• 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 % max life

itzbrhue3

New Member
Joined
Feb 21, 2017
Messages
41
Solutions
1
Reaction score
1
it works, but is this the correct way to do it?


local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat1, COMBAT_PARAM_BLOCKSHIELD, 1)
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatFormula(combat1, COMBAT_FORMULA_SKILL, 1, 0, 1, 0)



local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)

function onGetFormulaValues(cid, level, skill, attack, element, factor)
local hp_target = getCreatureMaxHealth(getCreatureTarget(cid)) * 0.1
local min = hp_target
local max = hp_target
return -math.ceil(min), -math.ceil(max)
end

setCombatCallback(combat2, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")


function onUseWeapon(cid, var)
doCombat(cid, combat1, var)
doCombat(cid, combat2, var)
return true
end
 
Back
Top