@LabelIndex 397337
@StringIndex 59394
class 0 alarm_of_giant_q0184 : default_npc {
handler:
	EventHandler TALKED(c0,quest_id,talker) {
		if( _from_choice == 0 ) {
			if( gg::HaveMemo(talker,184) == 1 || gg::HaveMemo(talker,185) == 1 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"Nikola's Cooperation - Contract (In Progress)");
			}
			if( _choiceN > 1 ) {
				myself::ShowChoicePage(talker,0);
				return;
			}
		}
		if( _from_choice || _choiceN == 1 ) {
			switch(_code) {
				case 0: {
					if( _from_choice == 0 || gg::HaveMemo(talker,184) == 1 || gg::HaveMemo(talker,185) == 1 ) {
						myself::SetCurrentQuestID(184);
						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::HaveMemo(talker,184) == 1 && myself::GetOneTimeQuestFlag(talker,184) == 0 && gg::GetMemoState(talker,184) == 3 ) || ( gg::HaveMemo(talker,185) == 1 && myself::GetOneTimeQuestFlag(talker,185) == 0 && gg::GetMemoState(talker,185) == 3 ) ) {
							c0 = gg::GetCreatureFromIndex(myself.sm.param1);
							if( gg::IsNull(c0) == 0 ) {
								if( c0 == talker ) {
									myself::ShowPage(talker,"alarm_of_giant_q0184001.htm");
								} else {
									myself::ShowPage(talker,"alarm_of_giant_q0184002.htm");
								}
							}
						} else {
							myself::ShowPage(talker,"noquest.htm");
						}
					}
					break;
				}
			}
			return;
		}
		super;
	}

	EventHandler TIMER_FIRED_EX(c0,npc0,timer_id) {
		myself::SetCurrentQuestID(184);
		if( timer_id == 18404 ) {
			npc0 = gg::GetNPCFromID(myself.sm.param3);
			c0 = gg::GetCreatureFromIndex(myself.sm.param1);
			if( gg::IsNull(npc0) == 0 ) {
				if( npc0.i_quest0 == 1 ) {
					npc0.i_quest0 = 0;
					if( gg::IsNull(c0) == 0 ) {
						myself::Say(gg::MakeFString(18455,"","","","",""));
						if( gg::HaveMemo(c0,185) == 1 ) {
							myself::SetMemoState(c0,185,5);
						} else if( gg::HaveMemo(c0,184) == 1 ) {
							myself::SetMemoState(c0,184,5);
						}
					}
				}
			}
			myself::Despawn();
		} else if( timer_id == 18401 ) {
			myself::AddTimerEx(18402,( 1000 * 30 ));
			myself::Say(gg::MakeFString(18452,"","","","",""));
		} else if( timer_id == 18402 ) {
			myself::AddTimerEx(18403,( 1000 * 20 ));
			myself::Say(gg::MakeFString(18453,"","","","",""));
		} else if( timer_id == 18403 ) {
			myself::AddTimerEx(18404,( 1000 * 10 ));
			myself::Say(gg::MakeFString(18454,"","","","",""));
		}
		super;
	}

	EventHandler CREATED(c0,i0) {
		myself::SetCurrentQuestID(184);
		c0 = gg::GetCreatureFromIndex(myself.sm.param1);
		myself::AddTimerEx(18401,( 1000 * 60 ));
		myself::Say(gg::MakeFString(18451,"","","","",""));
		if( gg::IsNull(c0) == 0 ) {
			myself::SoundEffect(c0,"ItemSound3.sys_siren");
		}
		super;
	}

	EventHandler MENU_SELECTED(ask,c0,i0,npc0,reply,talker) {
		if( ask == 184 ) {
			myself::SetCurrentQuestID(184);
			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;
			}
		}
		c0 = gg::GetCreatureFromIndex(myself.sm.param1);
		if( gg::IsNull(c0) == 0 ) {
			if( talker == c0 ) {
				if( ask == 184 ) {
					if( reply == 2 ) {
						if( gg::HaveMemo(talker,184) == 1 && myself::GetOneTimeQuestFlag(talker,184) == 0 && gg::GetMemoState(talker,184) == 3 ) {
							myself::ShowPage(talker,"alarm_of_giant_q0184_q0184_02.htm");
						} else if( gg::HaveMemo(talker,185) == 1 && myself::GetOneTimeQuestFlag(talker,185) == 0 && gg::GetMemoState(talker,185) == 3 ) {
							myself::ShowPage(talker,"alarm_of_giant_q0184_q0185_02.htm");
						}
					}
					if( reply == 3 ) {
						if( gg::HaveMemo(talker,184) == 1 && myself::GetOneTimeQuestFlag(talker,184) == 0 && gg::GetMemoState(talker,184) == 3 ) {
							myself::SetMemoStateEx(talker,184,1,1);
							myself::ShowPage(talker,"alarm_of_giant_q0184_q0184_04.htm");
						} else if( gg::HaveMemo(talker,185) == 1 && myself::GetOneTimeQuestFlag(talker,185) == 0 && gg::GetMemoState(talker,185) == 3 ) {
							myself::SetMemoStateEx(talker,185,1,1);
							myself::ShowPage(talker,"alarm_of_giant_q0184_q0185_04.htm");
						}
					}
					if( reply == 4 ) {
						if( gg::HaveMemo(talker,184) == 1 && myself::GetOneTimeQuestFlag(talker,184) == 0 && gg::GetMemoState(talker,184) == 3 ) {
							i0 = gg::GetMemoStateEx(talker,184,1);
							myself::SetMemoStateEx(talker,184,1,( i0 + 1 ));
							myself::ShowPage(talker,"alarm_of_giant_q0184_q0184_06.htm");
						} else if( gg::HaveMemo(talker,185) == 1 && myself::GetOneTimeQuestFlag(talker,185) == 0 && gg::GetMemoState(talker,185) == 3 ) {
							i0 = gg::GetMemoStateEx(talker,185,1);
							myself::SetMemoStateEx(talker,185,1,( i0 + 1 ));
							myself::ShowPage(talker,"alarm_of_giant_q0184_q0185_06.htm");
						}
					}
					if( reply == 5 ) {
						if( gg::HaveMemo(talker,184) == 1 && myself::GetOneTimeQuestFlag(talker,184) == 0 && gg::GetMemoState(talker,184) == 3 ) {
							i0 = gg::GetMemoStateEx(talker,184,1);
							myself::SetMemoStateEx(talker,184,1,( i0 + 1 ));
							myself::ShowPage(talker,"alarm_of_giant_q0184_q0184_08.htm");
						} else if( gg::HaveMemo(talker,185) == 1 && myself::GetOneTimeQuestFlag(talker,185) == 0 && gg::GetMemoState(talker,185) == 3 ) {
							i0 = gg::GetMemoStateEx(talker,185,1);
							myself::SetMemoStateEx(talker,185,1,( i0 + 1 ));
							myself::ShowPage(talker,"alarm_of_giant_q0184_q0185_08.htm");
						}
					}
					if( reply == 6 ) {
						if( gg::HaveMemo(talker,184) == 1 && myself::GetOneTimeQuestFlag(talker,184) == 0 && gg::GetMemoState(talker,184) == 3 ) {
							i0 = gg::GetMemoStateEx(talker,184,1);
							if( i0 >= 3 ) {
								npc0 = gg::GetNPCFromID(myself.sm.param3);
								if( gg::IsNull(npc0) == 0 ) {
									if( npc0.i_quest0 == 1 ) {
										npc0.i_quest0 = 0;
									}
								}
								myself::Despawn();
								myself::ShowPage(talker,"alarm_of_giant_q0184_q0184_09.htm");
								myself::SetMemoState(talker,184,4);
							} else {
								myself::ShowPage(talker,"alarm_of_giant_q0184_q0184_10.htm");
								myself::SetMemoStateEx(talker,184,1,0);
							}
						} else if( gg::HaveMemo(talker,185) == 1 && myself::GetOneTimeQuestFlag(talker,185) == 0 && gg::GetMemoState(talker,185) == 3 ) {
							i0 = gg::GetMemoStateEx(talker,185,1);
							if( i0 >= 3 ) {
								npc0 = gg::GetNPCFromID(myself.sm.param3);
								if( gg::IsNull(npc0) == 0 ) {
									if( npc0.i_quest0 == 1 ) {
										npc0.i_quest0 = 0;
									}
								}
								myself::Despawn();
								myself::ShowPage(talker,"alarm_of_giant_q0184_q0185_09.htm");
								myself::SetMemoState(talker,185,4);
							} else {
								myself::ShowPage(talker,"alarm_of_giant_q0184_q0185_10.htm");
								myself::SetMemoStateEx(talker,185,1,0);
							}
						}
					}
				}
			}
		}
		super;
	}

}
