@LabelIndex 39292
@StringIndex 0
class 0 warrior_casting_ddmagic_physicalspecial : warrior {
parameter:
	int	W_LongRangeDDMagic = 272039937;
	int	PhysicalSpecialRange = 264241153;

handler:
	EventHandler ATTACKED(attacker,damage) {
		if( attacker.is_pc != 0 || myself::IsInCategory(12,attacker.class_id) ) {
			if( myself::IsNullCreature(myself.top_desire_target) == 0 ) {
				if( myself::DistFromMe(attacker) > 200 && myself.top_desire_target == attacker ) {
					if( myself::Skill_GetConsumeMP(W_LongRangeDDMagic) < myself.sm.mp && myself::Skill_GetConsumeHP(W_LongRangeDDMagic) < myself.sm.hp && myself::Skill_InReuseDelay(W_LongRangeDDMagic) == 0 ) {
						myself::AddUseSkillDesire(attacker,W_LongRangeDDMagic,0,1,1000000);
					}
				}
				if( gg::Rand(100) < 33 && myself.top_desire_target != attacker && myself::DistFromMe(attacker) < 200 ) {
					if( myself::Skill_GetConsumeMP(PhysicalSpecialRange) < myself.sm.mp && myself::Skill_GetConsumeHP(PhysicalSpecialRange) < myself.sm.hp && myself::Skill_InReuseDelay(PhysicalSpecialRange) == 0 ) {
						myself::AddUseSkillDesire(attacker,PhysicalSpecialRange,0,1,1000000);
					}
				}
			}
		}
		super;
	}

	EventHandler CLAN_ATTACKED(attacker,damage) {
		if( myself::GetLifeTime() > 7 && ( attacker.is_pc != 0 || myself::IsInCategory(12,attacker.class_id) ) ) {
			if( myself::IsNullCreature(myself.top_desire_target) == 0 ) {
				if( myself::DistFromMe(attacker) < 200 && gg::Rand(100) < 33 && myself.top_desire_target != attacker ) {
					if( myself::Skill_GetConsumeMP(PhysicalSpecialRange) < myself.sm.mp && myself::Skill_GetConsumeHP(PhysicalSpecialRange) < myself.sm.hp && myself::Skill_InReuseDelay(PhysicalSpecialRange) == 0 ) {
						myself::AddUseSkillDesire(attacker,PhysicalSpecialRange,0,1,1000000);
					}
				}
			}
		}
		super;
	}

	EventHandler USE_SKILL_FINISHED() {
		if( myself::IsNullCreature(myself.top_desire_target) == 0 ) {
			if( myself::DistFromMe(myself.top_desire_target) > 200 && myself.top_desire_target.is_pc == 1 ) {
				if( myself::Skill_GetConsumeMP(W_LongRangeDDMagic) < myself.sm.mp && myself::Skill_GetConsumeHP(W_LongRangeDDMagic) < myself.sm.hp && myself::Skill_InReuseDelay(W_LongRangeDDMagic) == 0 ) {
					myself::AddUseSkillDesire(myself.top_desire_target,W_LongRangeDDMagic,0,1,1000000);
				}
			}
		}
		super;
	}

}
