Exemple #1
0
        public override void OnTarget(Mobile target)
        {
            if (CheckHSequence(target))
            {
                double total  = 0.0;
                int    skills = 0;

                // Does TotalSkills count temp mods?
                for (int i = 0; i < target.Skills.Length; ++i)
                {
                    if (target.Skills[i].Value > 0.0)
                    {
                        total += target.Skills[i].Value;
                        skills++;
                    }
                }

                total /= skills;

                if ((int)total % 4 == 0)
                {
                    int damage = GetDamage(Caster, target, CastSkill, 1.0) + GetDamage(Caster, target, DamageSkill, 1.0);
                    SpellHelper.Damage(this, target, damage * 2, 0, 0, 0, 0, 100);
                    BlueMageControl.CheckKnown(target, this, CanTeach(target));
                }
                else
                {
                    target.FixedParticles(0x3779, 9, 32, 5030, EffectLayer.Head);
                    Caster.PlaySound(0x5C);
                }
            }

            FinishSequence();
        }
        public override void OnHit(Mobile attacker, Mobile defender, int damage)
        {
            attacker.SendMessage("You drain part of your opponent's life energy");
            defender.SendMessage("You feel part of your life force being stolen away.");

            // Energy Drain it's self heals the user 10 points per negative level as well.
            // attacker.Heal( damage - (damage / 4) ); //75% leech like effect since it deals very little damage.

            if (attacker is PlayerMobile)
            {
                if (defender is PlayerMobile)
                {
                    Ability.EnergyDrain(attacker, defender, 1, 3, true);                       // 1 to stats & skills per hit for 3 minutes.
                }
                else
                {
                    Ability.EnergyDrain(attacker, defender, 2, 3, true);                       // 2 to stats & skills per hit for 3 minutes.
                }
            }
            else
            {
                Ability.EnergyDrain(attacker, defender, 3, 6, true);                   // 3 to stats & skills per hit for 6 minutes.
            }
            BlueMageControl.CheckKnown(defender, this, CanTeach(attacker));

            ClearCurrentMove(attacker);
            CheckGain(attacker);
        }
        public override void SpellEffect(Mobile target)
        {
            if (!DragonList.ContainsKey(target))
            {
                DragonList.Add(target, new DragonInfo(target));
                target.HueMod = 1255;
            }

            if (!DragonList[target].AddMods())
            {
                Caster.Target = new BlueSpellTarget(this, TargetFlags.Harmful);
                return;
            }
            else
            {
                target.HueMod++;

                // effects
                target.PlaySound(0x1F4);
                //TempHP.Give( target, 10, true );
                Effects.SendLocationEffect(new Point3D(target.X, target.Y, target.Z), target.Map, 0x3709, 30, 9965, 0x501, 7);

                BlueMageControl.CheckKnown(target, this, CanTeach(target));
            }
        }
Exemple #4
0
        public override void OnTarget(Mobile target)
        {
            if (CheckHSequence(target))
            {
                if (target is BaseChampion || target is BasePeerless)
                {
                    return;
                }

                int amount = target.Hits / 2;

                if (amount >= 100 && Caster.AccessLevel == AccessLevel.Player)
                {
                    amount = 100;
                }

                target.Hits -= amount;

                Caster.MovingEffect(target, 0xF62, 15, 1, false, false, 1, 0);
                Caster.MovingEffect(target, 0x3660, 15, 1, false, false, 1, 0);

                target.SendMessage("You feel your life force being pulled away.");
                target.PlaySound(0x5C8);

                BlueMageControl.CheckKnown(target, this, CanTeach(target));
            }

            FinishSequence();
        }
Exemple #5
0
        public override void SpellEffect(Mobile m)
        {
            int toheal = 0;

            if (Caster.Hits < 30)
            {
                toheal = 15;
            }
            else if (Caster.Hits < 90)
            {
                toheal = Caster.Hits / 2;
            }
            else
            {
                toheal = 45 + (Caster.Hits / 10);
            }

            if (!(m.Poisoned && !(m == Caster)))
            {
                SpellHelper.Heal(toheal, m, Caster);
                m.FixedParticles(0x376A, 1, 15, 9923, 1153, 3, EffectLayer.Waist);
                m.PlaySound(0x5C8);
                BlueMageControl.CheckKnown(m, this, CanTeach(m));
            }
        }
