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

Potion With Charges

SnowFox

New Member
Joined
May 18, 2008
Messages
264
Reaction score
0
Hey i would like potions SMP,GMP,SHP,GHP,UHP,GSP all the potions
with 10x charges on them meaning you can use A potion 10 times before it disappears. Please if someone could release this for me it will be really greatful im using 8.4 SQL.

I DID USE SEARCH AND FOUND NOTHING SO DONT SAY SEARCH!
 
Hey i would like potions SMP,GMP,SHP,GHP,UHP,GSP all the potions
with 10x charges on them meaning you can use A potion 10 times before it disappears. Please if someone could release this for me it will be really greatful im using 8.4 SQL.

I DID USE SEARCH AND FOUND NOTHING SO DONT SAY SEARCH!
I'm pretty sure this would require .DAT modification.
 
yeah i think so too
u cant give numbers to potions
but u can make without them too
make an item action script, give them charges -but u wont see numbers on potion-
i think that will work
 
Better make runes of it lol.. how serious does this sound?

Code:
Heh, today I boght a cup of coffee with 10 charges, I got 9 charges left now, I'll use them later...
 
Xaroth, what about gulps? It's not like you drink a whole bottle of something at once, now is it?
 
In DAT editor find your potion id and select Stackable or Charges...
I am not sure but you can do this by using OTItem Editor too :)
 
Last edited:
You can also storing charges in actionId

example:
Code:
	if(item.actionid == 0) then
		doSetItemActionId(item.uid, 99 + 3) -- 3 = charges
		return TRUE
	end

	local _charges = item.actionid - 100
	if(_charges > 1) then
		doSetItemActionId(item.uid, item.actionid - 1)
	else
		doRemoveItem(item.uid)
	end

example health potion with this: (taken from TFS 0.3)
Code:
local MIN = 100
local MAX = 200
local EMPTY_POTION = 7636
local CHARGES = 3

local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100))

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if isPlayer(itemEx.uid) == FALSE then
		return FALSE
	end

	if hasCondition(cid, CONDITION_EXHAUST_HEAL) == TRUE then
		doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
		return TRUE
	end

	if doCreatureAddHealth(itemEx.uid, math.random(MIN, MAX)) == LUA_ERROR then
		return FALSE
	end

	doAddCondition(cid, exhaust)
	doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)
	doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1)

	if(item.actionid == 0) then
		doSetItemActionId(item.uid, 99 + CHARGES)
		return TRUE
	end

	local _charges = item.actionid - 100
	if(_charges > 1) then
		doSetItemActionId(item.uid, item.actionid - 1)
	else
		doRemoveItem(item.uid)
	end

	return TRUE
end

It will automatically set actionid if its not setted. Defaulf charges are set in this script (CHARGES).

You can also set charges manually - command - /attr aid 100 + charges - example: /attr aid 150 (50 charges) - works only on TFS 0.3
 
Ahh Ok its just cause i sore an ot with it and thought it was cool ill just either put runes or try find an unlimited potion script thankyou anyways or your help
 
Back
Top