LOOT options

If Wishes were UOX Coders, we'd be done by now ;P Post your wishes/suggestions for UOX3 changes/improvements here.
Post Reply
dragon slayer
UOX3 Guru
Posts: 776
Joined: Thu Dec 21, 2006 7:37 am
Has thanked: 4 times
Been thanked: 26 times

LOOT options

Post 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.
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post 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
-= Ho Eyo He Hum =-
Blue Dragon
UOX3 Apprentice
Posts: 159
Joined: Mon Jan 09, 2012 1:43 am
Has thanked: 0
Been thanked: 0

Post 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.
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post 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
-= Ho Eyo He Hum =-
Blue Dragon
UOX3 Apprentice
Posts: 159
Joined: Mon Jan 09, 2012 1:43 am
Has thanked: 0
Been thanked: 0

Post 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.
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post 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
-= Ho Eyo He Hum =-
Blue Dragon
UOX3 Apprentice
Posts: 159
Joined: Mon Jan 09, 2012 1:43 am
Has thanked: 0
Been thanked: 0

Post by Blue Dragon »

Very good Xuri :D.

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
}
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post 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.
-= Ho Eyo He Hum =-
Blue Dragon
UOX3 Apprentice
Posts: 159
Joined: Mon Jan 09, 2012 1:43 am
Has thanked: 0
Been thanked: 0

Post by Blue Dragon »

Ok! :D
Post Reply