892
edits
m (it funks?) |
m (table instead of string) |
||
Line 13: | Line 13: | ||
local result = '{|\r\n' | local result = '{|\r\n' | ||
local rows = {} | local rows = {} | ||
local headers = { | |||
'ID', | |||
'Name', | |||
'NormalAttackMaxHit', | |||
'NormalAttackType', | |||
'HasSpecial', | |||
'Accuracy', | |||
'MeleeEvasion', | |||
'RangedEvasion', | |||
'MagicEvasion', | |||
'GoldDropMin', | |||
'GoldDropMax', | |||
'BoneType', | |||
'BonePrayerValue', | |||
'Location', | |||
'SlayerTier', 'SlayerTierName', 'SlayerTierCost', | |||
'SlayerTierPlayerLevel', 'SlayerTierQtyMin', 'SlayerTierQtyMax', 'SlayerCoinReward', | |||
'ItemsID', 'ItemsWeight', 'ItemsDenominators', 'ItemsTotalWeight', 'ItemsQtyMin', 'ItemsQtyMax' | |||
} | |||
local monsterID = 0 | local monsterID = 0 | ||
local monster = Monsters.getMonsterByID(monsterID) | local monster = Monsters.getMonsterByID(monsterID) | ||
while monster ~= nil and monsterID < 2000 do -- as of writing this, there are [0..163] monsters | while monster ~= nil and monsterID < 2000 do -- as of writing this, there are [0..163] monsters | ||
local rowTxt = '|-\r\n' | local rowTxt = {} | ||
table.insert(rowTxt, '|-\r\n') | |||
table.insert(rowTxt, monsterID) | |||
table.insert(rowTxt, monster.name) | |||
local combatLevel = Monsters._getMonsterCombatLevel(monster) | |||
table.insert(rowTxt, combatLevel) | |||
local hitpoints = Monsters._getMonsterHP(monster) | |||
table.insert(rowTxt, hitpoints) | |||
table.insert(rowTxt, Monsters._getMonsterAttackSpeed(monster)) | |||
table.insert(rowTxt, Monsters._getMonsterMaxHit(monster)) | |||
table.insert(rowTxt, monster.attackType) | |||
table.insert(rowTxt, tostring(not #(monster.specialAttack or {}))) | |||
local | table.insert(rowTxt, Monsters._getMonsterAR(monster)) | ||
table.insert(rowTxt, Monsters._getMonsterER(monster, 'Melee')) | |||
table.insert(rowTxt, Monsters._getMonsterER(monster, 'Ranged')) | |||
table.insert(rowTxt, Monsters._getMonsterER(monster, 'Magic')) | |||
table.insert(rowTxt, monster.dropCoins[1]) | |||
table.insert(rowTxt, monster.dropCoins[2]) | |||
local bones = Items.getItemByID(monster.bones) | local bones = Items.getItemByID(monster.bones) | ||
if bones ~= nil and bones.prayerPoints then | if bones ~= nil and bones.prayerPoints then | ||
rowTxt | table.insert(rowTxt, bones.name) | ||
rowTxt | table.insert(rowTxt, bones.prayerPoints) | ||
else | else | ||
rowTxt | table.insert(rowTxt, tostring(false)) | ||
rowTxt | table.insert(rowTxt, tostring(0)) | ||
end | end | ||
table.insert(rowTxt, Monsters._getMonsterAreas(monster, false)) --args[2] is excludeDungeons | |||
local slayer = nil | local slayer = nil | ||
if monster.canSlayer then | if monster.canSlayer then | ||
Line 92: | Line 77: | ||
end | end | ||
table.insert(rowTxt, slayer.id) | |||
table.insert(rowTxt, slayer.display) | |||
table.insert(rowTxt, slayer.cost) | |||
table.insert(rowTxt, slayer.slayerLevel) | |||
table.insert(rowTxt, slayer.minQuantity) | |||
table.insert(rowTxt, slayer.maxQuantity) | |||
table.insert(rowTxt, slayer.reward) | |||
local itemIds = {} | |||
local itemWeights = {} | |||
local itemDenominators = {} | |||
local itemQtyMins = {} | |||
local itemQtyMaxs = {} | |||
local totalWeight = 0 | |||
for _, droppable in pairs(monster.lootTable) do | |||
totalWeight = totalWeight + droppable[2] | |||
end | |||
for _, droppable in pairs(monster.lootTable) do | |||
table.insert(itemIds, droppable[1]) | |||
table.insert(itemWeights, droppable[2]*monster.lootChance) | |||
table.insert(itemDenominators, totalWeight*100) | |||
table.insert(itemQtyMins, 1) | |||
table.insert(itemQtyMaxs, droppable[3]) | |||
end | |||
table.insert(rowTxt, table.concat(itemIds, ",")) | |||
table.insert(rowTxt, table.concat(itemWeights, ",")) | |||
table.insert(rowTxt, table.concat(itemDenominators, ",")) | |||
table.insert(rowTxt, totalWeight) | |||
table.insert(rowTxt, table.concat(itemQtyMins, ",")) | |||
table.insert(rowTxt, table.concat(itemQtyMaxs, ",")) | |||
table.insert(rows, rowTxt) | table.insert(rows, table.concat(rowTxt, '|').."\r\n") | ||
monsterID = monsterID + 1 | monsterID = monsterID + 1 | ||
monster = Monsters.getMonsterByID(monsterID) | monster = Monsters.getMonsterByID(monsterID) |
edits