• 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!

Rune Merger Spell

Big M O O K

New Member
Joined
Aug 24, 2008
Messages
35
Reaction score
0
I need a spell for 8.1 XML Devlands that takes 2 runes with charges in each hand and makes 1 rune with double charges (ie: one 12x rune and one 100x rune, say "merge" and u have a rune thats 112x. OR 100x + 100x for a 200x rune, and so on so forth).

Hope some1 can help xD cuz i have no idea how to do it.


i want it for a system where ppl make their own mana runes (10x) and have to merge them to use/ or sell because ppl will buy off players if they have to make them xD

well thanks in advanced if some1 helps
 
Last edited:
"8.1 XML" That doesn't help much, we need to know the distro's name to be able to find out the lua functions of that particular distro.
 
This script is made by Alreth:)


Heylo!

I seem to be back from a loooong break and the first thing I find are TALKACTIONS. Wooooow so much fun I finally can make now using talkactions. My first script is an rune merger spell, suggested by TemplerKnight.

Variables which you can change are at the top of the script, their values marked in blue. You can change these to easily setup your rune merger script. If you're an old fan of my old rune merger (the one with two coal basins and a lever) you'll quickly notice the similarities in the variables and the whole code.

Save as data\talkactions\scripts\rune_merger.lua:
Code:
function onSay(cid, words, param)
 
-- Rune Merger Spell by Alreth, v1.02.
-- Last updated 2007-04-25 13:00, by Alreth.
 
  -- Edit these variables so they fit to your map and server settings. --
    runesidmin = 2261                   -- Itemid of the first rune on the server
    runesidmax = 2316                   -- Itemid of the last rune on the server
    manacost =20                       -- Mana spent every time runes are merged
    maxcharges =200                    -- Max amount of charges allowed for runes (value has to be between 2 and 255)
    allowvoc = {0, 1, 2, 3, 4}                       -- Enter the vocation ids which will be allowed to use this rune. 0 = rook, 1 = sorc, 2 = druid, 3 = paladin, 4 = knight
    gmaccess = 3                       -- Accesslevel for GMs (GMs are allowed, regardless vocation)
  -- Stop editing here unless you know what you are doing. --    
 
    rune1 = getPlayerSlotItem(cid, 5)   -- The item in your left hand
    rune2 = getPlayerSlotItem(cid, 6)   -- The item in your right hand
 
    if (isInArray(allowvoc, getPlayerVocation(cid)) or getPlayerAccess(cid) >= gmaccess) then
        if (rune1.itemid >= runesidmin and rune1.itemid <= runesidmax) then
            if (rune1.itemid == rune2.itemid) then
                if (getPlayerMana(cid) < manacost) then
                    doPlayerSendTextMessage(cid, 22, "You need "..manacost.." mana to perform this merge.")
                    return 1
                else
                    doPlayerAddMana(cid, -manacost)
 
                    rune1x = rune1.type
                    rune2x = rune2.type
                    if (rune1x == 0) then
                        rune1x = 1
                    end
                    if (rune2x == 0) then
                        rune2x = 1
                    end
 
                    runetotal = rune1x + rune2x
                    if (runetotal <= maxcharges) then
                        newrune1 = runetotal
                        newrune2 = 0
                    else
                        newrune1 = maxcharges
                        newrune2 = runetotal-maxcharges
                        doPlayerSendTextMessage(cid, 22, "The new merged rune can not have more than "..maxcharges.." charges. One full rune will be made and one with restoring charges.")
                    end
 
                    if (newrune1 > 0) then
                        doPlayerAddItem(cid, rune1.itemid, newrune1)
                    end
                    if (newrune2 > 0) then
                        doPlayerAddItem(cid, rune1.itemid, newrune2)
                    end
 
                    doRemoveItem(rune1.uid, rune1.type)
                    doRemoveItem(rune2.uid, rune2.type)
                    doSendMagicEffect(getPlayerPosition(cid), 14)
                end
            else
                doPlayerSendTextMessage(cid, 22, "Please hold two runes of the same typ in each one of your hands before trying to merge them together.")
                return 1
            end
        else
            doPlayerSendTextMessage(cid, 22, "You can only merge runes together.")
            return 1
        end
    else
        doPlayerSendCancel(cid, "Sorry, but your vocation is not allowed to perform this spell.")
        return 1
    end
 
    doPlayerSendTextMessage(cid, 16, "Left: "..rune1.itemid.." Right: "..rune2.itemid)
    return 0
 
