@LabelIndex 378973
@StringIndex 55665
class 0 warehouse_keeper_rydie : warehouse_keeper {
handler:
	EventHandler TALK_SELECTED(fhtml0,talker) {
		if( _from_choice == 0 ) {
			if( gg::HaveMemo(talker,418) == 1 && gg::GetMemoState(talker,418) == 201 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"Path of the Artisan (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,418) == 1 && gg::GetMemoState(talker,418) == 201 ) ) {
						myself::SetCurrentQuestID(418);
						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_keeper_rydie_q0418_01.htm");
					}
					break;
				}
			}
			return;
		}
		super;
	}

	EventHandler MENU_SELECTED(ask,reply,talker) {
		if( ask == 418 ) {
			myself::SetCurrentQuestID(418);
			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 == 418 ) {
			if( reply == 1 && gg::HaveMemo(talker,418) == 1 && gg::GetMemoState(talker,418) == 201 ) {
				if( ( myself::GetCurrentTick() - talker.quest_last_reward_time ) > 1 ) {
					talker.quest_last_reward_time = myself::GetCurrentTick();
					myself::GiveItem1(talker,1635,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,11726);
							myself::GiveItem1(talker,57,81900);
						} else if( talker.level >= 19 ) {
							myself::IncrementParam(talker,0,228064);
							myself::IncrementParam(talker,1,15075);
							myself::GiveItem1(talker,57,81900);
						} else {
							myself::IncrementParam(talker,0,295862);
							myself::IncrementParam(talker,1,18424);
							myself::GiveItem1(talker,57,81900);
						}
					}
					myself::RemoveMemo(talker,418);
					gg::AddPCSocial(gg::GetIndexFromCreature(talker),3);
					gg::AddLog(2,talker,418);
					myself::SoundEffect(talker,"ItemSound.quest_finish");
					myself::ShowPage(talker,"warehouse_keeper_rydie_q0418_04.htm");
				}
			}
		}
		super;
	}

}
