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

Windows mana rune !!

Teddy

SweStream.se
Joined
Oct 2, 2008
Messages
3,797
Reaction score
10
Location
Sweden 172
can i make this script only work for sorc and druid's ?

Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)

function onCastSpell(cid, var)
    local mana = math.random(300, 500)
    doPlayerAddMana(cid, mana)
    --doSendAnimatedText(getPlayerPosition(cid), '+' .. mana, TEXTCOLOR_GOLD)
    return doCombat(cid, combat, var)
end
 
Here is KNIGHT Uh if its help :D
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_YELLOW)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, FALSE)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)

function onGetFormulaValues(cid, level, maglevel)
	min = (level * 1 + maglevel * 4) * 2.5
	max = (level * 1 + maglevel * 4) * 2.8
	if min < 700 then
		min = 800
	end
	return min, max
end

setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

function onCastSpell(cid, var)
if(isInArray({4,8}, getPlayerVocation(cid)) == TRUE) then
	return doCombat(cid, combat, var)
	else
    	doPlayerSendTextMessage(cid,22,"Only Knight And Elite Knight Can Use This Rune...")
    	doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
  end
  	return TRUE
end
 
It will only work in Linux unfortunately.

Huh? What are you talking about lmao thats so wrong.

Chipsen, the only thing you need to do is to go to spells.xml, then find your manarune there and set it to be usable by those vocations only. For example, lets look at Holy Missile Rune:

Code:
	<rune name="Holy Missile" id="2295" allowfaruse="1" charges="5" lvl="27" maglv="4" exhaustion="2000" needtarget="1" blocktype="solid" event="script" value="attack/holy missile.lua">
[B][COLOR="Blue"]		<vocation name="Paladin"/>
		<vocation name="Royal Paladin" showInDescription="0"/>[/COLOR][/B]
	</rune>

Just add those lines on your respective rune and should work correctly! Also remember that when you add vocations to runes/spells, you need to be aware of not putting the /> after the location/name of the script, but at the end of the last vocation putting </rune>, just like up there. Which means:

<rune name="Holy Missile" id="2295" allowfaruse="1" charges="5" lvl="27" maglv="4" exhaustion="2000" needtarget="1" blocktype="solid" event="script" value="attack/holy missile.lua">
<vocation name="Paladin"/>
<vocation name="Royal Paladin" showInDescription="0"/>
</rune>

Hope it helps.

PS: If it doesnt work that way (dont see why it shouldnt, considering Holy Missile works perfect), then you could try mixing both of the scripts you posted, doing it like this:

LUA:
local combat = createCombatObject()
	setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
	setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1)
	setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)

function onCastSpell(cid, var)
    local mana = math.random(300, 500)
    doPlayerAddMana(cid, mana)
		--doSendAnimatedText(getPlayerPosition(cid), '+' .. mana, TEXTCOLOR_GOLD)
			if(isInArray({3,7}, getPlayerVocation(cid)) == TRUE) then
				return doCombat(cid, combat, var)
			else
				doPlayerSendTextMessage(cid,22,"Only Paladins and Royal Paladins can use this rune.")
				doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
			end
	return TRUE
end

Dont promise it will work but its worth a shot, only if the first one didnt work.
Cheers~
 
Last edited:
Ahh srry was thinking of another thread concerning paladins lol, just change to the respective IDs.

Sorcerer =1, Druid = 2.

LUA:
 if(isInArray({1,2}, getPlayerVocation(cid)) == TRUE) then
                                return doCombat(cid, combat, var)
                        else
                                doPlayerSendTextMessage(cid,22,"Only Sorcerers and Druids can use this rune.")
                                doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
                        end

But did you try the spells.xml part? That one should work fine and it doesnt require scripting.
 
Back
Top