@LabelIndex 103017
@StringIndex 11985
class 0 npc_shhadai : citizen {
parameter:
	int	on_oasis = 20;
	int	PosX = 9032;
	int	PosY = 253063;
	int	PosZ = -1928;
	int	PosX_temp = 16882;
	int	PosY_temp = 238952;
	int	PosZ_temp = 9776;

handler:
	EventHandler CREATED(i0) {
		i0 = gg::GetL2Time(2);
		if( i0 ) {
			if( gg::Rand(100) < on_oasis ) {
				myself::InstantTeleport(myself.sm,PosX,PosY,PosZ);
				myself.i_ai3 = 1;
				myself.i_ai4 = 0;
			} else {
				myself::InstantTeleport(myself.sm,PosX_temp,PosY_temp,PosZ_temp);
				myself.i_ai3 = -1;
			}
		} else {
			myself::InstantTeleport(myself.sm,PosX_temp,PosY_temp,PosZ_temp);
			myself.i_ai3 = 0;
		}
		myself::AddTimerEx(5003,10000);
		super;
	}

	EventHandler TALKED(talker,ask,reply) {
		myself::ShowPage(talker,"shhadai001.htm");
	}

	EventHandler MENU_SELECTED(talker,ask,reply) {
		if( ask == -1006 ) {
			if( reply == 1 ) {
				myself::ShowPage(talker,"shhadai002.htm");
			}
		} else if( ask == -303 ) {
			if( reply == 617 || reply == 616 || reply == 624 || reply == 625 ) {
				myself::ShowMultisell(reply,talker);
			}
		}
	}

	EventHandler TIMER_FIRED_EX(timer_id,i0) {
		if( timer_id == 5003 ) {
			i0 = gg::GetL2Time(2);
			if( i0 ) {
				if( myself.i_ai3 == 1 ) {
					if( gg::Rand(100) > 50 ) {
						myself.i_ai4 = ( myself.i_ai4 + 1 );
					}
					if( myself.i_ai4 == 20 ) {
						myself::Shout(gg::MakeFString(1800137,"","","","",""));
						myself.i_ai4 = 0;
					}
				} else if( myself.i_ai3 == -1 ) {
				} else if( gg::Rand(100) < on_oasis ) {
					myself::InstantTeleport(myself.sm,PosX,PosY,PosZ);
					myself.i_ai3 = 1;
				} else {
					myself::InstantTeleport(myself.sm,PosX_temp,PosY_temp,PosZ_temp);
					myself.i_ai3 = -1;
				}
			} else if( myself.i_ai3 == 1 ) {
				myself::InstantTeleport(myself.sm,PosX_temp,PosY_temp,PosZ_temp);
				myself.i_ai3 = 0;
			} else if( myself.i_ai3 == -1 ) {
				myself.i_ai3 = 0;
			} else {
			}
			myself::AddTimerEx(5003,10000);
		}
		super;
	}

}
