Exemplo n.º 1
0
            public ParalyzeFieldItem(Mobile caster, int itemID, Point3D loc, Map map, TimeSpan duration) : base(itemID)
            {
                Visible = false;
                Movable = false;
                Light   = LightType.Circle300;

                int spellHue = Enhancements.GetMobileSpellHue(caster, Enhancements.SpellType.ParalyzeField);

                Hue = spellHue;

                MoveToWorld(loc, map);

                if (caster.InLOS(this))
                {
                    Visible = true;
                }
                else
                {
                    Delete();
                }

                if (Deleted)
                {
                    return;
                }

                m_Caster = caster;

                m_Timer = new InternalTimer(this, duration);
                m_Timer.Start();

                m_End = DateTime.UtcNow + duration;
            }
Exemplo n.º 2
0
        public override void OnCast()
        {
            if (CheckSequence())
            {
                bool enhancedSpellcast = SpellHelper.IsEnhancedSpell(Caster, null, EnhancedSpellbookType.Summoner, false, true);

                BaseCreature summon = new SummonedDaemon();

                summon.StoreBaseSummonValues();

                double duration = 4.0 * Caster.Skills[SkillName.Magery].Value;

                if (enhancedSpellcast)
                {
                    duration *= SpellHelper.EnhancedSummonDurationMultiplier;

                    summon.DamageMin = (int)((double)summon.DamageMin * SpellHelper.EnhancedSummonDamageMultiplier);
                    summon.DamageMax = (int)((double)summon.DamageMax * SpellHelper.EnhancedSummonDamageMultiplier);

                    summon.SetHitsMax((int)((double)summon.HitsMax * SpellHelper.EnhancedSummonHitPointsMultiplier));
                    summon.Hits = summon.HitsMax;
                }

                summon.SetDispelResistance(Caster, enhancedSpellcast, 0);

                int spellHue = Enhancements.GetMobileSpellHue(Caster, Enhancements.SpellType.SummonDaemon);

                summon.Hue = spellHue;

                SpellHelper.Summon(summon, Caster, 0x217, TimeSpan.FromSeconds(duration), false, false);
            }

            FinishSequence();
        }
Exemplo n.º 3
0
        public void Target(Mobile mobile)
        {
            BaseCreature bc_Creature = mobile as BaseCreature;

            if (!Caster.CanSee(mobile) || mobile.Hidden)
            {
                Caster.SendLocalizedMessage(500237); // Target can not be seen.
            }
            else if (bc_Creature == null || !bc_Creature.IsDispellable)
            {
                Caster.SendLocalizedMessage(1005049); // That cannot be dispelled.
            }
            else if (CheckHSequence(mobile))
            {
                SpellHelper.Turn(Caster, mobile);

                int spellHue = Enhancements.GetMobileSpellHue(Caster, Enhancements.SpellType.Dispel);

                Caster.DoHarmful(bc_Creature);

                if (Caster is PlayerMobile)
                {
                    bc_Creature.ResolveDispel(Caster, true, spellHue);
                }

                else
                {
                    bc_Creature.ResolveDispel(Caster, false, spellHue);
                }
            }

            FinishSequence();
        }
Exemplo n.º 4
0
        public void Target(Mobile mobile)
        {
            if (!Caster.CanSee(mobile) || mobile.Hidden)
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (CheckHSequence(mobile))
            {
                SpellHelper.Turn(Caster, mobile);
                SpellHelper.CheckReflect((int)this.Circle, Caster, ref mobile);
                SpellHelper.AddStatCurse(Caster, mobile, StatType.Str);

                CheckMagicResist(mobile);

                if (mobile.Spell != null)
                {
                    mobile.Spell.OnCasterHurt();
                }

                mobile.Paralyzed = false;

                int spellHue = Enhancements.GetMobileSpellHue(Caster, Enhancements.SpellType.Weaken);

                mobile.FixedParticles(0x3779, 10, 15, 5002, spellHue, 0, EffectLayer.Head);
                mobile.PlaySound(0x1E6);
            }

            FinishSequence();
        }
Exemplo n.º 5
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m) || m.Hidden)
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }

            else if (CheckBSequence(m))
            {
                SpellHelper.Turn(Caster, m);

                SpellHelper.AddStatBonus(Caster, m, StatType.Str); SpellHelper.DisableSkillCheck = true;
                SpellHelper.AddStatBonus(Caster, m, StatType.Dex);
                SpellHelper.AddStatBonus(Caster, m, StatType.Int); SpellHelper.DisableSkillCheck = false;

                bool enhancedSpellcast = SpellHelper.IsEnhancedSpell(Caster, m, EnhancedSpellbookType.Wizard, false, true);

                int spellHue = Enhancements.GetMobileSpellHue(Caster, Enhancements.SpellType.Bless);

                if (enhancedSpellcast)
                {
                    m.FixedParticles(0x373A, 10, 30, 5018, spellHue, 0, EffectLayer.Waist);
                    m.PlaySound(0x1EA);
                }

                else
                {
                    m.FixedParticles(0x373A, 10, 15, 5018, spellHue, 0, EffectLayer.Waist);
                    m.PlaySound(0x1EA);
                }
            }

            FinishSequence();
        }
