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

Code!

http://otland.net/f81/basic-manarune-based-upon-level-magic-level-99982/
All credits to JDB ^
If you dont want the mana rune to rise while you get lvls, use this one:

go to data/spells/scripts/healing/mana rune.lua
Code:
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)
	doPlayerAddMana(cid, math.random(500, 550))
	return doCombat(cid, combat, var)
end

and add in spells.xml

Code:
<rune name="Mana Rune" id="2294" allowfaruse="1" charges="1" lvl="1" maglv="5" exhaustion="750" aggressive="0" needtarget="1" blocktype="solid" event="script" value="healing/donor mana rune.lua"/>

then go to items.xml > find item 2294 and change name.

Done. If you use JDB's script all credit for him.
If you use mine please rep+ :)
 
Lol, and that is why im learning? And Manarune.lua isn't there.
Somebody?

Hehe, you will see some lua files there, copy one and paste it on the same folder but change the name to mana rune
Then you add what I told you to, and if you want it to heal 1k, change this
Code:
doPlayerAddMana(cid, math.random(500, 550))
to this:
Code:
doPlayerAddMana(cid, math.random(1000, 1100))

Then just follow what i told you to do and you will get the mana rune :)
Rep+ if it helped
 
So Im gonna create an own lua file and put this doPlayerAddMana(cid, math.random(1000, 1100))
in it?!

No lol!
Copy one, paste it, erase what it says and then change name to mana rune and add what i put in my 1st post..

Code:
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)
	doPlayerAddMana(cid, math.random(500, 550))  
	return doCombat(cid, combat, var)
end

But change the
Code:
doPlayerAddMana(cid, math.random(500, 550))
to:
Code:
doPlayerAddMana(cid, math.random(1000, 1050))

So it heals 1k. Then do what I told you at the first post!
 
Go to data/actions/scripts ,create file manarune.lua and put this:
PHP:
local storage = { 
    MinMana = 1000, --Minimum mana cure
    MaxMana = 1100, --Maximum mana cure
    CostIngotts = 1, --Cost 1 ingott
    IngottItemID = XXXX, --Edit this: XXXX = ingott item number , dont delete the ,
    Effect = 2 --Effect number
} 
function onUse(cid,var)
local minvalue = getPlayerStorageValue(cid, storage.MinMana) -- Dont edit this
local maxvalue = getPlayerStorageValue(cid, storage.MaxMana) -- Dont edit this
local cost = getPlayerStorageValue(cid, storage.CostIngotts) -- Dont edit this
local ingott = getPlayerStorageValue(cid, storage.IngottItemID) -- Dont edit this
local position = getPlayerPosition(cid)
local effect = getPlayerStorageValue(cid, storage.Effect)

doPlayerAddMana(cid, math.random(minvalue, maxvalue)) -- Dont edit this
doSendMagicEffect(position, effect) -- Dont edit this
doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1) -- Edit only the Aaaah
if item.type > 1 then
doChangeTypeItem(item.uid,item.type-1)
else
doRemoveItem(item.uid,1)
doRemoveItem(ingott.uid,cost)
end
return 1
end

then go to data/actions and open actions.xml & add line:
PHP:
<action itemid="XXXX" script="manarune.lua" allowfaruse="1" blockwalls="1" />
in the XXXX put your manarune item id.

-- If i helped u , add reputation.
 
Last edited:
Sorry but what is the manarune item id? XD
And anyway when i do it this shows up:

[11/09/2010 12:05:55] [Error - LuaScriptInterface::loadFile] cannot open data/actions/scripts/manarune.lua: No such file or directory
[11/09/2010 12:05:55] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/manarune.lua)
[11/09/2010 12:05:55] cannot open data/actions/scripts/manarune.lua: No such file or directory
 
Go to data/actions/scripts ,create file manarune.lua and put this:
PHP:
local storage = { 
    MinMana = 1000, --Minimum mana cure
    MaxMana = 1100, --Maximum mana cure
    CostIngotts = 1, --Cost 1 ingott
    IngottItemID = XXXX, --Edit this: XXXX = ingott item number , dont delete the ,
    Effect = 2 --Effect number
} 
function onUse(cid,var)
local minvalue = getPlayerStorageValue(cid, storage.MinMana) -- Dont edit this
local maxvalue = getPlayerStorageValue(cid, storage.MaxMana) -- Dont edit this
local cost = getPlayerStorageValue(cid, storage.CostIngotts) -- Dont edit this
local ingott = getPlayerStorageValue(cid, storage.IngottItemID) -- Dont edit this
local position = getPlayerPosition(cid)
local effect = getPlayerStorageValue(cid, storage.Effect)

