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

Mera Mero

Guess Who?
Joined
Dec 27, 2014
Messages
417
Reaction score
86
Hello otlanders ,How can i make wand attacking depends on level ,like when i get more level my wand attack will up too
 
Make 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.
 
Make 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.
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 more
Code:
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
 
I 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
 
I 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
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 more
 
just change maglevel to level? xD
Wohoho doesn't work << same hit LoL its working depends on mag ,idk how
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, 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
 
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
 
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
-.- i'm not loser , And this is the only SUBJECT that does not know anything about it is the worst subject for me! >,<
well those numbers are pretty much basic math xD
as i said before fuck maths :D
 
Back
Top