[FIX]/give2 command

If you want to help us or give some corrections / codes, put it here :)

Moderators: osRose dev team, ospRose dev team, osiRose dev team, Moderators

[FIX]/give2 command

Postby Ghost_Dragon on Thu Aug 21, 2008 9:54 am

I was running through GM commands in my family's test server and I noticed that the /give2 command wasn't working like it should. So I downloaded the REV 80 to see if maybe it was updated in it, still no. So what I did was replace it out of the EVO files. I take no credit for this...just putting it up for those people who's command isn't working.

In WorldServer.h find:
  1. bool pakGMItemtoplayer(CPlayer* thisclient, char* name , UINT itemid , UINT itemtype , UINT itemamount) ;


Replace with:
  1. bool pakGMItemtoplayer(CPlayer* thisclient, char* name , UINT itemid , UINT itemtype , UINT itemamount , UINT itemrefine , UINT itemls, UINT itemstats , UINT itemsocket) ;


In gmcmds.cpp find:
  1. else if (strcmp(command, "give2")==0)
  2.     {
  3.               if(Config.Command_Give2 > thisclient->Session->accesslevel)
  4.                         return true;
  5.             if ((tmp = strtok(NULL, " "))==NULL) return true; char* name=tmp;
  6.             if ((tmp = strtok(NULL, " "))==NULL) return true; unsigned itemid = atoi(tmp);
  7.             if ((tmp = strtok(NULL, " "))==NULL) return true; unsigned itemtype = atoi(tmp);
  8.             if ((tmp = strtok(NULL, " "))==NULL) return true; unsigned itemamount = atoi(tmp);
  9.             Log( MSG_GMACTION, " %s : /give2 %s,%i,%i,%i" , thisclient->CharInfo->charname, name, itemid, itemtype, itemamount);
  10.             return pakGMItemtoplayer( thisclient , name , itemid , itemtype , itemamount );
  11.  
  12.     }


Replace with:
  1. else if (strcmp(command, "give2")==0)
  2. {  
  3.              if(Config.Command_Item > thisclient->Session->accesslevel)
  4.                       return true;
  5.         UINT itemrefine, itemstats, itemls, itemsocket;
  6.         if ((tmp = strtok(NULL, " "))==NULL) return true; char* name=tmp;
  7.         if ((tmp = strtok(NULL, " "))==NULL) return true; UINT itemid =atoi(tmp);
  8.         if ((tmp = strtok(NULL, " "))==NULL) return true; UINT itemtype =atoi(tmp);
  9.         if ((tmp = strtok(NULL, " "))==NULL) return true; UINT itemamount =atoi(tmp);            
  10.         if ((tmp = strtok(NULL, " "))==NULL)
  11.             itemrefine =0;
  12.         else
  13.             itemrefine = atoi(tmp)<10?atoi(tmp)*16:9*16;
  14.         if ((tmp = strtok(NULL, " "))==NULL)
  15.             itemls =100;
  16.         else
  17.             itemls = atoi(tmp);
  18.         if ((tmp = strtok(NULL, " "))==NULL)
  19.             itemsocket =0;
  20.         else
  21.             itemsocket =atoi(tmp)==0?false:true;
  22.         if ((tmp = strtok(NULL, " "))==NULL)
  23.             itemstats =0;
  24.         else
  25.             itemstats =atoi(tmp);
  26.         Log( MSG_GMACTION, " %s : /give2 %s,%i,%i,%i,%i,%i,%i,%i" , thisclient->CharInfo->charname, name, itemid , itemtype , itemamount , itemrefine , itemls, itemstats , itemsocket);
  27.         return pakGMItemtoplayer( thisclient , name , itemid , itemtype , itemamount , itemrefine , itemls, itemstats , itemsocket );
  28. }


Also in gmcmds.cpp find:
  1. bool CWorldServer::pakGMItemtoplayer(CPlayer* thisclient, char* name , unsigned itemid , unsigned itemtype , unsigned itemamount)
  2. {
  3.    CItem item;
  4.  
  5.    item.count   = itemamount;
  6.    item.durability   = 40;
  7.    item.itemnum   = itemid;
  8.    item.itemtype   = itemtype;
  9.    item.lifespan   = 100;
  10.    item.refine   = 0;
  11.    item.stats   = 0;
  12.    item.socketed   = 0;
  13.    item.appraised   = 0;
  14.    item.gem = 0;
  15.  
  16.    CPlayer* otherclient = GetClientByCharName ( name );
  17.  
  18.    if(otherclient != NULL) {
  19.       unsigned newslot = otherclient->GetNewItemSlot( item );
  20.       if(newslot != 0xffff) {
  21.          ClearItem( thisclient->items[newslot] )
  22.          thisclient->items[newslot]=item;
  23.          otherclient->UpdateInventory( newslot );
  24.  
  25.          BEGINPACKET (pak, 0x702);
  26.          ADDSTRING(pak, "You have recieved an item from a GM !");
  27.          ADDBYTE(pak, 0);
  28.          otherclient->client->SendPacket(&pak);
  29.  
  30.          RESETPACKET (pak, 0x702);
  31.          ADDSTRING(pak, "Item has been given!");
  32.          ADDBYTE(pak, 0);
  33.          thisclient->client->SendPacket(&pak);
  34.       }
  35.       else {
  36.          BEGINPACKET (pak, 0x702);
  37.          ADDSTRING(pak, "No free slot !");
  38.          ADDBYTE(pak, 0);
  39.          thisclient->client->SendPacket(&pak);
  40.       }
  41.    }
  42.  
  43.    return true;
  44. }
  45.  


