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

Manarune Problems

Ewar

New Member
Joined
Nov 24, 2008
Messages
15
Reaction score
0
Ihave this script of the manarune, but the manarune can only have 1 charge and the npc can only sell 1 charge, please helop me I want to the manarune have 5 charges
function onUse(cid, item, frompos, item2, topos)

local level = getPlayerLevel(cid)
local mlevel = getPlayerMagLevel(cid)

-- Exhausted Settings --
local exhausted_seconds = 1 -- How many seconds manarune will be unavailible to use. --
local exhausted_storagevalue = 99999 -- Storage Value to store exhaust. It MUST be unused! --
-- Exhausted Settings END --

-- Mana Formula Settings --
-- You can use "level" and "mlevel" --
local mana_minimum = 400
local mana_maximum = 800
-- Mana Formula Settings END --

local mana_add = math.random(mana_minimum, mana_maximum)


if(os.time() > getPlayerStorageValue(cid, exhausted_storagevalue)) then -- Exhausted check. --
if(isPlayer(item2.uid) == 1) then -- Entity is player? --
doSendMagicEffect(frompos, CONST_ME_MAGIC_RED)
doSendMagicEffect(topos, CONST_ME_MAGIC_GREEN)
doSendAnimatedText(topos, mana_add, TEXTCOLOR_LIGHTBLUE)
doPlayerAddMana(item2.uid, mana_add)
setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
if item.type > 1 then -- We check the charges. --
doChangeTypeItem(item.uid, item.type - 1)
else
doRemoveItem(item.uid, 1)
end
else
doSendMagicEffect(frompos, CONST_ME_POFF)
doPlayerSendCancel(cid, "You can use this rune only on players.")
end
else
doSendMagicEffect(frompos, CONST_ME_POFF)
doPlayerSendCancel(cid, "You are exhausted.")
end
return 1
end
 
"Data/Items/items.xml"

find for ID of your ManaRune,

like here:


PHP:
	<item id="xxxx" article="a" name="mana rune">
		<attribute key="runeSpellName" value="adura mana"/>
		<attribute key="weight" value="120"/>
		<attribute key="charges" value="1"/>
	</item>
 
Back
Top