@LabelIndex 379014
@StringIndex 55669
class 0 warehouse_chief_yaseni : master_lv3_ware {
handler:
	EventHandler TALK_SELECTED(fhtml0,i0,talker) {
		if( _from_choice == 0 ) {
			if( gg::HaveMemo(talker,417) == 1 && gg::OwnItemCount(talker,8543) > 0 && gg::OwnItemCount(talker,1657) == 0 && gg::GetMemoState(talker,417) == 2 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"Path of the Scavenger (In Progress)");
			}
			if( gg::HaveMemo(talker,714) == 1 && gg::GetMemoState(talker,714) == 5 && myself::IsMyLord(talker) == 1 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 1;
				myself::AddChoice(1,"Path to Becoming a Lord - Schuttgart (in progress)");
			}
			if( gg::HaveMemo(talker,714) == 1 && gg::GetMemoState(talker,714) == 6 && myself::IsMyLord(talker) == 1 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 2;
				myself::AddChoice(2,"Path to Becoming a Lord - Schuttgart (in progress)");
			}
			if( gg::HaveMemo(talker,714) == 1 && gg::GetMemoState(talker,714) == 7 && myself::IsMyLord(talker) == 1 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 3;
				myself::AddChoice(3,"Path to Becoming a Lord - Schuttgart (in progress)");
			}
			if( gg::HaveMemo(talker,714) == 1 && gg::GetMemoState(talker,714) == 8 && myself::IsMyLord(talker) == 1 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 4;
				myself::AddChoice(4,"Path to Becoming a Lord - Schuttgart (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,417) == 1 && gg::OwnItemCount(talker,8543) > 0 && gg::OwnItemCount(talker,1657) == 0 && gg::GetMemoState(talker,417) == 2 ) ) {
						myself::SetCurrentQuestID(417);
						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,"warehouse_chief_yaseni_q0417_01.htm");
					}
					break;
				}
				case 1: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,714) == 1 && gg::GetMemoState(talker,714) == 5 && myself::IsMyLord(talker) == 1 ) ) {
						myself::SetCurrentQuestID(714);
						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,"warehouse_chief_yaseni_q0714_01.htm");
					}
					break;
				}
				case 2: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,714) == 1 && gg::GetMemoState(talker,714) == 6 && myself::IsMyLord(talker) == 1 ) ) {
						myself::SetCurrentQuestID(714);
						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,"warehouse_chief_yaseni_q0714_03.htm");
					}
					break;
				}
				case 3: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,714) == 1 && gg::GetMemoState(talker,714) == 7 && myself::IsMyLord(talker) == 1 ) ) {
						myself::SetCurrentQuestID(714);
						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::SetMemoState(talker,714,8);
						myself::ShowPage(talker,"warehouse_chief_yaseni_q0714_04.htm");
						myself::SetFlagJournal(talker,714,7);
						myself::ShowQuestMark(talker,714);
						myself::SoundEffect(talker,"ItemSound.quest_middle");
					}
					break;
				}
				case 4: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,714) == 1 && gg::GetMemoState(talker,714) == 8 && myself::IsMyLord(talker) == 1 ) ) {
						myself::SetCurrentQuestID(714);
						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,"warehouse_chief_yaseni_q0714_05.htm");
					}
					break;
				}
			}
			return;
		}
		super;
	}

	EventHandler MENU_SELECTED(ask,reply,talker) {
		if( ask == 417 ) {
			myself::SetCurrentQuestID(417);
			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 == 417 ) {
			if( reply == 1 && gg::HaveMemo(talker,417) == 1 && gg::GetMemoState(talker,417) == 2 && gg::OwnItemCount(talker,8543) > 0 ) {
				myself::ShowPage(talker,"warehouse_chief_yaseni_q0417_02.htm");
				myself::GiveItem1(talker,1642,1);
				if( myself::GetOneTimeQuestFlag(talker,145) == 0 ) {
					myself::SetOneTimeQuestFlag(talker,145,1);
					if( talker.level >= 20 ) {
						myself::IncrementParam(talker,0,160267);
						myself::IncrementParam(talker,1,17706);
						myself::GiveItem1(talker,57,81900);
					} else if( talker.level >= 19 ) {
						myself::IncrementParam(talker,0,228064);
						myself::IncrementParam(talker,1,21055);
						myself::GiveItem1(talker,57,81900);
					} else {
						myself::IncrementParam(talker,0,295862);
						myself::IncrementParam(talker,1,24404);
						myself::GiveItem1(talker,57,81900);
					}
				}
				myself::DeleteItem1(talker,8543,gg::OwnItemCount(talker,8543));
				gg::AddLog(2,talker,417);
				myself::RemoveMemo(talker,417);
				myself::SoundEffect(talker,"ItemSound.quest_finish");
				gg::AddPCSocial(gg::GetIndexFromCreature(talker),3);
			}
		}
		if( ask == 714 ) {
			myself::SetCurrentQuestID(714);
			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 == 714 ) {
			if( reply == 1 ) {
				if( gg::HaveMemo(talker,714) == 1 && gg::GetMemoState(talker,714) == 5 && myself::IsMyLord(talker) == 1 ) {
					myself::SetMemoState(talker,714,6);
					myself::ShowPage(talker,"warehouse_chief_yaseni_q0714_02.htm");
					myself::SetFlagJournal(talker,714,5);
					myself::ShowQuestMark(talker,714);
					myself::SoundEffect(talker,"ItemSound.quest_middle");
				}
			}
		}
		super;
	}

}
