ServUO Loot Generation

From UO Mayhem
Revision as of 00:23, 4 January 2024 by Basket (talk | contribs)
Jump to navigation Jump to search


Loot Generation Order

  1. BaseCreature.cs, OnBeforeDeath()
    • calls GenerateLoot(false)
  1. BaseCreature.cs, GenerateLoot(bool spawning)
    • If !spawning then m_KillersLuck = killer/highest-damage-dealers luck
    • calls BaseCreature.cs GenerateLoot()
      • MOBILE.cs has public override void GenerateLoot() which will AddLoot() all LootPack
    • if m_Paragon (mobile is paragon) then add extra AddLoot() based on fame (from Meager to UltraRich)
  1. BaseCreature.cs, AddLoot(LootPack pack)
    • calls LootPack.cs pack.Generate(this, backpack, m_spawning, m_KillersLuck)
  1. LootPack.cs, Generate (Mobile from, Container cont, bool spawning, int luckChance)
    • for each item (LootPackEntry) in the LootPack check if we should create the item. If Items spawn chance * 100 > random(10000 ) create item
      • If random failed to create, do another check against players luck
      • If random succeeds to create, call LootPackEntry.Construct (from, luckchance, spawning)

587

  1. Lootpack.cs LootPackEntry.Construct (Mobile from, int luckChance, bool spawning)
    • Choose an item type to make from LootPackEntry.items[]
    • calls Mutate(from, luckChance, item.Construct(SEE BELOW))

1000

  1. Lootpack.cs LootPackItem.Construct (bool inTokuno, bool isMondain, bool isStygian)
    • will pick a random item from the BaseType depending on if it's Tokuno, Mondain, or Stygian

657

  1. LootPack.cs Item Mutate (Mobile from, int luckChance, Item item)
    • Random 1 in 100 chance to turn into a FireHorn
    • If item is BaseWeapon, BaseArmor, BaseJewel, or BaseHat
      • If >= HighSeas generate using new item reforging system
      • determine bonus properties from GetBonusProperties()
      • if bonus properties < max properties then do a luck check to see if we should add 1 more property
      • properties = 1 + bonus properties (cap at max properties)
      • call BaseRunicTool.ApplyAttributesTo((BaseCATEGORY)item, falce, luckChance, props, m_MinIntensity, m_MaxIntensity)
    • If item is BaseInstrument
      • pick a random slayer
  1. BaseRunicTool.cs ApplyAttributesTo(BaseCATEGORY category, bool playerMade, int luckchance, int attributeCount, int min, int max)
    • if not player made, and using new item system, runic reforge create it
    • apply all attributes
      • pick a random attribute that is available to apply
      • call ApplyAttribute (primary/secondary, min, max, ATTRIBUTE, minimum attribute value, maximum attribute value)
  1. ApplyAttribute
    • Scale(.....) the attribute, random the percent, do a luck roll to see if we should bump the value
    • apply the attribute based on inputted data