Add creature type icons for summons

This commit is contained in:
Kamil Chojnowski
2017-11-19 02:37:41 +01:00
parent 81a705096a
commit 3b23b787f3
8 changed files with 65 additions and 6 deletions

View File

@@ -33,6 +33,12 @@ NpcIconTrade = 2
NpcIconQuest = 3
NpcIconTradeQuest = 4
CreatureTypePlayer = 0
CreatureTypeMonster = 1
CreatureTypeNpc = 2
CreatureTypeSummonOwn = 3
CreatureTypeSummonOther = 4
-- @}
function getNextSkullId(skullId)
@@ -104,6 +110,16 @@ function getEmblemImagePath(emblemId)
return path
end
function getTypeImagePath(creatureType)
local path
if creatureType == CreatureTypeSummonOwn then
path = '/images/game/creaturetype/summon_own'
elseif creatureType == CreatureTypeSummonOther then
path = '/images/game/creaturetype/summon_other'
end
return path
end
function getIconImagePath(iconId)
local path
if iconId == NpcIconChat then
@@ -139,9 +155,16 @@ function Creature:onEmblemChange(emblemId)
end
end
function Creature:onTypeChange(typeId)
local imagePath = getTypeImagePath(typeId)
if imagePath then
self:setTypeTexture(imagePath)
end
end
function Creature:onIconChange(iconId)
local imagePath = getIconImagePath(iconId)
if imagePath then
self:setIconTexture(imagePath)
end
end
end