Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- @docclass Creature
- -- @docconsts @{
- SkullNone = 0
- SkullYellow = 1
- SkullGreen = 2
- SkullWhite = 3
- SkullRed = 4
- SkullBlack = 5
- SkullOrange = 6
- ShieldNone = 0
- ShieldWhiteYellow = 1
- ShieldWhiteBlue = 2
- ShieldBlue = 3
- ShieldYellow = 4
- ShieldBlueSharedExp = 5
- ShieldYellowSharedExp = 6
- ShieldBlueNoSharedExpBlink = 7
- ShieldYellowNoSharedExpBlink = 8
- ShieldBlueNoSharedExp = 9
- ShieldYellowNoSharedExp = 10
- EmblemNone = 0
- EmblemFire = 1
- EmblemWater = 2
- EmblemAir = 3
- EmblemEarth = 4
- -- @}
- function getSkullImagePath(skullId)
- local path
- if skullId == SkullYellow then
- path = '/images/game/skulls/skull_yellow'
- elseif skullId == SkullGreen then
- path = '/images/game/skulls/skull_green'
- elseif skullId == SkullWhite then
- path = '/images/game/skulls/skull_white'
- elseif skullId == SkullRed then
- path = '/images/game/skulls/skull_red'
- elseif skullId == SkullBlack then
- path = '/images/game/skulls/skull_black'
- elseif skullId == SkullOrange then
- path = '/images/game/skulls/skull_orange'
- end
- return path
- end
- function getShieldImagePathAndBlink(shieldId)
- local path, blink
- if shieldId == ShieldWhiteYellow then
- path, blink = '/images/game/shields/shield_yellow_white', false
- elseif shieldId == ShieldWhiteBlue then
- path, blink = '/images/game/shields//shield_blue_white', false
- elseif shieldId == ShieldBlue then
- path, blink = '/images/game/shields//shield_blue', false
- elseif shieldId == ShieldYellow then
- path, blink = '/images/game/shields//shield_yellow', false
- elseif shieldId == ShieldBlueSharedExp then
- path, blink = '/images/game/shields//shield_blue_shared', false
- elseif shieldId == ShieldYellowSharedExp then
- path, blink = '/images/game/shields//shield_yellow_shared', false
- elseif shieldId == ShieldBlueNoSharedExpBlink then
- path, blink = '/images/game/shields//shield_blue_not_shared', true
- elseif shieldId == ShieldYellowNoSharedExpBlink then
- path, blink = '/images/game/shields//shield_yellow_not_shared', true
- elseif shieldId == ShieldBlueNoSharedExp then
- path, blink = '/images/game/shields//shield_blue_not_shared', false
- elseif shieldId == ShieldYellowNoSharedExp then
- path, blink = '/images/game/shields//shield_yellow_not_shared', false
- end
- return path, blink
- end
- function getEmblemImagePath(emblemId)
- local path
- if emblemId == EmblemFire then
- path = '/images/game/emblems/emblem_fire'
- elseif emblemId == EmblemWater then
- path = '/images/game/emblems/emblem_water'
- elseif emblemId == EmblemAir then
- path = '/images/game/emblems/emblem_air'
- elseif emblemId == EmblemEarth then
- path = '/images/game/emblems/emblem_earth'
- end
- return path
- end
- function Creature:onSkullChange(skullId)
- local imagePath = getSkullImagePath(skullId)
- if imagePath then
- self:setSkullTexture(imagePath)
- end
- end
- function Creature:onShieldChange(shieldId)
- local imagePath, blink = getShieldImagePathAndBlink(shieldId)
- if imagePath then
- self:setShieldTexture(imagePath, blink)
- end
- end
- function Creature:onEmblemChange(emblemId)
- if self:isLocalPlayer() and modules.client_options.getOption('showSelfEmblem') == false then
- return true
- end
- local imagePath = getEmblemImagePath(emblemId)
- if imagePath then
- self:setEmblemTexture(imagePath)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement