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

MoveEvent Perfect Baking/Cooking system (Fruit Juice included)

LucasFerraz

Systems Analyst
Joined
Jun 10, 2010
Messages
2,858
Reaction score
96
Location
Brazil
http://tibia.wikia.com/wiki/Cooking
Made by Freewolny

actions.xml
XML:
	<!-- Baking -->
	<action itemid="2694" script="other/baking.lua"/> <!--Wheat-->
	<action itemid="2692" script="other/baking.lua"/> <!--Flour-->
	<action itemid="2693" script="other/baking.lua"/> <!--Lump of dough-->
	<action itemid="6277" script="other/baking.lua"/> <!--Lump of cake dough-->
	<action itemid="2566" script="other/baking.lua"/> <!--Kitchen knife-->
	<action itemid="2561" script="other/baking.lua"/> <!--Baking tray-->
	<action itemid="8848" script="other/baking.lua"/> <!--Baking tray (with cookies)-->
	<action itemid="8846" script="other/baking.lua"/> <!--Lump of chocolate dough-->
	<action itemid="5865" script="other/baking.lua"/> <!--Fruit Juice-->

baking.lua
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local liquidContainers = {1775, 2005}
	local ovens = {1786, 1787, 1788, 1789, 1790, 1791, 1792, 1793, 6356, 6357, 6358, 6359, 6360, 6361, 6362, 6363}
	local lumpsOfChocolateDough = getPlayerItemCount(cid, 6277) + getPlayerItemCount(cid, 6574)
	if item.itemid == 2692 and isInArray(liquidContainers, itemEx.itemid) == TRUE and itemEx.type == 1 then
		doChangeTypeItem(item.uid, item.type - 1)
		doPlayerAddItem(cid, 2693, 1)
		doChangeTypeItem(itemEx.uid, item.type - item.type)
	elseif item.itemid == 2694 and (itemEx.itemid == 1381 or itemEx.itemid == 1382 or itemEx.itemid == 1383 or itemEx.itemid == 1384) then
		doChangeTypeItem(item.uid, item.type - 1)
		doPlayerAddItem(cid, 2692, 1)
	elseif item.itemid == 2693 and isInArray(ovens, itemEx.itemid) == TRUE then
		doChangeTypeItem(item.uid, item.type - 1)
		doCreateItem(2689, 1, toPosition)
	elseif item.itemid == 2692 and isInArray(liquidContainers, itemEx.itemid) == TRUE and itemEx.type == 6 then
		doChangeTypeItem(item.uid, item.type - 1)
		doPlayerAddItem(cid, 6277, 1)
		doChangeTypeItem(itemEx.uid, itemEx.type - itemEx.type)
	elseif item.itemid == 6277 and isInArray(ovens, itemEx.itemid) == TRUE then
		doChangeTypeItem(item.uid, item.type - 1)
		doCreateItem(6278, 1, toPosition)
	elseif item.itemid == 2566 and (itemEx.itemid == 2679 or itemEx.itemid == 2680 or itemEx.itemid == 2674) and getPlayerItemCount(cid, 6278) > 0 then
		doRemoveItem(itemEx.uid, 1)
		doPlayerRemoveItem(cid, 6278, 1)
		doPlayerAddItem(cid, 6279, 1)
	elseif item.itemid == 6277 and itemEx.itemid == 2561 then
		doRemoveItem(item.uid, 1)
		doTransformItem(itemEx.uid, 8848)
	elseif item.itemid == 8848 and isInArray(ovens, itemEx.itemid) == TRUE then
		doTransformItem(item.uid, 2561)
		doCreateItem(2687, 12, toPosition)
	elseif item.itemid == 5865 and (itemEx.itemid == 2679 or itemEx.itemid == 2680 or itemEx.itemid == 2674) and getPlayerItemCount(cid, 2006) > 0 then
		doRemoveItem(itemEx.uid, 1)
		doPlayerRemoveItem(cid, 2006, 1)
		doPlayerAddItem(cid, 2006, 21)	
	elseif item.itemid == 6277 and itemEx.itemid == 6574 then
		doRemoveItem(itemEx.uid, 1)
		doChangeTypeItem(item.uid, item.type - 1)
		if (getPlayerItemCount(cid, 6277) + getPlayerItemCount(cid, 6574)) ~= lumpsOfChocolateDough then
			doPlayerAddItem(cid, 8846, 1)
		else
			doCreateItem(8846, 1, toPosition)
		end
	elseif item.itemid == 8846 and isInArray(ovens, itemEx.itemid) == TRUE then
		doChangeTypeItem(item.uid, item.type - 1)
		doCreateItem(8847, 1, toPosition)	
	else
		return FALSE
	end
	return TRUE
end

--Made by Freewolny
 
Last edited:
Back
Top