• 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:
Make this rune to set one storage to player, and after put one check in spells with this storage.

Its simple =)
 
Thread moved to requests.

Btw, you forgot to add which server you use, people can't help you if they don't know that, client version is also useful.
 
When you start your server, the first line in your console shows which server you use.
Example TFS 0.3.6.
P-1GfF.png
 
When you start your server, the first line in your console shows which server you use.
Example TFS 0.3.6.
P-1GfF.png

i think it TFS 3.6.

this
Code:
[08/03/2014 12:41:02] Maxwar Console 1.5 by Chavoz, version 1.5 (Zatacka)
[08/03/2014 12:41:02] Compiled with GNU C++ version 3.4.5 (mingw special) at Aug  5 2012, 03:20:11.
[08/03/2014 12:41:02] A server developed by Zatacka.
[08/03/2014 12:41:02] >> Loading config (config.lua)
[08/03/2014 12:41:02] > Using plaintext encryption
[08/03/2014 12:41:02] >> Checking software version... failed checking - malformed file.
[08/03/2014 12:41:02] >> Fetching blacklist
[08/03/2014 12:41:03] >> Loading RSA key
[08/03/2014 12:41:03] >> Starting SQL connection
[08/03/2014 12:41:03] >> Running Database Manager
[08/03/2014 12:41:03] > Optimized database.
[08/03/2014 12:41:03] >> Loading items
[08/03/2014 12:41:04] >> Loading groups
[08/03/2014 12:41:04] >> Loading vocations
[08/03/2014 12:41:04] >> Loading script systems
[08/03/2014 12:41:08] >> Loading chat channels
[08/03/2014 12:41:08] >> Loading outfits
[08/03/2014 12:41:08] [Warning - Outfits::parseOutfitNode] Duplicated outfit for gender 0 with lookType 24
[08/03/2014 12:41:08] [Warning - Outfits::parseOutfitNode] Duplicated outfit for gender 1 with lookType 24
[08/03/2014 12:41:08] >> Loading experience stages
[08/03/2014 12:41:08] >> Loading monsters
[08/03/2014 12:41:11] >> Loading mods...
[08/03/2014 12:41:11] > Loading Animated smiles.xml... done.
[08/03/2014 12:41:11] > Loading buypremium_command.xml... done.
[08/03/2014 12:41:11] > Loading changender_command.xml... done.
[08/03/2014 12:41:11] > Loading custommonsters.xml... done.
[08/03/2014 12:41:11] > Loading customspells.xml... done.
[08/03/2014 12:41:11] > Loading expscroll.xml... done.
[08/03/2014 12:41:11] > Loading firestorm.xml... done.
[08/03/2014 12:41:11] > Loading firstitems.xml... done.
[08/03/2014 12:41:11] > Loading football.xml... done.
[08/03/2014 12:41:11] > Loading lottery.xml... done.
[08/03/2014 12:41:11] > Loading offline_msg.xml... done.
[08/03/2014 12:41:11] > 11 mods were loaded.
[08/03/2014 12:41:11] >> Loading map and spawns...
[08/03/2014 12:41:13] > Map size: 2048x2048.
[08/03/2014 12:41:13] > Map descriptions:
[08/03/2014 12:41:13] "Saved with Remere's Map Editor 2.2"
[08/03/2014 12:41:13] "Swevolution Made By Scawins"
[08/03/2014 12:41:15] Duplicate uniqueId 23309
 
spells.xml
Code:
<rune name="Block Rune" id="2307" allowfaruse="1" charges="1" lvl="20" maglv="10" exhaustion="2000" needtarget="1" blocktype="solid" event="script" value="support/block rune.lua"/>

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)
     return doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED)
end

function onCastSpell(cid, var)
     local target = getTopCreature(variantToPosition(var)).uid
     if not isPlayer(target) then
         doPlayerSendCancel(cid, "Target has to be a player.")
         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(target, c.storage, c.time)
     doSendAnimatedText(getPlayerPosition(target), "Blocked", COLOR_RED)
     doCombat(cid, combat, var)
     for x = 1, c.time do
         addEvent(doBlockEffect, x * 1000, target)
     end
     return true
end

creaturescripts.xml
Code:
<event type="statschange" name="BlockEffect" event="script" value="blockeffect.lua"/>

