Inheritance: ParticleEffect
コード例 #1
0
ファイル: Effects.cs プロジェクト: BackupTheBerlios/sunuo-svn
        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 map = target.Map;

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

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

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

                    if ( SendParticlesTo( state ) )
                    {
                        if ( particles == null )
                            particles = new TargetParticleEffect( target, itemID, speed, duration, hue, renderMode, effect, (int)layer, unknown );

                        state.Send( particles );
                    }
                    else if ( itemID != 0 )
                    {
                        if ( regular == null )
                            regular = new TargetEffect( target, itemID, speed, duration, hue, renderMode );

                        state.Send( regular );
                    }
                }

                eable.Free();
            }

            //SendPacket( target.Location, target.Map, new TargetParticleEffect( target, itemID, speed, duration, hue, renderMode, effect, (int)layer, unknown ) );
        }
コード例 #2
0
ファイル: Effects.cs プロジェクト: BackupTheBerlios/sunuo-svn
        public static void SendBoltEffect( IEntity e, bool sound, int hue )
        {
            Map map = e.Map;

            if ( map == null )
                return;

            if ( e is Item )
                ((Item)e).ProcessDelta();
            else if ( e is Mobile )
                ((Mobile)e).ProcessDelta();

            Packet preEffect = null, boltEffect = null, playSound = null;

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

            foreach ( NetState state in eable )
            {
                if ( state.Mobile.CanSee( e ) )
                {
                    if ( SendParticlesTo( state ) )
                    {
                        if ( preEffect == null )
                            preEffect = new TargetParticleEffect( e, 0, 10, 5, 0, 0, 5031, 3, 0 );

                        state.Send( preEffect );
                    }

                    if ( boltEffect == null )
                        boltEffect = new BoltEffect( e, hue );

                    state.Send( boltEffect );

                    if ( sound )
                    {
                        if ( playSound == null )
                            playSound = new PlaySound( 0x29, e );

                        state.Send( playSound );
                    }
                }
            }

            eable.Free();
        }