• 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 mana potion

Amanek

New Member
Joined
May 15, 2013
Messages
11
Reaction score
0
Code:
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 1200))
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local level = getPlayerLevel(cid)
	local mlevel = getPlayerMagLevel(cid)
	local mana_minimum = (level * 3.5) - 50
	local mana_maximum = (level * 3.7)
	local mana_add = math.random(mana_minimum, mana_maximum)
 
 
	if((not(isSorcerer(itemEx.uid) or isDruid(itemEx.uid)) or getPlayerLevel(itemEx.uid) < 1) and getPlayerCustomFlagValue(itemEx.uid, PlayerCustomFlag_GamemasterPrivileges) == FALSE) then
		doCreatureSay(itemEx.uid, "Only sorcerer and druid of level 1 or above may drink this fluid.", TALKTYPE_ORANGE_1)
		return TRUE
	end
 
	doPlayerAddMana(cid, mana_add)
	doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)
	doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1)
	return TRUE
end

here's problem bugg.JPG

Code:
getPlayerCustomFlagValue(itemEx.uid, PlayerCustomFlag_GamemasterPrivileges) == FALSE
What do that line of code?
 
LUA:
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 1200))
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local level = getPlayerLevel(cid)
	local mlevel = getPlayerMagLevel(cid)
	local mana_minimum = (level * 3.5) - 50
	local mana_maximum = (level * 3.7)
	local mana_add = math.random(mana_minimum, mana_maximum)
        local voc = {1,2,5,6}
 
 
	if((not inArray(cid, getPlayerVocation(cid)) or getPlayerLevel(itemEx.uid) < 1)) then
		doCreatureSay(cid, "Only sorcerer and druid of level 1 or above may drink this fluid.", TALKTYPE_ORANGE_1)
		return TRUE
	end
 
	doPlayerAddMana(cid, mana_add)
	doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_BLUE)
		doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1)
	return TRUE
end
 
Last edited:
Back
Top