Exemplo n.º 6
0
            public WallOfStoneItem(Point3D loc, Map map, Mobile caster) : base(128)
            {
                Visible = false;
                Movable = false;

                //Player Enhancement Customization: Geomancer
                //if (PlayerEnhancementPersistance.IsCustomizationEntryActive(caster, CustomizationType.Geomancer))
                //ItemID = 376;

                int spellHue = Enhancements.GetMobileSpellHue(caster, Enhancements.SpellType.WallOfStone);

                Hue = spellHue;

                MoveToWorld(loc, map);

                if (caster.InLOS(this))
                {
                    Visible = true;
                }
                else
                {
                    Delete();
                }

                if (Deleted)
                {
                    return;
                }

                m_Timer = new InternalTimer(this, TimeSpan.FromSeconds(10.0));
                m_Timer.Start();

                m_End = DateTime.UtcNow + TimeSpan.FromSeconds(10.0);
            }
Exemplo n.º 7
0
        public void Target(Mobile m)
        {
            if (!m.CanSee(m) || m.Hidden)
            {
                Caster.SendLocalizedMessage(500237); // Target can not be seen.
            }

            else if (m.MagicDamageAbsorb > 0)
            {
                Caster.SendLocalizedMessage(1005559);   // This spell is already in effect.
            }

            else if (!m.CanBeginAction(typeof(DefensiveSpell)))
            {
                Caster.SendMessage("The spell will not adhere to them at this time.");                   // The spell will not adhere to you at this time.
            }

            else if (CheckBSequence(m))
            {
                if (Caster.MagicDamageAbsorb >= 0)
                {
                    int value = 0;

                    bool enhancedSpellcast = SpellHelper.IsEnhancedSpell(Caster, null, EnhancedSpellbookType.Wizard, false, true);

                    //Spirit Speak Bonus
                    int spiritSpeakBonus = (int)(Math.Floor(8 * Caster.Skills[SkillName.SpiritSpeak].Value / 100));

                    value += spiritSpeakBonus;

                    if (enhancedSpellcast)
                    {
                        value += 8;
                    }

                    int spellHue = Enhancements.GetMobileSpellHue(Caster, Enhancements.SpellType.MagicReflect);

                    if (enhancedSpellcast)
                    {
                        m.FixedParticles(0x375A, 10, 30, 5037, spellHue, 0, EffectLayer.Waist);
                        m.PlaySound(0x1E9);
                    }

                    else
                    {
                        m.FixedParticles(0x375A, 10, 15, 5037, spellHue, 0, EffectLayer.Waist);
                        m.PlaySound(0x1E9);
                    }

                    if (value < 1)
                    {
                        value = 1;
                    }

                    m.MagicDamageAbsorb = value;
                }
            }

            FinishSequence();
        }
Exemplo n.º 8
0
        public static void ApplyEffect(Mobile Caster, Mobile mobile)
        {
            SpellHelper.AddStatCurse(Caster, mobile, StatType.Str); SpellHelper.DisableSkillCheck = true;
            SpellHelper.AddStatCurse(Caster, mobile, StatType.Dex);
            SpellHelper.AddStatCurse(Caster, mobile, StatType.Int); SpellHelper.DisableSkillCheck = false;

            Timer t = (Timer)m_UnderEffect[mobile];

            if (Caster.Player && mobile.Player && t == null)
            {
                TimeSpan duration = SpellHelper.GetDuration(Caster, mobile);
                m_UnderEffect[mobile] = t = Timer.DelayCall(duration, new TimerStateCallback(RemoveEffect), mobile);
                mobile.UpdateResistances();
            }

            if (mobile.Spell != null)
            {
                mobile.Spell.OnCasterHurt();
            }

            mobile.Paralyzed = false;

            int spellHue = Enhancements.GetMobileSpellHue(Caster, Enhancements.SpellType.Curse);

            mobile.FixedParticles(0x374A, 10, 15, 5028, spellHue, 0, EffectLayer.Waist);
            mobile.PlaySound(0x1E1);
        }
Exemplo n.º 9
0
        public void Target(IPoint3D p)
        {
            if (!Caster.CanSee(p))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (SpellHelper.CheckTown(p, Caster) && CheckSequence())
            {
                SpellHelper.Turn(Caster, p);
                SpellHelper.GetSurfaceTop(ref p);

                List <Mobile> targets = new List <Mobile>();

                Map map = Caster.Map;

                if (map != null)
                {
                    IPooledEnumerable eable = map.GetMobilesInRange(new Point3D(p), 3);

                    foreach (Mobile m in eable)
                    {
                        if (SpellHelper.ValidIndirectTarget(Caster, m) && Caster.CanSee(m) && Caster.CanBeHarmful(m, false))
                        {
                            targets.Add(m);
                        }
                    }

                    eable.Free();
                }

                int spellHue = Enhancements.GetMobileSpellHue(Caster, Enhancements.SpellType.MassCurse);

                for (int i = 0; i < targets.Count; ++i)
                {
                    Mobile mobile = targets[i];

                    CheckMagicResist(mobile);

                    Caster.DoHarmful(mobile);

                    SpellHelper.AddStatCurse(Caster, mobile, StatType.Str);
                    SpellHelper.AddStatCurse(Caster, mobile, StatType.Dex);
                    SpellHelper.AddStatCurse(Caster, mobile, StatType.Int);

                    if (mobile.Spell != null)
                    {
                        mobile.Spell.OnCasterHurt();
                    }

                    mobile.Paralyzed = false;

                    mobile.FixedParticles(0x374A, 10, 15, 5028, spellHue, 0, EffectLayer.Waist);
                    mobile.PlaySound(0x1FB);
                }
            }

            FinishSequence();
        }
