[Release] Activate Fireworks

02/23/2010 21:05 ~jochemke~#16
If he coded it or not he released it anyway . won't make any difference to that .
but yea good work :)
02/24/2010 00:21 -NewDawn-#17
Can we get back to topic? =\
I'm having some problems with making it so that everyone can see it...
any ideas on how to fix it (from anyone)?
02/24/2010 00:23 [GM]#18
Quote:
Originally Posted by -NewDawn- View Post
Can we get back to topic? =\
I'm having some problems with making it so that everyone can see it...
any ideas on how to fix it (from anyone)?
what kind of problems?
02/24/2010 00:37 -NewDawn-#19
well, it's not a problem... it works on the client side... but nobody else can see them except you.
02/24/2010 00:48 [GM]#20
Quote:
Originally Posted by -NewDawn- View Post
well, it's not a problem... it works on the client side... but nobody else can see them except you.
ya thats right nobody can see them this problem also with Cool Effects etc.
02/24/2010 07:21 -NewDawn-#21
Quote:
Originally Posted by [GM] View Post
ya thats right nobody can see them this problem also with Cool Effects etc.
Code:
                    #region Firwork EndlessLove
                    case 720031:
                        {
                            RemoveItem(I);
                            {

                                foreach (Game.Character Player in Game.World.H_Chars.Values)
                                {
                                    Player.MyClient.AddSend(Packets.String(Player.EntityID, 10, "firework-1love"));
                                }
                            }
                        }
                        break;
                    #endregion
                    #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
                    #region Firwork MyWish 
                    case 720032:
                        {
                            RemoveItem(I);
                            {

                                foreach (Game.Character Player in Game.World.H_Chars.Values)
                                {
                                    Player.MyClient.AddSend(Packets.String(Player.EntityID, 10, "firework-2love"));
                                }
                            }
                        }
                        break;
                    #endregion
Now EVERYONE can see it.... and that's the problem. It doesn't matter what map you're on. Everyone can see it. rofl! x_x""
02/24/2010 09:02 ramix#22
or u can put that and chance

Quote:
World.Action(this, Packets.String(EntityID, 10, "firework-2love").Get);
02/24/2010 10:16 Korvacs#23
Code:
                    #region Firwork EndlessLove
                    case 720031:
                        {
                            RemoveItem(I);
                            {
                                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(Packets.String(CC.EntityID, 10, "firework-1love"));
                                }
                            }
                        }
                        break;
                    #endregion
                    #region Firwork
                    case 720030:
                        {
                            RemoveItem(I);
                            {
                                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(Packets.String(CC.EntityID, 10, "firework-like"));
                                }
                            }
                        }
                        break;
                    #endregion
                    #region Firwork MyWish
                    case 720032:
                        {
                            RemoveItem(I);
                            {
                                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(Packets.String(CC.EntityID, 10, "firework-2love"));
                                }
                            }
                        }
                        break;
                    #endregion
Hows this?
02/25/2010 00:08 -NewDawn-#24
Quote:
Originally Posted by Korvacs View Post
Code:
                    #region Firwork EndlessLove
                    case 720031:
                        {
                            RemoveItem(I);
                            {
                                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(Packets.String(CC.EntityID, 10, "firework-1love"));
                                }
                            }
                        }
                        break;
                    #endregion
                    #region Firwork
                    case 720030:
                        {
                            RemoveItem(I);
                            {
                                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(Packets.String(CC.EntityID, 10, "firework-like"));
                                }
                            }
                        }
                        break;
                    #endregion
                    #region Firwork MyWish
                    case 720032:
                        {
                            RemoveItem(I);
                            {
                                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(Packets.String(CC.EntityID, 10, "firework-2love"));
                                }
                            }
                        }
                        break;
                    #endregion
Hows this?
Well that could work but how would one define "C".
When your code is rewritten to make sense with the server it looks like this:
Code:
#region Firwork
                    case 720030:
                        {
                            RemoveItem(I);
                            {
                                foreach (Game.Character CC in Game.World.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(Packets.String(CC.EntityID, 10, "firework-like"));
                                }
                            }
                        }
                        break;
                    #endregion
with "CC" defined in the "foreach" statement; however that leaves "C" undefined. So... this is how I defined it:

Game.Character C = MyClient.MyChar;

This worked perfectly =P

The new code that works perfectly should appear as followed with the help of Korvacs:

