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

Block Rune

elking

Swev-v2.sytes.net Comming Soon !<>!
Joined
Aug 20, 2012
Messages
445
Reaction score
28
Location
Egypt
Hello People of OTLAND.

Lately I try to look for script to Rune Which can Stop damage on you for 4 second and while this 4 second you can't use any heal [exura vita] spell only attack spell [exevo gran mort]

I hope to anyone can help me :)

BUMP!
 
Last edited by a moderator:
You can just make an extra exhaustion part.
Above the other exhaustion check.
Code:
if exhaustion.check(cid, 43534) then
    doPlayerSendCancel(cid, "You need to wait "..exhaustion.get(cid, 43534).." seconds before you can use the rune again.")
    doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
    return false
end

Above the other exhaustion set.
Code:
exhaustion.set(cid, 43534, 60)
this ?
Code:
function onStatsChange(cid, attacker, type, combat, value)

  if exhaustion.check(cid, 43534) then
    doPlayerSendCancel(cid, "You need to wait "..exhaustion.get(cid, 43534).." seconds before you can use the rune again.")
    doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
    exhaustion.set(cid, 43534, 60)
    return false
end
give this?!
Code:
[13/03/2014 10:51:18] [Error - LuaScriptInterface::loadFile] data/creaturescripts/scripts/blockeffect.lua:8: 'end' expected (to close 'function' at line 1) near '<eof>'
[13/03/2014 10:51:18] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/blockeffect.lua)
[13/03/2014 10:51:18] data/creaturescripts/scripts/blockeffect.lua:8: 'end' expected (to close 'function' at line 1) near '<eof>'
 
No, it should be in the block rune (keep the statschange script as I posted it).

this ?
Code:
local c = {
  storage = 41523,
  time = 4
}
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_DEATH)

local function doBlockEffect(cid)
doSendAnimatedText(getPlayerPosition(cid), "Blocked", COLOR_RED)
    return doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED)
end

function onCastSpell(cid, var)
    local target = getTopCreature(variantToPosition(var)).uid
    if not isPlayer(target) then
        target = cid
    end
    if exhaustion.check(target, c.storage) then
        local n = target == cid and "You are" or getPlayerName(target).." is"
        doPlayerSendCancel(cid, n.." already blocking attacks.")
        doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
        return false
    end
    exhaustion.set(target, c.storage, c.time)
    doSendAnimatedText(getPlayerPosition(target), "Blocked", COLOR_RED)
      doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED)
    doCombat(cid, combat, var)
    for x = 1, c.time do
        addEvent(doBlockEffect, x * 1000, target)
    end
    exhaustion.set(cid, 43534, 60)
if exhaustion.check(cid, 43534) then
    doPlayerSendCancel(cid, "You need to wait "..exhaustion.get(cid, 43534).." seconds before you can use the rune again.")
    doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
    return false
end
end

Still saying you must wait 60 second but its able to use after 2 second gone .!
 
Last edited:
Add the exhaustion check part above "if exhaustion.check(target, c.storage) then".

Code:
local c = {
  storage = 41523,
  time = 4
}

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_DEATH)

local function doBlockEffect(cid)
      doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED)
    doSendAnimatedText(getPlayerPosition(target), "Blocked", COLOR_RED)
end


function onCastSpell(cid, var)
    local target = getTopCreature(variantToPosition(var)).uid
    if not isPlayer(target) then
        target = cid
    end
    if exhaustion.check(cid, 43534) then
    doPlayerSendCancel(cid, "You need to wait "..exhaustion.get(cid, 43534).." seconds before you can use the rune again.")
    doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
    return false
end
    if exhaustion.check(target, c.storage) then
        local n = target == cid and "You are" or getPlayerName(target).." is"
        doPlayerSendCancel(cid, n.." already blocking attacks.")
        doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
        return false
    end
    exhaustion.set(cid, 43534, 60)
    exhaustion.set(target, c.storage, c.time)
    doSendAnimatedText(getPlayerPosition(target), "Blocked", COLOR_RED)
      doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED)
    doCombat(cid, combat, var)
    for x = 1, c.time do
        addEvent(doBlockEffect, x * 1000, target)
    end
    return true
