Northnorial
Member
I found the two following scripts here on OtLand,
the first one is not showing the healing damage,
the second tho is showing the healing damage,
I could really use some explanation why the first one is and the second is not showing the healing damage.
Also I would like to know what numbers like if (n < 20) then or addEvent(regen, 250, cid, var, 0) do...
Thanks in advance!
the first one is not showing the healing damage,
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
local condition = createConditionObject(CONDITION_REGENERATION)
setConditionParam(condition, CONDITION_PARAM_BUFF_SPELL, true)
setConditionParam(condition, CONDITION_PARAM_TICKS, 1 * 60 * 1000)
setConditionParam(condition, CONDITION_PARAM_HEALTHGAIN, 500)
setConditionParam(condition, CONDITION_PARAM_HEALTHTICKS, 3000)
setCombatCondition(combat, condition)
local area = createCombatArea(AREA_CIRCLE3X3)
setCombatArea(combat, area)
function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end
the second tho is showing the healing damage,
Code:
healRegen = {}
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
local condition = createConditionObject(CONDITION_REGENERATION)
setConditionParam(condition, CONDITION_PARAM_SUBID, 1)
setConditionParam(condition, CONDITION_PARAM_BUFF_SPELL, true)
setCombatCondition(combat, condition)
local area = createCombatArea(AREA_CIRCLE3X3)
setCombatArea(combat, area)
function regen(cid,var,n)
n = n or 0
if isPlayer(cid) then
doCreatureAddHealth(cid, 20)
if (n < 20) then
healRegen[cid] = addEvent(regen, 3 * 1000, cid, var, n+1)
end
end
return true
end
function onCastSpell(cid, var)
if healRegen[cid] then
stopEvent(healRegen[cid])
end
doCombat(cid, combat, var)
healRegen[cid] = addEvent(regen, 250, cid, var, 0)
return true
end
I could really use some explanation why the first one is and the second is not showing the healing damage.
Also I would like to know what numbers like if (n < 20) then or addEvent(regen, 250, cid, var, 0) do...
Thanks in advance!