• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Weapon that show Effect when paralyze

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?

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
 
Solution
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?

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)...
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?

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
Line 14. Function is written wrong, and pos isn't identified beforehand.
LUA:
doSendMagicEffect(getCreaturePosition(target), CONST_ME_HAILSTORM)
 
Solution
Back
Top