Log in

View Full Version : Loot problems in 4.4 - bug or feature? (long)


Drawde
06-16-2003, 05:34 AM
EQEmu 4.4 (release version and later DR1) has a strange problem with the loot randomisation code. You always get 1 item from every lootdrop
group assigned to a NPC's loot table. (So a skeleton, for example, will always have 1 rusty weapon and 1 bone chip). The items
chosen from the lootdrop tables are still random, the problem is that there is always 1 item from each table, no more or less
(so you'll never, for example, get 2 bone chips, or no weapon, from a skeleton)
Since I'm currently doing loot tables for Luclin, this is rather annoying (for example, boss NPCs like Emperor Ssraeshza just end up dropping a Glowing
Orb of Luclinite, nothing else).

The way it originally worked, a loot table could have 8-10 different items with a percentage chance of between 10% and 50% each, which would
result in usually around 1-3 items dropping (occasionally no items, or more than 3), the items with the higher percentage chance dropping more often.
Increasing the loot table multiplier would increase the maximum number of items dropping; for example setting it to 2 with the above loot table would
result in an average of 2-6 items. This is the sort of loot table used for things like rats, spiders, and other creatures. For orcs, etc. I'd add a weapon/armour
loot group to the loot table, so they might have a 70% chance of a rusty weapon and 50% chance of cloth armour.

If an item had a percentage chance of 100% it would always drop. This made it very easy, for example, to have a quest item that always drops, along
with various loot items that each had a random chance; or a guard/NPC loot table with a weapon and shield both with a 100% chance, so they always had them.

With the current system, you need to increase the loot table multiplier to have more than 1 item drop (the multiplier seems to set the actual number of items
that drop). The percentage chance for items in the lootdrop table determines the items's chance of being chosen. So if an item has a chance of 100% it'll always
be chosen, and if there are multiple items with a chance of 100%, the first one on the list gets chosen.
With this system it is possible, with some work, to get a reasonable "random junk" loot table as mentioned above, but more complex
loot tables are much harder to do. For example, a dragon with 10 or so loot items each of which has a 20% chance of dropping, along with a couple
of quest items (e.g dragon scale, books for Paladin epic) with a higher or 100% chance. With the old system, this worked perfectly; you'd get 4-5
random loot items, along with the quest items which always or nearly always dropped.
Currently, however, this would end up with you just getting a single dragon scale (or whatever the 100% chance item was) every time, as I mentioned
earlier with Luclin bosses always dropping the glowing orb. Increasing the multiplier would just result in it dropping more scales (or, if the scales chance
was, say, 80%, 3 out of 4 items would be the dragon scales) To get it working properly you'd need a seperate loot drop group for each individual higher-percentage
quest item. Considering that many NPCs and creatures, not just high-level ones like dragons, have loot tables like this, this would create a huge amount of extra work
and makes the loot DB much more complex and harder to debug/modify.
(I do use seperate loot drop groups for things like generic weapons, armour, gems, research items etc - this is not what I'm talking about)

Anyway - What was changed in the loot code, and why? (Is it an intentional change, or just something that got broken by accident?)
The old system seemed much better and allowed loot drops much closer to EQLive. Is there any chance it could be reinstated?
(Do any other world builders agree with me?)
If it really is just a bug, I apologise for such a long post :) though the description of the loot system might allow you to
fix/track down the bug.

Trumpcard
06-16-2003, 05:48 AM
Drawde, I remember when we originally fixed this problem, it would loop through the entire list, and roll randomly on each item. At some point, Wiz's pool looting system went in, but I'm pretty sure we put that into an optional ifdef at some point as all the databases were designed with one loot list per mob in place.

I'll see if I can track down what happened or was added. I'll see about switching it back to our original method.

Say you have 10 items on your list, it will roll on each one, based on the % chance assigned to that item.

Most likely, the problem is the same one that I ran into when I fixed it earlier, it was a goofy casting issue. We have problems with folks just shoving a 10 pound variable in a 2 pound container sometimes.. :-)

Drawde
06-18-2003, 12:44 AM
Thanks for the reply.
Any chance of someone sending me some compiled exes once these fixes have been made?

Trumpcard
06-18-2003, 01:30 AM
I'll send you some exectuables when i get it put together...

harlequinred
06-21-2003, 05:32 AM
Could you possibly send those binaries my way as well? I'd like to get some of those loot tables working too.

Drawde
06-29-2003, 06:54 AM
Any update on this?
It might be worth using a DB variable switch to determine which loot system to use, as I think some DBs do use the poll looting system.

BTW I've virtually finished the NPC spawns for Luclin now, there are just a couple of zones (Sanctus Seru, Vex Thal and Acrylia Caverns) that I don't have logs for, so I'll have to eventually add them by hand using the HackersQuest DB as a reference. However all the other zones seem to work very well.