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) 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)); 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)); Code:
if (strstr(string,"placeitem")) { return 3; } 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:
|
I'll get this merged in tonight as possible...
Great addition, thanks for the contribution ! |
Awesome addition , thanks a ton :)
|
Wow.
|
This might be in the next release, then gone soon after. Wes is rewriting all of the quest code to make it more effcient.
|
Excellent addition... I certainly hope Wes picks this one up in his new code.
One suggestion though: Perhaps a checkslot(slotnumber), or a getfreeslot() routine would compliment this function nicely. Blindly tossing a backback in a slot that may be occupied by other important inventory might not be the greatest idea. Not very familiar with the quest scripting, but you get the idea... Code:
if($1 == "i am naked") { krich |
I've been picking through the lastest code (as of 3 days from this post) and haven't noticed this addition. Anyone know if it will be a future add once the lastest stuff is given a good run through?
Just wondering. I like the thought of doing this. |
I added it into the last compile I did , along with luclin AA's and random # fix , can be D/L'd here-
http://forums.eqemu.net/viewtopic.php?t=8962 the one dated 7/8/03 |
I don't know of any quest on eqlive that auto-equips an item for you. And as has been mentioned, setting the contents of an inventory slot if something might already exist there probably isn't a great way to do it.
Inventory Slot probably shouldn't be specified, the function should loop through the player's inventory and find an open slot, failing if no open slots exist. |
We have to merge all of the changes we did, the changes to get current that break almost everything, and code submitted to the forums.. if you want it in build your own until we have time to test it along with all of the other code we have to remerge and rewrite.
|
All times are GMT -4. The time now is 02:27 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.