Go Back   EQEmulator Home > EQEmulator Forums > Archives > Archive::Development > Archive::Development

Archive::Development Archive area for Development's posts that were moved here after an inactivity period of 90 days.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 07-02-2003, 07:42 PM
killspree
Dragon
 
Join Date: Jun 2002
Posts: 776
Default placeitem quest command for putting items into an inventory

This adds the ability to place items directly into a players inventory by using the placeitem function, I've also included a list of the slot IDs, so folks don't have to test through trial and error to get items placed into the correct slots.

parser.cpp line ~1977 add:

Code:
			else if (strstr(strlwr(arglist[0]),"placeitem")) { // killspree: format is PutItemInInventory(slotid,itemid,charges)

				mob->CastToClient()->PutItemInInventory(atoi(arglist[1]), atoi(arglist[2]), atoi(arglist[3]));

			}
parser.cpp line ~2265 change:

Code:
	strn0cpy(com_list, "if 0|break 1|while 0|spawn 6|dbspawnadd 2|echo 1|summonitem 1|castspell 2|say 1|emote 1|shout 1|depop 1|cumflag 1|flagclient 2|exp 1|level 1|safemove 1|rain 1|snow 1|givecash 4|pvp 1|doanim 1|addskill 2|flagcheck 1|me 1|write 2|settarget 2|follow 1|sfollow 0|save 0|setallskill 1|attack 1|movepc 4|setguild 2|setsky 1|movegrp 4|rebind 4|gmmove 3|", sizeof(com_list));
To:

Code:
	strn0cpy(com_list, "if 0|break 1|while 0|spawn 6|dbspawnadd 2|echo 1|summonitem 1|castspell 2|say 1|emote 1|shout 1|depop 1|cumflag 1|flagclient 2|exp 1|level 1|safemove 1|rain 1|snow 1|givecash 4|pvp 1|doanim 1|addskill 2|flagcheck 1|me 1|write 2|settarget 2|follow 1|sfollow 0|save 0|setallskill 1|attack 1|movepc 4|setguild 2|setsky 1|movegrp 4|rebind 4|gmmove 3|placeitem 3|", sizeof(com_list));
basic_functions.h line ~341 add:

Code:
    if (strstr(string,"placeitem"))     {   return 3;    }
Some VERY important info on this; the format for using the command is placeitem("slotid","itemid","charges"). This will place item x in slot y with a certain amount of charges. This will work especially good to configure it so folks that start new characters and are missing starting items can go to their trainer and get them, instead of having to petition to have them summoned by a GM on legit servers.

Slots are as follows, these are the INVENTORY slots, i.e. the slots where items are EQUIPED - using these slot IDs will place an item into that slot, most likely replacing the current item in the slot if there is one - I suggest not creating quests that utilize these slots except for starting items:

Slot 1: Left Ear
Slot 2: Head
Slot 3: Face
Slot 4: Right Ear
Slot 5: Neck
Slot 6: Shoulders
Slot 7: Arms
Slot 8: Back
Slot 9: Left Wrist
Slot 10: Right Wrist
Slot 11: Range
Slot 12: Hands
Slot 13: Primary
Slot 14: Secondary
Slot 15: Left Fingers
Slot 16: Right Fingers
Slot 17: Chest
Slot 18: Legs
Slot 19: Feet
Slot 20: Waist
Slot 21: Ammo

The following slots are for main inventory, i.e. the slots that you place containers into on your inventory screen - Slots will be named Left 1-4 and Right 1-4 for the coresponding slots from top to bottom:

Slot 22: Left 1
Slot 23: Left 2
Slot 24: Left 3
Slot 25: Left 4
Slot 26: Right 1
Slot 27: Right 2
Slot 28: Right 3
Slot 29: Right 4

The following slot IDs are for the slots INSIDE of backpacks - these IDs consist of 10 values per backpack, to take into account a 10 slot bag. The IDs go in coresponding order as follows, Left 1, Right 1, Left 2, Right 2, etc...:

Slots 250 to 259: Items will be placed into the bag in Slot 22
Slots 260 to 269: Items will be placed into the bag in Slot 23
Slots 270 to 279: Items will be placed into the bag in Slot 24
Slots 280 to 289: Items will be placed into the bag in Slot 25
Slots 290 to 299: Items will be placed into the bag in Slot 26
Slots 300 to 309: Items will be placed into the bag in Slot 27
Slots 310 to 319: Items will be placed into the bag in Slot 28
Slots 320 to 329: Items will be placed into the bag in Slot 29

To give an example of the above, say you wanted to place a backpack in the top left slot of the players inventory, with cloth items in the top left and top right slots of the backpack, the placeitem function would look something like the following:

Quote:
if($1 == "placeitem") { say("Very well, here you go $name, a nice new backpack with some clothing inside!") placeitem("22","17969","1") placeitem("250","1001","1") placeitem("251","1002","1") }
This does indeed work, as I've tested it out on my server tonight. If you find any problems with it or have ideas on how to make it better, feel free to let me know.
__________________
Xeldan
Lead Content Designer
Shards of Dalaya
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 02:57 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3