public override void OnDeath(Mobile m) { if (!Controller.InUse) { return; } if (m is PlayerMobile) { m.SendMessage("You have died in the RVS Duel!!"); for (int x = 0; x < 5; x++) { Controller.LaunchFireworks(m); } Timer.DelayCall(TimeSpan.FromSeconds(5.0), new TimerStateCallback(Controller.HandleDeath), (object)m); } else if (m is BaseCreature) //CHANGE THIS WHEN APPROPRIATE { if (Controller.SheepPoints >= Controller.Handeling.MonstersOverwhelm) { Controller.DeleteEnemies(); Controller.EndRVS(1); //Rabbits Have Won } else if (Controller.RabbitPoints >= Controller.Handeling.MonstersOverwhelm) { Controller.DeleteEnemies(); Controller.EndRVS(2); //Sheep Have Won } else if (this.RegionName == "Sheep") { Controller.SpawnEnemies(Controller.Handeling, "Rabbit", 2); Controller.SheepPoints--; Controller.RabbitPoints++; Controller.RabbitPoints++; Controller.Handeling.EchoMessage(String.Format("Team Rabbit has {0} Points!", Controller.RabbitPoints.ToString())); } else if (this.RegionName == "Rabbit") { Controller.SpawnEnemies(Controller.Handeling, "Sheep", 2); Controller.RabbitPoints--; Controller.SheepPoints++; Controller.SheepPoints++; Controller.Handeling.EchoMessage(String.Format("Team Sheep has {0} Points!", Controller.SheepPoints.ToString())); } } else { m.Corpse.Delete(); } }
public void EndSelf() { if (Ended) { return; } if (InProgress) { Controller.EndRVS(0); } Ended = true; IEnumerator key = Teams.Keys.GetEnumerator(); // creates the key variable so we can iterate through the Teams dictionary for (int i = 0; i < Teams.Count; ++i) // Iterates through the Teams dictionary using a for loop { key.MoveNext(); // Moves the enumerator to its next item RVS_Team d_team = (RVS_Team)Teams[(int)key.Current]; // creates a variable referencing the currently iterated team for (int i2 = 0; i2 < d_team.Players.Count; ++i2) { object o = (object)d_team.Players[i2]; if (o is PlayerMobile) { PlayerMobile pm = (PlayerMobile)d_team.Players[i2]; RefundBuyIn(pm); pm.CloseGump(typeof(RVSSetup_Main)); pm.CloseGump(typeof(RVSSetup_Pending)); pm.CloseGump(typeof(RVSSetup_ParticipantSetup)); pm.CloseGump(typeof(RVSSetup_AddParticipant)); pm.CloseGump(typeof(RVSSetup_Rules_View)); pm.CloseGump(typeof(RVSSetup_ViewParticipants)); pm.CloseGump(typeof(RVSSetup_Rules_Armor_View)); pm.CloseGump(typeof(RVSSetup_Rules_Combat_View)); pm.CloseGump(typeof(RVSSetup_Rules_Items_View)); pm.CloseGump(typeof(RVSSetup_Rules_Skills_View)); pm.CloseGump(typeof(RVSSetup_Rules_Weapons_View)); pm.CloseGump(typeof(RVSSetup_Rules_Spells_View)); pm.CloseGump(typeof(RVSSetup_Rules_Spells_1st_View)); pm.CloseGump(typeof(RVSSetup_Rules_Spells_2nd_View)); pm.CloseGump(typeof(RVSSetup_Rules_Spells_3rd_View)); pm.CloseGump(typeof(RVSSetup_Rules_Spells_4th_View)); pm.CloseGump(typeof(RVSSetup_Rules_Spells_5th_View)); pm.CloseGump(typeof(RVSSetup_Rules_Spells_6th_View)); pm.CloseGump(typeof(RVSSetup_Rules_Spells_7th_View)); pm.CloseGump(typeof(RVSSetup_Rules_Spells_8th_View)); } } } EchoMessage(String.Format("The RVS duel has been cancelled.")); if (RVS_Config.Registry.Contains(this)) { RVS_Config.Registry.Remove(this); } }