Thanks for your reply but this script doesn't work , i copied script of icestrike after then changed onCastSpell to onUseWeapon and i can't attack with any number with it i mean i just attack with effect no moreMake the wand as a weapon. Create a weapon script just the same way you would a spell, make the formula use the players level, the only difference in weapons and spells for this purpose would be the function called, onUseWeapon() vs onCastSpell().
Best place to start would be taking a basic spell from the datapack you downloaded that works similar to a wand, like, exori frigo, or exori vis, or something like that, and replacing the function onCastSpell with onUseWeapon, then from there, all you would need to do is alter the parts of the script that you want different to the way you want, like the damage formula, effect, animation, ect....
You could also check the resources on here, Limos has released alot of weapon scripts that could be useful examples.
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_ICEATTACK)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SMALLICE)
setCombatFormula(combat, COMBAT_FORMULA_LEVEL, -1, -10, -1, -20, 5, 5, 1.4, 2.1)
function onUseWeapon(cid, var)
return doCombat(cid, combat, var)
end
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ICE)
function onGetFormulaValues(cid, level, maglevel)
local min = math.floor(level / 5) + maglevel * 2.8 + 50
local max = math.floor(level / 5) + maglevel * 3.8 + 50
return -min * 2, -max * 2
end
setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
function onUseWeapon(cid, var)
return doCombat(cid, combat, var)
end
but this one is working depends om MAGlevel not level ,my request is to make wand attacking depends on level if i get more level my hit will be moreI hope i understood,
Code:local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA) setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ICE) function onGetFormulaValues(cid, level, maglevel) local min = math.floor(level / 5) + maglevel * 2.8 + 50 local max = math.floor(level / 5) + maglevel * 3.8 + 50 return -min * 2, -max * 2 end setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues") function onUseWeapon(cid, var) return doCombat(cid, combat, var) end
Wohoho doesn't work << same hit LoL its working depends on mag ,idk howjust change maglevel to level? xD
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ICE)
function onGetFormulaValues(cid, level, level)
local min = math.floor(level / 5) + level * 2.8 + 50
local max = math.floor(level / 5) + level * 3.8 + 50
return -min * 2, -max * 2
end
setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
function onUseWeapon(cid, var)
return doCombat(cid, combat, var)
end
hmm alright but may you explain what these numbers are? cuz i don't know which one i need to changedon't change this one:
(cid, level, level)
function onGetFormulaValues(cid, level, level) <-------- You changed this to cid, level, level, it HAS to be cid, level, maglevel
local min = math.floor(level / 5) + level * 2.8 + 50
local max = math.floor(level / 5) + level * 3.8 + 50
return -min * 2, -max * 2
end
function onGetFormulaValues(cid, level, maglevel)
local min = math.floor(level / 5) + level * 2.8 + 50
local max = math.floor(level / 5) + level * 3.8 + 50
return -min * 2, -max * 2
end
local min = level
local max = level *2
local min = 50 + ((level * 10)-10)
local max = min * 1.1
-.- i'm not loser , And this is the only SUBJECT that does not know anything about it is the worst subject for me! >,<You changed
Code:function onGetFormulaValues(cid, level, level) <-------- You changed this to cid, level, level, it HAS to be cid, level, maglevel local min = math.floor(level / 5) + level * 2.8 + 50 local max = math.floor(level / 5) + level * 3.8 + 50 return -min * 2, -max * 2 end
So change it back:
Code:function onGetFormulaValues(cid, level, maglevel) local min = math.floor(level / 5) + level * 2.8 + 50 local max = math.floor(level / 5) + level * 3.8 + 50 return -min * 2, -max * 2 end
And it should work.
Also, it is just math.
local min = minimum damage done
local max = maximum damage done
so you can do
Code:local min = level local max = level *2
or
Code:local min = 50 + ((level * 10)-10) local max = min * 1.1
etc, It's just math and variables, you should of learned this in basic public school in like the 7th grade.
**EDIT**
Oh and I forgot to call you a noob, or loser girl or whatever, so yea.
Loser! Use Brain + Effort = Success
as i said before fuck mathswell those numbers are pretty much basic math xD
-.- i'm not loser , And this is the only SUBJECT that does not know anything about it is the worst subject for me! >,<
as i said before fuck maths
i think for you not for me and again i'm not loser , grudgingMath is the easiest subject. Just practice . Loser ^_^