@LabelIndex 380874
@StringIndex 56013
class 0 karuda : citizen {
handler:
	EventHandler TALK_SELECTED(fhtml0,talker) {
		if( _from_choice == 0 ) {
			if( talker.level >= 20 && gg::HaveMemo(talker,644) == 0 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"Grave Robber Annihilation");
			}
			if( talker.level < 20 && gg::HaveMemo(talker,644) == 0 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 1;
				myself::AddChoice(1,"Grave Robber Annihilation");
			}
			if( gg::HaveMemo(talker,644) == 1 && gg::GetMemoState(talker,644) >= ( ( 1 * 10 ) + 1 ) && gg::GetMemoState(talker,644) <= ( ( 1 * 10 ) + 2 ) ) {
				_choiceN = ( _choiceN + 1 );
				_code = 2;
				myself::AddChoice(2,"Grave Robber Annihilation (In Progress)");
			}
			if( talker.level >= 23 && gg::HaveMemo(talker,645) == 0 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 3;
				myself::AddChoice(3,"Ghosts of Batur");
			}
			if( talker.level < 23 && gg::HaveMemo(talker,645) == 0 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 4;
				myself::AddChoice(4,"Ghosts of Batur");
			}
			if( gg::HaveMemo(talker,645) == 1 && gg::GetMemoState(talker,645) >= ( ( 1 * 10 ) + 1 ) && gg::GetMemoState(talker,645) <= ( ( 1 * 10 ) + 2 ) ) {
				_choiceN = ( _choiceN + 1 );
				_code = 5;
				myself::AddChoice(5,"Ghosts of Batur (In Progress)");
			}
			if( gg::HaveMemo(talker,122) == 1 && myself::GetOneTimeQuestFlag(talker,122) == 0 && gg::GetMemoState(talker,122) == ( ( 1 * 10 ) + 1 ) ) {
				_choiceN = ( _choiceN + 1 );
				_code = 6;
				myself::AddChoice(6,"Ominous News (In Progress)");
			}
			if( gg::HaveMemo(talker,112) == 1 && myself::GetOneTimeQuestFlag(talker,112) == 0 && gg::GetMemoState(talker,112) == ( ( 1 * 10 ) + 1 ) ) {
				_choiceN = ( _choiceN + 1 );
				_code = 7;
				myself::AddChoice(7,"Walk of Fate (In Progress)");
			}
			if( _choiceN > 1 ) {
				myself::ShowChoicePage(talker,1);
				return;
			}
		}
		if( _from_choice || _choiceN == 1 ) {
			switch(_code) {
				case 0: {
					if( _from_choice == 0 || ( talker.level >= 20 && gg::HaveMemo(talker,644) == 0 ) ) {
						myself::SetCurrentQuestID(644);
						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,"karuda_q0644_0101.htm");
							myself::FHTML_SetInt(fhtml0,"quest_id",644);
							myself::ShowQuestFHTML(talker,fhtml0,644);
						} else {
							myself::ShowPage(talker,"fullquest.htm");
						}
					}
					break;
				}
				case 1: {
					if( _from_choice == 0 || ( talker.level < 20 && gg::HaveMemo(talker,644) == 0 ) ) {
						myself::SetCurrentQuestID(644);
						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,"karuda_q0644_0102.htm",644);
					}
					break;
				}
				case 2: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,644) == 1 && gg::GetMemoState(talker,644) >= ( ( 1 * 10 ) + 1 ) && gg::GetMemoState(talker,644) <= ( ( 1 * 10 ) + 2 ) ) ) {
						myself::SetCurrentQuestID(644);
						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::GetMemoState(talker,644) == ( ( 1 * 10 ) + 2 ) && gg::OwnItemCount(talker,8088) >= 120 ) {
							myself::SetHTMLCookie(talker,644,1);
							myself::ShowPage(talker,"karuda_q0644_0105.htm");
						} else {
							myself::ShowPage(talker,"karuda_q0644_0106.htm");
						}
					}
					break;
				}
				case 3: {
					if( _from_choice == 0 || ( talker.level >= 23 && gg::HaveMemo(talker,645) == 0 ) ) {
						myself::SetCurrentQuestID(645);
						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,"karuda_q0645_0101.htm");
							myself::FHTML_SetInt(fhtml0,"quest_id",645);
							myself::ShowQuestFHTML(talker,fhtml0,645);
						} else {
							myself::ShowPage(talker,"fullquest.htm");
						}
					}
					break;
				}
				case 4: {
					if( _from_choice == 0 || ( talker.level < 23 && gg::HaveMemo(talker,645) == 0 ) ) {
						myself::SetCurrentQuestID(645);
						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,"karuda_q0645_0102.htm",645);
					}
					break;
				}
				case 5: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,645) == 1 && gg::GetMemoState(talker,645) >= ( ( 1 * 10 ) + 1 ) && gg::GetMemoState(talker,645) <= ( ( 1 * 10 ) + 2 ) ) ) {
						myself::SetCurrentQuestID(645);
						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::GetMemoState(talker,645) == ( ( 1 * 10 ) + 2 ) && gg::OwnItemCount(talker,8089) >= 180 ) {
							myself::SetHTMLCookie(talker,645,1);
							myself::ShowPage(talker,"karuda_q0645_0105.htm");
						} else {
							myself::ShowPage(talker,"karuda_q0645_0106.htm");
						}
					}
					break;
				}
				case 6: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,122) == 1 && myself::GetOneTimeQuestFlag(talker,122) == 0 && gg::GetMemoState(talker,122) == ( ( 1 * 10 ) + 1 ) ) ) {
						myself::SetCurrentQuestID(122);
						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::SetHTMLCookie(talker,122,1);
						myself::ShowPage(talker,"karuda_q0122_0101.htm");
					}
					break;
				}
				case 7: {
					if( _from_choice == 0 || ( gg::HaveMemo(talker,112) == 1 && myself::GetOneTimeQuestFlag(talker,112) == 0 && gg::GetMemoState(talker,112) == ( ( 1 * 10 ) + 1 ) ) ) {
						myself::SetCurrentQuestID(112);
						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::SetHTMLCookie(talker,112,1);
						myself::ShowPage(talker,"karuda_q0112_0101.htm");
					}
					break;
				}
			}
			return;
		}
		super;
	}

	EventHandler QUEST_ACCEPTED(quest_id,talker) {
		if( quest_id == 644 ) {
			myself::SetCurrentQuestID(644);
			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.level >= 20 ) {
				talker.quest_last_reward_time = myself::GetCurrentTick();
				myself::SetMemo(talker,644);
				myself::SetMemoState(talker,644,( ( 1 * 10 ) + 1 ));
				gg::AddLog(1,talker,644);
				myself::SetFlagJournal(talker,644,1);
				myself::SoundEffect(talker,"ItemSound.quest_accept");
				myself::ShowQuestPage(talker,"karuda_q0644_0103.htm",644);
				myself::ShowQuestMark(talker,644);
			}
			return;
		}
		if( quest_id == 645 ) {
			myself::SetCurrentQuestID(645);
			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.level >= 23 ) {
				talker.quest_last_reward_time = myself::GetCurrentTick();
				myself::SetMemo(talker,645);
				myself::SetMemoState(talker,645,( ( 1 * 10 ) + 1 ));
				gg::AddLog(1,talker,645);
				myself::SetFlagJournal(talker,645,1);
				myself::SoundEffect(talker,"ItemSound.quest_accept");
				myself::ShowQuestPage(talker,"karuda_q0645_0103.htm",645);
				myself::ShowQuestMark(talker,645);
			}
			return;
		}
		super;
	}

	EventHandler MENU_SELECTED(ask,i0,i1,quest_id,reply,talker) {
		if( ask == 644 ) {
			myself::SetCurrentQuestID(644);
			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 == 644 ) {
			i0 = myself::GetHTMLCookie(talker,644,( 2 - 1 ));
			if( i0 != -1 ) {
				if( reply == 3 && gg::HaveMemo(talker,644) == 1 && gg::GetMemoState(talker,644) >= ( ( ( 2 - 1 ) * 10 ) + 1 ) ) {
					myself::ShowPage(talker,"karuda_q0644_0201.htm");
				}
				if( reply >= 11 && reply <= 20 && gg::HaveMemo(talker,644) == 1 && gg::GetMemoState(talker,644) >= ( ( ( 2 - 1 ) * 10 ) + 1 ) ) {
					if( gg::OwnItemCount(talker,8088) >= 120 ) {
						if( ( myself::GetCurrentTick() - talker.quest_last_reward_time ) > 1 ) {
							talker.quest_last_reward_time = myself::GetCurrentTick();
							myself::DeleteItem1(talker,8088,120);
							if( reply == 11 && gg::HaveMemo(talker,644) == 1 ) {
								myself::GiveItem1(talker,1865,30);
							}
							if( reply == 12 && gg::HaveMemo(talker,644) == 1 ) {
								myself::GiveItem1(talker,1867,40);
							}
							if( reply == 13 && gg::HaveMemo(talker,644) == 1 ) {
								myself::GiveItem1(talker,1872,40);
							}
							if( reply == 14 && gg::HaveMemo(talker,644) == 1 ) {
								myself::GiveItem1(talker,1871,30);
							}
							if( reply == 15 && gg::HaveMemo(talker,644) == 1 ) {
								myself::GiveItem1(talker,1870,30);
							}
							if( reply == 16 && gg::HaveMemo(talker,644) == 1 ) {
								myself::GiveItem1(talker,1869,30);
							}
							gg::AddLog(2,talker,644);
							gg::AddLog(3,talker,644);
							myself::RemoveMemo(talker,644);
							myself::SoundEffect(talker,"ItemSound.quest_finish");
							myself::ShowPage(talker,"karuda_q0644_0202.htm");
						}
					}
				}
			}
		}
		if( ask == 645 ) {
			myself::SetCurrentQuestID(645);
			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 == 645 ) {
			i0 = myself::GetHTMLCookie(talker,645,( 2 - 1 ));
			if( i0 != -1 ) {
				if( reply == 3 && gg::HaveMemo(talker,645) == 1 && gg::GetMemoState(talker,645) >= ( ( ( 2 - 1 ) * 10 ) + 1 ) ) {
					myself::ShowPage(talker,"karuda_q0645_0201.htm");
				}
				if( reply >= 11 && reply <= 20 && gg::HaveMemo(talker,645) == 1 && gg::GetMemoState(talker,645) >= ( ( ( 2 - 1 ) * 10 ) + 1 ) ) {
					if( gg::OwnItemCount(talker,8089) >= 180 ) {
						if( ( myself::GetCurrentTick() - talker.quest_last_reward_time ) > 1 ) {
							talker.quest_last_reward_time = myself::GetCurrentTick();
							myself::DeleteItem1(talker,8089,180);
							if( reply == 11 && gg::HaveMemo(talker,645) == 1 ) {
								myself::GiveItem1(talker,1878,18);
							}
							if( reply == 12 && gg::HaveMemo(talker,645) == 1 ) {
								myself::GiveItem1(talker,1879,7);
							}
							if( reply == 13 && gg::HaveMemo(talker,645) == 1 ) {
								myself::GiveItem1(talker,1880,4);
							}
							if( reply == 14 && gg::HaveMemo(talker,645) == 1 ) {
								myself::GiveItem1(talker,1881,6);
							}
							if( reply == 15 && gg::HaveMemo(talker,645) == 1 ) {
								myself::GiveItem1(talker,1882,10);
							}
							if( reply == 16 && gg::HaveMemo(talker,645) == 1 ) {
								myself::GiveItem1(talker,1883,2);
							}
							gg::AddLog(2,talker,645);
							gg::AddLog(3,talker,645);
							myself::RemoveMemo(talker,645);
							myself::SoundEffect(talker,"ItemSound.quest_finish");
							myself::ShowPage(talker,"karuda_q0645_0202.htm");
						}
					}
				}
			}
		}
		if( ask == 122 ) {
			myself::SetCurrentQuestID(122);
			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 == 122 && myself::GetOneTimeQuestFlag(talker,122) == 0 ) {
			i0 = myself::GetHTMLCookie(talker,122,( 2 - 1 ));
			if( i0 != -1 ) {
				if( reply == 3 && gg::HaveMemo(talker,122) == 1 && gg::GetMemoState(talker,122) >= ( ( ( 2 - 1 ) * 10 ) + 1 ) ) {
					myself::SetOneTimeQuestFlag(talker,122,1);
					if( ( myself::GetCurrentTick() - talker.quest_last_reward_time ) > 1 ) {
						talker.quest_last_reward_time = myself::GetCurrentTick();
						myself::GiveItem1(talker,57,8923);
						myself::IncrementParam(talker,0,45151);
						myself::IncrementParam(talker,1,2310);
						gg::AddLog(2,talker,122);
						myself::RemoveMemo(talker,122);
						myself::SoundEffect(talker,"ItemSound.quest_finish");
						myself::ShowPage(talker,"karuda_q0122_0201.htm");
					}
				}
			}
		}
		if( ask == 112 ) {
			myself::SetCurrentQuestID(112);
			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 == 112 && myself::GetOneTimeQuestFlag(talker,112) == 0 ) {
			i0 = myself::GetHTMLCookie(talker,112,( 2 - 1 ));
			if( i0 != -1 ) {
				if( reply == 3 && gg::HaveMemo(talker,112) == 1 && gg::GetMemoState(talker,112) >= ( ( ( 2 - 1 ) * 10 ) + 1 ) ) {
					myself::SetOneTimeQuestFlag(talker,112,1);
					if( ( myself::GetCurrentTick() - talker.quest_last_reward_time ) > 1 ) {
						talker.quest_last_reward_time = myself::GetCurrentTick();
						myself::GiveItem1(talker,57,22308);
						myself::IncrementParam(talker,0,112876);
						myself::IncrementParam(talker,1,5774);
						myself::GiveItem1(talker,956,1);
						gg::AddLog(2,talker,112);
						myself::RemoveMemo(talker,112);
						myself::SoundEffect(talker,"ItemSound.quest_finish");
						myself::ShowPage(talker,"karuda_q0112_0201.htm");
					}
				}
			}
		}
		super;
	}

}
