public override void OnDeath(Container c) { #region Gives gold and Faction coin based on alignment List <DamageEntry> rights = DamageEntries; List <Mobile> toGiveGold = new List <Mobile>(); List <Mobile> toGiveItem = new List <Mobile>(); List <Mobile> toRemove = new List <Mobile>(); List <int> GoldToRecieve = new List <int>(); for (int i = 0; i < rights.Count; ++i) { DamageEntry de = rights[i]; //Only players get rewarded if (de.HasExpired || !de.Damager.Player) { DamageEntries.RemoveAt(i); continue; } toGiveGold.Add(de.Damager); GoldToRecieve.Add(de.DamageGiven * 3); //Player gets 3 times the damage dealt in gold if (de.DamageGiven > 50) //Players doing more than 50 damage they get an order coin { toGiveItem.Add(de.Damager); } } foreach (Mobile m in toGiveGold) { if (m is PlayerMobile) { int amountofgold = GoldToRecieve[toGiveGold.IndexOf(m)]; if (amountofgold > 1000) { amountofgold = 1000; } m.AddToBackpack(new Gold(amountofgold)); } } foreach (Mobile m in toGiveItem) { ChaosCoin item = new ChaosCoin(); if (m is PlayerMobile && m.Guild.Type == GuildType.Chaos) { m.AddToBackpack(item); m.SendAsciiMessage("You have been rewarded a Chaos Coin for fighting for Lord Blackthorn."); } } #endregion }
public override void OnDeath(Container c) { #region Taran: Reward all attackers List <DamageEntry> rights = DamageEntries; List <Mobile> toGiveGold = new List <Mobile>(); List <Mobile> toGiveItem = new List <Mobile>(); List <Mobile> toRemove = new List <Mobile>(); List <int> GoldToRecieve = new List <int>(); for (int i = 0; i < rights.Count; ++i) { DamageEntry de = rights[i]; //Only players get rewarded if (de.HasExpired || !de.Damager.Player) { DamageEntries.RemoveAt(i); continue; } toGiveGold.Add(de.Damager); GoldToRecieve.Add(de.DamageGiven * 5); //Player gets 5 times the damage dealt in gold if (de.DamageGiven > 700) //Players doing more than 700 damage gets a random weapon or armor { toGiveItem.Add(de.Damager); } } foreach (Mobile m in toGiveGold) { if (m is PlayerMobile) { int amountofgold = GoldToRecieve[toGiveGold.IndexOf(m)]; if (amountofgold > 100000) { amountofgold = 100000; //Taran: Could be good with a max of 100k if damage bugs occur } if (amountofgold > 65000) { m.AddToBackpack(new BankCheck(amountofgold)); } else { m.AddToBackpack(new Gold(amountofgold)); } m.SendAsciiMessage("You dealt {0} damage to the monster and got {1} gold", amountofgold / 5, amountofgold); } } foreach (Mobile m in toGiveItem) { if (m is PlayerMobile) { Item item = Loot.RandomArmorOrShieldOrWeapon(); if (item is BaseWeapon) { BaseWeapon weapon = (BaseWeapon)item; weapon.DamageLevel = (WeaponDamageLevel)Utility.Random(6); weapon.AccuracyLevel = (WeaponAccuracyLevel)Utility.Random(6); weapon.DurabilityLevel = (WeaponDurabilityLevel)Utility.Random(6); } else if (item is BaseArmor) { BaseArmor armor = (BaseArmor)item; armor.ProtectionLevel = (ArmorProtectionLevel)Utility.Random(6); armor.Durability = (ArmorDurabilityLevel)Utility.Random(6); } m.AddToBackpack(item); m.SendAsciiMessage("You dealt more than 700 damage to the Fire Spirit, your reward is well deserved!"); } } #endregion List <Mobile> explosionDamage = new List <Mobile>(); foreach (Mobile m in Map.GetMobilesInRange(Location, 5)) { if (!(m is FireSpirit)) { explosionDamage.Add(m); } } for (int i = 0; i < explosionDamage.Count; i++) { Mobile m = explosionDamage[i]; m.Damage(5); m.FixedParticles(0x36BD, 20, 2, 5044, EffectLayer.Head); } base.OnDeath(c); }
public override bool OnBeforeDeath() { if (m_TrueForm) { #region Taran: Reward all attackers List <DamageEntry> rights2 = DamageEntries; List <Mobile> toGiveGold = new List <Mobile>(); List <Mobile> toGiveItem = new List <Mobile>(); List <Mobile> toRemove = new List <Mobile>(); List <int> GoldToRecieve = new List <int>(); for (int i = 0; i < rights2.Count; ++i) { DamageEntry de = rights2[i]; //Only players get rewarded if (de.HasExpired || !de.Damager.Player) { DamageEntries.RemoveAt(i); continue; } toGiveGold.Add(de.Damager); GoldToRecieve.Add(de.DamageGiven * 10); //Player gets 10 times the damage dealt in gold if (de.DamageGiven > 1000) //Players doing more than 1000 damage gets a random weapon or armor { toGiveItem.Add(de.Damager); } } foreach (Mobile m in toGiveGold) { if (m is PlayerMobile) { int amountofgold = GoldToRecieve[toGiveGold.IndexOf(m)]; if (amountofgold > 100000) { amountofgold = 100000; //Taran: Could be good with a max of 100k if damage bugs occur } if (amountofgold > 65000) { m.AddToBackpack(new BankCheck(amountofgold)); } else { m.AddToBackpack(new Gold(amountofgold)); } m.SendAsciiMessage("You dealt {0} damage to the champion and got {1} gold", amountofgold / 10, amountofgold); } } foreach (Mobile m in toGiveItem) { if (m is PlayerMobile) { Item item = Loot.RandomArmorOrShieldOrWeapon(); if (item is BaseWeapon) { BaseWeapon weapon = (BaseWeapon)item; weapon.DamageLevel = (WeaponDamageLevel)Utility.Random(6); weapon.AccuracyLevel = (WeaponAccuracyLevel)Utility.Random(6); weapon.DurabilityLevel = (WeaponDurabilityLevel)Utility.Random(6); } else if (item is BaseArmor) { BaseArmor armor = (BaseArmor)item; armor.ProtectionLevel = (ArmorProtectionLevel)Utility.Random(6); armor.Durability = (ArmorDurabilityLevel)Utility.Random(6); } m.AddToBackpack(item); m.SendAsciiMessage("You dealt more than 1000 damage to the harrower, your reward is well deserved!"); } } //Remove all monsters within 20 tiles when the harrower is killed foreach (Mobile m in Map.GetMobilesInRange(Location, 20)) { if (m is BaseCreature && !(m is Harrower)) { BaseCreature bc = (BaseCreature)m; if (!(m is BaseMount) && m.Spawner == null && bc.LastOwner == null && !bc.Controlled) { toRemove.Add(m); } } } foreach (Mobile m in toRemove) { if (m != null) { m.Delete(); } } #endregion List <DamageStore> rights = GetLootingRights(DamageEntries, HitsMax); for (int i = rights.Count - 1; i >= 0; --i) { DamageStore ds = rights[i]; if (ds.m_HasRight && ds.m_Mobile is PlayerMobile) { PlayerMobile.ChampionTitleInfo.AwardHarrowerTitle((PlayerMobile)ds.m_Mobile); } } if (!NoKillAwards) { //GivePowerScrolls(); Map map = Map; if (map != null) { for (int x = -16; x <= 16; ++x) { for (int y = -16; y <= 16; ++y) { double dist = Math.Sqrt(x * x + y * y); if (dist <= 16) { new GoodiesTimer(map, X + x, Y + y).Start(); } } } } for (int i = 0; i < m_Tentacles.Count; ++i) { Mobile m = m_Tentacles[i]; if (!m.Deleted) { m.Kill(); } } m_Tentacles.Clear(); if (m_GateItem != null) { m_GateItem.Delete(); } } return(base.OnBeforeDeath()); } else { Morph(); return(false); } }
public override void OnDeath(Container c) { #region Taran: Reward all attackers List <DamageEntry> rights = DamageEntries; List <Mobile> toGiveGold = new List <Mobile>(); List <Mobile> toGiveItem = new List <Mobile>(); List <Mobile> toRemove = new List <Mobile>(); List <int> GoldToRecieve = new List <int>(); for (int i = 0; i < rights.Count; ++i) { DamageEntry de = rights[i]; //Only players get rewarded if (de.HasExpired || !de.Damager.Player) { DamageEntries.RemoveAt(i); continue; } toGiveGold.Add(de.Damager); GoldToRecieve.Add(de.DamageGiven * 10); //Player gets 10 times the damage dealt in gold if (de.DamageGiven > 1000) //Players doing more than 1000 damage gets a random weapon or armor { toGiveItem.Add(de.Damager); } } foreach (Mobile m in toGiveGold) { if (m is PlayerMobile) { int amountofgold = GoldToRecieve[toGiveGold.IndexOf(m)]; if (amountofgold > 100000) { amountofgold = 100000; //Taran: Could be good with a max of 100k if damage bugs occur } if (amountofgold > 65000) { m.AddToBackpack(new BankCheck(amountofgold)); } else { m.AddToBackpack(new Gold(amountofgold)); } m.SendAsciiMessage("You dealt {0} damage to the champion and got {1} gold", amountofgold / 10, amountofgold); } } foreach (Mobile m in toGiveItem) { if (m is PlayerMobile) { Item item = Loot.RandomArmorOrShieldOrWeapon(); if (item is BaseWeapon) { BaseWeapon weapon = (BaseWeapon)item; weapon.DamageLevel = (WeaponDamageLevel)Utility.Random(6); weapon.AccuracyLevel = (WeaponAccuracyLevel)Utility.Random(6); weapon.DurabilityLevel = (WeaponDurabilityLevel)Utility.Random(6); } else if (item is BaseArmor) { BaseArmor armor = (BaseArmor)item; armor.ProtectionLevel = (ArmorProtectionLevel)Utility.Random(6); armor.Durability = (ArmorDurabilityLevel)Utility.Random(6); } m.AddToBackpack(item); m.SendAsciiMessage("You dealt more than 1000 damage to the champion, your reward is well deserved!"); } } //Remove all monsters within 20 tiles when the champion is killed foreach (Mobile m in Map.GetMobilesInRange(Location, 20)) { if (m is BaseCreature && !(m is BaseChampion)) { BaseCreature bc = (BaseCreature)m; if (!(m is BaseMount) && m.Spawner == null && bc.LastOwner == null && !bc.Controlled) { toRemove.Add(m); } } } foreach (Mobile m in toRemove) { if (m != null) { m.Delete(); } } #endregion /*if (toGive.Count > 0) * toGive[Utility.Random(toGive.Count)].AddToBackpack(new ChampionSkull(SkullType)); * else * c.DropItem(new ChampionSkull(SkullType));*/ base.OnDeath(c); }