Exemple #6
0
        public override void SpellEffect(Mobile target)
        {
            if (target.Skills[SkillName.Hiding].Value < Utility.Random(120))
            {
                target.SendMessage("The spell failed to hide you.");
                return;
            }

            for (int i = -1; i < 2; i++)
            {
                for (int j = -1; j < 2; j++)
                {
                    Effects.SendLocationParticles(
                        EffectItem.Create(new Point3D(
                                              target.X + i,
                                              target.Y + j,
                                              target.Z
                                              ), target.Map, EffectItem.DefaultDuration),
                        0x36BD /*ItemID*/, 1 /*Speed*/, 20 /*Duration*/, 0 /*Hue*/, 0 /*RenderMode*/, 0 /*Effect*/, 0                  /*Unknown*/
                        );
                }
            }

            target.Warmode = false;
            target.Hidden  = true;

            target.AllowedStealthSteps = (int)((Caster.Skills[DamageSkill].Value / 5) / 4);             // 6 steps at 120.0
            BlueMageControl.CheckKnown(target, this, CanTeach(target));
        }
        public override void OnTarget(Mobile target)
        {
            if (CheckBSequence(target, true))
            {
                if (target is BaseCreature)
                {
                    BaseCreature bc = (BaseCreature)target;

                    if (!bc.IsDeadPet)
                    {
                        Caster.SendMessage("That animal is still alive.");
                    }
                    else if (bc.ControlMaster != null)
                    {
                        bc.ControlMaster.CloseGump(typeof(PetResurrectGump));
                        bc.ControlMaster.SendGump(new PetResurrectGump(Caster, bc));
                        AutoLifeSpell.ResurrectEffect(bc);
                    }
                }
                else if (!target.Alive)
                {
                    target.CloseGump(typeof(AutoLifeGump));
                    target.SendGump(new AutoLifeGump());
                }
                else if (target is PlayerMobile)
                {
                    PlayerMobile pm = (PlayerMobile)target;
                    BeginAutoLife(pm, (int)(ScaleBySkill(Caster, DamageSkill) * 3));
                    BlueMageControl.CheckKnown(target, this, CanTeach(target));
                }
            }

            FinishSequence();
        }
        public override void OnHit(Mobile attacker, Mobile defender, int damage)
        {
            ClearCurrentMove(attacker);

            double diff = (attacker.Hits / attacker.HitsMax);

            diff = 100 - (diff * 100.0);
            int glove = (int)diff;

            switch (Utility.Random(5))
            {
            case 1: AOS.Damage(defender, attacker, glove, 0, 100, 0, 0, 0); break;

            case 2: AOS.Damage(defender, attacker, glove, 0, 0, 100, 0, 0); break;

            case 3: AOS.Damage(defender, attacker, glove, 0, 0, 0, 100, 0); break;

            case 4: AOS.Damage(defender, attacker, glove, 0, 0, 0, 0, 100); break;

            default: AOS.Damage(defender, attacker, glove, 100, 0, 0, 0, 0); break;
            }

            BlueMageControl.CheckKnown(defender, this, CanTeach(attacker));
            CheckGain(attacker);
        }
Exemple #9
0
        public override void SpellEffect(Mobile target)
        {
            int dam = GetDamage(Caster, target, CastSkill, 2.0);

            dam += GetDamage(Caster, target, DamageSkill, 2.0);
            SpellHelper.Damage(this, target, dam, 20, 20, 20, 20, 20);
            BlueMageControl.CheckKnown(target, this, CanTeach(target));
        }
Exemple #10
0
        public override void OnHit(Mobile attacker, Mobile defender, int damage)
        {
            ClearCurrentMove(attacker);

            BlueMageControl.CheckKnown(defender, this, CanTeach(attacker));
            CheckGain(attacker);

            attacker.SendMessage("You make a wild swing and hit your foe with it.");
            defender.SendMessage("You were hit by a wild swing.");
        }
Exemple #11
0
        public override void OnTarget(Mobile target)
        {
            if (CheckHSequence(target))
            {
                Timer timer = new InternalTimer(Caster, target, GetDamage(Caster, target, DamageSkill, 1.2), this);
                timer.Start();

                BlueMageControl.CheckKnown(target, this, CanTeach(target));
            }

            FinishSequence();
        }
Exemple #12
0
		public override void OnTarget( Mobile target )
		{
			if ( CheckHSequence( target ) )
			{
				Timer timer = new ConfuseTimer( target, (int)(ScaleBySkill( Caster, DamageSkill ) + 5) );
				timer.Start();
				target.SendMessage("You are confused!");

				BlueMageControl.CheckKnown( target, this, CanTeach( target ) );
			}

			FinishSequence();
		}
