Continuing the "Spells" effort

Development forum for the EQ2Emulator Database project.

Moderator: Team Members

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Re: Continuing the "Spells" effort

Post by LethalEncounter » Wed Sep 16, 2009 4:48 pm

Nothing magical about it :P 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 :P 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.

User avatar
Zcoretri
Team Member
Posts: 1642
Joined: Fri Jul 27, 2007 12:55 pm
Location: SoCal

Re: Continuing the "Spells" effort

Post by Zcoretri » Wed Sep 16, 2009 6:37 pm

By offset, you mean which piece of data is going to get the new passed in value?

I will give it a try :)

User avatar
Zcoretri
Team Member
Posts: 1642
Joined: Fri Jul 27, 2007 12:55 pm
Location: SoCal

Re: Continuing the "Spells" effort

Post by Zcoretri » Thu Sep 17, 2009 4:57 pm

Got it to work just fine...more fun shit to play with now, lol :mrgreen:
LethalEncounter wrote:Nothing magical about it :P 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)

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Re: Continuing the "Spells" effort

Post by LethalEncounter » Fri Sep 18, 2009 4:12 pm

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests