PDA

View Full Version : Diablo style loot


bruise
12-21-2011, 10:10 PM
Hey I have a private server that I have no plans of making public but I would like to setup diablo-style loot. I've tried using GeorgeS' diablo tools but I can't for the life of me figure it out. I tried using his EQItems tool for instance to list all items with >= 500hp and adding it to the custom list for mobs 65-99.. It ends up just getting stuck saying something about (0) items being added and wont move from there.

Ultimately I would LOVE to have certain items avail for each tier of levels, 1-10, 11-20, etc with a huge list of items avail for each. I would definitely settle with having EVERY item able to drop from any mob in the game though. If anyone knows a way to accomplish either of these tasks I would be eternally grateful!

werebat
12-22-2011, 09:58 AM
My understanding is that you can only have 100 items in a lootdrop id at 1% each. So if thats the case, you need to have multiple lootdrop ids to contain all items for that tier level. Then you assign then en masse to your mobs and that should do it. I assigned all mobs a chance to drop defiant gear in another thread in the Database forum. You can look there for an example of how to do it.

I like this idea, but how do you tier them? I may try this if I can come up with a tiering idea, then I could write the script to accomplish it. It was easy with the defiant gear since they have required levels assigned but most items do not.

bruise
12-22-2011, 12:14 PM
I know servers like Akka's funhouse do something very similar to this. I think in order to make these loot tables manually would be a monstrous task. I wouldn't begin to know how to script it for all items. I was think something like lvl 1-10, items with HP <= 100, 2-20, items with <= 200, etc until finally at 65+ every item in the DB could maybe drop.

Tabasco
12-22-2011, 12:59 PM
One of the first things I did on my server was assign level scaled global loot and for the past two years I've periodically attempted to improve it.

First I made an item values table and a scoring script that grabs everything from the items table that's equipable and scores it based on stats. I gave every possible item stat a multiplier and in later iterations even broke down spells by effect to try to determine the 'value' of a proc or focus. A good scoring module alone can be a bit of a task if you want to be thorough.

Once I had values written for all the items I was interested in setting up as loot (about 34,000) I started messing with formulas for distributing them across a level range from 1-75, defaulting any higher level mobs to the 75 table. Across the various iterations I've had models that spread out the desired quality range across all levels, or use a fixed increment, and finally I've gotten around to giving NPC's scores of their own and transcending level altogether so that a boss has boss loot, etc.

It breaks down at high levels because the natural quality distribution is lop-sided. In the early game you have all these varied natural drops but as gear starts to get higher end you're usually dealing with class armor sets and epics, which typically can't fill a single table of 100 items.

Using a simplified scoring model might actually give you better, even if substantially smaller, results. It depends on what your final goal is. For me, I just wanted folks to be able to play anywhere in the world and still get meaningful gear without drops being too generic.

bruise
12-22-2011, 01:38 PM
Wow that sounds amazing! Would you mind sharing your work? Im looking for mobs to be able to drop useful items that don't have stats as well like WR bags, illusion items, etc. I also want higher level mobs to be able to drop items with absurd stats like 2000+ HP. On my server im going to make it soloable but not by making mobs weaker, instead by making much nicer gear available. I see you used only those items you wanted as loot but I want every equippable item available if that's not too difficult to tweak. I thank you for any/all assistance as im still a complete noob at developing my own code!

bruise
12-22-2011, 01:49 PM
Also if its easier I would be perfectly fine with all higher lvl mobs being able to drop any item in game as this would make it a lot more fun in my opinion due to it taking MUCH longer to find superior items!

Burningsoul
12-22-2011, 03:18 PM
You keep coming back to wanting mobs to "drop everything in the game", but since you're limited to 100 items per loot drop, that will NEVER happen. There is no easy way to do that. You can create 50 loot drops, assigned to a loot table, and then mass-assigned to a broad level range of mobs, but D2Loot can't do that for you, it'd have to be by hand.

The best I can come up with is scaling items by AC or damage - say for instance, you're working on level 21-30 mobs. You're working on the armor loot table. You want your BEST gear dropping to be no higher than 50AC, but more than 10. Using GeorgeS D2loot proggie, input the following rule - "AC>10 AND AC<50". You can scale it however you like, and as you learn more about sql queries you can create more in-depth filters.

Others may have better, more varied opinions. I'm anxious to hear them, as I also have much to learn.

werebat
12-22-2011, 03:47 PM
With multiple lootdrop ids it can happen.

Example:
I want 6000 items to have a chance of dropping.
I create 60 lootdrop ids of 100 items each. (60 x 100 = 6000)

It would be a task to do such a thing but it is possible. AFAIK there is not a limit to the number of lootdrop ids a mob can have. If so then you would have (max_number_of_lootdrops * 100) items possible per mob. The real trick is figuring out what items you want each mob capable of dropping.

