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

Stamina and Cap++ Scroll

kito2

www.masteria.net
Joined
Mar 9, 2009
Messages
3,766
Solutions
1
Reaction score
225
Location
Chile, Santiago
Hi there, well I had an idea an it was making a two different items which when you use them, one adds you full stamina and other that give you more capacity.

When you use this items, they dissapear.

Can anyone make this scripts?

Thanks!
I pay rep++!
 
From a Health Booster, so I did a Mana Booster...
Then experience scroll, noble document (in my OT add 3 premium days), now stamina scroll and capacity scroll, and added a script that rox, you have 0,01% to loot one of those items, its very nice.
 
@barker
I have this script

Code:
  local cfg =
{
        level = 20, ---minimum level
        itemid = 7632,
        newMana = 25  ---the amount of mana the mana booster will add to the character
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
        if (item.itemid == cfg.itemid) then
                if getPlayerLevel(cid) >= cfg.level and (isSorcerer(cid) or isDruid(cid) or isPaladin(cid) or isRookie(cid)) then  
                        setCreatureMaxMana(cid, (getCreatureMaxMana(cid)+cfg.newMana))
                        doSendAnimatedText(getCreaturePosition(cid), "Mana!",TEXTCOLOR_RED)
                        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS)
                        doCreatureSay(cid, "You have recieved ".. cfg.newMana .." extra mana points, now your mana is ".. getCreatureMaxMana(cid) .."!", TALKTYPE_ORANGE_1)  
                        doRemoveItem(item.uid)  
                else  
                        doPlayerSendCancel(cid, "Your level is not high enough or you are not a magician.")  
                end
                return TRUE
        end
end

How could you make it to add more capacity to your max capacity?
Does the function getCreatureMaxCapacity(cid) exist?
 
Google ^_^

Lua:
function getPlayerMaxCap(cid)
local query = db.getResult("SELECT `cap` FROM `players` WHERE `id` = " .. getPlayerGUID(cid) .. ";")
    if query:getID() ~= -1 then
        return query:getDataInt("cap")
    end
    query:free()
    return LUA_ERROR
end

/data/lib/function.lua

doPlayerSetMaxCapacity(cid, cap) does exist, but the cap check doesn't.
 
Google ^_^

Lua:
function getPlayerMaxCap(cid)
local query = db.getResult("SELECT `cap` FROM `players` WHERE `id` = " .. getPlayerGUID(cid) .. ";")
    if query:getID() ~= -1 then
        return query:getDataInt("cap")
    end
    query:free()
    return LUA_ERROR
end

/data/lib/function.lua

doPlayerSetMaxCapacity(cid, cap) does exist, but the cap check doesn't.

Thanks for that function!! :D
 
Back
Top