Exemplo n.º 10
0
        public void Target(Mobile m)
        {
            if (!m.CanSee(m) || m.Hidden)
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }

            if (!m.CanBeginAction(typeof(ReactiveArmorSpell)))
            {
                Caster.SendMessage("The spell will not adhere to them at this time.");
            }

            else if (CheckBSequence(m))
            {
                int value = (int)(m.Skills[SkillName.Magery].Value);

                value /= 3;

                if (value < 0)
                {
                    value = 1;
                }
                else if (value > 20)
                {
                    value = 20;
                }

                bool enhancedSpellcast = SpellHelper.IsEnhancedSpell(Caster, null, EnhancedSpellbookType.Wizard, false, true);

                int spellHue = Enhancements.GetMobileSpellHue(Caster, Enhancements.SpellType.ReactiveArmor);

                //Spirit Speak Bonus
                value += (int)(20 * (Caster.Skills[SkillName.SpiritSpeak].Value / 100));

                if (enhancedSpellcast)
                {
                    value += 20;

                    m.FixedParticles(0x376A, 9, 64, 5008, spellHue, 0, EffectLayer.Waist);
                    m.PlaySound(0x1F2);
                }

                else
                {
                    m.FixedParticles(0x376A, 9, 32, 5008, spellHue, 0, EffectLayer.Waist);
                    m.PlaySound(0x1F2);
                }

                m.MeleeDamageAbsorb = value;

                m.BeginAction(typeof(ReactiveArmorSpell));
                Timer.DelayCall(TimeSpan.FromMinutes(0.5), delegate { m.EndAction(typeof(ReactiveArmorSpell)); });
            }

            FinishSequence();
        }
Exemplo n.º 11
0
        public void Target(IPoint3D p, Mobile from)
        {
            if (!Caster.CanSee(p))
            {
                Caster.SendLocalizedMessage(500237); // Target can not be seen.
            }
            else if (CheckSequence())
            {
                SpellHelper.Turn(Caster, p);
                SpellHelper.GetSurfaceTop(ref p);

                List <Mobile> targets = new List <Mobile>();

                Map map = Caster.Map;

                if (map != null)
                {
                    IPooledEnumerable eable = map.GetMobilesInRange(new Point3D(p), 8);

                    foreach (Mobile m in eable)
                    {
                        if (m is BaseCreature && ((BaseCreature)m).Summoned && Caster.CanBeHarmful(m, false))
                        {
                            targets.Add(m);
                        }
                    }

                    eable.Free();
                }

                int spellHue = Enhancements.GetMobileSpellHue(Caster, Enhancements.SpellType.MassDispel);

                for (int i = 0; i < targets.Count; ++i)
                {
                    Mobile       m           = targets[i];
                    BaseCreature bc_Creature = m as BaseCreature;

                    if (bc_Creature == null)
                    {
                        continue;
                    }

                    Caster.DoHarmful(m);

                    bc_Creature.ResolveDispel(Caster, false, spellHue);
                }
            }

            FinishSequence();
        }
Exemplo n.º 12
0
        public void Target(IPoint3D p)
        {
            Map map = Caster.Map;

            SpellHelper.GetSurfaceTop(ref p);

            if (map == null || !map.CanSpawnMobile(p.X, p.Y, p.Z) || BaseShip.FindShipAt(p, map) != null)
            {
                Caster.SendLocalizedMessage(501942); // That location is blocked.
            }
            else if (SpellHelper.CheckTown(p, Caster) && CheckSequence())
            {
                bool enhancedSpellcast = SpellHelper.IsEnhancedSpell(Caster, null, EnhancedSpellbookType.Summoner, false, true);

                BaseCreature summon = new EnergyVortex();

                summon.StoreBaseSummonValues();

                double duration = 2.0 * Caster.Skills[SkillName.Magery].Value;

                if (enhancedSpellcast)
                {
                    duration *= SpellHelper.EnhancedSummonDurationMultiplier;

                    summon.DamageMin = (int)((double)summon.DamageMin * SpellHelper.EnhancedSummonDamageMultiplier);
                    summon.DamageMax = (int)((double)summon.DamageMax * SpellHelper.EnhancedSummonDamageMultiplier);

                    summon.SetHitsMax((int)((double)summon.HitsMax * SpellHelper.EnhancedSummonHitPointsMultiplier));
                    summon.Hits = summon.HitsMax;
                }

                summon.SetDispelResistance(Caster, enhancedSpellcast, 0);

                int spellHue = Enhancements.GetMobileSpellHue(Caster, Enhancements.SpellType.EnergyVortex);

                summon.Hue = spellHue;

                BaseCreature.Summon(summon, false, Caster, new Point3D(p), 0x212, TimeSpan.FromSeconds(duration));
            }

            FinishSequence();
        }