Exemple #13
0
        public override void OnHit(Mobile attacker, Mobile defender, int damage)
        {
            attacker.SendMessage("You hit your opponent with a powerful kick.");
            defender.SendMessage("You have been knocked back by your opponent's kick.");

            int dist = (int)(ScaleBySkill(attacker, SkillName.Forensics) / 4);

            Ability.SlideAway(defender, attacker.Location, (dist > 6) ? 6 : dist);

            BlueMageControl.CheckKnown(defender, this, CanTeach(attacker));

            ClearCurrentMove(attacker);
            CheckGain(attacker);
        }
Exemple #14
0
 public override void SpellEffect(Mobile target)
 {
     if (Status.Enabled)
     {
         target.FixedParticles(0x374A, 10, 15, 5038, EffectLayer.Head);
         target.PlaySound(0x213);
         BeginShield(target, (int)(ScaleBySkill(Caster, DamageSkill) * 8));
         BlueMageControl.CheckKnown(target, this, CanTeach(target));
     }
     else
     {
         target.SendMessage("This spell is nonfunctional.");
     }
 }
Exemple #15
0
        public override void OnTarget(Mobile target)
        {
            if (CheckHSequence(target))
            {
                int drain = (target.Mana > 100) ? 50 : (target.Mana / 2);
                target.Mana -= drain;

                Effects.SendMovingParticles(new Entity(Serial.Zero, new Point3D(target.X, target.Y, target.Z + 50), target.Map), target, 0xFB4, 7, 0, false, true, 0 /*hue?*/, 0, 9502, 1, 0, (EffectLayer)255, 0x100);
                target.FixedParticles(0x3779, 9, 32, 5030, EffectLayer.Head);
                target.PlaySound(0x33);

                BlueMageControl.CheckKnown(target, this, CanTeach(target));
            }

            FinishSequence();
        }
        public override void OnHit(Mobile attacker, Mobile defender, int damage)
        {
            ClearCurrentMove(attacker);

            if (Utility.RandomDouble() > 0.15)               //15% fail chance
            {
                int level;
                int total = (int)attacker.Skills[MoveSkill].Value;
                total += (int)attacker.Skills[SkillName.MagicResist].Value / 2;
                total /= 2;

                if (total > 82)                   // 105 Forensics & 120 MagicResist or better
                {
                    level = 4;                    // Lethal
                }
                else if (total > 74)              // GM Forensics & MagicResist
                {
                    level = 3;                    // Deadly
                }
                else if (total > 60)              // 80 in Forensics & MagicResist
                {
                    level = 2;                    // Greater
                }
                else if (total > 36)              // 50.0 in Forensics & MagicResist
                {
                    level = 1;                    // Regular
                }
                else
                {
                    level = 0;                     // Lesser
                }
                defender.ApplyPoison(attacker, Poison.GetPoison(level));
            }
            else
            {
                ClearCurrentMove(attacker);
                SetContext(attacker);
                attacker.SendMessage("Your claw attack failed. You prepare to strike again...");
                return;
            }

            BlueMageControl.CheckKnown(defender, this, CanTeach(attacker));
            CheckGain(attacker);

            attacker.SendMessage("You poison your opponent with a deadly claw attack.");
            defender.SendMessage("You were poisoned by your opponent's claws");
        }
        public override void OnTarget(Mobile target)
        {
            if (CheckHSequence(target))
            {
                if (target.GetStatMod("MindBlast") == null)
                {
                    int offset = (int)(target.Skills[SkillName.Magery].Value / 2);
                    offset += (int)(target.Skills[SkillName.Necromancy].Value / 2);
                    offset += (int)(target.Skills[SkillName.EvalInt].Value / 4);
                    offset += (int)(target.Skills[SkillName.SpiritSpeak].Value / 4);

                    if (target is PlayerMobile)
                    {
                        offset /= 2;
                    }

                    offset -= ((int)ScaleBySkill(target, SkillName.MagicResist)) - 5;

                    if (offset < 15)
                    {
                        offset = 15;
                    }

                    int duration = (int)(Caster.Skills[CastSkill].Value * 2);

                    target.AddStatMod(new StatMod(StatType.Int, "MindBlast", -offset, TimeSpan.FromSeconds(duration)));
                    target.AddSkillMod(new TimedSkillMod(SkillName.Meditation, true, -offset, TimeSpan.FromSeconds(duration)));
                    target.AddSkillMod(new TimedSkillMod(SkillName.Focus, true, -offset, TimeSpan.FromSeconds(duration)));

                    target.SendMessage("Your mind has been blown!");

                    SpellHelper.Damage(this, target, offset * 2, 0, 0, 100, 0, 0);
                }

                target.FixedParticles(0x374A, 10, 15, 5038, 1181, 2, EffectLayer.Head);
                target.PlaySound(0x213);
                BlueMageControl.CheckKnown(target, this, CanTeach(target));
            }

            FinishSequence();
        }
        public static int KnowsThisMany(Mobile m)
        {
            if (!BlueMageControl.IsBlueMage(m))
            {
                return(0);
            }

            int count = 0;

            bool[] known = BlueMageControl.GetBoolList(m);

            for (int i = 0; i < known.Length; i++)
            {
                if (known[i])
                {
                    ++count;
                }
            }

            return(count);
        }
        public static bool KnowsAll(Mobile m, int type)
        {
            if (!BlueMageControl.IsBlueMage(m))
            {
                return(false);
            }

            bool spells = true, moves = true;

            bool[] known = BlueMageControl.GetBoolList(m);

            for (int i = 0; i < known.Length; i++)
            {
                if (known[i])
                {
                    continue;
                }
                else if (IsBlueMove(i))
                {
                    moves = false;
                }
                else
                {
                    spells = false;
                }
            }

            if (type == 1)
            {
                return(spells);
            }
            else if (type == 2)
            {
                return(moves);
            }
            else
            {
                return(spells && moves);
            }
        }
