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

Level based attack rune

Suss

New Member
Joined
Nov 5, 2007
Messages
14
Reaction score
1
So I've tried looking and haven't found anything.. not the best with scripting a whole thing myself like this. I've probably missed something easy, too.. :/

Can anyone help me with a level based attack rune?

So far, this is the rune:

LUA:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, true)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HOLYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_HOLY)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -13, -18, -18, -35)

function onCastSpell(cid, var)
	return doCombat(cid, combat, var)
end

It's great for mages, but like you can see, I need it to hit the same amount no matter what vocation. If you're level 300, you'll hit the same amount as any other vocation for example.



Thanks!
 
Or for easier configuration try something like this:

LUA:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, true)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HOLYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_HOLY)

function onGetFormulaValues(cid, level)
	local min = level * 2.0 + 10    -- minimum rune damage formula
	local max = level * 2.5 + 25    -- maximum rune damage formula
	return -min, -max
end

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