Noob packet help and code.....

Vigintennalis Membrum
Vicennium
Joined
Sep 27, 2006
Messages
561
Reaction score
95
-- Vending
Openned the shop (CHACKED):
[3]<<7c2- 01 00 0d 28 32 00 4c e7 03 b2 02 00 00 49 61 67 75 43 6f 6f 6c 27 73 20 50 65 00

CLIENT SENDS COMMAND (7C2) 01 = SLOTID

00 49 61 67 75 43 6f 6f 6c 27 73 20 50 65 00 = STRING NAME CONVERTED FROM HEX TO ASCII WOULD = IaguCool's Pe

[3]>>7c2- da a0 00 00 49 61 67 75 43 6f 6f 6c 27 73 20 50 65 00

SERVER SENDS COMMAND (7C2) DA 0A = CLIENTID

00 49 61 67 75 43 6f 6f 6c 27 73 20 50 65 00 = STRING NAME CONVERTED FROM HEX TO ASCII WOULD = IaguCool's Pe

NOW IN CODE:

OPEN WORLDPACKETS.CPP

// -----------------------------------------------------------------------------------------
// Open Shop
// -----------------------------------------------------------------------------------------
bool CWorldServer::pakshop( CWorldClient* thisclient, CPacket* P )
{
unsignedchar slotid = GETBYTE((*P), 0x0 );
unsignedshort itemid = GETWORD((*P), 0x1 );


BEGINPACKET( pak, 0x7c2 );
ADDWORD( pak, thisclient->clientid );
ADDDWORD( pak, 0 );
ADDSTRING( pak, STRINGid );
ADDBYTE( pak, 0 );
SendToVisible( &pak, thisclient );

RESETPACKET(pak, 0x762 );
ADDBYTE( pak, slotid );
ADDWORD( pak, itemid );
thisclient->SendPacket( &pak );



returntrue;
}

Closed shop (CHACKED):
[3]<<7c3-
[3]>>7c3- da a0
Closed shop window (CHACKED):

7C3 COMMAND CLIENT RETURNS NOTHING
7C3 COMMAND SERVER SENDS CLIENTID = DA A0

// -----------------------------------------------------------------------------------------
// Close Shop
// -----------------------------------------------------------------------------------------
bool CWorldServer::pakcloseshop( CWorldClient* thisclient, CPacket* P )
{
BEGINPACKET( pak, 0x7c3 );
ADDWORD( pak, thisclient->clientid );
SendToVisible( &pak, thisclient );

returntrue;
}

Used Potion (CHACKED):
[3]<<7a3- 36 00
[3]>>7a3- da a0 03 00
[3]>>7a3- da a0 03 00 36

CLIENT SENDS 7A3 COMMAND = ITEM ID 36
SERVER SENDS 7A3 COMMAND = DA 0A CLIENTID 03=SLOTID

IN CODE:

// -----------------------------------------------------------------------------------------
// USE POTION
// -----------------------------------------------------------------------------------------
bool CWorldServer::usepotion( CWorldClient* thisclient, CPacket* P )
{

unsigned char slotid = GETBYTE((*P), 0x0 );
unsigned short itemid = GETWORD((*P), 0x1 );
if(slotid<0||slotid>39) return true;

BEGINPACKET( pak, 0x7a3 );
ADDWORD( pak, thisclient->clientid );
addword( &pak, thisclient->itemid );
this->Sendpacket( &pak, thisclient );

returnpacket(pak, 0x7a3 );
ADDWORD( pak, thisclient->clientid );
ADDBYTE( pak, slotid );
ADDWORD( pak, itemid );
addbyte( pak, 0);
thisclient->SendPacket( &pak );
return true;
}

make sure you add your stuff to worldsever.cpp and worldsocket.h
 
Last edited:
i got this error
what i do?
Code:
.\worldserver.cpp(698) : error C2039: 'itemid' : is not a member of 'CWorldClient'
        c:\documents and settings\user\desktop\complie\world server\worldsockets.h(35) : see declaration of 'CWorldClient'
.\worldserver.cpp(698) : error C3861: 'addword': identifier not found
.\worldserver.cpp(699) : error C2039: 'Sendpacket' : is not a member of 'CWorldServer'
        c:\documents and settings\user\desktop\complie\world server\worldsockets.h(115) : see declaration of 'CWorldServer'
.\worldserver.cpp(701) : error C3861: 'returnpacket': identifier not found
.\worldserver.cpp(705) : error C3861: 'addbyte': identifier not found
 
