• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Action ManaRune Vocations

Nightss

Normal People
Joined
May 18, 2013
Messages
55
Reaction score
12
Location
Mexicali
Hi, i made this scripts for each vocation to heal different mana ;)

Actions / Scripts

Code:
[/B]
[B]
    function onUse(cid, item, fromPosition, itemEx, toPosition)


    local sorcerer = 900 -- Mana Whit Sorcerer

    local druid = 900 -- Mana Whit Druid

    local paladin = 600 -- Mana Whit Paladin

    local knight = 400 --Mana Whit  Knight

    local master = 1300 -- Mana Whit Master Sorcerer

    local elder = 1300 -- Mana Whit Elder Druid

    local royal = 900 -- Mana Whit Royal Paladin

    local elite = 600 -- Mana Whit Elite Knight


    local playerVoc = getPlayerVocation(cid)

    if playerVoc == 1 then
    doPlayerAddMana(cid, sorcerer)
    doSendAnimatedText(getPlayerPosition(cid), "Sorcerer", 180)
    doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_BLUE)

    elseif playerVoc == 2 then
    doPlayerAddMana(cid, druid)
    doSendAnimatedText(getPlayerPosition(cid), "Druid", 180)
    doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_GREEN)

    elseif playerVoc == 3 then
    doPlayerAddMana(cid, paladin)
    doSendAnimatedText(getPlayerPosition(cid), "Paladin", 180)
    doSendMagicEffect(getPlayerPosition(cid), CONST_ME_FIREWORK_YELLOW)

    elseif playerVoc == 4 then
    doPlayerAddMana(cid, knight)
    doSendAnimatedText(getPlayerPosition(cid), "Knight", 180)
    doSendMagicEffect(getPlayerPosition(cid), CONST_ME_STUN)

    elseif playerVoc == 5 then
    doPlayerAddMana(cid, master)
    doSendAnimatedText(getPlayerPosition(cid), "Master", 180)
    doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_BLUE)

    elseif playerVoc == 6 then
    doPlayerAddMana(cid, elder)
    doSendAnimatedText(getPlayerPosition(cid), "Elder", 180)
    doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_GREEN)

    elseif playerVoc == 7 then
    doPlayerAddMana(cid, royal)
    doSendAnimatedText(getPlayerPosition(cid), "Royal", 180)
    doSendMagicEffect(getPlayerPosition(cid), CONST_ME_FIREWORK_YELLOW)

    elseif playerVoc == 8 then
    doPlayerAddMana(cid, elite)
    doSendAnimatedText(getPlayerPosition(cid), "Elite", 180)
    doSendMagicEffect(getPlayerPosition(cid), CONST_ME_STUN)

     
    end
    return true
    end

Actions.xml
Code:
[/B]
[B]
    <action itemid="XXXX" script="nameofarchive.lua" />

"XXXX" is the id of rune :D

Picture;

2retd9g.png


 
Last edited:
IT Gonna be Good now
function onUse(cid, item, fromPosition, itemEx, toPosition)



local sorcerer = 900 -- Mana Whit Sorcerer

local druid = 900 -- Mana Whit Druid

local paladin = 600 -- Mana Whit Paladin

local knight = 400 --Mana Whit Knight

local master = 1300 -- Mana Whit Master Sorcerer

local elder = 1300 -- Mana Whit Elder Druid

local royal = 900 -- Mana Whit Royal Paladin

local elite = 600 -- Mana Whit Elite Knight




local playerVoc = getPlayerVocation(cid)

if playerVoc == 1 then
doPlayerAddMana(cid, sorcerer)
doSendAnimatedText(getPlayerPosition(cid), "You've Used Mana Rune And Gain'd 900 Mana", 180)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_BLUE)

elseif playerVoc == 2 then
doPlayerAddMana(cid, druid)
doSendAnimatedText(getPlayerPosition(cid), "You've Used Mana Rune And Gain'd 900 Mana", 180)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_GREEN)

elseif playerVoc == 3 then
doPlayerAddMana(cid, paladin)
doSendAnimatedText(getPlayerPosition(cid), "You've Used Mana Rune And Gain'd 600 Mana", 180)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_FIREWORK_YELLOW)

elseif playerVoc == 4 then
doPlayerAddMana(cid, knight)
doSendAnimatedText(getPlayerPosition(cid), "You've Used Mana Rune And Gain'd 400 Mana", 180)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_STUN)

elseif playerVoc == 5 then
doPlayerAddMana(cid, master)
doSendAnimatedText(getPlayerPosition(cid), "You've Used Mana Rune And Gain'd 1300 Mana", 180)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_BLUE)

elseif playerVoc == 6 then
doPlayerAddMana(cid, elder)
doSendAnimatedText(getPlayerPosition(cid), "You've Used Mana Rune And Gain'd 1300 Mana", 180)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_GREEN)

elseif playerVoc == 7 then
doPlayerAddMana(cid, royal)
doSendAnimatedText(getPlayerPosition(cid), "You've Used Mana Rune And Gain'd 900 Mana", 180)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_FIREWORK_YELLOW)

elseif playerVoc == 8 then
doPlayerAddMana(cid, elite)
doSendAnimatedText(getPlayerPosition(cid), "You've Used Mana Rune And Gain'd 600 Mana", 180)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_STUN)



end
return true
end
 
try to make it in spell.xml,

it'll be better than there ;)
 
is there a exhaust on it? I added and works great but seems like there isn't a exhaust
There is indeed no exhaustion added, you can add an exhaustion condition same as potions have in potions.lua.
try to make it in spell.xml,

it'll be better than there ;)
Mana runes/potions should be added in actions, if they are added in spells people can't use other runes and spells at the same time as gaining mana, which is needed for mages to hunt/fight properly.
 
Mana runes/potions should be added in actions, if they are added in spells people can't use other runes and spells at the same time as gaining mana, which is needed for mages to hunt/fight properly.

it's my first time to notice that thanks :D

but there is way to make this action >> " Manarune " unremovable ?? i tried but didn't work for me :)
 
If you don't add doRemoveItem(item.uid, 1) in the action script, it won't be removed when using it.
 
can you change that to gain mana for level/magiclevel based?
my server are character of 1-1000 level and a level 1000 sorcerer.. with gain 900 mana per use.. LOL! :)
 
You can make a calculation then use level and magiclevel as variable in the calculation.
Code:
local level, mlevel = getPlayerLevel(cid), getPlayerMagLevel(cid)

Then for example
Code:
local sorcerer = 900 + (mlevel * 2) + (level / 5)
 
Back
Top