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

[Spell] Player immunity

Syryniss

Member
Joined
Feb 13, 2014
Messages
206
Reaction score
20
Hi. I'm looking for help with some spell. I want it to make player immune for any damage for few seconds or give him for example 30% absorbtion, like this which is on items. Thanks in advance!
 
I have that spell on HDD, but it isn't free. Sold it to some ppl in the past.
You can configure: how much it absorbing, how much for each type of damage, from which conditions it prevents, or just set flat absorbtion for all.
Aslo it have creaturescripts to make it work perfectly. You can ask me on PM.
Can't publish it here, becouse some users paid for it.
 
Refresh, I'm still looking for it. I only need an idea how to add absorbtion to spell, don't need any advanced scripts with config and many options etc.
 
You need to make a spell like a buff:
Code:
IMMUNITY = 67163549 -- storage of the buff

function powerOff(cid)
    if isPlayer(cid) == true then
      setPlayerStorageValue(cid, IMMUNITY, 0)
    else
      return false
    end
end

function powerOn(cid)
    if isPlayer(cid) == true then
      setPlayerStorageValue(cid, IMMUNITY, 1)
      doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_BLUE)
      local segundos = 30 -- buff seconds
      addEvent(powerOff, 1000*segundos, cid)
    else
      return false
    end
end

function onCastSpell(cid, var)
    if getPlayerStorageValue(cid, IMMUNITY) >= 1 then
      doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
      doPlayerSendCancel(cid, "You're already under the effect of this buff.")
    else
      addEvent(powerOn, 0, cid)
      setPlayerStorageValue(cid, IMMUNITY, 1)
    end
end

and you need to edit all your spells, like this:
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_EARTHDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_CARNIPHILA)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_EARTH)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1, -10, -1, -20, 5, 5, 1.4, 2.1)

function onCastSpell(cid, var)
    if getPlayerStorageValue(getCreatureTarget(cid), IMMUNITY) >= 1 then
      return false
    else
      return doCombat(cid, combat, var)
    end
end

when the target IMMUNITY storage is >= 1 start the buff ;)
 
Thank you very much! I found today this, but with your idea it would be easier to do complete immunity not only from one type of combat.
 
Last edited:
Back
Top