Exemple #1
0
        public void DoFireColumn()
        {
            Direction columnDir = Utility.GetDirection(this, Combatant);

            Packet            flash = ScreenLightFlash.Instance;
            IPooledEnumerable e     = Map.GetClientsInRange(Location, Core.GlobalUpdateRange);

            foreach (NetState ns in e)
            {
                if (ns.Mobile != null)
                {
                    ns.Mobile.Send(flash);
                }
            }

            e.Free();

            int  x     = X;
            int  y     = Y;
            bool south = columnDir == Direction.East || columnDir == Direction.West;

            Movement.Movement.Offset(columnDir, ref x, ref y);

            for (int i = 0; i < 8; i++)
            {
                Movement.Movement.Offset(columnDir, ref x, ref y);

                IPoint3D p = new Point3D(x, y, Map.GetAverageZ(x, y)) as IPoint3D;
                SpellHelper.GetSurfaceTop(ref p);

                var fire = new FireField(this, Utility.RandomMinMax(25, 32), south);
                fire.MoveToWorld(new Point3D(p), Map);
            }
        }
Exemple #2
0
        public void DoFireColumn()
        {
            var map = Map;

            if (map == null)
            {
                return;
            }

            Direction columnDir = Utility.GetDirection(this, Combatant);

            Packet            flash = ScreenLightFlash.Instance;
            IPooledEnumerable e     = Map.GetClientsInRange(Location, Core.GlobalUpdateRange);

            foreach (NetState ns in e)
            {
                if (ns.Mobile != null)
                {
                    ns.Mobile.Send(flash);
                }
            }

            e.Free();

            int  x     = X;
            int  y     = Y;
            bool south = columnDir == Direction.East || columnDir == Direction.West;

            Movement.Movement.Offset(columnDir, ref x, ref y);
            Point3D p = new Point3D(x, y, Z);

            SpellHelper.AdjustField(ref p, map, 16, false);

            var fire = new FireField(this, Utility.RandomMinMax(25, 32), south);

            fire.MoveToWorld(p, map);

            for (int i = 0; i < 7; i++)
            {
                Movement.Movement.Offset(columnDir, ref x, ref y);

                p = new Point3D(x, y, Z);
                SpellHelper.AdjustField(ref p, map, 16, false);

                fire = new FireField(this, Utility.RandomMinMax(25, 32), south);
                fire.MoveToWorld(p, map);
            }
        }
Exemple #3
0
            protected override void OnTick()
            {
                if (m_From == null || m_From.Deleted || m_Map == null || m_Map == Map.Internal)
                {
                    Stop();
                    return;
                }

                if (0.33 > Utility.RandomDouble())
                {
                    var field = new FireField(m_From, 25, Utility.RandomBool());
                    field.MoveToWorld(m_LastTarget, m_Map);
                }

                Point3D start  = new Point3D();
                Point3D finish = new Point3D();

                finish.X = m_ShowerArea.X + Utility.Random(m_ShowerArea.Width);
                finish.Y = m_ShowerArea.Y + Utility.Random(m_ShowerArea.Height);
                finish.Z = m_From.Z;

                SpellHelper.AdjustField(ref finish, m_Map, 16, false);

                //objects move from upper right/right to left as per OSI
                start.X = finish.X + Utility.RandomMinMax(-4, 4);
                start.Y = finish.Y - 15;
                start.Z = finish.Z + 50;

                Effects.SendMovingParticles(
                    new Entity(Serial.Zero, start, m_Map),
                    new Entity(Serial.Zero, finish, m_Map),
                    0x36D4, 15, 0, false, false, 0, 0, 9502, 1, 0, (EffectLayer)255, 0x100);

                Effects.PlaySound(finish, m_Map, 0x11D);

                m_LastTarget = finish;
                m_Count++;

                if (m_Count >= m_MaxCount / 2 && !m_DoneDamage)
                {
                    if (m_ToDamage != null && m_ToDamage.Count > 0)
                    {
                        int damage;

                        foreach (Mobile mob in m_ToDamage)
                        {
                            damage = Utility.RandomMinMax(m_MinDamage, m_MaxDamage);

                            m_From.DoHarmful(mob);
                            AOS.Damage(mob, m_From, damage, 0, 100, 0, 0, 0);

                            mob.FixedParticles(0x36BD, 1, 15, 9502, 0, 3, (EffectLayer)255);
                        }
                    }

                    m_DoneDamage = true;
                    return;
                }

                if (m_Count >= m_MaxCount)
                {
                    Stop();
                }
            }