mirror of
https://github.com/edubart/otclient.git
synced 2025-10-16 04:24:54 +02:00
implementing battle window, need some improvements but its working
This commit is contained in:
@@ -23,53 +23,74 @@ EmblemGreen = 1
|
||||
EmblemRed = 2
|
||||
EmblemBlue = 3
|
||||
|
||||
function Creature:onSkullChange(skullId)
|
||||
function getSkullImagePath(skullId)
|
||||
if skullId == SkullYellow then
|
||||
self:setSkullTexture(resolvepath('images/skull_yellow.png'))
|
||||
return 'images/skull_yellow.png'
|
||||
elseif skullId == SkullGreen then
|
||||
self:setSkullTexture(resolvepath('images/skull_green.png'))
|
||||
return 'images/skull_green.png'
|
||||
elseif skullId == SkullWhite then
|
||||
self:setSkullTexture(resolvepath('images/skull_white.png'))
|
||||
return 'images/skull_white.png'
|
||||
elseif skullId == SkullRed then
|
||||
self:setSkullTexture(resolvepath('images/skull_red.png'))
|
||||
return 'images/skull_red.png'
|
||||
elseif skullId == SkullBlack then
|
||||
self:setSkullTexture(resolvepath('images/skull_black.png'))
|
||||
return 'images/skull_black.png'
|
||||
elseif skullId == SkullOrange then
|
||||
self:setSkullTexture(resolvepath('images/skull_orange.png'))
|
||||
return 'images/skull_orange.png'
|
||||
end
|
||||
end
|
||||
|
||||
function getShieldImagePathAndBlink(shieldId)
|
||||
if shieldId == ShieldWhiteYellow then
|
||||
return 'images/shield_yellow_white.png', false
|
||||
elseif shieldId == ShieldWhiteBlue then
|
||||
return 'images/shield_blue_white.png', false
|
||||
elseif shieldId == ShieldBlue then
|
||||
return 'images/shield_blue.png', false
|
||||
elseif shieldId == ShieldYellow then
|
||||
return 'images/shield_yellow.png', false
|
||||
elseif shieldId == ShieldBlueSharedExp then
|
||||
return 'images/shield_blue_shared.png', false
|
||||
elseif shieldId == ShieldYellowSharedExp then
|
||||
return 'images/shield_yellow_shared.png', false
|
||||
elseif shieldId == ShieldBlueNoSharedExpBlink then
|
||||
return 'images/shield_blue_not_shared.png', true
|
||||
elseif shieldId == ShieldYellowNoSharedExpBlink then
|
||||
return 'images/shield_yellow_not_shared.png', true
|
||||
elseif shieldId == ShieldBlueNoSharedExp then
|
||||
return 'images/shield_blue_not_shared.png', false
|
||||
elseif shieldId == ShieldYellowNoSharedExp then
|
||||
return 'images/shield_yellow_not_shared.png', false
|
||||
end
|
||||
end
|
||||
|
||||
function getEmblemImagePath(emblemId)
|
||||
if emblemId == EmblemGreen then
|
||||
return 'images/emblem_green.png'
|
||||
elseif emblemId == EmblemRed then
|
||||
return 'images/emblem_red.png'
|
||||
elseif emblemId == EmblemBlue then
|
||||
return 'images/emblem_blue.png'
|
||||
end
|
||||
end
|
||||
|
||||
function Creature:onSkullChange(skullId)
|
||||
local imagePath = getSkullImagePath(skullId)
|
||||
if imagePath then
|
||||
self:setSkullTexture(resolvepath(imagePath))
|
||||
end
|
||||
end
|
||||
|
||||
function Creature:onShieldChange(shieldId)
|
||||
if shieldId == ShieldWhiteYellow then
|
||||
self:setShieldTexture(resolvepath('images/shield_yellow_white.png'), false)
|
||||
elseif shieldId == ShieldWhiteBlue then
|
||||
self:setShieldTexture(resolvepath('images/shield_blue_white.png'), false)
|
||||
elseif shieldId == ShieldBlue then
|
||||
self:setShieldTexture(resolvepath('images/shield_blue.png'), false)
|
||||
elseif shieldId == ShieldYellow then
|
||||
self:setShieldTexture(resolvepath('images/shield_yellow.png'), false)
|
||||
elseif shieldId == ShieldBlueSharedExp then
|
||||
self:setShieldTexture(resolvepath('images/shield_blue_shared.png'), false)
|
||||
elseif shieldId == ShieldYellowSharedExp then
|
||||
self:setShieldTexture(resolvepath('images/shield_yellow_shared.png'), false)
|
||||
elseif shieldId == ShieldBlueNoSharedExpBlink then
|
||||
self:setShieldTexture(resolvepath('images/shield_blue_not_shared.png'), true)
|
||||
elseif shieldId == ShieldYellowNoSharedExpBlink then
|
||||
self:setShieldTexture(resolvepath('images/shield_yellow_not_shared.png'), true)
|
||||
elseif shieldId == ShieldBlueNoSharedExp then
|
||||
self:setShieldTexture(resolvepath('images/shield_blue_not_shared.png'), false)
|
||||
elseif shieldId == ShieldYellowNoSharedExp then
|
||||
self:setShieldTexture(resolvepath('images/shield_yellow_not_shared.png'), false)
|
||||
local imagePath, blink = getShieldImagePathAndBlink(shieldId)
|
||||
if imagePath then
|
||||
self:setShieldTexture(resolvepath(imagePath), blink)
|
||||
end
|
||||
end
|
||||
|
||||
function Creature:onEmblemChange(emblemId)
|
||||
if emblemId == EmblemGreen then
|
||||
self:setEmblemTexture(resolvepath('images/emblem_green.png'))
|
||||
elseif emblemId == EmblemRed then
|
||||
self:setEmblemTexture(resolvepath('images/emblem_red.png'))
|
||||
elseif emblemId == EmblemBlue then
|
||||
self:setEmblemTexture(resolvepath('images/emblem_blue.png'))
|
||||
local imagePath = getEmblemImagePath(emblemId)
|
||||
if imagePath then
|
||||
self:setEmblemTexture(resolvepath(imagePath))
|
||||
end
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user