[Extremely Important!!] Effects in 5165

02/24/2010 03:04 -NewDawn-#1
There is a huge problem in the 5165 source regarding effects: they're all client side, meaning only the person who set it off can see them! Use my code to launch an effect:

Code:
if (Cmd[0] == "/effect")
                            {
                                Game.World.Effect = Cmd[1];
                                foreach (Game.Character Player in Game.World.H_Chars.Values)
                                {
                                    Player.MyClient.AddSend(Packets.String(Player.EntityID, 10, Game.World.Effect));
                                }
                            }
The code works like this:
/effect firework-1love <-- temporary effect
/effect M_Fire <-- Permanent Effect (Until Logout shown below)
[Only registered and activated users can see links. Click Here To Register...]

Ok, so the problem is, we need to code some kind of class that will make effects appear on everyone's screens that are within range. Right now, if you set off an effect, even from a normal skill, it will only appear on your screen. This wouldn't be such a huge problem if it didn't mess with mostly all of the features in Conquer Online. =\

At the moment, these are the features being affected:
  1. Marriage Fireworks
  2. Skill Effects (including mount steed, shield, etc)
  3. Fireworks from the Market
  4. NightDevil and transformation effects
  5. Night and Day Command
  6. Flower Effects
and probably a lot more that I can't remember right now.

So I'm going to start us off, we all know that the "Level Up" effect is an effect that everyone can see. I'm trying to locate it right now, but if anyone is faster than i am, POST IT!


I will update this post every time we get further along.

Good Luck everyone! I'm sure we can all figure this out together!
[Only registered and activated users can see links. Click Here To Register...]
(The effect above is NightDevil which is only a transformation as seen by the Person who performed the spell)
02/24/2010 03:08 Arcо#2
Code:
if (Cmd[0] == "/effect")
                            {
 
                                foreach (Game.Character Player in Game.World.H_Chars.Values)
                                {
                                    Player.MyClient.AddSend(Packets.String(Player.EntityID, 10, Cmd[1]));
                                }
                            }
Try?
02/24/2010 03:21 -NewDawn-#3
Quote:
Originally Posted by .Arco View Post
Code:
if (Cmd[0] == "/effect")
                            {
 
                                foreach (Game.Character Player in Game.World.H_Chars.Values)
                                {
                                    Player.MyClient.AddSend(Packets.String(Player.EntityID, 10, Cmd[1]));
                                }
                            }
Try?
OMG! U're MAGIC!

So this in the fireworks release and all of the effect releases
MyClient.AddSend(Packets.String(MyClient.MyChar.En tityID, 10, "firework-1love"));

