@LabelIndex 104434
@StringIndex 0
class 0 party_leader_demonic_swordman_oracle : party_leader_warrior_oracle {
parameter:
	int	W_LongRangeDDMagic = 458752001;

handler:
	EventHandler ATTACKED(damage,attacker,party0,i0) {
		if( gg::Rand(100) < 3 ) {
			if( myself::Skill_GetConsumeMP(debuff) < myself.sm.mp && myself::Skill_GetConsumeHP(debuff) < myself.sm.hp && myself::Skill_InReuseDelay(debuff) == 0 ) {
				myself::AddUseSkillDesire(attacker,debuff,0,0,1000000);
			}
		}
		if( myself::DistFromMe(attacker) >= 100 ) {
			if( myself::Skill_GetConsumeMP(W_LongRangeDDMagic) < myself.sm.mp && myself::Skill_GetConsumeHP(W_LongRangeDDMagic) < myself.sm.hp ) {
				if( myself::Skill_InReuseDelay(W_LongRangeDDMagic) == 0 ) {
					myself::AddUseSkillDesire(attacker,W_LongRangeDDMagic,0,1,1000000);
				} else {
					myself::AddUseSkillDesire(attacker,W_LongRangeDDMagic,0,1,1000000);
				}
			} else {
				myself.i_ai0 = 1;
				myself::AddAttackDesire(attacker,1,1000);
			}
		}
		super;
	}

	EventHandler SEE_CREATURE(creature,party0) {
		myself.i_ai1 = myself::GetTick();
		party0 = gg::GetParty(creature);
		if( myself::IsNullParty(party0) == 0 ) {
			if( gg::Rand(100) < 50 ) {
				if( myself::Skill_GetConsumeMP(W_LongRangeDDMagic) < myself.sm.mp && myself::Skill_GetConsumeHP(W_LongRangeDDMagic) < myself.sm.hp ) {
					if( myself::Skill_InReuseDelay(W_LongRangeDDMagic) == 0 ) {
						myself::AddUseSkillDesire(creature,W_LongRangeDDMagic,0,1,1000000);
					} else {
						myself::AddUseSkillDesire(creature,W_LongRangeDDMagic,0,1,1000000);
					}
				} else {
					myself.i_ai0 = 1;
					myself::AddAttackDesire(creature,1,1000);
				}
				if( creature.is_pc == 0 && myself::IsInCategory(12,creature.class_id) == 0 ) {
					return;
				}
				if( SeeCreatureAttackerTime == -1 ) {
					if( SetAggressiveTime == -1 ) {
						if( myself::GetLifeTime() >= ( gg::Rand(5) + 3 ) && myself::InMyTerritory(myself.sm) ) {
							myself::AddAttackDesire(creature,1,200);
						}
					} else if( SetAggressiveTime == 0 ) {
						if( myself::InMyTerritory(myself.sm) ) {
							myself::AddAttackDesire(creature,1,200);
						}
					} else if( myself::GetLifeTime() > ( SetAggressiveTime + gg::Rand(4) ) && myself::InMyTerritory(myself.sm) ) {
						myself::AddAttackDesire(creature,1,200);
					}
				} else if( myself::GetLifeTime() > SeeCreatureAttackerTime && myself::InMyTerritory(myself.sm) ) {
					myself::AddAttackDesire(creature,1,200);
				}
			}
		} else if( gg::Rand(100) < 20 ) {
			if( myself::Skill_GetConsumeMP(W_LongRangeDDMagic) < myself.sm.mp && myself::Skill_GetConsumeHP(W_LongRangeDDMagic) < myself.sm.hp ) {
				if( myself::Skill_InReuseDelay(W_LongRangeDDMagic) == 0 ) {
					myself::AddUseSkillDesire(creature,W_LongRangeDDMagic,0,1,1000000);
				} else {
					myself::AddUseSkillDesire(creature,W_LongRangeDDMagic,0,1,1000000);
				}
			} else {
				myself.i_ai0 = 1;
				myself::AddAttackDesire(creature,1,1000);
			}
			if( creature.is_pc == 0 && myself::IsInCategory(12,creature.class_id) == 0 ) {
				return;
			}
			if( SeeCreatureAttackerTime == -1 ) {
				if( SetAggressiveTime == -1 ) {
					if( myself::GetLifeTime() >= ( gg::Rand(5) + 3 ) && myself::InMyTerritory(myself.sm) ) {
						myself::AddAttackDesire(creature,1,200);
					}
				} else if( SetAggressiveTime == 0 ) {
					if( myself::InMyTerritory(myself.sm) ) {
						myself::AddAttackDesire(creature,1,200);
					}
				} else if( myself::GetLifeTime() > ( SetAggressiveTime + gg::Rand(4) ) && myself::InMyTerritory(myself.sm) ) {
					myself::AddAttackDesire(creature,1,200);
				}
			} else if( myself::GetLifeTime() > SeeCreatureAttackerTime && myself::InMyTerritory(myself.sm) ) {
				myself::AddAttackDesire(creature,1,200);
			}
		}
	}

	EventHandler MY_DYING(c0,c1,party0,i1,i2) {
		if( myself.sm.class_id == 1022261 ) {
			if( gg::Rand(10000) <= 1171 ) {
				myself::DropItem1(myself.sm,9594,1);
			}
		} else if( myself.sm.class_id == 1022265 ) {
			if( gg::Rand(10000) <= 575 ) {
				myself::DropItem1(myself.sm,9596,1);
			}
		}
	}

}
