示例#1
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 map = from.Map;

            if (map != null)
            {
                Packet particles = null, regular = null;

                IPooledEnumerable eable = map.GetClientsInRange(from.Location);

                foreach (NetState state in eable)
                {
                    state.Mobile.ProcessDelta();

                    if (SendParticlesTo(state))
                    {
                        if (particles == null)
                        {
                            particles = new MovingParticleEffect(from, to, itemID, speed, duration, fixedDirection, explodes, hue, renderMode, effect, explodeEffect, explodeSound, layer, unknown);
                        }

                        state.Send(particles);
                    }
                    else if (itemID > 1)
                    {
                        if (regular == null)
                        {
                            regular = new MovingEffect(from, to, itemID, speed, duration, fixedDirection, explodes, hue, renderMode);
                        }

                        state.Send(regular);
                    }
                }

                eable.Free();
            }

            //SendPacket( from.Location, from.Map, new MovingParticleEffect( from, to, itemID, speed, duration, fixedDirection, explodes, hue, renderMode, effect, explodeEffect, explodeSound, unknown ) );
        }
示例#2
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();
        }