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

Mana Health Special rune

killing

Member
Joined
Feb 23, 2012
Messages
815
Reaction score
11
Location
BIH
Special MR!
-I want to player Get more mana with lvl..for example player up lvl 100 and special MR giv 1000 mana more,Player up 150 lvl Player use the Special MR,player get 1500 mana...and so on.(Server max lvl 800)
-Same for the UH..
I hope you understand me.
And i want to know wher to put that script..
 
The rune ids are as example.
actions.xml
XML:
<action itemid="2275;2307" event="script" value="other/levelrunes.lua"/>

levelrunes.lua
Lua:
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, 1000) -- time in seconds x1000

function onUse(cid, item, fromPosition, itemEx, toPosition)

local config = {

	Manarune = {
	id = 2275,
	vocations = {1,2,5,6},
	mana = getPlayerLevel(cid) * 10
	},

	Healthrune = {
	id = 2307,
	vocations = {3,4,7,8},
	health = getPlayerLevel(cid) * 10
	}
}

	if(hasCondition(cid, CONDITION_EXHAUST)) then
        	doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) 
		doPlayerSendCancel(cid, "You are exhausted")
		return true
	end

	if item.itemid == config.Manarune.id then
		if isInArray(config.Manarune.vocations, getPlayerVocation(cid)) then
			doPlayerAddMana(cid, config.Manarune.mana)
			doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
			doSendAnimatedText(getPlayerPosition(cid),""..config.Manarune.mana.."", TEXTCOLOR_LIGHTBLUE)
			doAddCondition(cid, exhaust) 
		else
			doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) 
			doPlayerSendCancel(cid, "This rune is only for sorcerers and druids.")
		end
	end

	if item.itemid == config.Healthrune.id then
		if isInArray(config.Healthrune.vocations, getPlayerVocation(cid)) then
			doCreatureAddHealth(cid, config.Healthrune.health)
			doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
			doSendAnimatedText(getPlayerPosition(cid),""..config.Healthrune.health.."", TEXTCOLOR_GREEN)
			doAddCondition(cid, exhaust) 
		else
			doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) 
			doPlayerSendCancel(cid, "This rune is only for paladins and knights.")
		end
	end
	return true
end
 
the rune ids are as example.
Actions.xml
XML:
<action itemid="2275;2307" event="script" value="other/levelrunes.lua"/>

levelrunes.lua
Lua:
local exhaust = createconditionobject(condition_exhaust)
setconditionparam(exhaust, condition_param_ticks, 1000) -- time in seconds x1000

function onuse(cid, item, fromposition, itemex, toposition)

local config = {

	manarune = {
	id = 2275,
	vocations = {1,2,5,6},
	mana = getplayerlevel(cid) * 10
	},

	healthrune = {
	id = 2307,
	vocations = {3,4,7,8},
	health = getplayerlevel(cid) * 10
	}
}

	if(hascondition(cid, condition_exhaust)) then
        	dosendmagiceffect(getthingpos(cid), const_me_poff) 
		doplayersendcancel(cid, "you are exhausted")
		return true
	end

	if item.itemid == config.manarune.id then
		if isinarray(config.manarune.vocations, getplayervocation(cid)) then
			doplayeraddmana(cid, config.manarune.mana)
			dosendmagiceffect(getthingpos(cid), const_me_magic_blue)
			dosendanimatedtext(getplayerposition(cid),""..config.manarune.mana.."", textcolor_lightblue)
			doaddcondition(cid, exhaust) 
		else
			dosendmagiceffect(getthingpos(cid), const_me_poff) 
			doplayersendcancel(cid, "this rune is only for sorcerers and druids.")
		end
	end

	if item.itemid == config.healthrune.id then
		if isinarray(config.healthrune.vocations, getplayervocation(cid)) then
			docreatureaddhealth(cid, config.healthrune.health)
			dosendmagiceffect(getthingpos(cid), const_me_magic_blue)
			dosendanimatedtext(getplayerposition(cid),""..config.healthrune.health.."", textcolor_green)
			doaddcondition(cid, exhaust) 
		else
			dosendmagiceffect(getthingpos(cid), const_me_poff) 
			doplayersendcancel(cid, "this rune is only for paladins and knights.")
		end
	end
	return true
end


thanks!!!!!!!!!

- - - Updated - - -

It WORKS!!
 
Back
Top