@LabelIndex 395984
@StringIndex 59111
class 0 priest_kanis : citizen {
handler:
	EventHandler TALK_SELECTED(fhtml0,talker) {
		if( _from_choice == 0 ) {
			if( gg::HaveMemo(talker,133) == 0 && talker.level >= 78 && myself::GetOneTimeQuestFlag(talker,133) == 0 && myself::GetOneTimeQuestFlag(talker,131) == 1 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"That's Bloody Hot!");
			}
			if( gg::HaveMemo(talker,133) == 0 && talker.level < 78 && myself::GetOneTimeQuestFlag(talker,133) == 0 && myself::GetOneTimeQuestFlag(talker,131) == 1 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 1;
				myself::AddChoice(1,"That's Bloody Hot!");
			}
			if( myself::GetOneTimeQuestFlag(talker,133) == 1 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 2;
				myself::AddChoice(2,"That's Bloody Hot! (Done)");
			}
			if( myself::GetOneTimeQuestFlag(talker,131) == 0 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 3;
				myself::AddChoice(3,"That's Bloody Hot!");
			}
			if( gg::HaveMemo(talker,133) == 1 && gg::GetMemoState(talker,133) == 1 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 4;
				myself::AddChoice(4,"That's Bloody Hot! (In Progress)");
			}
			if( gg::HaveMemo(talker,133) == 1 && gg::GetMemoState(talker,133) == 2 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 5;
				myself::AddChoice(5,"That's Bloody Hot! (In Progress)");
			}
			if( gg::HaveMemo(talker,133) == 1 && gg::GetMemoState(talker,133) >= 3 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 6;
				myself::AddChoice(6,"That's Bloody Hot! (In Progress)");
			}
			if( gg::HaveMemo(talker,131) == 0 && talker.level >= 78 && myself::GetOneTimeQuestFlag(talker,131) <= 0 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 7;
				myself::AddChoice(7,"Bird in a Cage");
			}
			if( gg::HaveMemo(talker,131) == 0 && talker.level < 78 && myself::GetOneTimeQuestFlag(talker,131) <= 0 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 8;
				myself::AddChoice(8,"Bird in a Cage");
			}
			if( gg::HaveMemo(talker,131) == 0 && myself::GetOneTimeQuestFlag(talker,131) > 0 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 9;
				myself::AddChoice(9,"Bird in a Cage (Done)");
			}
			if( gg::HaveMemo(talker,131) == 1 && gg::GetMemoState(talker,131) == 1 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 10;
				myself::AddChoice(10,"Bird in a Cage (In Progress)");
			}
			if( gg::HaveMemo(talker,131) == 1 && gg::GetMemoState(talker,131) == 2 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 11;
				myself::AddChoice(11,"Bird in a Cage (In Progress)");
			}
			if( gg::HaveMemo(talker,131) == 1 && gg::GetMemoState(talker,131) == 3 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 12;
				myself::AddChoice(12,"Bird in a Cage (In Progress)");
			}
			if( gg::HaveMemo(talker,131) == 1 && gg::GetMemoState(talker,131) == 4 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 13;
				myself::AddChoice(13,"Bird in a Cage (In Progress)");
			}
			if( gg::HaveMemo(talker,131) == 1 && gg::GetMemoState(talker,131) == 5 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 14;
				myself::AddChoice(14,"Bird in a Cage (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,133) == 0 && talker.level >= 78 && myself::GetOneTimeQuestFlag(talker,133) == 0 && myself::GetOneTimeQuestFlag(talker,131) == 1 ) ) {
						myself::SetCurrentQuestID(133);
						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 ) {
							myself::FHTML_SetFileName(fhtml0,"priest_kanis_q0133_01.htm");
							myself::FHTML_SetInt(fhtml0,"quest_id",133);
							myself::ShowQuestFHTML(talker,fhtml0,133);
						} else {
							myself::ShowPage(talker,"fullquest.htm");
						}
					}
					break;
				}
				case 1: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,133) == 0 && talker.level < 78 && myself::GetOneTimeQuestFlag(talker,133) == 0 && myself::GetOneTimeQuestFlag(talker,131) == 1 ) ) {
						myself::SetCurrentQuestID(133);
						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::ShowQuestPage(talker,"priest_kanis_q0133_02.htm",133);
					}
					break;
				}
				case 2: {
					if( _from_choice == 0 || myself::GetOneTimeQuestFlag(talker,133) == 1 ) {
						myself::SetCurrentQuestID(133);
						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,"finishedquest.htm");
					}
					break;
				}
				case 3: {
					if( _from_choice == 0 || myself::GetOneTimeQuestFlag(talker,131) == 0 ) {
						myself::SetCurrentQuestID(133);
						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::ShowQuestPage(talker,"priest_kanis_q0133_03.htm",133);
					}
					break;
				}
				case 4: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,133) == 1 && gg::GetMemoState(talker,133) == 1 ) ) {
						myself::SetCurrentQuestID(133);
						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,"priest_kanis_q0133_05.htm");
					}
					break;
				}
				case 5: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,133) == 1 && gg::GetMemoState(talker,133) == 2 ) ) {
						myself::SetCurrentQuestID(133);
						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,"priest_kanis_q0133_09.htm");
					}
					break;
				}
				case 6: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,133) == 1 && gg::GetMemoState(talker,133) >= 3 ) ) {
						myself::SetCurrentQuestID(133);
						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,"priest_kanis_q0133_13.htm");
					}
					break;
				}
				case 7: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,131) == 0 && talker.level >= 78 && myself::GetOneTimeQuestFlag(talker,131) <= 0 ) ) {
						myself::SetCurrentQuestID(131);
						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 ) {
							myself::FHTML_SetFileName(fhtml0,"priest_kanis_q0131_01.htm");
							myself::FHTML_SetInt(fhtml0,"quest_id",131);
							myself::ShowQuestFHTML(talker,fhtml0,131);
						} else {
							myself::ShowPage(talker,"fullquest.htm");
						}
					}
					break;
				}
				case 8: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,131) == 0 && talker.level < 78 && myself::GetOneTimeQuestFlag(talker,131) <= 0 ) ) {
						myself::SetCurrentQuestID(131);
						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::ShowQuestPage(talker,"priest_kanis_q0131_02.htm",131);
					}
					break;
				}
				case 9: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,131) == 0 && myself::GetOneTimeQuestFlag(talker,131) > 0 ) ) {
						myself::SetCurrentQuestID(131);
						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,"finishedquest.htm");
					}
					break;
				}
				case 10: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,131) == 1 && gg::GetMemoState(talker,131) == 1 ) ) {
						myself::SetCurrentQuestID(131);
						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,"priest_kanis_q0131_05.htm");
					}
					break;
				}
				case 11: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,131) == 1 && gg::GetMemoState(talker,131) == 2 ) ) {
						myself::SetCurrentQuestID(131);
						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,"priest_kanis_q0131_08.htm");
					}
					break;
				}
				case 12: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,131) == 1 && gg::GetMemoState(talker,131) == 3 ) ) {
						myself::SetCurrentQuestID(131);
						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,"priest_kanis_q0131_13.htm");
					}
					break;
				}
				case 13: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,131) == 1 && gg::GetMemoState(talker,131) == 4 ) ) {
						myself::SetCurrentQuestID(131);
						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,"priest_kanis_q0131_16.htm");
					}
					break;
				}
				case 14: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,131) == 1 && gg::GetMemoState(talker,131) == 5 ) ) {
						myself::SetCurrentQuestID(131);
						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,"priest_kanis_q0131_18.htm");
					}
					break;
				}
			}
			return;
		}
		super;
	}

	EventHandler QUEST_ACCEPTED(quest_id,talker) {
		if( quest_id == 133 ) {
			myself::SetCurrentQuestID(133);
			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();
				if( gg::HaveMemo(talker,133) == 0 && talker.level >= 78 && myself::GetOneTimeQuestFlag(talker,133) == 0 && myself::GetOneTimeQuestFlag(talker,131) == 1 ) {
					myself::SetMemoState(talker,133,1);
					myself::SetMemo(talker,quest_id);
					myself::SoundEffect(talker,"ItemSound.quest_accept");
					myself::ShowQuestPage(talker,"priest_kanis_q0133_04.htm",133);
					myself::SetFlagJournal(talker,133,1);
					myself::ShowQuestMark(talker,133);
					myself::SetMemoState(talker,133,1);
				}
				gg::AddLog(1,talker,quest_id);
			}
			return;
		}
		if( quest_id == 131 ) {
			myself::SetCurrentQuestID(131);
			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();
				if( gg::HaveMemo(talker,131) <= 0 && talker.level >= 78 && myself::GetOneTimeQuestFlag(talker,131) <= 0 ) {
					myself::SetMemoState(talker,131,1);
					myself::SetMemo(talker,quest_id);
					myself::SoundEffect(talker,"ItemSound.quest_accept");
					myself::ShowQuestPage(talker,"priest_kanis_q0131_04.htm",131);
					myself::SetFlagJournal(talker,131,1);
					myself::ShowQuestMark(talker,131);
				}
				gg::AddLog(1,talker,quest_id);
			}
			return;
		}
		super;
	}

	EventHandler MENU_SELECTED(ask,reply,talker) {
		if( ask == 133 ) {
			myself::SetCurrentQuestID(133);
			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 == 133 ) {
			if( reply == 1 ) {
				if( gg::HaveMemo(talker,133) == 1 && gg::GetMemoState(talker,133) == 1 ) {
					myself::ShowPage(talker,"priest_kanis_q0133_06.htm");
				}
			}
			if( reply == 2 ) {
				if( gg::HaveMemo(talker,133) == 1 && gg::GetMemoState(talker,133) == 1 ) {
					myself::ShowPage(talker,"priest_kanis_q0133_07.htm");
				}
			}
			if( reply == 3 ) {
				if( gg::HaveMemo(talker,133) == 1 && gg::GetMemoState(talker,133) == 1 ) {
					myself::SetMemoState(talker,133,2);
					myself::ShowPage(talker,"priest_kanis_q0133_08.htm");
				}
			}
			if( reply == 4 ) {
				if( gg::HaveMemo(talker,133) == 1 && gg::GetMemoState(talker,133) == 2 ) {
					myself::ShowPage(talker,"priest_kanis_q0133_10.htm");
				}
			}
			if( reply == 5 ) {
				if( gg::HaveMemo(talker,133) == 1 && gg::GetMemoState(talker,133) == 2 ) {
					myself::ShowPage(talker,"priest_kanis_q0133_11.htm");
				}
			}
			if( reply == 6 ) {
				if( gg::HaveMemo(talker,133) == 1 && gg::GetMemoState(talker,133) == 2 ) {
					myself::GiveItem1(talker,9785,1);
					myself::SetMemoState(talker,133,3);
					myself::ShowPage(talker,"priest_kanis_q0133_12.htm");
					myself::SetFlagJournal(talker,133,2);
					myself::ShowQuestMark(talker,133);
				}
			}
		}
		if( ask == 131 ) {
			myself::SetCurrentQuestID(131);
			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 == 131 ) {
			if( reply == 1 ) {
				if( gg::HaveMemo(talker,131) == 1 && gg::GetMemoState(talker,131) == 1 ) {
					myself::ShowPage(talker,"priest_kanis_q0131_06.htm");
				}
			}
			if( reply == 2 ) {
				if( gg::HaveMemo(talker,131) == 1 && gg::GetMemoState(talker,131) == 1 ) {
					myself::SetMemoState(talker,131,2);
					myself::ShowPage(talker,"priest_kanis_q0131_07.htm");
				}
			}
			if( reply == 3 ) {
				if( gg::HaveMemo(talker,131) == 1 && gg::GetMemoState(talker,131) == 2 ) {
					myself::ShowPage(talker,"priest_kanis_q0131_09.htm");
				}
			}
			if( reply == 4 ) {
				if( gg::HaveMemo(talker,131) == 1 && gg::GetMemoState(talker,131) == 2 ) {
					myself::ShowPage(talker,"priest_kanis_q0131_10.htm");
				}
			}
			if( reply == 5 ) {
				if( gg::HaveMemo(talker,131) == 1 && gg::GetMemoState(talker,131) == 2 ) {
					myself::ShowPage(talker,"priest_kanis_q0131_11.htm");
				}
			}
			if( reply == 6 ) {
				if( gg::HaveMemo(talker,131) == 1 && gg::GetMemoState(talker,131) == 2 ) {
					myself::GiveItem1(talker,9783,1);
					myself::SetMemoState(talker,131,3);
					myself::ShowPage(talker,"priest_kanis_q0131_12.htm");
					myself::SetFlagJournal(talker,131,2);
					myself::ShowQuestMark(talker,131);
					myself::SoundEffect(talker,"ItemSound.quest_middle");
				}
			}
			if( reply == 7 ) {
				if( gg::HaveMemo(talker,131) == 1 && gg::GetMemoState(talker,131) == 3 ) {
					myself::ShowPage(talker,"priest_kanis_q0131_14.htm");
				}
			}
			if( reply == 10 ) {
				if( gg::HaveMemo(talker,131) == 1 && gg::GetMemoState(talker,131) == 3 ) {
					myself::ShowPage(talker,"priest_kanis_q0131_15.htm");
				}
			}
			if( reply == 11 ) {
				if( gg::HaveMemo(talker,131) == 1 && gg::GetMemoState(talker,131) == 4 ) {
					myself::DeleteItem1(talker,9784,gg::OwnItemCount(talker,9784));
					myself::SetMemoState(talker,131,5);
					myself::ShowPage(talker,"priest_kanis_q0131_17.htm");
				}
			}
			if( reply == 12 ) {
				if( ( myself::GetCurrentTick() - talker.quest_last_reward_time ) > 1 ) {
					talker.quest_last_reward_time = myself::GetCurrentTick();
					if( gg::HaveMemo(talker,131) == 1 && gg::GetMemoState(talker,131) == 5 ) {
						myself::DeleteItem1(talker,9783,gg::OwnItemCount(talker,9783));
						myself::RemoveMemo(talker,131);
						myself::SoundEffect(talker,"ItemSound.quest_finish");
						myself::ShowPage(talker,"priest_kanis_q0131_19.htm");
						gg::AddLog(2,talker,131);
						myself::SetOneTimeQuestFlag(talker,131,1);
						myself::IncrementParam(talker,0,250677);
						myself::IncrementParam(talker,1,25019);
						switch(gg::Rand(4)) {
							case 0: {
								myself::GiveItem1(talker,9546,4);
								break;
							}
							case 1: {
								myself::GiveItem1(talker,9547,4);
								break;
							}
							case 2: {
								myself::GiveItem1(talker,9548,4);
								break;
							}
							case 3: {
								myself::GiveItem1(talker,9549,4);
								break;
							}
						}
					}
				}
			}
		}
		super;
	}

}
