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?
So lets go.
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.
- 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")
PHP:dofile(getDataDir() .. "lib/exhaustion.lua")
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 }
- Open your config.lua
Now add this line:
PHP:paralyzeDelay = 1400 --The paralyze delay in miliseconds, default is 2000ms (2sec)
- Now you can simply download my hasting/healing spells and overwrite it, or you can change it manually (by following the next steps).
- 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
- 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
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
- 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
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: