• 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 Manarune 1% failure

slayzer

Klaffen
Joined
Dec 28, 2008
Messages
301
Solutions
3
Reaction score
51
Location
Norway
Im not sure where to put it but:
how can i make it become like 1% chance for manarune (in this case frozen starlight) to fail and vanish just like normal rune?
here is my "manarune" script:
Code:
local t = {
	min = 1000,
	max = 1250,
	text = "Aaaah...",
	effect = CONST_ME_MAGIC_BLUE
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if isPlayer(itemEx.uid) then
		doPlayerAddMana(itemEx.uid, math.random(t.min, t.max))
		doCreatureSay(itemEx.uid, t.text, TALKTYPE_ORANGE_1)
		doSendMagicEffect(toPosition, t.effect)
	else
		doPlayerSendCancel(cid, "You can only use this rune on players.")
	end
	return true
end
 
@up Been too busy to try, but im hoping tha Rayeko's script work :p

Also, note that maybe the spellbook is already added by default for the "show spells" script. xD
allready tried to remove that funksjon on the spellbook hoping to get it work

EDIT: the script worked Rayeko :) Rep++ for you :D
 
Last edited:
With 1.5 sec exhaust. Easy to configure in the config panel.

Did also a bugfix. DoPlayerAddMana --> DoCreatureAddMana
Lua:
local exhaust = createConditionObject(CONDITION_EXHAUST_HEAL)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, _config.cooldown)

local _config = {
	min = 10000,
	max = 12500,
	text = "Mana (:",
	cancelText = "You are exhausted!",
	cooldown = 1500, -- Write in milli seconds, 0 to disable. 1500 = 1.5 seconds.
	effect = CONST_ME_MAGIC_BLUE
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(getCreatureCondition(cid, CONDITION_EXHAUST_HEAL) == FALSE) then
			doCreatureAddMana(cid, math.random(_config.min, _config.max))
			doCreatureSay(cid, _config.text, TALKTYPE_ORANGE_1)
			doSendMagicEffect(getCreaturePosition(cid), _config.effect)
		else
		doPlayerSendCancel(cid, _config.cancelText)
		end
		return true
end

Perhaps it does not work on that spellbook because it is already being loaded in movements.xml
 
Last edited:
Back
Top