• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua help in mana rune

3alola1

I don't have time
Joined
Sep 2, 2010
Messages
928
Solutions
8
Reaction score
530
Location
Darashia
PHP:
function onUse(cid, item, frompos, item2, topos) 
mag = getPlayerMagLevel(cid) 
if mag >= 0 then 
doSendMagicEffect(topos,28) 
doCreatureSay(cid,"Infinty Manarune!",19) 
doSendAnimatedText(getPlayerPosition(cid), "+100000", TEXTCOLOR_PURPLE)
doPlayerAddMana(cid, 1000000) 
if item.type > 0 then 
end 
else 
doSendMagicEffect(frompos,2) 
doPlayerSendCancel(cid,"You don't have the required magic level to use that rune.") 
end 
return 1 
end

i need help in this i whant to make the rune health so fast!!!
 
LUA:
function onUse(cid, item, frompos, item2, topos) 
local _setup = {
			exhaust = createConditionObject(CONDITION_EXHAUST_HEAL),
			setConditionParam(_setup.exhaust, CONDITION_PARAM_TICKS, _setup.exhaustTime),
			exhaustTime = 1000 -- exhaust on time 1000 = 1 second exhaust. 10 = 10 second exhaust
		}
         
setConditionParam(_setup.exhaust, CONDITION_PARAM_TICKS, _setup.exhaustTime)	
 
	if(getCreatureCondition(cid, CONDITION_EXHAUST_HEAL) == TRUE) then
		doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
		return TRUE
	end
	
mag = getPlayerMagLevel(cid) 
if mag >= 0 then 
doSendMagicEffect(topos,28) 
doCreatureSay(cid,"Infinty Manarune!",19) 
doSendAnimatedText(getPlayerPosition(cid), "+100000", TEXTCOLOR_PURPLE)
doPlayerAddMana(cid, 1000000)
doAddCondition(cid, _setup.exhaust) 
if item.type > 0 then 
end 
else 
doSendMagicEffect(frompos,2) 
doPlayerSendCancel(cid,"You don't have the required magic level to use that rune.") 
end 
return 1 
end
 
Last edited:
made by i add functions down in onuse
try this
LUA:
local _setup = {
			exhaust = createConditionObject(CONDITION_EXHAUST_HEAL),
			setConditionParam(_setup.exhaust, CONDITION_PARAM_TICKS, _setup.exhaustTime),
			exhaustTime = 1000 -- exhaust on time 1000 = 1 second exhaust. 10 = 10 second exhaust
		}
 
setConditionParam(_setup.exhaust, CONDITION_PARAM_TICKS, _setup.exhaustTime)	
 
	if(getCreatureCondition(cid, CONDITION_EXHAUST_HEAL) == TRUE) then
		doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
		return TRUE
	end
function onUse(cid, item, frompos, item2, topos)  
mag = getPlayerMagLevel(cid) 
if mag >= 0 then 
doSendMagicEffect(topos,28) 
doCreatureSay(cid,"Infinty Manarune!",19) 
doSendAnimatedText(getPlayerPosition(cid), "+100000", TEXTCOLOR_PURPLE)
doPlayerAddMana(cid, 1000000)
doAddCondition(cid, _setup.exhaust) 
if item.type > 0 then 
end 
else 
doSendMagicEffect(frompos,2) 
doPlayerSendCancel(cid,"You don't have the required magic level to use that rune.") 
end 
return 1 
end
 
Chronox I don't really know where you learned this tabbing from but it's really horrible.. Also the original code was probably the worst code I've ever saw.

LUA:
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_SUBID, 1555)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, 5000)

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if isPlayer(cid) and (getCreatureCondition(cid, CONDITION_EXHAUST, 1555) == FALSE) then
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_FIREWORK_YELLOW)
		doSendAnimatedText(getCreaturePosition(cid), "+100000", TEXTCOLOR_PURPLE)
		doCreatureSay(cid, "Infinity Manarune!", TALKTYPE_ORANGE_1)
		doCreatureAddMana(cid, 100000)
		doAddCondition(cid, exhaust)
	else
		doPlayerSendCancel(cid "You are exhausted.")
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
	end
	return true
end
 
Last edited:
Hi mate Try this i dno if it will work not Tested but should work for 8.6


Manarune
LUA:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_MANADRAIN)
setCombatParam(combat, COMBAT_PARAM_EFFECT, 14)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, true)
function onGetFormulaValues(cid, level, maglevel)
	local min = (getCreatureMaxMana(cid) / 100) * 15
	local max = (getCreatureMaxMana(cid) / 100) * 25
	return min, max
end
setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

 
function onCastSpell(cid, var)	
	return doCombat(cid, combat, var)
end

Super Uh
LUA:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_MANADRAIN)
setCombatParam(combat, COMBAT_PARAM_EFFECT, 12)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, true)
function onGetFormulaValues(cid, level, maglevel)
	local min = (getCreatureMaxHealth(cid) / 100) * 15
	local max = (getCreatureMaxHealth(cid) / 100) * 25
	return min, max
end
setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

 
function onCastSpell(cid, var)	
	return doCombat(cid, combat, var)
end

Code:
local min = (getCreatureMaxHealth(cid) / 100) * 15
local max = (getCreatureMaxHealth(cid) / 100) * 25
return min, max

you can change the 15 + 25 to what ever you like

Full Credits To Loney For This Script
 
Last edited:
Back
Top