• 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 Vip mana (you can change effect)

wlj

retierd
Joined
Jan 7, 2009
Messages
1,201
Reaction score
1
Code of spell.

Lua:
-- >>CONFIG<< --by Wlj-of-otland.net--
local MIN_MANA_GAIN = 769 -- How much is the lowest mana you can possibly gain (If your heal less than that amount of mana you will get that mana instead) ?
local MIN_MANA_RAND = 1657 -- The minimum amount of mana to be given (random)
local MAX_MANA_RAND = 1900 -- The maximum amount of mana to be given (random)
local ACCEPT_LUCK = true -- Should it be possible to get lucky and receive extra mana? true, false
local MAG_LEVEL_MULTI = 2 -- How many times should Magic Level be multiplied, to be added to the mana formula? 1 = same, 0 = nothing etc
local LEVEL_MULTI = 2 -- How many times should Level be multiplied, to be added to the mana formula? 1 = same, 0 = nothing etc 
local MAGIC_EFFECT = CONST_ME_SLEEP -- Magic effect that will be casted on the player each time it heals the mana.
local ANIMATION_COLOR = 37 -- What animation color will there be when you heal (Comes over player showing how much mana you healed) 1 - 255 (?)
local HEAL_TIMES = 1 -- How many times should you be healed when using the manarune once? Atleast 1
local FIRST_HEAL_DELAY = 0 -- How long time will it take before it heals FIRST time? In milliseconds
local HEAL_DELAY = 1000 -- How long time will it take before it heals one? In milliseconds
-- >>CONFIG<< --


local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)

local exhaust = createConditionObject(CONDITION_EXHAUSTED)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, HEAL_TIMES * HEAL_DELAY + FIRST_HEAL_DELAY)
	
function onCastSpell(cid, var)
doTargetCombatCondition(0, cid, exhaust, CONST_ME_NONE)
    local function doHealMana(parameters)
        local random = math.random(MIN_MANA_RAND, MAX_MANA_RAND)
        if ACCEPT_LUCK == true then
	    local luck = math.random(1, 100)
            if luck >= 90 then
                random = random * 2
            elseif luck == 50 then
                random = random * 3
            end
        end
        local formula = (getPlayerLevel(cid) * LEVEL_MULTI) + (getPlayerMagLevel(cid) * MAG_LEVEL_MULTI) + random
        local manaGain = math.max(MIN_MANA_GAIN, formula)
        doPlayerAddMana(cid, manaGain)
        doCreatureSay(cid,"Hail GM Brutal Legend!",19)
        doSendAnimatedText(getPlayerPosition(cid), manaGain, ANIMATION_COLOR)
        doSendMagicEffect(getPlayerPosition(cid), MAGIC_EFFECT)
        doCombat(parameters.cid, parameters.combat, parameters.var)
    end

    local times = HEAL_TIMES
    local parameters = {cid = cid, combat = combat, var = var}
    while times > 0 do
        if times == HEAL_TIMES then
            addEvent(doHealMana, FIRST_HEAL_DELAY, parameters)
        else
            addEvent(doHealMana, HEAL_DELAY * times, parameters) 
        end
        times = times - 1
    end
end
How i change the effect?

PHP:
CONST_ME_DRAWBLOOD = 0
CONST_ME_LOSEENERGY = 1
CONST_ME_POFF = 2
CONST_ME_BLOCKHIT = 3
CONST_ME_EXPLOSIONAREA = 4
CONST_ME_EXPLOSIONHIT = 5
CONST_ME_FIREAREA = 6
CONST_ME_YELLOW_RINGS = 7
CONST_ME_GREEN_RINGS = 8
CONST_ME_HITAREA = 9
CONST_ME_TELEPORT = 10
CONST_ME_ENERGYHIT = 11
CONST_ME_MAGIC_BLUE = 12
CONST_ME_MAGIC_RED = 13
CONST_ME_MAGIC_GREEN = 14
CONST_ME_HITBYFIRE = 15
CONST_ME_HITBYPOISON = 16
CONST_ME_MORTAREA = 17
CONST_ME_SOUND_GREEN = 18
CONST_ME_SOUND_RED = 19
CONST_ME_POISONAREA = 20
CONST_ME_SOUND_YELLOW = 21
CONST_ME_SOUND_PURPLE = 22
CONST_ME_SOUND_BLUE = 23
CONST_ME_SOUND_WHITE = 24
CONST_ME_BUBBLES = 25
CONST_ME_CRAPS = 26
CONST_ME_GIFT_WRAPS = 27
CONST_ME_FIREWORK_YELLOW = 28
CONST_ME_FIREWORK_RED = 29
CONST_ME_FIREWORK_BLUE = 30
CONST_ME_STUN = 31
CONST_ME_SLEEP = 32
CONST_ME_WATERCREATURE = 33
CONST_ME_GROUNDSHAKER = 34
CONST_ME_HEARTS = 35
CONST_ME_FIREATTACK = 36
CONST_ME_ENERGYAREA = 37
CONST_ME_SMALLCLOUDS = 38
CONST_ME_HOLYDAMAGE = 39
CONST_ME_BIGCLOUDS = 40
CONST_ME_ICEAREA = 41
CONST_ME_ICETORNADO = 42
CONST_ME_ICEATTACK = 43
CONST_ME_STONES = 44
CONST_ME_SMALLPLANTS = 45
CONST_ME_CARNIPHILA = 46
CONST_ME_PURPLEENERGY = 47
CONST_ME_YELLOWENERGY = 48
CONST_ME_HOLYAREA = 49
CONST_ME_BIGPLANTS = 50
CONST_ME_CAKE = 51
CONST_ME_GIANTICE = 52
CONST_ME_WATERSPLASH = 53
CONST_ME_PLANTATTACK = 54
CONST_ME_TUTORIALARROW = 55
CONST_ME_TUTORIALSQUARE = 56
CONST_ME_MIRRORHORIZONTAL = 57
CONST_ME_MIRRORVERTICAL = 58
CONST_ME_SKULLHORIZONTAL = 59
CONST_ME_SKULLVERTICAL = 60
CONST_ME_ASSASSIN = 61
CONST_ME_STEPSHORIZONTAL = 62
CONST_ME_BLOODYSTEPS = 63
CONST_ME_STEPSVERTICAL = 64
CONST_ME_YALAHARIGHOST = 65
CONST_ME_BATS = 66
CONST_ME_NONE = 255