Exemplo n.º 13
0
        public void Target(Mobile m)
        {
            if (!m.CanSee(m) || m.Hidden)
            {
                m.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (CheckBSequence(m))
            {
                SpellHelper.Turn(Caster, m);

                int val = (int)(m.Skills[SkillName.Magery].Value / 10.0 + 1);

                if (m.BeginAction(typeof(ProtectionSpell)))
                {
                    Caster.DoBeneficial(m);
                    m.VirtualArmorMod += val;

                    new InternalTimer(m, Caster, val).Start();

                    bool enhancedSpellcast = SpellHelper.IsEnhancedSpell(Caster, m, EnhancedSpellbookType.Wizard, false, true);

                    int spellHue = Enhancements.GetMobileSpellHue(Caster, Enhancements.SpellType.Protection);

                    if (enhancedSpellcast)
                    {
                        m.FixedParticles(0x375A, 9, 40, 5027, spellHue, 0, EffectLayer.Waist);
                        m.PlaySound(0x1F7);
                    }

                    else
                    {
                        m.FixedParticles(0x375A, 9, 20, 5027, spellHue, 0, EffectLayer.Waist);
                        m.PlaySound(0x1F7);
                    }
                }
            }

            FinishSequence();
        }
Exemplo n.º 14
0
        public void Target(IPoint3D p)
        {
            if (!Caster.CanSee(p))
            {
                Caster.SendLocalizedMessage(500237); // Target can not be seen.
            }
            else if (SpellHelper.CheckTown(p, Caster) && CheckSequence())
            {
                bool    enhancedSpellcast = false;
                Boolean chargedSpellcast  = false;

                int spellHue = Enhancements.GetMobileSpellHue(Caster, Enhancements.SpellType.MeteorSwarm);

                int radius = 3;

                if (Caster is BaseCreature)
                {
                    radius += (int)(Math.Floor((Caster.Skills[SkillName.Magery].Value - 75) / 25));
                }

                SpellHelper.Turn(Caster, p);

                if (p is Item)
                {
                    p = ((Item)p).GetWorldLocation();
                }

                Map map = Caster.Map;

                IPooledEnumerable nearbyMobiles = map.GetMobilesInRange(new Point3D(p), radius);

                Queue m_Queue = new Queue();

                int targetCount = 0;

                bool playerVsCreatureOccurred = false;

                if (targetCount > 0)
                {
                    Effects.PlaySound(p, Caster.Map, 0x160);
                }

                foreach (Mobile mobile in nearbyMobiles)
                {
                    if (mobile == Caster)
                    {
                        continue;
                    }

                    if (Caster is BaseCreature)
                    {
                        if (!SpecialAbilities.MonsterCanDamage(Caster, mobile))
                        {
                            continue;
                        }
                    }

                    if (!Caster.CanBeHarmful(mobile, false))
                    {
                        continue;
                    }

                    if (Caster is PlayerMobile && mobile is BaseCreature)
                    {
                        playerVsCreatureOccurred = true;
                    }

                    targetCount++;
                    m_Queue.Enqueue(mobile);
                }

                nearbyMobiles.Free();

                if (playerVsCreatureOccurred)
                {
                    enhancedSpellcast = SpellHelper.IsEnhancedSpell(Caster, null, EnhancedSpellbookType.Fire, false, true);
                    chargedSpellcast  = SpellHelper.IsChargedSpell(Caster, null, false, Scroll != null);
                }

                while (m_Queue.Count > 0)
                {
                    Mobile mobile = (Mobile)m_Queue.Dequeue();

                    double damage      = (double)Utility.RandomMinMax(DamageMin, DamageMax);
                    double damageBonus = 0;

                    CheckMagicResist(mobile);

                    Boolean isTamedTarget = SpellHelper.IsTamedTarget(Caster, mobile);

                    if (Caster is PlayerMobile && mobile is BaseCreature)
                    {
                        damageBonus += SpellSpecificCreatureDamageBonus;
                    }

                    if (enhancedSpellcast && mobile is BaseCreature)
                    {
                        if (isTamedTarget)
                        {
                            damageBonus += SpellHelper.EnhancedSpellTamedCreatureBonus;
                        }

                        else
                        {
                            damageBonus += SpellHelper.EnhancedSpellBonus;
                        }
                    }

                    if (chargedSpellcast && mobile is BaseCreature)
                    {
                        if (isTamedTarget)
                        {
                            damageBonus += SpellHelper.ChargedSpellTamedCreatureBonus;
                        }

                        else
                        {
                            damageBonus += SpellHelper.ChargedSpellBonus;
                        }

                        Caster.MovingParticles(mobile, 0x36D4, 5, 0, false, true, spellHue, 0, 9501, 1, 0, 0x100);
                        Caster.MovingParticles(mobile, 0x36D4, 9, 0, false, true, spellHue, 0, 9501, 1, 0, 0x100);
                    }

                    else
                    {
                        Caster.MovingParticles(mobile, 0x36D4, 7, 0, false, true, spellHue, 0, 9501, 1, 0, 0x100);
                    }

                    BaseCreature bc_Target = mobile as BaseCreature;
                    PlayerMobile pm_Target = mobile as PlayerMobile;

                    if (bc_Target != null)
                    {
                        if (bc_Target.ShipOccupied != null)
                        {
                            damage *= BaseShip.shipBasedAoESpellDamageToCreatureScalar;
                        }
                    }

                    if (pm_Target != null)
                    {
                        if (pm_Target.ShipOccupied != null)
                        {
                            damage *= BaseShip.shipBasedAoESpellDamageToPlayerScalar;
                        }
                    }

                    damage *= GetDamageScalar(mobile, damageBonus);

                    SpellHelper.Damage(this, Caster, mobile, damage);
                }
            }

            ArenaFight.SpellCompletion(Caster, typeof(MeteorSwarmSpell));

            FinishSequence();
        }
Exemplo n.º 15
0
        public void Target(Mobile mobile)
        {
            if (!Caster.CanSee(mobile) || mobile.Hidden)
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (CheckHSequence(mobile))
            {
                Mobile source = Caster;

                SpellHelper.Turn(source, mobile);
                SpellHelper.CheckReflect((int)this.Circle, ref source, ref mobile);

                double damage      = (double)Utility.RandomMinMax(3, 5);
                double damageBonus = 0;

                CheckMagicResist(mobile);

                bool    enhancedSpellcast = SpellHelper.IsEnhancedSpell(Caster, mobile, EnhancedSpellbookType.Fire, true, true);
                Boolean chargedSpellcast  = SpellHelper.IsChargedSpell(Caster, mobile, true, Scroll != null);
                Boolean isTamedTarget     = SpellHelper.IsTamedTarget(Caster, mobile);

                int spellHue = Enhancements.GetMobileSpellHue(Caster, Enhancements.SpellType.MagicArrow);

                if (Caster is PlayerMobile && mobile is BaseCreature)
                {
                    damageBonus += SpellSpecificCreatureDamageBonus;
                }

                if (enhancedSpellcast)
                {
                    if (isTamedTarget)
                    {
                        damageBonus += SpellHelper.EnhancedSpellTamedCreatureBonus;
                    }

                    else
                    {
                        damageBonus += SpellHelper.EnhancedSpellBonus;
                    }
                }

                if (chargedSpellcast)
                {
                    if (isTamedTarget)
                    {
                        damageBonus += SpellHelper.ChargedSpellTamedCreatureBonus;
                    }

                    else
                    {
                        damageBonus += SpellHelper.ChargedSpellBonus;
                    }

                    source.MovingParticles(mobile, 0x36E4, 3, 0, false, true, spellHue, 0, 3006, 4006, 0, 0);
                    source.MovingParticles(mobile, 0x36E4, 7, 0, false, true, spellHue, 0, 3006, 4006, 0, 0);

                    source.PlaySound(0x1E5);
                }

                else
                {
                    source.MovingParticles(mobile, 0x36E4, 5, 0, false, true, spellHue, 0, 3006, 4006, 0, 0);
                    source.PlaySound(0x1E5);
                }

                damage *= GetDamageScalar(mobile, damageBonus);

                SpellHelper.Damage(this, Caster, mobile, damage);
            }

            FinishSequence();
        }
Exemplo n.º 16
0
        public void Target(IPoint3D p)
        {
            if (!Caster.CanSee(p))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }

            else if (CheckSequence())
            {
                SpellHelper.Turn(Caster, p);

                SpellHelper.GetSurfaceTop(ref p);

                List <Mobile> targets = new List <Mobile>();

                Map map = Caster.Map;

                if (map != null)
                {
                    IPooledEnumerable eable = map.GetMobilesInRange(new Point3D(p), 3);

                    foreach (Mobile m in eable)
                    {
                        if (Caster.CanBeBeneficial(m, false))
                        {
                            targets.Add(m);
                        }
                    }

                    eable.Free();
                }

                Effects.PlaySound(p, Caster.Map, 0x299);

                if (targets.Count > 0)
                {
                    int cured = 0;

                    int spellHue = Enhancements.GetMobileSpellHue(Caster, Enhancements.SpellType.ArchCure);

                    for (int i = 0; i < targets.Count; ++i)
                    {
                        Mobile mobile = targets[i];

                        if (mobile.Player)
                        {
                            Caster.DoBeneficial(mobile);
                        }

                        if (mobile.CurePoison(Caster))
                        {
                            ++cured;
                        }

                        if (mobile.Poisoned)
                        {
                            AspectArmorProfile aspectArmorProfile = AspectGear.GetAspectArmorProfile(mobile);

                            //Poison Aspect
                            if (aspectArmorProfile != null)
                            {
                                if (aspectArmorProfile.m_Aspect == AspectEnum.Poison)
                                {
                                    double extraCureChance = AspectGear.PoisonCureChanceBonus * (AspectGear.PoisonCureChanceBonusPerTier * (double)aspectArmorProfile.m_TierLevel);

                                    if (Utility.RandomDouble() <= extraCureChance)
                                    {
                                        ++cured;

                                        mobile.CurePoison(Caster);

                                        //TEST: Add Aspect Visuals
                                    }
                                }
                            }
                        }

                        mobile.FixedParticles(0x373A, 10, 15, 5012, spellHue, 0, EffectLayer.Waist);
                        mobile.PlaySound(0x1E0);
                    }

                    if (cured > 0)
                    {
                        Caster.SendLocalizedMessage(1010058);
                    }
                }
            }

            FinishSequence();
        }
