GetSurfaceTop() public static method

public static GetSurfaceTop ( IPoint3D &p ) : void
p IPoint3D
return void
Beispiel #1
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();
        }
Beispiel #2
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);

                ArrayList targets = new ArrayList();

                Map map = Caster.Map;

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

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

                    eable.Free();
                }

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

                    BaseCreature bc = m as BaseCreature;

                    if (bc == null)
                    {
                        continue;
                    }

                    double dispelChance = (50.0 + ((100 * (Caster.Skills.Animisme.Value - bc.DispelDifficulty)) / (bc.DispelFocus * 2))) / 120;

                    if (dispelChance > Utility.RandomDouble())
                    {
                        Effects.SendLocationParticles(EffectItem.Create(m.Location, m.Map, EffectItem.DefaultDuration), 0x3728, 8, 20, 5042);
                        Effects.PlaySound(m, m.Map, 0x201);

                        m.Delete();
                    }
                    else
                    {
                        Caster.DoHarmful(m);

                        Effects.SendTargetEffect(m, 0x3779, 10, 20);
                        Caster.SendLocalizedMessage(1010084); // The creature resisted the attempt to dispel it!
                    }
                }
            }

            FinishSequence();
        }
Beispiel #3
0
//		// Archcure is now 1/4th of a second faster
//		public override int CastDelayBase{ get{ return base.CastDelayBase - 1; } }

        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);

                ArrayList targets = new ArrayList();

                Map map = Caster.Map;

                if (map != null)
                {
                    IPooledEnumerable eable = map.GetMobilesInRange(new Point3D(p), (int)SpellHelper.AdjustValue(Caster, 1 + Caster.Skills[SkillName.Thaumaturgie].Value / 50, true));

                    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;

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

                        Caster.DoBeneficial(m);

                        Poison poison = m.Poison;

                        if (poison != null)
                        {
                            double chanceToCure = 10000 + (int)(Caster.Skills[SkillName.Thaumaturgie].Value * 75) - ((poison.Level + 1) * 2500);
                            chanceToCure /= 100;

                            chanceToCure = SpellHelper.AdjustValue(Caster, chanceToCure);

                            if (chanceToCure > Utility.Random(100) && m.CurePoison(Caster))
                            {
                                ++cured;
                            }
                        }

                        Effects.SendTargetParticles(m, 0x373A, 10, 15, 5012, EffectLayer.Waist);
                        m.PlaySound(0x1E0);
                    }

                    if (cured > 0)
                    {
                        Caster.SendLocalizedMessage(1010058);                           // You have cured the target of all poisons!
                    }
                }
            }

            FinishSequence();
        }
Beispiel #4
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);

                ArrayList targets = new ArrayList();

                Map map = Caster.Map;

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

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

                    eable.Free();
                }

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

                double value = (int)(Caster.Skills[SkillName.Thaumaturgie].Value + Caster.Skills[SkillName.ArtMagique].Value + Caster.Skills[SkillName.Concentration].Value);
                value /= 30;

                value = SpellHelper.AdjustValue(Caster, value);

                if (value > 10)
                {
                    value = 10;
                }

                double duree = value * 9;

                duree = SpellHelper.AdjustValue(Caster, duree);

                if (duree > 120)
                {
                    duree = 120;
                }

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

                        if (m.BeginAction(typeof(DefensiveSpell)))
                        {
                            if (m.VirtualArmorMod == 0)
                            {
                                Caster.DoBeneficial(m);
                                m.VirtualArmorMod += (int)value;
                                new InternalTimer(m, (int)value, duree).Start();

                                Effects.SendTargetParticles(m, 0x375A, 9, 20, 5027, EffectLayer.Waist);
                                m.PlaySound(0x1F7);
                            }
                        }
                    }
                }
            }

            FinishSequence();
        }
