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

Great Mana

gaku

New Member
Joined
Nov 27, 2007
Messages
33
Reaction score
0
HiHo guys, is it possible to load the "great mana potion" with charges? Would be nice if someone can post it. This script I have so far:

Code:
elseif(item.itemid == greatManaPot) then
		if(not(isSorcerer(cid) or isDruid(cid)) or (getPlayerLevel(cid) < 80)) and not(getPlayerGroupId(cid) >= 2) then
			doCreatureSay(cid, "This potion can only be consumed by sorcerers and druids of level 80 or higher.", TALKTYPE_ORANGE_1)
			return TRUE
		end

		if(doTargetCombatMana(0, cid, 200, 300, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
			return FALSE
		end
		doAddCondition(cid, exhaust)
		doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1)
		doTransformItem(item.uid, greatEmptyPot)
 
You could try something like this:
Code:
elseif(item.itemid == greatManaPot) then
		if(not(isSorcerer(cid) or isDruid(cid)) or (getPlayerLevel(cid) < 80)) and not(getPlayerGroupId(cid) >= 2) then
			doCreatureSay(cid, "This potion can only be consumed by sorcerers and druids of level 80 or higher.", TALKTYPE_ORANGE_1)
			return TRUE
		end

		if(doTargetCombatMana(0, cid, 200, 300, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
			return FALSE
		end
		doAddCondition(cid, exhaust)
		doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1)
[B]                local GMPCharges = GMPCharges + 1
                if GMPCharges == 5 then
			doTransformItem(item.uid, greatEmptyPot)
                end[/B]
Don't hold me to that, but logically it would be a temporary fix.

Jo3
 
Well I tried it, but it seems that the potions does not end. I tried this

Code:
elseif(item.itemid == greatManaPot) then
		if(not(isSorcerer(cid) or isDruid(cid)) or (getPlayerLevel(cid) < 80)) and not(getPlayerGroupId(cid) >= 2) then
			doCreatureSay(cid, "This potion can only be consumed by sorcerers and druids of level 80 or higher.", TALKTYPE_ORANGE_1)
			return TRUE
		end
		
	if math.random(1, 20) == 1 then
		doSendMagicEffect(fromPosition, CONST_ME_POFF)
		doTransformItem(item.uid, 7635)
	else

		if(doTargetCombatMana(0, cid, 200, 300, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
			return FALSE
		end
		doAddCondition(cid, exhaust)
		doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1)
		doTransformItem(item.uid, greatManaPot)
end


Mabye my one is fixable so I can use it exaclty 5x?
 
I just tested this and it works:
Code:
	elseif(item.itemid == greatManaPot) then
		if(not(isSorcerer(cid) or isDruid(cid)) or (getPlayerLevel(cid) < 80)) and not(getPlayerGroupId(cid) >= 2) then
			doCreatureSay(cid, "This potion can only be consumed by sorcerers and druids of level 80 or higher.", TALKTYPE_ORANGE_1)
			return TRUE
		end

		if(doTargetCombatMana(0, cid, 200, 300, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
			return FALSE
		end
		doAddCondition(cid, exhaust)
		doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1)
		GMPCharges = GMPCharges + 1
		if GMPCharges == 5 then
			doTransformItem(item.uid, greatEmptyPot)
			GMPCharges = 0
		end
and at the main top of the script put:
Code:
local GMPCharges = 0
The only problem is that if you use 5 different potions it will empty one potion instead of taking "charges" off. It's 5:30AM here and I have class in 5 hours, so when I get time I can figure out how to make "charges".

Jo3
 
Wow, that rocks. I think I am fine with this version =). Rep for you.
Incase I need the "charges" I would like to pm you, if thats fine with you.
Anyway, thank you very much for this =)
 
Since Jo isnt home atm (I think so), does anyone knows, how I can add the charges when I look on it? Atm 1 GMP gives me 5 time mana, but it always shows 1 charge is left. If anyone knows, would be nice. thx.
 
Back
Top Bottom