FYzx
New Member
- Joined
- Jan 2, 2015
- Messages
- 7
- Reaction score
- 2
Well this is something simple. For a bunch of weapons and spells I'm making I use the same damage calculation formula for all of them with very slight tweaks. So can I somehow make that formula a global string?
I've tried making it a function in 050-function.lua
and then simply using in the weapons
but it doesn't work. Well it actually does work, but for only one weapon; all other weapons return this error:
Is this possible or am I wasting my time?
Thanks in advance.
I've tried making it a function in 050-function.lua
Code:
function onGetDamage(cid, level, skill, attack, factor)
min = - ((1 + getPlayerSkillLevel(cid, 4)/100) * 0.5
max = min * 2
return min, max
end
and then simply using in the weapons
Code:
setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetDamage")
but it doesn't work. Well it actually does work, but for only one weapon; all other weapons return this error:
Code:
Warning: [CallBack::loadCallBack] Event onGetDamage not found.
Is this possible or am I wasting my time?
Thanks in advance.