• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Solved Problem with spell

Hindori

New Member
Joined
Jan 24, 2009
Messages
157
Reaction score
2
LUA:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_GRASSDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, 91)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1, -10, -1, -20, 5, 5, 1.4, 2.1)

function onCastSpell(cid, var)
local hp = GetCreatureHealth(getCreatureTarget(cid))
SetCreatureStorageValue(cid, 35321, hp)
	doCreatureSay(cid, "Absorb!", TALKTYPE_MONSTER)
doCombat(cid, combat, var)
AddCreatureHealth(cid, getCreatureStorageValue(cid, 35321) - hp)
SetCreatureStorageValue(cid, 35321, 0)
	doSendMagicEffect(getPlayerPosition(cid), 99)
end

when i using this i get this error :
 
Last edited:
REP++ please

this:
GetCreatureHealth(getCreatureTarget(cid))
is not equal this:
getCreatureHealth(getCreatureTarget(cid))

LUA:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_GRASSDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, 91)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1, -10, -1, -20, 5, 5, 1.4, 2.1)
 
function onCastSpell(cid, var)
local hp = getCreatureHealth(getCreatureTarget(cid))
setCreatureStorageValue(cid, 35321, hp)
	doCreatureSay(cid, "Absorb!", TALKTYPE_MONSTER)
doCombat(cid, combat, var)
addCreatureHealth(cid, getCreatureStorageValue(cid, 35321) - hp)
setCreatureStorageValue(cid, 35321, 0)
	doSendMagicEffect(getPlayerPosition(cid), 99)
end
 
Back
Top