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

conjure food bug

Mauzim

Member
Joined
Jan 3, 2011
Messages
568
Reaction score
9
Code:
local FOODS = {
	2666, -- meat
	2671, -- ham
	2681, -- grape
	2674, -- aple
	2689, -- bread
	2690, -- roll
	2696 -- cheese
}

function onCastSpell(cid, var)
	local size = table.maxn(FOODS)
	if(not doPlayerAddItem(cid, FOODS[math.random(1, size)])) then
		doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
		doSendMagicEffect(getThingPosition(cid), CONST_ME_POFF)
		return false
	end

	if(math.random(1, 100) > 50) then
		doPlayerAddItem(cid, FOODS[math.random(1, size)])
	end

	doSendMagicEffect(getThingPosition(cid), CONST_ME_MAGIC_GREEN)
	return true
end
if player spam this is effect smoke and player get food and cap not going down ;s
 
try
LUA:
local t = {
	2666, -- meat
	2671, -- ham
	2681, -- grape
	2674, -- aple
	2689, -- bread
	2690, -- roll
	2696 -- cheese
}

function onCastSpell(cid, var)
	if doPlayerAddItemEx(cid, doCreateItemEx(t[math.random(#t)])) ~= RETURNVALUE_NOERROR then
		doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
		doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
		return false
	end

	if math.random(2) == 1 then
		doPlayerAddItemEx(cid, doCreateItemEx(t[math.random(#t)]))
	end

	doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_GREEN)
	return true
end
 
Last edited:
if player have all types of food and if cast spell that no waste mana, soul, cap and add random food ;p
but cyko fix that bug
 
Back
Top