• 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 Paralyze aoe also affect monsters

xFlamek

New Member
Joined
May 1, 2020
Messages
23
Reaction score
0
hello, im trying to fix paralyze scripts for monsters atm using scrip like this one, but my problem is that it also affect monster, even if monster have paralyze immunity set in config.
Lua:
    local combat = Combat()
    combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_SMALLCLOUDS) -- effect of spell
    local condition = Condition(CONDITION_PARALYZE)
    condition:setParameter(CONDITION_PARAM_TICKS, 20000) -- 20 seconds
    condition:setFormula(-0.25, 0, -0.45, 0) -- player speed -25% to -45%
    combat:addCondition(condition)
    local area = createCombatArea(AREA_SQUARE1X1)-- need to setup right area of effect
    combat:setArea(area)
    Combat:addCondition(condition)
    
function onCastSpell(creature, variant, isHotkey)
    if not combat:execute(creature, variant) then
        return false
    end
 
end
 
hello, im trying to fix paralyze scripts for monsters atm using scrip like this one, but my problem is that it also affect monster, even if monster have paralyze immunity set in config.
Lua:
    local combat = Combat()
    combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_SMALLCLOUDS) -- effect of spell
    local condition = Condition(CONDITION_PARALYZE)
    condition:setParameter(CONDITION_PARAM_TICKS, 20000) -- 20 seconds
    condition:setFormula(-0.25, 0, -0.45, 0) -- player speed -25% to -45%
    combat:addCondition(condition)
    local area = createCombatArea(AREA_SQUARE1X1)-- need to setup right area of effect
    combat:setArea(area)
    Combat:addCondition(condition)
   
function onCastSpell(creature, variant, isHotkey)
    if not combat:execute(creature, variant) then
        return false
    end

end

Im having the same issue, did you find a fix?
 
Check if creature is not monster before combat:execute

if not creature:isMonster() then
 
hello, im trying to fix paralyze scripts for monsters atm using scrip like this one, but my problem is that it also affect monster, even if monster have paralyze immunity set in config.
Lua:
    local combat = Combat()
    combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_SMALLCLOUDS) -- effect of spell
    local condition = Condition(CONDITION_PARALYZE)
    condition:setParameter(CONDITION_PARAM_TICKS, 20000) -- 20 seconds
    condition:setFormula(-0.25, 0, -0.45, 0) -- player speed -25% to -45%
    combat:addCondition(condition)
    local area = createCombatArea(AREA_SQUARE1X1)-- need to setup right area of effect
    combat:setArea(area)
    Combat:addCondition(condition)
   
function onCastSpell(creature, variant, isHotkey)
    if not combat:execute(creature, variant) then
        return false
    end

end

Lua:
local condition = Condition(CONDITION_PARALYZE)
local combat = Combat()
local area = createCombatArea(AREA_SQUARE1X1) -- Effect area

condition:setParameter(CONDITION_PARAM_TICKS, 20000) -- 20 seconds
condition:setFormula(-0.25, 0, -0.45, 0) -- -25% to -45% of player speed

combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_SMALLCLOUDS) -- Effect effect id
combat:setArea(area)
combat:addCondition(condition)

function onCastSpell(creature, variant)
  if creature:isImmune(CONDITION_PARALYZE) then
    return false
  end

  return combat:execute(creature, variant)
end

Note: I DID NOT test it.
 
Lua:
local condition = Condition(CONDITION_PARALYZE)
local combat = Combat()
local area = createCombatArea(AREA_SQUARE1X1) -- Effect area

condition:setParameter(CONDITION_PARAM_TICKS, 20000) -- 20 seconds
condition:setFormula(-0.25, 0, -0.45, 0) -- -25% to -45% of player speed

combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_SMALLCLOUDS) -- Effect effect id
combat:setArea(area)
combat:addCondition(condition)

function onCastSpell(creature, variant)
  if creature:isImmune(CONDITION_PARALYZE) then
    return false
  end

  return combat:execute(creature, variant)
end

Note: I DID NOT test it.


Check if creature is not monster before combat:execute

if not creature:isMonster() then

My issue was that the "spell" the creatures threw wasn't paralyze, it was "speed". I just added a monster-paralyze spell from the paralyze rune.lua, cheers though =)
 
Back
Top