Maybe it helps, because I don't know what you realy want.
Code:
public static void parseWalk(object opacket)
{
ErrorHandler.AddHandler();
Packet packet = (Packet)opacket;
currentWalk result = new currentWalk();
result.playerId = packet.data.ReadDWORD();
if (packet.data.ReadBYTE() == 1)
{
result.xSector = packet.data.ReadBYTE();
result.ySector = packet.data.ReadBYTE();
if (result.ySector == 0x80)
{
int x = packet.data.ReadSignedDWORD();
int z = packet.data.ReadSignedDWORD();
int y = packet.data.ReadSignedDWORD();
result.zPos = z;
result.xCoord = Functions.GetXCoord((int)x, result.xSector);
result.yCoord = Functions.GetYCoord((int)y, result.ySector);
}
else
{
short x = packet.data.ReadSignedWORD();
short z = packet.data.ReadSignedWORD();
short y = packet.data.ReadSignedWORD();
result.zPos = (int)z;
result.xCoord = Functions.GetXCoord((int)x, result.xSector);
result.yCoord = Functions.GetYCoord((int)y, result.ySector);
}
result.distance = Functions.CalcDistance(result.xCoord, result.yCoord);
}
Main.UpdateWalk(result);
}
public static int GetXCoord(int posX, int regionX)
{
return (int)Math.Round((double)((regionX - 135) * 192 + posX / 10));
}
public static int GetYCoord(int posY, int regionY)
{
return (int)Math.Round((double)((regionY - 92) * 192 + posY / 10));
}
public static int CalcDistance(int XCoord, int YCoord)
{
return (int)System.Math.Round(System.Math.Sqrt(Math.Pow((Main.charData.XCoord - XCoord), 2) + Math.Pow((Main.charData.YCoord - YCoord), 2)));
}
That don't really help me since it's for walk packet even it's server side packet, /wp packet is kinda different packet.
/wp packet is somehow encrypted..
however i can't find out how warps encrypted inside gmwpfort.dat maybe it has the solution!
i have mentioned in the first post how /wp packet is and what is the poses for this example and region id.
Thanks for trying to help.
new damage calculation 05/16/2014 - Seafight - 17 Replies Damage calculation bug fix | Seafight
this is the latest post from seafight
in simple terms what this means is pay 2900 crystals for extra cannons on decks just to cause the same damage as before but using more ammunition, 10% more ammo to be exact. bigpoint have gave us an update to increase damage but took it off us with a fake bug fix.
i must say im not very happy with that. would love to hear what everyone else thinks on this.
Exp Calculation 08/21/2011 - CO2 Private Server - 4 Replies I know this is not real exp calculation and it's custom.
Just wondering, if it would be a good way to do it custom.
static ulong GetExerience(ulong GainExperience, byte attLevel, byte oppLevel, byte Rate, uint Damage, byte Reborns, byte TeamMembers)
{
ulong Experience = (attLevel <= oppLevel) ? (GainExperience * Rate) : ((GainExperience / attLevel) * Rate);
Experience += (ulong)(Damage ^ (Reborns + oppLevel)) / TeamMembers;
return...
Exp calculation? 01/09/2011 - CO2 Programming - 3 Replies Hey,
Does anyone has a decent exp calculation, or show me atleast how it is calculated? I really have no idea when it comes to conquer.
Thanks in advance,
ImmuneOne.
Damage Calculation 08/02/2010 - CO2 PServer Guides & Releases - 12 Replies Okay. I haven't found any physical damage calculations out there that involves BP. Maybe nobody wants it or what but Ive been lurking these forums for a while looking for ideas for my server. Anyway, here's my ROUGH (+- 1.5k) damage compared to the real co. If anyone got any ideas on how to improve my equation by all means please post.
I use 5165 but the gist of it should be the same as other servers.
also, thanks to CoEmu v2, I used some of the damage calculation from there namely the...
Repair Calculation 06/04/2010 - CO2 Private Server - 0 Replies Here is the correct gold calculation for repairing an item:
int nRecoverDurability = Math.Max(0, Item.Stats.Durability - Item.CurDurability);
if (nRecoverDurability == 0)
return;
byte Quality = ItemManipulation.GetQuality((int)Item.Stats.ID);
double QualityMultipier = 0;