public static void EndDDGame( PlayerMobile from, Mobile m ) { PlayerMobile pm = from as PlayerMobile; if ( pm == null ) return; Howey bc = m as Howey; if ( bc == null ) return; Item check = pm.Backpack.FindItemByType(typeof(DoNDGameDeed) ); if ( check == null ) return; DoNDGameDeed gd = check as DoNDGameDeed; if ( gd == null ) return; if ( gd.GameOver == false ) return; Timer g_timer = new CloseGameTimer( pm, bc, gd ); g_timer.Start(); List<Mobile> toDelete = new List<Mobile>(); foreach (Mobile mobile in World.Mobiles.Values) { if (mobile is PlayerMobile) { continue; } if (mobile is BaseCreature) { if (mobile is Girls) { toDelete.Add(mobile); } } } foreach (Mobile Girls in toDelete) Girls.Delete(); toDelete.Clear(); if (pm.HasGump( typeof( DoNDPlayerGump ))) pm.CloseGump( typeof( DoNDPlayerGump ) ); if ( bc.DeBugger == true ) Console.WriteLine( "DeBug : System, End Game OK" ); }
public static void PickOrder( PlayerMobile from, Mobile m ) { PlayerMobile pm = from as PlayerMobile; if ( pm == null ) return; Howey bc = m as Howey; if ( bc == null ) return; Item check = pm.Backpack.FindItemByType(typeof(DoNDGameDeed) ); if ( check == null ) return; DoNDGameDeed gd = check as DoNDGameDeed; if ( gd == null ) return; if ( gd.PA == 0 ) { CaseSelection( pm, bc ); if (pm.HasGump( typeof( DoNDMainGump ))) pm.CloseGump( typeof( DoNDMainGump ) ); pm.SendGump( new DoNDMainGump( pm, gd ) ); if ( bc.DeBugger == true ) Console.WriteLine( "DeBug : System, PickOrder, Pick Your Case OK" ); return; } if ( gd.Deal == true ) { CaseSelection( pm, bc ); PrizeCheck( pm, bc ); BankOffer( pm, bc ); if (pm.HasGump( typeof( DoNDMainGump ))) pm.CloseGump( typeof( DoNDMainGump ) ); pm.SendGump( new DoNDMainGump( pm, gd ) ); if ( bc.DeBugger == true ) Console.WriteLine( "DeBug : System, PickOrder, Deal By Pass OK" ); return; } if ( gd.StageOne == true ) { if ( gd.SubStageOne == true ) { CaseSelection( pm, bc ); if (pm.HasGump( typeof( DoNDMainGump ))) pm.CloseGump( typeof( DoNDMainGump ) ); pm.SendGump( new DoNDMainGump( pm, gd ) ); bc.Say( pm.Name + ", Please Pick Five Case's!"); gd.SubStageOne = false; gd.SubStageTwo = true; if ( bc.DeBugger == true ) Console.WriteLine( "DeBug : System, PickOrder, Stage one/one OK" ); return; } if ( gd.SubStageTwo == true ) { CaseSelection( pm, bc ); if (pm.HasGump( typeof( DoNDMainGump ))) pm.CloseGump( typeof( DoNDMainGump ) ); pm.SendGump( new DoNDMainGump( pm, gd ) ); bc.Say( pm.Name + ", Please Pick Four Case's!"); gd.SubStageTwo = false; gd.SubStageThree = true; if ( bc.DeBugger == true ) Console.WriteLine( "DeBug : System, PickOrder, Stage one/two OK" ); return; } if ( gd.SubStageThree == true ) { CaseSelection( pm, bc ); if (pm.HasGump( typeof( DoNDMainGump ))) pm.CloseGump( typeof( DoNDMainGump ) ); pm.SendGump( new DoNDMainGump( pm, gd ) ); bc.Say( pm.Name + ", Please Pick Three Case's!"); gd.SubStageThree = false; gd.SubStageFour = true; if ( bc.DeBugger == true ) Console.WriteLine( "DeBug : System, PickOrder, Stage one/three OK" ); return; } if ( gd.SubStageFour == true ) { CaseSelection( pm, bc ); if (pm.HasGump( typeof( DoNDMainGump ))) pm.CloseGump( typeof( DoNDMainGump ) ); pm.SendGump( new DoNDMainGump( pm, gd ) ); bc.Say( pm.Name + ", Please Pick Two Case's!"); gd.SubStageFour = false; gd.SubStageFive = true; if ( bc.DeBugger == true ) Console.WriteLine( "DeBug : System, PickOrder, Stage one/four OK" ); return; } if ( gd.SubStageFive == true ) { CaseSelection( pm, bc ); if (pm.HasGump( typeof( DoNDMainGump ))) pm.CloseGump( typeof( DoNDMainGump ) ); pm.SendGump( new DoNDMainGump( pm, gd ) ); bc.Say( pm.Name + ", Please Pick One Case!"); gd.SubStageFive = false; gd.SubStageSix = true; if ( bc.DeBugger == true ) Console.WriteLine( "DeBug : System, PickOrder, Stage one/five OK" ); return; } if ( gd.SubStageSix == true ) { CaseSelection( pm, bc ); gd.OfferSel = true; gd.CaseSel = false; bc.Banker = true; if (pm.HasGump( typeof( DoNDMainGump ))) pm.CloseGump( typeof( DoNDMainGump ) ); pm.SendGump( new DoNDMainGump( pm, gd ) ); bc.Say( pm.Name + ", Banker's Calling!"); gd.SubStageSix = false; pm.PlaySound( 1447 ); if ( bc.DeBugger == true ) Console.WriteLine( "DeBug : System, PickOrder, Stage one/six OK" ); return; } if ( gd.Banker == true ) { BankOffer( pm, bc ); if (pm.HasGump( typeof( DoNDMainGump ))) pm.CloseGump( typeof( DoNDMainGump ) ); pm.SendGump( new DoNDMainGump( pm, gd ) ); gd.StageOne = false; gd.StageTwo = true; bc.Say( pm.Name + ", Lets hear the Banker's offer!"); if ( bc.DeBugger == true ) Console.WriteLine( "DeBug : System, PickOrder, Stage one/banker OK" ); return; } } if ( gd.StageTwo == true ) { if ( gd.SubStageOne2 == true ) { CaseSelection( pm, bc ); if (pm.HasGump( typeof( DoNDMainGump ))) pm.CloseGump( typeof( DoNDMainGump ) ); pm.SendGump( new DoNDMainGump( pm, gd ) ); bc.Say( pm.Name + ", Please Pick Four Case's!"); gd.SubStageOne2 = false; gd.SubStageTwo2 = true; if ( bc.DeBugger == true ) Console.WriteLine( "DeBug : System, PickOrder, Stage two/one OK" ); return; } if ( gd.SubStageTwo2 == true ) { CaseSelection( pm, bc ); if (pm.HasGump( typeof( DoNDMainGump ))) pm.CloseGump( typeof( DoNDMainGump ) ); pm.SendGump( new DoNDMainGump( pm, gd ) ); bc.Say( pm.Name + ", Please Pick Three Case's!"); gd.SubStageTwo2 = false; gd.SubStageThree2 = true; if ( bc.DeBugger == true ) Console.WriteLine( "DeBug : System, PickOrder, Stage two/two OK" ); return; } if ( gd.SubStageThree2 == true ) { CaseSelection( pm, bc ); if (pm.HasGump( typeof( DoNDMainGump ))) pm.CloseGump( typeof( DoNDMainGump ) ); pm.SendGump( new DoNDMainGump( pm, gd ) ); bc.Say( pm.Name + ", Please Pick Two Case's!"); gd.SubStageThree2 = false; gd.SubStageFour2 = true; if ( bc.DeBugger == true ) Console.WriteLine( "DeBug : System, PickOrder, Stage two/three OK" ); return; } if ( gd.SubStageFour2 == true ) { CaseSelection( pm, bc ); if (pm.HasGump( typeof( DoNDMainGump ))) pm.CloseGump( typeof( DoNDMainGump ) ); pm.SendGump( new DoNDMainGump( pm, gd ) ); bc.Say( pm.Name + ", Please Pick One Case!"); gd.SubStageFour2 = false; gd.SubStageFive2 = true; if ( bc.DeBugger == true ) Console.WriteLine( "DeBug : System, PickOrder, Stage two/four OK" ); return; } if ( gd.SubStageFive2 == true ) { CaseSelection( pm, bc ); gd.OfferSel = true; gd.CaseSel = false; bc.Banker = true; if (pm.HasGump( typeof( DoNDMainGump ))) pm.CloseGump( typeof( DoNDMainGump ) ); pm.SendGump( new DoNDMainGump( pm, gd ) ); bc.Say( pm.Name + ", Banker's Calling!"); gd.SubStageFive2 = false; pm.PlaySound( 1447 ); if ( bc.DeBugger == true ) Console.WriteLine( "DeBug : System, PickOrder, Stage two/five OK" ); return; } if ( gd.Banker == true ) { BankOffer( pm, bc ); if (pm.HasGump( typeof( DoNDMainGump ))) pm.CloseGump( typeof( DoNDMainGump ) ); pm.SendGump( new DoNDMainGump( pm, gd ) ); gd.StageTwo = false; gd.StageThree = true; bc.Say( pm.Name + ", Lets hear the Banker's offer!"); if ( bc.DeBugger == true ) Console.WriteLine( "DeBug : System, PickOrder, Stage two/banker OK" ); return; } } if ( gd.StageThree == true ) { if ( gd.SubStageOne3 == true ) { CaseSelection( pm, bc ); if (pm.HasGump( typeof( DoNDMainGump ))) pm.CloseGump( typeof( DoNDMainGump ) ); pm.SendGump( new DoNDMainGump( pm, gd ) ); bc.Say( pm.Name + ", Please Pick Three Case's!"); gd.SubStageOne3 = false; gd.SubStageTwo3 = true; if ( bc.DeBugger == true ) Console.WriteLine( "DeBug : System, PickOrder, Stage three/one OK" ); return; } if ( gd.SubStageTwo3 == true ) { CaseSelection( pm, bc ); if (pm.HasGump( typeof( DoNDMainGump ))) pm.CloseGump( typeof( DoNDMainGump ) ); pm.SendGump( new DoNDMainGump( pm, gd ) ); bc.Say( pm.Name + ", Please Pick Two Case's!"); gd.SubStageTwo3 = false; gd.SubStageThree3 = true; if ( bc.DeBugger == true ) Console.WriteLine( "DeBug : System, PickOrder, Stage three/two OK" ); return; } if ( gd.SubStageThree3 == true ) { CaseSelection( pm, bc ); if (pm.HasGump( typeof( DoNDMainGump ))) pm.CloseGump( typeof( DoNDMainGump ) ); pm.SendGump( new DoNDMainGump( pm, gd ) ); bc.Say( pm.Name + ", Please Pick One Case!"); gd.SubStageThree3 = false; gd.SubStageFour3 = true; if ( bc.DeBugger == true ) Console.WriteLine( "DeBug : System, PickOrder, Stage three/three OK" ); return; } if ( gd.SubStageFour3 == true ) { CaseSelection( pm, bc ); gd.OfferSel = true; gd.CaseSel = false; bc.Banker = true; if (pm.HasGump( typeof( DoNDMainGump ))) pm.CloseGump( typeof( DoNDMainGump ) ); pm.SendGump( new DoNDMainGump( pm, gd ) ); bc.Say( pm.Name + ", Banker's Calling!"); gd.SubStageFour3 = false; pm.PlaySound( 1447 ); if ( bc.DeBugger == true ) Console.WriteLine( "DeBug : System, PickOrder, Stage three/four OK" ); return; } if ( gd.Banker == true ) { BankOffer( pm, bc ); if (pm.HasGump( typeof( DoNDMainGump ))) pm.CloseGump( typeof( DoNDMainGump ) ); pm.SendGump( new DoNDMainGump( pm, gd ) ); gd.StageThree = false; gd.StageFour = true; bc.Say( pm.Name + ", Lets hear the Banker's offer!"); if ( bc.DeBugger == true ) Console.WriteLine( "DeBug : System, PickOrder, Stage three/banker OK" ); return; } } if ( gd.StageFour == true ) { if ( gd.SubStageOne4 == true ) { CaseSelection( pm, bc ); if (pm.HasGump( typeof( DoNDMainGump ))) pm.CloseGump( typeof( DoNDMainGump ) ); pm.SendGump( new DoNDMainGump( pm, gd ) ); bc.Say( pm.Name + ", Please Pick Two Case's!"); gd.SubStageOne4 = false; gd.SubStageTwo4 = true; if ( bc.DeBugger == true ) Console.WriteLine( "DeBug : System, PickOrder, Stage four/one OK" ); return; } if ( gd.SubStageTwo4 == true ) { CaseSelection( pm, bc ); if (pm.HasGump( typeof( DoNDMainGump ))) pm.CloseGump( typeof( DoNDMainGump ) ); pm.SendGump( new DoNDMainGump( pm, gd ) ); bc.Say( pm.Name + ", Please Pick One Case!"); gd.SubStageTwo4 = false; gd.SubStageThree4 = true; if ( bc.DeBugger == true ) Console.WriteLine( "DeBug : System, PickOrder, Stage four/two OK" ); return; } if ( gd.SubStageThree4 == true ) { CaseSelection( pm, bc ); gd.OfferSel = true; gd.CaseSel = false; bc.Banker = true; gd.Commercial = true; if (pm.HasGump( typeof( DoNDMainGump ))) pm.CloseGump( typeof( DoNDMainGump ) ); pm.SendGump( new DoNDMainGump( pm, gd ) ); bc.Say( pm.Name + ", Banker's Calling!"); gd.SubStageThree4 = false; pm.PlaySound( 1447 ); if ( bc.DeBugger == true ) Console.WriteLine( "DeBug : System, PickOrder, Stage four/three OK" ); return; } if ( gd.Banker == true ) { BankOffer( pm, bc ); if (pm.HasGump( typeof( DoNDMainGump ))) pm.CloseGump( typeof( DoNDMainGump ) ); pm.SendGump( new DoNDMainGump( pm, gd ) ); gd.StageFour = false; gd.StageFive = true; bc.Say( pm.Name + ", Lets hear the Banker's offer!"); if ( bc.DeBugger == true ) Console.WriteLine( "DeBug : System, PickOrder, Stage four/banker OK" ); return; } } if ( gd.StageFive == true ) { if ( gd.SubStageOne5 == true ) { CaseSelection( pm, bc ); if (pm.HasGump( typeof( DoNDMainGump ))) pm.CloseGump( typeof( DoNDMainGump ) ); pm.SendGump( new DoNDMainGump( pm, gd ) ); bc.Say( pm.Name + ", Please Pick One Case!"); gd.SubStageOne5 = false; gd.SubStageTwo5 = true; if ( bc.DeBugger == true ) Console.WriteLine( "DeBug : System, PickOrder, Stage five/one OK" ); return; } if ( gd.SubStageTwo5 == true ) { CaseSelection( pm, bc ); gd.OfferSel = true; gd.CaseSel = false; bc.Banker = true; if (pm.HasGump( typeof( DoNDMainGump ))) pm.CloseGump( typeof( DoNDMainGump ) ); pm.SendGump( new DoNDMainGump( pm, gd ) ); bc.Say( pm.Name + ", Banker's Calling!"); gd.SubStageTwo5 = false; pm.PlaySound( 1447 ); if ( bc.DeBugger == true ) Console.WriteLine( "DeBug : System, PickOrder, Stage five/two OK" ); return; } if ( gd.Banker == true ) { BankOffer( pm, bc ); if (pm.HasGump( typeof( DoNDMainGump ))) pm.CloseGump( typeof( DoNDMainGump ) ); pm.SendGump( new DoNDMainGump( pm, gd ) ); gd.StageFive = false; gd.StageSix = true; bc.Say( pm.Name + ", Lets hear the Banker's offer!"); if ( bc.DeBugger == true ) Console.WriteLine( "DeBug : System, PickOrder, Stage five/banker OK" ); return; } } if ( gd.StageSix == true ) { if ( gd.SubStageOne6 == true ) { CaseSelection( pm, bc ); gd.OfferSel = true; gd.CaseSel = false; bc.Banker = true; if (pm.HasGump( typeof( DoNDMainGump ))) pm.CloseGump( typeof( DoNDMainGump ) ); pm.SendGump( new DoNDMainGump( pm, gd ) ); bc.Say( pm.Name + ", Banker's Calling!"); gd.SubStageOne6 = false; pm.PlaySound( 1447 ); if ( bc.DeBugger == true ) Console.WriteLine( "DeBug : System, PickOrder, Stage six/one OK" ); return; } if ( gd.Banker == true ) { BankOffer( pm, bc ); if (pm.HasGump( typeof( DoNDMainGump ))) pm.CloseGump( typeof( DoNDMainGump ) ); pm.SendGump( new DoNDMainGump( pm, gd ) ); gd.StageSix = false; gd.StageSeven = true; bc.Say( pm.Name + ", Lets hear the Banker's offer!"); if ( bc.DeBugger == true ) Console.WriteLine( "DeBug : System, PickOrder, Stage six/banker OK" ); return; } } if ( gd.StageSeven == true ) { if ( gd.SubStageOne7 == true ) { CaseSelection( pm, bc ); gd.OfferSel = true; gd.CaseSel = false; bc.Banker = true; if (pm.HasGump( typeof( DoNDMainGump ))) pm.CloseGump( typeof( DoNDMainGump ) ); pm.SendGump( new DoNDMainGump( pm, gd ) ); bc.Say( pm.Name + ", Banker's Calling!"); gd.SubStageOne7 = false; pm.PlaySound( 1447 ); if ( bc.DeBugger == true ) Console.WriteLine( "DeBug : System, PickOrder, Stage seven/one OK" ); return; } if ( gd.Banker == true ) { BankOffer( pm, bc ); if (pm.HasGump( typeof( DoNDMainGump ))) pm.CloseGump( typeof( DoNDMainGump ) ); pm.SendGump( new DoNDMainGump( pm, gd ) ); gd.StageSeven = false; gd.StageEight = true; bc.Say( pm.Name + ", Lets hear the Banker's offer!"); if ( bc.DeBugger == true ) Console.WriteLine( "DeBug : System, PickOrder, Stage seven/banker OK" ); return; } } if ( gd.StageEight == true ) { if ( gd.SubStageOne8 == true ) { CaseSelection( pm, bc ); gd.OfferSel = true; gd.CaseSel = false; bc.Banker = true; if (pm.HasGump( typeof( DoNDMainGump ))) pm.CloseGump( typeof( DoNDMainGump ) ); pm.SendGump( new DoNDMainGump( pm, gd ) ); bc.Say( pm.Name + ", Banker's Calling!"); gd.SubStageOne8 = false; pm.PlaySound( 1447 ); if ( bc.DeBugger == true ) Console.WriteLine( "DeBug : System, PickOrder, Stage eight/one OK" ); return; } if ( gd.Banker == true ) { BankOffer( pm, bc ); if (pm.HasGump( typeof( DoNDMainGump ))) pm.CloseGump( typeof( DoNDMainGump ) ); pm.SendGump( new DoNDMainGump( pm, gd ) ); gd.StageEight = false; gd.StageNine = true; bc.Say( pm.Name + ", Lets hear the Banker's offer!"); if ( bc.DeBugger == true ) Console.WriteLine( "DeBug : System, PickOrder, Stage eight/banker OK" ); return; } } if ( gd.StageNine == true ) { if ( gd.SubStageOne9 == true ) { CaseSelection( pm, bc ); gd.OfferSel = true; gd.CaseSel = false; bc.Banker = true; if (pm.HasGump( typeof( DoNDMainGump ))) pm.CloseGump( typeof( DoNDMainGump ) ); pm.SendGump( new DoNDMainGump( pm, gd ) ); bc.Say( pm.Name + ", Banker's Calling!"); gd.SubStageOne9 = false; pm.PlaySound( 1447 ); if ( bc.DeBugger == true ) Console.WriteLine( "DeBug : System, PickOrder, Stage nine/one OK" ); return; } if ( gd.Banker == true ) { BankOffer( pm, bc ); if (pm.HasGump( typeof( DoNDMainGump ))) pm.CloseGump( typeof( DoNDMainGump ) ); pm.SendGump( new DoNDMainGump( pm, gd ) ); gd.StageNine = false; gd.StageTen = true; bc.Say( pm.Name + ", Lets hear the Banker's offer!"); if ( bc.DeBugger == true ) Console.WriteLine( "DeBug : System, PickOrder, Stage nine/banker OK" ); return; } } if ( gd.StageTen == true ) { gd.PO = 0; if ( gd.Trade == true ) { TradeOffer( pm, bc ); if (pm.HasGump( typeof( DoNDMainGump ))) pm.CloseGump( typeof( DoNDMainGump ) ); pm.SendGump( new DoNDMainGump( pm, gd ) ); if ( bc.DeBugger == true ) Console.WriteLine( "DeBug : System, PickOrder, Stage ten/trade OK" ); return; } if ( gd.NoTrade == true ) { bc.Say( pm.Name + ", The Last case had....!"); CaseSelection( pm, bc ); if (pm.HasGump( typeof( DoNDMainGump ))) pm.CloseGump( typeof( DoNDMainGump ) ); pm.SendGump( new DoNDMainGump( pm, gd ) ); if ( bc.DeBugger == true ) Console.WriteLine( "DeBug : System, PickOrder, Stage ten/NoTrade OK" ); Timer g_timer = new CloseGameTimer( pm, bc, gd ); g_timer.Start(); return; } } }