Ir para conteúdo

Featured Replies

Resolvido por Wise

Ir para solução
  • Respostas 6
  • Visualizações 508
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • local t = {time = 3, stor = 30303, stats = {30, 30}} -- time in minutes to cast again / storage / {health%, mana%} local hm = {} local combat = createCombatObject() setCombatParam(combat, COMBAT_PARA

Postado
  • Solução
local t = {time = 3, stor = 30303, stats = {30, 30}} -- time in minutes to cast again / storage / {health%, mana%}
local hm = {}

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)

local condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_TICKS, t.time*60000)
setConditionParam(condition, CONDITION_PARAM_STAT_MAXHEALTH, hm[1])
setConditionParam(condition, CONDITION_PARAM_STAT_MAXMANA, hm[2])
setCombatCondition(combat, condition)

function onCastSpell(cid, var)
    if getPlayerStorageValue(cid, t.stor) - os.time() > 0 then
        doPlayerSendCancel(cid, 'This spell can only be cast every '..t.time..' minutes.')
        return false
    end

    table.insert(hm, t.stats[1]*(getCreatureMaxHealth(cid)/100))
    table.insert(hm, t.stats[2]*(getCreatureMaxMana(cid)/100))
    return doCombat(cid, combat, var) and setPlayerStorageValue(cid, t.stor, os.time() + t.time*60)
end

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

The corrupt fear us.

The honest support us.

The heroic join us.

Postado
  • Autor
local time = 3 -- minutes
local stats = {30, 30} -- {health, mana} %

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)

local condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_TICKS, time*60000)
setConditionParam(condition, CONDITION_PARAM_STAT_MAXHEALTH, stats[1]*(getCreatureMaxHealth(cid)/100))
setConditionParam(condition, CONDITION_PARAM_STAT_MAXMANA, stats[2]*(getCreatureMaxMana(cid)/100))
setCombatCondition(combat, condition)

function onCastSpell(cid, var)
    return doCombat(cid, combat, var)
end

[17/12/2014 21:28:09] Lua Script Error: [spell Interface] 
[17/12/2014 21:28:09] data/spells/scripts/hp.lua
 
[17/12/2014 21:28:09] luaGetCreatureMaxHealth(). Creature not found
 
[17/12/2014 21:28:09] Lua Script Error: [spell Interface] 
[17/12/2014 21:28:09] data/spells/scripts/hp.lua
 
[17/12/2014 21:28:09] luaGetCreatureMaxMana(). Creature not found
[17/12/2014 21:28:10] Reloaded spells.

Porque deu esse error? OT e 8.4

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