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

Scripting help, events, manarune

mayel

New Member
Joined
Sep 11, 2009
Messages
174
Reaction score
2
Location
Stockholm, Sweden
Hey guys, I know the basics of programming and so on.
But i needs some help.

How do i bind events(like lvlup, manaregain 'n so on) to like for instance the lever(id=1945 in rme)...

Exampel:
When you pull the lever you will get an item or something, do you know what i mean?

Im trying to make a manarune aswell, what have i done wrong?

/data/items
I have just simply written the id 2275 in the item folder.
/data/spells
Changed the id to 2275 in the spells folder , the name and the script path to healing/manarune.lua
And in /data/spells/scripts/healing
Done a very simple script, i taken from the internet.

Results:
The rune gets it's name, id and shape but the function doesn't work...
Thanks on advance
 
spells.xml
Code:
	<rune name="Mana Rune" id="2300" allowfaruse="1" charges="5" lvl="8" exhaustion="899" maglv="5" aggressive="0" needtarget="1" blocktype="solid" script="manarune.lua"/>

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)
	doPlayerAddMana(cid, math.random(400, 550))
	return doCombat(cid, combat, var)
end
 
Back
Top