Exemplo n.º 17
0
        public void Target(Mobile mobile)
        {
            if (!Caster.CanSee(mobile) || mobile.Hidden)
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (CheckHSequence(mobile))
            {
                SpellHelper.Turn(Caster, mobile);
                SpellHelper.CheckReflect((int)this.Circle, Caster, ref mobile);

                double damage      = (double)Utility.RandomMinMax(DamageMin, DamageMax);
                double damageBonus = 0;

                CheckMagicResist(mobile);

                bool    enhancedSpellcast = SpellHelper.IsEnhancedSpell(Caster, mobile, EnhancedSpellbookType.Fire, true, true);
                Boolean chargedSpellcast  = SpellHelper.IsChargedSpell(Caster, mobile, true, Scroll != null);
                Boolean isTamedTarget     = SpellHelper.IsTamedTarget(Caster, mobile);

                int spellHue = Enhancements.GetMobileSpellHue(Caster, Enhancements.SpellType.Flamestrike);

                if (Caster is PlayerMobile && mobile is BaseCreature)
                {
                    damageBonus += SpellSpecificCreatureDamageBonus;
                }

                if (enhancedSpellcast)
                {
                    if (isTamedTarget)
                    {
                        damageBonus += SpellHelper.EnhancedSpellTamedCreatureBonus;
                    }

                    else
                    {
                        damageBonus += SpellHelper.EnhancedSpellBonus;
                    }
                }

                if (chargedSpellcast)
                {
                    if (isTamedTarget)
                    {
                        damageBonus += SpellHelper.ChargedSpellTamedCreatureBonus;
                    }

                    else
                    {
                        damageBonus += SpellHelper.ChargedSpellBonus;
                    }

                    mobile.FixedParticles(0x3709, 10, 60, 5052, spellHue, 0, EffectLayer.LeftFoot);
                    mobile.PlaySound(0x208);
                }

                else
                {
                    mobile.FixedParticles(0x3709, 10, 30, 5052, spellHue, 0, EffectLayer.LeftFoot);
                    mobile.PlaySound(0x208);
                }

                damage *= GetDamageScalar(mobile, damageBonus);

                SpellHelper.Damage(this, Caster, mobile, damage);
            }

            FinishSequence();
        }
