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

Requesting : [Paying] Manarune

Breakdown

Be good, or be good at it
Joined
Feb 5, 2009
Messages
334
Reaction score
9

A manarune script ...


But this is how i would like it to work.

From level 20 to 50 it awards 85 mana per use.

From level 50 to 100 it awards 120 mana per use.

From level 100 to 200, it awards 200 mana per use.

Lastly, from level 200 to 9000000000000000000000 it awards 300 mana per use.


A more advance one i would love, but i dont care which one can be done is :

From level 20 to 50 awards 3% of total mana on use.

From level 50 to 100 awards 8% of total mana on use.

From level 100 to 200, it awards 12% of total mana on use.

From level 200 to 9999999999999999 it awards 15% of total mana on use.


If the second one cant be done, it's fine either one is great id just prefer the second one.

I will give 4 USD to the first person who makes the second one, and sends it to me in a private message keeping it confidential.
 
Don't pay money for a script that you can get for free :thumbup:.

Here it is..
data/spells/scripts create a manarune.lua
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)

function onCastSpell(cid, var)
	-- Script by Shawak

	-- DON'T TOUCH ------------------------
	local pct = 1          -- pct = procent
	local lv = getPlayerLevel(cid)
	local maxMana = getCreatureMaxMana(cid)
	---------------------------------------

	if lv <= 19 then
		pct = 2
	elseif lv >= 20 and lv <= 49 then
		pct = 3
	elseif lv >= 50 and lv <= 99 then
		pct = 8
	elseif lv >= 100 and lv <= 199 then
		pct = 12
	elseif lv >= 200 then
		pct = 15
	end
	doCreatureAddMana(cid,(maxMana / 100 * pct))
	return doCombat(cid, combat, var)
end

Post bugs here ;).

Regards,
Shawak
 
Last edited:
There's an issue with it ::

[05/06/2009 12:13:06] Lua Script Error: [Spell Interface]
[05/06/2009 12:13:06] data/spells/scripts/custom/manarune.lua:eek:nCastSpell

[05/06/2009 12:13:06] data/spells/scripts/custom/manarune.lua:12: attempt to perform arithmetic on global 'procent' (a nil value)
[05/06/2009 12:13:06] stack traceback:
[05/06/2009 12:13:06] data/spells/scripts/custom/manarune.lua:12: in function <data/spells/scripts/custom/manarune.lua:6>

Happens when i try to use it ingame.
 
Fixed.

Regards,
Shawak

Will that script remove charges from the rune?

And heres an error I have with it;

Code:
[05/06/2009 15:32:39] Lua Script Error: [Spell Interface] 
[05/06/2009 15:32:39] data/spells/scripts/custom/manarune.lua:onCastSpell

[05/06/2009 15:32:39] data/spells/scripts/custom/manarune.lua:12: attempt to perform arithmetic on global 'pct' (a nil value)
[05/06/2009 15:32:40] stack traceback:
[05/06/2009 15:32:40] 	data/spells/scripts/custom/manarune.lua:12: in function <data/spells/scripts/custom/manarune.lua:6>
 
Last edited:
Same error, crashed my server this time. Spells stopped working, had an error to accept the crash first

6egi8j.jpg
 
I´ll test it now, ;).

EDIT:
It work without any problem.

go to data/spells/spells.xml
and add:
PHP:
<rune name="Manarune" id="2300" allowfaruse="1" charges="1" lvl="1" maglv="1" exhaustion="1000" aggressive="0" needtarget="1" blocktype="solid" script="manarune.lua"/>
after that go to
data/spells/scripts and create a manarune.lua
paste:
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)

function onCastSpell(cid, var)
        -- Script by Shawak

        -- DON'T TOUCH ------------------------
        local pct = 1          -- pct = procent
        local lv = getPlayerLevel(cid)
        local maxMana = getCreatureMaxMana(cid)
        ---------------------------------------

        if lv <= 19 then
                pct = 2
        elseif lv >= 20 and lv <= 49 then
                pct = 3
        elseif lv >= 50 and lv <= 99 then
                pct = 8
        elseif lv >= 100 and lv <= 199 then
                pct = 12
        elseif lv >= 200 then
                pct = 15
        end
        doCreatureAddMana(cid,(maxMana / 100 * pct))
        return doCombat(cid, combat, var)
end
Then go to data/items/items.xml
And search for:
Lua:
	<item id="2300" article="a" name="spell rune">
		<attribute key="weight" value="120"/>
	</item>
Change it to:
Lua:
	<item id="2300" article="a" name="mana rune">
		<attribute key="weight" value="120"/>
		<attribute key="charges" value="1"/>
	</item>

Congratulations, now you are able to use the mana rune.

Regards,
Shawak
 
Last edited:
You forgot to change in items.xml this?

Lua:
        <item id="2300" article="a" name="mana rune">
                <attribute key="weight" value="120"/>
                <attribute key="charges" value="1"/>
        </item>

Regards,
Shawak
 
Try
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)

function onCastSpell(cid, var)
        -- Script by Shawak

        local item_id = ID OF MANARUNE

        -- DON'T TOUCH ------------------------
        local pct = 1          -- pct = procent
        local lv = getPlayerLevel(cid)
        local maxMana = getCreatureMaxMana(cid)
        ---------------------------------------

        if lv <= 19 then
                pct = 2
        elseif lv >= 20 and lv <= 49 then
                pct = 3
        elseif lv >= 50 and lv <= 99 then
                pct = 8
        elseif lv >= 100 and lv <= 199 then
                pct = 12
        elseif lv >= 200 then
                pct = 15
        end
        doCreatureAddMana(cid,(maxMana / 100 * pct))
        doRemoveItem(item_id,1)
        return doCombat(cid, combat, var)
end

Regards,
Shawak
 
ok. for me it's working, but if I use it I get error in console:
Code:
[08/06/2009 16:53:31] Lua Script Error: [Spell Interface] 
[08/06/2009 16:53:31] data/spells/scripts/custom/manarune.lua:onCastSpell

[08/06/2009 16:53:31] luaDoRemoveItem(). Item not found
hmm?
 
Back
Top