-- end of rune merger script --
end

Add inside data\talkactions\talkactions.xml:
Code:
<talkaction words="adevo mas" script="rune_merger.lua" />
 
This script is made by Alreth:)




Save as data\talkactions\scripts\rune_merger.lua:
Code:
function onSay(cid, words, param)
 
-- Rune Merger Spell by Alreth, v1.02.
-- Last updated 2007-04-25 13:00, by Alreth.
 
  -- Edit these variables so they fit to your map and server settings. --
    runesidmin = 2261                   -- Itemid of the first rune on the server
    runesidmax = 2316                   -- Itemid of the last rune on the server
    manacost =20                       -- Mana spent every time runes are merged
    maxcharges =200                    -- Max amount of charges allowed for runes (value has to be between 2 and 255)
    allowvoc = {0, 1, 2, 3, 4}                       -- Enter the vocation ids which will be allowed to use this rune. 0 = rook, 1 = sorc, 2 = druid, 3 = paladin, 4 = knight
    gmaccess = 3                       -- Accesslevel for GMs (GMs are allowed, regardless vocation)
  -- Stop editing here unless you know what you are doing. --    
 
    rune1 = getPlayerSlotItem(cid, 5)   -- The item in your left hand
    rune2 = getPlayerSlotItem(cid, 6)   -- The item in your right hand
 
    if (isInArray(allowvoc, getPlayerVocation(cid)) or getPlayerAccess(cid) >= gmaccess) then
        if (rune1.itemid >= runesidmin and rune1.itemid <= runesidmax) then
            if (rune1.itemid == rune2.itemid) then
                if (getPlayerMana(cid) < manacost) then
                    doPlayerSendTextMessage(cid, 22, "You need "..manacost.." mana to perform this merge.")
                    return 1
                else
                    doPlayerAddMana(cid, -manacost)
 
                    rune1x = rune1.type
                    rune2x = rune2.type
                    if (rune1x == 0) then
                        rune1x = 1
                    end
                    if (rune2x == 0) then
                        rune2x = 1
                    end
 
                    runetotal = rune1x + rune2x
                    if (runetotal <= maxcharges) then
                        newrune1 = runetotal
                        newrune2 = 0
                    else
                        newrune1 = maxcharges
                        newrune2 = runetotal-maxcharges
                        doPlayerSendTextMessage(cid, 22, "The new merged rune can not have more than "..maxcharges.." charges. One full rune will be made and one with restoring charges.")
                    end
 
                    if (newrune1 > 0) then
                        doPlayerAddItem(cid, rune1.itemid, newrune1)
                    end
                    if (newrune2 > 0) then
                        doPlayerAddItem(cid, rune1.itemid, newrune2)
                    end
 
                    doRemoveItem(rune1.uid, rune1.type)
                    doRemoveItem(rune2.uid, rune2.type)
                    doSendMagicEffect(getPlayerPosition(cid), 14)
                end
            else
                doPlayerSendTextMessage(cid, 22, "Please hold two runes of the same typ in each one of your hands before trying to merge them together.")
                return 1
            end
        else
            doPlayerSendTextMessage(cid, 22, "You can only merge runes together.")
            return 1
        end
    else
        doPlayerSendCancel(cid, "Sorry, but your vocation is not allowed to perform this spell.")
        return 1
    end
 
    doPlayerSendTextMessage(cid, 16, "Left: "..rune1.itemid.." Right: "..rune2.itemid)
    return 0
 
-- end of rune merger script --
end

Add inside data\talkactions\talkactions.xml:
Code:
<talkaction words="adevo mas" script="rune_merger.lua" />

Awesome =) TY.
 
Back
Top Bottom