Postado Setembro 3, 2020 4 anos 1 hora atrás, WooX disse: Não é necessário, da pra fazer utilizando o callback onTargetCreature. Fiz com base na spell "exevo gran mas vis" do Tibia, os parâmetros da spell podem ser alterados. --[[ <instant name="Remove Target" words="gtfo" lvl="55" mana="650" selftarget="1" prem="0" exhaustion="1800" needlearn="0" event="script" value="support/remove_target.lua"> <vocation id="1"/> <vocation id="5"/> </instant> ]] local config = { blockTarget = true, blockTime = 5, -- Segundos affectAllies = false, affectTargetCasterOnly = false -- Se marcado como true ira remover o target somente de quem estiver atacando o usuario da spell } local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_BIGCLOUDS) setAttackFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 8, 5, 7, 11) function onTargetCreature(cid, target) if config.affectTargetCasterOnly and getCreatureTarget(target) ~= cid then return false end if not config.affectAllies then local partyMembers = getPartyMembers(cid) if getPlayerGuildId(cid) == getPlayerGuildId(target) or isInArray(partyMembers, target) then return false end end if config.blockTarget then setPlayerStorageValue(target, 234512, os.time() + config.blockTime) end --errors(false) doPlayerTargetCreature(target, target) --errors(true) return true end setCombatCallback(combat, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature") local area = createCombatArea(AREA_CROSS6X6) setCombatArea(combat, area) function onCastSpell(cid, var) return doCombat(cid, combat, var) end Testei aqui ele nao esta cancelando o target dos inimigos..
Postado Setembro 3, 2020 4 anos 6 minutos atrás, .HuRRiKaNe disse: Testei aqui ele nao esta cancelando o target dos inimigos.. Tem certeza? eu testei aqui e ta funcionando certinho, deu algum erro pra você? Nós somos aquilo que fazemos repetidamente. Excelência, não é um modo de agir, mas um hábito. Aristóteles
Postado Setembro 3, 2020 4 anos 2 minutos atrás, WooX disse: Tem certeza? eu testei aqui e ta funcionando certinho, deu algum erro pra você? Certeza absoluta, testei a do amigo que criou o tópico e ele cancela o próprio target ao invés do inimigo, a sua solta a spell tudo normal, não dá nenhum erro, mas não cancela o target..
Postado Setembro 3, 2020 4 anos 59 minutos atrás, .HuRRiKaNe disse: Certeza absoluta, testei a do amigo que criou o tópico e ele cancela o próprio target ao invés do inimigo, a sua solta a spell tudo normal, não dá nenhum erro, mas não cancela o target.. Certifique-se de que possui a função instalada na source. Ao realizar o teste, deixe uma arma no char que deve perder o target para ter certeza de que o ataque foi interrompido. Dependendo do client que estiver utilizando a marca do target não vai ser removida, essa parte é client-side. Nós somos aquilo que fazemos repetidamente. Excelência, não é um modo de agir, mas um hábito. Aristóteles
Postado Setembro 3, 2020 4 anos 3 horas atrás, WooX disse: Não é necessário, da pra fazer utilizando o callback onTargetCreature. Fiz com base na spell "exevo gran mas vis" do Tibia, os parâmetros da spell podem ser alterados. --[[ <instant name="Remove Target" words="gtfo" lvl="55" mana="650" selftarget="1" prem="0" exhaustion="1800" needlearn="0" event="script" value="support/remove_target.lua"> <vocation id="1"/> <vocation id="5"/> </instant> ]] local config = { blockTarget = true, blockTime = 5, -- Segundos affectAllies = false, affectTargetCasterOnly = false -- Se marcado como true ira remover o target somente de quem estiver atacando o usuario da spell } local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_BIGCLOUDS) setAttackFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 8, 5, 7, 11) function onTargetCreature(cid, target) if config.affectTargetCasterOnly and getCreatureTarget(target) ~= cid then return false end if not config.affectAllies then local partyMembers = getPartyMembers(cid) if getPlayerGuildId(cid) == getPlayerGuildId(target) or isInArray(partyMembers, target) then return false end end if config.blockTarget then setPlayerStorageValue(target, 234512, os.time() + config.blockTime) end --errors(false) doPlayerTargetCreature(target, target) --errors(true) return true end setCombatCallback(combat, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature") local area = createCombatArea(AREA_CROSS6X6) setCombatArea(combat, area) function onCastSpell(cid, var) return doCombat(cid, combat, var) end Testei aqui e nao funcionou tambem nao.
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.