- // 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;
- }
First the good news.
I have got some of the NPCs to actually repair my stuff.
The bad news (not really all that bad i guess) is that I don't know all the NPCs that can actually fix stuff.
I have Ronk in Adventurer's plains and raffle in Zant both working but i have no idea what other NPC need to be set up too.
The thing is that each NPC returns a unique ID code in the packet.
For some reason in osProse we use a switch function to work this with individual cases so if the wrong code comes in, nothing happens.
In osrose they don't do the switch thing at all. the downside is that if we drop the NPC code check and just run the repair code anyway, then we lose a layer of protection against hackers.
So what i need is a list of all the NPCs that can fix your stuff, then I can go and find out what value they are sending in.