@LabelIndex 414231
@StringIndex 62699
class 0 aden_feud_manager : feud_manager {
handler:
	EventHandler TALK_SELECTED(fhtml0,i1,i2,i3,i4,i5,i6,talker) {
		if( _from_choice == 0 ) {
			if( gg::GetDominionWarState(85) == 5 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 0;
				myself::AddChoice(0,"For the Sake of the Territory - Oren (in progress)");
			}
			if( gg::GetDominionWarState(85) != 5 ) {
				_choiceN = ( _choiceN + 1 );
				_code = 1;
				myself::AddChoice(1,"For the Sake of the Territory - Oren (in progress)");
			}
			if( _choiceN > 1 ) {
				myself::ShowChoicePage(talker,1);
				return;
			}
		}
		if( _from_choice || _choiceN == 1 ) {
			switch(_code) {
				case 0: {
					if( _from_choice == 0 || gg::GetDominionWarState(85) == 5 ) {
						myself::SetCurrentQuestID(721);
						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;
						}
						i1 = gg::GetNRMemoStateEx(talker,728,1);
						if( i1 == 85 ) {
							myself::ShowPage(talker,"aden_feud_manager_q0721_01.htm");
						} else {
							myself::ShowPage(talker,"aden_feud_manager_q0721_02.htm");
						}
					}
					break;
				}
				case 1: {
					if( _from_choice == 0 || gg::GetDominionWarState(85) != 5 ) {
						myself::SetCurrentQuestID(721);
						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;
						}
						i1 = gg::GetNRMemoState(talker,721);
						i2 = gg::GetNRMemoState(talker,728);
						i3 = gg::GetNRMemoStateEx(talker,728,1);
						if( i3 == 85 ) {
							if( i2 < 0 ) {
								myself::ShowPage(talker,"aden_feud_manager_q0721_03a.htm");
							} else if( i2 == 0 ) {
								myself::ShowPage(talker,"aden_feud_manager_q0721_04.htm");
							} else if( i2 < 900 ) {
								i4 = ( i2 / 10 );
								i5 = ( ( i2 - ( i4 * 5 ) ) * 1000 );
								myself::FHTML_SetFileName(fhtml0,"aden_feud_manager_q0721_05.htm");
								myself::FHTML_SetStr(fhtml0,"bosang",gg::MakeFString(71753,gg::IntToStr(i4),gg::IntToStr(i5),"","",""));
								myself::ShowFHTML(talker,fhtml0);
							} else if( i2 < 1800 ) {
								i4 = ( ( i2 - 900 ) / 2 );
								i5 = ( ( i4 * 1000 ) + 450000 );
								myself::FHTML_SetFileName(fhtml0,"aden_feud_manager_q0721_05.htm");
								myself::FHTML_SetStr(fhtml0,"bosang",gg::MakeFString(71754,gg::IntToStr(i4),gg::IntToStr(i5),"","",""));
								myself::ShowFHTML(talker,fhtml0);
							} else {
								i4 = ( i2 - 900 );
								i5 = ( i4 * 1000 );
								myself::FHTML_SetFileName(fhtml0,"aden_feud_manager_q0721_05.htm");
								myself::FHTML_SetStr(fhtml0,"bosang",gg::MakeFString(71755,gg::IntToStr(i5),"","","",""));
								myself::ShowFHTML(talker,fhtml0);
							}
						} else if( i3 > 80 ) {
							myself::FHTML_SetFileName(fhtml0,"aden_feud_manager_q0721_03.htm");
							myself::FHTML_SetStr(fhtml0,"dominion",gg::MakeFString(( 72900 + i3 ),"","","","",""));
							myself::ShowFHTML(talker,fhtml0);
						} else {
							myself::ShowPage(talker,"aden_feud_manager_q0721_03a.htm");
						}
					}
					break;
				}
			}
			return;
		}
		super;
	}

	EventHandler MENU_SELECTED(ask,c0,c1,fhtml0,i0,i1,i2,i3,i4,i5,i6,i7,i8,i9,pledge0,reply,talker) {
		if( ask == 721 ) {
			myself::SetCurrentQuestID(721);
			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 == 721 ) {
			if( reply == 1 ) {
				myself::ShowPage(talker,"aden_feud_manager_q0721_06.htm");
			}
			if( reply == 2 ) {
				if( gg::GetDominionWarState(85) != 5 ) {
					myself::ShowPage(talker,"aden_feud_manager_q0721_07.htm");
					i1 = gg::GetNRMemoState(talker,721);
					i2 = gg::GetNRMemoState(talker,728);
					i3 = gg::GetNRMemoStateEx(talker,728,1);
					if( i2 <= 0 ) {
					} else if( i2 < 900 ) {
						i4 = ( i2 / 10 );
						i5 = ( i2 - ( i4 * 5 ) );
						myself::GiveItem1(talker,13761,i4);
						myself::GiveItem1(talker,57,( i5 * 1000 ));
						myself::SetNRMemoState(talker,728,0);
					} else if( i2 < 1800 ) {
						i4 = ( ( i2 - 900 ) / 2 );
						i5 = ( ( i4 * 1000 ) + 450000 );
						myself::GiveItem1(talker,13761,90);
						myself::UpdatePVPPoint(talker,i4);
						myself::GiveItem1(talker,57,i5);
						myself::SetNRMemoState(talker,728,0);
					} else {
						i4 = ( i2 - 900 );
						i5 = ( i4 * 1000 );
						myself::GiveItem1(talker,13761,90);
						myself::UpdatePVPPoint(talker,450);
						myself::GiveItem1(talker,57,i5);
						myself::SetNRMemoState(talker,728,0);
					}
				}
			}
		}
		super;
	}

}
