Page 1 of 1
LOOT options
Posted: Mon Apr 02, 2012 6:46 pm
by dragon slayer
I noticed Loot is generated on the npc when he is first created. is there away to change this or make a option so loot is only generated on death instead of being added when npc is created. so world saves would maybe drop by a second or two.
Nother thing is
I wanted to do loot lists like this
[LOOTLISTSUB 1]
{
randominstruments
randomtinkerparts
randomtools
randomvegetables
}
so if i onloy wanted one tag on the npc then all i needed to use was the lootlist sub tag and would spawn random out of the other lootlists.
Plus i wanted to know if we could get a new option on LOOT=
LOOT=randomtools,AMOUNT not the amount of a item that is pilable but say 10 tools will spawn randomely so i didnt have to add 10 LOOT=randomtools lines to the npc just needed to add one.
Re: LOOT options
Posted: Fri Oct 26, 2012 10:49 am
by Xuri
The first idea here is intriguing, but keep in mind that UOX3 already does not save any NPC and/or item spawned through regionspawners (this includes items on NPCs spawned this way). So if you spawn all your NPCs this way, there is little to be gained. At the same time it would also make the stealing-skill less useful against NPCs - unless that skill is modified at the same time to take into account those lootless-NPCs. Thirdly, the LOOT tag is currently not stored on characters after they spawn, so that's an extra variable we'd have to add for all characters (whether used or not). You can also, if you really want to give NPCs loot only after they die, create a system in Javascript for spawning that loot through the onDeath event.
Concerning the second part of your post, there should already be support for nested lootlists, like this:
Code: Select all
[LOOTLIST randomstuff]
{
LOOTLIST=randominstruments
LOOTLIST=randomtinkerparts
0x13bb
0x1051
}
Edit: The text below is somewhat incorrect. See my next post for updated syntax.
Also, support for specifying an amount behind the LOOT tag will be in my next CVS update. Updated syntax:
LOOT=itemID
LOOT=itemID,amount
LOOT=itemlistID
LOOT=itemlistID,amount
Re: LOOT options
Posted: Fri Oct 26, 2012 11:35 pm
by Blue Dragon
Xuri wrote:
Also, support for specifying an amount behind the LOOT tag will be in my next CVS update. Updated syntax:
LOOT=itemID
LOOT=itemID,amount
LOOT=itemlistID
LOOT=itemlistID,amount
It looks good.
Re: LOOT options
Posted: Sat Oct 27, 2012 11:34 pm
by Xuri
Ewwps! I made a mistake in my previous post: The LOOT tag does not support itemIDs directly, only lootlistIDs. However, PACKITEM supports items directly (and listobjects, which point to ITEMLISTs in itemlists.dfn), so I've updated that to support the optional amount value as well.
As such, the updated (and correct this time) syntax looks like this:
Code: Select all
LOOT=lootlist
LOOT=lootlist,amount
PACKITEM=itemId
PACKITEM=itemId,amount
PACKITEM=listobject
PACKITEM=listobject,amount
Re: LOOT options
Posted: Sun Oct 28, 2012 1:54 am
by Blue Dragon
I thought you had mistaken realy, hehehe. Anyway, that sounds good...
But could something like below?
PACKITEM = itemID, amount amount
Basically "amount amount" would be the minimum and maximum quantities respectively. Logo "PACKITEM = blackpearl, 10 30", would play the black pearl with a random amount from these two values.
It's just an idea, but anyway your update will be very good.
Re: LOOT options
Posted: Sun Oct 28, 2012 4:39 am
by Xuri
Consider it done. New and updated list of supported syntax for these DFN tags:
Code: Select all
LOOT=lootlist
LOOT=lootlist,amount
LOOT=lootlist,minamount maxamount
PACKITEM=itemId
PACKITEM=itemId,amount
PACKITEM=itemId,minamount maxamount
PACKITEM=listobject
PACKITEM=listobject,amount
PACKITEM=listobject,minamount maxamount
AMOUNT=amount
AMOUNT=minamount maxamount
Re: LOOT options
Posted: Sun Oct 28, 2012 1:06 pm
by Blue Dragon
Very good Xuri

.
Now only one doubt.
Assuming that I want in a particular lootlist a rare item has a probability of 10 (normal) to 1 (rare), or 10%, to appear on monster loot. It has an easy way to do this or would just the way I exemplify below?
[lootlist rareitem]
{
rareitem
normalitem
normalitem
normalitem
normalitem
normalitem
normalitem
normalitem
normalitem
normalitem
normalitem
}
Or does not have a normal item in a case, following the same probability above example, rather than appear a normal item would appear nothing in loot.
How to put this?
[lootlist rareitem]
{
rareitem
blank
blank
blank
blank
blank
blank
blank
blank
blank
blank
}
Re: LOOT options
Posted: Sun Oct 28, 2012 9:11 pm
by Xuri
At the moment the easiest way of doing this is probably through the two methods you mentioned, though the second one will generate some errors in the UOX3 log because it will fail to spawn items with itemIDs named "blank". However, I'm adding some bits to the code that will make UOX3 stop trying to spawn entries titled "blank", and just not spawn anything if those entries are picked from the list.
Re: LOOT options
Posted: Sun Oct 28, 2012 10:12 pm
by Blue Dragon
Ok!