Exemplo n.º 18
0
        public void Target(Mobile mobile)
        {
            if (!Caster.CanSee(mobile) || mobile.Hidden)
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }

            else if (CheckBSequence(mobile))
            {
                SpellHelper.Turn(Caster, mobile);
                Poison p = mobile.Poison;

                if (p != null)
                {
                    double chanceToCure = (Caster.Skills[SkillName.Magery].Value * 0.75) + (110.0 - (p.Level + 1) * 33.0);

                    chanceToCure /= 100;

                    if (chanceToCure > Utility.RandomDouble())
                    {
                        if (mobile.CurePoison(Caster))
                        {
                            if (Caster != mobile)
                            {
                                Caster.SendLocalizedMessage(1010058); // You have cured the target of all poisons!
                            }
                            mobile.SendLocalizedMessage(1010059);     // You have been cured of all poisons.
                        }
                    }

                    else
                    {
                        bool cured = false;

                        AspectArmorProfile aspectArmorProfile = AspectGear.GetAspectArmorProfile(mobile);

                        //Poison Aspect
                        if (aspectArmorProfile != null)
                        {
                            if (aspectArmorProfile.m_Aspect == AspectEnum.Poison)
                            {
                                double extraCureChance = AspectGear.PoisonCureChanceBonus * (AspectGear.PoisonCureChanceBonusPerTier * (double)aspectArmorProfile.m_TierLevel);

                                if (Utility.RandomDouble() <= extraCureChance)
                                {
                                    mobile.CurePoison(Caster);

                                    cured = true;

                                    //TEST: Add Aspect Visuals
                                }
                            }
                        }

                        if (!cured)
                        {
                            mobile.SendLocalizedMessage(1010060); // You have failed to cure your target!
                        }
                    }
                }

                int spellHue = Enhancements.GetMobileSpellHue(Caster, Enhancements.SpellType.Cure);

                mobile.FixedParticles(0x373A, 10, 15, 5012, spellHue, 0, EffectLayer.Waist);
                mobile.PlaySound(0x1E0);
            }

            FinishSequence();
        }
Exemplo n.º 19
0
        public void Target(Mobile mobile)
        {
            if (!Caster.CanSee(mobile) || mobile.Hidden)
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (CheckHSequence(mobile))
            {
                Mobile from = Caster, target = mobile;
                SpellHelper.Turn(from, target);
                SpellHelper.CheckReflect((int)this.Circle, ref from, ref target);

                double damage      = (double)Utility.RandomMinMax(10, 20);
                double damageBonus = 0;

                CheckMagicResist(mobile);

                bool    enhancedSpellcast = SpellHelper.IsEnhancedSpell(Caster, mobile, EnhancedSpellbookType.Warlock, true, true);
                Boolean chargedSpellcast  = SpellHelper.IsChargedSpell(Caster, mobile, true, Scroll != null);
                Boolean isTamedTarget     = SpellHelper.IsTamedTarget(Caster, mobile);

                int spellHue = Enhancements.GetMobileSpellHue(Caster, Enhancements.SpellType.MindBlast);

                if (Caster is PlayerMobile && mobile is BaseCreature)
                {
                    damageBonus += SpellSpecificCreatureDamageBonus;
                }

                if (enhancedSpellcast)
                {
                    if (isTamedTarget)
                    {
                        damageBonus += SpellHelper.EnhancedSpellTamedCreatureBonus;
                    }

                    else
                    {
                        damageBonus += SpellHelper.EnhancedSpellBonus;
                    }
                }

                if (chargedSpellcast)
                {
                    if (isTamedTarget)
                    {
                        damageBonus += SpellHelper.ChargedSpellTamedCreatureBonus;
                    }

                    else
                    {
                        damageBonus += SpellHelper.ChargedSpellBonus;
                    }

                    from.FixedParticles(0x374A, 10, 30, 2038, spellHue, 0, EffectLayer.Head);

                    target.FixedParticles(0x374A, 10, 30, 5038, spellHue, 0, EffectLayer.Head);
                    target.PlaySound(0x213);
                }

                else
                {
                    from.FixedParticles(0x374A, 10, 15, 2038, spellHue, 0, EffectLayer.Head);

                    target.FixedParticles(0x374A, 10, 15, 5038, spellHue, 0, EffectLayer.Head);
                    target.PlaySound(0x213);
                }

                damage *= GetDamageScalar(mobile, damageBonus);

                SpellHelper.Damage(this, Caster, mobile, damage);
            }

            FinishSequence();
        }
