@LabelIndex 38232
@StringIndex 6654
class 0 royal_rush_strong_man_1 : warrior {
parameter:
	int	PhysicalSpecial1 = 264241153;
	int	SelfRangeDDMagic1 = 264241153;
	int	SelfBuff = 264241153;

handler:
	EventHandler CREATED() {
		myself::LookNeighbor(300);
		if( myself::Skill_GetConsumeMP(SelfBuff) < myself.sm.mp && myself::Skill_GetConsumeHP(SelfBuff) < myself.sm.hp && myself::Skill_InReuseDelay(SelfBuff) == 0 ) {
			myself::AddUseSkillDesire(myself.sm,SelfBuff,1,1,1000000);
		}
		myself::AddTimerEx(6001,( 60 * 1000 ));
		super;
	}

	EventHandler SEE_CREATURE(creature) {
		if( creature.is_pc == 0 && myself::IsInCategory(12,creature.class_id) == 0 ) {
			super;
			return;
		}
		if( myself::GetLifeTime() > 7 && myself::InMyTerritory(myself.sm) && myself.p_state == 3 ) {
			if( myself::IsNullCreature(myself.top_desire_target) == 0 ) {
				if( gg::Rand(100) < 33 && myself.top_desire_target == creature ) {
					if( myself::Skill_GetConsumeMP(PhysicalSpecial1) < myself.sm.mp && myself::Skill_GetConsumeHP(PhysicalSpecial1) < myself.sm.hp && myself::Skill_InReuseDelay(PhysicalSpecial1) == 0 ) {
						myself::AddUseSkillDesire(creature,PhysicalSpecial1,0,1,1000000);
					}
				}
			}
		}
		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);
		}
		super;
	}

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

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

	EventHandler TIMER_FIRED_EX(timer_id) {
		if( timer_id == 6001 ) {
			if( gg::GetDateTime(0,4) >= 55 ) {
				myself::Despawn();
			}
			myself::AddTimerEx(6001,( 60 * 1000 ));
		}
		super;
	}

	EventHandler MY_DYING() {
		myself::CreateOnePrivateEx(1031455,"royal_rush_keybox",0,0,gg::FloatToInt(myself.sm.x),gg::FloatToInt(myself.sm.y),gg::FloatToInt(myself.sm.z),0,0,0,0);
		super;
	}

}
