Ir para conteúdo
Banner com Efeitos

Featured Replies

Postado

opa e ai galera , alguem pode me ajudar

fiz  2 spells que trocam outfit , porém gostaria que ao usar uma e em seguida usar a outra seria cancelado os seus addEvents do functiononcastspell da primeira magia.

usei storages mas não consegui , help

 

 

 

primeira magia :

Spoiler

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, 50)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1, -10, -1, -20, 5, 5, 1.4, 2.1)

local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 61)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -1, -10, -1, -20, 5, 5, 1.4, 2.1)

function outfit1(cid)
storage = 60100 -- coloque o storage aqui
if isCreature(cid) then
if getPlayerStorageValue(cid, storage) == 60100 then
doSetCreatureOutfit (cid, {lookType = 193}, 1000)
else
return true
end
end
end

function outfit2(cid)
storage = 60100 -- coloque o storage aqui
if isCreature(cid) then
if getPlayerStorageValue(cid, storage) == 60100 then
doSetCreatureOutfit (cid, {lookType = 194}, 1000)
else
return true
end
end
end

function outfit3(cid)
storage = 60100 -- coloque o storage aqui
if isCreature(cid) then
if getPlayerStorageValue(cid, storage) == 60100 then
doSetCreatureOutfit (cid, {lookType = 195}, 1000)
else
return true
end
end
end

function outfit4(cid)
storage = 60100 -- coloque o storage aqui
if isCreature(cid) then
if getPlayerStorageValue(cid, storage) == 60100 then
doSetCreatureOutfit (cid, {lookType = 193}, 1000)
else
return true
end
end
end

function outfit5(cid)
storage = 60100 -- coloque o storage aqui
if isCreature(cid) then
if getPlayerStorageValue(cid, storage) == 60100 then
doSetCreatureOutfit (cid, {lookType = 191}, 1000)
else
return true
end
end
end

 

function onCastSpell(cid, var)
setPlayerStorageValue(cid, 60100, 60100)
setPlayerStorageValue(cid, 1, 60100)
addEvent(outfit1, 100, cid)
addEvent(outfit2, 150, cid)
addEvent(outfit3, 250, cid)
addEvent(outfit4, 500, cid)
addEvent(outfit5, 800, cid)
    
end

 

 

segunda :

Spoiler

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, 50)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1, -10, -1, -20, 5, 5, 1.4, 2.1)

local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 61)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -1, -10, -1, -20, 5, 5, 1.4, 2.1)

function punchsouth1(cid)
storage = 50100 -- coloque o storage aqui
if isCreature(cid) then
if getPlayerStorageValue(cid, storage) == 50100 then
doSetCreatureOutfit (cid, {lookType = 205}, 1000)
else
return true
end
end
end

function punchsouth2(cid)
storage = 50100 -- coloque o storage aqui
if isCreature(cid) then
if getPlayerStorageValue(cid, storage) == 50100 then
doSetCreatureOutfit (cid, {lookType = 206}, 1000)
else
return true
end
end
end

function punchsouth3(cid)
storage = 50100 -- coloque o storage aqui
if isCreature(cid) then
if getPlayerStorageValue(cid, storage) == 50100 then
doSetCreatureOutfit (cid, {lookType = 207}, 1000)
else
return true
end
end
end

function punchsouth4(cid)
storage = 50100 -- coloque o storage aqui
if isCreature(cid) then
if getPlayerStorageValue(cid, storage) == 50100 then
doSetCreatureOutfit (cid, {lookType = 205}, 1000)
else
return true
end
end
end

function punchsouth5(cid)
storage = 50100 -- coloque o storage aqui
if isCreature(cid) then
if getPlayerStorageValue(cid, storage) == 50100 then
doSetCreatureOutfit (cid, {lookType = 191}, 1000)
else
return true
end
end
end

 

function onCastSpell(cid, var)
setPlayerStorageValue(cid, 50100, 50100)
addEvent(punchsouth1, 100, cid)
addEvent(punchsouth2, 150, cid)
addEvent(punchsouth3, 250, cid)
addEvent(punchsouth4, 950, cid)
addEvent(punchsouth5, 1050, cid)
    
end

 

  • 2 weeks later...
Postado

Aqui no TibiaKing mensagens como UP e BUMP são proibidas, utilize o botão subir este tópico. Esta é uma mensagem automática!
Pedimos que leia as regras do fórum!

Spoiler

Here in TibiaKing messages like UP and BUMP are prohibited, use the button raise this topic. This is an automated message!
Please read the forum rules.

 