end

give me this error

Code:
[14/03/2014 07:33:05] [Error - Spell Interface]
[14/03/2014 07:33:06] In a timer event called from:
[14/03/2014 07:33:06] data/spells/scripts/support/block rune.lua:onCastSpell
[14/03/2014 07:33:06] Description:
[14/03/2014 07:33:06] (luaGetThingPosition) Thing not found
 
local function doBlockEffect(cid)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED)
doSendAnimatedText(getPlayerPosition(cid), "Blocked", COLOR_RED)
return true​
end
 
local function doBlockEffect(cid)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED)
doSendAnimatedText(getPlayerPosition(cid), "Blocked", COLOR_RED)
return true​
end

Ty work :)

but you forget to add remove items after 3 use
 
Last edited:
@Limos why it give me this error while using mana or uh??

Code:
[15/03/2014 10:04:57] [Error - CreatureScript Interface]
[15/03/2014 10:04:57] data/creaturescripts/scripts/blockeffect.lua:onStatsChange
[15/03/2014 10:04:57] Description:
[15/03/2014 10:04:58] data/lib/034-exhaustion.lua:8: field 'day' missing in date table
[15/03/2014 10:04:58] stack traceback:
[15/03/2014 10:04:58]    [C]: in function 'time'
[15/03/2014 10:04:58]    data/lib/034-exhaustion.lua:8: in function 'check'
[15/03/2014 10:04:58]    data/creaturescripts/scripts/blockeffect.lua:2: in function <data/creaturescripts/scripts/blockeffect.lua:1>

and help me with removing items after 3 using and thanks :)
 
@Limos I start again from the first

block rune.lua

Code:
local c = {
  storage = 41523,
  time = 4
}

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_DEATH)

local function doBlockEffect(cid)
      doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED)
      doSendAnimatedText(getPlayerPosition(cid), "Blocked", COLOR_RED)
end

function onCastSpell(cid, var)
    local target = getTopCreature(variantToPosition(var)).uid
    if not isPlayer(target) then
        target = cid
    end
    if exhaustion.check(target, c.storage) then
        local n = target == cid and "You are" or getPlayerName(target).." is"
        doPlayerSendCancel(cid, n.." already blocking attacks.")
        doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
        return false
    end
    exhaustion.set(target, c.storage, c.time)
    doSendAnimatedText(getPlayerPosition(target), "Blocked", COLOR_RED)
          doSendMagicEffect(getPlayerPosition(target), CONST_ME_MAGIC_RED)
    doCombat(cid, combat, var)
    for x = 1, c.time do
        addEvent(doBlockEffect, x * 1000, target)
    end
    return true
end

blockeffect.lua

Code:
function onStatsChange(cid, attacker, type, combat, value)
  if time.check(cid, 41523) then
    return true
  end
  return true
end

and still giving this when doing anyUh spell , using mana and when anymonster attack on me so damage not decrease mana and uh :(

Code:
[15/03/2014 10:04:57] [Error - CreatureScript Interface]
[15/03/2014 10:04:57] data/creaturescripts/scripts/blockeffect.lua:onStatsChange
[15/03/2014 10:04:57] Description:
[15/03/2014 10:04:58] data/lib/034-exhaustion.lua:8: field 'day' missing in date table
[15/03/2014 10:04:58] stack traceback:
[15/03/2014 10:04:58]    [C]: in function 'time'
[15/03/2014 10:04:58]    data/lib/034-exhaustion.lua:8: in function 'check'
[15/03/2014 10:04:58]    data/creaturescripts/scripts/blockeffect.lua:2: in function <data/creaturescripts/scripts/blockeffect.lua:1>
 
Back
Top