lookEvent.onLook = function(self, thing, position, distance, description)
if thing:isItem() then
if thing:getCustomEquipId() then
local eq = customEquipment[thing:getCustomEquipId()]
if eq then
-- Description generation
-- Buffs
if eq.conditions["healthgain"] then
description = string.format("%s\nHealth Regeneration: +" ..eq.conditions["healthgain"].. "", description)
end
if eq.conditions["managain"] then
description = string.format("%s\nMana Regeneration: +" ..eq.conditions["managain"].. "", description)
end
if eq.conditions["maxhitpoints"] then
description = string.format("%s\nMaximum hitpoints: +" ..eq.conditions["maxhitpoints"].. "", description)
end
if eq.conditions["maxmanapoints"] then
description = string.format("%s\nMaximum manapoints : +" ..eq.conditions["maxmanapoints"].. "", description)
end
if eq.conditions["magicpoints"] then
description = string.format("%s\nMagic boost: +" ..eq.conditions["magicpoints"].. "", description)
end
if eq.conditions["meleeskill"] then
description = string.format("%s\nMelee boost: +" ..eq.conditions["meleeskill"].. "", description)
end
if eq.conditions["speed"] then
description = string.format("%s\nSpeed boost: +" ..eq.conditions["speed"].. "", description)
end
if eq.conditions["soul"] then
description = string.format("%s\nSoul boost: +" ..eq.conditions["soul"].. "", description)
end
if eq.conditions["manashield"] then
description = string.format("%s\nManashield Activation ", description)
end
if eq.conditions["invis"] then
description = string.format("%s\nInvisible Activation ", description)
end
-- Skills
if eq.conditions["fistskill"] then
description = string.format("%s\nFist skill boost: +" ..eq.conditions["fistskill"].. "", description)
end
if eq.conditions["clubskill"] then
description = string.format("%s\nClub skill boost: +" ..eq.conditions["clubskill"].. "", description)
end
if eq.conditions["swordskill"] then
description = string.format("%s\nSword skill boost: +" ..eq.conditions["swordskill"].. "", description)
end
if eq.conditions["axeskill"] then
description = string.format("%s\nAxe skill boost: +" ..eq.conditions["axeskill"].. "", description)
end
if eq.conditions["distanceskill"] then
description = string.format("%s\nDistance skill boost: +" ..eq.conditions["distanceskill"].. "", description)
end
if eq.conditions["shieldskill"] then
description = string.format("%s\nShield skill boost: +" ..eq.conditions["shieldskill"].. "", description)
end
if eq.conditions["fishingskill"] then
description = string.format("%s\nFishing skill boost: +" ..eq.conditions["fishingskill"].. "", description)
end
-- Special skill
if eq.conditions["criticalhitchance"] then
description = string.format("%s\nCritical hit chance: +" ..eq.conditions["criticalhitchance"].. "", description)
end
if eq.conditions["criticalhitamount"] then
description = string.format("%s\nCritical hit amount: +" ..eq.conditions["criticalhitamount"].. "", description)
end
if eq.conditions["lifeleechchance"] then
description = string.format("%s\nLife leech chance: +" ..eq.conditions["lifeleechchance"].. "", description)
end
if eq.conditions["lifeleechamount"] then
description = string.format("%s\nLife leech amount: +" ..eq.conditions["lifeleechamount"].. "", description)
end
if eq.conditions["manaleechchance"] then
description = string.format("%s\nMana leech chance: +" ..eq.conditions["manaleechchance"].. "", description)
end
if eq.conditions["manaleechamount"] then
description = string.format("%s\nMana leech amount: +" ..eq.conditions["manaleechamount"].. "", description)
end
-- Requirements
if eq.requirements["level"] and type(eq.requirements["level"]) == "number" then
description = string.format("%s\nLevel Required: %d", description, eq.requirements["level"])
end
if eq.requirements["magiclevel"] and type(eq.requirements["magiclevel"]) == "number" then
description = string.format("%s\nMagic Level Required: %d", description, eq.requirements["magiclevel"])
end
if eq.requirements["premium"] and eq.requirements["premium"] > 0 then
description = string.format("%s\nPremium Required", description)
end
if eq.requirements["vocation"] then
description = string.format("%s\nVocation Required: " ..eq.requirements["vocation"].. "", description)
end
--- attributes reload onLook
if attributeReload then
if reloadOnLook then
for attr, val in pairs(eq.attributes) do
item:setAttribute(attr, val)
end
end
end
end
end
end
return description
end