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:
obviously in this code I uses a for each loop(in color blue) that would map/iterate the number of players in the game and in side the loop i have a conditional statement(in color green) that would check either a particular player that has been mapped from the game is a nearby player, If so the latter effect will be executed. this algorithm is likely similar to the algorithm in SendScreen() method found in Character.cs, so therefore we may able to change the code above and make it look simpler like this.
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;
}
new Thread(delegate()
{
[COLOR="Blue"]foreach (Game.Character CC in Game.World.H_Chars.Values)[/COLOR]
{
[COLOR="Lime"] if (CC.Loc.Map == MyClient.MyChar.Loc.Map && MyMath.InBox(MyClient.MyChar.Loc.X, MyClient.MyChar.Loc.Y, CC.Loc.X, CC.Loc.Y, 100))[/COLOR]
{
if (counter == 7)
{
if (MyClient.MyChar.Job >= 10 && MyClient.MyChar.Job <= 15)
CC.MyClient.[COLOR="Red"]AddSend[/COLOR](Packets.String(MyClient.MyChar.EntityID, 10, "warrior"));
else if (MyClient.MyChar.Job >= 20 && MyClient.MyChar.Job <= 25)
CC.MyClient.[COLOR="Red"]AddSend[/COLOR](Packets.String(MyClient.MyChar.EntityID, 10, "fighter"));
else if (MyClient.MyChar.Job >= 100)
CC.MyClient.[COLOR="Red"]AddSend[/COLOR](Packets.String(MyClient.MyChar.EntityID, 10, "taoist"));
else if (MyClient.MyChar.Job >= 39 && MyClient.MyChar.Job <= 46)
CC.MyClient.[COLOR="Red"]AddSend[/COLOR](Packets.String(MyClient.MyChar.EntityID, 10, "archer"));
else if (MyClient.MyChar.Job >= 50 && MyClient.MyChar.Job <= 55)
CC.MyClient.[COLOR="Red"]AddSend[/COLOR](Packets.String(MyClient.MyChar.EntityID, 10, "Ninja120"));
}
else
{
if (MyClient.MyChar.Job >= 10 && MyClient.MyChar.Job <= 15)
CC.MyClient.[COLOR="Red"]AddSend[/COLOR](Packets.String(MyClient.MyChar.EntityID, 10, "warrior-s"));
else if (MyClient.MyChar.Job >= 20 && MyClient.MyChar.Job <= 25)
CC.MyClient.[COLOR="Red"]AddSend[/COLOR](Packets.String(MyClient.MyChar.EntityID, 10, "fighter-s"));
else if (MyClient.MyChar.Job >= 100)
CC.MyClient.[COLOR="Red"]AddSend[/COLOR](Packets.String(MyClient.MyChar.EntityID, 10, "taoist-s"));
else if (MyClient.MyChar.Job >= 39 && MyClient.MyChar.Job <= 46)
CC.MyClient.[COLOR="Red"]AddSend[/COLOR](Packets.String(MyClient.MyChar.EntityID, 10, "archer-s"));
else if (MyClient.MyChar.Job >= 50 && MyClient.MyChar.Job <= 55)
CC.MyClient.[COLOR="Red"]AddSend[/COLOR](Packets.String(MyClient.MyChar.EntityID, 10, "Ninja120"));
}
}
MyClient.MyChar.Action = 100;
}
}).Start();
}
}
}
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;
}
if (counter == 7)
{
if (MyClient.MyChar.Job >= 10 && MyClient.MyChar.Job <= 15)
MyClient.MyChar.SendScreen(Packets.String(MyClient.MyChar.EntityID, 10, "warrior"));
else if (MyClient.MyChar.Job >= 20 && MyClient.MyChar.Job <= 25)
MyClient.MyChar.SendScreen(Packets.String(MyClient.MyChar.EntityID, 10, "fighter"));
else if (MyClient.MyChar.Job >= 100)
MyClient.MyChar.SendScreen(Packets.String(MyClient.MyChar.EntityID, 10, "taoist"));
else if (MyClient.MyChar.Job >= 39 && MyClient.MyChar.Job <= 46)
MyClient.MyChar.SendScreen(Packets.String(MyClient.MyChar.EntityID, 10, "archer"));
else if (MyClient.MyChar.Job >= 50 && MyClient.MyChar.Job <= 55)
MyClient.MyChar.SendScreen(Packets.String(MyClient.MyChar.EntityID, 10, "Ninja120"));
}
else
{
if (MyClient.MyChar.Job >= 10 && MyClient.MyChar.Job <= 15)
MyClient.MyChar.SendScreen(Packets.String(MyClient.MyChar.EntityID, 10, "warrior-s"));
else if (MyClient.MyChar.Job >= 20 && MyClient.MyChar.Job <= 25)
MyClient.MyChar.SendScreen(Packets.String(MyClient.MyChar.EntityID, 10, "fighter-s"));
else if (MyClient.MyChar.Job >= 100)
MyClient.MyChar.SendScreen(Packets.String(MyClient.MyChar.EntityID, 10, "taoist-s"));
else if (MyClient.MyChar.Job >= 39 && MyClient.MyChar.Job <= 46)
MyClient.MyChar.SendScreen(Packets.String(MyClient.MyChar.EntityID, 10, "archer-s"));
else if (MyClient.MyChar.Job >= 50 && MyClient.MyChar.Job <= 55)
MyClient.MyChar.SendScreen(Packets.String(MyClient.MyChar.EntityID, 10, "Ninja120"));
}
}
MyClient.MyChar.Action = 100;
}
}).Start();
}
}
}