@LabelIndex 101358
@StringIndex 0
class 0 damage_trap : default_trap {
parameter:
	int	show_created = 1;
	int	show_detected = 0;
	int	show_activated = 0;
	int	show_step_in = 0;
	int	show_step_out = 0;
	int	show_defused = 1;
	int	trap_skill = 458752001;
	int	trap_skill_type = 0;

handler:
	EventHandler TRAP_STEP_IN(i0,i1,c0) {
		c0 = gg::GetCreatureFromID(i0);
		if( myself.m_WorldTrapState == 1 ) {
			if( myself::DistFromMe(c0) < 300 ) {
				myself::SetWorldTrapVisibleByClassId(myself.sm.class_id,1);
				if( trap_skill_type == 0 ) {
					if( myself::Skill_GetConsumeMP(trap_skill) < myself.sm.mp && myself::Skill_GetConsumeHP(trap_skill) < myself.sm.hp && myself::Skill_InReuseDelay(trap_skill) == 0 ) {
						myself::AddUseSkillDesire(myself.sm,trap_skill,0,1,1000000);
					}
				} else if( myself::IsNullCreature(c0) == 0 ) {
					if( myself::Skill_GetConsumeMP(trap_skill) < myself.sm.mp && myself::Skill_GetConsumeHP(trap_skill) < myself.sm.hp && myself::Skill_InReuseDelay(trap_skill) == 0 ) {
						myself::AddUseSkillDesire(c0,trap_skill,0,0,1000000);
					}
				}
			}
		}
	}

	EventHandler USE_SKILL_FINISHED(skill_name_id,success) {
		if( skill_name_id == trap_skill ) {
			myself::DefuseWorldTrapByClassId(myself.sm.id,myself.sm.class_id);
		}
	}

}
