runsicky
Member
- Joined
- Apr 19, 2018
- Messages
- 80
- Reaction score
- 12
It is possible to change attack formula in weapons, like i did on this example:
But what about defense?
Is it possible to change things on receive damage in LUA?
I mean, something like:
reduce death/fire/ice/energy/holy damage depending if player got a storage X
also reflect some dmg % if player got a storage Y
dont recive any dmg if player got a storage Z
paralyze who attacks the player if player got the storage C
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
function onGetFormulaValues(cid, level, skill, attack, factor)
-- get attack mode
local damagebase_min = wbdmg_melee_min
local damagebase_max = wbdmg_melee_min
min = ((damagebase_min) * (attack * 12) * (skill * 3)) * -0.10
max = ((damagebase_max) * (attack * 12) * (skill * 3)) * -1.00
return min, max
end
setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")
function onUseWeapon(cid, var)
return doCombat(cid, combat, var)
end
But what about defense?
Is it possible to change things on receive damage in LUA?
I mean, something like:
reduce death/fire/ice/energy/holy damage depending if player got a storage X
also reflect some dmg % if player got a storage Y
dont recive any dmg if player got a storage Z
paralyze who attacks the player if player got the storage C