- // Repair npc
- bool CWorldServer::pakRepairItem( CPlayer* thisclient, CPacket* P )
- {
- BYTE action = GETBYTE((*P),0);
- switch(action)
- {
- case 0x61: //Ronk
- case 0x3d:
- case 0x39:
- case 0x1c:
- case 0x08:
- case 0x74:
- case 0x89:
- case 0x12: // Raffle
- case 0x43: //NPC Repair Item / Town
- {
- BYTE slot = GETBYTE((*P),2);
- if(!CheckInventorySlot( thisclient, slot)) return false;
- if(thisclient->items[slot].count<1) return true;
- //Log( MSG_INFO,"Item socketed?: %i", thisclient->items[slot].socketed);
- thisclient->items[slot].lifespan = 100;
- //Log( MSG_INFO,"Item socketed?: %i", thisclient->items[slot].socketed);
- //Still TODO: find where prices of storage and repair are and add it to the code.
- BEGINPACKET( pak, 0x7cd );
- ADDQWORD ( pak, thisclient->CharInfo->Zulies );
- ADDBYTE ( pak, 0x01 );
- ADDBYTE ( pak, slot );
- ADDWORD ( pak, BuildItemHead( thisclient->items[slot] ));
- ADDDWORD ( pak, BuildItemData( thisclient->items[slot] ));
- ADDBYTE ( pak, 0x00 );
- thisclient->client->SendPacket( &pak );
- thisclient->SetStats( );
- }
- break;
- default:
- Log( MSG_WARNING,"Repair Item unknown action: %i", action);
- }
- return true;
- }
with this
- // Repair npc
- bool CWorldServer::pakRepairItem( CPlayer* thisclient, CPacket* P )
- {
- BYTE slot = GETBYTE((*P),2);
- if(!CheckInventorySlot( thisclient, slot)) return false;
- if(thisclient->items[slot].count<1) return true;
- //Log( MSG_INFO,"Item socketed?: %i", thisclient->items[slot].socketed);
- thisclient->items[slot].lifespan = 100;
- //Log( MSG_INFO,"Item socketed?: %i", thisclient->items[slot].socketed);
- //Still TODO: find where prices of storage and repair are and add it to the code.
- BEGINPACKET( pak, 0x7cd );
- ADDQWORD ( pak, thisclient->CharInfo->Zulies );
- ADDBYTE ( pak, 0x01 );
- ADDBYTE ( pak, slot );
- ADDWORD ( pak, BuildItemHead( thisclient->items[slot] ));
- ADDDWORD ( pak, BuildItemData( thisclient->items[slot] ));
- ADDBYTE ( pak, 0x00 );
- thisclient->client->SendPacket( &pak );
- thisclient->SetStats( );
- return true;
- }
It will still work but now we aren't using the action code from the NPC at all so it make packet injection a whole lot easier