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.

Reply
 
Thread Tools Display Modes
  #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
  #2  
Old 07-03-2003, 01:57 AM
Trumpcard
Demi-God
 
Join Date: Jan 2002
Location: Charlotte, NC
Posts: 2,614
Default

I'll get this merged in tonight as possible...

Great addition, thanks for the contribution !
__________________
Quitters never win, and winners never quit, but those who never win and never quit are idiots.
Reply With Quote
  #3  
Old 07-03-2003, 09:13 AM
tcsmyworld's Avatar
tcsmyworld
Discordant
 
Join Date: Feb 2002
Posts: 452
Default

Awesome addition , thanks a ton
Reply With Quote
  #4  
Old 07-06-2003, 05:02 PM
Krayz
Fire Beetle
 
Join Date: May 2003
Posts: 20
Default

Wow.
Reply With Quote
  #5  
Old 07-07-2003, 01:54 AM
kathgar
Discordant
 
Join Date: May 2002
Posts: 434
Default

This might be in the next release, then gone soon after. Wes is rewriting all of the quest code to make it more effcient.
__________________
++[>++++++<-]>[<++++++>-]<.>++++[>+++++<-]>[<
+++++>-]<+.+++++++..+++.>>+++++[<++++++>-]<+
+.<<+++++++++++++++.>.+++.------.--------.>+.
Reply With Quote
  #6  
Old 07-09-2003, 07:01 AM
krich
Hill Giant
 
Join Date: May 2003
Location: The Great Northwest
Posts: 150
Default

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") { 
    $emptyslot = getfreeslot()
    if ($emptyslot != 0) {
        say("Very well, here you go $name, a nice new backpack with some clothing inside!") 
        placeitem($emptyslot,"17969","1") 
        $bagbase = 250 + (($emptyslot - 22) * 10)
        placeitem($bagbase,"1001","1") 
        placeitem($bagbase + 1,"1002","1") 
    } else {
        say("It appears you don't have room to carry this bag of goodies, come back to me when you have unencumbered yourself a bit.")
    }
}
Regards,

krich
Reply With Quote
  #7  
Old 07-20-2003, 08:09 AM
Krayz
Fire Beetle
 
Join Date: May 2003
Posts: 20
Default

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.
Reply With Quote
  #8  
Old 07-20-2003, 08:12 AM
tcsmyworld's Avatar
tcsmyworld
Discordant
 
Join Date: Feb 2002
Posts: 452
Default

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
Reply With Quote
  #9  
Old 07-20-2003, 08:43 AM
alkrun
Sarnak
 
Join Date: Jan 2002
Posts: 66
Default

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.
Reply With Quote
  #10  
Old 07-20-2003, 10:35 AM
kathgar
Discordant
 
Join Date: May 2002
Posts: 434
Default

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.
__________________
++[>++++++<-]>[<++++++>-]<.>++++[>+++++<-]>[<
+++++>-]<+.+++++++..+++.>>+++++[<++++++>-]<+
+.<<+++++++++++++++.>.+++.------.--------.>+.
Reply With Quote
Reply

Thread Tools
Display Modes

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 11:09 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