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

Script! Wand Damage by magic level.

ximishe

New Member
Joined
Mar 23, 2010
Messages
49
Reaction score
1
Hello i need a script for change the destriny of Wands and Rods.

<!-- Rods -->
<wand id="2182" level="7" mana="2" min="8" max="18" type="earth" function="default"> <!-- Snakebit Rod -->
<vocation name="Druid"/>
its a weapons.xml

What to change? I need to Damage is request magic level. Like Spells. If higher mlvel then damage is better!
 
Lua:
function onGetFormulaValues(cid, level, maglevel)
	local min = maglevel * x + x
	local max = maglevel * x + x
	return -min, -max
end
 
Ok, Sizaro, lua function looks quite good, but how to pass values that's returned by function to weapons.xml ? should i use function="lvlwand" and paste it to "lvlwand.lua", and then set min="min" and max="max" ?
 
weapons.xml
Code:
<wand id="7424" event="script" value="wand.lua">
	<vocation name="Druid"/>
	<vocation name="Elder Druid"/>
	<vocation name="Sorcerer"/>
	<vocation name="Master sorcerer"/>
</wand>

wand.lua
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ICE)
	
function onGetFormulaValues(cid, level, maglevel)
	local min = -maglevel*5
	local max = -maglevel*6	
return min, max		
end
setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
function onUseWeapon(cid, var)
	doCombat(cid, combat, var)
end

[Tested on TFS 0.3.6]
 
<attribute key="weaponType" value="wand"/>
<attribute key="shootType" value="death"/>
<attribute key="range" value="5"/>

under whatever weapon u want as a wand
 
Back
Top