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

Weapon (Wand)

Korabika

LUA Scripter
Joined
Jun 22, 2013
Messages
21
Reaction score
0
Hello Otlanders!!.
.
I Have Made Equipments in My OT Adds Magic Damage When Equiped But It Changes The Damage OF Wands For Example :

PHP:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, 1)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, 31)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGICVALUE, 0, 1420, 0, 1750)
function onUseWeapon(cid, var)
    return doCombat(cid, combat, var)
end
I want to Make This Never Changes Even I Equiped +50% Magic Damage Can Anyone Help Me?
 
Last edited:
You mean damage that is not based on lvl or ml?
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, 1)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, 31)

function onGetFormulaValues(cid, level, maglevel)
     min = 1420
     max = 1750

     return -min, -max
end

setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

function onUseWeapon(cid, var)
     return doCombat(cid, combat, var)
end
 
in weapons.xml
could it use..
Code:
<wand id="2186" level="13" mana="3" min="13" max="25" type="ice" function="default"> <!-- Moonlight Rod -->
     <vocation name="Druid"/>
   </wand>
instead of using a script?
 
You can use a Lua script if you want special effects that don't exist in weapons.xml/items.xml.
I meant for the poster, seeing as it was rods/wands. Might be an easier approach if that's all that was intended.
 
You mean damage that is not based on lvl or ml?
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, 1)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, 31)

function onGetFormulaValues(cid, level, maglevel)
     min = 1420
     max = 1750

     return -min, -max
end

setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

function onUseWeapon(cid, var)
     return doCombat(cid, combat, var)
end
It still get increased When i Wear An Item Which Adds Magic Damage and i dont want that i wanted items to increase spells only
i used that to make items add magic damage
<attribute key="increaseMagicPercent" value="115"/>
this Adds +15% Magic Damage Any Soultions else?

I meant for the poster, seeing as it was rods/wands. Might be an easier approach if that's all that was intended.
As He said i want to use the script to use more special effects but i think if i did like what u said it also will result the same problem
 
Last edited by a moderator:
You can increase the magiclevel instead of magic damage, this way only attacks based on ml will be more.
But if i only want to increase the spells damage without increasing the magic level and without increasing the damage of the weapons? :D:D
 
That would probably require an edit of your spells to check if said item is equipped or not, or you could use a movements script and set a storage value when equipped said item which the spell can check for and then increase the damage from that point on
 
Man You Don't Understand Me I Want The Wand's Damage Never Changes it now affects with items which adds magic damage but i want it to not affect got it?
 
Back
Top