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

Lua Ultimate Health Potion

is the pots on your server stackable?
any magic effect?
any text effect?
pots disappear or change into empty one or infinite?

EDIT:
Works perfectly on Crying damson 0.3.6pl1,
IT is similar to he normal pots, same effect and such except it heals 85% i made a config for you to edit it easy.

Change in data/actions/actions.xml
Code:
<action itemid="7588-7591;8472-8473;7618;7620;8704" event="script" value="liquids/potions.lua"/>
to
Code:
<action itemid="7588-7591;8472;7618;7620;8704" event="script" value="liquids/potions.lua"/>
and add:
Code:
<action itemid="8473" event="script" value="other/healthpot.lua"/>

Remove in data/actions/scripts/liquids/potion.lua
Lua:
	[8473] = {empty = 7635, splash = 2, health = {610, 800}, level = 130, vocations = {4, 8}, vocStr = "knights"}, -- ultimate health potion

And create a file in data/actions/scripts/other/healthpot.lua
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
-- Config --
config = {
	formula = (getCreatureMaxHealth(cid) / 100) * 85, -- Change the 85 in any percent you want to heal it --
	storage = 81543, -- Dont change this only if use this storage already --
	effect = CONST_ME_MAGIC_BLUE, -- Effect on use --
	text = "Aaaah...", -- Text on use --
	vocations = {4, 8}, -- Vocations -- 
	level = 130 -- Level requirment --
	
}
-- Config ends --
if exhaustion.check(cid, config.storage) == TRUE then
	doPlayerSendCancel(cid, "You are exhausted.")	
elseif(((getPlayerLevel(cid) < config.level) or (not isInArray(config.vocations, getPlayerVocation(cid)))) and
	not getPlayerCustomFlagValue(cid, PlayerCustomFlag_GamemasterPrivileges))
	then
	doCreatureSay(itemEx.uid, "Only knights of level 130 or above may drink this fluid.", TALKTYPE_ORANGE_1)
else	
	doCreatureAddHealth(cid, config.formula)
	exhaustion.set(cid, config.storage, 1)
	doSendMagicEffect(getThingPos(cid),config.effect)
	doTransformItem(item.uid, 7635)
	doCreatureSay(cid, config.text, TALKTYPE_ORANGE_1)
end
	return TRUE
end
 
Last edited:
Back
Top