Code:
#region Firwork EndlessLove
                    case 720031:
                       {
                            RemoveItem(I);
                            {
                                Game.Character C = MyClient.MyChar;
                                foreach (Game.Character CC in Game.World.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(Packets.String(CC.EntityID, 10, "firework-1love"));
                                }
                            }
                        }
                        break;
                    #endregion
                    #region Firwork
                    case 720030:
                        {
                            RemoveItem(I);
                            {
                                Game.Character C = MyClient.MyChar;
                                foreach (Game.Character CC in Game.World.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(Packets.String(CC.EntityID, 10, "firework-like"));
                                }
                            }
                        }
                        break;
                    #endregion

                    #region Firwork MyWish 
                    case 720032:
                        {
                            RemoveItem(I);
                            {
                                Game.Character C = MyClient.MyChar;
                                foreach (Game.Character CC in Game.World.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(Packets.String(CC.EntityID, 10, "firework-2love"));
                                }
                            }
                        }
                        break;
                    #endregion
02/25/2010 00:09 Arcо#25
Quote:
Originally Posted by -NewDawn- View Post
Well that could work but how would one define "C".
When your code is rewritten to make sense with the server it looks like this:
Code:
#region Firwork
                    case 720030:
                        {
                            RemoveItem(I);
                            {
                                foreach (Game.Character CC in Game.World.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(Packets.String(CC.EntityID, 10, "firework-like"));
                                }
                            }
                        }
                        break;
                    #endregion
with "CC" defined in the "foreach" statement; however that leaves "C" undefined. So... this is how I defined it:

Game.Character C = MyClient.MyChar;

This worked perfectly =P

The new code that works perfectly should appear as followed with the help of Korvacs:

Code:
#region Firwork EndlessLove
                    case 720031:
                       {
                            RemoveItem(I);
                            {
                                Game.Character C = MyClient.MyChar;
                                foreach (Game.Character CC in Game.World.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(Packets.String(CC.EntityID, 10, "firework-1love"));
                                }
                            }
                        }
                        break;
                    #endregion
                    #region Firwork
                    case 720030:
                        {
                            RemoveItem(I);
                            {
                                Game.Character C = MyClient.MyChar;
                                foreach (Game.Character CC in Game.World.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(Packets.String(CC.EntityID, 10, "firework-like"));
                                }
                            }
                        }
                        break;
                    #endregion

                    #region Firwork MyWish 
                    case 720032:
                        {
                            RemoveItem(I);
                            {
                                Game.Character C = MyClient.MyChar;
                                foreach (Game.Character CC in Game.World.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(Packets.String(CC.EntityID, 10, "firework-2love"));
                                }
                            }
                        }
                        break;
                    #endregion
Since its already under Character you can just take out C and it will work.
02/25/2010 01:25 killerbee#26
Quote:
Originally Posted by Korvacs View Post
Code:
                    #region Firwork EndlessLove
                    case 720031:
                        {
                            RemoveItem(I);
                            {
                                foreach (Character CC in [COLOR="red"]H_Chars[/COLOR].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(Packets.String(CC.EntityID, 10, "firework-1love"));
                                }
                            }
                        }
                        break;
                    #endregion
                    #region Firwork
                    case 720030:
                        {
                            RemoveItem(I);
                            {
                                foreach (Character CC in [COLOR="red"]H_Chars[/COLOR].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(Packets.String(CC.EntityID, 10, "firework-like"));
                                }
                            }
                        }
                        break;
                    #endregion
                    #region Firwork MyWish
                    case 720032:
                        {
                            RemoveItem(I);
                            {
                                foreach (Character CC in [COLOR="Red"]H_Chars[/COLOR].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(Packets.String(CC.EntityID, 10, "firework-2love"));
                                }
                            }
                        }
                        break;
                    #endregion
Hows this?
red is my error
H_Chars does not exist in the current content
02/25/2010 06:03 -NewDawn-#27
Quote:
Originally Posted by killerbee View Post
red is my error
H_Chars does not exist in the current content
That's why i assigned it in my post.
02/25/2010 06:57 killerbee#28
Quote:
Originally Posted by -NewDawn- View Post
That's why i assigned it in my post.
right now, im using urs.
02/25/2010 07:26 -NewDawn-#29
Quote:
Originally Posted by killerbee View Post
right now, im using urs.
Then there's something wrong with your source or you're putting it where it doesn't belong =P are u putting it in character.cs with the other cases of items?