@LabelIndex 399652
@StringIndex 59803
class 0 soldier_tenis : citizen {
handler:
	EventHandler TALK_SELECTED(fhtml0,talker) {
		if( _from_choice == 0 ) {
			if( gg::HaveMemo(talker,702) == 1 && gg::GetMemoState(talker,702) == 1 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"A Trap for Revenge (in progress)");
			}
			if( gg::HaveMemo(talker,702) == 1 && gg::GetMemoState(talker,702) == 2 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 1;
				myself::AddChoice(1,"A Trap for Revenge (in progress)");
			}
			if( _choiceN > 1 ) {
				myself::ShowChoicePage(talker,1);
				return;
			}
		}
		if( _from_choice || _choiceN == 1 ) {
			switch(_code) {
				case 0: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,702) == 1 && gg::GetMemoState(talker,702) == 1 ) ) {
						myself::SetCurrentQuestID(702);
						if( myself::GetInventoryInfo(talker,0) >= ( myself::GetInventoryInfo(talker,1) * 0.800000 ) || myself::GetInventoryInfo(talker,2) >= ( myself::GetInventoryInfo(talker,3) * 0.800000 ) ) {
							myself::ShowSystemMessage(talker,1118);
							return;
						}
						myself::ShowPage(talker,"soldier_tenis_q0702_01.htm");
					}
					break;
				}
				case 1: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,702) == 1 && gg::GetMemoState(talker,702) == 2 ) ) {
						myself::SetCurrentQuestID(702);
						if( myself::GetInventoryInfo(talker,0) >= ( myself::GetInventoryInfo(talker,1) * 0.800000 ) || myself::GetInventoryInfo(talker,2) >= ( myself::GetInventoryInfo(talker,3) * 0.800000 ) ) {
							myself::ShowSystemMessage(talker,1118);
							return;
						}
						myself::ShowPage(talker,"soldier_tenis_q0702_04.htm");
					}
					break;
				}
			}
			return;
		}
		super;
	}

	EventHandler MENU_SELECTED(ask,i0,i1,reply,talker) {
		if( ask == 702 ) {
			myself::SetCurrentQuestID(702);
			if( myself::GetInventoryInfo(talker,0) >= ( myself::GetInventoryInfo(talker,1) * 0.800000 ) || myself::GetInventoryInfo(talker,2) >= ( myself::GetInventoryInfo(talker,3) * 0.800000 ) ) {
				myself::ShowSystemMessage(talker,1118);
				return;
			}
		}
		if( ask == 702 ) {
			if( reply == 1 ) {
				if( gg::HaveMemo(talker,702) == 1 && gg::GetMemoState(talker,702) == 1 ) {
					myself::ShowPage(talker,"soldier_tenis_q0702_02.htm");
				}
			}
			if( reply == 2 ) {
				if( gg::HaveMemo(talker,702) == 1 && gg::GetMemoState(talker,702) == 1 ) {
					myself::SetMemoState(talker,702,2);
					myself::ShowPage(talker,"soldier_tenis_q0702_03.htm");
					myself::SetFlagJournal(talker,702,2);
					myself::ShowQuestMark(talker,702);
					myself::SoundEffect(talker,"ItemSound.quest_middle");
				}
			}
			if( reply == 10 ) {
				if( gg::HaveMemo(talker,702) == 1 && gg::GetMemoState(talker,702) == 2 ) {
					myself::RemoveMemo(talker,702);
					myself::SoundEffect(talker,"ItemSound.quest_finish");
					gg::AddLog(2,talker,702);
					myself::ShowPage(talker,"soldier_tenis_q0702_05.htm");
				}
			}
			if( reply == 20 ) {
				if( gg::HaveMemo(talker,702) == 1 && gg::GetMemoState(talker,702) == 2 && gg::OwnItemCount(talker,13877) < 100 ) {
					myself::ShowPage(talker,"soldier_tenis_q0702_06.htm");
				} else if( gg::HaveMemo(talker,702) == 1 && gg::GetMemoState(talker,702) == 2 && gg::OwnItemCount(talker,13877) >= 100 ) {
					myself::ShowPage(talker,"soldier_tenis_q0702_07.htm");
				}
			}
			if( reply == 21 ) {
				if( gg::HaveMemo(talker,702) == 1 && gg::GetMemoState(talker,702) == 2 && gg::OwnItemCount(talker,13877) >= 100 ) {
					myself::GiveItem1(talker,13878,1);
					myself::DeleteItem1(talker,13877,100);
					myself::ShowPage(talker,"soldier_tenis_q0702_08.htm");
				}
			}
			if( reply == 22 ) {
				if( gg::HaveMemo(talker,702) == 1 && gg::GetMemoState(talker,702) == 2 && gg::OwnItemCount(talker,13877) >= 100 ) {
					myself::ShowPage(talker,"soldier_tenis_q0702_09.htm");
				}
			}
			if( reply == 30 ) {
				if( gg::HaveMemo(talker,702) == 1 && gg::GetMemoState(talker,702) == 2 && gg::OwnItemCount(talker,13880) < 1 ) {
					myself::ShowPage(talker,"soldier_tenis_q0702_10.htm");
				} else if( gg::HaveMemo(talker,702) == 1 && gg::GetMemoState(talker,702) == 2 && gg::OwnItemCount(talker,13880) >= 1 ) {
					myself::ShowPage(talker,"soldier_tenis_q0702_11.htm");
				}
			}
			if( reply == 31 ) {
				if( gg::HaveMemo(talker,702) == 1 && gg::GetMemoState(talker,702) == 2 && gg::OwnItemCount(talker,13880) >= 1 ) {
					myself::ShowPage(talker,"soldier_tenis_q0702_12.htm");
				}
			}
			if( reply == 32 ) {
				if( gg::HaveMemo(talker,702) == 1 && gg::GetMemoState(talker,702) == 2 && gg::OwnItemCount(talker,13880) >= 1 ) {
					myself::ShowPage(talker,"soldier_tenis_q0702_13.htm");
				}
			}
			if( reply == 40 ) {
				if( gg::HaveMemo(talker,702) == 1 && gg::GetMemoState(talker,702) == 2 && gg::OwnItemCount(talker,13880) >= 1 ) {
					myself::ShowPage(talker,"soldier_tenis_q0702_14.htm");
				}
			}
			if( reply == 41 ) {
				if( gg::HaveMemo(talker,702) == 1 && gg::GetMemoState(talker,702) == 2 && gg::OwnItemCount(talker,13880) >= 1 ) {
					i0 = gg::Rand(1000);
					i1 = gg::Rand(1000);
					if( i0 >= 500 && i1 >= 600 ) {
						myself::GiveItem1(talker,57,( gg::Rand(49917) + 125000 ));
						if( i1 < 720 ) {
							myself::GiveItem1(talker,9628,( gg::Rand(3) + 1 ));
							myself::GiveItem1(talker,9629,( gg::Rand(3) + 1 ));
						} else if( i1 < 840 ) {
							myself::GiveItem1(talker,9629,( gg::Rand(3) + 1 ));
							myself::GiveItem1(talker,9630,( gg::Rand(3) + 1 ));
						} else if( i1 < 960 ) {
							myself::GiveItem1(talker,9628,( gg::Rand(3) + 1 ));
							myself::GiveItem1(talker,9630,( gg::Rand(3) + 1 ));
						} else if( i1 < 1000 ) {
							myself::GiveItem1(talker,9628,( gg::Rand(3) + 1 ));
							myself::GiveItem1(talker,9629,( gg::Rand(3) + 1 ));
							myself::GiveItem1(talker,9630,( gg::Rand(3) + 1 ));
						}
						myself::ShowPage(talker,"soldier_tenis_q0702_15.htm");
					} else if( i0 >= 500 && i1 < 600 ) {
						myself::GiveItem1(talker,57,( gg::Rand(49917) + 125000 ));
						if( i1 < 210 ) {
						} else if( i1 < 340 ) {
							myself::GiveItem1(talker,9628,( gg::Rand(3) + 1 ));
						} else if( i1 < 470 ) {
							myself::GiveItem1(talker,9629,( gg::Rand(3) + 1 ));
						} else if( i1 < 600 ) {
							myself::GiveItem1(talker,9630,( gg::Rand(3) + 1 ));
						}
						myself::ShowPage(talker,"soldier_tenis_q0702_16.htm");
					} else if( i0 < 500 && i1 >= 600 ) {
						myself::GiveItem1(talker,57,( gg::Rand(49917) + 25000 ));
						if( i1 < 720 ) {
							myself::GiveItem1(talker,9628,( gg::Rand(3) + 1 ));
							myself::GiveItem1(talker,9629,( gg::Rand(3) + 1 ));
						} else if( i1 < 840 ) {
							myself::GiveItem1(talker,9629,( gg::Rand(3) + 1 ));
							myself::GiveItem1(talker,9630,( gg::Rand(3) + 1 ));
						} else if( i1 < 960 ) {
							myself::GiveItem1(talker,9628,( gg::Rand(3) + 1 ));
							myself::GiveItem1(talker,9630,( gg::Rand(3) + 1 ));
						} else if( i1 < 1000 ) {
							myself::GiveItem1(talker,9628,( gg::Rand(3) + 1 ));
							myself::GiveItem1(talker,9629,( gg::Rand(3) + 1 ));
							myself::GiveItem1(talker,9630,( gg::Rand(3) + 1 ));
						}
						myself::ShowPage(talker,"soldier_tenis_q0702_17.htm");
					} else if( i0 < 500 && i1 < 600 ) {
						myself::GiveItem1(talker,57,( gg::Rand(49917) + 25000 ));
						if( i1 < 210 ) {
						} else if( i1 < 340 ) {
							myself::GiveItem1(talker,9628,( gg::Rand(3) + 1 ));
						} else if( i1 < 470 ) {
							myself::GiveItem1(talker,9629,( gg::Rand(3) + 1 ));
						} else if( i1 < 600 ) {
							myself::GiveItem1(talker,9630,( gg::Rand(3) + 1 ));
						}
						myself::ShowPage(talker,"soldier_tenis_q0702_18.htm");
					}
					myself::DeleteItem1(talker,13880,1);
					gg::AddLog(3,talker,702);
				}
			}
		}
		super;
	}

}