Replace with:
  1. bool CWorldServer::pakGMItemtoplayer(CPlayer* thisclient, char* name , UINT itemid, UINT itemtype, UINT itemamount, UINT itemrefine, UINT itemls, UINT itemstats, UINT itemsocket)
  2. {
  3.     CItem item;
  4.     item.count            = itemamount;
  5.     item.durability        = 40;
  6.     item.itemnum        = itemid;
  7.     item.itemtype        = itemtype;
  8.     item.lifespan        = 100; //itemls Set lifespan to 100
  9.     item.refine            = itemrefine;
  10.     item.stats            = itemstats;
  11.     item.socketed        = itemsocket;
  12.     item.appraised        = 1;
  13.     if(itemstats > 300)
  14.     {
  15.         item.gem = itemstats;  
  16.     }else{
  17.         item.gem = 0;
  18.     }  
  19.    
  20.    CPlayer* otherclient = GetClientByCharName ( name );
  21.  
  22.    if(otherclient != NULL) {
  23.       unsigned newslot = otherclient->GetNewItemSlot( item );
  24.       if(newslot != 0xffff) {
  25.          otherclient->items[newslot] = item;
  26.          otherclient->UpdateInventory( newslot );
  27.  
  28.          BEGINPACKET (pak, 0x702);
  29.          ADDSTRING(pak, "You have recieved an item from a GM !");
  30.          ADDBYTE(pak, 0);
  31.          otherclient->client->SendPacket(&pak);
  32.  
  33.          RESETPACKET (pak, 0x702);
  34.          ADDSTRING(pak, "Item has been given!");
  35.          ADDBYTE(pak, 0);
  36.          thisclient->client->SendPacket(&pak);
  37.       }
  38.       else {
  39.          BEGINPACKET (pak, 0x702);
  40.          ADDSTRING(pak, "No free slot !");
  41.          ADDBYTE(pak, 0);
  42.          thisclient->client->SendPacket(&pak);
  43.       }
  44.    }
  45.  
  46.    return true;
  47. }


Like I said I take no credit for this...just want to help things get working. Hope this gets fixed in the next REV.
Last edited by Ghost_Dragon on Thu Aug 21, 2008 10:58 pm, edited 1 time in total.
------------------>SEARCH<-------------------
Image
User avatar
Ghost_Dragon
Pomic
Pomic
 
Posts: 132
Joined: Fri Feb 29, 2008 9:38 am
Location: Home of Superbowl 43 Champs.

Re: [FIX]/give2 command

Postby soccerstar on Thu Aug 21, 2008 12:43 pm

did you test it and everything worked out, and nice job !
Search, Just Do It.
User avatar
soccerstar
Clown
Clown
 
Posts: 501
Joined: Tue Jun 17, 2008 12:46 am

Re: [FIX]/give2 command

Postby PurpleYouko on Thu Aug 21, 2008 2:42 pm

Nicely spotted.

One little issue though. You can potentially give away bugged items with this code. We need to fix stats and gems as they are intricately connected.

in your code, find

replace with this
  1.  
  2. if(itemstats > 300)
  3.     {
  4.         item.gem = itemstats;  
  5.     }else{
  6.         item.gem = 0;
  7.     }

if you don't do this then your player might have serious problems, particularly if they put this item into storage.
It also means it is possible to give away a gemmed item by setting stats greater than 300.
Need to lookup information on NARose items, skills, quests?
Now featuring a newly completed skill tree for all classes
Formatting fixed for different resolutions
Image

"A Gazelle is nothing but a giraffe plotted logarithmicaly"
User avatar
PurpleYouko
Rose Guru
Rose Guru
 
Posts: 4733
Joined: Fri Aug 10, 2007 2:05 pm

Re: [FIX]/give2 command

Postby Ghost_Dragon on Thu Aug 21, 2008 7:56 pm

Thanks purple....adding that last part in right now...

*Edited the first post to reflect Purple's addition.*
------------------>SEARCH<-------------------
Image
User avatar
Ghost_Dragon
Pomic
Pomic
 
Posts: 132
Joined: Fri Feb 29, 2008 9:38 am
Location: Home of Superbowl 43 Champs.

Useful Product Site

Postby FrankJScott on Fri May 10, 2024 9:34 pm

