Esempio n. 1
0
        public void Target(IPoint3D p)
        {
            Point3D point = new Point3D(p.X, p.Y, p.Z);

            if (!Caster.CanSee(p))
            {
                Caster.SendLocalizedMessage(500237); // Target can not be seen.
            }
            else if (BaseShip.FindShipAt(p, Caster.Map) != null)
            {
                Caster.SendMessage("That location is blocked.");
            }

            else if (SpellHelper.CheckTown(point, 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, 0x1F6);

                for (int i = -1; i <= 1; ++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, 22, true);

                    if (!canFit)
                    {
                        continue;
                    }

                    Item item = new WallOfStoneItem(loc, Caster.Map, Caster);
                    Effects.SendLocationParticles(item, 0x376A, 9, 10, 5025);
                }
            }

            FinishSequence();

            Caster.BeginAction(typeof(WallOfStoneSpell));
            Timer.DelayCall(TimeSpan.FromSeconds(16), delegate { Caster.EndAction(typeof(WallOfStoneSpell)); });
        }
Esempio n. 2
0
 public InternalTimer(WallOfStoneItem item, TimeSpan duration) : base(duration)
 {
     m_Item = item;
 }