コード例 #1
0
        public static void RemoveDisguise(Mobile from)
        {
            from.HueMod  = -1;
            from.NameMod = null;
            ((PlayerMobile)from).SavagePaintExpiration = TimeSpan.Zero;

            ((PlayerMobile)from).SetHairMods(-1, -1);

            PolymorphSpell.StopTimer(from);
            IncognitoSpell.StopTimer(from);
            DisguiseTimers.RemoveTimer(from);

            from.EndAction(typeof(PolymorphSpell));
            from.EndAction(typeof(IncognitoSpell));
        }
コード例 #2
0
ファイル: Dispel.cs プロジェクト: rberiot/imaginenation
        public static void RemoveAllEffects(Mobile target, Mobile caster)
        {
            //Remove magic reflect
            if (target.MagicDamageAbsorb > 0)
            {
                target.MagicDamageAbsorb = 0;
            }

            //dispel protection
            ProtectionSpell.StopTimer(target);

            //dispell polymorph
            PolymorphSpell.StopTimer(target);

            //dispell incognito
            IncognitoSpell.StopTimer(target);
        }
コード例 #3
0
ファイル: Dispel.cs プロジェクト: MythikGN/Mythik
        public static bool DoDispell(Mobile from, Mobile m)
        {
            // only remove beneficial if target is other.
            var res = SpellHelper.RemoveStatMod(from, m, StatType.All, m != from);

            if (!res)
            {
                res = SpellHelper.RemoveStatMod(from, m, StatType.Str, m != from);
            }
            if (!res)
            {
                res = SpellHelper.RemoveStatMod(from, m, StatType.Int, m != from);
            }
            if (!res)
            {
                res = SpellHelper.RemoveStatMod(from, m, StatType.Dex, m != from);
            }
            if (!res && m != from) // only dispel if not targeting self
            {
                res = Second.ProtectionSpell.EndProtection(m);
            }
            if (!res && m != from) // only dispel if not targeting self
            {
                res = First.ReactiveArmorSpell.EndArmor(m);
            }
            if (!res)
            {
                res = DisguiseTimers.RemoveTimer(m);
                m.EndAction(typeof(IncognitoSpell));
            }

            if (!res)
            {
                if (!m.CanBeginAction(typeof(PolymorphSpell)))
                {
                    PolymorphSpell.StopTimer(m);
                    res = true;
                }
            }
            return(res);
        }
コード例 #4
0
ファイル: ZuluUtil.cs プロジェクト: Pumpk1ns/RunZHA
        public static void WipeMods(Mobile m)
        {
            PlayerMobile pm = m as PlayerMobile;

            m.DisruptiveAction();

            foreach (StatType Stat in Enum.GetValues(typeof(StatType)))
            {
                string name = String.Format("[Magic] {0} Offset", Stat);
                if (m.GetStatMod(name) != null)
                {
                    m.RemoveStatMod(name);
                }
            }

            if (TransformationSpellHelper.UnderTransformation(m))
            {
                TransformationSpellHelper.RemoveContext(m, true);
            }

            m.HueMod  = -1;
            m.NameMod = null;


            PolymorphSpell.StopTimer(m);
            IncognitoSpell.StopTimer(m);
            DisguiseGump.StopTimer(m);


            foreach (Type T in DispelActions)
            {
                m.EndAction(T);
            }

            m.BodyMod = 0;
            m.HueMod  = -1;



            if (pm != null)
            {
                if (pm.BuffTable != null)
                {
                    List <BuffInfo> list = new List <BuffInfo>();

                    foreach (BuffInfo buff in pm.BuffTable.Values)
                    {
                        if (!buff.RetainThroughDeath)
                        {
                            list.Add(buff);
                        }
                    }

                    for (int i = 0; i < list.Count; i++)
                    {
                        pm.RemoveBuff(list[i]);
                    }
                }

                pm.SavagePaintExpiration = TimeSpan.Zero;
                pm.SetHairMods(-1, -1);

                pm.ResendBuffs();
            }



            m.VirtualArmorMod = 0;


            BaseArmor.ValidateMobile(m);
            BaseClothing.ValidateMobile(m);
        }
