• 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 Hey i want a script to manarune so it shows how much it heals.! rep++ if u help me

kuk124

Banned User
Joined
May 6, 2010
Messages
271
Reaction score
6
Location
Homeless.
Hey i need a manarnue script to show how much mana heals so players can see how much they are mana they sry for bad english :wub:
 
Its better all manarunes in 1 script ;)
I Scripted this mana rune.. Easy config, how mana, vocations , etc..
Only Edit IDS 2264; etc.. for other ID your manarune and script same..
actions.xml
LUA:
<action itemid="2264;2270;2297" event="script" value="liquids/manarune.lua" allowfaruse="1"/>
manarune.lua
LUA:
local config = {
	removeOnUse = "no",
	splashable = "no",
	realAnimation = "no",
	healthMultiplier = 1.0,
	manaMultiplier = 1.0
}

config.removeOnUse = getBooleanFromString(config.removeOnUse)
config.splashable = getBooleanFromString(config.splashable)
config.realAnimation = getBooleanFromString(config.realAnimation)

local POTIONS = {
	[2270] = {empty = 7635, splash = 2, mana = {150, 250}, level = 1, vocations = {4, 8, 12}, vocStr = "knights"}, -- knight manarune
	[2264] = {empty = 7635, splash = 7, mana = {400, 500}, level = 1, vocations = {1, 2, 5, 6, 9, 10}, vocStr = "sorcerers and druids"}, -- mages manarune
	[2297] = {empty = 7635, splash = 3, mana = {200, 300}, level = 1, vocations = {3, 7, 11}, vocStr = "paladins"} -- paladin maanarune
}

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

function onUse(cid, item, fromPosition, itemEx, toPosition)
	local potion = POTIONS[item.itemid]
	if(not potion) then
		return false
	end

	if(not isPlayer(itemEx.uid)) then
		if(not config.splashable) then
			return false
		end

		if(toPosition.x == CONTAINER_POSITION) then
			toPosition = getThingPos(item.uid)
		end

		doDecayItem(doCreateItem(2016, potion.splash, toPosition))
		doTransformItem(item.uid, potion.empty)
		return true
	end

	if(hasCondition(cid, CONDITION_EXHAUST_HEAL)) then
		doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
		return true
	end

	if(((potion.level and getPlayerLevel(cid) < potion.level) or (potion.vocations and not isInArray(potion.vocations, getPlayerVocation(cid)))) and
		not getPlayerCustomFlagValue(cid, PlayerCustomFlag_GamemasterPrivileges))
	then
		doCreatureSay(itemEx.uid, "Solo " .. potion.vocStr ..  " pueden usar esta manarune.", TALKTYPE_ORANGE_1)
		return true
	end

	local health = potion.health
	if(health and not doCreatureAddHealth(itemEx.uid, math.ceil(math.random(health[1], health[2]) * config.healthMultiplier))) then
		return false
	end

	local mana = potion.mana
	if(mana and not doPlayerAddMana(itemEx.uid, math.ceil(math.random(mana[1], mana[2]) * config.manaMultiplier))) then
		return false
	end

	doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)
	if(not realAnimation) then
		doCreatureSay(itemEx.uid, "Manarune rox...", TALKTYPE_ORANGE_1)
	else
		for i, tid in ipairs(getSpectators(getCreaturePosition(cid), 1, 1)) do
			if(isPlayer(tid)) then
				doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1, false, tid)
			end
		end
	end

	doAddCondition(cid, exhaust)
	if(not potion.empty or config.removeOnUse) then
		doRemoveItem(item.uid)
		return true
	end
	return true
end
 
Back
Top