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

[lua] Manafluid bug!

ZelOT

New Member
Joined
Sep 13, 2010
Messages
85
Reaction score
1
Location
Sweden
Hello!

It has come to my attention that my manafluid script is sometimes not "working" if you get damaged in the same moment you are using them. The mana is coming on the ground under you.
I'm using Avesta 7.6 SQL engine.
Here is the script!

Thanks in advance.

PHP:
local exhaust = createConditionObject(CONDITION_EXHAUSTED)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, 1000)

function onUse(cid, item, frompos, item2, topos)
        if(hasCondition(cid, CONDITION_EXHAUSTED) == TRUE) then
		doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
		return TRUE
	end
	if item2.itemid == 1 then
		if item.type == 0 then
			doPlayerSendCancel(cid, "It is empty.")
		else
			if item2.uid == cid then
				doChangeTypeItem(item.uid, 0)
				if item.type == 7 then
					new_mana = math.random(50, 150)
					doPlayerAddMana(cid, new_mana)
					doSendMagicEffect(topos, 12)
					doPlayerSay(cid, "Aaaah...", 1)
					doRemoveItem(item.uid,1)
                              doAddCondition(cid, exhaust)
				elseif item.type == 10 then
					new_life = math.random(40, 80)
					doPlayerAddHealth(cid, new_life)
					doSendMagicEffect(topos, 12)
					doPlayerSay(cid, "Aaaah...", 1)
				else
					doPlayerSay(cid, "Gulp.", 1)
				end
			else
				doChangeTypeItem(item.uid, 0)
				splash = doCreateItem(2025, item.type, topos)
				doDecayItem(splash)
			end
		end
	elseif item2.itemid >= 490 and item2.itemid <= 517 
	or item2.itemid >= 618 and item2.itemid <= 629 
	or item2.itemid == 1368 or item2.itemid == 1369 
	or item2.itemid >= 4820 and item2.itemid <= 4825 
	or item2.itemid >= 4828 and item2.itemid <= 4831 
	or item2.itemid >= 4608 and item2.itemid <= 4666 then
		doChangeTypeItem(item.uid, 1)
	elseif item2.itemid == 103 then
		doChangeTypeItem(item.uid, 19)
	elseif item2.itemid >= 598 and item2.itemid < 601 
	or item2.itemid == 1509 
	or item2.itemid >= 518 and item2.itemid <= 529 then
		doChangeTypeItem(item.uid, 26)
	elseif item2.itemid >= 351 and item2.itemid <= 355 then
		doChangeTypeItem(item.uid, 19)
	elseif item2.itemid >= 602 and item2.itemid <= 605 
	or item2.itemid >= 4691 and item2.itemid <= 4755 
	or item2.itemid == 4758 then
		doChangeTypeItem(item.uid, 28)
	elseif item2.itemid == 1771 then
		doChangeTypeItem(item.uid, 1)
	elseif item2.itemid == 1772 then
		doChangeTypeItem(item.uid, 3)
	elseif item2.itemid == 1773 then
		doChangeTypeItem(item.uid, 15)
	elseif item2.itemid > 2806 and item2.itemid < 3132 
	or item2.itemid >= 4251 and item2.itemid <= 4327 then
		doChangeTypeItem(item.uid, 2)
	else
		if item.type == 0 then
			doPlayerSendCancel(cid, "It is empty.")
		else
			doChangeTypeItem(item.uid, 0)
			splash = doCreateItem(2025, item.type, topos)
			doDecayItem(splash)
		end
	end
	return 1
end
 
I has done a MANA RUNE script for my 7.6 OT..., but dont have exhaust...

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

	if getPlayerMagLevel(cid) >= 0 then
 	if playeraddmana.itemid > 0 then
	random_number = math.random(100,100)
 	doSendMagicEffect(topos,12)
	doPlayerAddMana(playeraddmana.uid,random_number)
        doPlayerSay(cid,"Ahhhhh...",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
 
Back
Top