• 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 (Wow) Evocation -- Spell that gives mana% every X seconds for Y long!

MarkSmartRemark

Lua-Noob in Training :D
Joined
Jan 27, 2010
Messages
139
Reaction score
3
Hey guys,

Evocation spell based from WoW, its simple but i hope some people can use it..

Gives a chunk of %mana when you cast, and gives you X amount of mana every Y seconds.. easy config at top of spell..
Let me know if theres any bugs, i just tested it and seems to do what its supposed to..

Also i used on 8.60 cryingdamson(0.3.6) v8.2

:rolleyes:

-Added Cooldown Exhaust (-tetra20)
-Added Working Animation (-tetra20)

Need Help With:
- Adding config where if player moves, spell is cancelled and he gets no mana. (a bit harder but yea, im sure people can use for other spells too)



Make file in /spells folder
Code:
-- >>Script by Tabz!<< --
--{Credits: Colandus, based from healing spell; Tetra20, individual cooldown}

--.::.CONFIG.::.--
local first_mana = 15    --- First %of mana added
local percent_mana = 7.5 --- %of mana added each tick afterwards
local heal_tick = 6      --- How many times will it tick?
local tick_length = 15  --- How long between each tick? [seconds]
local cooldown = 120      --- Cooldown time for this spell (Exhaustion)? [seconds]
--.::.CONFIG.::.--



local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, heal_tick * (tick_length*100))

function onCastSpell(cid, var)
local max_mana = getCreatureMaxMana(cid)
if exhaustion.check(cid,299) then
doPlayerSendCancel(cid, "Your Evocation spell still has "..exhaustion.get(cid, 299).." seconds on cooldown.")
return false
end
    doCreatureAddMana(cid, (max_mana*(first_mana/100)))
            local cpos = getPlayerPosition(cid)
    local function onCastSpell2(parameters)
            doCreatureAddMana(cid, (max_mana*(percent_mana/100)))
            doSendMagicEffect(cpos, 1)
            doSendMagicEffect(cpos, 53)
            end
    local parameters = {cid = cid, combat = combat, var = var}
    for i = 0, math.max(heal_tick, 1) - 1 do
        addEvent(onCastSpell2, (tick_length*100) * i, parameters)
    end
    exhaustion.set(cid,299,cooldown)
    return true
end


EDIT:


Heres spells.xml

Code:
<instant name="Evocation" words="Evocation" lvl="7" mana="0" aggressive="0" selftarget="1" exhaustion="2000" needlearn="0" event="script" value="Mage/New/Evocation.lua">
        <vocation id="1"/>
    </instant>

Set exhaust regular, there is individual cooldown on the spell.

Aightt deuces!
 
Last edited:
Nice Spell it seems to be good.gonna give it a try
Here you are a spell with exhaustion of 60 second.Please use Code Tag
Code:
 -- >>Script by Tabz!<< --
--{Credits: Colandus healing spell}

--.::.CONFIG.::.--
local first_mana = 15    --- First %of mana added
local percent_mana = 7.5 --- %of mana added each tick afterwards
local heal_tick = 6      --- How many times will it tick?
local tick_length = 1500 --- How long between each tick? (Milliseconds) 1000 = 1 sec
local exhaustion = 60 -- exhaustion time in seconds
--.::.CONFIG.::.--



local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, heal_tick * tick_length)

function onCastSpell(cid, var)
local max_mana = getCreatureMaxMana(cid)
if exhaustion.check(cid,300) then
doPlayerSendCancel(cid, "You Have To Wait "..exhaustion.get(cid, 300).." Second to Reuse this Spell.")
return false
end
    doCreatureAddMana(cid, (max_mana*(first_mana/100)))
            local cpos = getPlayerPosition(cid)
            local function onCastSpell2(parameters)
            doCreatureAddMana(cid, (max_mana*(percent_mana/100)))
            doSendMagicEffect(cpos, 1)
            doSendMagicEffect(cpos, 53)
            end
    local parameters = {cid = cid, combat = combat, var = var}
    for i = 0, math.max(heal_tick, 1) - 1 do
        addEvent(onCastSpell2, tick_length * i, parameters)
    end
    exhaustion.set(cid,300,exhaustion*1000)
    return true
end
 
Last edited:
@tetra20

Code:
[19/02/2014 14:49:16] Admin Test has logged in.

[19/02/2014 14:49:17] [Error - Spell Interface]
[19/02/2014 14:49:17] data/spells/scripts/Mage/New/Evocation.lua:onCastSpell
[19/02/2014 14:49:17] Description:
[19/02/2014 14:49:17] data/spells/scripts/Mage/New/Evocation.lua:19: attempt to index upvalue 'exhaustion' (a number value)
[19/02/2014 14:49:17] stack traceback:
[19/02/2014 14:49:17]    data/spells/scripts/Mage/New/Evocation.lua:19: in function <data/spells/scripts/Mage/New/Evocation.lua:17>

