@LabelIndex 101881
@StringIndex 11780
class 0 npc_incastle_native : default_npc {
parameter:
	int	FieldCycle = 1;
	int	FieldCycle_Condition = 104;
	int	FieldCycle_Quantity = 10;
	int	Threshold_Level_Min = 9;
	int	Threshold_Level_Max = 9;
	int	Threshold_Point_Min = -1;
	int	Threshold_Point_Max = 1000000000;

handler:
	EventHandler CREATED() {
		super;
	}

	EventHandler TALKED(talker,ask,reply,i0) {
		i0 = gg::GetStep_FieldCycle(FieldCycle);
		if( i0 < Threshold_Level_Min ) {
			myself::ShowPage(talker,"incastle_native001a.htm");
		} else if( i0 >= Threshold_Level_Min && i0 <= Threshold_Level_Max ) {
			myself::ShowPage(talker,"incastle_native001.htm");
		} else {
			myself::ShowPage(talker,"incastle_native001b.htm");
		}
	}

	EventHandler MENU_SELECTED(talker,ask,reply,i0,i1) {
		i0 = gg::GetStep_FieldCycle(FieldCycle);
		if( ask == -1006 ) {
			if( reply == 1 ) {
				i1 = gg::OwnItemCount(talker,9674);
				if( i1 >= 5 ) {
					gg::AddPoint_FieldCycle(1,( 5 * 20 ),4,talker);
					myself::DeleteItem1(talker,9674,5);
					myself::ShowPage(talker,"incastle_native002.htm");
					myself::AddTimerEx(1000,3000);
				} else {
					myself::ShowPage(talker,"incastle_native002a.htm");
				}
			}
		}
	}

	EventHandler TIMER_FIRED_EX(timer_id) {
		if( timer_id == 1000 ) {
			myself::Despawn();
		}
	}

}
