Braindead's Mordor Site

Personal tools

Item Generation Formula

From Braindead's Mordor Site

Jump to: navigation, search

Looked through the Chest Code, this was a tough one, but I think I got it.

  1. Get MonsterItemChance (or MIC), it's the "U25" Value in Wabbit's Editor
  2. Pick a Random Number [1 to 100]
  3. Apply Chest Modifier to Random Number
    Chest: -25, Box: Unchanged, Container: +15
  4. Add LN("Floor" + 10)*5 to Random Number if chest wasn't Magically Locked
    Effect: Magically Locked = Higher chance of items.
  5. If Modified Random Number is greater than 90 and %MIC isn't 100, then set Random Number to 90.
    This should result in some chests always giving items, ie. chests from Pseudo-Dragons, Lamurian High Priestess, Minotaurs etc
  6. If Modified Random Number is smaller or equal to MIC, item is spawned.
  7. Get Item Level Ranges.
    Maximum: "Item Drop Level" value in Wabbit's Editor
    Minimum: Int(Maximum / 2), always at least 1.
    This Int() probably uses Banker's Rounding, which rounds to the nearest even number, so the minimum drop level for 1-16 will be 1, 1, 2, 2, 2, 3, 4, 4, 4, 5, 6, 6, 6, 7, 8, 8.
  8. Apply Chest Modifier to Item Level Ranges.
    Chest: +1 Minimum, Box: Unchanged, Container: -1 Minimum and Maximum.
    Note: Asmodeus Chests always have 14 Minimum and 16 Maximum, regardless of Chest Type.
  9. Get Item Category, 1 random value from the 10 values below "Item Drop Level" in Wabbit's Editor.
    If value is -1, pick a random Item Category.
    Values below -1 in a Category indicate a specific item, and will always be spawned if that Category is chosen.
  10. Generate Item List.
    This one requires a bit of explanation.
    Game will loop through all Item IDs until it finds an Item ID matching both Minimum Item Level Range and Category.
    It will then continue until it finds an Item ID not matching both Maximum Item Level Range and Category. All items between first ID and [second ID - 1] are put in this list. This causes some items, ie. Vorpal Blade, Lamurian Crown etc, to never be spawned unless explicitly instructed to. [Note from Nudibranch: this can't be entirely correct. I've gotten Vorpal Blades from many monsters not explicitly programmed to drop them. Lamurian Crown has a 0% chance of dropping, which is why it is only dropped by the Lamurian High Priestess.] Unfortunately, it also makes adding items through modding a bit meh. New items will always have IDs outside the "generic" ranges, so they'll never spawn unless you instruct monsters to spawn them or restructure the entire Itemdata File.
  11. Assign Spawn Chance to each Item in List
    Divide the "Chance" value in Wabbit's Editor by the sum of all "Chance" values in the Item List, multiply by 100.
    It works similar to the TC System in Diablo 2, for those who have messed around with that.
  12. Pick a Random Number [0 to 99.9999...], floating-point
  13. Determine which Item is spawned
    If Random Number is equal or lesser than the first Item's chance, spawn that Item.
    Otherwise add chance of next Item in list to the previous chance, and recheck if Random Number is equal or lesser.
    Continue doing this until an Item is spawned.
%Chance for subsequent item spawns = Int(MIC/10)

So, in theory, you should be able to find a chest with infinite items in it ^^

Discuss this topic in the forum

Back to Mordor Spoilers

This page was last modified 23:34, 4 January 2015.  This page has been accessed 22,376 times.  Disclaimers 
Copyrights And Credits