Burningsoul
12-22-2011, 05:45 PM
That's what I was implying, and yes it's quite a daunting task. Given that he wants all items to drop, and there's 90,000+ items according to world.exe, that's a HUGE loottable entry :)

Thinking about it, something like the following would help a bit..

insert into lootdrop values (100001, 'Megaloots_1');
insert into lootdrop_entries select 100001, id, 1, 1, 1 from items where id>0 and id<101;
insert into loottable_entries select distinct loottable_id, 100001, 1, 4 from npc_types where loottable_id > 0 and level between 0 and 10;
(Shamelessly stolen and modified from the "Activating Defiant Drops" thread)

It would still take 900 Lootdrop Entries, and that's not even filtering the junk (Fire Procs and other placeholder items) that you wouldn't want. For giggles awhile back, I gave all level 1-10 Npcs a loottable with 30 100-item lootdrops. Loading up world and zone.exe took quite some time, I'd love to see it choke down aforementioned loottable :)

Tabasco
12-22-2011, 05:59 PM
I think the easiest way to randomly drop from the entire table would be to grab a random id from 0 - item max out of the shared item struct and add it at spawn time.

That might even work on a private server, but in practice the table is full of GM and test items that you don't want dropping on a public server.
In fact, the last time I checked I think it was only around 7500 wearable items that naturally drop. (Based on loottable/lootdrop) Everything else is quested, crafted, or not intended for player consumption.

Kayen
12-23-2011, 03:57 PM
I think the best way to do this would be to add the loot via quest after the mobs spawning using a default.pl file for each zone using

quest::addloot(item_id, charges = 0, equipitem = true)

Lets say you have 6000 items for npc lv 50-60 with ID 1-6000

In default.pl in

sub EVEN_SPAWN
{

my $DropChance = int(rand(99)) + 1;

if ($DropChance == 1)
{
my $Select_Itemid = int(rand(6000))+1;

quest::addloot($Select_Itemid);
}
}


Thats about it chooses a random itemid from 1-6000 and sticks in on there, its much easier to actually add and organize loot via quests then it is tables now a day.

Kayen
GM Storm Haven

Burningsoul
12-24-2011, 01:22 AM
That looks awesome Kayen, so simple I can't believe I overlooked it. I fixed the typo in sub EVENT_SPAWN and changed a few bits, saved it as default.pl in tutorialb. I zone in, #repop zone just for OCD's sake, and pulled a train of 30-ish mobs. I'm not noticing it taking effect.

Is it because it uses an if, but doesn't include elseif afterwards? 123309 is near the end of the items table, so I should be seeing quite a variety of items dropping, even if they're useless placeholders or whatnot.

Also tried changing quest::addloot($Select_Itemid); to
quest::addloot($Select_Itemid, charges = 0, equipitem = true)
And all I'm seeing in zone.exe is warning that missing "'s around charges and equipitem might break later revisions.

sub EVENT_SPAWN
{

my $DropChance = int(rand(99)) + 1;

if ($DropChance < 99)
{
my $Select_Itemid = int(rand(123309))+1;

quest::addloot($Select_Itemid);
}
}

I set the $DropChance < 99 just to ensure I wouldn't be on the losing side of the RNG during testing.

lerxst2112
12-24-2011, 03:08 AM
I attached this script to npc id 9001 (deathfist pawn), spawned a bunch of them, and found a variety of loot on them they would not normally have with a wide variety of IDs.

I changed it to +1001 since that is the first valid item ID.


sub EVENT_SPAWN
{
my $DropChance = int(rand(99)) + 1;
if($DropChance < 99)
{
my $Select_Itemid = int(rand(100000))+1001;
quest::addloot($Select_Itemid);
}
}


If you only want valid items you might try looping the selection until you get one. This will tell you how to figure out if the item is valid or not: http://eqemulator.org/forums/showthread.php?t=34188

Burningsoul
12-24-2011, 06:44 AM
Update: Works like a charm when assigned via NPC name or ID .pl files. Any attempt at using default.pl, whether in the root quests folder, templates folder, or inside the zone's folder however, does not.

Even if global loading of this can't be achieved, it's still a -tremendous- help for customizing zones.

werebat
01-25-2012, 04:51 PM
I created a massive lootdrop with every weapon, armor, shield and potion item in the game based on itemtype. So my resulting lootdrop has tens of thousands of items in it. I have been running it for several days now and can confirm it works like a charm. So you can use the activate defiant template to create lootdrops of any size you want. The trick is including only the items you want. Mine is set up by relevels for every mob. So mobs up to level 10 drop stuff that has a reqlevel of 10 or lower, up to level 60 mobs drop stuff that has a reqlevel of 60 or lower, etc...