• 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 Stamina Refiller new script

pugamoline

uint32_t patch_mem(char *
Joined
Nov 15, 2011
Messages
189
Reaction score
19
This is a example .. of how to refiller full stamina
You can't use this item after a fight or you have 42 hours stamina

with logs in [/data/logs/stamina.txt]

Lua:
local cfg =
{
        level = 20, ---minimum level
        itemid = 10173, --the itemid when you use this script
        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 ((getCreatureCondition(cid, CONDITION_INFIGHT) == FALSE) and getPlayerStamina(cid) ~= 2520) then	
						doPlayerSetStamina(cid, 60 * 42)
						--db.executeQuery("UPDATE `players` SET `stamina` = `stamina` + 2 * 60 * 1000 WHERE `id` = " .. getPlayerGUID(cid))
						--player = getPlayerGUID(cid)
						--name = getCreatureName(cid)
                        doSendAnimatedText(getCreaturePosition(cid), "Stamina!",TEXTCOLOR_YELLOW)
                        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS) 
                        doRemoveItem(item.uid)  
						doRemoveCreature(cid)
						--db.executeQuery("UPDATE `players` SET `stamina` = `stamina` + 12 * 60 * 60 * 1000 WHERE `id` = " .. player)
						doWriteLogFile("data/logs/stamina.txt", "".. name ..": [+42 horas stamina]")
                else  
                        doPlayerSendCancel(cid, "You can't use this item after a fight or you have 42 hours stamina.")
						doSendMagicEffect(getPlayerPosition(cid),2)
					
                end
                return TRUE
        end
end


Rep++
 
someone explain to me where and how to give this script?
 
Last edited:
Back
Top