4,951
edits
Falterfire (talk | contribs) (Pet Navbox now has separate section for boss pets) |
Falterfire (talk | contribs) (Added initial pass at making boss pets a thing) |
||
Line 39: | Line 39: | ||
function p.getPetBySkill(skillName) | function p.getPetBySkill(skillName) | ||
local result = nil | local result = nil | ||
local skillID = Skills.getSkillID(skillName) | |||
for i, pet in pairs(PetData.Pets) do | for i, pet in pairs(PetData.Pets) do | ||
if( | if(skillID == pet.skill) then | ||
result = Shared.clone(pet) | result = Shared.clone(pet) | ||
--Make sure every pet has an id, and account for Lua being 1-index | --Make sure every pet has an id, and account for Lua being 1-index | ||
Line 67: | Line 65: | ||
local result = nil | local result = nil | ||
local skillName = frame.args ~= nil and frame.args[1] or frame | local skillName = frame.args ~= nil and frame.args[1] or frame | ||
return p.getPetTable(p.getPetBySkill(skillName).name) | |||
end | end | ||
Line 80: | Line 74: | ||
local name = (args.name ~= nil and args.name ~= '') and args.name or args[1] | local name = (args.name ~= nil and args.name ~= '') and args.name or args[1] | ||
local pet = p.getPet(name) | local pet = p.getPet(name) | ||
local | |||
local source = nil | |||
if (args.skill ~= nil and args.skill ~= '') then | |||
source = args.skill | |||
elseif pet.skill ~= nil and pet.skill >= 0 then | |||
source = Icons.Icon({Skills.getSkillName(pet.skill), type='skill'}) | |||
else | |||
local combatArea = Zones.getArea(pet.acquiredBy) | |||
if combatArea ~= nil then | |||
source = Icons.Icon({combatArea.name, type=combatArea.type}) | |||
end | |||
end | |||
local effect = (args.effect ~= nil and args.effect ~= '') and args.effect or pet.description | local effect = (args.effect ~= nil and args.effect ~= '') and args.effect or pet.description | ||
Line 87: | Line 93: | ||
result = result..Icons.Icon({name, type='pet', size='250', notext=true}) | result = result..Icons.Icon({name, type='pet', size='250', notext=true}) | ||
result = result..'\r\n|-\r\n| Pet ID: '..pet.id | result = result..'\r\n|-\r\n| Pet ID: '..pet.id | ||
result = result..'\r\n|-\r\n| | |||
result = result..'\r\n|-\r\n| Source: '..source | |||
result = result..'\r\n|-\r\n| style ="width: 250px;"|Effect: '..effect..'\r\n|}' | result = result..'\r\n|-\r\n| style ="width: 250px;"|Effect: '..effect..'\r\n|}' | ||