12,790
edits
mNo edit summary |
(Use game data for list of ITM afflicted monsters) |
||
(11 intermediate revisions by one other user not shown) | |||
Line 14: | Line 14: | ||
local result = '{| class="wikitable sortable stickyHeader"' | local result = '{| class="wikitable sortable stickyHeader"' | ||
result = result..'\r\n|-class="headerRow-0"' | result = result..'\r\n|-class="headerRow-0"' | ||
result = result..'\r\n!Icon!!Dungeon!!Monsters!!Boss Level!!Total HP!! | result = result..'\r\n!Icon!!Dungeon!!Monsters!!Boss Level!!Total HP!!Min DR (melee)!!Min DR (ranged)!!Min DR (magic)!!Reward(s)!!Boss Pet' | ||
for i, dungIdx in ipairs(AreaData.displayOrder.dungeons) do | for i, dungIdx in ipairs(AreaData.displayOrder.dungeons) do | ||
Line 28: | Line 28: | ||
local minDR = p._getDungeonMinDR(dung, 1000, 0.4) | local minDR = p._getDungeonMinDR(dung, 1000, 0.4) | ||
result = result..'||'..minDR["Melee"] | result = result..'||'..minDR["Melee"].."%" | ||
result = result..'||'..minDR["Ranged"] | result = result..'||'..minDR["Ranged"].."%" | ||
result = result..'||'..minDR["Magic"] | result = result..'||'..minDR["Magic"].."%" | ||
result = result..'||'..pm._getDungeonRewards(dung, false) | result = result..'||'..pm._getDungeonRewards(dung, false) | ||
Line 49: | Line 49: | ||
for i, monsterID in Shared.skpairs(dung.monsters) do | for i, monsterID in Shared.skpairs(dung.monsters) do | ||
local monster = Monsters.getMonsterByID(monsterID) | local monster = Monsters.getMonsterByID(monsterID) | ||
local styleName = Constants.getCombatStyleName(monster.attackType) | if monster == nil and monsterID == -1 then | ||
for _, id in Shared.skpairs(AreaData.itm.monsters) do | |||
if maxHit > maxHitsPerMonsterStyle[styleName] then | local monster = Monsters.getMonsterByID(id) | ||
maxHitsPerMonsterStyle[styleName] = maxHit | local styleName = Constants.getCombatStyleName(monster.attackType) | ||
local maxHit = Monsters._getMonsterMaxHit(monster, true) -- doStuns = true | |||
if styleName == "Random" then | |||
for randomStyle, value in Shared.skpairs(maxHitsPerMonsterStyle) do | |||
if maxHit > value then | |||
maxHitsPerMonsterStyle[randomStyle] = maxHit | |||
end | |||
end | |||
else | |||
if maxHit > maxHitsPerMonsterStyle[styleName] then | |||
maxHitsPerMonsterStyle[styleName] = maxHit | |||
end | |||
end | |||
end | |||
else | |||
local styleName = Constants.getCombatStyleName(monster.attackType) | |||
local maxHit = Monsters._getMonsterMaxHit(monster, true) -- doStuns = true | |||
if styleName == "Random" then | |||
for randomStyle, value in Shared.skpairs(maxHitsPerMonsterStyle) do | |||
if maxHit > value then | |||
maxHitsPerMonsterStyle[randomStyle] = maxHit | |||
end | |||
end | |||
else | |||
if maxHit > maxHitsPerMonsterStyle[styleName] then | |||
maxHitsPerMonsterStyle[styleName] = maxHit | |||
end | |||
end | |||
end | end | ||
end | end | ||
Line 92: | Line 120: | ||
function p._testing() | function p._testing() | ||
local dung = CombatAreas.getArea(" | local dung = CombatAreas.getArea("Into the Mist") | ||
local maxHp = 1120 | local maxHp = 1120 | ||
local ae = 0.4 | local ae = 0.4 | ||
Line 114: | Line 142: | ||
for tier, aevalue in Shared.skpairs(AutoEatValues) do | for tier, aevalue in Shared.skpairs(AutoEatValues) do | ||
mw.log(aevalue) | --mw.log(aevalue) | ||
end | end | ||
Line 120: | Line 148: | ||
return result | return result | ||
end | |||
function p._getStrongestAfflicted() | |||
local maxHitsPerMonsterStyle = { Melee = 0, Ranged = 0, Magic = 0 } | |||
for _, id in Shared.skpairs(AreaData.itm.monsters) do | |||
local monster = Monsters.getMonsterByID(id) | |||
local styleName = Constants.getCombatStyleName(monster.attackType) | |||
local maxHit = Monsters._getMonsterMaxHit(monster, true) -- doStuns = true | |||
if styleName == "Random" then | |||
for randomStyle, value in Shared.skpairs(maxHitsPerMonsterStyle) do | |||
if maxHit > value then | |||
maxHitsPerMonsterStyle[randomStyle] = maxHit | |||
end | |||
end | |||
else | |||
if maxHit > maxHitsPerMonsterStyle[styleName] then | |||
maxHitsPerMonsterStyle[styleName] = maxHit | |||
end | |||
end | |||
end | |||
return maxHitsPerMonsterStyle | |||
end | |||
function p._getAfflictedAverageHP() | |||
local totalHp = 0 | |||
local afflicted = AreaData.itm.monsters | |||
for _, id in Shared.skpairs(afflicted) do | |||
local monster = Monsters.getMonsterByID(id) | |||
totalHp = totalHp + Monsters._getMonsterHP(monster) | |||
end | |||
return math.ceil(totalHp / Shared.tableCount(afflicted)) | |||
end | end | ||
function p._getDungeonTotalHP(dung, accountForEnemyDR) | function p._getDungeonTotalHP(dung, accountForEnemyDR) | ||
local calculateDr = accountForEnemyDR or false | local calculateDr = accountForEnemyDR or false | ||
totalHp = 0 | local totalHp = 0 | ||
for i, monsterID in Shared.skpairs(dung.monsters) do | for i, monsterID in Shared.skpairs(dung.monsters) do | ||
local dr = 0 | |||
local monsterHp = 0 | |||
local monster = Monsters.getMonsterByID(monsterID) | local monster = Monsters.getMonsterByID(monsterID) | ||
if monster == nil and monsterID == -1 then | |||
monsterHp = p._getAfflictedAverageHP() | |||
dr = 0.2 -- afflicted always have +20% dr | |||
else | |||
monsterHp = Monsters._getMonsterHP(monster) | |||
dr = 0 | |||
end | |||
if calculateDR then | if calculateDR then | ||
for i, eq in Shared.skpairs(monster.equipmentStats) do | for i, eq in Shared.skpairs(monster.equipmentStats) do | ||
if eq.key == "damageReduction" then | if eq.key == "damageReduction" then | ||
dr = eq.value/100 | dr = dr + eq.value/100 | ||
end | end | ||
end | end | ||
else | |||
dr = 0 | |||
end | end | ||
local monsterPostReductionHP = math.floor(monsterHp / (1-dr)) | local monsterPostReductionHP = math.floor(monsterHp / (1-dr)) | ||
totalHp = totalHp + monsterPostReductionHP | totalHp = totalHp + monsterPostReductionHP | ||
end | end | ||
return totalHp | return totalHp |