@LabelIndex 139839
@StringIndex 0
class 0 ai_gludio_feud_hold : warrior_basic {
parameter:
	int	out_of_territory_use = 1;
	int	comeback_timer = 5;

handler:
	EventHandler SEE_CREATURE(creature) {
		if( myself::Castle_GetPledgeState(creature) == 2 || ( myself::IsNullCreature(creature.master) == 0 && myself::Castle_GetPledgeState(creature.master) == 2 ) ) {
			return;
		}
		super;
	}

	EventHandler OUT_OF_TERRITORY() {
		if( out_of_territory_use == 0 ) {
			return;
		}
		if( comeback_timer > 0 ) {
			myself::AddTimerEx(3079,( comeback_timer * 1000 ));
		} else if( myself::InMyTerritory(myself.sm) != 1 ) {
			myself::RemoveAllAttackDesire();
			myself::AddMoveToDesire(myself.start_x,myself.start_y,myself.start_z,1000000);
			return;
		}
	}

	EventHandler TIMER_FIRED_EX(timer_id) {
		if( timer_id == 3079 ) {
			if( out_of_territory_use == 0 ) {
				return;
			}
			if( myself::InMyTerritory(myself.sm) != 1 ) {
				myself::RemoveAllAttackDesire();
				myself::AddMoveToDesire(myself.start_x,myself.start_y,myself.start_z,1000000);
				return;
			}
		}
	}

}
