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

Mixed Rune

XouruS

Active Member
Joined
Dec 29, 2009
Messages
941
Reaction score
36
Location
Canada
Yo, im tryed to make a rune that adds hp and mana. But i failed. :ninja:
Also i tryed _Arthurs script but it added only mana.

Code:
 function onUse(cid, item, fromPosition, itemEx, toPosition)
	local min, max = 0, 0

	
	local rand = math.random(min, max)
	if rand > 1600 then
		rand = 1600
	end
	
	if rand < 900 then
		rand = 900
	end
	
	if not isPlayer(itemEx.uid) then
		return doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
	end
	
	if(getCreatureMana(cid) >= getCreatureMaxMana(cid)) then
		return doPlayerSendCancel(cid, "Your mana is currently full.")
	end
	
	return doChangeTypeItem(item.uid, item.type - 1) and doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE) and doPlayerAddMana(itemEx.uid, rand) and doCreatureSay(itemEx.uid, "Mmmh, delicious!", TALKTYPE_ORANGE_1)
end

Can anyone help me?

Ty in advance. :)
 
local config = {
[1] = {100, 200},
[2] = {100, 200},
[3] = {100, 200},
[4] = {100, 200},
[5] = {100, 200},
[6] = {100, 200},
[7] = {100, 200},
[8] = {100, 200},
[9] = {500, 700},
[10] = {500, 700},
[11] = {500, 700},
[12] = {500, 700},
}

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, true)

function onCastSpell(cid, var)
for i, j in pairs(config) do
if getPlayerVocation(cid) == i then
doPlayerAddMana(cid,math.random(j[1],j[2]))
doCreatureAddHealth(cid, math.random(j[1],j[2]), 65535, 256, true)
end
end
return doCombat(cid, combat, var)
end
[1] = {100, 200},
[1] = vocacion id
100 = hp
200 = mana
 
I've made the script before, so.. I did this one, I spent 1 minute, max.
but this is how I remember doing it, when I first did it. o_O

it goes in spells, just like a rune should. Not actions.
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
setHealingFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 5, 5, 10, 14) -- same as heal friend spell.