Exemple #20
0
        public override void OnTarget(Mobile target)
        {
            if (CheckHSequence(target))
            {
                //target.FixedEffect( 0x37B9, 10, 5 );

                // West
                Effects.SendMovingEffect(
                    new Entity(Serial.Zero, new Point3D(target.X, target.Y, target.Z - 15), target.Map),
                    new Entity(Serial.Zero, new Point3D(target.X - 7, target.Y, target.Z + 20), target.Map),
                    14678, 5, 1, false, false, 1, 4);

                // North
                Effects.SendMovingEffect(
                    new Entity(Serial.Zero, new Point3D(target.X, target.Y, target.Z - 15), target.Map),
                    new Entity(Serial.Zero, new Point3D(target.X, target.Y - 7, target.Z + 20), target.Map),
                    14662, 5, 1, false, false, 1, 4);

                // East
                Effects.SendMovingEffect(
                    new Entity(Serial.Zero, new Point3D(target.X, target.Y, target.Z - 15), target.Map),
                    new Entity(Serial.Zero, new Point3D(target.X + 7, target.Y, target.Z + 20), target.Map),
                    14678, 5, 1, false, false, 1, 4);

                // South
                Effects.SendMovingEffect(
                    new Entity(Serial.Zero, new Point3D(target.X, target.Y, target.Z - 15), target.Map),
                    new Entity(Serial.Zero, new Point3D(target.X, target.Y + 7, target.Z + 20), target.Map),
                    14662, 5, 1, false, false, 1, 4);


                BeginGuardOff(target, Caster);

                BlueMageControl.CheckKnown(target, this, CanTeach(target));
            }

            FinishSequence();
        }
