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

Manarune, Only want mage to be able to use rep++

Dalale

GX
Joined
Jun 13, 2008
Messages
718
Reaction score
2
Location
Sweden
Manarune, Only want mage to be able to use
Druid, Elder druid, Sorcerer, Master sorcerer

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

function onUse(cid, item, fromPosition, itemEx, toPosition)
	local level, mlevel = getPlayerLevel(cid), getPlayerMagLevel(cid)
	local mana_minimum = level * 1.7 + mlevel * 1.7 - 50
	local mana_maximum = level * 1.9 + mlevel * 1.9
	doPlayerAddMana(cid, math.random(mana_minimum, mana_maximum))
	doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)
	doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1)
if item.type > 1 then
	doChangeTypeItem(item.uid, item.type - 1)
end
	return TRUE
end
 
add this in data/spells/spells.xml
<rune name="Manarune" id="XXXX" allowfaruse="1" charges="X" lvl="X" maglv="X" exhaustion="X" needtarget="1" blocktype="solid" event="script" value="YOUR_MANARUNE_FILE">
<vocation id="1"/>
<vocation id="2"/>
<vocation id="5" showInDescription="0"/>
<vocation id="6" showInDescription="0"/>
</rune>

rep++ :thumbup:
 
Code:
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, getConfigInfo('timeBetweenExActions') - 100)

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if isPlayer(itemEx.uid) == TRUE and isSorcerer(cid) == TRUE or isDruid(cid) == TRUE then
		local level, mlevel = getPlayerLevel(cid), getPlayerMagLevel(cid)
		local mana_minimum = level * 1.7 + mlevel * 1.7 - 50
		local mana_maximum = level * 1.9 + mlevel * 1.9
		doPlayerAddMana(cid, math.random(mana_minimum, mana_maximum))
		doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)
		doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1)
		doAddCondition(cid, exhaust)
		return TRUE, item.type > 1 and doChangeTypeItem(item.uid, item.type - 1) or doRemoveItem(item.uid)
	else
		doPlayerSendCancel(cid, "Your vocation cannot use this rune.")
		return TRUE
	end
end
 
Last edited:
Code:
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, getConfigInfo('timeBetweenExActions') - 100)

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if isSorcerer(cid) == TRUE or isDruid(cid) == TRUE then
		local level, mlevel = getPlayerLevel(cid), getPlayerMagLevel(cid)
		local mana_minimum = level * 1.7 + mlevel * 1.7 - 50
		local mana_maximum = level * 1.9 + mlevel * 1.9
		doPlayerAddMana(cid, math.random(mana_minimum, mana_maximum))
		doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)
		doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1)
		doAddCondition(cid, exhaust)
		return TRUE, item.type > 1 and doChangeTypeItem(item.uid, item.type - 1) or doRemoveItem(item.uid)
	else
		doPlayerSendCancel(cid, "Your vocation cannot use this rune.")
		return TRUE
	end
end

thanks, havent try it yet, but, if you try to cast the manarune on your friend im getting a error

Code:
[16/01/2010 20:55:21] [Error - Action Interface] 
[16/01/2010 20:55:21] data/actions/scripts/other/manarune.lua:onUse
[16/01/2010 20:55:21] Description: 
[16/01/2010 20:55:21] (luaDoCreatureSay) Creature not found
 
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition
local cfg = { level, mlevel = getPlayerLevel(cid), getPlayerMagLevel(cid), mana_minimum = level * 1.7 + mlevel * 1.7 - 50,  mana_maximum = level * 1.9 + mlevel * 1.9,  vocs = { 5, 6, 7, 8 }, level, mlevel = getPlayerLevel(cid), getPlayerMagLevel(cid),  mana_minimum = level * 1.7 + mlevel * 1.7 - 50,  mana_maximum = level * 1.9 + mlevel * 1.9,  vocs = { 5, 6, 7, 8 }}
		if isInArray(cfg.vocs, getPlayerVocation(cid)) == true then
			      setConditionParam(createConditionObject(CONDITION_EXHAUST), CONDITION_PARAM_TICKS, getConfigInfo('timeBetweenExActions') - 100)
				if getPlayerVocation(cid), isInArray(cfg.vocs) == true then
	         doPlayerAddMana(cid, math.random(mana_minimum, mana_maximum))
	     doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)
	doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1)
  if item.type > 1 then
doChangeTypeItem(item.uid, item.type - 1)
	else
		doPlayerSendCancel(cid, "Your vocation cannot use this rune.")
		return TRUE
	end
end
 
Back
Top