• 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
 
should work:

Lua:
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
		if math.random(1, 100) == 1 then
		doRemoveItem(item.uid, 1)
		end
		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
 
Sorry for double post but
Code:
local t = {
	min = 10000,
	max = 12500,
	text = "Mana (:",
	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, "Screw This..")
	end
	return true
end
what is the mistake in the script? i mean, im not sure why it wont work on shield, in this case spellbook of dark mysteries. please tell me whats wrong.
already fixed
Code:
	<action itemid="8918" event="script" value="liquids/Shield manarune.lua"/>
 
Sorry for double post but
Code:
local t = {
	min = 10000,
	max = 12500,
	text = "Mana (:",
	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, "Screw This..")
	end
	return true
end
what is the mistake in the script? i mean, im not sure why it wont work on shield, in this case spellbook of dark mysteries. please tell me whats wrong.
already fixed
Code:
	<action itemid="8918" event="script" value="liquids/Shield manarune.lua"/>

What do you mean?
 
i wanted the script to work like this: you could just right click on an item to restore mana like manarune. worked when i used the script for Frozen Starlight but not when i tried it on Spellbook of dark something
 
should work:

Lua:
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
		if math.random(1, 100) == 1 then
		doRemoveItem(item.uid, 1)
		end
		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


Richux,you bastard. I remember time when u weren't able to write simple script. I am suprised xD and who would think that my litte student became such good scripter :) xD
 
The script doesnt work, i think its because you have to click on target to get mana from it. and equip like shields, you cant do it.
can anyone Please fix the script for me? like make it "onclick/onuse" of some kind
rep++
 
Sorry for double post but
Code:
local t = {
	min = 10000,
	max = 12500,
	text = "Mana (:",
	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, "Screw This..")
	end
	return true
end
what is the mistake in the script? i mean, im not sure why it wont work on shield, in this case spellbook of dark mysteries. please tell me whats wrong.
already fixed
Code:
	<action itemid="8918" event="script" value="liquids/Shield manarune.lua"/>

As someone before said, this won't work 'cause the script is based on "Use with.." but, you can make it work just making "Use" of it without client editing. You need a different script, like this:
Code:
local t = {
	min = 10000,
	max = 12500,
	text = "Mana (:",
	effect = CONST_ME_MAGIC_BLUE
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
		doPlayerAddMana(cid, math.random(t.min, t.max))
		doCreatureSay(cid, t.text, TALKTYPE_ORANGE_1)
		doSendMagicEffect(getCreaturePosition(cid), t.effect)
	return true
end

Also, note that maybe the spellbook is already added by default for the "show spells" script. xD
 
Last edited:
As someone before said, this won't work 'cause the script is based on "Use with.." but, you can make it work just making "Use" of it without client editing. You need a different script, like this:
Code:
local t = {
	min = 10000,
	max = 12500,
	text = "Mana (:",
	effect = CONST_ME_MAGIC_BLUE
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
		doPlayerAddMana(cid, math.random(t.min, t.max))
		doCreatureSay(cid, t.text, TALKTYPE_ORANGE_1)
		doSendMagicEffect(toPosition, t.effect)
	return true
end

Also, note that maybe the spellbook is already added by default for the "show spells" script. xD

It would still be "Use with...".
 
Back
Top