ServUO Loot Generation: Difference between revisions

From UO Mayhem
Jump to navigation Jump to search
No edit summary
No edit summary
 
(11 intermediate revisions by the same user not shown)
Line 4: Line 4:
# BaseCreature.cs, OnBeforeDeath()
# BaseCreature.cs, OnBeforeDeath()
#* calls GenerateLoot(false)
#* calls GenerateLoot(false)
# BaseCreature.cs, GenerateLoot(bool spawning)
# BaseCreature.cs, GenerateLoot(bool spawning)
#* If !spawning then m_KillersLuck = killer/highest-damage-dealers luck
#* If !spawning then m_KillersLuck = killer/highest-damage-dealers luck
#* if m_Paragon then add extra AddLoot() based on fame (From Meager to UltraRich)
#* 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)
 
# BaseCreature.cs, AddLoot(LootPack pack)
#* calls LootPack.cs pack.Generate(this, backpack, m_spawning, m_KillersLuck)
 
# 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
# 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
# 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
# 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
 
# 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)


# MOBILE.cs public override void GenerateLoot() adds lootpacks
# ApplyAttribute
#* Scale(.....) the attribute, random the percent, do a luck roll to see if we should bump the value by some overly complex way. (change this to make it simpler, and more rewarding/impactful/noticeable)
#* apply the attribute

Latest revision as of 00:27, 4 January 2024


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 by some overly complex way. (change this to make it simpler, and more rewarding/impactful/noticeable)
    • apply the attribute