Sending Packets

12/05/2010 03:40 vuduy#136
Looks fine to me. It might be better to wait until the targetID is registered before executing the skills; you can also measure the server's latency while waiting as well. Example:

Code:
public long DoSetTarget(uint targetID)
{
	var stream = new MemoryStream();
	stream.Write(BitConverter.GetBytes(0x2), 0, 2);
	stream.Write(BitConverter.GetBytes(targetID), 0, 4);
	byte[] data = stream.ToArray();
	SendPackage(data);
	Stopwatch timer = Stopwatch.StartNew();
	while (timer.ElapsedMilliseconds < 5000)
	{
		// Check for TargetID to show up
		if (Self.TargetId == targetID) break;
		Thread.Sleep(10);
	}
	return timer.ElapsedMilliseconds / 2;
}
12/05/2010 05:35 SunB#137
All the functions are fine and the problem is when I do casting spell but I am too far from the mob. The character does not automatically run to mob. Is there any to let the game-client handle that for us or we have to handle that ourselves?
12/05/2010 08:06 vuduy#138
Use Action structures for that; it simplifies everything.
12/05/2010 09:09 Interest07#139
Just in case you don't have the action structs...


Follow:

Interaction struct (regular attack, pickup item, initiate dialogue with npc, use skill or harvest resource):


Move struct:

12/05/2010 16:07 SunB#140
what is the pointer to the Action struct from the base address?
For interaction struct, there is "skillPointer", how we construct this pointer?
Thank you so much for your help,, vuduy and Interest ^^
12/06/2010 00:08 Interest07#141
the actionstruct pointer is an offset from player, so for pwi for example:

Code:
baseAddress = [0xA5B90C]
structureAddress = [baseAddress + 0x1C]
playerAddress = [structureAddress + 0x20]
actionStructAddress = [playerAddress + 0xFF4]
The offset finder that comes with my WQ bot should get you your actionStruct offset.

you can find skillPointer in the skillList, not sure what the offset is for that for PWI atm. BUt you basically browse through the skillList as follows:

Code:
skillListAddress = [playerAddress + skillListOffset]
for(int i = 0; i < nSkills; i++)
{
     skillPointer = [skillListAddres + i * 0x4]
     if([skillPointer + 0x8] == skillIdYouWantTouse)
     {
          break;
     }
}
12/06/2010 03:06 SunB#142
Thank you so much for that. I will try them after work :D
For other actions like regular attack, gather resources or pickup, I do not need the skill pointer, so just leave it as an empty pointer, right? :D
12/06/2010 09:58 Interest07#143
Quote:
Originally Posted by SunB View Post
Thank you so much for that. I will try them after work :D
For other actions like regular attack, gather resources or pickup, I do not need the skill pointer, so just leave it as an empty pointer, right? :D
yup, 0 will work ;)
12/07/2010 07:17 penipu81#144
how to find other player id ??
12/07/2010 07:32 SunB#145
There is a list of player around your character.
[base address + 0x1C + 0x8 + 0x20] (for PW vietnam). It may different from your client.
12/08/2010 14:38 silkytail#146
hey interest did you ever wonder to make some base of all known packet data formats? I'd like to join but I suppose it needs some fancy thing to keep all data in convenient form and don't have any idea about it right now.
12/08/2010 14:51 Interest07#147
Hmmm, yeah I suppose it would be nice to have a file with a neat syntax describing all packets, so every programmer regardless of language can use them easily. There is still the danger of different versions of PW using different packets though. I'll put some thought into it :)
12/08/2010 14:58 silkytail#148
yep that fancy thing should also support packet versioning :) a sort of wiki but with tables, probably comments :р first thought about google docs but it could be a pain..
12/08/2010 16:15 No0oB#149
maybe you/we can create a SQL database with packets/description and that stuff...
and then show it in on a webpage (php) in a table... this way you/we can create a page for every pw version (int/rus/br/my ...) with own tables ^^
or something else (^_^)
12/08/2010 16:18 SunB#150
Yeah, it would be cool, a free WordPress page or as No0oB said a free hosting website and setting things up :D