@LabelIndex 53879
@StringIndex 0
class 0 warrior_physicalspecial_shot_range : warrior {
parameter:
	int	LongRangePhysicalSpecial = 458752001;
	int	PhysicalSpecial = 458752001;
	int	SelfRangePhysicalSpecial = 458752001;

handler:
	EventHandler CREATED() {
		myself.i_ai1 = 0;
		myself.i_ai3 = 0;
		super;
	}

	EventHandler ATTACKED(attacker,damage) {
		myself.i_ai3 = gg::GetIndexFromCreature(attacker);
		if( myself::DistFromMe(attacker) > 200 ) {
			if( myself::Skill_GetConsumeMP(LongRangePhysicalSpecial) < myself.sm.mp && myself::Skill_GetConsumeHP(LongRangePhysicalSpecial) < myself.sm.hp && myself::Skill_InReuseDelay(LongRangePhysicalSpecial) == 0 ) {
				myself::AddUseSkillDesire(attacker,LongRangePhysicalSpecial,0,1,1000000);
			}
		}
		if( gg::Rand(100) < 33 ) {
			if( myself::Skill_GetConsumeMP(PhysicalSpecial) < myself.sm.mp && myself::Skill_GetConsumeHP(PhysicalSpecial) < myself.sm.hp && myself::Skill_InReuseDelay(PhysicalSpecial) == 0 ) {
				myself::AddUseSkillDesire(attacker,PhysicalSpecial,0,1,1000000);
			}
		}
		if( gg::Rand(100) < 33 ) {
			if( myself::Skill_GetConsumeMP(SelfRangePhysicalSpecial) < myself.sm.mp && myself::Skill_GetConsumeHP(SelfRangePhysicalSpecial) < myself.sm.hp && myself::Skill_InReuseDelay(SelfRangePhysicalSpecial) == 0 ) {
				myself::AddUseSkillDesire(attacker,SelfRangePhysicalSpecial,0,1,1000000);
			}
		}
		super;
	}

	EventHandler TIMER_FIRED_EX(timer_id,c0) {
		if( timer_id == 1002 ) {
			c0 = gg::GetCreatureFromIndex(myself.i_ai3);
			if( myself::IsNullCreature(c0) == 0 ) {
				if( myself::DistFromMe(c0) > 200 ) {
					if( myself::Skill_GetConsumeMP(LongRangePhysicalSpecial) < myself.sm.mp && myself::Skill_GetConsumeHP(LongRangePhysicalSpecial) < myself.sm.hp && myself::Skill_InReuseDelay(LongRangePhysicalSpecial) == 0 ) {
						myself::AddUseSkillDesire(c0,LongRangePhysicalSpecial,0,1,1000000);
					}
				}
			} else {
				myself.i_ai3 = 0;
			}
			myself::AddTimerEx(1002,5000);
		}
	}

}