Exemple #21
0
        public override void OnTarget(Mobile target)
        {
            Point3D from = Caster.Location;
            Point3D to   = target.Location;

            if (Factions.Sigil.ExistsOn(Caster))
            {
                Caster.SendLocalizedMessage(1061632);                   // You can't do that while carrying the sigil.
            }
            else if (!SpellHelper.CheckTravel(Caster, TravelCheckType.TeleportFrom))
            {
            }
            else if (!SpellHelper.CheckTravel(Caster, Caster.Map, new Point3D(target), TravelCheckType.TeleportTo))
            {
            }
            else if (target is BaseVendor)
            {
                Caster.SendMessage("You cannot switch with that.");
            }
            else if (CheckSequence())
            {
                SpellHelper.Turn(Caster, target);
                Caster.Location = to;
                target.Location = from;
                SpellHelper.Turn(Caster, target);

                Caster.ProcessDelta();

                Effects.SendLocationParticles(EffectItem.Create(from, Caster.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 2023);
                Effects.SendLocationParticles(EffectItem.Create(to, Caster.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 5023);
                //m.FixedParticles( 0x376A, 9, 32, 0x13AF, EffectLayer.Waist );
                Caster.PlaySound(0x1FE);

                BlueMageControl.CheckKnown(target, this, CanTeach(target));
            }

            FinishSequence();
        }
Exemple #22
0
        public override void SpellEffect(Mobile m)
        {
            m.Paralyze(TimeSpan.FromSeconds(ScaleBySkill(Caster, DamageSkill)));

            NetState ns = m.NetState;

            if (ns != null)
            {
                if (m.Race == Race.Elf)
                {
                    ns.Send(new PersonalLightLevel(m, -66));
                }
                else
                {
                    ns.Send(new PersonalLightLevel(m, -56));
                }
            }

            Timer timer = new InternalTimer(m, (int)ScaleBySkill(Caster, DamageSkill));

            timer.Start();

            BlueMageControl.CheckKnown(m, this, CanTeach(m));
        }
        public override void OnTarget(Mobile target)
        {
            if (CheckHSequence(target))
            {
                if (!(target is BaseChampion || target.HitsMax >= 500))
                {
                    int oldmana = target.Mana;
                    int oldhits = target.Hits;

                    target.Hits = oldmana;
                    target.Mana = oldhits;
                }

                //0xF62 = spear, 0x37B9 = glow, 0x13A7 = pillow
                target.FixedParticles(0x37B9, 10, 19, 0, 0x501, 0, EffectLayer.LeftFoot);
                target.FixedParticles(0x37B9, 10, 19, 0, 0x501, 0, EffectLayer.Head);
                target.BoltEffect(0x35);
                target.PlaySound(0x5AA);

                BlueMageControl.CheckKnown(target, this, CanTeach(target));
            }

            FinishSequence();
        }
        public override bool CheckCast()
        {
            if (Caster is BaseCreature)
            {
                BaseCreature bc = Caster as BaseCreature;
                bc.DebugSay("Blue Spell: CheckCast is returning base");
                return(base.CheckCast());
            }
            else if (Caster.AccessLevel == AccessLevel.Counselor)
            {
                // Counselors are blocked becuase counselors are not meant to have leet god powers. Lock the level down like you're supposed to and you can hire the position out as the advice giving only position as it's supposed to be.
                Caster.SendMessage("You are blocked from these spells.");
                return(false);
            }
            else if (Caster is PlayerMobile && !BlueMageControl.IsBlueMage(Caster) && Caster.AccessLevel == AccessLevel.Player)
            {
                Caster.SendMessage("Only a blue mage can cast this spell.");
                return(false);
            }

            // Not a real class system, because class systems suck, but you can't use higher levels of spells as part of an intended balence.
            if (BlueMageControl.SkillLock && Caster.AccessLevel == AccessLevel.Player)
            {
                if (Caster.Skills[SkillName.Magery].Base > 50.0)
                {
                    //Caster.SendMessage( "You study true magic and cannot mimic such a choatic spell." );
                    Caster.Skills[SkillName.Magery].Base = 50.0;
                }
                if (Caster.Skills[SkillName.Chivalry].Base > 50.0)
                {
                    //Caster.SendMessage( "Your oath prevents you from using such a dishonorable spell." );
                    Caster.Skills[SkillName.Chivalry].Base = 50.0;
                }
                if (Caster.Skills[SkillName.Necromancy].Base > 50.0)
                {
                    //Caster.SendMessage( "Your dark power prevents you from casting this spell." );
                    Caster.Skills[SkillName.Necromancy].Base = 50.0;
                }
                if (Caster.Skills[SkillName.AnimalTaming].Base > 0.0)
                {
                    //Caster.SendMessage( "You refuse to cast the spell, you believe monsters should be used, not studied." );
                    Caster.Skills[SkillName.AnimalTaming].Base = 0.0;
                }
                else if (Caster.Skills[SkillName.Spellweaving].Base > 50.0)
                {
                    Caster.Skills[SkillName.Spellweaving].Base = 50.0;
                }
                else if (Caster.Skills[SkillName.Mysticism].Base > 50.0)
                {
                    Caster.Skills[SkillName.Mysticism].Base = 50.0;
                }

                if (Caster is PlayerMobile && !BlueMageControl.CheckKnown(Caster, this, false))
                {
                    Caster.SendMessage("You do not know this spell");
                    return(false);
                }
            }

            if (!base.CheckCast())               //|| !base.CheckSequence() )
            {
                return(false);
            }
            else
            {
                //Caster.PublicOverheadMessage( MessageType.Regular, 1365, false, this.type.toString() );
                BaseAnimation();
                return(true);
            }
        }
Exemple #25
0
 public override void SpellEffect(Mobile target)
 {
     SpellHelper.Damage(this, target, (Caster.Hits * 2), 0, 100, 0, 0, 0);
     BlueMageControl.CheckKnown(target, this, CanTeach(target));
 }
Exemple #26
0
 public override void SpellEffect(Mobile target)
 {
     SpellHelper.Damage(this, target, GetDamage(Caster, target, DamageSkill, 2.3), 0, 100, 0, 0, 0);
     BlueMageControl.CheckKnown(target, this, CanTeach(target));
 }
        public override void OnTarget(Mobile target)
        {
            /* Effects.SendMovingEffect(
             *      IEntity from,
             *      IEntity to,
             *      int itemID, int speed, int duration, bool fixedDirection, bool explodes, int hue, int renderMode );  */

            // West
            Effects.SendMovingEffect(
                new Entity(Serial.Zero, new Point3D(target.X - 1, target.Y, target.Z - 20), target.Map),
                new Entity(Serial.Zero, new Point3D(target.X - 1, target.Y, target.Z + 20), target.Map),
                14678, 5, 1, false, false, 1, 4);

            // North
            Effects.SendMovingEffect(
                new Entity(Serial.Zero, new Point3D(target.X, target.Y - 1, target.Z - 20), target.Map),
                new Entity(Serial.Zero, new Point3D(target.X, target.Y - 1, target.Z + 20), target.Map),
                14662, 5, 1, false, false, 1, 4);

            // East
            Effects.SendMovingEffect(
                new Entity(Serial.Zero, new Point3D(target.X + 1, target.Y, target.Z - 20), target.Map),
                new Entity(Serial.Zero, new Point3D(target.X + 1, target.Y, target.Z + 20), target.Map),
                14678, 5, 1, false, false, 1, 4);

            // South
            Effects.SendMovingEffect(
                new Entity(Serial.Zero, new Point3D(target.X, target.Y + 1, target.Z - 20), target.Map),
                new Entity(Serial.Zero, new Point3D(target.X, target.Y + 1, target.Z + 20), target.Map),
                14662, 5, 1, false, false, 1, 4);

            target.SendMessage("You are under the effects of Mightyguard");

            if (Status.Enabled)
            {
                ShellSpell.BeginShell(target, (int)(ScaleBySkill(Caster, DamageSkill) * 8));
                ProtectSpell.BeginProtect(target, (int)(ScaleBySkill(Caster, DamageSkill) * 8));
            }
            else
            {
                int bonus = (int)(ScaleBySkill(Caster, DamageSkill));
                int buff  = 0;
                List <ResistanceMod> mods = new List <ResistanceMod>();

                // Physical
                buff = target.GetMinResistance(ResistanceType.Physical) + bonus;

                if (target.PhysicalResistance < buff)
                {
                    mods.Add(new ResistanceMod(ResistanceType.Physical, buff));
                }

                // Fire
                buff = target.GetMinResistance(ResistanceType.Fire) + bonus;

                if (target.PhysicalResistance < buff)
                {
                    mods.Add(new ResistanceMod(ResistanceType.Fire, buff));
                }

                // Cold
                buff = target.GetMinResistance(ResistanceType.Cold) + bonus;

                if (target.PhysicalResistance < buff)
                {
                    mods.Add(new ResistanceMod(ResistanceType.Cold, buff));
                }

                // Poison
                buff = target.GetMinResistance(ResistanceType.Poison) + bonus;

                if (target.PhysicalResistance < buff)
                {
                    mods.Add(new ResistanceMod(ResistanceType.Poison, buff));
                }

                // Energy
                buff = target.GetMinResistance(ResistanceType.Energy) + bonus;

                if (target.PhysicalResistance < buff)
                {
                    mods.Add(new ResistanceMod(ResistanceType.Energy, buff));
                }

                ResistanceMod[] modarray = mods.ToArray();

                for (int i = 0; i < modarray.Length; i++)
                {
                    target.AddResistanceMod(modarray[i]);
                }

                TimedResistanceMod.AddMod(target, "Mighty Guard", modarray, TimeSpan.FromSeconds((ScaleBySkill(Caster, DamageSkill) * 12)));
            }

            BlueMageControl.CheckKnown(target, this, CanTeach(target));
        }