GA
dúvida

Manarune Por Lvl & Ml / Mana E Life.

Por gahgah, 28 de jun. de 2012 em Scripts

7
960
gahgahG
28 de junho de 2012 às 09:58

RESOLVIDO.

Editado Junho 28 por gahgah

jhon992J
28 de junho de 2012 às 10:32
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_POISON)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)

local removeRune = true -- (true/false)

function onCastSpell(cid, var)
if removeRune then
   doPlayerRemoveItem(cid, itemid, 1) -- põe o id da rune ali em itemid
end
local heal = hitLevelMl(cid, 0.5) -- 0.5, será a base do hit você pode alterar e ir testando
doPlayerAddMana(cid, heal)
doCreatureAddHealth(cid, heal)
return doCombat(cid, combat, var)
end

function hitLevelMl(cid, base)
local heal = (getPlayerLevel(cid)*base + getPlayerMagLevel(cid)*base + math.random(1,25))
return heal
end

gahgahG
28 de junho de 2012 às 11:05

Perfeito, so nao esta removendo a Runa apos o uso.

jhon992J
28 de junho de 2012 às 11:24

Colocase o id da runa e não apareceu erro nenhum? o.O Era pra ta removendo então. Mais testa assim, sem o controlador lógico:

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_POISON)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)

local removeRune = "true" -- (true/false)

function onCastSpell(cid, var)
if removeRune == "true" then
   doPlayerRemoveItem(cid, itemid, 1) -- põe o id da rune ali em itemid
end
local heal = hitLevelMl(cid, 0.5) -- 0.5, será a base do hit você pode alterar e ir testando
doPlayerAddMana(cid, heal)
doCreatureAddHealth(cid, heal)
return doCombat(cid, combat, var)
end

function hitLevelMl(cid, base)
local heal = (getPlayerLevel(cid)*base + getPlayerMagLevel(cid)*base + math.random(1,25))
return heal
end

gahgahG
28 de junho de 2012 às 11:42

Agora deu certo.. mto obrigado, como sempre +REP

Editado Junho 28 por gahgah

saulosS
28 de junho de 2012 às 20:48

tópico reportado

VildenV
29 de junho de 2012 às 03:26

Dúvida sanada, movido.