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

Protection spell

DestinationSer

@echo off
Joined
Mar 7, 2009
Messages
2,806
Solutions
1
Reaction score
675
I want a spell that makes a player invincible for 5 seconds..
If anybody can do this i will rep++ :)
 
i found this on internet idk it works

Go to data\creaturescripts\scripts and create absorb.lua
Code:
function onStatsChange(cid, attacker, type, combat, value) 
        if getCreatureStorage(cid, STORAGE_ABSORB-1) == 1 then 
            doCreatureSetStorage(cid, STORAGE_ABSORB-1, -1) 
            return true 
        end 
local combats = 
{ 
[1] = {1}, 
[2] = {2}, 
[4] = {3}, 
[8] = {4}, 
[32] = {5}, 
[64] = {6}, 
[512] = {7}, 
[1024] = {8}, 
[2048] = {9} 
} 
local COMBATS = combats[combat] 
    if COMBATS then 
        if exhaustion.check(cid,COMBATS[1]+ STORAGE_ABSORB + 100) then 
            storage = getCreatureStorage(cid, STORAGE_ABSORB + COMBATS[1]) 
            value = (value * (storage/100)) 
            doCreatureSetStorage(cid, STORAGE_ABSORB-1, 1) 
            doTargetCombatHealth(attacker, cid, combat, -value, -value, INVISIBLE_EFFECT)   
            return false 
        end 
    end 
    return true 
end


Add to login.lua
Code:
registerCreatureEvent(cid, "absorb")

Add to creaturescripts.xml
Code:
 <event type="statsChange" name="absorb" event="script" value="absorb.lua"/>

Go to data/lib and create absorb.lua
Code:
INVISIBLE_EFFECT = 255 
STORAGE_ABSORB = 30000 
ABSORB_PHYSICAL = 1 
ABSORB_ENERGY = 2 
ABSORB_EARTH = 3 
ABSORB_POISON = 3 
ABSORB_FIRE = 4 
ABSORB_LIFEDRAIN = 5 
ABSORB_MANADRAIN = 6  
ABSORB_ICE = 7 
ABSORB_HOLY = 8 
ABSORB_DEATH = 9 
function absorbObject(cid, condition, time, percent) 
    doCreatureSetStorage(cid, condition+STORAGE_ABSORB, percent) 
    exhaustion.set(cid, condition+100+STORAGE_ABSORB, time) 
    return true 
end


example, rune makes us 50% absorbing poison damage for 20(propably secs)
Code:
function onUse(cid, item, pos, itemEx, topos) 
local time = 20 
local power = 50 
    absorbObject(cid, ABSORB_POISON, time, power) 
    doRemoveItem(item.uid) 
    return true 
end

time = time
power = power (100 == 100%)
 
Back
Top