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

Mana Rune with no Charges

potinho

Advanced OT User
Joined
Oct 11, 2009
Messages
1,402
Solutions
17
Reaction score
150
Location
Brazil
Hello guys,

Im included in my server a Mana Rune, but when i sell or create this item, he came with no charges like other runes (sd, uh).

Here spells.xml
<rune name="Mana Rune" id="2281" allowfaruse="1" charges="1" maglv="4" exhaustion="800" aggressive="0" needtarget="1" blocktype="solid" event="script" value="healing/manarune.lua"/>

Script.lua
Lua:
local combat = createCombatObject()

setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)

setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, FALSE)

setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, TRUE)

function onCastSpell(cid, var)

        doCreatureAddMana(cid, math.random(100,300))

        doCreatureSay(cid,"Aaaah...", TALKTYPE_ORANGE_1)

        doPlayerRemoveItem(cid,2281,1)       

    return doCombat(cid, combat, var)

end

end

And XML of item:

<item id="2281" article="a" name="Mana Rune">
<attribute key="type" value="rune"/>
<attribute key="charges" value="1"/>
<attribute key="weight" value="52"/>
</item>
 
Solution
I tried, but it cames with no charges too =/
Post automatically merged:

Correction: i make runes with 100 charges but when i click in "see rune" doesnt show charges

Remove it from spells.xml index! It needs to be an regular item with no charges at all.

All things inherent from being in the spells index must be emulated via the item action lua script.
Not better to add to actions item like manarune?
You tag Topic as 7.6 then:

manarune.lua
Lua:
function onUse(cid, item, frompos, item2, topos)
if item.itemid == 2281 and item.type > 1 then
doPlayerAddMana(cid,800)
doChangeTypeItem(item.uid,item.type-1)
doSendMagicEffect(topos,12)
doPlayerSay(cid,"Ahhhh... ",1)
else
doRemoveItem(item.uid,1)
end
return 1
end

Actions.xml
XML:
<action itemid="2281" script="manarune.lua" />
I think it's better way to add runes :)
 
Not better to add to actions item like manarune?
You tag Topic as 7.6 then:

manarune.lua
Lua:
function onUse(cid, item, frompos, item2, topos)
if item.itemid == 2281 and item.type > 1 then
doPlayerAddMana(cid,800)
doChangeTypeItem(item.uid,item.type-1)
doSendMagicEffect(topos,12)
doPlayerSay(cid,"Ahhhh... ",1)
else
doRemoveItem(item.uid,1)
end
return 1
end

Actions.xml
XML:
<action itemid="2281" script="manarune.lua" />
I think it's better way to add runes :)
I tried, but it cames with no charges too =/
Post automatically merged:

Correction: i make runes with 100 charges but when i click in "see rune" doesnt show charges
 
Last edited:
I tried, but it cames with no charges too =/
Post automatically merged:

Correction: i make runes with 100 charges but when i click in "see rune" doesnt show charges

Remove it from spells.xml index! It needs to be an regular item with no charges at all.

All things inherent from being in the spells index must be emulated via the item action lua script.
 
Solution
Back
Top