Gave me this error

EDIT: Ahh wait, you have to change config from "exhaustion" to something else, if not it reads in exhaustion.check hehe i changed config to cooldown and it works! i will edit main post and add credit. Thank you!


Also, i just realised if you cast the spell and move around, the animation effects stay behind.. the script doesnt grab the new players position to send the effect, if anyone can help with that the spell is pretty much done i think!
 
Last edited:
Please Change to Codes Tag not php
Try This One
@MarkSmartRemark
Code:
-- >>Script by Tabz!<< --
--{Credits: Colandus, based from healing spell; Tetra20, individual cooldown}

--.::.CONFIG.::.--
local first_mana = 15    --- First %of mana added
local percent_mana = 7.5 --- %of mana added each tick afterwards
local heal_tick = 6      --- How many times will it tick?
local tick_length = 15  --- How long between each tick? [seconds]
local cooldown = 120      --- Cooldown time for this spell (Exhaustion)? [seconds]
--.::.CONFIG.::.--



local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, heal_tick * (tick_length*100))

function onCastSpell(cid, var)
local max_mana = getCreatureMaxMana(cid)
if exhaustion.check(cid,299) then
doPlayerSendCancel(cid, "Your Evocation spell still has "..exhaustion.get(cid, 299).." seconds on cooldown.")
return false
end
    doCreatureAddMana(cid, (max_mana*(first_mana/100)))
    local function onCastSpell2(parameters)
            doCreatureAddMana(cid, (max_mana*(percent_mana/100)))
            doSendMagicEffect(getPlayerPosition(cid), 1)
            doSendMagicEffect(getPlayerPosition(cid), 53)
            end
    local parameters = {cid = cid, combat = combat, var = var}
    for i = 0, math.max(heal_tick, 1) - 1 do
        addEvent(onCastSpell2, (tick_length*100) * i, parameters)
    end
    exhaustion.set(cid,299,cooldown)
    return true
end
 
Last edited:
Code:
local cfg = {
    cooldownStorage = 65337,    -- storage id
    cooldownTime = 180,            -- 180 seconds
    instantPercentMana = 15,    -- instantly adds 15% mp
    percentManaPerTick = 1,        -- adds 1% mp every tick
    tickEvery = 1000,            -- one tick every 1000ms (1 second)
    ticks = 30                    -- amount of ticks
}

