Anonymous

Module:Monsters: Difference between revisions

From Melvor Idle
Remove Acc and Eva from tables; Fix Abyssal slayer targets being put into base game slayer categories
(Show AP for chest drops and monster currency drops where applicable)
(Remove Acc and Eva from tables; Fix Abyssal slayer targets being put into base game slayer categories)
Line 72: Line 72:
elseif statName == 'damageReduction' then
elseif statName == 'damageReduction' then
return p.getEquipmentStat(monster, 'damageReduction')
return p.getEquipmentStat(monster, 'damageReduction')
elseif statName == 'resistance' then
return p.getEquipmentStat(monster, 'resistance')
elseif statName == 'drReduction' then
elseif statName == 'drReduction' then
return p._getMonsterDrReduction(monster)
return p._getMonsterDrReduction(monster)
Line 953: Line 955:
for _, taskCategory in ipairs(GameData.rawData.slayerTaskCategories) do
for _, taskCategory in ipairs(GameData.rawData.slayerTaskCategories) do
local ms = taskCategory.monsterSelection
local ms = taskCategory.monsterSelection
if ms.type == 'CombatLevel' then
if ms.type == 'CombatLevel' and monster.damageType == nil then
local cmbLevel = p._getMonsterCombatLevel(monster)
local cmbLevel = p._getMonsterCombatLevel(monster)
if cmbLevel >= ms.minLevel and (ms.maxLevel == nil or cmbLevel <= ms.maxLevel) then
if cmbLevel >= ms.minLevel and (ms.maxLevel == nil or cmbLevel <= ms.maxLevel) then
return taskCategory
return taskCategory
end
end
elseif ms.type == 'Abyss' then
elseif ms.type == 'Abyss' and monster.damageType == 'melvorItA:Abyssal' then
if Areas._isMonsterInArea(monster, Areas.getAreaByID(ms.areaID)) then
if Areas._isMonsterInArea(monster, Areas.getAreaByID(ms.areaID)) then
return taskCategory
return taskCategory
end
end
else
--else
error('Unknown Slayer task category monster selection type: ' .. (ms.type or 'nil'))
-- error('Unknown Slayer task category monster selection type: ' .. (ms.type or 'nil'))
end
end
end
end
Line 1,698: Line 1,700:
table.insert(tableParts, '{| class="wikitable sortable stickyHeader"')
table.insert(tableParts, '{| class="wikitable sortable stickyHeader"')
-- First header row
-- First header row
table.insert(tableParts, '\r\n|- class="headerRow-0"\r\n! colspan="4" | !! colspan="5" |Offensive Stats !! colspan="3" |Evasion Rating !! colspan="4" |')
table.insert(tableParts, '\r\n|- class="headerRow-0"\r\n! colspan="4" | !! colspan="4" |Offensive Stats !! colspan="8" |')
-- Second header row
-- Second header row
table.insert(tableParts, '\r\n|- class="headerRow-1"\r\n!Monster !!Name !!Combat Level ')
table.insert(tableParts, '\r\n|- class="headerRow-1"\r\n!Monster !!Name !!Combat Level ')
table.insert(tableParts, '!!style="padding:0 1em 0 0"|' .. Icons.Icon({'Hitpoints', type='skill'}))
table.insert(tableParts, '!!style="padding:0 1em 0 0"|' .. Icons.Icon({'Hitpoints', type='skill'}))
table.insert(tableParts, '!!Attack Speed (s) !!colspan="3"|Max Hit !!Accuracy ')
table.insert(tableParts, '!!Attack Speed (s) !!colspan="3"|Max Hit ')
table.insert(tableParts, '!!style="padding:0 1em 0 0"|' .. Icons.Icon({'Defence', type='skill', notext=true}))
table.insert(tableParts, '!!style="padding:0 1em 0 0"|' .. Icons.Icon({'Ranged', type='skill', notext=true}))
table.insert(tableParts, '!!style="padding:0 1em 0 0"|' .. Icons.Icon({'Magic', type='skill', notext=true}))
table.insert(tableParts, '!!DR!!' .. Icons.Icon({'Coins', notext=true, nolink=true}) .. ' Coins !!Bones !!Locations')
table.insert(tableParts, '!!DR!!' .. Icons.Icon({'Coins', notext=true, nolink=true}) .. ' Coins !!Bones !!Locations')


Line 1,718: Line 1,717:
local atkSpeed = p._getMonsterAttackSpeed(monster)
local atkSpeed = p._getMonsterAttackSpeed(monster)
local maxHit = p._getMonsterMaxHit(monster)
local maxHit = p._getMonsterMaxHit(monster)
local dr = p._getMonsterStat(monster, 'damageReduction')
local dr = nil
if monster.damageType == 'melvorItA:Abyssal' then
dr = p._getMonsterStat(monster, 'resistance')
else
dr = p._getMonsterStat(monster, 'damageReduction')
end
local drReduce = p._getMonsterDrReduction(monster)
local drReduce = p._getMonsterDrReduction(monster)
local accR = p._getMonsterAR(monster)
local evaR = {p._getMonsterER(monster, "Melee"), p._getMonsterER(monster, "Ranged"), p._getMonsterER(monster, "Magic")}
local currVal = 0
local currVal = 0
if monster.currencyDrops ~= nil and not monster.currencyDrops[1] ~= nil then
if monster.currencyDrops ~= nil and not monster.currencyDrops[1] ~= nil then
Line 1,744: Line 1,746:
table.insert(tableParts, '\r\n|style="text-align:right"|' .. Num.formatnum(maxHit))
table.insert(tableParts, '\r\n|style="text-align:right"|' .. Num.formatnum(maxHit))
end
end
table.insert(tableParts, '\r\n|style="text-align:right" data-sort-value="' .. accR .. '" |' .. Num.formatnum(accR))
table.insert(tableParts, '\r\n|style="text-align:right" data-sort-value="' .. evaR[1] .. '" |' .. Num.formatnum(evaR[1]))
table.insert(tableParts, '\r\n|style="text-align:right" data-sort-value="' .. evaR[2] .. '" |' .. Num.formatnum(evaR[2]))
table.insert(tableParts, '\r\n|style="text-align:right" data-sort-value="' .. evaR[3] .. '" |' .. Num.formatnum(evaR[3]))
table.insert(tableParts, '\r\n|style="text-align:right" data-sort-value="' .. dr .. '" |' .. dr..'%')
table.insert(tableParts, '\r\n|style="text-align:right" data-sort-value="' .. dr .. '" |' .. dr..'%')
table.insert(tableParts, '\r\n|style="text-align:right" data-sort-value="' .. currVal .. '" |' .. currText)
table.insert(tableParts, '\r\n|style="text-align:right" data-sort-value="' .. currVal .. '" |' .. currText)