Diablo style item spawning

BlitzMax Forums/BlitzMax Programming/Diablo style item spawning

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

You need

a table of all items and their stats
an algorithm to identify possible loot for the current player level

you can enhance this with

subsets of items for certain zones, monster types
giving certain npcs(monsters) a fixed table of possible loot specific to that npc
add a variable amount of gold separately to the looting algorithm
etc etc etc

I'd just use a "loot-array" consisting of index numbers which point to the big item-table for every monster type.
If the monster types raise in level like in diablo you need to take that into account and prepare the npc-specific loot-array accordingly.