@LabelIndex 378167
@StringIndex 55560
class 0 bri_mec_tran : guardian {
handler:
	EventHandler TALK_SELECTED(fhtml0,talker) {
		if( _from_choice == 0 ) {
			if( gg::HaveMemo(talker,267) == 0 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"Wrath of Verdure");
			}
			if( gg::HaveMemo(talker,267) == 1 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 1;
				myself::AddChoice(1,"Wrath of Verdure (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,267) == 0 ) {
						myself::SetCurrentQuestID(267);
						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( myself::GetMemoCount(talker) < 26 ) {
							if( talker.level >= 4 && talker.race == 1 ) {
								myself::FHTML_SetFileName(fhtml0,"bri_mec_tran_q0267_02.htm");
								myself::FHTML_SetInt(fhtml0,"quest_id",267);
								myself::ShowQuestFHTML(talker,fhtml0,267);
							} else if( talker.race != 1 ) {
								myself::ShowQuestPage(talker,"bri_mec_tran_q0267_00.htm",267);
							} else if( talker.level < 4 ) {
								myself::ShowQuestPage(talker,"bri_mec_tran_q0267_01.htm",267);
							}
						} else {
							myself::ShowPage(talker,"fullquest.htm");
						}
					}
					break;
				}
				case 1: {
					if( _from_choice == 0 || gg::HaveMemo(talker,267) == 1 ) {
						myself::SetCurrentQuestID(267);
						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( gg::OwnItemCount(talker,1335) > 0 ) {
							if( ( myself::GetCurrentTick() - talker.quest_last_reward_time ) > 1 ) {
								talker.quest_last_reward_time = myself::GetCurrentTick();
								myself::GiveItem1(talker,1340,( 1 * gg::OwnItemCount(talker,1335) ));
								if( gg::OwnItemCount(talker,1335) >= 10 ) {
									myself::GiveItem1(talker,57,600);
								}
								myself::DeleteItem1(talker,1335,gg::OwnItemCount(talker,1335));
								myself::ShowPage(talker,"bri_mec_tran_q0267_05.htm");
								gg::AddLog(3,talker,267);
							}
						} else {
							myself::ShowPage(talker,"bri_mec_tran_q0267_04.htm");
						}
					}
					break;
				}
			}
			return;
		}
		super;
	}

	EventHandler QUEST_ACCEPTED(quest_id,talker) {
		if( quest_id == 267 ) {
			myself::SetCurrentQuestID(267);
			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( ( myself::GetCurrentTick() - talker.quest_last_reward_time ) > 1 ) {
				talker.quest_last_reward_time = myself::GetCurrentTick();
				myself::SetMemo(talker,quest_id);
				myself::ShowQuestMark(talker,267);
				gg::AddLog(1,talker,267);
				myself::SetFlagJournal(talker,267,1);
				myself::SoundEffect(talker,"ItemSound.quest_accept");
				myself::ShowQuestPage(talker,"bri_mec_tran_q0267_03.htm",267);
			}
			return;
		}
		super;
	}

	EventHandler MENU_SELECTED(ask,reply,talker) {
		if( ask == 267 ) {
			myself::SetCurrentQuestID(267);
			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 == 267 ) {
			if( reply == 1 ) {
				myself::ShowPage(talker,"bri_mec_tran_q0267_06.htm");
				myself::RemoveMemo(talker,267);
				gg::AddLog(2,talker,267);
				myself::SoundEffect(talker,"ItemSound.quest_finish");
			} else if( reply == 2 ) {
				myself::ShowPage(talker,"bri_mec_tran_q0267_07.htm");
			}
		}
		super;
	}

}