Change CONST where?

local ANIMATION_COLOR = 37 -- What animation color will there be when you heal (Comes over player showing how much mana you healed) 1 - 255 (?)

atm 37=Sleep comes up Report bugs ;)
 
är det charge eller forever? ??

Lua:
-- >>CONFIG<< --by Wlj-of-otland.net--
local REMOVE_CHARGES = false -- true/false shall it remove charges?
local MIN_MANA_GAIN = 769 -- How much is the lowest mana you can possibly gain (If your heal less than that amount of mana you will get that mana instead) ?
local MIN_MANA_RAND = 1657 -- The minimum amount of mana to be given (random)
local MAX_MANA_RAND = 1900 -- The maximum amount of mana to be given (random)
local ACCEPT_LUCK = true -- Should it be possible to get lucky and receive extra mana? true, false
local MAG_LEVEL_MULTI = 2 -- How many times should Magic Level be multiplied, to be added to the mana formula? 1 = same, 0 = nothing etc
local LEVEL_MULTI = 2 -- How many times should Level be multiplied, to be added to the mana formula? 1 = same, 0 = nothing etc 
local MAGIC_EFFECT = CONST_ME_SLEEP -- Magic effect that will be casted on the player each time it heals the mana.
local ANIMATION_COLOR = 37 -- What animation color will there be when you heal (Comes over player showing how much mana you healed) 1 - 255 (?)
local HEAL_TIMES = 1 -- How many times should you be healed when using the manarune once? Atleast 1
local FIRST_HEAL_DELAY = 0 -- How long time will it take before it heals FIRST time? In milliseconds
local HEAL_DELAY = 1000 -- How long time will it take before it heals one? In milliseconds
-- >>CONFIG<< --


local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)

local exhaust = createConditionObject(CONDITION_EXHAUSTED)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, HEAL_TIMES * HEAL_DELAY + FIRST_HEAL_DELAY)
        
function onCastSpell(cid, var)
doTargetCombatCondition(0, cid, exhaust, CONST_ME_NONE)
    local function doHealMana(parameters)
        local random = math.random(MIN_MANA_RAND, MAX_MANA_RAND)
        if ACCEPT_LUCK == true then
            local luck = math.random(1, 100)
            if luck >= 90 then
                random = random * 2
            elseif luck == 50 then
                random = random * 3
            end
        end
        local formula = (getPlayerLevel(cid) * LEVEL_MULTI) + (getPlayerMagLevel(cid) * MAG_LEVEL_MULTI) + random
        local manaGain = math.max(MIN_MANA_GAIN, formula)
        doPlayerAddMana(cid, manaGain)
        doCreatureSay(cid,"Hail GM Brutal Legend!",19)
        doSendAnimatedText(getPlayerPosition(cid), manaGain, ANIMATION_COLOR)
        doSendMagicEffect(getPlayerPosition(cid), MAGIC_EFFECT)
        doCombat(parameters.cid, parameters.combat, parameters.var)
    end

    local times = HEAL_TIMES
    local parameters = {cid = cid, combat = combat, var = var}
    while times > 0 do
        if times == HEAL_TIMES then
            addEvent(doHealMana, FIRST_HEAL_DELAY, parameters)
        else
            addEvent(doHealMana, HEAL_DELAY * times, parameters) 
        end
        times = times - 1
    end
end
 
Back
Top