BA

Mostre seu poder

Por BananaFight, 09 de abr. de 2013 em Clients

otserv
tibia
script
32
8.1k
akira021A
22 de abril de 2013 às 19:35

Tem como colocar pras spells irem por valor storage? dividir elas por storage, soh a vocation X pode usa-la se tiver o X storage, isso eh com opcode neh?

 

opcode funciona com a versão 8.6?

 

vlw

BananaFightB
22 de abril de 2013 às 19:42

Sim, Opcode funciona com qualquer versão.

akira021A
22 de abril de 2013 às 20:04

com qualquer versão? eu vi num post o kra dizendo que nao pega na 8.54 pois no arquivo const.h nao consta os arquivos que eh para colocar la, e eu uso a 8.54 e procurei e realmente nao consta, Banana vc sabe dizer se da pra usar na 8.54, se tem algum tutorial explicando isso?

 

Vlw

BananaFightB
23 de abril de 2013 às 00:57

Funciona, mais tem que adaptar...

TheSourceT
23 de abril de 2013 às 17:50

Quando vou criar um novo botão está dando erro...

 

 

 

Spell bar.otui

 

 

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('Spells')
 height: 65
 width: 250
 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')

SpellGroupIcon
  id: botaocinco
  image-source: moves_icon/Heall.png
  anchors.top: parent.top
  anchors.left: parent.left
  margin-left: 5

SpellProgressSpell
  id: magiacinco
  anchors.fill: groupIconAttack
  !tooltip: tr('Heal Maior')
  @onClick: SpellSkill('5')

 

 

 

 

SpellBar.lua

 

 

-- 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
 elseif numeskill == '5' then
Spell = 'magiacinco'
GrpSpell = 'botaocinco'
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

 

 

 

 

o arquivo ot ui parece estar bagunçado no final mais no notepad ++ ta bem alinhado como akeles tutoriais... falando que se nao tiver não funciona.

Editado Abril 23 por TheSource

BananaFightB
23 de abril de 2013 às 20:56

Qual erro avisa. ?

TheSourceT
23 de abril de 2013 às 22:16

o modulo pega normal so usando as 4 spells que tem quando tento por a 5 ele não abre mais.

1 mês depois...
KaboFlow29K
01 de maio de 2013 às 05:26
thump_8413435dibujo.jpg
BananaFightB
01 de maio de 2013 às 05:44

Acabei de testar e nem um desses erros foram causados pelos arquivos referentes a esse tópico.

 

E para quem ainda não conseguiu adicionar um novo spells, Um mini tutorial :

 

SpellBar.Lua

 

Ao final de

 

  elseif numeskill == '4' then
Spell = 'progressSpellSpecial'
GrpSpell = 'groupIconSpecial'
TimeSpell = 1200
spellText = 'Exori Gran'
level = 8
mana = 20

 

Você vai adicionar um novo

 

  elseif numeskill == '5' then
Spell = 'progressSpellSpecial2'
GrpSpell = 'groupIconSpecial2'
TimeSpell = 1200
spellText = 'Novo Spell'
level = 1
mana = 0

 

Agora na parte SpellBar.otui você vai no final e adiciona 2 novos itens, Como no Exemplo

 

	SpellGroupIcon
  id: groupIconSpecial2
  image-source: moves_icon/Special.png
  anchors.top: parent.top
  anchors.left: groupIconSpecial.right
  margin-left: 5

SpellProgressSpell
  id: progressSpellSpecial2
  anchors.fill: groupIconSpecial2
  !tooltip: tr('Special2')
  @onClick: SpellSkill('5')

 

E pronto acabou...

Editado Maio 1 por BananaFight

3 semanas depois...
DasdorD
16 de maio de 2013 às 20:42
asdasdsadsadsad.png
1 mês depois...
rohfagundesR
24 de junho de 2013 às 12:02

como colocar pra aparecer o level na spell

caso o player n tenha o level pra usar?

1 mês depois...
raynerhardR
19 de julho de 2013 às 01:41

Coloquei em mods, e como ativa isso agora?

1 mês depois...
WatersonW
01 de agosto de 2013 às 15:50

Olha, achei muito top, a spell bar e talz, só que não sei se tem como arrumar porém se eu uso a spell, e vms supor precisa de target a spell e eu usar normalmente ele buga como se eu tivesse usado entende? Tem como arrumar?

1 mês depois...
uriel70U
10 de setembro de 2013 às 09:34

E como colocar pra cara vocação abrir uma barra diferente ?

2 semanas depois...
vvdda91V
23 de setembro de 2013 às 01:09

Muito útil! Parabéns! Fica aí meu positivo.