doPlayerAddMana(cid, math.random(minvalue, maxvalue)) -- Dont edit this
doSendMagicEffect(position, effect) -- Dont edit this
doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1) -- Edit only the Aaaah
if item.type > 1 then
doChangeTypeItem(item.uid,item.type-1)
else
doRemoveItem(item.uid,1)
doRemoveItem(ingott.uid,cost)
end
return 1
end

then go to data/actions and open actions.xml & add line:
PHP:
<action itemid="XXXX" script="manarune.lua" allowfaruse="1" blockwalls="1" />
in the XXXX put your manarune item id.

-- If i helped u , add reputation.

o.0 what is that script supposed to be lol....


@topic

You need to go to your server directory ---> data ---> action(folder) ---> scripts ---> and make a new manarune.lua : [and paste this inside]

LUA:
local config = {
                   mini = 1000
				   maxi = 1500
                   removee = true    -- make false if you dont want to remove rune on use
               }
function onUse(cid, item, fromPosition, itemEx, toPosition)
  if c.removee ~= false then
     doRemoveItem(item.uid)
  end
return doPlayerAddMana(cid,math.random(c.mini,c.maxi)) and doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
end

So now you are done with script : Return back to the action folder --> open actions.xml [paste]

Code:
<action itemid="XXX" event="script" value="manarune.lua"/>

Now just change the "XXX" to your itemid.
 
Sorry but what is the manarune item id? XD
And anyway when i do it this shows up:

[11/09/2010 12:05:55] [Error - LuaScriptInterface::loadFile] cannot open data/actions/scripts/manarune.lua: No such file or directory
[11/09/2010 12:05:55] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/manarune.lua)
[11/09/2010 12:05:55] cannot open data/actions/scripts/manarune.lua: No such file or directory

Open notepad, put this:
PHP:
local storage = {  
    MinMana = 1000, --Minimum mana cure 
    MaxMana = 1100, --Maximum mana cure 
    CostIngotts = 1, --Cost 1 ingott 
    IngottItemID = XXXX, --PUT INGOTT ITEM ID IN XXXX - DONT REMOVE THE ","
    Effect = 2 --Effect number 
}  
function onUse(cid,var) 
local minvalue = getPlayerStorageValue(cid, storage.MinMana) -- Dont edit this 
local maxvalue = getPlayerStorageValue(cid, storage.MaxMana) -- Dont edit this 
local cost = getPlayerStorageValue(cid, storage.CostIngotts) -- Dont edit this 
local ingott = getPlayerStorageValue(cid, storage.IngottItemID) -- Dont edit this 
local position = getPlayerPosition(cid) 
local effect = getPlayerStorageValue(cid, storage.Effect) 

doPlayerAddMana(cid, math.random(minvalue, maxvalue)) -- Dont edit this 
doSendMagicEffect(position, effect) -- Dont edit this 
doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1) -- Edit only the Aaaah 
if item.type > 1 then 
doChangeTypeItem(item.uid,item.type-1) 
else 
doRemoveItem(item.uid,1) 
doRemoveItem(ingott.uid,cost) 
end 
return 1 
end
Go to File>save as>change type to all files , go to the "OT/data/actions/scripts" and in name put manarune.lua>Click save.

Now go to "OT/data/items" open items.xml
Search manarune and ingott item name and find the id's.

Go to "OT/data/actions/scripts" and open manarune.lua with notepad.
Search: IngottItemID = XXXX,
in XXXX put the ingott item ID ( Dont remove the "," );
Save.

Go to "OT/data/actions"
open actions.xml with notepad and put this line:
PHP:
<action itemid="XXXX" script="manarune.lua" allowfaruse="1" blockwalls="1" />
In the XXXX put the manarune item ID ( four numbers )
Save.
 
Back
Top