public override void OnDamage(int amount, Mobile from, bool willKill) { Point3D p = new Point3D(from); base.OnDamage(amount, from, willKill); // eats pet or summons if (from is BaseCreature) { BaseCreature creature = (BaseCreature)from; if (creature.Controlled || creature.Summoned) { Heal(creature.Hits); creature.Kill(); Effects.PlaySound(Location, Map, 0x574); } } // teleports player near if (from is PlayerMobile && !InRange(from.Location, 5)) { Combatant = from; SpellHelper.FindValidSpawnLocation(Map, ref p, true); from.MoveToWorld(p, Map); from.FixedParticles(0x376A, 9, 32, 0x13AF, EffectLayer.Waist); from.PlaySound(0x1FE); } }
public override void OnDamage(int amount, Mobile from, bool willKill) { base.OnDamage(amount, from, willKill); // eats pet or summons if (from is BaseCreature) { BaseCreature creature = (BaseCreature)from; if (creature.Controlled || creature.Summoned) { Heal(creature.Hits); creature.Kill(); Effects.PlaySound(Location, Map, 0x574); } } // teleports player near if (from is PlayerMobile && !InRange(from.Location, 1)) { Combatant = from; from.MoveToWorld(GetSpawnPosition(1), Map); from.FixedParticles(0x376A, 9, 32, 0x13AF, EffectLayer.Waist); from.PlaySound(0x1FE); } }
public override void OnGotMeleeAttack(Mobile attacker) { base.OnGotMeleeAttack(attacker); if (attacker is BaseCreature) { BaseCreature c = (BaseCreature)attacker; if (c.Controlled && c.ControlMaster != null) { c.ControlMaster.SendMessage("The Recluse is immune to your pets attack."); this.Combatant = c.ControlMaster; c.Kill(); this.Emote("Your pet has been killed!", c.Name); } else if (attacker.BodyValue != 400 || attacker.BodyValue != 401 || attacker.BodyValue != 605 || attacker.BodyValue != 606) { attacker.Kill(); this.Emote("Your Summons has been killed!"); } else if (attacker is EvolutionDragon) { attacker.Kill(); this.Emote("Your Evo pet has been killed!"); } else if (attacker is VoltSpider) { attacker.Kill(); this.Emote("Your Hatched pet has been killed!"); } } }
public override void OnGotMeleeAttack(Mobile attacker) { base.OnGotMeleeAttack(attacker); if (0.25 >= Utility.RandomDouble() && attacker is BaseCreature) { BaseCreature c = (BaseCreature)attacker; if (c.Controlled && c.ControlMaster != null) { c.ControlMaster.SendMessage("The genetecist tried to extract DNA from your pet but failed killing your pet."); this.Combatant = c.ControlMaster; c.Kill(); this.Emote("Tries to extract DNA from {0}", c.Name); } } }
public override void AlterMeleeDamageTo(Mobile to, ref int damage) { //this kills pets if the KillPets is set true if (to is BaseCreature) { BaseCreature creature = (BaseCreature)to; if (creature.Controlled && KillPets) { if (DebugLinkedCreatures) { PublicOverheadMessage(MessageType.Emote, EmoteHue, false, "*Killing Pet*"); } creature.Kill(); } } base.AlterMeleeDamageTo(to, ref damage); }
public override void OnGaveMeleeAttack(Mobile defender) { Poison p = HitPoison; if (p != null && HitPoisonChance >= Utility.RandomDouble()) { defender.ApplyPoison(this, p); foreach (Mobile m in this.GetMobilesInRange(5)) { if (m.IsPlayer) { PlayerMobile pm = m as PlayerMobile; if (pm.HonorActive) { continue; } } m.ApplyPoison(this, p); } } PlaySound(0x574); if (defender is BaseCreature) { BaseCreature bc = defender as BaseCreature; if (bc.SummonMaster != null) { bc.SummonMaster.SendLocalizedMessage(1072079); // Your pet has succumbed to the hunger of your enemy! } else if (bc.ControlMaster != null) { bc.ControlMaster.SendLocalizedMessage(1072079); // Your pet has succumbed to the hunger of your enemy! } bc.Kill(); Hits = HitsMax; } }
//this does the meat and potatoes work to prevent damage public void CheckDamageFrom(Mobile from, ref int damage) { if (from is BaseCreature) { BaseCreature creature = (BaseCreature)from; if (creature.Controlled && BlockPetDamage) { if (DebugLinkedCreatures) { PublicOverheadMessage(MessageType.Emote, EmoteHue, false, "*Blocking Pet Damage*"); } damage = 0; } if (creature.Controlled && KillPets) { if (DebugLinkedCreatures) { PublicOverheadMessage(MessageType.Emote, EmoteHue, false, "*Killing Pet*"); } creature.Kill(); } } if (!LinkedCreatureAttackable()) { if (DebugLinkedCreatures) { PublicOverheadMessage(MessageType.Emote, EmoteHue, false, "*Cannot take damage*"); } damage = 0; PlaySound(NoDamageSound); FixedEffect(NoDamageEffect, 10, 5); } }