Last edited:
bool CWorldServer::pakshop( CWorldClient* thisclient, CPacket* P )
{
unsignedchar slotid = GETBYTE((*P), 0x0 );
unsignedshort itemid = GETWORD((*P), 0x1 );


BEGINPACKET( pak, 0x7c2 );
ADDWORD( pak, thisclient->clientid );
ADDDWORD( pak, 0 );
ADDSTRING( pak, STRINGid );
ADDBYTE( pak, 0 );
SendToVisible( &pak, thisclient );

RESETPACKET(pak, 0x762 );
ADDBYTE( pak, slotid );
ADDWORD( pak, itemid );
thisclient->SendPacket( &pak );



returntrue;
}
False, where name appears deppend on the number of items you used to set your shop.
762 its useless to set shop, cause players only need 7c2 to see it, and later you need another packet to send the list to the player when he looks the shop.
 
False, where name appears deppend on the number of items you used to set your shop.
762 its useless to set shop, cause players only need 7c2 to see it, and later you need another packet to send the list to the player when he looks the shop.

ye..i know whats your meaning...
 
if i get packets off a old rose server for evo servers do we just change the set to add
eg. SETWORD-->ADDWORD
or will only a few codes work that way

iNeverDownAway - you might need to change the small lettered words addbyte to ADDBYTE etc..
 
Last edited:
i got only more 1 problem
Code:
------ Build started: Project: 3. World Server, Configuration: Release Win32 ------
Compiling...
worldserver.cpp
.\worldserver.cpp(699) : error C2660: 'CClientSocket::SendPacket' : function does not take 2 arguments
Build log was saved at "file://c:\Documents and Settings\User\Desktop\Complie\World Server\Release\BuildLog.htm"
3. World Server - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 2 up-to-date, 0 skipped ==========
 
i think you need to add these in the worldserver.cpp
case 0x07c2: return pakshop ( (CWorldClient* )thisclient, P );
case 0x07c3: return pakcloseshop ( (CWorldClient* )thisclient, P );

and these in worldsockets.h
bool pakshop( CWorldClient* thisclient, CPacket* P );
bool pakcloseshop( CWorldClient* thisclient, CPacket* P );

This should compile it had a few bugs

// -----------------------------------------------------------------------------------------
// Open Shop
// -----------------------------------------------------------------------------------------
bool CWorldServer::pakshop( CWorldClient* thisclient, CPacket* P )
{
unsigned char slotid = GETBYTE((*P), 0x0 );
unsigned short itemid = GETWORD((*P), 0x1 );


BEGINPACKET( pak, 0x7c2 );
ADDWORD( pak, thisclient->clientid );
ADDDWORD( pak, 0 );
ADDSTRING( pak, STRINGid );
ADDBYTE( pak, 0 );
SendToVisible( &pak, thisclient );

RESETPACKET(pak, 0x762 );
ADDBYTE( pak, slotid );
ADDWORD( pak, itemid );
thisclient->SendPacket( &pak );



return true;
}

// -----------------------------------------------------------------------------------------
// Close Shop
// -----------------------------------------------------------------------------------------
bool CWorldServer::pakcloseshop( CWorldClient* thisclient, CPacket* P )
{
BEGINPACKET( pak, 0x7c3 );
ADDWORD( pak, thisclient->clientid );
SendToVisible( &pak, thisclient );

return true;
}
 
Last edited:
and 1problem guys
listen

at open shop find
Code:
ADDSTRING( pak, STRINGid );

replace with
Code:
ADDSTRING(pak,thisclient->username);
 
jonnybravo;1623473Used Potion (CHACKED): [3 said:
<<7a3- 36 00
[3]>>7a3- da a0 03 00
[3]>>7a3- da a0 03 00 36

CLIENT SENDS 7A3 COMMAND = ITEM ID 36
SERVER SENDS 7A3 COMMAND = DA 0A CLIENTID 03=SLOTID

IN CODE:

// -----------------------------------------------------------------------------------------
// USE POTION
// -----------------------------------------------------------------------------------------
bool CWorldServer::usepotion( CWorldClient* thisclient, CPacket* P )
{

unsigned char slotid = GETBYTE((*P), 0x0 );
unsigned short itemid = GETWORD((*P), 0x1 );
if(slotid<0||slotid>39) return true;

BEGINPACKET( pak, 0x7a3 );
ADDWORD( pak, thisclient->clientid );
addword( &pak, thisclient->itemid );
this->Sendpacket( &pak, thisclient );

returnpacket(pak, 0x7a3 );
ADDWORD( pak, thisclient->clientid );
ADDBYTE( pak, slotid );
ADDWORD( pak, itemid );
addbyte( pak, 0);
thisclient->SendPacket( &pak );
return true;
}

make sure you add your stuff to worldsever.cpp and worldsocket.h[/SIZE][/SIZE][/SIZE]

@jonnybravo

I got the shop set up now, it is funny that you can move your shop around like walking your shop! ;-)

I guess we can't see inside the shop yet too. I know, tiny steps at a time, we will get there.

The use potion one I am having problems with, is there something else missing as I get alot of errors with it.

Thanks for the updates.
 
just curious, did anyone manage to get the potions code working? ive been playing around with it all night but to no avail :(

ptep
 
Back