コード例 #5
0
        public static void NegateEffects(Mobile target, bool curses, bool buffs, bool damage, bool morph)
        {
            if (target == null)
            {
                return;
            }

            if (damage)
            {
                if (target.Poisoned)
                {
                    var p = target.Poison;

                    target.Poison = null;

                    target.OnCured(target, p);
                }

                target.Frozen    = false;
                target.Paralyzed = false;

                target.SetPropertyValue("Asleep", false);

                BuffInfo.RemoveBuff(target, BuffIcon.Paralyze);
                BuffInfo.RemoveBuff(target, BuffIcon.Sleep);
            }

            if (buffs)
            {
                ReactiveArmorSpell.EndArmor(target);
                MagicReflectSpell.EndReflect(target);
            }

            if (curses)
            {
                #region Pain Spike
                IDictionary table;

                if (typeof(PainSpikeSpell).GetFieldValue("m_Table", out table) && table.Contains(target))
                {
                    var t = table[target] as Timer;

                    if (t != null)
                    {
                        t.Stop();
                    }

                    table.Remove(target);

                    BuffInfo.RemoveBuff(target, BuffIcon.PainSpike);
                }
                #endregion

                CurseSpell.RemoveEffect(target);
                EvilOmenSpell.TryEndEffect(target);
                StrangleSpell.RemoveCurse(target);
                CorpseSkinSpell.RemoveCurse(target);
                BloodOathSpell.RemoveCurse(target);
                MindRotSpell.ClearMindRotScalar(target);
            }

            if (damage)
            {
                MortalStrike.EndWound(target);
                BleedAttack.EndBleed(target, target.Alive);
                MeerMage.StopEffect(target, target.Alive);
            }

            if (morph)
            {
                AnimalForm.RemoveContext(target, true);

                PolymorphSpell.StopTimer(target);
                IncognitoSpell.StopTimer(target);

                target.Send(SpeedControl.Disable);

                target.EndAction(typeof(PolymorphSpell));
                target.EndAction(typeof(IncognitoSpell));

                BuffInfo.RemoveBuff(target, BuffIcon.AnimalForm);
                BuffInfo.RemoveBuff(target, BuffIcon.Polymorph);
                BuffInfo.RemoveBuff(target, BuffIcon.Incognito);
            }

            if (buffs)
            {
                RemoveStatBonus(target, StatType.All);
            }

            if (curses)
            {
                RemoveStatCurse(target, StatType.All);
            }
        }
コード例 #6
0
ファイル: Battle.cs プロジェクト: AllanNisbet/runuo
        public virtual void Negate(Mobile m)
        {
            if (m == null || m.Deleted)
            {
                return;
            }

            if (m.Frozen)
            {
                m.Frozen = false;
            }

            if (m.Paralyzed)
            {
                m.Paralyzed = false;
            }

            if (m.Poisoned)
            {
                m.CurePoison(m);
            }

            if (BleedAttack.IsBleeding(m))
            {
                BleedAttack.EndBleed(m, true);
            }

            if (MortalStrike.IsWounded(m))
            {
                MortalStrike.EndWound(m);
            }

            PolymorphSpell.StopTimer(m);
            IncognitoSpell.StopTimer(m);
            DisguiseTimers.RemoveTimer(m);

            m.EndAction(typeof(PolymorphSpell));
            m.EndAction(typeof(IncognitoSpell));

            MeerMage.StopEffect(m, false);

            if (DebugMode || m.AccessLevel <= AccessLevel.Counselor)
            {
                m.RevealingAction();
                m.DisruptiveAction();
            }

            if (m.Target != null)
            {
                m.Target.Cancel(m, TargetCancelType.Overriden);
            }

            m.Spell = null;

            if (m.Combatant != null)
            {
#if ServUO
                var c = m.Combatant as Mobile;
#else
                var c = m.Combatant;
#endif

                if (c != null && c.Combatant == m)
                {
                    c.Combatant = null;
                    c.Warmode   = false;
                }

                m.Combatant = null;
            }

            if (m.Aggressed != null)
            {
                m.Aggressed.Clear();
            }

            if (m.Aggressors != null)
            {
                m.Aggressors.Clear();
            }

            m.Warmode  = false;
            m.Criminal = false;

            m.Delta(MobileDelta.Noto);
        }