SendParticlesTo() public static method

public static SendParticlesTo ( Server.Network.NetState state ) : bool
state Server.Network.NetState
return bool
Exemplo n.º 1
0
        public static void SendLocationParticles(IEntity e, int itemID, int speed, int duration, int hue, int renderMode, int effect, int unknown)
        {
            Map map1 = e.Map;

            if (map1 == null)
            {
                return;
            }
            Packet            packet1     = null;
            Packet            packet2     = null;
            IPooledEnumerable enumerable1 = map1.GetClientsInRange(e.Location);

            foreach (NetState state1 in enumerable1)
            {
                state1.Mobile.ProcessDelta();
                if (Effects.SendParticlesTo(state1))
                {
                    if (packet1 == null)
                    {
                        packet1 = new LocationParticleEffect(e, itemID, speed, duration, hue, renderMode, effect, unknown);
                    }
                    state1.Send(packet1);
                    continue;
                }
                if (itemID != 0)
                {
                    if (packet2 == null)
                    {
                        packet2 = new LocationEffect(e, itemID, speed, duration, hue, renderMode);
                    }
                    state1.Send(packet2);
                }
            }
            enumerable1.Free();
        }
Exemplo n.º 2
0
        public static void SendBoltEffect(IEntity e, bool sound, int hue)
        {
            Map map1 = e.Map;

            if (map1 == null)
            {
                return;
            }
            if ((e is Item))
            {
                ((Item)e).ProcessDelta();
            }
            else if ((e is Mobile))
            {
                ((Mobile)e).ProcessDelta();
            }
            Packet            packet1     = null;
            Packet            packet2     = null;
            Packet            packet3     = null;
            IPooledEnumerable enumerable1 = map1.GetClientsInRange(e.Location);

            foreach (NetState state1 in enumerable1)
            {
                if (state1.Mobile.CanSee(e))
                {
                    if (Effects.SendParticlesTo(state1))
                    {
                        if (packet1 == null)
                        {
                            packet1 = new TargetParticleEffect(e, 0, 10, 5, 0, 0, 5031, 3, 0);
                        }
                        state1.Send(packet1);
                    }
                    if (packet2 == null)
                    {
                        packet2 = new BoltEffect(e, hue);
                    }
                    state1.Send(packet2);
                    if (sound)
                    {
                        if (packet3 == null)
                        {
                            packet3 = new PlaySound(41, e);
                        }
                        state1.Send(packet3);
                    }
                }
            }
            enumerable1.Free();
        }
Exemplo n.º 3
0
        public static void SendMovingParticles(IEntity from, IEntity to, int itemID, int speed, int duration, bool fixedDirection, bool explodes, int hue, int renderMode, int effect, int explodeEffect, int explodeSound, EffectLayer layer, int unknown)
        {
            if ((from is Mobile))
            {
                ((Mobile)from).ProcessDelta();
            }
            if ((to is Mobile))
            {
                ((Mobile)to).ProcessDelta();
            }
            Map map1 = from.Map;

            if (map1 == null)
            {
                return;
            }
            Packet            packet1     = null;
            Packet            packet2     = null;
            IPooledEnumerable enumerable1 = map1.GetClientsInRange(from.Location);

            foreach (NetState state1 in enumerable1)
            {
                state1.Mobile.ProcessDelta();
                if (Effects.SendParticlesTo(state1))
                {
                    if (packet1 == null)
                    {
                        packet1 = new MovingParticleEffect(from, to, itemID, speed, duration, fixedDirection, explodes, hue, renderMode, effect, explodeEffect, explodeSound, layer, unknown);
                    }
                    state1.Send(packet1);
                    continue;
                }
                if (itemID > 1)
                {
                    if (packet2 == null)
                    {
                        packet2 = new MovingEffect(from, to, itemID, speed, duration, fixedDirection, explodes, hue, renderMode);
                    }
                    state1.Send(packet2);
                }
            }
            enumerable1.Free();
        }
Exemplo n.º 4
0
        public static void SendTargetParticles(IEntity target, int itemID, int speed, int duration, int hue, int renderMode, int effect, EffectLayer layer, int unknown)
        {
            if ((target is Mobile))
            {
                ((Mobile)target).ProcessDelta();
            }
            Map map1 = target.Map;

            if (map1 == null)
            {
                return;
            }
            Packet            packet1     = null;
            Packet            packet2     = null;
            IPooledEnumerable enumerable1 = map1.GetClientsInRange(target.Location);

            foreach (NetState state1 in enumerable1)
            {
                state1.Mobile.ProcessDelta();
                if (Effects.SendParticlesTo(state1))
                {
                    if (packet1 == null)
                    {
                        packet1 = new TargetParticleEffect(target, itemID, speed, duration, hue, renderMode, effect, layer, unknown);
                    }
                    state1.Send(packet1);
                    continue;
                }
                if (itemID != 0)
                {
                    if (packet2 == null)
                    {
                        packet2 = new TargetEffect(target, itemID, speed, duration, hue, renderMode);
                    }
                    state1.Send(packet2);
                }
            }
            enumerable1.Free();
        }