• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Action Manarune 7.6 (from Xenoria 7.6 xml pvp-enfo)

Pro Warbringer

Retired with developing
Joined
Sep 23, 2008
Messages
3,582
Reaction score
25
Location
Austria
Well here it is...

Put this in (ex.) C:\Documents and Settings\user\My Documents\Copy of Xenoria\Xenoria\data\actions\scripts


function onUse(cid, item, frompos, item2, topos)
addmanapos = topos
addmanapos.stackpos = 253
playeraddmana = getThingfromPos(addmanapos)

if getPlayerMagLevel(cid) >= 4 then
if playeraddmana.itemid > 0 then
random_number = math.random(210,250)
doSendMagicEffect(topos,12)
doPlayerAddMana(playeraddmana.uid,random_number)
doPlayerSay(cid,"You can change it",1)
if item.type > 1 then
doChangeTypeItem(item.uid,item.type-1)
else
doRemoveItem(item.uid,1)
end
else
doSendMagicEffect(frompos,2)
return 0
end
else
doSendMagicEffect(frompos,2)
doPlayerSendCancel(cid,"You don't have the required magic level to use that rune.")
end
return 1
end

and add into Actions.xml
<action itemid="2272" script="manarune.lua" />


Wouldn't mind for some reputation! :)

Kind Regard's,
Pro Warbringer
 
LUA:
function onUse(cid, item, frompos, item2, topos)
	local addmanapos = topos
	local addmanapos.stackpos = 253
	local playeraddmana = getThingfromPos(addmanapos)
	if getPlayerMagLevel(cid) >= 4 then
		if playeraddmana.itemid > 0 then
		local random_number = math.random(210,250)
		local doSendMagicEffect(topos,12)
			doPlayerAddMana(playeraddmana.uid,random_number)
			doPlayerSay(cid,"You can change it",1)
			if item.type > 1 then
				doChangeTypeItem(item.uid,item.type-1)
			else
				doRemoveItem(item.uid,1)
			end
		else
			doSendMagicEffect(frompos,2)
		return false
		end
	else
		doSendMagicEffect(frompos,2)
		doPlayerSendCancel(cid,"You don't have the required magic level to use that rune.")
	end
return true
end

tabbed and syntax, still looks ugly written and sloppy though, ohwell
 
Back
Top