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

Can someone make this manarune take charges away.

Cornwallis

Member
Joined
Jan 3, 2010
Messages
480
Reaction score
16
I did not, obviousely, clearly state what i wanted because i did not know how to word it short ): well, i need it to take charges away! D: ty!
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local level, mlevel = getPlayerLevel(cid), getPlayerMagLevel(cid)
	local mana_minimum = level * 2.2 + mlevel * 10.0 
	local mana_maximum = level * 2.3 + mlevel * 10.0
	doPlayerAddMana(cid, math.random(mana_minimum, mana_maximum))
	doSendMagicEffect(getThingPos(itemEx.uid), 12)
	return TRUE

end
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if not isPlayer(itemEx.uid) then
		return doPlayerSendCancel(cid, 'You can only use this rune on players.')
	end
	local level, mlevel = getPlayerLevel(cid), getPlayerMagLevel(cid)
	local mana_minimum = level * 2.2 + mlevel * 10.0 
	local mana_maximum = level * 2.3 + mlevel * 10.0
	doPlayerAddMana(itemEx.uid, math.random(mana_minimum, mana_maximum))
	doSendMagicEffect(toPosition, 12)
	doChangeTypeItem(item.uid, item.type - 1)
	return true
end
 
You mean only if they can wear the outfit?

Code:
	if canPlayerWearOutfit(cid, getPlayerSex(cid) == 0 and 154 or 158, 1 and 2) then
		if canPlayerWearOutfit(cid, getPlayerSex(cid) == 0 and 145 or 149, 1 and 2) then
			-- do something --
		else
			doPlayerSendCancel(cid, "Sorry, you must be able to wear the Wizard outfit.")
		end
	else
		doPlayerSendCancel(cid, "Sorry, you must be able to wear the Shaman outfit.)
	end
 
haha, I'm sorry i forgot to say that i changed my vocation names, sorcerer is wizard, and and druid is shaman :D I gotta admit, to be able to only use an item if you have a certain outfit is fucking amazing! I might have to use that some time :p
 
Ahh, well then you need to use...
Code:
	if getPlayerVocation(cid) == [COLOR="Red"]9[/COLOR] then
		if getPlayerVocation(cid) == [COLOR="Red"]10[/COLOR] then
			-- do something --
		else
			doPlayerSendCancel(cid, "Sorry, you must be a Wizard.")
		end
	else
		doPlayerSendCancel(cid, "Sorry, you must be a Shaman.")
	end
 
LUA:
local vocations = {1,2,5,6}  --Druid, sorc + promotion

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if not isPlayer(itemEx.uid) then
		return doPlayerSendCancel(cid, 'You can only use this rune on players.')
	end
	if not(isInArray(vocations,getPlayerVocation(itemEx.uid)) or getPlayerLevel(itemEx.uid) >= 80) then
		return doCreatureSay(itemEx.uid, "Only sorcerers and druids of level 80 and above may use this manarune.",TALKTYPE_ORANGE_1)
	end
	local level, mlevel = getPlayerLevel(cid), getPlayerMagLevel(cid)
	local mana_minimum = level * 2.2 + mlevel * 10.0 
	local mana_maximum = level * 2.3 + mlevel * 10.0
	doPlayerAddMana(itemEx.uid, math.random(mana_minimum, mana_maximum))
	doSendMagicEffect(toPosition, 12)
	doChangeTypeItem(item.uid, item.type - 1)
	return true
end
 
Sorry my bad..
Change:
if not(isInArray(vocations,getPlayerVocation(itemEx.uid)) or getPlayerLevel(itemEx.uid) >= 80) then
to:
if not(isInArray(vocations,getPlayerVocation(itemEx.uid)) and getPlayerLevel(itemEx.uid) >= 80) then
 
Sorry my bad..
Change:
if not(isInArray(vocations,getPlayerVocation(itemEx.uid)) or getPlayerLevel(itemEx.uid) >= 80) then
to:
if not(isInArray(vocations,getPlayerVocation(itemEx.uid)) and getPlayerLevel(itemEx.uid) >= 80) then

lol no! :p

if not isInArray(vocations, getPlayerVocation(cid)) or getPlayerLevel(cid) < 80 then
 
Back
Top