Exemplo n.º 20
0
        public void Target(Mobile mobile)
        {
            if (!Caster.CanSee(mobile) || mobile.Hidden)
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (CheckHSequence(mobile))
            {
                Mobile source = Caster;
                SpellHelper.Turn(Caster, mobile);
                SpellHelper.CheckReflect((int)this.Circle, ref source, ref mobile);

                double damage      = (double)Utility.RandomMinMax(DamageMin, DamageMax);
                double damageBonus = 0;

                CheckMagicResist(mobile);

                bool    enhancedSpellcast = SpellHelper.IsEnhancedSpell(Caster, mobile, EnhancedSpellbookType.Fire, true, true);
                Boolean chargedSpellcast  = SpellHelper.IsChargedSpell(Caster, mobile, true, Scroll != null);
                Boolean isTamedTarget     = SpellHelper.IsTamedTarget(Caster, mobile);

                int spellHue = Enhancements.GetMobileSpellHue(Caster, Enhancements.SpellType.Explosion);

                if (Caster is PlayerMobile && mobile is BaseCreature)
                {
                    damageBonus += SpellSpecificCreatureDamageBonus;
                }

                if (enhancedSpellcast)
                {
                    if (isTamedTarget)
                    {
                        damageBonus += SpellHelper.EnhancedSpellTamedCreatureBonus;
                    }

                    else
                    {
                        damageBonus += SpellHelper.EnhancedSpellBonus;
                    }
                }

                if (enhancedSpellcast)
                {
                    if (isTamedTarget)
                    {
                        damageBonus += SpellHelper.EnhancedSpellTamedCreatureBonus;
                    }

                    else
                    {
                        damageBonus += SpellHelper.EnhancedSpellBonus;
                    }
                }

                if (chargedSpellcast)
                {
                    if (isTamedTarget)
                    {
                        damageBonus += SpellHelper.ChargedSpellTamedCreatureBonus;
                    }

                    else
                    {
                        damageBonus += SpellHelper.ChargedSpellBonus;
                    }
                }

                Timer.DelayCall(TimeSpan.FromSeconds(2.5), delegate
                {
                    if (!SpecialAbilities.Exists(mobile))
                    {
                        return;
                    }

                    if (chargedSpellcast)
                    {
                        mobile.FixedParticles(0x36BD, 20, 20, 5044, spellHue, 0, EffectLayer.Head);
                        mobile.PlaySound(0x307);
                    }

                    else
                    {
                        mobile.FixedParticles(0x36BD, 20, 10, 5044, spellHue, 0, EffectLayer.Head);
                        mobile.PlaySound(0x307);
                    }

                    damage *= GetDamageScalar(mobile, damageBonus);

                    SpellHelper.Damage(this, Caster, mobile, damage);
                });
            }

            FinishSequence();
        }
