@LabelIndex 103470
@StringIndex 12063
class 0 npc_ghost_tolles : default_npc {
parameter:
	int	mode = 0;
	string	fnHi = "ghost_tolles001.htm";
	string	fnHi2 = "ghost_tolles002.htm";
	string	fnHi3 = "ghost_tolles003.htm";
	int	f6_x = -12176;
	int	f6_y = 279696;
	int	f6_z = -13596;

handler:
	EventHandler CREATED() {
		if( mode == 2 ) {
			if( myself::GetGlobalMap(16) == -1 || myself::GetGlobalMap(16) == 0 ) {
				myself::AddTimerEx(78002,( ( 5 * 60 ) * 1000 ));
			} else {
				myself::Despawn();
			}
		} else if( mode != 3 ) {
			myself::AddTimerEx(78001,( ( 15 * 60 ) * 1000 ));
		}
	}

	EventHandler TALKED(talker,ask,reply) {
		if( mode == 1 ) {
			myself::Say(gg::MakeFString(1800135,"","","","",""));
			myself::Despawn();
		} else if( mode == 2 ) {
			myself::ShowPage(talker,fnHi);
		} else if( mode == 3 ) {
			myself::ShowPage(talker,fnHi3);
		} else {
			myself::ShowPage(talker,fnHi2);
		}
		super;
	}

	EventHandler MENU_SELECTED(talker,ask,reply,party0) {
		if( ask == -7801 ) {
			if( reply == 1 ) {
				party0 = gg::GetParty(talker);
				if( myself::IsNullParty(party0) == 0 ) {
					myself::TeleportParty(party0.id,f6_x,f6_y,f6_z,6000,0);
				} else {
					myself::InstantTeleport(talker,f6_x,f6_y,f6_z);
				}
			}
		}
		super;
	}

	EventHandler TIMER_FIRED_EX(timer_id) {
		if( timer_id == 78001 ) {
			myself::Despawn();
		} else if( timer_id == 78002 ) {
			if( myself::GetGlobalMap(16) == -1 || myself::GetGlobalMap(16) == 0 ) {
				myself::AddTimerEx(78002,( ( 5 * 60 ) * 1000 ));
			} else {
				myself::Despawn();
			}
		}
	}

}
