• 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!

Lua HELP ! Weapon Paralyse Chance Percent

CollapserMemory

New Member
Joined
Dec 4, 2014
Messages
66
Reaction score
1
--- Weapon Paralyse By Vinny ---

local percent = 30 --- Chance Percent for Paralyse


local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, 38)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, 31)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -2.1, -85, -2.0, 85)

local condition = createConditionObject(CONDITION_PARALYZE)
setConditionParam(condition, CONDITION_PARAM_TICKS, 5000)
setConditionParam(condition, CONDITION_PARAM_SPEED, -50000)
setConditionFormula(condition, -1.0, 0, -1.0, 0)
setCombatCondition(combat, condition)

function onUseWeapon(cid, var)
if isCreature(variantToNumber(var)) then
if percent >= math.random(1,100) then
doAddCondition(variantToNumber(var), condition)
end
end
return doCombat(cid, combat, var)
end
 
Only thing I can recommend is
Code:
setCombatParam(combat, COMBAT_PARAM_EFFECT, 38)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, 31)
change the 38 and 31 to enums (like CONST_ME_ and CONST_ANI_)
other than that, everything seems to look fine. I'm not so sure about the -50000 speed either, lol. maybe bring that down (up) a bit to like -1000 or something, I dunno if it would affect it or not.
 
Only thing I can recommend is
Code:
setCombatParam(combat, COMBAT_PARAM_EFFECT, 38)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, 31)
change the 38 and 31 to enums (like CONST_ME_ and CONST_ANI_)
other than that, everything seems to look fine. I'm not so sure about the -50000 speed either, lol. maybe bring that down (up) a bit to like -1000 or something, I dunno if it would affect it or not.
-- Now -- But Error Continue ... --
--- 2h Druid By Vinny ---

local percent = 30 --- Porcentagem de Paralyse


local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_SMALLCLOUDS)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -2.1, -85, -2.0, 85)

local condition = createConditionObject(CONDITION_PARALYZE)
setConditionParam(condition, CONDITION_PARAM_TICKS, 5000)
setConditionParam(condition, CONDITION_PARAM_SPEED, -5000)
setConditionFormula(condition, -1.0, 0, -1.0, 0)
setCombatCondition(combat, condition)

function onUseWeapon(cid, var)
if isCreature(variantToNumber(var)) then
if percent >= math.random(1,100) then
doAddCondition(variantToNumber(var), condition)
end
end
return doCombat(cid, combat, var)
end
 
I have no idea. As far as I can tell, all the functions are being used correctly, but as per usual, I'm unfamiliar with the older functions so it's possible one of them is being passed a bad value or something. Dunno.
 
The only thing that comes to mind is lowering that speed reduction. -50000 is absurd.
Most creature have a walkspeed of 200-350, reducing it by 50-80 is enough to feel a solid paralyze, -50000 might be what's crashing the server.
yeah that's what I thought, but he only reduced it to 5000 after I mentioned it xD
 
Try this script: http://pastebin.com/PUc7QeqT
Code:
    local combat = createCombatObject()
    setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
    setCombatParam(combat, COMBAT_PARAM_BLOCKSHIELD, 1)
    setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
    setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_STUN)
    setCombatFormula(combat, COMBAT_FORMULA_SKILL, 0, 0, 1.0, 0)

    local condition = createConditionObject(CONDITION_PARALYZE)
    setConditionParam(condition, CONDITION_PARAM_TICKS, 10000)
    setConditionParam(condition, CONDITION_PARAM_SPEED, -550)
    setCombatCondition(combat, condition)

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

    function onUseWeapon(cid, var)
    local chance = math.random(1,10)

      if chance == 1 then
            doCombat(cid, combat, var)
        else
            doCombat(cid, combat2, var)
        end
    return true
end

Change it to appropriate combat type if you want to make a Mage Weapon paralyze.

If I helped can someone check to see if they can help with my problem. Thanks
https://otland.net/threads/bug-when-creating-guild-gesior.235013/
Hope I helped, Goodluck.
 
Back
Top