• 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 Paralyze Rune (just like in RL), delay added

lucasterra

Member
Joined
Dec 27, 2008
Messages
16
Reaction score
5
Hello there.

Here I'm posting my perfect paralyze rune. I'm using TFS.
What did I change?
  • The healing/hasting spells, now will only be castable sometime after a paralyze rune was issued (configurable in config.lua).
  • I changed the paralyze formula, so everytime a paralyze rune is issued the target's speed will be set to 80 (like in global).
  • Added a magic green effect on the paralyze caster.

So lets go.

  1. Go to \data\lib\data.lua
    In the file's end, you will find something like this:
    PHP:
    dofile(getDataDir() .. "lib/constant.lua")
    dofile(getDataDir() .. "lib/function.lua")
    dofile(getDataDir() .. "lib/compat.lua")
    dofile(getDataDir() .. "lib/database.lua")
    Add this in the last line:
    PHP:
    dofile(getDataDir() .. "lib/exhaustion.lua")
    Also make sure you have the script exhaustion.lua on your lib folder. If you don't have, create it (credits to TFS team I guess)
    PHP:
    exhaustion =
    {
    	check = function (cid, storage)
    		if(getPlayerStorageValue(cid, storage) >= os.time(t)) then
    			return TRUE
    		end
    
    		return FALSE
    	end,
    
    	get = function (cid, storage)
    		local exhaust = getPlayerStorageValue(cid, storage)
    		if(exhaust > 0) then
    			local left = exhaust - os.time(t)
    			if(left >= 0) then
    				return left
    			end
    		end
    
    		return FALSE
    	end,
    
    	set = function (cid, storage, time)
    		setPlayerStorageValue(cid, storage, os.time(t) + time)
    	end,
    
    	make = function (cid, storage, time)
    		local exhaust = exhaustion.get(cid, storage)
    		if(not exhaust) then
    			exhaustion.set(cid, storage, time)
    			return TRUE
    		end
    
    		return FALSE
    	end
    }
  2. Open your config.lua
    Now add this line:
    PHP:
    paralyzeDelay = 1400 --The paralyze delay in miliseconds, default is 2000ms (2sec)
  3. Now you can simply download my hasting/healing spells and overwrite it, or you can change it manually (by following the next steps).

  4. Go to \data\spells\support\paralyze rune.lua
    Overwrite your code for this code:
    PHP:
    local combat = createCombatObject()
    setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED)
    
    local condition = createConditionObject(CONDITION_PARALYZE)
    setConditionParam(condition, CONDITION_PARAM_TICKS, 20000)
    setConditionFormula(condition, -1, 40, -1, 40)
    setCombatCondition(combat, condition)
    
    function onCastSpell(cid, var)
    local paradelay = getConfigInfo('paralyzeDelay')
    	if isPlayer(variantToNumber(var)) == TRUE then
    		return doCombat(cid, combat, var), exhaustion.set(variantToNumber(var), 30030, paradelay/1000), doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_GREEN)
    	else
    		return doCombat(cid, combat, var), doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_GREEN)
    	end
    end
  5. Go to \data\spells\healing\, open each healing script of yours
    Where you find it:
    PHP:
    function onCastSpell(cid, var)
    	return doCombat(cid, combat, var)
    end
    Overwrite by it:
    PHP:
    function onCastSpell(cid, var)
    	if isPlayer(cid) == TRUE then
    		if exhaustion.check(cid, 30030) then
    			return FALSE
    		else
    			return doRemoveCondition(cid, CONDITION_PARALYZE), doCombat(cid, combat, var)
    		end
    	else
    		return doRemoveCondition(cid, CONDITION_PARALYZE), doCombat(cid, combat, var)
    	end
    end
  6. Go to \data\spells\support\ and open each hasting script of yours
    Where you find:
    PHP:
    function onCastSpell(cid, var)
    	return doCombat(cid, combat, var)
    end
    Overwrite by it:
    PHP:
    function onCastSpell(cid, var)
    	if isPlayer(cid) == TRUE then
    		if exhaustion.check(cid, 30030) then
    			return FALSE
    		else
    			return doRemoveCondition(cid, CONDITION_HASTE), doCombat(cid, combat, var)
    		end
    	else
    		return doRemoveCondition(cid, CONDITION_HASTE), doCombat(cid, combat, var)
    	end
    end
 
Last edited:
And after editing spells, healing spells and haste will remove paralyze automatically ?

What about potions ?
 
And after editing spells, healing spells and haste will remove paralyze automatically ?

What about potions ?

Yeah, haste will remove paralyzes.
About potions?

Open each of your potion scripts, and check for this:
PHP:
doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1)
Change to this:
PHP:
doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1)
doRemoveCondition(itemEx.uid, CONDITION_PARALYZE)
 
Added a magic green effect on the paralyze caster.
And changed the default paralyze delay.
 
When I added your configuration people can't use healing spells.
If they say for example Exura, it takes 20 mana but it don't have any effect and don't adding health. Do you know what's wrong?
 
I don't know, sorry. I was supposed to do not cast anything, only being able to cast after the delay.
 
1 bug:
When a monster is using haste then it's showing errors in console :p
function onCastSpell(cid, var)
if isPlayer(cid) == TRUE then
if exhaustion.check(cid, 30030) then
return FALSE
elseif isPlayer(cid) == FALSE then
return doCombat(cid, combat, var)
else
return doRemoveCondition(cid, CONDITION_HASTE), doCombat(cid, combat, var)

end
end
end

I think now it should work without errors in console when a monster is using haste(I hope)
 
Last edited:
wtf o0 0.4??
and how do i do this in tfs 0.3.6pl1??
cuz my heals dosent remove paralyze
 
Back
Top