Postado

A primeira

Spoiler

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, 50)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1, -10, -1, -20, 5, 5, 1.4, 2.1)

local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 61)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -1, -10, -1, -20, 5, 5, 1.4, 2.1)

function outfit1(cid)
storage = 60100 -- coloque o storage aqui
if isCreature(cid) then
if getPlayerStorageValue(cid, storage) == 60100 then
doSetCreatureOutfit (cid, {lookType = 193}, 1000)
else
return true
end
end
end

function outfit2(cid)
storage = 60100 -- coloque o storage aqui
if isCreature(cid) then
if getPlayerStorageValue(cid, storage) == 60100 then
doSetCreatureOutfit (cid, {lookType = 194}, 1000)
else
return true
end
end
end

function outfit3(cid)
storage = 60100 -- coloque o storage aqui
if isCreature(cid) then
if getPlayerStorageValue(cid, storage) == 60100 then
doSetCreatureOutfit (cid, {lookType = 195}, 1000)
else
return true
end
end
end

function outfit4(cid)
storage = 60100 -- coloque o storage aqui
if isCreature(cid) then
if getPlayerStorageValue(cid, storage) == 60100 then
doSetCreatureOutfit (cid, {lookType = 193}, 1000)
else
return true
end
end
end

function outfit5(cid)
storage = 60100 -- coloque o storage aqui
if isCreature(cid) then
if getPlayerStorageValue(cid, storage) == 60100 then
doSetCreatureOutfit (cid, {lookType = 191}, 1000)
else
return true
end
end
end

 

function onCastSpell(cid, var)
    setPlayerStorageValue(cid, 60100, 60100)
    setPlayerStorageValue(cid, 1, 60100)
    addEvent(outfit1, 100, cid)
    addEvent(outfit2, 150, cid)
    addEvent(outfit3, 250, cid)
    addEvent(outfit4, 500, cid)
    addEvent(outfit5, 800, cid)


    stopEvent(punchsouth1)
    stopEvent(punchsouth2)
    stopEvent(punchsouth3)
    stopEvent(punchsouth4)
    stopEvent(punchsouth5)
end


A segunda

Spoiler

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, 50)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1, -10, -1, -20, 5, 5, 1.4, 2.1)

local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 61)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -1, -10, -1, -20, 5, 5, 1.4, 2.1)

function punchsouth1(cid)
storage = 50100 -- coloque o storage aqui
if isCreature(cid) then
if getPlayerStorageValue(cid, storage) == 50100 then
doSetCreatureOutfit (cid, {lookType = 205}, 1000)
else
return true
end
end
end

function punchsouth2(cid)
storage = 50100 -- coloque o storage aqui
if isCreature(cid) then
if getPlayerStorageValue(cid, storage) == 50100 then
doSetCreatureOutfit (cid, {lookType = 206}, 1000)
else
return true
end
end
end

function punchsouth3(cid)
storage = 50100 -- coloque o storage aqui
if isCreature(cid) then
if getPlayerStorageValue(cid, storage) == 50100 then
doSetCreatureOutfit (cid, {lookType = 207}, 1000)
else
return true
end
end
end

function punchsouth4(cid)
storage = 50100 -- coloque o storage aqui
if isCreature(cid) then
if getPlayerStorageValue(cid, storage) == 50100 then
doSetCreatureOutfit (cid, {lookType = 205}, 1000)
else
return true
end
end
end

function punchsouth5(cid)
storage = 50100 -- coloque o storage aqui
if isCreature(cid) then
if getPlayerStorageValue(cid, storage) == 50100 then
doSetCreatureOutfit (cid, {lookType = 191}, 1000)
else
return true
end
end
end

 

function onCastSpell(cid, var)
    setPlayerStorageValue(cid, 50100, 50100)
    addEvent(punchsouth1, 100, cid)
    addEvent(punchsouth2, 150, cid)
    addEvent(punchsouth3, 250, cid)
    addEvent(punchsouth4, 950, cid)
    addEvent(punchsouth5, 1050, cid)

 

    stopEvent(outfit1)
    stopEvent(outfit2)
    stopEvent(outfit3)
    stopEvent(outfit4)
    stopEvent(outfit5)
end


Testa ae
O que eu fiz foi adicionar a função stopEvent para parar o evento do outro script, pode adaptar do jeito que quiser, ainda n testei, mas deve funcionar

Editado por kiinho (veja o histórico de edições)

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.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo