• 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!

Simple Script - Spell Damages Self / Costs HP not Mana

Arn

Member
Joined
Mar 8, 2010
Messages
282
Reaction score
18
Like the title says, I'm trying to make a simple spell that gives me haste (got that working), and costs 50 hp to the player using it. So far, the functions I've tried, haven't worked.

Please help.

Thank you for your time,

-Arn


EDIT: I have the damage part working now, I just want want it to show "50" in red text on the character when the damage is done.

the sendAnimatedText function is depricated on my server btw.



Last Edit:

Fixed it myself. Heres the code if anyone is wondering.

Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_DRAWBLOOD)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)
setCombatFormula(combat, COMBAT_FORMULA_DAMAGE, -50, -50, -50, -50)

local condition = createConditionObject(CONDITION_HASTE)
setConditionParam(condition, CONDITION_PARAM_TICKS, 33000)
setConditionFormula(condition, 0.3, -24, 0.3, -24)
setCombatCondition(combat, condition)

function onCastSpell(cid, var)
	doTargetCombatHealth(0, cid, COMBAT_PHYSICALDAMAGE, -50, -50, CONST_ME_MAGIC_BLUE)
	return doCombat(cid, combat, var)
end
 
Last edited:
Back
Top