Postado Setembro 6, 2020 4 anos Autor 6 horas atrás, WooX disse: Não testado. --<event type="cast" name="blockSpell" event="script" value="block_spell.lua"/> function onCast(cid) if isPlayer(cid) and getPlayerStorageValue(cid, 4570) > os.time() then local delay = getPlayerStorageValue(cid, 4570) - os.time() addEvent(function() if isPlayer(cid) then unregisterCreatureEvent(cid, "blockSpell") end end, delay * 1000) return false end return true end --[[ <instant name="Block Spell" words="petrificus totalus" lvl="50" mana="200" range="3" blockwalls="1" needtarget="1" exhaustion="2000" needlearn="0" event="script" value="block_spell.lua"> <vocation id="1"/> <vocation id="2"/> </instant> ]] local config = { blockTime = 5, -- Segundos affectPlayersOnly = true } local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_FIREATTACK) setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_FIRE) function onCastSpell(cid, var) local target = isPlayer(var.number) and var.number or getCreatureTarget(cid) if config.playersOnly and not isPlayer(target) then doPlayerSendCancel(cid, "Somente jogadores sao afetados por essa spell.") return true end setPlayerStorageValue(target, 4570, os.time() + config.blockTime) registerCreatureEvent(target, "blockSpell") return doCombat(cid, combat, var) end Fiz o teste aqui, nenhum erro na distro, mas nao esta bloqueando as magias, o target consegue usar spells normalmente apos ser afetado pelo blockspell (Utilizo otx 2 8.60)
Postado Setembro 6, 2020 4 anos 11 horas atrás, .HuRRiKaNe disse: (Utilizo otx 2 8.60) https://github.com/mattyx14/otxserver/commit/3b10aedeac0a49e5538a3343873d52967b97835a Nós somos aquilo que fazemos repetidamente. Excelência, não é um modo de agir, mas um hábito. Aristóteles
Postado Junho 30, 2022 2 anos Eu tenho spells de block e chamada de "Silence" como o amigo ali encima falou, tenho 6 vidas de danzou entre outras!
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.