12,872
edits
(_getSpecialAttackTable: Fix) |
(_getSpecialAttackTable: Fix ancient magicks being unintentionally excluded from output) |
||
(5 intermediate revisions by the same user not shown) | |||
Line 50: | Line 50: | ||
if includeCat['Item'] then | if includeCat['Item'] then | ||
for i, item in ipairs(GameData.rawData.items) do | for i, item in ipairs(GameData.rawData.items) do | ||
if item.specialAttacks ~= nil and not Shared.tableIsEmpty(item.specialAttacks) then | if item.specialAttacks ~= nil and not item.golbinRaidExclusive and not Shared.tableIsEmpty(item.specialAttacks) then | ||
local overrideChance = (item.overrideSpecialChances ~= nil and not Shared.tableIsEmpty(item.overrideSpecialChances)) | local overrideChance = (item.overrideSpecialChances ~= nil and not Shared.tableIsEmpty(item.overrideSpecialChances)) | ||
for j, spAttID in ipairs(item.specialAttacks) do | for j, spAttID in ipairs(item.specialAttacks) do | ||
Line 70: | Line 70: | ||
for i, spellCat in ipairs(spellCats) do | for i, spellCat in ipairs(spellCats) do | ||
for j, spell in ipairs(GameData.rawData[spellCat]) do | for j, spell in ipairs(GameData.rawData[spellCat]) do | ||
local spAttID = spell.specialAttack or spell.specialAttackID | |||
local spAtt = GameData.getEntityByID('attacks', | if spAttID ~= nil and includedAttacks[spAttID] then | ||
local spAtt = GameData.getEntityByID('attacks', spAttID) | |||
if spAtt ~= nil then | if spAtt ~= nil then | ||
table.insert(spAttTable, {id = spAtt.id, source = 'Spell', sourceSort = spell.name, sourceText = Icons.Icon({ spell.name, type = 'spell' }), chance = spAtt.defaultChance, descType = 'player' }) | table.insert(spAttTable, {id = spAtt.id, source = 'Spell', sourceSort = spell.name, sourceText = Icons.Icon({ spell.name, type = 'spell' }), chance = spAtt.defaultChance, descType = 'player' }) | ||
Line 113: | Line 114: | ||
table.insert(spAttTable, { id = familiar.id, source = 'Familiar', sourceSort = familiar.name, sourceText = Icons.Icon({ familiar.name, type = 'item' }), chance = famChance or 0, descType = 'player' }) | table.insert(spAttTable, { id = familiar.id, source = 'Familiar', sourceSort = familiar.name, sourceText = Icons.Icon({ familiar.name, type = 'item' }), chance = famChance or 0, descType = 'player' }) | ||
-- Slap a dummy entry into the attacks table for this familiar | -- Slap a dummy entry into the attacks table for this familiar | ||
attacks[famIdx] = { id = familiar.id, name = familiar.name .. ' (Familiar)', description | attacks[famIdx] = { id = familiar.id, name = familiar.name .. ' (Familiar)', description = famDesc } | ||
famIdx = famIdx + 1 | famIdx = famIdx + 1 | ||
end | end | ||
Line 241: | Line 242: | ||
table.sort(validEffectNames, function(a, b) return a < b end) | table.sort(validEffectNames, function(a, b) return a < b end) | ||
return ' | return Shared.printError('Invalid effect name "' .. effectName .. '", must be one of: ' .. table.concat(validEffectNames, ', ')) | ||
end | end | ||
end | end | ||
Line 271: | Line 272: | ||
} | } | ||
local gameMode = { | local gameMode = { | ||
{ 'Standard', 'Standard' }, | { 'Standard Mode', 'Standard' }, | ||
{ 'Hardcore', Icons.Icon({ 'Hardcore' }) } | { 'Hardcore Mode', Icons.Icon({ 'Hardcore' }) } | ||
} | } | ||
local attrCount = Shared.tableCount(triangleAttributes) | local attrCount = Shared.tableCount(triangleAttributes) |