• 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 To make wand attack

monstruo1

New Member
Joined
May 13, 2013
Messages
36
Reaction score
0
I need make my wand attack 4+hit for each lvl and for each ml of the character +2hit

star_tear.lua in data/weapons/scripts

Lua:
 local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, 18)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1.5, -60, -1.5, -70)

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

and in weapons.xml

HTML:
 <wand id="7735" level="8" mana="5" min="100" max="200" type="holy" event="script" value="star_tear.lua"> <!-- Star Tear -->
	<vocation id="1"/>
	<vocation id="2"/>
	<vocation id="5"/>
	<vocation id="6"/>
	</wand>
 
Add a callback to the combat to get damage depending on lvl etc and then add your custom formula.
You can check exori or some other spell for that, which uses this kind of callback.
 
I always use this function


Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, 18)
function onGetFormulaValues(cid, level, maglevel)
	min = (level *4) + 60
	max = (level *4) + 70
	return -min, -max
end

setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

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

Personally, I use this for every single spell or weapon I put in my servers.
 
Back
Top