Ir para conteúdo

Líderes

Conteúdo Popular

Exibindo conteúdo com a maior reputação em 11/27/17 em todas áreas

  1. garep

    Spell's bar por voc

    Muita gente falando e pedindo spell's bar por voc e n tem opcode instalado e não sabe como instala ai vai um script, com ele da pra fazer vários.... Script: Client > local spelllist = { ['Death Strike'] = {id = 87, words = 'exori mort', exhaustion = 2000, premium = true, type = 'Instant', icon = 'deathstrike', mana = 20, level = 16, soul = 0, group = {[1] = 2000}, vocations = {1, 5}}, ['Flame Strike'] = {id = 89, words = 'exori flam', exhaustion = 2000, premium = true, type = 'Instant', icon = 'flamestrike', mana = 20, level = 14, soul = 0, group = {[1] = 2000}, vocations = {1, 2, 5, 6}}, ['Strong Flame Strike'] = {id = 150, words = 'exori gran flam', exhaustion = 8000, premium = true, type = 'Instant', icon = 'strongflamestrike', mana = 60, level = 70, soul = 0, group = {[1] = 2000, [4] = 8000}, vocations = {1, 5}}, } local VOCID = 1 local spells = {} local lado = 'vertical' local sbw -- window widget local sbb -- button ./\ widget local spellBarWindow -- UIWindow local exhsaustionTotal = 1100 local hideLevel = false -- os que nao tem level, vai mostrar? true = nao, false = sim function init() sbb = modules.client_topmenu.addRightGameToggleButton('sbb', 'Spell Bar' , 'SpellBar.png', toggle) sbb:setWidth(16) sbw = g_ui.displayUI('SpellBar') sbw:move(10,50) g_mouse.bindPress(sbw, function() createMenu() end, MouseRightButton) sbw:hide() connect(g_game, 'onTalk', mensagemEnviada) connect(g_game, { onGameEnd = function() sbw:hide() sbb:setOn(false) end }) connect(LocalPlayer, { onLevelChange = onLevelChange }) connect(g_game, 'onTextMessage', getVocation) for inst,values in pairs(spelllist) do if values.type == 'Instant' then -- depois vou fazer mais tipos.. if g_game.getProtocolVersion() >= 950 then -- Vocation is only send in newer clients if table.find(values.vocations, g_game.getLocalPlayer():getVocation()) then local inside = {instantName = inst, words = values.words, lvl = values.level, mana = values.mana, prem = values.premium, groups = values.group,icon = values.icon, vocations = values.vocations,exhaustion = values.exhaustion} table.insert(spells,inside) end else local inside = {instantName = inst, words = values.words, lvl = values.level, mana = values.mana, prem = values.premium, groups = values.group,icon = values.icon, vocations = values.vocations,exhaustion = values.exhaustion} table.insert(spells,inside) end end end table.sort(spells, function(a, b) return (a.lvl < b.lvl) end) end function onLevelChange(localPlayer, value, percent) getSpells(spells) end function mensagemEnviada(name, level, mode, text, channelId, pos) if not g_game.isOnline() then return end if g_game.getLocalPlayer():getName() ~= name then return end for i = 1,#spells do if spells[i].words:lower() == text:lower() then startDownDelay(i) break end end end function terminate() sbw:destroy() sbb:destroy() disconnect(g_game, { onGameEnd = function() sbw:hide() sbb:setOn(false) end }) disconnect(g_game, 'onTalk', mensagemEnviada) disconnect(LocalPlayer, { onLevelChange = onLevelChange }) disconnect(g_game, 'onTextMessage', getVocation) end function getVocation(mode, text) local t = string.explode(text, " ") if not g_game.isOnline() then return end if mode == MessageModes.Failure then if text:find("#getVoc#") then if tonumber(t[2]) == VOCID then sbb:setOn(true) sbb:show() sbw:show() getSpells(spells) level = g_game.getLocalPlayer():getLevel() else sbb:setOn(false) sbb:hide() sbw:hide() end end end end function toggle() if sbb:isOn() then sbw:hide() sbb:setOn(false) else sbw:show() getSpells(spells) sbb:setOn(true) level = g_game.getLocalPlayer():getLevel() end end function createMenu() local menu = g_ui.createWidget('PopupMenu') if lado == 'horizontal' then menu:addOption('Set Vertical', function() lado = 'vertical' getSpells(spells) end) else menu:addOption('Set Horizontal',function() lado = 'horizontal' getSpells(spells) end) end if hideLevel == false then menu:addOption('No Level Hide',function() hideLevel = true getSpells(spells) end) else menu:addOption('No Level Show',function() hideLevel = false getSpells(spells) end) end menu:display() end function destruirSpells() for i = 1,100 do if sbw:recursiveGetChildById('spell'..i) == nil then break end sbw:recursiveGetChildById('spell'..i):destroy() sbw:recursiveGetChildById('progress'..i):destroy() end end function getSpells(tabela) destruirSpells() spellBarWindow = sbw:recursiveGetChildById('mainWindow') local player = g_game.getLocalPlayer() local valor = #tabela local width = 38 local height = 38 if not player then return end for i = 1,#tabela do if (tabela[i].lvl > player:getLevel()) and hideLevel == true then valor = i - 1 break end if i == #tabela then valor = i end icon = g_ui.createWidget('SpellButton',spellBarWindow) progress = g_ui.createWidget('SpellProgressSpell',spellBarWindow) --icon: icon:setId('spell'..i) local spicon = Spells.getClientId(tabela[i].instantName) icon:setImageSource('/images/game/spells/defaultspells') icon:setImageClip((((spicon -1)%12)*32) .. ' ' .. ((math.ceil(spicon/12)-1)*32) .. ' 32 32') icon:setVisible(true) icon.words = tabela[i].words icon.instantName = tabela[i].instantName icon.lvl = tabela[i].lvl icon.mana = tabela[i].mana icon.exhaustion = tabela[i].exhaustion icon.exhaustionNeeded = 0 icon:setTooltip(tabela[i].words) if lado == 'horizontal' then icon:setMarginTop(3) height = 38 width = (i) * 32 + 2*(i) icon:setMarginLeft((i) * 32 + 2*(i) - 32) else icon:setMarginLeft(3) icon:setMarginTop((i) * 32 + 2*(i) - 32) width = 38 height = (i) * 32 + 2*(i) end --progress: progress:setId('progress'..i) progress:setVisible(true) progress:setPercent(100) progress:setMarginLeft(icon:getMarginLeft()) progress:setMarginTop(icon:getMarginTop()) if player:getLevel() < icon.lvl then progress:setText('L'..icon.lvl) progress:setColor('red') progress:setPercent(0) end if progress:getPercent() == 100 then progress:setText('OK') elseif icon.lvl < player:getLevel() then progress:setText(progress:getPercent()) end progress:setPhantom(true) icon.onClick = function() useSpell(i) end end sbw:setHeight(height) sbw:setWidth(width) spellBarWindow:setSize(sbw:getSize()) end function useSpell(i) local spell = sbw:recursiveGetChildById('spell'..i) if not spell then return end local progress = sbw:recursiveGetChildById('progress'..i) local player = g_game.getLocalPlayer() if not player then return end if progress:getPercent() < 100 then return modules.game_textmessage.displayFailureMessage('Wait your delay!') end g_game.talk(spell.words) end function startDownDelay(i) -- aqui vai ficar on onTalk, pra descer só realmente quando a spell sair local spell = sbw:recursiveGetChildById('spell'..i) if not spell then return end local progress = sbw:recursiveGetChildById('progress'..i) progress:setPercent(0) progress:setText('0%') progress:setColor('red') spell.exhaustionNeeded = 0 scheduleEvent(function() spellTimeleft(i) end,100) end function spellTimeleft(i) local spell = sbw:recursiveGetChildById('spell'..i) if not spell then return end local progress = sbw:recursiveGetChildById('progress'..i) spell.exhaustionNeeded = spell.exhaustionNeeded + 100 if spell.exhaustionNeeded < spell.exhaustion then progress:setPercent(math.ceil(((spell.exhaustionNeeded) * 100)/spell.exhaustion)) progress:setText(progress:getPercent()) progress:setColor('red') else progress:setPercent(100) progress:setText('OK') progress:setColor('green') spell.exhaustionNeeded = 0 return true end scheduleEvent(function() spellTimeleft(i) end,100) end vocID > id da voc, que vai aparecer as spells que no script, exp: kina voc 4 vocID 4 no script deixa so as spells de kina vocID 1 no scirpt deixa so as spells de sorc no serve agora otserv>data>talkactions function onSay(cid, words, param) if not param then return true end doPlayerSendCancel(cid, "#getVoc# ".. getPlayerVocation(cid)) return true end tag: tipo ser for criar spells pra mais voc, tipo 1mod pra cada voc... espero que tenha ficado facil... O script ta bem primitivo mais ja é um lado ai pra quem não tem.... Creditos: DrakyLucas, pois peguei seu mode como base.. Noninhouh. +reps se ajudo... ,
    1 ponto
  2. Thbr

    PxC | Estamos de volta!

    PxC Estamos de volta! Nova Página: https://www.facebook.com/BestPxC/ Novo Discord: https://discord.gg/bceuFgr Em Dezembro...
    1 ponto
Líderes está configurado para São Paulo/GMT-03:00
×
×
  • Criar Novo...