Exemplo n.º 21
0
        public void Target(IPoint3D p)
        {
            IPoint3D orig = p;
            Map      map  = Caster.Map;

            SpellHelper.GetSurfaceTop(ref p);
            Point3D pP = new Point3D(p);

            WarpBlockerTotem recallBlocker = WarpBlockerTotem.RecallBlockerTriggered(Caster, WarpBlockerTotem.MovementMode.TeleportIn, pP, Caster.Map);

            if (recallBlocker != null)
            {
                if (recallBlocker.PreventTeleportInResponse != "")
                {
                    Caster.SendMessage(recallBlocker.PreventTeleportInResponse);
                }
                else
                {
                    Caster.SendMessage(WarpBlockerTotem.DefaultTeleportInResponse);
                }
            }

            else if (Server.Misc.WeightOverloading.IsOverloaded(Caster))
            {
                Caster.SendLocalizedMessage(502359, "", 0x22);                   // Thou art too encumbered to move.
            }

            else if (!SpellHelper.CheckTravel(Caster, TravelCheckType.TeleportFrom))
            {
                Caster.SendLocalizedMessage(501942); // That location is blocked.
            }

            else if (!SpellHelper.CheckTravel(Caster, map, pP, TravelCheckType.TeleportTo))
            {
                Caster.SendLocalizedMessage(501942); // That location is blocked.
            }

            else if (map == null || !map.CanSpawnMobile(p.X, p.Y, p.Z))
            {
                Caster.SendLocalizedMessage(501942);                   // That location is blocked.
            }

            else if (SpellHelper.CheckMulti(pP, map))
            {
                Caster.SendLocalizedMessage(501942);                   // That location is blocked.
            }

            else
            {
                if (CheckSequence())
                {
                    SpellHelper.Turn(Caster, orig);

                    Mobile m = Caster;

                    Point3D from = m.Location;
                    Point3D to   = pP;

                    m.Location = to;
                    m.ProcessDelta();

                    int spellHue = Enhancements.GetMobileSpellHue(Caster, Enhancements.SpellType.Teleport);

                    if (m.Player)
                    {
                        Effects.SendLocationParticles(EffectItem.Create(from, m.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, spellHue, 0, 2023, 0);

                        //Player Enhancement Customization: Blink
                        bool blink = false; //PlayerEnhancementPersistance.IsCustomizationEntryActive(Caster, CustomizationType.Blink);

                        if (blink)
                        {
                            int distance = Utility.GetDistance(from, to);

                            Point3D effectStep = from;

                            for (int a = 0; a < distance + 1; a++)
                            {
                                Timer.DelayCall(TimeSpan.FromSeconds(a * .05), delegate
                                {
                                    if (m == null)
                                    {
                                        return;
                                    }

                                    Direction direction = Utility.GetDirection(effectStep, to);
                                    effectStep          = SpecialAbilities.GetPointByDirection(effectStep, direction);

                                    Effects.SendLocationParticles(EffectItem.Create(effectStep, m.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, spellHue, 0, 2023, 0);
                                    m.PlaySound(0x5C6);
                                });
                            }
                        }

                        else
                        {
                            Effects.SendLocationParticles(EffectItem.Create(to, m.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, spellHue, 0, 2023, 0);
                            m.PlaySound(0x1FE);
                        }
                    }

                    else
                    {
                        m.FixedParticles(0x376A, 9, 32, 0x13AF, spellHue, 0, EffectLayer.Waist);
                        m.PlaySound(0x1FE);
                    }

                    IPooledEnumerable eable = m.GetItemsInRange(0);

                    foreach (Item item in eable)
                    {
                        if (item is Server.Spells.Sixth.ParalyzeFieldSpell.ParalyzeFieldItem || item is Server.Spells.Fifth.PoisonFieldSpell.PoisonFieldItem || item is Server.Spells.Fourth.FireFieldSpell.FireFieldItem)
                        {
                            item.OnMoveOver(m);
                        }
                    }

                    eable.Free();

                    m.BeginAction(typeof(TeleportSpell));
                    Timer.DelayCall(TimeSpan.FromSeconds(6), delegate { m.EndAction(typeof(TeleportSpell)); });
                }
            }

            FinishSequence();
        }
Exemplo n.º 22
0
        public void Target(IPoint3D p)
        {
            if (!Caster.CanSee(p))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (CheckSequence())
            {
                SpellHelper.Turn(Caster, p);

                SpellHelper.GetSurfaceTop(ref p);

                List <Mobile> targets = new List <Mobile>();

                Map map = Caster.Map;

                if (map != null)
                {
                    IPooledEnumerable eable = map.GetMobilesInRange(new Point3D(p), Core.AOS ? 2 : 3);

                    foreach (Mobile m in eable)
                    {
                        if (Caster.CanBeBeneficial(m, false))
                        {
                            targets.Add(m);
                        }
                    }

                    eable.Free();
                }

                if (Core.AOS)
                {
                    Party party = Party.Get(Caster);

                    for (int i = 0; i < targets.Count; ++i)
                    {
                        Mobile m = targets[i];

                        if (m == Caster || (party != null && party.Contains(m)))
                        {
                            Caster.DoBeneficial(m);
                            Spells.Second.ProtectionSpell.Toggle(Caster, m);
                        }
                    }
                }

                else
                {
                    Effects.PlaySound(p, Caster.Map, 0x299);

                    int val = (int)(Caster.Skills[SkillName.Magery].Value / 10.0 + 1);

                    bool chargeUsed = false;

                    for (int i = 0; i < targets.Count; ++i)
                    {
                        Mobile m = targets[i];

                        if (m.BeginAction(typeof(ProtectionSpell)))
                        {
                            if (m.Player)
                            {
                                Caster.DoBeneficial(m);
                            }

                            m.VirtualArmorMod += val;
                            new InternalTimer(m, Caster, val).Start();

                            bool enhancedSpellcast = SpellHelper.IsEnhancedSpell(Caster, null, EnhancedSpellbookType.Wizard, false, false);

                            if (enhancedSpellcast)
                            {
                                chargeUsed = true;
                            }

                            int spellHue = Enhancements.GetMobileSpellHue(Caster, Enhancements.SpellType.ArchProtection);

                            if (enhancedSpellcast)
                            {
                                m.FixedParticles(0x375A, 9, 40, 5027, spellHue, 0, EffectLayer.Waist);
                                m.PlaySound(0x1F7);
                            }

                            else
                            {
                                m.FixedParticles(0x375A, 9, 20, 5027, spellHue, 0, EffectLayer.Waist);
                                m.PlaySound(0x1F7);
                            }
                        }
                    }

                    if (chargeUsed)
                    {
                        if (Caster.FindItemOnLayer(Layer.OneHanded) is EnhancedSpellbook)
                        {
                            EnhancedSpellbook spellbook = Caster.FindItemOnLayer(Layer.OneHanded) as EnhancedSpellbook;

                            if (spellbook != null)
                            {
                                spellbook.OnSpellCast(Caster);
                            }
                        }
                    }
                }
            }

            FinishSequence();
        }