Page 3 of 3
Re: Continuing the "Spells" effort
Posted: Wed Sep 16, 2009 4:48 pm
by LethalEncounter
Nothing magical about it

The code is there in the COMMAND_TEST block, commented out. If you want to use it, just comment out the code that is in the COMMAND_TEST block which isn't currently commented and uncomment the code that is. Basically the way it works is I have a raw packet there (should still be for a spell) that we are going to edit and then send the packet to the player to view the results. The /test command takes up to 4 arguments, the first being an offset in the packet and the next being the new value of the data. The third and fourth arguments are optional but allow you to set the value for a second offset (third argument is another offset and fourth is the value). The code itself could be modified to work better, but it fit my needs pretty well

The hard part is figuring out exactly what offset you are wanting to change. If you want to change a custom packet make sure that you paste in your values starting at the packet size and make sure that the opcode type (0x0233 for 972) matches your client. Also you want want to verify that the packet is correct by just calling the command with 2 0 as the arguments. If the spell pops up then it is set up correctly and you should be able to continue.
Re: Continuing the "Spells" effort
Posted: Wed Sep 16, 2009 6:37 pm
by Zcoretri
By offset, you mean which piece of data is going to get the new passed in value?
I will give it a try

Re: Continuing the "Spells" effort
Posted: Thu Sep 17, 2009 4:57 pm
by Zcoretri
Got it to work just fine...more fun shit to play with now, lol
LethalEncounter wrote:Nothing magical about it

The code is there in the COMMAND_TEST block, commented out. If you want to use it, just comment out the code that is in the COMMAND_TEST block which isn't currently commented and uncomment the code that is. Basically the way it works is I have a raw packet there (should still be for a spell) that we are going to edit and then send the packet to the player to view the results.
It is actually a book item
The /test command takes up to 4 arguments
Can this be expanded to eight arguments? (so you can change 4 bytes at a time)
Re: Continuing the "Spells" effort
Posted: Fri Sep 18, 2009 4:12 pm
by LethalEncounter
Zcoretri wrote:
Can this be expanded to eight arguments? (so you can change 4 bytes at a time)
Try changing the code to this:
Code: Select all
int index = 0;
while(sep && sep->arg[index+1] && sep->IsNumber(index) && sep->IsNumber(index+1)){
pos = atoi(sep->arg[index]);
val = atoi(sep->arg[index+1]);
memset(blah+pos, val, 1);
index+=2;
}
EQ2Packet* packet = new EQ2Packet(OP_ClientCmdMsg, blah, sizeof(blah));
DumpPacket(packet);
client->QueuePacket(packet);
Haven't tested it, but it should allow you to specify as many changes as you want.