@LabelIndex 135684
@StringIndex 17328
class 0 ai_destruct_basic_ret : default_npc {
parameter:
	int	Breath = 458752001;
	int	Breath_Prob = 0;
	int	Buff = 458752001;
	string	SuperPointName1 = "defence_left";
	string	SuperPointName2 = "defence_right";
	string	SuperPointName3 = "invasion_left";
	string	SuperPointName4 = "invasion_center";
	string	SuperPointName5 = "invasion_right";
	int	SearchType = 0;

handler:
	EventHandler CREATED() {
		myself.c_ai1 = gg::GetNullCreature();
		myself.c_ai2 = gg::GetNullCreature();
		if( myself.sm.param1 == 1224010 ) {
			if( myself.sm.param2 == 0 && myself.sm.param3 == 0 ) {
				myself::AddMoveAroundDesire(5,5);
			} else if( myself.sm.param2 == 1224015 ) {
				if( myself.sm.param3 == 1224016 ) {
					myself::AddMoveSuperPointDesire(SuperPointName1,SearchType,10000);
				} else if( myself.sm.param3 == 1224017 ) {
					myself::AddMoveSuperPointDesire(SuperPointName2,SearchType,10000);
				} else if( myself.sm.param3 == 1224018 ) {
					myself::AddMoveSuperPointDesire(SuperPointName3,SearchType,10000);
				} else if( myself.sm.param3 == 1224019 ) {
					myself::AddMoveSuperPointDesire(SuperPointName4,SearchType,10000);
				} else if( myself.sm.param3 == 1224020 ) {
					myself::AddMoveSuperPointDesire(SuperPointName5,SearchType,10000);
				}
			} else {
				myself::AddMoveToDesire(myself.sm.param2,myself.sm.param3,gg::FloatToInt(myself.sm.z),50);
			}
		} else if( myself.sm.param1 == 1224011 ) {
			myself::Shout(gg::MakeFString(1800296,"","","","",""));
			if( myself.sm.param3 == 1224016 ) {
				myself::AddMoveSuperPointDesire(SuperPointName1,SearchType,10000);
			} else if( myself.sm.param3 == 1224017 ) {
				myself::AddMoveSuperPointDesire(SuperPointName2,SearchType,10000);
			}
		}
	}

	EventHandler NODE_ARRIVED(script_event_arg1,script_event_arg2,script_event_arg3) {
		if( script_event_arg1 == 20 ) {
			myself::RemoveAllDesire();
		}
	}

	EventHandler NO_DESIRE() {
	}

	EventHandler ATTACKED(attacker,damage) {
		if( Breath != 458752001 ) {
			if( gg::Rand(10000) < Breath_Prob ) {
				if( myself::Skill_GetConsumeMP(Breath) < myself.sm.mp && myself::Skill_GetConsumeHP(Breath) < myself.sm.hp && myself::Skill_InReuseDelay(Breath) == 0 ) {
					myself::AddUseSkillDesire(attacker,Breath,0,1,1000000);
				}
			}
		}
	}

	EventHandler DESIRE_MANIPULATION(speller,desire) {
		myself::MakeAttackEvent(speller,( desire * 2.000000 ),0);
	}

	EventHandler SCRIPT_EVENT(script_event_arg1,script_event_arg2,script_event_arg3,i0,c0,c1,party0) {
		if( script_event_arg1 == 1224006 ) {
			if( script_event_arg2 != 0 ) {
				if( myself::IsNullCreature(myself.c_ai2) == 1 ) {
					myself::RemoveAllDesire();
				}
				myself.c_ai2 = gg::GetCreatureFromIndex(script_event_arg2);
				if( myself::IsNullCreature(myself.c_ai2) == 0 ) {
					myself::MakeAttackEvent(myself.c_ai2,1000,0);
				}
			}
		}
		if( script_event_arg1 == 1224009 || script_event_arg1 == 1224014 || script_event_arg1 == 1224013 ) {
			myself::Despawn();
		}
	}

}
