@LabelIndex 139879
@StringIndex 0
class 0 ai_guard_of_airharbor1 : citizen {
parameter:
	string	fnHi = "guard_of_airharbor2001.htm";
	string	fnFignting = "guard_of_airharbor2002.htm";
	string	SuperPointName = "gludio_airport1";
	int	SearchType = 0;
	int	Enemy = 1018782;

handler:
	EventHandler CREATED() {
		myself::ChangeMoveType(0);
		myself::LookNeighbor(1000);
		myself::AddMoveSuperPointDesire(SuperPointName,SearchType,2000);
	}

	EventHandler NODE_ARRIVED(script_event_arg1,script_event_arg2) {
		myself::LookNeighbor(1000);
		myself::ChangeMoveType(0);
		myself::AddMoveSuperPointDesire(SuperPointName,SearchType,50);
	}

	EventHandler SEE_CREATURE(creature) {
		if( creature.is_pc == 0 && creature.class_id == Enemy ) {
			myself::AddAttackDesire(creature,1,500000);
			myself::AddTimerEx(1525001,1000);
			myself.i_ai0 = creature.id;
			myself.i_ai1 = 1;
		}
		super;
	}

	EventHandler SCRIPT_EVENT(script_event_arg1,script_event_arg2,c0) {
		if( script_event_arg1 == 1000 ) {
			c0 = gg::GetCreatureFromIndex(script_event_arg2);
			if( myself::IsNullCreature(c0) == 0 ) {
				myself::AddAttackDesire(c0,1,500000);
				myself::AddTimerEx(1525001,1000);
				myself.i_ai0 = c0.id;
				myself.i_ai1 = 1;
			}
		}
	}

	EventHandler TIMER_FIRED_EX(timer_id,c0) {
		if( timer_id == 1525001 ) {
			c0 = gg::GetCreatureFromID(myself.i_ai0);
			if( myself::IsNullCreature(c0) == 0 ) {
				if( c0.alive == 0 ) {
					myself::RemoveAllDesire();
					myself::ChangeMoveType(0);
					myself::AddMoveSuperPointDesire(SuperPointName,SearchType,2000);
					myself.i_ai1 = 0;
					return;
				}
				myself::AddTimerEx(1525001,5000);
			}
		}
	}

	EventHandler TALKED(talker) {
		if( NoFnHi == 1 ) {
			return;
		}
		if( myself.i_ai1 ) {
			myself::ShowPage(talker,fnFignting);
		} else {
			myself::ShowPage(talker,fnHi);
		}
	}

}