function onCastSpell(cid, var)
    doPlayerAddMana(cid, math.random(1000, 2000) -- edit these for the mana you want it to heal
	return doCombat(cid, combat, var)
end

If this doesn't work, I can check my posts and see if I can find it. I remember releasing it.
 
you can use this too if you want an action one :p
Lua:
local config = {
					Add_Mana = true, 		--- enable mana adding
					
					Add_Health=true,		--- enable health
					
					USE_Fomula = false,		-- enable formula usage , false if not
					
					formula_mana = 	function (cid,lvl,mlvl)  -- so i think you know what you would edit here
										local add = { 
														min = ( mlvl * 2 ) + ( lvl / 4 ) ,
														max = ( mlvl * 3 ) + ( lvl / 2 ) 
													}
										return math.random(add.min,add.max)
									end,
									
					formula_heal = 	function (cid,lvl,mlvl)
										local add = { 
														min = ( mlvl * 2 ) + ( lvl / 4 ) ,
														max = ( mlvl * 3 ) + ( lvl / 2 ) 
													}
										return math.random(add.min,add.max)
									end	,		
				
					
					--[[ USE_Fomula = false ]]--
					
					mana = {min = 100, max = 150 },		
					
					health = {min = 100, max = 150 },
					
					remove_charges = true,
					
					exhaust = 1 -- in seconds , sure u know how to make it less than that, set this to 0 and  reduce timeBetweenExaction in config.lua 
					
				}
					
local storage = 238829  -- empty storage

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if 	exhaustion.get(cid, storage) then
		doPlayerSendCancel(cid,"You are exhausted.")
		return true
	end
	exhaustion.set(cid, storage, config.exhaust)	
	if config.Add_Mana then
		doCreatureAddMana(cid, ( config.USE_Fomula and config.formula_mana(cid,getPlayerLevel(cid),getPlayerMagLevel(cid)) or math.random(config.mana.min,config.mana.max)  ) )
	end
	if config.Add_Health then
		doCreatureAddHealth(cid, ( config.USE_Fomula and config.formula_heal(cid,getPlayerLevel(cid),getPlayerMagLevel(cid)) or math.random(config.health.min,config.health.max) )  )
	end

return config.remove_charges and doRemoveItem(item.uid,1)
end
 
you can use this too if you want an action one :p
Lua:
local config = {
					Add_Mana = true, 		--- enable mana adding
					
					Add_Health=true,		--- enable health
					
					USE_Fomula = false,		-- enable formula usage , false if not
					
					formula_mana = 	function (cid,lvl,mlvl)  -- so i think you know what you would edit here
										local add = { 
														min = ( mlvl * 2 ) + ( lvl / 4 ) ,
														max = ( mlvl * 3 ) + ( lvl / 2 ) 
													}
										return math.random(add.min,add.max)
									end,
									
					formula_heal = 	function (cid,lvl,mlvl)
										local add = { 
														min = ( mlvl * 2 ) + ( lvl / 4 ) ,
														max = ( mlvl * 3 ) + ( lvl / 2 ) 
													}
										return math.random(add.min,add.max)
									end	,		
				
					
					--[[ USE_Fomula = false ]]--
					
					mana = {min = 100, max = 150 },		
					
					health = {min = 100, max = 150 },
					
					remove_charges = true,
					
					exhaust = 1 -- in seconds , sure u know how to make it less than that, set this to 0 and  reduce timeBetweenExaction in config.lua 
					
				}
					
local storage = 238829  -- empty storage

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if 	exhaustion.get(cid, storage) then
		doPlayerSendCancel(cid,"You are exhausted.")
		return true
	end
	exhaustion.set(cid, storage, config.exhaust)	
	if config.Add_Mana then
		doCreatureAddMana(cid, ( config.USE_Fomula and config.formula_mana(cid,getPlayerLevel(cid),getPlayerMagLevel(cid)) or math.random(config.mana.min,config.mana.max)  ) )
	end
	if config.Add_Health then
		doCreatureAddHealth(cid, ( config.USE_Fomula and config.formula_heal(cid,getPlayerLevel(cid),getPlayerMagLevel(cid)) or math.random(config.health.min,config.health.max) )  )
	end

return config.remove_charges and doRemoveItem(item.uid,1)
end

works, but i dont want it to spamm the ammount added :p
can you remove that and add a text and effect instead?
 
actually it dont post the amount added, the amount added is normally shown if you enabled the showhealdamadge in cnfig.lua w/e it is called, this enables to show how much u was healed, so if you dont want that just disable it..
 
Lua:
-- Created using QtLuaPad on pet vlj 4 2011
-- Written by: M4t30.

local = {
mag = getPlayerMagLevel(cid)
}
function onUse(cid, item, frompos, item2, topos)
	ifmag >= xx then	-- Set Player magic level here
	doPlayerAddHealth(cid, xxxx) -- How much will it give health
	else 
	doPlayerSendCancel(cid,"You don't have egnouh magic level to use this rune")
	end
	if item.type > 1 then
	end
	ifmag >= xx then
	doPlayerAddMana(cid,xxxx) -- How much gonna give mana
	else
	doPlayerSendCancel(cid,"You don't have egnouh magic level to use this rune")
    if item.type > 1 then
	end
	return TRUE
end
Dind test em..

And in actions add
XML:
<action itemid="xxx" script="mixed.lua" />
-- where xxxx comes add id of rune
 
The fuly-working mixed rune [UPGRADED/NON-UPGRADED]

UPGRADED MIXED RUNE [ACTION]
Go to actions/scripts/runes/Create mixed rune.lua
Code:
function onUse(cid, item, frompos, item2, topos)
mag = getPlayerMagLevel(cid)
if mag >= 0 then
doSendMagicEffect(topos,14)
doCreatureSay(cid,"Upgraded Mixed Rune",19)
doPlayerAddMana(cid, 150000)
doCreatureAddHealth(cid,300000)
if item.type > 1 then
doChangeTypeItem(item.uid,item.type-1)
end
else
doSendMagicEffect(frompos,2)
doPlayerSendCancel(cid,"You don't have the required magic level to use that rune.")
end
return 1
end
Open actions.xml and paste this in it:
Code:
<action itemid="2282" script="runes/upgraded mixed RUNE.lua" />
[You can change the item ID]

MIXED RUNE [ACTION]
Create mixed rune.lua in actions/scripts/runes and paste this:
Code:
function onUse(cid, item, frompos, item2, topos)
mag = getPlayerMagLevel(cid)
if mag >= 0 then
doSendMagicEffect(topos, 14)
doCreatureSay(cid,"Mixed Rune",19)
doPlayerAddMana(cid, 125000)
doCreatureAddHealth(cid,200000)
if item.type > 1 then
doChangeTypeItem(item.uid,item.type-1)
end
else
doSendMagicEffect(frompos,2)
doPlayerSendCancel(cid,"You don't have the required magic level to use that rune.")
end
return 1
end
Open actions.xml and paste this:
Code:
<action itemid="2299" script="runes/Mixed rune.lua" />
[You can change the item ID]
Rep me if I helped. :)
 
Back
Top