Beispiel #5
0
        public void FinishSequence(IPoint3D p, bool carre)
        {
            if (!Owner.CanSee(p))
            {
                Owner.SendLocalizedMessage(500237);                   // Target can not be seen.
            }

            double time = (int)(Owner.Niveau) * (Maitrise / 10.0);

            time *= getRatio();

            m_timer = new InternalTimer(this, time);
            m_timer.Start();

            bool blok = (m_damageWalk < 1);
            int  id   = 0x93;

            if (!carre)
            {
                SpellHelper.GetSurfaceTop(ref p);

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

                int number = (int)((Owner.Niveau) * (Maitrise / 60.0));

                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, Owner.Map, 0x1F6);

                for (int i = -(number / 2); i < (number / 2); ++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, Owner.Map, 22, true);

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

                    if (!canFit)
                    {
                        continue;
                    }

                    Item item = new InternalItem(loc, Owner.Map, Owner, SortNubiaHelper.getMur(energie), time, blok, m_damageWalk);
                    item.Hue = 0; // SortNubiaHelper.getCompColor(competence);

                    m_items.Add(item);

                    //Effects.SendLocationParticles( item, 0x3728, 9, 10, 5025 );
                    SortNubiaHelper.makeBigSmoke(item.Location, item.Map);
                    //new InternalItem( loc, Caster.Map, Caster );
                }
            }
            else
            {
                Point3D cp         = (Point3D)p;
                int     decal      = 4;
                bool    eastToWest = true;
                for (int u = 0; u < 4; u++)
                {
                    switch (u)
                    {
                    case 0: cp = (Point3D)p; cp.X += decal; eastToWest = false; break;

                    case 1: cp = (Point3D)p; cp.X -= decal; eastToWest = false; break;

                    case 2: cp = (Point3D)p; cp.Y += decal; eastToWest = true; break;

                    case 3: cp = (Point3D)p; cp.Y -= decal; eastToWest = true; break;
                    }

                    for (int i = -3; i <= 3; ++i)
                    {
                        Point3D loc    = new Point3D(eastToWest ? cp.X + i : cp.X, eastToWest ? cp.Y : cp.Y + i, cp.Z);
                        bool    canFit = SpellHelper.AdjustField(ref loc, Owner.Map, 22, true);

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

                        if (!canFit)
                        {
                            continue;
                        }

                        Item item = new InternalItem(loc, Owner.Map, Owner, SortNubiaHelper.getMur(energie), time, blok, m_damageWalk);
                        item.Hue = 2184;                        //ohaCompHelper.getCompColor(competence);
                        m_items.Add(item);

                        SortNubiaHelper.makeBigSmoke(item.Location, item.Map);

                        //new InternalItem( loc, Caster.Map, Caster );
                    }
                }
            }
        }
Beispiel #6
0
        public void Target(IPoint3D p)
        {
            Party party   = Engines.PartySystem.Party.Get(Caster);
            bool  inParty = false;

            if (!Caster.CanSee(p))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (CheckSequence())
            {
                SpellHelper.Turn(Caster, p);

                SpellHelper.GetSurfaceTop(ref p);

                ArrayList targets = new ArrayList();

                Map map = Caster.Map;

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

                    foreach (Mobile m in eable)
                    {
                        if (SpellHelper.ValidIndirectTarget(Caster, m) && Caster.CanSee(m) && Caster.CanBeHarmful(m, false))
                        {
                            if (party != null && party.Count > 0)
                            {
                                for (int k = 0; k < party.Members.Count; ++k)
                                {
                                    PartyMemberInfo pmi    = (PartyMemberInfo)party.Members[k];
                                    Mobile          member = pmi.Mobile;
                                    if (member.Serial == m.Serial)
                                    {
                                        inParty = true;
                                    }
                                }
                                if (!inParty)
                                {
                                    targets.Add(m);
                                }
                            }
                            else
                            {
                                targets.Add(m);
                            }
                        }
                        inParty = false;
                    }

                    eable.Free();
                }

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

                    Caster.DoHarmful(m);

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

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

                    m.Paralyzed = false;

                    Effects.SendTargetParticles(m, 0x374A, 10, 15, 5028, EffectLayer.Waist);
                    m.PlaySound(0x1FB);
                }
            }

            FinishSequence();
        }