edit : okay now forget what i've said been hrs looking for this stuff but still at some point so **** confused
now i got a working proxy , i got packet structure for entity spawn and for attacking packet and i can simply do something like ummm here
while(hunting)
get monsters x,y from packet 10014
send 1022 packet to the server with action kill the monster , right ? and incase i want to update the client i send the server reply to the client , right ?
is that right ? i don't think so , cuz i get the 10014 packet way faster than ill reply for it
for example : servers send me 50 monsters and i reply that i've killed 1 , so server won't send more till i move , right ?
should i save them in a list then with foreach loop ?
i duno im completely lost , will keep trying but still need little help to save time , thanks and any help is appreciated
edit : okay now forget what i've said been hrs looking for this stuff but still at some point so **** confused
now i got a working proxy , i got packet structure for entity spawn and for attacking packet and i can simply do something like ummm here
while(hunting)
get monsters x,y from packet 10014
send 1022 packet to the server with action kill the monster , right ? and incase i want to update the client i send the server reply to the client , right ?
is that right ? i don't think so , cuz i get the 10014 packet way faster than ill reply for it
for example : servers send me 50 monsters and i reply that i've killed 1 , so server won't send more till i move , right ?
should i save them in a list then with foreach loop ?
i duno im completely lost , will keep trying but still need little help to save time , thanks and any help is appreciated
That's where dictionary's/Lists come in handy...
You need to store the spawned monsters in a dictionary/list based on monster type/level which is totally up to you and create a thread to loop through that list content... find the closest monster and attack it
Attached is a C# Example.. check it out it might be useful to you
fine i know about that , list and then attack them , but i was talking about better view , like hit nearest monster (which i think it's kinda useless) or like jump when there is no more monsters
anyway i've done that so far , using collection to sort monsters on sight and haven't made it to attack them yet as i'm not done with 1022 , also so damn confused at 10017 as im trying to make it auto use fs once it come , all i got is 10017 1022 1105 and trying to understand them correctly
so far have done 10010 1004 10014 1101 1009 but still need help or atleast couple of days to fully understand the rest of packets , it's kinda fun but sometimes boring when u can't figure out anything about something or how it works
anyway thanks , if u don't mind i would want to know what packet recived/sent for xp skills , pm or post ^^ thanks bro
EDIT : HAHAHAHAHAHAHHAHAHAHAHAHA I DID IT FUCKKKKKKKKKKKKKK XD
finally after an hr i figured it out
Code:
case 10017:
Console.WriteLine("packed of 10017 had came to life with value at offset 16 = " + BitConverter.ToInt16(data, 16));
if (BitConverter.ToInt16(data, 16) == 16)
{
Console.WriteLine("xp skill is there , test code");
byte[] data2; // this should send superman to server and server will tell client if it works and activate it
data2 = new byte[48];
ReadWrite.WriteUInt16(0x0028, 0, data2);
ReadWrite.WriteUInt16(0x03FE,2,data2);
ReadWrite.WriteUInt32(0x000F50C0, 8, data2);
ReadWrite.WriteUInt32(0x9DE0A56B, 12, data2);
ReadWrite.WriteUInt16(role.X, 16, data2);
ReadWrite.WriteUInt16(role.Y, 18, data2);
ReadWrite.WriteUInt32(0x00000018, 20, data2);
ReadWrite.WriteUInt32(0xCC2161CA, 24, data2);
Console.WriteLine("trying to send this packet to activate fs" + data2.ToString()); //should be convert.tostring(data2) ^^
role.SendToServer(data2);
}
break;
it's damn fun to figure stuff on your own , yes was packet 10017 offset 16 with value 0x10 (16b)
ill struct it now for the rest of xp skills i was doing it on wrong offset
and thank you for the class example , ill check it out now
for any mod , close this thread , i was damn wrong to give up and post this , doing it on my own sounds more fun XD
Here's a VERY basic example of how I have coded it in the past.
Step 1: Learn about your surroundings.
In your packet handler you handle the entity spawn packet. If the UID matches the range for monsters (300k-500k iirc) then add it to a monsters list by storing the X/Y/UID + any other information you feel you want for your purposes.
Step 2: Updating the map
On kill subtype (server>Client interaction packet with subtype kill) then you remove the UID from your map collection.
On moving (jump/walk Client>Server) you check all stored monsters to see if they are off screen and now you remove from your map collection
On Entity remove subtype of general data packet (very rare but may as well handle it) remove from the map collection
Grats! You can now move around the map and have an always up to date list of monsters which are currently on your screen.
Now you need to create a logic thread. This will look something like...
//Only abort the logic loop when you disconnect and should be clearing your resources at this point
while(user.Connected)
{
//use whatever time system you want. Personally I've used Environment.TickCount, SystemTime and DateTime. They all work just fine
if(user.LastAttack + user.AttackSpeed > CurrentTime)
{
Monster mob = GetClosestMonster();//Just cycle through the monsters collection and pull closest to your location!
if(mob == null)
{
//Pick a location to move to and jump/walk there! (pathfinding or random movement checked vs dmaps.
}
else if(Distance(user, mob) < 3)//In melee Range
{
user.SendToServer(new InteractionPacket(AttackType.Melee, user.UID, mob.UID));
user.LastAttack = CurrentTime;
}
else
{
Point moveTo = GetPathPoint(user, mob);//Simple function to find a point to move to closer to monsters
user.SendToServer(new GeneralDataPacket(ActionType.Jump, user UID, moveTo.X, moveTo.Y));
user.SendToClient(new GeneralDataPacket(ActionType.NinjaStep, user.UID, moveTo.X, moveTo.Y));
//This is debatable. Ideally I'd only update my position from the Server>Client Jump responses but this is a simple example so whatever.
user.X = moveTo.X;
user.Y = moveTo.Y;
}
}
}
case 10014 :
if(GUI.__ishunting)
{
Dictionary<uint, Point> Monsters = new Dictionary<uint, Point>();
ushort X = BitConverter.ToUInt16(data, 86);//get the X value from the packet
ushort Y = BitConverter.ToUInt16(data, 88);//get the Y value from the packet
uint UID = BitConverter.ToUInt32(data, 8);
Monsters.Add(UID, new Point (X,Y) , true);
if (Monsters.Keys.Count != 0)
{
foreach (KeyValuePair<uint, Point> monster in Monsters)
{
if ((role.X - BitConverter.ToInt16(data, 16) < 18) && (role.Y - BitConverter.ToInt16(data, 18) < 18))
{
try
{
Console.WriteLine("hunting started");
byte[] data3; // this should send superman to server and server will tell client if it works and activate it
data3 = new byte[40];
ReadWrite.WriteUInt16(0x0028, 0, data3);
ReadWrite.WriteUInt16(0x03FE, 2, data3);
ReadWrite.WriteUInt32(0x000F50C0, 8, data3);
ReadWrite.WriteUInt32(monster.Key, 12, data3);
ReadWrite.WriteUInt16((Convert.ToUInt16(monster.Value.X)), 16, data3);
ReadWrite.WriteUInt16((Convert.ToUInt16(monster.Value.Y)), 18, data3);
ReadWrite.WriteUInt32(0x00000002, 20, data3);
Console.WriteLine("trying to send this packet to hunt");
role.SendToServer(data3);
}
finally
{
// Point newpoint = new Point(((Convert.ToUInt16(monster.Value.X)),(Convert.ToUInt16(monster.Value.Y))));
Monsters.Remove(monster.Key);
}
}
}
that's what i was doing , basically trying to kill every monster i get on packet 10014 , if failed or passed it remove it from the directory , it's really shitty and giving me error that the directory had been modified (duno how to solve it) , anyway ill read now what u posted and will rewrite it all over again , duno how to separate the hunting/looting from packets aka can't create events and stuff cuz im asshole in c# and my packet structures ain't good , but ill work on it , thanks and ill rewrite it once more
case 10014 :
if(GUI.__ishunting)
{
Dictionary<uint, Point> Monsters = new Dictionary<uint, Point>();
ushort X = BitConverter.ToUInt16(data, 86);//get the X value from the packet
ushort Y = BitConverter.ToUInt16(data, 88);//get the Y value from the packet
uint UID = BitConverter.ToUInt32(data, 8);
Monsters.Add(UID, new Point (X,Y) , true);
if (Monsters.Keys.Count != 0)
{
foreach (KeyValuePair<uint, Point> monster in Monsters)
{
if ((role.X - BitConverter.ToInt16(data, 16) < 18) && (role.Y - BitConverter.ToInt16(data, 18) < 18))
{
try
{
Console.WriteLine("hunting started");
byte[] data3; // this should send superman to server and server will tell client if it works and activate it
data3 = new byte[40];
ReadWrite.WriteUInt16(0x0028, 0, data3);
ReadWrite.WriteUInt16(0x03FE, 2, data3);
ReadWrite.WriteUInt32(0x000F50C0, 8, data3);
ReadWrite.WriteUInt32(monster.Key, 12, data3);
ReadWrite.WriteUInt16((Convert.ToUInt16(monster.Value.X)), 16, data3);
ReadWrite.WriteUInt16((Convert.ToUInt16(monster.Value.Y)), 18, data3);
ReadWrite.WriteUInt32(0x00000002, 20, data3);
Console.WriteLine("trying to send this packet to hunt");
role.SendToServer(data3);
}
finally
{
// Point newpoint = new Point(((Convert.ToUInt16(monster.Value.X)),(Convert.ToUInt16(monster.Value.Y))));
Monsters.Remove(monster.Key);
}
}
}
that's what i was doing , basically trying to kill every monster i get on packet 10014 , if failed or passed it remove it from the directory , it's really shitty and giving me error that the directory had been modified (duno how to solve it) , anyway ill read now what u posted and will rewrite it all over again , duno how to separate the hunting/looting from packets aka can't create events and stuff cuz im asshole in c# and my packet structures ain't good , but ill work on it , thanks and ill rewrite it once more
#1: If you send attack packet with coords > 6 from where you are then you get booted.
#2: if you attack too quickly you can get booted.
You need to be sure to handle things in a timely fashion that makes sense with how the game plays and interacts with the server (EG: Cannot just say "yah, i attacked that monster that's across the map from me cause I can!" the server simply won't allow it and will either ignore, boot or botjail you)
nice thread, i actually hope the lad keeps us posted on his progress..
over at chrome the spawn is analysed as the account is attacking it so you get the best out of the xp skill.
Packet Structure from SRO_Client.exe 06/12/2011 - SRO Coding Corner - 2 Replies Hello Community,
im developing a new emulator and use a packet sniffer for finding my packets.
Now i want to try to read the packet structure from client with ollydbg. That would simplify my work.
I hope someone can explain me how it works
[Request] Packet Structure for CharData Packet 05/16/2011 - Silkroad Online - 4 Replies can someone tell me which structure the CharData packet has? i would really appreciate this, since im still noob in such things. its just too high for me/ too much information for my head. :handsdown:
S->C(3013)...
packet structure 03/09/2008 - Conquer Online 2 - 16 Replies For what I'd like to do, I think packets are the place to start. After that, probably java then C and VB. This is a question for the people here who are self-taught... what resources would you recommend for...
1. understanding packet structure
2. learning some programming language without enrolling at the local university
I'm mainly interested in packet structure and how to capture/decipher/edit/send them, and eventually I'd like to "automate" these functions by writing some programs. ...