Exemple #1
0
                public InternalTimer(FireFieldItem item, TimeSpan delay, bool inLOS, bool canFit) : base(delay, TimeSpan.FromSeconds(1.0))
                {
                    m_Item   = item;
                    m_InLOS  = inLOS;
                    m_CanFit = canFit;

                    Priority = TimerPriority.FiftyMS;
                }
Exemple #2
0
 public InternalTimer( FireFieldItem item )
     : base(TimeSpan.FromSeconds( 0.5 ), TimeSpan.FromSeconds( 1.0 ))
 {
     m_Item = item;
 }
Exemple #3
0
 public InternalTimer(FireFieldItem item)
     : base(TimeSpan.FromSeconds(0.5), TimeSpan.FromSeconds(1.0))
 {
     m_Item = item;
 }
Exemple #4
0
                public InternalTimer(FireFieldItem item, TimeSpan delay, bool inLOS, bool canFit)
                    : base(delay, TimeSpan.FromSeconds(1.0))
                {
                    this.m_Item = item;
                    this.m_InLOS = inLOS;
                    this.m_CanFit = canFit;

                    this.Priority = TimerPriority.FiftyMS;
                }
Exemple #5
0
        public void Target(IPoint3D p)
        {
            if (!Caster.CanSee(p))
            {
                Caster.SendLocalizedMessage(500237); // Target can not be seen.
            }
            else if (BaseBoat.FindBoatAt(p, Caster.Map) != null)
            {
                Caster.SendMessage("That location is blocked.");
            }

            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, 0x20C);

                int itemID = eastToWest ? 0x398C : 0x3996;

                TimeSpan duration;

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

                duration = TimeSpan.FromSeconds(4.0 + (Caster.Skills[SkillName.Magery].Value * 0.5));

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

                    FireFieldItem fireField = new FireFieldItem(itemID, loc, Caster, Caster.Map, duration, i);

                    if (enhancedSpellcast)
                    {
                        fireField.m_Enhanced = true;
                    }
                }
            }

            FinishSequence();
        }