mirror of
https://github.com/edubart/otclient.git
synced 2025-10-15 12:04:55 +02:00
Add creature type icons for summons
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user