Ir para conteúdo

Featured Replies

Postado

Preciso que quando o player usar a spell aconteça isso junto com o combat:

Spoiler

function onCastSpell(cid, var)
local Target = getCreatureTarget(cid)
local Pos = getCreaturePosition(Target)
doTeleportThing(cid,Pos)
    doCombat(cid, combat, var)
end

Spell:

Spoiler

local config = {
mana = 0,
seconds = 10,
storage = 10,
semMana = "Você não tem mana suficiente.",
msg = "Você precisa aguardar %d segundos para usar essa magia novamente.",
}

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, 6)  
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 0, -3000, 0, -6000)

 

function onCastSpell(cid, var)
  if getPlayerStorageValue(cid, config.storage) == -1 then
    setPlayerStorageValue(cid, config.storage, os.time()-config.seconds)
  end
  if config.seconds-(os.time()-getPlayerStorageValue(cid, config.storage)) > 0 then
    doPlayerSendCancel(cid, string.format(config.msg, config.seconds-(os.time()-getPlayerStorageValue(cid, config.storage))))
    return true
  end
  if getPlayerMana(cid) >= config.mana then
    doPlayerAddMana(cid, -config.mana)
    setPlayerStorageValue(cid, config.storage, os.time())
    addEvent(doCombat, 0, cid, combat, var)
  else
    doPlayerSendCancel(cid, config.semMana)
              doSendMagicEffect(getPlayerPosition(cid),2)
  end
  return true
end

 

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

TRABALHOS

 

 

[iTEM.XML] Ancient Helmt dar HP e Duration: http://www.tibiaking.com/forum/topic/35010-itemxml-helmet-dar-vida-e-duration/

 

[CreatureScripts] OwNeD ao character morrerhttp://www.tibiaking.com/forum/topic/35733-creaturescripta-owned-quando-morrer/

 

Postado
local config = {
mana = 0,
seconds = 10,
storage = 10,
semMana = "Você não tem mana suficiente.",
msg = "Você precisa aguardar %d segundos para usar essa magia novamente.",
}

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, 6)  
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 0, -3000, 0, -6000)

 

function onCastSpell(cid, var)
  if getPlayerStorageValue(cid, config.storage) == -1 then
    setPlayerStorageValue(cid, config.storage, os.time()-config.seconds)
  end
  if config.seconds-(os.time()-getPlayerStorageValue(cid, config.storage)) > 0 then
    doPlayerSendCancel(cid, string.format(config.msg, config.seconds-(os.time()-getPlayerStorageValue(cid, config.storage))))
    return true
  end
  if getPlayerMana(cid) >= config.mana then
    doPlayerAddMana(cid, -config.mana)
    setPlayerStorageValue(cid, config.storage, os.time())
    local Target = getCreatureTarget(cid)
    local Pos = getCreaturePosition(Target)
    doTeleportThing(cid,Pos)
    addEvent(doCombat, 0, cid, combat, var)
  else
    doPlayerSendCancel(cid, config.semMana)
    doSendMagicEffect(getPlayerPosition(cid),2)
  end
  return true
end

 

                                                                     Ajudei? De nada \o/                                            Att Rusherzin

Postado
  • Autor

PERFEITO! REP+

TRABALHOS

 

 

[iTEM.XML] Ancient Helmt dar HP e Duration: http://www.tibiaking.com/forum/topic/35010-itemxml-helmet-dar-vida-e-duration/

 

[CreatureScripts] OwNeD ao character morrerhttp://www.tibiaking.com/forum/topic/35733-creaturescripta-owned-quando-morrer/

 

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.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo