[Guide] make Effects viewable by players

03/09/2010 11:03 kamote#16
Quote:
Originally Posted by ramix View Post
show only the ppl is in the area... i tested and works good for me...
hmmm... how about for flowers and Fireworks effects?
03/09/2010 13:33 ramix#17
works too... because when u use the fireworks is only for ppl see in the area...
03/09/2010 13:58 kamote#18
Quote:
Originally Posted by ramix View Post
works too... because when u use the fireworks is only for ppl see in the area...
i don't think so.. and im quite sure you don't even test your code for flower effect and firework! if you did you will knew that all players in your server would see it...
03/09/2010 14:43 ramix#19
nope i tested the fireworks and works 100%...

that is the code i use for fireworks

Quote:
World.Action(this, Packets.ItemPacket(EntityID, 255, 26).Get);
03/09/2010 15:50 ~Yuki~#20
Quote:
Originally Posted by walmartboi View Post
Very nice. Wouldn't of thought of this by myself, so you deserve my special thanks. :P
You coulda just have asked me. =)
03/09/2010 16:17 -NewDawn-#21
@pro4never, thx =P lol

/on topic:
If you ask me, the effect code we have already is just fine.
It works right?
Anyways, sometimes you need the statement before the effect - like checking for ping and if the character's ping is high then it won't show for them (how do you do that btw- I just came up with that on the spot).
Why change it?
03/09/2010 19:15 -impulse-#22
Quote:
Originally Posted by kamote View Post
I feel so darn` to found out this late... in Character.cs there is a pre-made void/method called SendScreen() which has a code that would send packets to any nearby players from the executor player.

With this we may able now to use SendScreen instead of using AddSend method to any Effect code that we want... example in my previous CoolEffect UPDATE I used to have this code:
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NewestCOServer.PacketHandling
{
   class CoolEffect
    {
        public static void ActiveCool(Main.GameClient MyClient)
        {
            byte counter = 0;

            for (byte i = 1; i < 9; i++)
            {
                if (i == 7) i++;
                Game.Item I = MyClient.MyChar.Equips.Get(i);
                if (I.ID != 0)
                {
                    Game.ItemIDManipulation Q = new CoPinoy.Game.ItemIDManipulation(I.ID);
                    if (Q.Quality == Game.Item.ItemQuality.Super)
                        counter += 1;
                }
            }

            if (MyClient.MyChar.Job >= 100)
                if (counter == 6)
                    counter = 7;
            if (MyClient.MyChar.Job >= 40 && MyClient.MyChar.Job <= 45)
                if (counter == 6)
                {
                    Game.Item I = MyClient.MyChar.Equips.Get(5);
                    I.ID = MyClient.MyChar.Equips.LeftHand.ID;
                    if (I.ID == 0)
                        counter = 7;
                }
            [B]new Thread(delegate()
            {
                ...
            }).Start();   [/B]
        }
    }
}

I can't understand why would you need a new thread to do this thing....
03/09/2010 19:18 Arcо#23
Quote:
Originally Posted by -impulse- View Post
I can't understand why would you need a new thread to do this thing....

Exactly what I was thinking.
03/10/2010 01:57 kamote#24
Quote:
Originally Posted by -impulse- View Post
I can't understand why would you need a new thread to do this thing....
this thread is not for CoolEffect ... i only added it as an example...

Quote:
Why change it?
with this thread I'm not suggesting nor forcing anyone to change there existing code. I only intend to inform you guys that there is an existing code for it.