@LabelIndex 387210
@StringIndex 57241
class 0 shaman_caracawe : citizen {
handler:
	EventHandler TALK_SELECTED(fhtml0,talker) {
		if( _from_choice == 0 ) {
			if( gg::HaveMemo(talker,124) == 1 && gg::GetMemoState(talker,124) == 3 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"Meeting the Elroki (In Progress)");
			}
			if( gg::HaveMemo(talker,124) == 1 && gg::GetMemoState(talker,124) < 3 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 1;
				myself::AddChoice(1,"Meeting the Elroki (In Progress)");
			}
			if( gg::HaveMemo(talker,124) == 1 && gg::GetMemoState(talker,124) == 4 && gg::OwnItemCount(talker,8778) < 1 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 2;
				myself::AddChoice(2,"Meeting the Elroki (In Progress)");
			}
			if( gg::HaveMemo(talker,124) == 1 && gg::GetMemoState(talker,124) == 4 && gg::OwnItemCount(talker,8778) >= 1 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 3;
				myself::AddChoice(3,"Meeting the Elroki (In Progress)");
			}
			if( gg::HaveMemo(talker,125) == 1 && gg::GetMemoState(talker,125) == 2 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 4;
				myself::AddChoice(4,"The Name of Evil 1 (In Progress)");
			}
			if( gg::HaveMemo(talker,125) == 1 && gg::GetMemoState(talker,125) < 2 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 5;
				myself::AddChoice(5,"The Name of Evil 1 (In Progress)");
			}
			if( gg::HaveMemo(talker,125) == 1 && gg::GetMemoState(talker,125) == 3 && gg::OwnItemCount(talker,8779) >= 2 && gg::OwnItemCount(talker,8780) >= 2 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 6;
				myself::AddChoice(6,"The Name of Evil 1 (In Progress)");
			}
			if( gg::HaveMemo(talker,125) == 1 && gg::GetMemoState(talker,125) == 3 && ( gg::OwnItemCount(talker,8779) < 2 || gg::OwnItemCount(talker,8780) < 2 ) ) {
				_choiceN = ( _choiceN + 1 );
				_code = 7;
				myself::AddChoice(7,"The Name of Evil 1 (In Progress)");
			}
			if( gg::HaveMemo(talker,125) == 1 && gg::GetMemoState(talker,125) == 4 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 8;
				myself::AddChoice(8,"The Name of Evil 1 (In Progress)");
			}
			if( gg::HaveMemo(talker,125) == 1 && gg::GetMemoState(talker,125) == 5 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 9;
				myself::AddChoice(9,"The Name of Evil 1 (In Progress)");
			}
			if( gg::HaveMemo(talker,125) == 1 && gg::GetMemoState(talker,125) >= 6 && gg::GetMemoState(talker,125) < 13 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 10;
				myself::AddChoice(10,"The Name of Evil 1 (In Progress)");
			}
			if( gg::HaveMemo(talker,125) == 1 && gg::GetMemoState(talker,125) == 14 && gg::OwnItemCount(talker,8781) >= 1 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 11;
				myself::AddChoice(11,"The Name of Evil 1 (In Progress)");
			}
			if( gg::HaveMemo(talker,643) == 1 && gg::GetMemoState(talker,643) != 2 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 12;
				myself::AddChoice(12,"Rise and Fall of the Elroki Tribe (In Progress)");
			}
			if( gg::HaveMemo(talker,643) == 1 && gg::GetMemoState(talker,643) == 2 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 13;
				myself::AddChoice(13,"Rise and Fall of the Elroki Tribe (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,124) == 1 && gg::GetMemoState(talker,124) == 3 ) ) {
						myself::SetCurrentQuestID(124);
						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,"shaman_caracawe_q0124_01.htm");
					}
					break;
				}
				case 1: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,124) == 1 && gg::GetMemoState(talker,124) < 3 ) ) {
						myself::SetCurrentQuestID(124);
						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,"shaman_caracawe_q0124_02.htm");
					}
					break;
				}
				case 2: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,124) == 1 && gg::GetMemoState(talker,124) == 4 && gg::OwnItemCount(talker,8778) < 1 ) ) {
						myself::SetCurrentQuestID(124);
						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,"shaman_caracawe_q0124_06.htm");
					}
					break;
				}
				case 3: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,124) == 1 && gg::GetMemoState(talker,124) == 4 && gg::OwnItemCount(talker,8778) >= 1 ) ) {
						myself::SetCurrentQuestID(124);
						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,"shaman_caracawe_q0124_07.htm");
					}
					break;
				}
				case 4: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,125) == 1 && gg::GetMemoState(talker,125) == 2 ) ) {
						myself::SetCurrentQuestID(125);
						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,"shaman_caracawe_q0125_01.htm");
					}
					break;
				}
				case 5: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,125) == 1 && gg::GetMemoState(talker,125) < 2 ) ) {
						myself::SetCurrentQuestID(125);
						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,"shaman_caracawe_q0125_02.htm");
					}
					break;
				}
				case 6: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,125) == 1 && gg::GetMemoState(talker,125) == 3 && gg::OwnItemCount(talker,8779) >= 2 && gg::OwnItemCount(talker,8780) >= 2 ) ) {
						myself::SetCurrentQuestID(125);
						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::DeleteItem1(talker,8779,gg::OwnItemCount(talker,8779));
						myself::DeleteItem1(talker,8780,gg::OwnItemCount(talker,8780));
						myself::SetMemoState(talker,125,4);
						myself::ShowPage(talker,"shaman_caracawe_q0125_11.htm");
					}
					break;
				}
				case 7: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,125) == 1 && gg::GetMemoState(talker,125) == 3 && ( gg::OwnItemCount(talker,8779) < 2 || gg::OwnItemCount(talker,8780) < 2 ) ) ) {
						myself::SetCurrentQuestID(125);
						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,"shaman_caracawe_q0125_12.htm");
					}
					break;
				}
				case 8: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,125) == 1 && gg::GetMemoState(talker,125) == 4 ) ) {
						myself::SetCurrentQuestID(125);
						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,"shaman_caracawe_q0125_14.htm");
					}
					break;
				}
				case 9: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,125) == 1 && gg::GetMemoState(talker,125) == 5 ) ) {
						myself::SetCurrentQuestID(125);
						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,"shaman_caracawe_q0125_18.htm");
					}
					break;
				}
				case 10: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,125) == 1 && gg::GetMemoState(talker,125) >= 6 && gg::GetMemoState(talker,125) < 13 ) ) {
						myself::SetCurrentQuestID(125);
						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,"shaman_caracawe_q0125_19.htm");
					}
					break;
				}
				case 11: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,125) == 1 && gg::GetMemoState(talker,125) == 14 && gg::OwnItemCount(talker,8781) >= 1 ) ) {
						myself::SetCurrentQuestID(125);
						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,"shaman_caracawe_q0125_20.htm");
					}
					break;
				}
				case 12: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,643) == 1 && gg::GetMemoState(talker,643) != 2 ) ) {
						myself::SetCurrentQuestID(643);
						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,"shaman_caracawe_q0643_02.htm");
					}
					break;
				}
				case 13: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,643) == 1 && gg::GetMemoState(talker,643) == 2 ) ) {
						myself::SetCurrentQuestID(643);
						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,"shaman_caracawe_q0643_03.htm");
					}
					break;
				}
			}
			return;
		}
		super;
	}

	EventHandler MENU_SELECTED(ask,i0,reply,talker) {
		if( ask == 124 ) {
			myself::SetCurrentQuestID(124);
			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 == 124 ) {
			if( reply == 7 ) {
				myself::ShowPage(talker,"shaman_caracawe_q0124_03.htm");
			}
			if( reply == 8 ) {
				myself::ShowPage(talker,"shaman_caracawe_q0124_04.htm");
			}
			if( reply == 9 ) {
				if( gg::HaveMemo(talker,124) == 1 && gg::GetMemoState(talker,124) == 3 ) {
					myself::SetMemoState(talker,124,4);
					myself::ShowPage(talker,"shaman_caracawe_q0124_05.htm");
					myself::SetFlagJournal(talker,124,5);
					myself::ShowQuestMark(talker,124);
					myself::SoundEffect(talker,"ItemSound.quest_middle");
				}
			}
		}
		if( ask == 125 ) {
			myself::SetCurrentQuestID(125);
			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 == 125 ) {
			if( reply == 7 && gg::HaveMemo(talker,125) == 1 && gg::GetMemoState(talker,125) == 2 ) {
				myself::ShowPage(talker,"shaman_caracawe_q0125_03.htm");
			}
			if( reply == 8 ) {
				myself::ShowPage(talker,"shaman_caracawe_q0125_04.htm");
			}
			if( reply == 9 ) {
				myself::ShowPage(talker,"shaman_caracawe_q0125_05.htm");
			}
			if( reply == 10 ) {
				myself::ShowPage(talker,"shaman_caracawe_q0125_06.htm");
			}
			if( reply == 11 ) {
				myself::ShowPage(talker,"shaman_caracawe_q0125_07.htm");
			}
			if( reply == 12 ) {
				myself::ShowPage(talker,"shaman_caracawe_q0125_08.htm");
			}
			if( reply == 13 && gg::HaveMemo(talker,125) == 1 && gg::GetMemoState(talker,125) == 2 ) {
				myself::SetMemoState(talker,125,3);
				myself::ShowPage(talker,"shaman_caracawe_q0125_09.htm");
				myself::SetFlagJournal(talker,125,3);
				myself::ShowQuestMark(talker,125);
				myself::SoundEffect(talker,"ItemSound.quest_middle");
			}
			if( reply == 14 && gg::HaveMemo(talker,125) == 1 && gg::GetMemoState(talker,125) == 4 ) {
				myself::ShowPage(talker,"shaman_caracawe_q0125_13.htm");
			}
			if( reply == 15 && gg::HaveMemo(talker,125) == 1 && gg::GetMemoState(talker,125) == 4 ) {
				myself::ShowPage(talker,"shaman_caracawe_q0125_15.htm");
			}
			if( reply == 16 ) {
				myself::ShowPage(talker,"shaman_caracawe_q0125_16.htm");
			}
			if( reply == 17 && gg::HaveMemo(talker,125) == 1 && gg::GetMemoState(talker,125) == 4 ) {
				myself::SetMemoState(talker,125,5);
				myself::ShowPage(talker,"shaman_caracawe_q0125_17.htm");
				myself::SetFlagJournal(talker,125,5);
				myself::ShowQuestMark(talker,125);
				myself::SoundEffect(talker,"ItemSound.quest_middle");
			}
		}
		if( ask == 643 ) {
			myself::SetCurrentQuestID(643);
			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 == 643 ) {
			if( reply == 6 ) {
				myself::SetMemoState(talker,643,2);
				myself::ShowPage(talker,"shaman_caracawe_q0643_04.htm");
			}
			if( reply == 7 ) {
				if( gg::OwnItemCount(talker,8776) < 300 ) {
					myself::ShowPage(talker,"shaman_caracawe_q0643_05.htm");
				} else if( ( myself::GetCurrentTick() - talker.quest_last_reward_time ) > 1 ) {
					talker.quest_last_reward_time = myself::GetCurrentTick();
					gg::AddLog(3,talker,643);
					i0 = gg::Rand(11);
					if( i0 == 0 ) {
						myself::GiveItem1(talker,8712,5);
					}
					if( i0 == 1 ) {
						myself::GiveItem1(talker,8713,5);
					}
					if( i0 == 2 ) {
						myself::GiveItem1(talker,8714,5);
					}
					if( i0 == 3 ) {
						myself::GiveItem1(talker,8715,5);
					}
					if( i0 == 4 ) {
						myself::GiveItem1(talker,8716,5);
					}
					if( i0 == 5 ) {
						myself::GiveItem1(talker,8717,5);
					}
					if( i0 == 6 ) {
						myself::GiveItem1(talker,8718,5);
					}
					if( i0 == 7 ) {
						myself::GiveItem1(talker,8719,5);
					}
					if( i0 == 8 ) {
						myself::GiveItem1(talker,8720,5);
					}
					if( i0 == 9 ) {
						myself::GiveItem1(talker,8721,5);
					}
					if( i0 == 10 ) {
						myself::GiveItem1(talker,8722,5);
					}
					myself::DeleteItem1(talker,8776,300);
					myself::ShowPage(talker,"shaman_caracawe_q0643_06.htm");
					myself::SoundEffect(talker,"ItemSound.quest_middle");
				}
			}
			if( reply == 8 ) {
				myself::ShowPage(talker,"shaman_caracawe_q0643_08.htm");
			}
			if( reply == 9 ) {
				if( gg::OwnItemCount(talker,8776) < 300 ) {
					myself::ShowPage(talker,"shaman_caracawe_q0643_09.htm");
				} else if( ( myself::GetCurrentTick() - talker.quest_last_reward_time ) > 1 ) {
					talker.quest_last_reward_time = myself::GetCurrentTick();
					gg::AddLog(3,talker,643);
					i0 = gg::Rand(10);
					if( i0 == 0 ) {
						myself::GiveItem1(talker,8903,1);
						myself::GiveItem1(talker,8885,1);
						myself::GiveItem1(talker,8887,1);
						myself::GiveItem1(talker,57,82000);
					}
					if( i0 == 1 ) {
						myself::GiveItem1(talker,8888,1);
						myself::GiveItem1(talker,8889,1);
						myself::GiveItem1(talker,8892,1);
						myself::GiveItem1(talker,57,82000);
					}
					if( i0 == 2 ) {
						myself::GiveItem1(talker,8883,1);
						myself::GiveItem1(talker,8893,1);
						myself::GiveItem1(talker,8894,1);
						myself::GiveItem1(talker,57,62000);
					}
					if( i0 == 3 ) {
						myself::GiveItem1(talker,8882,1);
						myself::GiveItem1(talker,8895,1);
						myself::GiveItem1(talker,8896,1);
						myself::GiveItem1(talker,57,62000);
					}
					if( i0 == 4 ) {
						myself::GiveItem1(talker,8881,1);
						myself::GiveItem1(talker,8897,1);
						myself::GiveItem1(talker,8898,1);
						myself::GiveItem1(talker,57,62000);
					}
					if( i0 == 5 ) {
						myself::GiveItem1(talker,8880,1);
						myself::GiveItem1(talker,8899,1);
						myself::GiveItem1(talker,8900,1);
						myself::GiveItem1(talker,57,62000);
					}
					if( i0 == 6 ) {
						myself::GiveItem1(talker,8877,1);
						myself::GiveItem1(talker,8907,1);
						myself::GiveItem1(talker,8908,1);
						myself::GiveItem1(talker,57,62000);
					}
					if( i0 == 7 ) {
						myself::GiveItem1(talker,8878,1);
						myself::GiveItem1(talker,8905,1);
						myself::GiveItem1(talker,8906,1);
						myself::GiveItem1(talker,57,62000);
					}
					if( i0 == 8 ) {
						myself::GiveItem1(talker,8879,1);
						myself::GiveItem1(talker,8886,1);
						myself::GiveItem1(talker,8904,1);
						myself::GiveItem1(talker,57,72000);
					}
					if( i0 == 9 ) {
						myself::GiveItem1(talker,8901,1);
						myself::GiveItem1(talker,8902,1);
						myself::GiveItem1(talker,8884,1);
						myself::GiveItem1(talker,57,62000);
					}
					myself::DeleteItem1(talker,8776,300);
					myself::ShowPage(talker,"shaman_caracawe_q0643_10.htm");
					myself::SoundEffect(talker,"ItemSound.quest_middle");
				}
			}
		}
		super;
	}

}