Should be replaced with stuff like that code?
Damn dude! HIGH FIVE (i'm a noob - but i think that rocks.) lol


But there's a second part to the problem:
Lets say we have my character (Fang) who has a fairy going around him using one of the effects. How do we target players so that the effect is on one person BUT everyone can see?
02/24/2010 03:25 Arcо#4
Quote:
Originally Posted by -NewDawn- View Post
OMG! U're MAGIC!

So this in the fireworks release and all of the effect releases
MyClient.AddSend(Packets.String(MyClient.MyChar.En tityID, 10, "firework-1love"));

Should be replaced with stuff like that code?
Damn dude! HIGH FIVE (i'm a noob - but i think that rocks.) lol


But there's a second part to the problem:
Lets say we have my character (Fang) who has a fairy going around him using one of the effects. How do we target players so that the effect is on one person BUT everyone can see?
Yes, but got to do the for each part as well.

What do you mean by a fairy using the effect?
02/24/2010 03:39 -NewDawn-#5
Quote:
Originally Posted by .Arco View Post
Yes, but got to do the for each part as well.

What do you mean by a fairy using the effect?
oh, if you're using my effect command,
type /effect elf-standby

It's just an effect that makes a fairy dance around u for a few seconds. lol
[Only registered and activated users can see links. Click Here To Register...]
02/24/2010 03:41 -Shunsui-#6
For Everyone to See them, Try

Code:
{ Game.World.Action(GC.MyChar, Packets.String(GC.MyChar.EntityID, 10, "elf-standby").Get); }
02/24/2010 03:45 Arcо#7
Quote:
Originally Posted by -NewDawn- View Post
oh, if you're using my effect command,
type /effect elf-standby

It's just an effect that makes a fairy dance around u for a few seconds. lol
[Only registered and activated users can see links. Click Here To Register...]
The effect command I gave you works for EVERY command just so you know.
02/24/2010 03:49 -NewDawn-#8
Quote:
Originally Posted by -Shunsui- View Post
For Everyone to See them, Try

Code:
{ Game.World.Action(GC.MyChar, Packets.String(GC.MyChar.EntityID, 10, "elf-standby").Get); }
When would I use this? To target an individual that has the effect but everyone can see it? =\?

Quote:
Originally Posted by .Arco View Post
The effect command I gave you works for EVERY command just so you know.
I WOULD use your command for effects like fireworks and roses... but i tested it on my server and all my beta testers on any map can see it. How can I prevent that?

EDIT: I came up with this:
Code:
 if (Cmd[0] == "/effect")
                        {
                            
                            foreach (Game.Character Player in Game.World.H_Chars.Values)
                            {
                                if (Player.Loc.Map == GC.MyChar.Loc.Map)
                                {
                                    if (MyMath.InBox(GC.MyChar.Loc.X, GC.MyChar.Loc.Y, Player.Loc.X, Player.Loc.Y, 12))
                                        Player.MyClient.AddSend(Packets.String(Player.EntityID, 10, Cmd[1]));
                                }
                            }
                        }
Still no idea how to make that a firework though to replace this file:
Code:
#region Firwork
                    case 720030:
                        {
                            RemoveItem(I);
                            {

                                foreach (Game.Character Player in Game.World.H_Chars.Values)
                                {

                                    Player.MyClient.AddSend(Packets.String(Player.EntityID, 10, "firework-like"));
                                }
                            }
                        }
                        break;
                    #endregion
02/24/2010 13:25 ramix#9
try this

Code:
#region Firwork
                    case 720030:
                        {
                            RemoveItem(I);
                            {
                                World.Action(this, Packets.ItemPacket(EntityID, 255, 26).Get);
                            }
                        }
                        break;
                    #endregion
02/25/2010 00:16 -NewDawn-#10
Quote:
Originally Posted by ramix View Post
try this

Code:
#region Firwork
                    case 720030:
                        {
                            RemoveItem(I);
                            {
                                World.Action(this, Packets.ItemPacket(EntityID, 255, 26).Get);
                            }
                        }
                        break;
                    #endregion
Well, we got fireworks working now with the help of this thread:
[Only registered and activated users can see links. Click Here To Register...]

Now the only remaining effects problem that we need to conquer is how to make it so that an effect is targeted meaning someone can be standing by you and see an effect go off on you instead of themselves. (Fireworks over their head for example - not that we want this effect to happen BUT let just use it as an example.)

So ramix, what exactly does your code do? "World.Action" means that it will effect all maps and all characters right?
02/25/2010 00:25 Arcо#11
Quote:
Originally Posted by -NewDawn- View Post
Well, we got fireworks working now with the help of this thread:
[Only registered and activated users can see links. Click Here To Register...]

Now the only remaining effects problem that we need to conquer is how to make it so that an effect is targeted meaning someone can be standing by you and see an effect go off on you instead of themselves. (Fireworks over their head for example - not that we want this effect to happen BUT let just use it as an example.)

So ramix, what exactly does your code do? "World.Action" means that it will effect all maps and all characters right?
Code:
                        if (Cmd[0] == "/effect")
                        {
                            Game.Character C = Game.World.CharacterFromName(Cmd[1]);
                            {
                                foreach (Game.Character Player in Game.World.H_Chars.Values)
                            {
                                C.MyClient.AddSend(Packets.String(C.EntityID, 10, Cmd[2]));
                            }

                            }
                        }
Try that, not 100% sure it will work as its untested.
ex:/effect Arco effectname
02/25/2010 01:07 -NewDawn-#12
Quote:
Originally Posted by .Arco View Post
Code:
                        if (Cmd[0] == "/effect")
                        {
                            Game.Character C = Game.World.CharacterFromName(Cmd[1]);
                            {
                                foreach (Game.Character Player in Game.World.H_Chars.Values)
                            {
                                C.MyClient.AddSend(Packets.String(C.EntityID, 10, Cmd[2]));
                            }

                            }
                        }
Try that, not 100% sure it will work as its untested.
ex:/effect Arco effectname
Doesn't work well =\ It only makes it so that it appears for that target. Nobody else can see it on that target.
02/25/2010 01:31 Arcо#13
Quote:
Originally Posted by -NewDawn- View Post
ok, I'll give it a try when I get back from getting my hair cut. It's 2 inches? longer than it should be. rofl. It looks like it'll work though. BBL.
I'm pretty sure that's not gonna work though, just give it a shot.
02/25/2010 08:01 .Ocularis#14
Code:
        public static void Action(Character C, byte[] Data)
        {
            try
            {
                foreach (Character CC in H_Chars.Values)
                {
                    if (CC.Loc.Map == C.Loc.Map && MyMath.InBox(C.Loc.X, C.Loc.Y, CC.Loc.X, CC.Loc.Y, 20))
                        CC.MyClient.AddSend(Data);
                }
            }
            catch { }
        }
?

That reads from your character and updates your characters info to all other clients within a range of 20... I think :P

So if you add a new thing like this...
Code:
public ArrayList UsingEffects = new ArrayList(2... or 3 keep it small so someone can't add 9 million effects)
With new entrys added to the list with this
Code:
C.MyChar.UsingEffects.Add(EffectID or whatever);
Somewhere below this
Code:
    public class Character
    {
        System.Timers.Timer Timer = new System.Timers.Timer();
        public enum JobName : byte
        {
            Zubat(Noob) = 1
            InternTrojan = 10,
            Trojan = 11,
            VeteranTrojan = 12,
            TigerTrojan = 13,
            DragonTrojan = 14,
            TrojanMaster = 15,
            InternWarrior = 20,
            Warrior = 21,
            BrassWarrior = 22,
            SilverWarrior = 23,
            GoldWarrior = 24,
            WarriorMaster = 25,
            Gladiator = 35
            InternArcher = 40,
            Archer = 41,
            EagleArcher = 42,
            TigerArcher = 43,
            DragonArcher = 44,
            ArcherMaster = 45,
            InternNinja = 50,
            Ninja = 51,
            MiddleNinja = 52,
            DarkNinja = 53,
            MysticNinja = 54,
            NinjaMaster = 55,
            Taoist = 101,
            WaterTaoist = 132,
            WaterWizard = 133,
            WaterMaster = 134,
            WaterSaint = 135,
            FireTaoist = 142,
            FireWizard = 143,
            FireMaster = 144,
            FireSaint = 145
        }
in Character.cs

Then have something else that will read from that list and send the effect packets of all active effects in MyClient to TheirClient using
Code:
        public static void Action(Character C, byte[] Data)
        {
            try
            {
                foreach (Character CC in H_Chars.Values)
                {
                    if (CC.Loc.Map == C.Loc.Map && MyMath.InBox(C.Loc.X, C.Loc.Y, CC.Loc.X, CC.Loc.Y, 20))
                        CC.MyClient.AddSend(Data);
                }
            }
            catch { }
        }
I think that would work... ish? Ish if at all? -.-

I've found nothing that would tell me NCS is currently capable of reading the current effects of MyClient and send the same effects to TheirClient within a range of 20.... but then again, I really don't even know what I'm looking for

... I'm thinking too damn hard now...:facepalm:


Does anyone know what I'm talking about more than me?
I'm thinking of the new KGB commercial now. I've got my head up my 'you know what'.....
But I'm learning :D
From the inside of my 'you know what' I guess ...:facepalm:


Anyway, if this was made to work... It wouldn't just make /effect viewable to all other clients.
It would fix gem,bless... cool... All effects. But the scripts that initialize those effects would have to be re written to write to the array list and then cleared when the effect is over..?
02/25/2010 08:49 ramix#15
Quote:
Originally Posted by -NewDawn- View Post
Well, we got fireworks working now with the help of this thread:
[Only registered and activated users can see links. Click Here To Register...]

Now the only remaining effects problem that we need to conquer is how to make it so that an effect is targeted meaning someone can be standing by you and see an effect go off on you instead of themselves. (Fireworks over their head for example - not that we want this effect to happen BUT let just use it as an example.)

So ramix, what exactly does your code do? "World.Action" means that it will effect all maps and all characters right?


yes all characters can see your effect... that works for me i tested... i chance in cool effect too for all characters see the effect :D