@LabelIndex 115313
@StringIndex 14198
class 0 pailaka_pet_ai : (null) {
parameter:
	int	DDMagic = 377552897;
	int	DDMagic2 = 377552898;
	int	step_action_id = 1071;

handler:
	EventHandler CREATED() {
		myself::AddPetDefaultDesire_Follow(20.000000);
		myself::AddTimerEx(1000,1000);
	}

	EventHandler NO_DESIRE() {
		myself::AddPetDefaultDesire_Follow(20.000000);
	}

	EventHandler MENU_SELECTED(ask,reply,action_id,i0,c0) {
		if( DDMagic == 0 ) {
			return;
		}
		i0 = myself.master.target_index;
		if( i0 <= 0 ) {
			return;
		}
		c0 = gg::GetCreatureFromIndex(i0);
		if( myself::IsNullCreature(c0) == 0 ) {
			if( action_id == step_action_id ) {
				myself::RemoveAllAttackDesire();
				if( gg::IsSameString(myself.sm.name,"pailaka_summon_01") == 1 ) {
					myself::AddUseSkillDesireEx(myself.master.target_id,DDMagic,0,reply,ask,1000000,0);
				} else {
					myself::AddUseSkillDesireEx(myself.master.target_id,DDMagic2,0,reply,ask,1000000,0);
				}
				myself::AddAttackDesireEx(myself.master.target_id,1,0,50000);
			}
		}
	}

	EventHandler TIMER_FIRED_EX(timer_id) {
		if( timer_id == 1000 ) {
			if( myself.sm.instant_zone_id == 0 ) {
				myself::Despawn();
			} else {
			}
		}
		myself::AddTimerEx(1000,2000);
	}

	EventHandler MY_DYING(i0,maker0,attacker) {
		if( myself::IsNullCreature(attacker) == 0 ) {
			myself::BroadcastScriptEvent(2316003,gg::GetIndexFromCreature(attacker),2000);
		}
	}

}
