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

Potions

GiordanoBoss

New Member
Joined
Jan 12, 2009
Messages
22
Reaction score
0
xD im Back again.. haha always i get a new problem damn, but i didnt find where tofix it.. neither a post.. as i said.. im a lil noob :p...

Well now i got a new problem, i made 4 new voc.. everything works properly but when the new vocs try to use any pot, gives "Sorry, not posible" i went to potions.lua... and didnt know what tochange and what i tried,the pots stoped working...i hope you can help me...
or tell where to edit :p thanks...
 
xD im Back again.. haha always i get a new problem damn, but i didnt find where tofix it.. neither a post.. as i said.. im a lil noob :p...

Well now i got a new problem, i made 4 new voc.. everything works properly but when the new vocs try to use any pot, gives "Sorry, not posible" i went to potions.lua... and didnt know what tochange and what i tried,the pots stoped working...i hope you can help me...
or tell where to edit :p thanks...

does it still work for the regular vocations?

anyways you just need to add a new function isNEWVOC(cid) to your global.lua file then add the check to check the vocation in your potions
 
example on ultimate health potion:
Code:
local MIN = 800
local MAX = 1000
local EMPTY_POTION = 7635

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((not(isKnight(itemEx.uid)) or getPlayerVocation(cid) ~= 12 or getPlayerLevel(itemEx.uid) < 130) and getPlayerCustomFlagValue(itemEx.uid, PlayerCustomFlag_GamemasterPrivileges) == FALSE) then
		doCreatureSay(itemEx.uid, "Only knights of level 130 or above may drink this fluid.", TALKTYPE_ORANGE_1)
		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)
	doRemoveItem(item.uid,1)
	return TRUE
end

perhaps this might work.. if not try to play with:
Code:
getPlayerVocation(cid)

@edit
new functions put into /lib/functions.lua, constant values into constant.lua.
 
Back
Top