Helliot1
Owner of Empire Online
- Joined
- Jul 26, 2017
- Messages
- 315
- Solutions
- 1
- Reaction score
- 60
Hello!!
I created a new weapon, a snowball, and on some hits, you have a chance to paralyze your target. But he wanted it to stop when it showed an effect on the target.
What's wrong with my script?
I created a new weapon, a snowball, and on some hits, you have a chance to paralyze your target. But he wanted it to stop when it showed an effect on the target.
What's wrong with my script?
LUA:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, true)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, 20)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 1, 0, 1, 0)
local condition = createConditionObject(CONDITION_PARALYZE)
setConditionParam(condition, CONDITION_PARAM_TICKS, 2000)
setConditionFormula(condition, -1.0, 0, -1.0, 0)
function onUseWeapon(cid, var)
doCombat(cid, combat, var)
local target = variantToNumber(var)
if isCreature(target) and math.random(10) == 2 then
doAddCondition(target, condition)
DoSendMagicEffect(pos, CONST_ME_HAILSTORM)
end
return true
end