Please try Google before asking about Updated Product Site f0fedb4
FrankJScott
Pomic
Pomic
 
Posts: 144
Joined: Wed May 08, 2024 5:24 pm

Recommended Clothing Store Simulator Info

Postby FrankJScott on Tue May 14, 2024 6:48 pm

To the man inquiring about their clothing, here clothing brand, an fashion store, retail clothes, apparalel store, clothes store in, q clothes store, clothing accessories store, go to clothing, at home clothing, in here store, clothing outfitters, i believe clothing, fashion clothing brand, re clothing, any clothes, you are here store, you clothing, mart clothing, the westside clothing store, I recommend this this site about clothing store simulator url for fashion & clothing, designer clothes for, to the top clothing, we will fashion store, all of the clothes, brand store clothing, house dress, your fashion, as clothing store, that's it clothing, brand new clothing brand, we are a design, clothing to go, i fashion store, clothing shop, clothing brand, we are design, all things fashion, cloth ing, here the store, also. See More Best Clothing Store Simulator Tips eccb386
FrankJScott
Pomic
Pomic
 
Posts: 144
Joined: Wed May 08, 2024 5:24 pm

High Rated Safe Laser Tips

Postby FrankJScott on Wed May 15, 2024 12:24 am

To the people talking about the bemer pad, bemer pad, safe laser vásárlás, használt bemer készülék eladó, bemer mattress, beamer electric therapy, bemer machine for circulation, bemer magnetic, safe laser 500 részletre, safe laser 500 infra ár, the bemer medical device, bemer near me, safe laser kölcsönzés, cost of bemer therapy, bemer magnetic therapy, soft laser treatment, the bemer machine, bemer microcirculation therapy, beamer healing machine, bemer evo, I recommend this our site for safe laser 500 for the bemer machine, soft tissue laser treatment, bemer microcirculation, bemer oxygen, the bemer pad, safe laser kozmetika, safe laser 30, lágylézer kezelés, bemer near me, safe laser 150, bemer matrac, bemer treatment near me, soft tissue laser, laser tissue, bemer, használt bemer készülék eladó, safe laser 150 ár, bemer mat therapy, bemer health mat, safe laser 500, also. See More Recommended Safe Laser Blog cb380_2
FrankJScott
Pomic
Pomic
 
Posts: 144
Joined: Wed May 08, 2024 5:24 pm

New Mongolian Tour Guide Guide

Postby FrankJScott on Wed May 15, 2024 1:15 am

In reply to the man asking about adventure holidays, kazakhstan tour companies, horseback riding tours in mongolia, travel experiences bucket list, mongolia private tour, bucket holidays, go tours, travel & local, mountain biking mongolia, travel tours, once in a lifetime travel experiences, trekking experience, top sites in mongolia, best tour company for australia, outdoor adventuring, top of the world travel agency, altai tours, tour travel trip, tour camping, cultural travel tours, active tours australia, best adventure experiences, bucket list travel company, I recommend this see on mountain biking tours in mongolia advice for aus tours, altai tavan bogd tour, adventure tour company, the mountain company, explore co, best travel company australia, altai tours, group travel sites, natural habitat vacations, trip venture, best hiking tours in the world, horseback riding tours in mongolia, private vacation packages, amazing holiday experiences, adventure blog, adv travel, mount khuiten mongolia, alpine hiking tours, under 30s tours, the mountain travel, altai mountains travel, tour in travels, travel tour sites, also. See More Updated Safe Laser Info 8_5d26f
FrankJScott
Pomic
Pomic
 
Posts: 144
Joined: Wed May 08, 2024 5:24 pm

Recommended Carpet Manufacturer Tips

Postby FrankJScott on Wed May 15, 2024 2:43 pm

In reply to the man talking about living room with area rug ideas, saudi carpet, the carpet shops, high quality area rugs, carpet on carpet design, rug making, rugs for over carpet, wall to wall carpet near me, carpet stanton, section rugs, admin rugs, area rugs for living room on sale, rug carpet living room, rugs hand made, carpet number, best type of area rug for living room, rugs of elegance, custom size rugs cheap, floor for carpet, hand rug, custom made carpet, rug on wall to wall carpet, wall to wall living room carpet, I suggest this hand knotted rugs for home depot rugs online, carpet styles for bedrooms, local carpet, rug use, carpet and design, local area rug stores, difference of carpet and rug, tufted rug designs, custom rugs for living room, best type of area rugs, best rugs, designer rug companies, rug to carpet, rug production, carpet quality levels, carpet into area rug, carpet for living room floor, rug design software, carpet places, custom size rugs, hall carpet design, finishing tufted rug, best place to purchase area rugs, area rug in carpet, contemporary rugs living room, also. See More Great Safe Laser Blog db4fc67
FrankJScott
Pomic
Pomic
 
Posts: 144
Joined: Wed May 08, 2024 5:24 pm


Return to Submit Code

Who is online

Users browsing this forum: No registered users and 2 guests

cron