local combat = {}
for i = 1, 999 do
    combat[i] = createCombatObject()
    setCombatParam(combat[i], COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
    setCombatParam(combat[i], COMBAT_PARAM_AGGRESSIVE, 0)
end

local condition = {}
for n = 1, 999 do
    condition[n] = createConditionObject(CONDITION_REGENERATION)
    setConditionParam(condition[n], CONDITION_PARAM_SUBID, cfg.cooldownStorage)
    setConditionParam(condition[n], CONDITION_PARAM_TICKS, cfg.ticks * 1000)
    setConditionParam(condition[n], CONDITION_PARAM_MANAGAIN, n * cfg.percentManaPerTick)
    setConditionParam(condition[n], CONDITION_PARAM_MANATICKS, cfg.tickEvery)
    setConditionParam(condition[n], CONDITION_PARAM_BUFF, TRUE)
    setCombatCondition(combat[n], condition[n])
end

function onCastSpell(cid, var)
    if getPlayerStorageValue(cid, cfg.cooldownStorage) <= os.time() then
        local mana = math.ceil(getCreatureMaxMana(cid)/100)
        doCombat(cid, combat[mana], var)
        doCreatureAddMana(cid, mana * cfg.instantPercentMana)
        setPlayerStorageValue(cid, cfg.cooldownStorage, os.time()+cfg.cooldownTime)
    else
        if getPlayerStorageValue(cid, cfg.cooldownStorage)-os.time() > 60 then
            local saytime = math.ceil((getPlayerStorageValue(cid, cfg.cooldownStorage)-os.time())/60)
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Cooldown: " ..(saytime).." minutes left.")
        else
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Cooldown: " ..(getPlayerStorageValue(cid, cfg.cooldownStorage)-os.time()).." seconds left.")
        end
        return false
    end
    return true
end

If you want as you asked me before, with: "If you move - cancel it". The code will be much more diffrent. But it can be made with the same system I used in your last spell.
 
Last edited:
Code:
local cfg = {
    cooldownStorage = 65337,    -- storage id
    cooldownTime = 180,            -- 180 seconds
    instantPercentMana = 15,    -- instantly adds 15% mp
    percentManaPerTick = 1,        -- adds 1% mp every tick
    tickEvery = 1000,            -- one tick every 1000ms (1 second)
    ticks = 30                    -- amount of ticks
}

local combat = {}
for i = 1, 999 do
    combat[i] = createCombatObject()
    setCombatParam(combat[i], COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
    setCombatParam(combat[i], COMBAT_PARAM_AGGRESSIVE, 0)
end

local condition = {}
for n = 1, 999 do
    condition[n] = createConditionObject(CONDITION_REGENERATION)
    setConditionParam(condition[n], CONDITION_PARAM_SUBID, cfg.cooldownStorage)
    setConditionParam(condition[n], CONDITION_PARAM_TICKS, cfg.ticks * 1000)
    setConditionParam(condition[n], CONDITION_PARAM_MANAGAIN, n * cfg.percentManaPerTick)
    setConditionParam(condition[n], CONDITION_PARAM_MANATICKS, cfg.tickEvery)
    setConditionParam(condition[n], CONDITION_PARAM_BUFF, TRUE)
    setCombatCondition(combat[n], condition[n])
end

function onCastSpell(cid, var)
    if getPlayerStorageValue(cid, cfg.cooldownStorage) <= os.time() then
        local mana = math.ceil(getCreatureMaxMana(cid)/100)
        doCombat(cid, combat[mana], var)
        doCreatureAddMana(cid, mana * cfg.instantPercentMana)
        setPlayerStorageValue(cid, cfg.cooldownStorage, os.time()+cfg.cooldownTime)
    else
        if getPlayerStorageValue(cid, cfg.cooldownStorage)-os.time() > 60 then
            local saytime = math.ceil((getPlayerStorageValue(cid, cfg.cooldownStorage)-os.time())/60)
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Cooldown: " ..(saytime).." minutes left.")
        else
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Cooldown: " ..(getPlayerStorageValue(cid, cfg.cooldownStorage)-os.time()).." seconds left.")
        end
        return false
    end
    return true
end

If you want as you asked me before, with: "If you move - cancel it". The code will be much more diffrent. But it can be made with the same system I used in your last spell.

Thanks @andu

I just tested it out, im using 0.3.6 -8.6 client

It does the initial tick, but after wards it doesnt do the ticks.. it shows the green message (which is awesome) but doesnt do ticks afterwards or remove the "regen" buff symbol when i move so im assuming it didnt cancel on move
 
Please Change to Codes Tag not php
Try This One
@MarkSmartRemark
Code:
-- >>Script by Tabz!<< --
--{Credits: Colandus, based from healing spell; Tetra20, individual cooldown}

--.::.CONFIG.::.--
local first_mana = 15    --- First %of mana added
local percent_mana = 7.5 --- %of mana added each tick afterwards
local heal_tick = 6      --- How many times will it tick?
local tick_length = 15  --- How long between each tick? [seconds]
local cooldown = 120      --- Cooldown time for this spell (Exhaustion)? [seconds]
--.::.CONFIG.::.--



local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, heal_tick * (tick_length*100))

function onCastSpell(cid, var)
local max_mana = getCreatureMaxMana(cid)
if exhaustion.check(cid,299) then
doPlayerSendCancel(cid, "Your Evocation spell still has "..exhaustion.get(cid, 299).." seconds on cooldown.")
return false
end
    doCreatureAddMana(cid, (max_mana*(first_mana/100)))
    local function onCastSpell2(parameters)
            doCreatureAddMana(cid, (max_mana*(percent_mana/100)))
            doSendMagicEffect(getPlayerPosition(cid), 1)
            doSendMagicEffect(getPlayerPosition(cid), 53)
            end
    local parameters = {cid = cid, combat = combat, var = var}
    for i = 0, math.max(heal_tick, 1) - 1 do
        addEvent(onCastSpell2, (tick_length*100) * i, parameters)
    end
    exhaustion.set(cid,299,cooldown)
    return true
end


@tetra20 worked! i miss the simplest things sometimes haha thank you.. will fix.
 
This script doesn't cancel on move. But ticks works properly, try to change percentManaPerTick = 1 to eg 25 and see results.
 
This script doesn't cancel on move. But ticks works properly, try to change percentManaPerTick = 1 to eg 25 and see results.

sorry man ive tried almost everything, it hasnt worked for me..

i tried changing config many times and script many times.. it isnt working for me and doesnt show errors.. :/

for all of them it does the same thing, it sends first mana% and doesnt tick after wards
 
Back
Top