public void HandleDeath(Mobile m) { HandleCorpse(m); DMHorse.TryRemoveHorse(m); m.Frozen = true; var t = new ResurrectTimer(m, this); m_ResurrectionTimers[m.Serial] = t; t.Start(); if (m.LastKiller == m) { m.LastKiller = null; } if (m.LastKiller != null) { FixPlayer(m.LastKiller, false); m.LastKiller.SendMessage(38, "You have been rewarded health, mana, and stamina for your kill"); } UpdateScores(m, m.LastKiller); m.LastKiller = null; new ResurrectMessageTimer(m).Start(); }
internal void doResurrection(Mobile from) { from.Frozen = false; if (m_ResurrectionTimers.ContainsKey(from.Serial)) { m_ResurrectionTimers[from.Serial].Stop(); m_ResurrectionTimers.Remove(from.Serial); } from.Resurrect(); SpawnMobile(from); FixPlayer(from, true); DMHorse.TryGiveHorse(from); }
private void ReadyPlayer(Mobile m) { if (!m_ScoreTable.ContainsKey(m.Serial)) { m_ScoreTable.Add(m.Serial, new ScoreKeeper(m)); } if (!m_UseSphereRules) { #region DistroCode bool MagicWeapons = MagicWeaponRule == pMagicWeaponRule.Allowed; bool MagicArmor = MagicArmorRule == pMagicArmorRule.Allowed; bool Potions = PotionRule == pPotionRule.Allowed; bool Bandages = BandageRule == pBandaidRule.Allowed; bool Pets = PetRule == pPetRule.Allowed; bool Mounts = MountRule == pMountRule.Allowed; if (!m.Alive) { m.Resurrect(); } Container bp = m.Backpack; Container bag = new Bag(); bag.Hue = 38; BankBox bank = m.BankBox; Item oncurs = m.Holding; if (oncurs != null) { bp.DropItem(oncurs); } m.CurePoison(m); m.Hits = m.HitsMax; m.Mana = m.ManaMax; m.Stam = m.StamMax; m.StatMods.Clear(); List <Item> items = new List <Item>(); foreach (Layer layer in PvpCore.EquipmentLayers) { Item item = m.FindItemOnLayer(layer); if (item != null) { if (item is BaseWeapon && !MagicWeapons) { BaseWeapon weapon = (BaseWeapon)item; if (weapon.AccuracyLevel != WeaponAccuracyLevel.Regular) { items.Add(weapon); } else if (weapon.DamageLevel != WeaponDamageLevel.Regular) { items.Add(weapon); } else if (weapon.DurabilityLevel != WeaponDurabilityLevel.Regular) { items.Add(weapon); } } else if (item is BaseArmor && !MagicArmor) { BaseArmor armor = (BaseArmor)item; if (armor.Durability != ArmorDurabilityLevel.Regular) { items.Add(armor); } else if (armor.ProtectionLevel != ArmorProtectionLevel.Regular) { items.Add(armor); } } } } if (m.Backpack != null) { foreach (Item item in m.Backpack.Items) { if (item != null) { if (item is BaseWeapon && !MagicWeapons) { BaseWeapon weapon = (BaseWeapon)item; if (weapon.AccuracyLevel != WeaponAccuracyLevel.Regular) { items.Add(weapon); } else if (weapon.DamageLevel != WeaponDamageLevel.Regular) { items.Add(weapon); } else if (weapon.DurabilityLevel != WeaponDurabilityLevel.Regular) { items.Add(weapon); } } else if (item is BaseArmor && !MagicArmor) { BaseArmor armor = (BaseArmor)item; if (armor.Durability != ArmorDurabilityLevel.Regular) { items.Add(armor); } else if (armor.ProtectionLevel != ArmorProtectionLevel.Regular) { items.Add(armor); } } else if (item is BasePotion && !Potions) { items.Add(item); } else if (item is EtherealMount && !Mounts) { items.Add(item); } else if (item is Bandage && !Bandages) { items.Add(item); } } } } if (!Mounts) { if (m.Mount != null) { IMount mount = m.Mount; mount.Rider = null; if (mount is BaseMount) { if (mount is BaseCreature) { BaseCreature bc = (BaseCreature)mount; bc.ControlTarget = null; bc.ControlOrder = OrderType.Stay; bc.Internalize(); bc.SetControlMaster(null); bc.SummonMaster = null; bc.IsStabled = true; m.Stabled.Add(bc); MountCollection.Add(m.Serial, bc); m.SendMessage(38, "Your mount has been moved to the your stables"); } } } } if (items.Count > 0) { m.SendMessage(38, "You had items that did not meet the requirements for the deathmatch and were thus moved to your bank."); } foreach (Item item in items) { bag.AddItem(item); } if (bag.Items.Count > 0) { bank.DropItem(bag); } else { bag.Delete(); } #endregion } if (m_EventSupplier != null) { m_EventSupplier.OnMoveOver(m); } Contestants.Add(m); SpawnMobile(m); if (m_GiveHorses) { DMHorse.TryGiveHorse(m); } if (m.NetState != null) { m.SendMessage(38, "You have joined a deathmatch"); m.SendMessage(38, "You can check the score with \".DMScore\""); } }
public void RemovePlayer(Mobile m, bool kicked) { SupplySystem.RemoveEventGear(m); m.IsInEvent = false; m.Frozen = false; if (!m.Alive && m is PlayerMobile) { ((PlayerMobile)m).ForceResurrect(); } m.MoveToWorld(m_LeaveLocation, m_LeaveMap); if (m_MountCollection.ContainsKey(m.Serial)) { BaseCreature bc = m_MountCollection[m.Serial]; if (bc != null) { bc.ControlTarget = m; bc.ControlOrder = OrderType.Stay; bc.SetControlMaster(m); bc.SummonMaster = m; bc.IsStabled = false; bc.MoveToWorld(m.Location, m.Map); m.Stabled.Remove(bc); m.Aggressed.Clear(); m.Aggressors.Clear(); m.Hits = m.HitsMax; m.Stam = m.StamMax; m.Mana = m.ManaMax; m.DamageEntries.Clear(); m.Combatant = null; } } if (m_Contestants.Contains(m)) { m_Contestants.Remove(m); } if (m.NetState != null) { if (kicked) { m.SendMessage(38, "You have been kicked from the deathmatch"); } else { m.SendMessage(38, "You have left the deathmatch"); } } DMHorse.TryRemoveHorse(m); if (m_ResurrectionTimers.ContainsKey(m.Serial)) { Timer t = m_ResurrectionTimers[m.Serial]; if (t != null) { t.Stop(); m_ResurrectionTimers.Remove(m.Serial); } } //Only print the message if the match is onging if (!m_Started) { return; } string leaveMessage = ""; if (kicked) { leaveMessage = string.Format("{0} has been kicked from a deathmatch", m.Name); } else { leaveMessage = string.Format("{0} has left a deathmatch", m.Name); } PvpCore.SendMessage(Contestants, leaveMessage, true); }