owned
Excellent OT User
Im trying to make it so that theres a 5% chance to para the target when hit. could someone help me. this is what i currently have:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_GREENSTAR)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 0, 0, 1.0, 0)
local condition = createConditionObject(CONDITION_PARALYZE)
setConditionParam(condition, CONDITION_PARAM_TICKS, 20000)
setConditionFormula(condition, -0.9, 0, -0.9, 0)
setCombatCondition(combat, condition)
function onUseWeapon(cid, var)
local ret = doCombat(cid, combat, var)
if(ret == false) then
return false
end
local target = variantToNumber(var)
if(target ~= 0) then
local chance = math.random(0, 100)
if(chance = 1,5) then
ret = doCombat(cid, combat, var)
end
end
return ret
end
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_GREENSTAR)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 0, 0, 1.0, 0)
local condition = createConditionObject(CONDITION_PARALYZE)
setConditionParam(condition, CONDITION_PARAM_TICKS, 20000)
setConditionFormula(condition, -0.9, 0, -0.9, 0)
setCombatCondition(combat, condition)
function onUseWeapon(cid, var)
local ret = doCombat(cid, combat, var)
if(ret == false) then
return false
end
local target = variantToNumber(var)
if(target ~= 0) then
local chance = math.random(0, 100)
if(chance = 1,5) then
ret = doCombat(cid, combat, var)
end
end
return ret
end