- bool pakGMItemtoplayer(CPlayer* thisclient, char* name , UINT itemid , UINT itemtype , UINT itemamount) ;
In WorldServer.h find:
Replace with:
- bool pakGMItemtoplayer(CPlayer* thisclient, char* name , UINT itemid , UINT itemtype , UINT itemamount , UINT itemrefine , UINT itemls, UINT itemstats , UINT itemsocket) ;
In gmcmds.cpp find:
- else if (strcmp(command, "give2")==0)
- {
- if(Config.Command_Give2 > thisclient->Session->accesslevel)
- return true;
- if ((tmp = strtok(NULL, " "))==NULL) return true; char* name=tmp;
- if ((tmp = strtok(NULL, " "))==NULL) return true; unsigned itemid = atoi(tmp);
- if ((tmp = strtok(NULL, " "))==NULL) return true; unsigned itemtype = atoi(tmp);
- if ((tmp = strtok(NULL, " "))==NULL) return true; unsigned itemamount = atoi(tmp);
- Log( MSG_GMACTION, " %s : /give2 %s,%i,%i,%i" , thisclient->CharInfo->charname, name, itemid, itemtype, itemamount);
- return pakGMItemtoplayer( thisclient , name , itemid , itemtype , itemamount );
- }
Replace with:
- else if (strcmp(command, "give2")==0)
- {
- if(Config.Command_Item > thisclient->Session->accesslevel)
- return true;
- UINT itemrefine, itemstats, itemls, itemsocket;
- if ((tmp = strtok(NULL, " "))==NULL) return true; char* name=tmp;
- if ((tmp = strtok(NULL, " "))==NULL) return true; UINT itemid =atoi(tmp);
- if ((tmp = strtok(NULL, " "))==NULL) return true; UINT itemtype =atoi(tmp);
- if ((tmp = strtok(NULL, " "))==NULL) return true; UINT itemamount =atoi(tmp);
- if ((tmp = strtok(NULL, " "))==NULL)
- itemrefine =0;
- else
- itemrefine = atoi(tmp)<10?atoi(tmp)*16:9*16;
- if ((tmp = strtok(NULL, " "))==NULL)
- itemls =100;
- else
- itemls = atoi(tmp);
- if ((tmp = strtok(NULL, " "))==NULL)
- itemsocket =0;
- else
- itemsocket =atoi(tmp)==0?false:true;
- if ((tmp = strtok(NULL, " "))==NULL)
- itemstats =0;
- else
- itemstats =atoi(tmp);
- Log( MSG_GMACTION, " %s : /give2 %s,%i,%i,%i,%i,%i,%i,%i" , thisclient->CharInfo->charname, name, itemid , itemtype , itemamount , itemrefine , itemls, itemstats , itemsocket);
- return pakGMItemtoplayer( thisclient , name , itemid , itemtype , itemamount , itemrefine , itemls, itemstats , itemsocket );
- }
Also in gmcmds.cpp find:
- bool CWorldServer::pakGMItemtoplayer(CPlayer* thisclient, char* name , unsigned itemid , unsigned itemtype , unsigned itemamount)
- {
- CItem item;
- item.count = itemamount;
- item.durability = 40;
- item.itemnum = itemid;
- item.itemtype = itemtype;
- item.lifespan = 100;
- item.refine = 0;
- item.stats = 0;
- item.socketed = 0;
- item.appraised = 0;
- item.gem = 0;
- CPlayer* otherclient = GetClientByCharName ( name );
- if(otherclient != NULL) {
- unsigned newslot = otherclient->GetNewItemSlot( item );
- if(newslot != 0xffff) {
- ClearItem( thisclient->items[newslot] )
- thisclient->items[newslot]=item;
- otherclient->UpdateInventory( newslot );
- BEGINPACKET (pak, 0x702);
- ADDSTRING(pak, "You have recieved an item from a GM !");
- ADDBYTE(pak, 0);
- otherclient->client->SendPacket(&pak);
- RESETPACKET (pak, 0x702);
- ADDSTRING(pak, "Item has been given!");
- ADDBYTE(pak, 0);
- thisclient->client->SendPacket(&pak);
- }
- else {
- BEGINPACKET (pak, 0x702);
- ADDSTRING(pak, "No free slot !");
- ADDBYTE(pak, 0);
- thisclient->client->SendPacket(&pak);
- }
- }
- return true;
- }
Replace with:
- bool CWorldServer::pakGMItemtoplayer(CPlayer* thisclient, char* name , UINT itemid, UINT itemtype, UINT itemamount, UINT itemrefine, UINT itemls, UINT itemstats, UINT itemsocket)
- {
- CItem item;
- item.count = itemamount;
- item.durability = 40;
- item.itemnum = itemid;
- item.itemtype = itemtype;
- item.lifespan = 100; //itemls Set lifespan to 100
- item.refine = itemrefine;
- item.stats = itemstats;
- item.socketed = itemsocket;
- item.appraised = 1;
- if(itemstats > 300)
- {
- item.gem = itemstats;
- }else{
- item.gem = 0;
- }
- CPlayer* otherclient = GetClientByCharName ( name );
- if(otherclient != NULL) {
- unsigned newslot = otherclient->GetNewItemSlot( item );
- if(newslot != 0xffff) {
- otherclient->items[newslot] = item;
- otherclient->UpdateInventory( newslot );
- BEGINPACKET (pak, 0x702);
- ADDSTRING(pak, "You have recieved an item from a GM !");
- ADDBYTE(pak, 0);
- otherclient->client->SendPacket(&pak);
- RESETPACKET (pak, 0x702);
- ADDSTRING(pak, "Item has been given!");
- ADDBYTE(pak, 0);
- thisclient->client->SendPacket(&pak);
- }
- else {
- BEGINPACKET (pak, 0x702);
- ADDSTRING(pak, "No free slot !");
- ADDBYTE(pak, 0);
- thisclient->client->SendPacket(&pak);
- }
- }
- return true;
- }
Like I said I take no credit for this...just want to help things get working. Hope this gets fixed in the next REV.