-
Quem Está Navegando 0 membros estão online
- Nenhum usuário registrado visualizando esta página.
-
Conteúdo Similar
-
- 13 respostas
- 11557 visualizações
-
- 1 resposta
- 1114 visualizações
-
- 0 respostas
- 1519 visualizações
-
- 20 respostas
- 13429 visualizações
-
- 0 respostas
- 990 visualizações
-
Pergunta
JG6 44
Boa Noite, galera queria saber se tem como por a barra de spells para aparecer diferente tipo as spells do Shinobi Online vo por o spellbar.lua e spellbar.otui aqui em baixo quem conseguir me ajudar dow rep+ por uma semana
-- private variables
local SpellBarWindow = nil
local SpellBarButton = nil
Moves = {}
Moves.options = {}
currentOutfit = 1
-- public functions
function init()
g_keyboard.bindKeyDown('F1', function() SpellSkill('1') end)
g_keyboard.bindKeyDown('F2', function() SpellSkill('2') end)
g_keyboard.bindKeyDown('F3', function() SpellSkill('3') end)
g_keyboard.bindKeyDown('F4', function() SpellSkill('4') end)
g_keyboard.bindKeyDown('F5', function() SpellSkill('5') end)
connect(g_game, 'onTextMessage', Moves.getParametros)
connect(g_game, { onGameEnd = remove })
SpellBarButton = modules.client_topmenu.addRightGameToggleButton('SpellBarButton', tr('Spell Bar'), 'SpellBar', toggle)
SpellBarButton:setOn(false)
SpellBarWindow = g_ui.loadUI('SpellBar',modules.game_interface.getRightPanel())
SpellBarWindow:disableResize()
SpellBarWindow:setup()
Moves.options = g_settings.getNode('moves') or {}
end
function terminate()
disconnect(g_game, { onGameEnd = remove })
SpellBarWindow:destroy()
SpellBarButton:destroy()
end
function remove()
SpellBarWindow:hide()
SpellBarButton:setOn(false)
end
function toggle()
if SpellBarButton:isOn() then
SpellBarWindow:close()
SpellBarButton:setOn(false)
else
SpellBarWindow:open()
SpellBarButton:setOn(true)
end
end
function onMiniWindowClose()
SpellBarButton:setOn(false)
end
function updateProgressSpell(progressSpell, interval, init)
if init then
progressSpell:setPercent(0)
else
progressSpell:setPercent(progressSpell:getPercent() + 1)
end
if progressSpell:getPercent() < 100 then
scheduleEvent(function()updateProgressSpell(progressSpell, interval) end, interval)
end
if progressSpell:getPercent() >= 100 then
g_game.talk(spellText)
end
end
function SpellSkill(numeskill)
local spellText = ''
local Spell = ''
local GrpSpell = ''
local TimeSpell = 0
local player = g_game.getLocalPlayer()
if numeskill == '1' then
Spell = 'progressSpellAttack'
GrpSpell = 'groupIconAttack'
TimeSpell = 600
spellText = 'Exori'
level = 8
mana = 20
elseif numeskill == '2' then
Spell = 'progressSpellHealing'
GrpSpell = 'groupIconHealing'
TimeSpell = 150
spellText = 'Exura'
level = 8
mana = 20
elseif numeskill == '3' then
Spell = 'progressSpellSupport'
GrpSpell = 'groupIconSupport'
TimeSpell = 800
spellText = 'Exura Sio "Eduard Bean'
level = 8
mana = 20
elseif numeskill == '4' then
Spell = 'progressSpellSpecial'
GrpSpell = 'groupIconSpecial'
TimeSpell = 1200
spellText = 'Exori Gran'
level = 8
mana = 20
end
if player:getLevel() < level then return end
if player:getMana() < mana then return end
local groupRct = SpellBarWindow:recursiveGetChildById(GrpSpell)
if not groupRct:isEnabled() then
return
end
local progressSpell= SpellBarWindow:recursiveGetChildById(Spell)
if progressSpell:getPercent() < 100 then
return
end
updateProgressSpell(progressSpell, TimeSpell, true)
g_game.talk(spellText)
end
SpellGroupIcon < Button
width: 32
height: 32
image-size: 32 32
image-clip: 0 0 0 0
image-color: white
image-border: 2
focusable: false
margin-top: 3
$on hover:
color: #f55e5e
SpellProgressSpell < UIProgressRect
background: #585858AA
percent: 100
focusable: false
MiniWindow
id: cooldownWindow
!text: tr('Ataques Normais')
height: 65
width: 185
icon: SpellBar.png
@onClose: onMiniWindowClose()
&save: true
MiniWindowContents
SpellGroupIcon
id: groupIconAttack
image-source: moves_icon/Switch.png
anchors.top: parent.top
anchors.left: parent.left
margin-left: 5
SpellProgressSpell
id: progressSpellAttack
anchors.fill: groupIconAttack
!tooltip: tr('Switch')
@onClick: SpellSkill('1')
SpellGroupIcon
id: groupIconHealing
image-source: moves_icon/Heal.png
anchors.top: parent.top
anchors.left: groupIconAttack.right
margin-left: 5
SpellProgressSpell
id: progressSpellHealing
anchors.fill: groupIconHealing
!tooltip: tr('Healing')
@onClick: SpellSkill('2')
SpellGroupIcon
id: groupIconSupport
image-source: moves_icon/Support.png
anchors.top: parent.top
anchors.left: groupIconHealing.right
margin-left: 5
SpellProgressSpell
id: progressSpellSupport
anchors.fill: groupIconSupport
!tooltip: tr('Support')
@onClick: SpellSkill('3')
SpellGroupIcon
id: groupIconSpecial
image-source: moves_icon/Special.png
anchors.top: parent.top
anchors.left: groupIconSupport.right
margin-left: 5
SpellProgressSpell
id: progressSpellSpecial
anchors.fill: groupIconSpecial
!tooltip: tr('Special')
@onClick: SpellSkill('4')
Link para o comentário
Compartilhar em outros sites
8 respostass a esta questão
Posts Recomendados