예제 #1
0
            public InternalItem(Point3D loc, Map map, Mobile caster) : base(0x80)
            {
                Visible      = false;
                Movable      = false;
                CanBeAltered = false;

                MoveToWorld(loc, map);

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

                if (Deleted)
                {
                    return;
                }

                double duration = durationMax * Spell.GetSpellScaling(caster, Info.skillForCasting);

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

                m_End = DateTime.Now + TimeSpan.FromSeconds(duration);
            }
예제 #2
0
        public void Target(Mobile m)
        {
            if (HasMindRotScalar(m))
            {
                Caster.SendLocalizedMessage(1005559);                   // This spell is already in effect.
            }
            else if (CheckHSequence(m))
            {
                SpellHelper.Turn(Caster, m);

                /* Attempts to place a curse on the Target that increases the mana cost of any spells they cast,
                 * for a duration based off a comparison between the Caster's Spirit Speak skill and the Target's Resisting Spells skill.
                 * The effect lasts for ((Spirit Speak skill level - target's Resist Magic skill level) / 50 ) + 20 seconds.
                 */

                m.PlaySound(0x1FB);
                m.PlaySound(0x258);
                Effects.SendTargetParticles(m, 0x373A, 1, 17, 9903, 15, 4, EffectLayer.Head);

                double duration = 40 * Spell.GetSpellScaling(Caster, Info.skillForCasting);

                double scalar = Spell.GetSpellScaling(Caster, Info.skillForCasting);

                SetMindRotScalar(Caster, m, scalar, TimeSpan.FromSeconds(duration));
            }

            FinishSequence();
        }
예제 #3
0
        public void Target(Mobile m)
        {
            if (CheckHSequence(m))
            {
                SpellHelper.Turn(Caster, m);

                SpellHelper.CheckReflect((int)this.Circle, Caster, ref m);

                m.PlaySound(0x22F);
                Effects.SendTargetParticles(m, 0x36CB, 1, 9, 9911, 67, 5, EffectLayer.Head);
                Effects.SendTargetParticles(m, 0x374A, 1, 17, 9502, 1108, 4, (EffectLayer)255);

                int baseDuration = 40;

                TimeSpan duration     = TimeSpan.FromSeconds(baseDuration * Spell.GetSpellScaling(Caster, Info.skillForCasting));
                int      PourcentRate = 30;

                if (!m_Table.Contains(m))
                {
                    m_Table.Add(m, PourcentRate);
                    new EtouffementTimer(m, duration).Start();
                }
                else
                {
                    Caster.SendMessage("Ce personnage est déjà affecté par ce sort.");
                }
            }

            FinishSequence();
        }
예제 #4
0
 public static void GetOnHitEffect(Mobile atk, double damage)
 {
     if (m_Table.Contains((BaseWeapon)atk.Weapon))
     {
         atk.Heal((int)(CurseWeaponSpell.LifestealPercentMax * Spell.GetSpellScaling(atk, Info.skillForCasting) * damage));
     }
 }
예제 #5
0
        public override void OnCast()
        {
            BaseWeapon weapon = Caster.Weapon as BaseWeapon;

            if (weapon == null || weapon is Fists /* || weapon is CreatureFists*/)
            {
                Caster.SendLocalizedMessage(501078);                   // You must be holding a weapon.
            }
            else if (CheckSequence())
            {
                Caster.PlaySound(0x387);
                Effects.SendTargetParticles(Caster, 0x3779, 1, 15, 9905, 32, 2, EffectLayer.Head);
                Effects.SendTargetParticles(Caster, 0x37B9, 1, 14, 9502, 32, 5, (EffectLayer)255);
                new SoundEffectTimer(Caster).Start();

                double duration = 180;

                duration *= Spell.GetSpellScaling(Caster, Info.skillForCasting);

                Timer t = (Timer)m_Table[weapon];

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

                m_Table[weapon] = t = new ExpireTimer(weapon, TimeSpan.FromSeconds(duration));

                t.Start();
            }

            FinishSequence();
        }
예제 #6
0
        public void Target(Mobile m)
        {
            if (Caster == m || !(m is PlayerMobile || m is BaseCreature)) // only PlayerMobile and BaseCreature implement blood oath checking
            {
                Caster.SendLocalizedMessage(1060508);                     // You can't curse that.
            }
            else if (m_OathTable.Contains(Caster))
            {
                Caster.SendLocalizedMessage(1061607);                   // You are already bonded in a Blood Oath.
            }
            else if (m_OathTable.Contains(m))
            {
                if (m.Player)
                {
                    Caster.SendLocalizedMessage(1061608);                       // That player is already bonded in a Blood Oath.
                }
                else
                {
                    Caster.SendLocalizedMessage(1061609);                       // That creature is already bonded in a Blood Oath.
                }
            }
            else if (CheckHSequence(m))
            {
                SpellHelper.Turn(Caster, m);

                /* Temporarily creates a dark pact between the caster and the target.
                 * Any damage dealt by the target to the caster is increased, but the target receives the same amount of damage.
                 * The effect lasts for ((Spirit Speak skill level - target's Resist Magic skill level) / 80 ) + 8 seconds.
                 *
                 * NOTE: The above algorithm must be fixed point, it should be:
                 * ((ss-rm)/8)+8
                 */

                m_OathTable[m]             = Caster;
                m_OathTableScaling[Caster] = Spell.GetSpellScaling(Caster, Info.skillForCasting);

                Caster.PlaySound(0x175);

                Effects.SendTargetParticles(Caster, 0x375A, 1, 17, 9919, 33, 7, EffectLayer.Waist);
                Effects.SendTargetParticles(Caster, 0x3728, 1, 13, 9502, 33, 7, (EffectLayer)255);

                Effects.SendTargetParticles(m, 0x375A, 1, 17, 9919, 33, 7, EffectLayer.Waist);
                Effects.SendTargetParticles(m, 0x3728, 1, 13, 9502, 33, 7, (EffectLayer)255);

                double duration = 60;

                duration *= Spell.GetSpellScaling(Caster, Info.skillForCasting);

                new ExpireTimer(Caster, m, TimeSpan.FromSeconds(duration)).Start();
            }

            FinishSequence();
        }
예제 #7
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);

                int dx = Caster.Location.X - p.X;
                int dy = Caster.Location.Y - p.Y;
                int rx = (dx - dy) * 44;
                int ry = (dx + dy) * 44;

                bool eastToWest;

                if (rx >= 0 && ry >= 0)
                {
                    eastToWest = false;
                }
                else if (rx >= 0)
                {
                    eastToWest = true;
                }
                else if (ry >= 0)
                {
                    eastToWest = true;
                }
                else
                {
                    eastToWest = false;
                }

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

                int itemID = eastToWest ? 0x3915 : 0x3922;

                double duration = durationMax * Spell.GetSpellScaling(Caster, Info.skillForCasting);

                for (int i = -3; i <= 3; ++i)
                {
                    Point3D loc = new Point3D(eastToWest ? p.X + i : p.X, eastToWest ? p.Y : p.Y + i, p.Z);

                    new InternalItem(itemID, loc, Caster, Caster.Map, TimeSpan.FromSeconds(duration), i);
                }
            }

            FinishSequence();
        }
예제 #8
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (CheckHSequence(m))
            {
                SpellHelper.Turn(Caster, m);

                SpellHelper.CheckReflect((int)this.Circle, Caster, ref m);

                double duration = durationMax * Spell.GetSpellScaling(Caster, Info.skillForCasting);

                m.Paralyze(TimeSpan.FromSeconds(duration));

                m.PlaySound(0x204);
                Effects.SendTargetEffect(m, 0x376A, 6, 1);
            }

            FinishSequence();
        }
예제 #9
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (m.Blessed)
            {
                Caster.SendMessage("Vous ne pouvez pas cibler une créature invulnérable !");
            }
            else if (CheckSequence())
            {
                SpellHelper.Turn(Caster, m);

                if (m != Caster && m.BeginAction(typeof(ChampDeStaseSpell)) && m.AccessLevel <= Caster.AccessLevel)
                {
                    double dur = durationMax * Spell.GetSpellScaling(Caster, Info.skillForCasting);

                    TimeSpan duration = TimeSpan.FromSeconds(dur);

                    m.Freeze(duration);

                    m.Hidden  = true;
                    m.Blessed = true;

                    Timer t = new InternalTimer(m, duration);

                    m_Timers[m] = t;

                    t.Start();
                }
                else
                {
                    Caster.SendMessage("Vous ne pouvez pas vous cibler vous-même !");
                }
            }

            FinishSequence();
        }
예제 #10
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);

                int dx = Caster.Location.X - p.X;
                int dy = Caster.Location.Y - p.Y;
                int rx = (dx - dy) * 44;
                int ry = (dx + dy) * 44;

                bool eastToWest;

                if (rx >= 0 && ry >= 0)
                {
                    eastToWest = false;
                }
                else if (rx >= 0)
                {
                    eastToWest = true;
                }
                else if (ry >= 0)
                {
                    eastToWest = true;
                }
                else
                {
                    eastToWest = false;
                }

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

                double duration = durationMax * Spell.GetSpellScaling(Caster, Info.skillForCasting);

                int itemID = eastToWest ? 0x3946 : 0x3956;

                for (int i = -3; i <= 3; ++i)
                {
                    Point3D loc    = new Point3D(eastToWest ? p.X + i : p.X, eastToWest ? p.Y : p.Y + i, p.Z);
                    bool    canFit = SpellHelper.AdjustField(ref loc, Caster.Map, 12, false);

                    if (!canFit)
                    {
                        continue;
                    }

                    Item item = new InternalItem(loc, Caster.Map, TimeSpan.FromSeconds(duration), itemID, Caster);
                    item.ProcessDelta();

                    Effects.SendLocationParticles(EffectItem.Create(loc, Caster.Map, EffectItem.DefaultDuration), 0x376A, 9, 10, 5051);
                }
            }

            FinishSequence();
        }