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

Lua Rod that heals per swing

ziggy46802

Active Member
Joined
Aug 19, 2012
Messages
418
Reaction score
27
So far I got to this
LUA:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_BLOCKSHIELD, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_EXPLOSIONAREA)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_EXPLOSION)

setConditionFormula(combat, -0, -1, -2, -10)

setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
 
 
function onCastSpell(cid, var)	
	return doCombat(cid, combat, var)

	return doCombat(cid, combat, var)
end

You see I got the main things for it to attack, but I didn't know if I had to go through special route of reaching the combat formula since is heals and damages. I wasn't sure how to call back the formulas so some help on that would be nice, but I do wan the 2 minimms for healing to be 0 and 1 and maximums to be 2 and 10, if that works ot.

Any help on this rod would be greatly appreciated and I will add in some surprising and random features to it and release it as well.

EDIT- No one wants rep? Even if you give me a non working script, as long as its me closer I'll rep you :P

- - - Updated - - -

Here is a script that almost works

LUA:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_BLOCKSHIELD, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_EXPLOSIONAREA)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_EXPLOSION)

function onGetFormulaValuesOne(cid, level, maglevel)
	local min = -1
	local max = -10
	return -min, -max
end

function onGetFormulaValuesTwo(cid, level, maglevel)
	local min = 1
	local max = 2
	return -min, -max
end
 
setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValuesOne")
 
 
setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValuesTwo")
 
	return doCombat(cid, combat, var)
end

The problem with it is that it heals the monster instead of the player, so how do I change it to the player?
 
Last edited:
Back
Top