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

REQUEST LUA Script: Edible soulorb to regain soul points

MadMOOK

Hoo
Joined
Apr 20, 2011
Messages
802
Reaction score
43
Just as title says.. I need a script that allows characters to eat soul orbs to regain soul points! :p Thanks
I use 0.2.14
 
Hey man, i thought id quickly make one for you. Haven't tested it though! I made it check to see if the player is at max soul points first, to make sure they didn't "waste" orbs. If you didn't want this then ill post different one when i check back ^^

Add this line into actions.xml:
XML:
<action itemid="5944" script="soulorbs.lua"/>

Then create a file called soulorbs.lua inside actions/scripts and paste this code:
Lua:
--	Created By Avalock
function onUse(cid, item, fromPosition, itemEx, toPosition)
local soul = 10 -- Edit to amount gained by using soul orb.
local playerVoc = getPlayerVocation(cid)

if getPlayerSoul(cid) == 200 and playerVoc == 5 or playerVoc == 6 or playerVoc == 7 or playerVoc == 8 then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You already have max soul!")
doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
elseif getPlayerSoul(cid) == 100 and playerVoc == 1 or playerVoc == 2 or playerVoc == 3 or playerVoc == 4 then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You already have max soul!")
doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
else
doPlayerAddSoul(cid, soul)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have gained "..soul.." soul points!")
doSendMagicEffect(getThingPos(cid), CONST_ME_HEARTS)
doChangeTypeItem(item.uid, item.type - 1)
end
return 1
end

To make the script add a random amount of soul (Between x and y) then change:
Lua:
local soul = 10 -- Edit to amount gained by using soul orb.
To this:
Lua:
local soul = math.random(1, 10) -- Edit to (min, max) amount gained by using soul orb.

Hope this helps!
 
Last edited:
I got no errors when I loaded server Ill shoot you a pm when I actually test it, adding lots of things to server at one time and will work bugs out shortly, im trying to add the soul point drain training when they train skills in a certain room and im going to sell soul orbs on website lol..
 
If you still need this script here, I'm bored so just decided to make it :p If it doesn't work message me and I'll fix it. :D
Code:
-- Created using QtLuaPad on Wed Aug 28 2013
-- Written by: RuggedMage.

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if getPlayerSoul(cid) == 200 then
        doPlayerSendCancel(cid, "You can't get anymore soul, you're already full!")
        else
            doPlayerAddSoul(cid, 100)
                doPlayerRemoveItem(cid, soulorb, 1) -- use whatever item id soul orb is.
                    doPlayerSendTextMessage(cid, 21, "You have successfully added soul with your soulorb!")
                    end
                return true
            end
 
Back
Top