Postado Agosto 31, 2014 10 anos Galera fiz um script baseado nese topico aki: http://www.tibiaking.com/forum/topic/8522-um-novo-modo-de-criar-magias/ ficou assim: local spell = { { damage = COMBAT_DEATHDAMAGE, -- O tipo de dano effect = {CONST_ME_MORTAREA}, -- Os efeitos da magia formula = {0.2, 3, 0.2, 4.2, 200, 300}, -- A formula de dano da magia area = createCombatArea({ -- Area da magia {0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0}, {0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0}, {0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0}, {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, {1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1}, {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, {0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0}, {0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0}, {0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}}) }, { damage = COMBAT_ENERGYDAMAGE, -- O tipo de dano effect = {CONST_ME_YELLOWENERGY}, -- Os efeitos da magia formula = {0.2, 3, 0.2, 4.2, 200, 300}, -- A formula de dano da magia area = createCombatArea({ -- Area da magia {0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0}, {0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0}, {0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0}, {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, {1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1}, {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, {0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0}, {0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0}, {0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}}) }, { damage = COMBAT_DEATHDAMAGE, -- O tipo de dano effect = {CONST_ME_MORTAREA}, -- Os efeitos da magia formula = {0.2, 3, 0.2, 4.2, 200, 300}, -- A formula de dano da magia area = createCombatArea({ -- Area da magia {0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0}, {0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0}, {0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0}, {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, {1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1}, {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, {0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0}, {0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0}, {0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}}) } } local returnSpell = {} for var, config in ipairs(spell) do returnSpell[var] = createCombatObject() setCombatParam(returnSpell[var], COMBAT_PARAM_TYPE, config.damage) setCombatParam(returnSpell[var], COMBAT_PARAM_EFFECT, (type(config.effect) == "table" and config.effect[1] or config.effect)) if type(config.effect) == "table" and config.effect[2] ~= nil then setCombatParam(returnSpell[var], COMBAT_PARAM_DISTANCEEFFECT, config.effect[2]) end if config.area then setCombatArea(returnSpell[var], config.area) end function getSpellDamage(cid, level, maglevel) local min = ((level*config.formula[1] + maglevel*config.formula[2]) + config.formula[5]) local max = ((level*config.formula[3] + maglevel*config.formula[4]) + config.formula[6]) return -min, -max end setCombatCallback(returnSpell[var], CALLBACK_PARAM_LEVELMAGICVALUE, "getSpellDamage") end function onCallCombat(parameters) return doCombat(unpack(parameters)) end function onCastSpell(cid, var) if #returnSpell > 1 then for i = 1, #returnSpell do addEvent(onCallCombat, (i*450)+15, {cid, returnSpell, var}) end else doCombat(cid, ret[1], var) end return true end mas como posso por cd na spell? Toda terça-feira um tópico novo: Descanso para curar mana (Spell): https://tibiaking.com/forums/topic/94615-spell-descanso-para-curar-mana/ Peça sua spell (Suporte): https://tibiaking.com/forums/topic/84162-peça-sua-spell/ Chuva de flechas (Spell): https://tibiaking.com/forums/topic/72232-chuva-de-flechas-spell/ Doom (Spell): https://tibiaking.com/forums/topic/51622-doom-spell/ Utilização do VS Code (Infra): https://tibiaking.com/forums/topic/94463-utilizando-o-visual-studio-code-notepad-nunca-mais/ SD com Combo (Spell): https://tibiaking.com/forums/topic/94520-sd-modificada/ Alteração attack speed (C++): https://tibiaking.com/forums/topic/94714-c-attack-speed-spells-itens-e-onde-você-quiser/ Bônus de Speed (NPC): https://tibiaking.com/forums/topic/94809-npc-concede-bônus-aos-players/
Postado Agosto 31, 2014 10 anos o cooldown fica na tag que vc adiciona no spells.xml.. é no exhaust "1000" onde 1000 é o tempo em milisegundos (1000 milisegundos = 1 segundo) Todos os meus trabalhos importantes estão na seção "Sobre mim" no meu perfil; Dá uma passada lá! "Há três caminhos para o fracasso: não ensinar o que se sabe, não praticar o que se ensina, e não perguntar o que se ignora." - São Beda (obg ao @Beeny por fazer essa linda sign <3)
Postado Setembro 1, 2014 10 anos Autor eu queria algo do tipo cd especifico para a spell, pois se eu por no spells.xml eu teria que esperar por exemplo 10seg pra usar qlqr spell ofensiva, eu queria um cd especifico para a spell Toda terça-feira um tópico novo: Descanso para curar mana (Spell): https://tibiaking.com/forums/topic/94615-spell-descanso-para-curar-mana/ Peça sua spell (Suporte): https://tibiaking.com/forums/topic/84162-peça-sua-spell/ Chuva de flechas (Spell): https://tibiaking.com/forums/topic/72232-chuva-de-flechas-spell/ Doom (Spell): https://tibiaking.com/forums/topic/51622-doom-spell/ Utilização do VS Code (Infra): https://tibiaking.com/forums/topic/94463-utilizando-o-visual-studio-code-notepad-nunca-mais/ SD com Combo (Spell): https://tibiaking.com/forums/topic/94520-sd-modificada/ Alteração attack speed (C++): https://tibiaking.com/forums/topic/94714-c-attack-speed-spells-itens-e-onde-você-quiser/ Bônus de Speed (NPC): https://tibiaking.com/forums/topic/94809-npc-concede-bônus-aos-players/
Postado Setembro 3, 2014 10 anos Autor up Toda terça-feira um tópico novo: Descanso para curar mana (Spell): https://tibiaking.com/forums/topic/94615-spell-descanso-para-curar-mana/ Peça sua spell (Suporte): https://tibiaking.com/forums/topic/84162-peça-sua-spell/ Chuva de flechas (Spell): https://tibiaking.com/forums/topic/72232-chuva-de-flechas-spell/ Doom (Spell): https://tibiaking.com/forums/topic/51622-doom-spell/ Utilização do VS Code (Infra): https://tibiaking.com/forums/topic/94463-utilizando-o-visual-studio-code-notepad-nunca-mais/ SD com Combo (Spell): https://tibiaking.com/forums/topic/94520-sd-modificada/ Alteração attack speed (C++): https://tibiaking.com/forums/topic/94714-c-attack-speed-spells-itens-e-onde-você-quiser/ Bônus de Speed (NPC): https://tibiaking.com/forums/topic/94809-npc-concede-bônus-aos-players/
Postado Setembro 6, 2014 10 anos Solução troca essa parte function onCastSpell(cid, var)if #returnSpell > 1 thenfor i = 1, #returnSpell doaddEvent(onCallCombat, (i*450)+15, {cid, returnSpell, var})endelsedoCombat(cid, ret[1], var)endreturn trueend por local cooldown = 10 function onCastSpell(cid, var) if os.time() - getPlayerStorageValue(cid, 19329) >= cooldown then doPlayerSetStorageValue(cid, 19329, os.time()) if #returnSpell > 1 then for i = 1, #returnSpell do addEvent(onCallCombat, (i*450)+15, {cid, returnSpell[i], var}) end else doCombat(cid, ret[1], var) end else doPlayerSendCancel(cid, "Your skill is in cooldown, you must wait "..(cooldown - (os.time() - getPlayerStorageValue(cid, 19329))).." seconds.") return false end return true end Todos os meus trabalhos importantes estão na seção "Sobre mim" no meu perfil; Dá uma passada lá! "Há três caminhos para o fracasso: não ensinar o que se sabe, não praticar o que se ensina, e não perguntar o que se ignora." - São Beda (obg ao @Beeny por fazer essa linda sign <3)
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.