Module:Pets: Difference between revisions

petGetSidebar: Amend drop chance for Into the Mist
(_getPetEffect: Adjust for various changes in source data)
(petGetSidebar: Amend drop chance for Into the Mist)
Line 177: Line 177:
   local dropChance = nil
   local dropChance = nil
   if pet.obtained ~= nil and pet.obtained.dungeonCompletion ~= nil then
   if pet.obtained ~= nil and pet.obtained.dungeonCompletion ~= nil then
    local odds = pet.obtained.dungeonCompletion[1][2]
  local odds = pet.obtained.dungeonCompletion[1][2]
    dropChance = '1 in '..odds..' ('..Shared.round(100 / odds, 2, 2)..'%)'
  -- Special handling for Into the Mist/Pablo
  if pet.obtained.dungeonCompletion[1][1] == 15 then
    dropChance = 'Guaranteed after ' .. odds .. ' completions'
  else
      dropChance = '1 in '..odds..' ('..Shared.round(100 / odds, 2, 2)..'%)'
    end
   end
   end