login.lua
Code:
registerCreatureEvent(cid, "BlockEffect")

blockeffect.lua
Code:
function onStatsChange(cid, attacker, type, combat, value)
   if exhaustion.check(cid, 41523) then
     return false
   end
   return true
end
 
Last edited:
spells.xml
Code:
<rune name="Block Rune" id="2307" allowfaruse="1" charges="1" lvl="20" maglv="10" exhaustion="2000" needtarget="1" event="script" value="support/block rune.lua"/>

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)
     return doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED)
end

function onCastSpell(cid, var)
     local target = getTopCreature(variantToPosition(var)).uid
     if not isPlayer(target) then
         doPlayerSendCancel(cid, "Target has to be a player.")
         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(target, c.storage, c.time)
     doSendAnimatedText(getPlayerPosition(target), "Blocked", COLOR_RED)
     doCombat(cid, combat, var)
     for x = 1, c.time do
         addEvent(doBlockEffect, x * 1000, target)
     end
     return true
end

creaturescripts.xml
Code:
<event type="statschange" name="BlockEffect" event="script" value="blockeffect.lua"/>

login.lua
Code:
registerCreatureEvent(cid, "BlockEffect")

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

I think this to stop player attack on you [you must click on it and put it on player]?

I need it when you use it it block all damage spell on you

Only one click and I need it work for 5 time

and when I use it nothing happen he still say ...target has to be player... and I attacked with player ? o_O
 
Last edited:
If you use the rune on yourself, you will block attacks for 4 seconds, if you use it on someone else, that player will block attacks for 4 seconds. You can't use this on monsters or NPCs.
Made for and tested with TFS 0.3.6, since you said it was based on that, if it's based on an other server and you don't know which one, you can also send me the download link and I can look for myself.
 
Last edited:
If you use the rune on yourself, you will block attacks for 4 seconds, if you use it on someone else, that player will block attacks for 4 seconds. You can't use this on monsters or NPCs.
Made for and tested with TFS 0.3.6, since you said it was based on that, if it's based on an other server and you don't know which one, you can also send me de download link and I can look for myself.

I change my engine to this

TheForgottenServer8.60V5

Code:
[10/03/2014 03:15:00] The Forgotten Server 8.60 V5 - Edited By Otswe, version 0.3.6 V5 - Edited By Otswe (Crying Damson)
[10/03/2014 03:15:00] Compiled with GNU C++ version 4.4.0 at Jun 23 2012, 18:42:56.
[10/03/2014 03:15:00] A server developed by Elf, slawkens, Talaturen, KaczooH, Lithium, Kiper, Kornholijo.
[10/03/2014 03:15:00] Visit our forum for updates, support and resources: http://otland.net.
 
Tested on V8 (V5 isn't downloadable anymore) and also works there, but if you don't want the cancel message when using the rune on monsters or npc, you can also do it like 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)
     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)
     doCombat(cid, combat, var)
     for x = 1, c.time do
         addEvent(doBlockEffect, x * 1000, target)
     end
     return true
end
Now when you use it on a monster or npc, it's like using it on yourself.
 
Tested on V8 (V5 isn't downloadable anymore) and also works there, but if you don't want the cancel message when using the rune on monsters or npc, you can also do it like 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)
     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)
     doCombat(cid, combat, var)
     for x = 1, c.time do
         addEvent(doBlockEffect, x * 1000, target)
     end
     return true
end
Now when you use it on a monster or npc, it's like using it on yourself.

Sorry for delay it work

But I need it still saying BLOCKING untill 4 second

And I need it remove but after 3 using
 
What do you mean? You want the animated text be repeated till the effect is over?
Then you can just add this under local function doBlockEffect(cid).
Code:
doSendAnimatedText(getPlayerPosition(cid), "Blocked", COLOR_RED)

What should be removed?
 
What do you mean? You want the animated text be repeated till the effect is over?
Then you can just add this under local function doBlockEffect(cid).
Code:
doSendAnimatedText(getPlayerPosition(cid), "Blocked", COLOR_RED)

What should be removed?

removed block rune [id 2829]

and between every using you must wait 1 min
 
Last edited:
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)
 
Back
Top