• 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 [MOD]Alchemy System - New UPDATE!

Try this its for testing if this works then i can build from here/
Lua:
function onSay(cid, words, param)
local item = getPlayerItemById(cid, true, 2348)	
	if item.actionid == item.actionid then
		if words == "summon" then
		local points = (item.actionid - 42600)	
			if points >= 3 then	
				if getPlayerLevel(cid) >= 10 and param == "Hero" then
				local setPoints = (item.actionid - 3)
				local pointsMinus = (points - 3)
					doSummonMonster("Hero", getCreaturePosition(cid))
					doSetItemActionId(item.uid, setPoints)
					doSetItemSpecialDescription(item.uid, "You have "..pointsMinus.." soul inside this stone.")
				end	
			else
				doPlayerSendCancel(cid, "You don't have enough souls in the stone.")
			end
		end
	end
return true
end
 
sry i crash it reloading stuff
this is what i got the script down to
PHP:
	local summons =  {
			--["creature"] = {levelrequired, souls}
			["dragon"] = {60, 10},
			["hero"] = {40, 4},
			["demonskeleton"] = {20, 2}
        }
	function onSay(cid, words, param)
		local item = getPlayerItemById(cid, true, 2348)
		local param = string.lower(param)
		if(getPlayerItemCount(cid, 2348) == 1) then
			if (param ~= "" and summons[param]) then   
				if item.actionid >= summons[param][2] then    
					if getPlayerLevel(cid) >= summons[param][1] then
						local setPoints = (item.actionid - summons[param][2])
						doSummonMonster(param, getCreaturePosition(cid))
						doItemSetAttribute(item.uid, "aid", setPoints)
						doItemSetAttribute(item.uid, "description", "You have "..setPoints.." soul inside this stone.")
					end    
				else
					doPlayerSendCancel(cid, "You don't have enough souls in the stone.")
				end
			else
				doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Command requires GOOD param!")
			end
		end
		return true
	end

[Error - TalkAction Interface]
buffer:eek:nSay
Description:
(luaDoSummonMonster) Creature not found
 
Last edited:
Try this i don't think it will work as i think it will but give it a try
Lua:
local summons =  {
            --["creature"] = {levelrequired, souls}
            ["dragon"] = {60, 10},
			["hero"] = {40, 4},
			["demonskeleton"] = {20, 2}
        }
function onSay(cid, words, param)
    local item = getPlayerItemById(cid, true, 2348)
    local param = string.lower(param)
    if(getPlayerItemCount(cid, 2348) == 1) then
		if (param ~= "" and summons[param]) then   
			if item.actionid >= summons[param][2] then    
				if getPlayerLevel(cid) >= summons[param][1] then
				local setPoints = (item.actionid - summons[param][2])
				local summon = summons[param]
					doSummonMonster(summon, getCreaturePosition(cid))
					doItemSetAttribute(item.uid, "aid", setPoints)
					doItemSetAttribute(item.uid, "description", "You have "..setPoints.." soul inside this stone.")
				end    
			else
				doPlayerSendCancel(cid, "You don't have enough souls in the stone.")
			end
		else
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Command requires GOOD param!")
		end
	end	
	return true
end
 
Last edited:
@soul4soul
here test this npc script( you have to link it to one of your npc)
Code:
local focus = 0
local talk_start = 0
local target = 0
local days = 0

function onThingMove(creature, thing, oldpos, oldstackpos)

end

function onCreatureAppear(creature)

end

function onCreatureDisappear(cid, pos)
	if focus == cid then
		selfSay('Good bye then.')
		focus = 0
		talk_start = 0
	end
end

function onCreatureTurn(creature)

end

function msgcontains(txt, str)
return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))
end

function onCreatureSay(cid, type, msg)
msg = string.lower(msg)

	if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then
		selfSay('Hello ' .. getCreatureName(cid) .. '! I sell all things related to "alchemy".')
		focus = cid
		talk_start = os.clock()

	elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
		selfSay('Sorry, ' .. creatureGetName(cid) .. '! I talk to you in a minute.')

	elseif focus == cid then
		talk_start = os.clock()

		if msgcontains(msg, 'alchemy') then
				selfSay('Ahh, yes I have "recipes", "recipe book", "alchemybook" and "alchemic skill book", of which do you want to know more about?')
				talk_state = 1

		elseif talk_state == 1 then
			if msgcontains(msg, 'recipe book') then
					selfSay('I have this recipe book that you can use to see the recipes you have learned, do you want to buy it?')
					talk_state = 2
			end
			if msgcontains(msg, 'alchemybook') then
					selfSay('This alchemy book will teach you all you need to know about alchemy, do you wish to buy it?')
					talk_state = 3
			end	
			if msgcontains(msg, 'alchemic skill book') then	
					selfSay('This book, is where you write your progress on your alchemy skill, do you want to buy it?')
					talk_sate = 4
			end	
			if msgcontains(msg, 'recipes')then
				if getPlayerStorageValue(cid, 50500) == -1 then
					selfSay('You don\'t seem to know much about alchemy, I suggest you buy "alchemy book" so you can learn about it, once you know more, come talk to me.')
					talk_state = 1
				else
					selfSay('Yes, I have a "list" of recipes, want to see?.')
					talk_state = 5
				end
			end	
			if msgcontains(msg, 'bye') then
				selfSay('Good bye, ' .. creatureGetName(cid) .. '!')
				focus = 0
				talk_start = 0	
			end	
		elseif talk_state == 2 then
			if msgcontains(msg, 'yes') then
					if getPlayerMoney(cid) >= 1000 then
						doPlayerRemoveMoney(cid, 1000)
						doPlayerAddItem(cid, 1965, 1)
						selfSay('Here you go!')
						talk_state = 1
					else
						selfSay('You don\'t have enough money to buy the book')
						talk_state = 1
					end	
			end
		elseif talk_state == 3 then
			if msgcontains(msg, 'yes') then
					if getPlayerMoney(cid) >= 1500 then	
						doPlayerRemoveMoney(cid, 1500)
						doPlayerAddItem(cid, 2217, 1)
						selfSay('Here you go!')
						talk_state = 1
					else
						selfSay('You don\'t have enough money to buy the book')
						talk_state = 1
					end	
			end
		elseif talk_state == 4 then
			if msgcontains(msg, 'yes') then
				if getPlayerMoney(cid) >= 500 then
					doPlayerRemoveMoney(cid, 1500)
					doPlayerAddItem(cid, 1950, 1)
					selfSay('Here you go!')
					talk_state = 1
				else
					selfSay('You don\'t have enough money to buy the book')
					talk_state = 1	
				end
			end
		elseif talk_state == 5 then
			if msgcontains(msg, 'yes') then
				selfSay('I sell recipes for: "antidote", "lesser mana potion", "medium mana potion", "strong mana potion", "small health potion", "lesser health potion", "medium health potion", "strong health potion", "great health potion", "spirit potion", "speed potion", "potion of strength", "potion of dexterity", "potion of endurance", "potion of magic level", "potion of health", "potion of mana", "elixir", "blood orb", "soul orb", "mind orb" and "philosopher\'s stone", which one do you want?')
				talk_state = 6
			else
				selfSay('That\'s too bad, maybe next time.')
				talk_state = 1
			end
		elseif talk_state == 6 then
			if msgcontains(msg, 'antidote') then
				selfSay('Do you want to buy an Antidote Recipe for 1000 gold?')
				action = 50001
				desc = 'This contains the recipe to make Antidote.'
				price = 1000
				level = 10
				talk_state = 7
			end	
			if msgcontains(msg, 'lesser mana potion') then
				selfSay('Do you want to buy a Lesser Mana Potion Recipe for 1200 gold?')
				action = 50002
				desc = 'This contains the recipe to make Lesser Mana Potion.'
				price = 1200
				level = 15
				talk_state = 7
			end	
			if msgcontains(msg, 'medium mana potion') then
				selfSay('Do you want to buy a Medium Mana Potion Recipe for 1400 gold?')
				action = 50003
				desc = 'This contains the recipe to make Medium Mana Potion.'
				price = 1400
				level = 25
				talk_state = 7	
			end	
			if msgcontains(msg, 'strong mana potion') then
				selfSay('Do you want to buy a Strong Mana Potion Recipe for 1600 gold?')
				action = 50004
				desc = 'This contains the recipe to make Strong Mana Potion.'
				price = 1600
				level = 35
				talk_state = 7	
			end	
			if msgcontains(msg, 'small health potion') then
				selfSay('Do you want to buy a Small Health Potion Recipe for 1000 gold?')
				action = 50005
				desc = 'This contains the recipe to make Small Health Potion.'
				price = 1000
				level = 10
				talk_state = 7
			end	
			if msgcontains(msg, 'lesser health potion') then
				selfSay('Do you want to buy a Lesser Health Potion Recipe for 1200 gold?')
				action = 50006
				desc = 'This contains the recipe to make Lesser Health Potion.'
				price = 1200
				level = 15
				talk_state = 7
			end	
			if msgcontains(msg, 'medium health potion') then
				selfSay('Do you want to buy a Medium Health Potion Recipe for 1400 gold?')
				action = 50007
				desc = 'This contains the recipe to make Medium Health Potion.'
				price = 1400
				level = 25
				talk_state = 7
			end	
			if msgcontains(msg, 'strong health potion') then
				selfSay('Do you want to buy a Strong Health Potion Recipe for 1600 gold?')
				action = 50008
				desc = 'This contains the recipe to make Strong Health Potion.'
				price = 1600
				level = 35
				talk_state = 7
			end	
			if msgcontains(msg, 'great health potion') then
				selfSay('Do you want to buy a Great Health Potion Recipe for 1800 gold?')
				action = 50009
				desc = 'This contains the recipe to make Great Health Potion.'
				price = 1800
				level = 40
				talk_state = 7
			end	
			if msgcontains(msg, 'spirit potion') then
				selfSay('Do you want to buy a Spirit Potion Recipe for 2800 gold?')
				action = 50010
				desc = 'This contains the recipe to make Spirit Potion.'
				price = 2800
				level = 50
				talk_state = 7	
			end	
			if msgcontains(msg, 'speed potion') then
				selfSay('Do you want to buy a Speed Potion Recipe for 2800 gold?')
				action = 50011
				desc = 'This contains the recipe to make Speed Potion.'
				price = 2800
				level = 50
				talk_state = 7
			end	
			if msgcontains(msg, 'potion of strength') then
				selfSay('Do you want to buy a Potion of Strength Recipe for 3100 gold?')
				action = 50012
				desc = 'This contains the recipe to make Potion of Strength.'
				price = 3100
				level = 70
				talk_state = 7	
			end	
			if msgcontains(msg, 'potion of dexterity') then
				selfSay('Do you want to buy a Potion of Dexterity Recipe for 3100 gold?')
				action = 50013
				desc = 'This contains the recipe to make Potion of Dexterity.'
				price = 3100
				level = 70
				talk_state = 7
			end	
			if msgcontains(msg, 'potion of endurance') then
				selfSay('Do you want to buy a Potion of Endurance Recipe for 3100 gold?')
				action = 50014
				desc = 'This contains the recipe to make Potion of Endurance.'
				price = 3100
				level = 70
				talk_state = 7	
			end	
			if msgcontains(msg, 'potion of magic level') then
				selfSay('Do you want to buy a Potion of Magic Level Recipe for 3400 gold?')
				action = 50015
				desc = 'This contains the recipe to make Potion of Magic Level.'
				price = 3400
				level = 80
				talk_state = 7	
			end	
			if msgcontains(msg, 'potion of health') then
				selfSay('Do you want to buy a Potion of Health Recipe for 3000 gold?')
				action = 50016
				desc = 'This contains the recipe to make Potion of Health.'
				price = 3000
				level = 60
				talk_state = 7
			end	
			if msgcontains(msg, 'potion of mana') then
				selfSay('Do you want to buy a Potion of Mana Recipe for 3000 gold?')
				action = 50017
				desc = 'This contains the recipe to make Potion of Mana.'
				price = 3000
				level = 60
				talk_state = 7	
			end	
			if msgcontains(msg, 'elixir') then
				selfSay('Do you want to buy an Elixir Recipe for 4000 gold?')
				action = 50018
				desc = 'This contains the recipe to make Elixir.'
				price = 4000
				level = 100
				talk_state = 7
			end	
			if msgcontains(msg, 'blood orb') then
				selfSay('Do you want to buy a Blood Orb Recipe for 2400 gold?')
				action = 50019
				desc = 'This contains the recipe to make Blood Orb.'
				price = 2400
				level = 40
				talk_state = 7
			end	
			if msgcontains(msg, 'soul orb') then
				selfSay('Do you want to buy a Soul Orb Recipe for 3200 gold?')
				action = 50020
				desc = 'This contains the recipe to make Soul Orb.'
				price = 3200
				level = 90
				talk_state = 7
			end	
			if msgcontains(msg, 'mind orb') then
				selfSay('Do you want to buy a Mind Orb Recipe for 3200 gold?')
				action = 50021
				desc = 'This contains the recipe to make Mind Orb.'
				price = 3200
				level = 90
				talk_state = 7
			end	
			if msgcontains(msg, 'philosopher\'s stone') or msgcontains(msg, 'philosopher') then
				selfSay('Do you want to buy a Philosopher\'s Stone Recipe for 5000 gold?')
				action = 50022
				desc = 'This contains the recipe to make Philosopher\'s Stone.'
				price = 5000
				level = 100
				talk_state = 7
			end	
			if msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
				selfSay('Good bye, ' .. creatureGetName(cid) .. '!')
				focus = 0
				talk_start = 0	
			end	
		elseif talk_state == 7 then
			if msgcontains(msg, 'yes') then
				if getPlayerStorageValue(cid, 50500) >= level then
					if getPlayerMoney(cid) >= price then
						selfSay('Here you go!')
						doPlayerRemoveMoney(cid, price)
						doPlayerAddItem(cid, 1954, 1)
						doSetItemActionId(getPlayerItemById(cid, true, 1954).uid, action)
						doSetItemSpecialDescription(getPlayerItemById(cid, true, 1954).uid, desc)
						talk_state = 6
					else
						selfSay('You don\'t seem to have enough money.')
						talk_state = 6
					end
				else
					selfSay('You need '..level..' in Alchemy to buy this recipe.')
					talk_state = 6
				end
			else
				selfSay('That\'s too bad, maybe next time.')
				talk_state = 6	
			end	
		elseif msgcontains(msg, 'bye') then
			selfSay('Good bye, ' .. creatureGetName(cid) .. '!')
			focus = 0
			talk_start = 0
		end
	elseif msgcontains(msg, 'bye') then
		selfSay('Good bye, ' .. creatureGetName(cid) .. '!')
		focus = 0
		talk_start = 0	
	end
end

function onCreatureChangeOutfit(creature)

end

function onThink()
	doNpcSetCreatureFocus(focus)
	if (os.clock() - talk_start) > 30 then
		if focus > 0 then
			selfSay('Next Please...')
		end
		focus = 0
	end
	if focus ~= 0 then
		if getDistanceToCreature(focus) > 5 then
			selfSay('Good bye then.')
			focus = 0
		end
	end
end
 
Last edited:
SHITZ AMAZING - When someone gonna open an Oblivion server?!

Anyone got this in their server for me to test xD?
 
yes its in my server.

btw here is the script i have i changed it a little for 0.3.6. and i hope u dont mind i changed 2 if statements and removed the empty functions to get the script just a little bit shorter.
Code:
local focus = 0
local talk_start = 0

function onCreatureDisappear(cid, pos)
	if focus == cid then
		selfSay('Good bye then.')
		focus = 0
		talk_start = 0
	end
end

function msgcontains(txt, str)
return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))
end

function onCreatureSay(cid, type, msg)
msg = string.lower(msg)

	if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then
		selfSay('Hello ' .. getCreatureName(cid) .. '! I sell all things related to "alchemy".')
		focus = cid
		talk_start = os.clock()

	elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
		selfSay('Sorry, ' .. getCreatureName(cid) .. '! I talk to you in a minute.')

	elseif focus == cid then
		talk_start = os.clock()

		if msgcontains(msg, 'alchemy') then
				selfSay('Ahh, yes I have "recipes", "recipe book", "alchemybook" and "alchemic skill book", of which do you want to know more about?')
				talk_state = 1

		elseif talk_state == 1 then
			if msgcontains(msg, 'recipe book') then
					selfSay('I have this recipe book that you can use to see the recipes you have learned, do you want to buy it?')
					talk_state = 2
					price = 1000
					book = 1965
			end
			if msgcontains(msg, 'alchemybook') then
					selfSay('This alchemy book will teach you all you need to know about alchemy, do you wish to buy it?')
					talk_state = 2
					price = 1500
					book = 2217
			end	
			if msgcontains(msg, 'alchemic skill book') then	
					selfSay('This book, is where you write your progress on your alchemy skill, do you want to buy it?')
					talk_state = 2
					price = 500
					book = 1950
			end	
			if msgcontains(msg, 'recipes')then
				if getPlayerStorageValue(cid, 50500) == -1 then
					selfSay('You don\'t seem to know much about alchemy, I suggest you buy "alchemy book" so you can learn about it, once you know more, come talk to me.')
					talk_state = 1
				else
					selfSay('Yes, I have a "list" of recipes, want to see?.')
					talk_state = 5
				end
			end	
			if msgcontains(msg, 'goodbye') then
				selfSay('Good bye, ' .. getCreatureName(cid) .. '!')
				focus = 0
				talk_start = 0	
			end	
		elseif talk_state == 2 then
			if msgcontains(msg, 'yes') then
					if getPlayerMoney(cid) >= price then
						doPlayerRemoveMoney(cid, price)
						doPlayerAddItem(cid, book, 1)
						selfSay('Here you go!')
						talk_state = 1
					else
						selfSay('You don\'t have enough money to buy the book')
						talk_state = 1
					end	
			end
		elseif talk_state == 5 then
			if msgcontains(msg, 'yes') then
				selfSay('I sell recipes for: "antidote", "lesser mana potion", "medium mana potion", "strong mana potion", "small health potion", "lesser health potion", "medium health potion", "strong health potion", "great health potion", "spirit potion", "speed potion", "potion of strength", "potion of dexterity", "potion of endurance", "potion of magic level", "potion of health", "potion of mana", "elixir", "blood orb", "soul orb", "mind orb" and "philosopher\'s stone", which one do you want?')
				talk_state = 6
			else
				selfSay('That\'s too bad, maybe next time.')
				talk_state = 1
			end
		elseif talk_state == 6 then
			if msgcontains(msg, 'antidote') then
				selfSay('Do you want to buy an Antidote Recipe for 1000 gold?')
				action = 50001
				desc = 'This contains the recipe to make Antidote.'
				price = 1000
				level = 10
				talk_state = 7
			end	
			if msgcontains(msg, 'lesser mana potion') then
				selfSay('Do you want to buy a Lesser Mana Potion Recipe for 1200 gold?')
				action = 50002
				desc = 'This contains the recipe to make Lesser Mana Potion.'
				price = 1200
				level = 15
				talk_state = 7
			end	
			if msgcontains(msg, 'medium mana potion') then
				selfSay('Do you want to buy a Medium Mana Potion Recipe for 1400 gold?')
				action = 50003
				desc = 'This contains the recipe to make Medium Mana Potion.'
				price = 1400
				level = 25
				talk_state = 7	
			end	
			if msgcontains(msg, 'strong mana potion') then
				selfSay('Do you want to buy a Strong Mana Potion Recipe for 1600 gold?')
				action = 50004
				desc = 'This contains the recipe to make Strong Mana Potion.'
				price = 1600
				level = 35
				talk_state = 7	
			end	
			if msgcontains(msg, 'small health potion') then
				selfSay('Do you want to buy a Small Health Potion Recipe for 1000 gold?')
				action = 50005
				desc = 'This contains the recipe to make Small Health Potion.'
				price = 1000
				level = 10
				talk_state = 7
			end	
			if msgcontains(msg, 'lesser health potion') then
				selfSay('Do you want to buy a Lesser Health Potion Recipe for 1200 gold?')
				action = 50006
				desc = 'This contains the recipe to make Lesser Health Potion.'
				price = 1200
				level = 15
				talk_state = 7
			end	
			if msgcontains(msg, 'medium health potion') then
				selfSay('Do you want to buy a Medium Health Potion Recipe for 1400 gold?')
				action = 50007
				desc = 'This contains the recipe to make Medium Health Potion.'
				price = 1400
				level = 25
				talk_state = 7
			end	
			if msgcontains(msg, 'strong health potion') then
				selfSay('Do you want to buy a Strong Health Potion Recipe for 1600 gold?')
				action = 50008
				desc = 'This contains the recipe to make Strong Health Potion.'
				price = 1600
				level = 35
				talk_state = 7
			end	
			if msgcontains(msg, 'great health potion') then
				selfSay('Do you want to buy a Great Health Potion Recipe for 1800 gold?')
				action = 50009
				desc = 'This contains the recipe to make Great Health Potion.'
				price = 1800
				level = 40
				talk_state = 7
			end	
			if msgcontains(msg, 'spirit potion') then
				selfSay('Do you want to buy a Spirit Potion Recipe for 2800 gold?')
				action = 50010
				desc = 'This contains the recipe to make Spirit Potion.'
				price = 2800
				level = 50
				talk_state = 7	
			end	
			if msgcontains(msg, 'speed potion') then
				selfSay('Do you want to buy a Speed Potion Recipe for 2800 gold?')
				action = 50011
				desc = 'This contains the recipe to make Speed Potion.'
				price = 2800
				level = 50
				talk_state = 7
			end	
			if msgcontains(msg, 'potion of strength') then
				selfSay('Do you want to buy a Potion of Strength Recipe for 3100 gold?')
				action = 50012
				desc = 'This contains the recipe to make Potion of Strength.'
				price = 3100
				level = 70
				talk_state = 7	
			end	
			if msgcontains(msg, 'potion of dexterity') then
				selfSay('Do you want to buy a Potion of Dexterity Recipe for 3100 gold?')
				action = 50013
				desc = 'This contains the recipe to make Potion of Dexterity.'
				price = 3100
				level = 70
				talk_state = 7
			end	
			if msgcontains(msg, 'potion of endurance') then
				selfSay('Do you want to buy a Potion of Endurance Recipe for 3100 gold?')
				action = 50014
				desc = 'This contains the recipe to make Potion of Endurance.'
				price = 3100
				level = 70
				talk_state = 7	
			end	
			if msgcontains(msg, 'potion of magic level') then
				selfSay('Do you want to buy a Potion of Magic Level Recipe for 3400 gold?')
				action = 50015
				desc = 'This contains the recipe to make Potion of Magic Level.'
				price = 3400
				level = 80
				talk_state = 7	
			end	
			if msgcontains(msg, 'potion of health') then
				selfSay('Do you want to buy a Potion of Health Recipe for 3000 gold?')
				action = 50016
				desc = 'This contains the recipe to make Potion of Health.'
				price = 3000
				level = 60
				talk_state = 7
			end	
			if msgcontains(msg, 'potion of mana') then
				selfSay('Do you want to buy a Potion of Mana Recipe for 3000 gold?')
				action = 50017
				desc = 'This contains the recipe to make Potion of Mana.'
				price = 3000
				level = 60
				talk_state = 7	
			end	
			if msgcontains(msg, 'elixir') then
				selfSay('Do you want to buy an Elixir Recipe for 4000 gold?')
				action = 50018
				desc = 'This contains the recipe to make Elixir.'
				price = 4000
				level = 100
				talk_state = 7
			end	
			if msgcontains(msg, 'blood orb') then
				selfSay('Do you want to buy a Blood Orb Recipe for 2400 gold?')
				action = 50019
				desc = 'This contains the recipe to make Blood Orb.'
				price = 2400
				level = 40
				talk_state = 7
			end	
			if msgcontains(msg, 'soul orb') then
				selfSay('Do you want to buy a Soul Orb Recipe for 3200 gold?')
				action = 50020
				desc = 'This contains the recipe to make Soul Orb.'
				price = 3200
				level = 90
				talk_state = 7
			end	
			if msgcontains(msg, 'mind orb') then
				selfSay('Do you want to buy a Mind Orb Recipe for 3200 gold?')
				action = 50021
				desc = 'This contains the recipe to make Mind Orb.'
				price = 3200
				level = 90
				talk_state = 7
			end	
			if msgcontains(msg, 'philosopher\'s stone') or msgcontains(msg, 'philosopher') then
				selfSay('Do you want to buy a Philosopher\'s Stone Recipe for 5000 gold?')
				action = 50022
				desc = 'This contains the recipe to make Philosopher\'s Stone.'
				price = 5000
				level = 100
				talk_state = 7
			end	
			if msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
				selfSay('Good bye, ' .. getCreatureName(cid) .. '!')
				focus = 0
				talk_start = 0	
			end	
		elseif talk_state == 7 then
			if msgcontains(msg, 'yes') then
				if getPlayerStorageValue(cid, 50500) >= level then
					if getPlayerMoney(cid) >= price then
						selfSay('Here you go!')
						doPlayerRemoveMoney(cid, price)
						doPlayerAddItem(cid, 1954, 1)
						doItemSetAttribute(getPlayerItemById(cid, true, 1954).uid, "aid", action)
						doItemSetAttribute(getPlayerItemById(cid, true, 1954).uid, "description", desc)
						talk_state = 6
					else
						selfSay('You don\'t seem to have enough money.')
						talk_state = 6
					end
				else
					selfSay('You need '..level..' in Alchemy to buy this recipe.')
					talk_state = 6
				end
			else
				selfSay('That\'s too bad, maybe next time.')
				talk_state = 6	
			end	
		elseif msgcontains(msg, 'bye') then
			selfSay('Good bye, ' .. getCreatureName(cid) .. '!')
			focus = 0
			talk_start = 0
		end
	elseif msgcontains(msg, 'bye') then
		selfSay('Good bye, ' .. getCreatureName(cid) .. '!')
		focus = 0
		talk_start = 0	
	end
end

function onThink()
	doNpcSetCreatureFocus(focus)
	if (os.clock() - talk_start) > 30 then
		if focus > 0 then
			selfSay('Next Please...')
		end
		focus = 0
	end
	if focus ~= 0 then
		if getDistanceToCreature(focus) > 5 then
			selfSay('Good bye then.')
			focus = 0
		end
	end
end

also i have an idea. you should change the alchemy making script to a movevent using on additem. so you can throw the box of ingredients say onto a fire. make a little burning animation on the box like things r melding together. it would seem more realistic compared to pulling a lever to mix.

im not sure what changed but all the hi bye stuff works now too.

here is the npc i made... i know its rlly simple but i think its a cool one to use for an alchemy NPC.
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Elric" script="data/npc/scripts/alchemy.lua" walkinterval="3000">
<health now="100" max="100"/>
<look type="333"/>
</npc>
inspired from Alphonse elric

another edit:
you can shorten the skill book script. delete the for loop its not necessary the task inside is only getting repeated one time so there isnt a need for the loop to count to 1. delete it and fill in [1] for

edit:
the % doesnt work for alch b/c the gain is so high it gains over a full lvl at a time. once u get a higher skill i think it works this is what i have now
Alchemy: 32. Percent to go: -13900%
Alchemy: 33. Percent to go: 100%

bug if u dont have anything next to the lever and you try to pull it
[Error - Action Interface]
buffer:eek:nUse
Description:
(luaGetContainerItem) Container not found
 
Last edited:
made the mixing script 50~lines shorter and rdy for use on 0.3.6. removed un-need config variables. i only ran a simple test so somethings may not work. i think the script could be made much shorter but this is the best i can do.
Code:
	local cfg = {
        chance = 10, -- Change this to raise up the success chance--
        }
	local t =  {
        [50001] = {slots = {2794, 2760, 2007}, name = "Antidote", item = 8474},
        [50002] = {slots = {2787, 2804, 8302}, name = "Lesser Mana Potion", item = 7620},
        [50003] = {slots = {2787, 2803, 8302}, name = "Medium Mana Potion", item = 7589},
        [50004] = {slots = {2787, 2802, 8302}, name = "Strong Mana Potion", item = 7590},
        [50005] = {slots = {2794, 2799}, name = "Small Health Potion", item = 8704},
        [50006] = {slots = {2791, 2800, 8303}, name = "Lesser Health Potion", item = 7618},
        [50007] = {slots = {2791, 2759, 8303}, name = "Medium Health Potion", item = 7588},
        [50008] = {slots = {2791, 2801, 8303}, name = "Strong Health Potion", item = 7591},
        [50009] = {slots = {2791, 5921, 8303}, name = "Great Health Potion", item = 8473},
        [50010] = {slots = {2789, 2806, 8298}, name = "Spirit Potion", item = 8472},
        [50011] = {slots = {2789, 7732, 8305, 2007}, name = "Speed Potion", item = 7439, aid = 41501},
        [50012] = {slots = {2363, 2782, 8315}, name = "Potion of Strength", item = 7443, aid = 41502, desc = "This is a potion of strength."},
        [50013] = {slots = {2363, 2796, 8315}, name = "Potion of Dexterity", item = 7443, aid = 41503, desc = "This is a potion of dexterity."},
        [50014] = {slots = {2363, 2795, 8315}, name = "Potion of Endurance", item = 7443, aid = 41504, desc = "This is a potion of endurance."},
        [50015] = {slots = {2783, 8301, 2177}, name = "Potion of Magic Level", item = 7443, aid = 41505, desc = "This is a potion of magic level."},
        [50016] = {slots = {2788, 5015, 8299}, name = "Potion of Health", item = 7443, aid = 41506, desc = "This is a potion of health."},
        [50017] = {slots = {2790, 5922, 8299}, name = "Potion of Mana", item = 7443, aid = 41507, desc = "This is a potion of mana."},
        [50018] = {slots = {2798, 2177}, name = "Elixir", item = 7440, aid = 41508},
        [50019] = {slots = {2007, 8303, 8298}, name = "Blood Orb", item = 2363},
        [50020] = {slots = {2007, 2177, 8305, 8299}, name = "Soul Orb", item = 5944},
        [50021] = {slots = {2007, 2177, 8315, 8301}, name = "Mind Orb", item = 2178,},
        [50022] = {slots = {2178, 5944, 2363, 2153, 2154, 2155, 2156, 2158}, name = "Philosopher's Stone", item = 2348, aid = 41509}
        }              
function onUse(cid, item, toPosition, itemEx, fromPosition)
    for i, k in pairs(t) do        
    local container = getTileItemByType({x = toPosition.x, y = toPosition.y, z = toPosition.z}, 4)
    local inContainer1, inContainer2, inContainer3, inContainer4, inContainer5, inContainer6, inContainer7, inContainer8, inContainer9 = getContainerItem(container.uid, 0), getContainerItem(container.uid, 1), getContainerItem(container.uid, 2), getContainerItem(container.uid, 3), getContainerItem(container.uid, 4), getContainerItem(container.uid, 5), getContainerItem(container.uid, 6), getContainerItem(container.uid, 7), getContainerItem(container.uid, 8)
		if getPlayerStorageValue(cid, i) == inContainer1.actionid-50000 then
			if inContainer1.actionid == i then
				if #slots == 8 then  
					if (isInArray(k.slots, inContainer2.itemid)) and (isInArray(k.slots, inContainer3.itemid)) and (isInArray(k.slots, inContainer4.itemid)) and (isInArray(k.slots, inContainer5.itemid)) and (isInArray(k.slots, inContainer6.itemid)) and (isInArray(k.slots, inContainer7.itemid)) and (isInArray(k.slots, inContainer8.itemid)) and (isInArray(k.slots, inContainer9.itemid)) then
                        doRemoveItem(inContainer2.uid)
                        doRemoveItem(inContainer3.uid)
                        doRemoveItem(inContainer4.uid)
                        doRemoveItem(inContainer5.uid)
                        doRemoveItem(inContainer6.uid)
                        doRemoveItem(inContainer7.uid)
                        doRemoveItem(inContainer8.uid)
                        doRemoveItem(inContainer9.uid)
                        if math.random(1, (100 + (getCustomSkill(cid, 50500) / 10))) <= getCustomSkill(cid, 50500) + cfg.chance then
                            doPlayerAddItem(cid, k.item,1)
                            doPlayerSendTextMessage(cid, 25, "You made..."..k.name..".")
							doSendMagicEffect({x = toPosition.x, y = toPosition.y, z = toPosition.z},15)                            if k.aid then
								local getItem = getPlayerItemById(cid, true, k.item)
                                doItemSetAttribute(getItem.uid, "aid", k.aid)
							end
                            if k.desc then
                                doItemSetAttribute(getItem.uid, "description", k.desc)
                            end
                        else
                            doPlayerSendCancel(cid, "The mix went wrong.")
                        end
						addCustomSkillTry(cid, "Alchemy", 50500)						
					else
						doPlayerSendCancel(cid, "There are no Ingredients or the order of the ingredients are wrong.")
					end            
				end
			end            
			if inContainer1.actionid == i then
				if #slots == 7 then
					if (isInArray(k.slots, inContainer2.itemid)) and (isInArray(k.slots, inContainer3.itemid)) and (isInArray(k.slots, inContainer4.itemid)) and (isInArray(k.slots, inContainer5.itemid)) and (isInArray(k.slots, inContainer6.itemid)) and (isInArray(k.slots, inContainer7.itemid)) and (isInArray(k.slots, inContainer8.itemid)) then          
						doRemoveItem(inContainer2.uid)
                        doRemoveItem(inContainer3.uid)
                        doRemoveItem(inContainer4.uid)
                        doRemoveItem(inContainer5.uid)
                        doRemoveItem(inContainer6.uid)
                        doRemoveItem(inContainer7.uid)
                        doRemoveItem(inContainer8.uid)
                        if math.random(1, (100 + (getCustomSkill(cid, 50500) / 10))) <= getCustomSkill(cid, 50500) + cfg.chance then
                            doPlayerAddItem(cid, k.item,1)
                            doPlayerSendTextMessage(cid, 25, "You made..."..k.name..".")
                            if k.aid then
								local getItem = getPlayerItemById(cid, true, k.item)
                                doItemSetAttribute(getItem.uid, "aid", k.aid)
							end
                            if k.desc then
                                doItemSetAttribute(getItem.uid, "description", k.desc)
                            end
                        else
                            doPlayerSendCancel(cid, "The mix went wrong.")
                        end    
						addCustomSkillTry(cid, "Alchemy", 50500)
					else
						doPlayerSendCancel(cid, "There are no Ingredients or the order of the ingredients are wrong.")
					end            
				end
			end    
			if inContainer1.actionid == i then
				if #slots == 6 then
					if (isInArray(k.slots, inContainer2.itemid)) and (isInArray(k.slots, inContainer3.itemid)) and (isInArray(k.slots, inContainer4.itemid)) and (isInArray(k.slots, inContainer5.itemid)) and (isInArray(k.slots, inContainer6.itemid)) and (isInArray(k.slots, inContainer7.itemid)) then
                        doRemoveItem(inContainer2.uid)
                        doRemoveItem(inContainer3.uid)
                        doRemoveItem(inContainer4.uid)
                        doRemoveItem(inContainer5.uid)
                        doRemoveItem(inContainer6.uid)
                        doRemoveItem(inContainer7.uid)
                        if math.random(1, (100 + (getCustomSkill(cid, 50500) / 10))) <= getCustomSkill(cid, 50500) + cfg.chance then
                            doPlayerAddItem(cid, k.item,1)
                            doPlayerSendTextMessage(cid, 25, "You made..."..k.name..".")
                            if k.aid then
                                local getItem = getPlayerItemById(cid, true, k.item)
                                doItemSetAttribute(getItem.uid, "aid", k.aid)
							end
                            if k.desc then
                                doItemSetAttribute(getItem.uid, "description", k.desc)
                            end
                        else
                            doPlayerSendCancel(cid, "The mix went wrong.")
                        end
						addCustomSkillTry(cid, "Alchemy", 50500)
					else
						doPlayerSendCancel(cid, "There are no Ingredients or the order of the ingredients are wrong.")
					end            
				end
			end    
			if inContainer1.actionid == i then    
				if #slots == 5 then
					if (isInArray(k.slots, inContainer2.itemid)) and (isInArray(k.slots, inContainer3.itemid)) and (isInArray(k.slots, inContainer4.itemid)) and (isInArray(k.slots, inContainer5.itemid)) and (isInArray(k.slots, inContainer6.itemid)) then      
                        doRemoveItem(inContainer2.uid)
                        doRemoveItem(inContainer3.uid)
                        doRemoveItem(inContainer4.uid)
                        doRemoveItem(inContainer5.uid)
                        doRemoveItem(inContainer6.uid)
                        if math.random(1, (100 + (getCustomSkill(cid, 50500) / 10))) <= getCustomSkill(cid, 50500) + cfg.chance then
                            doPlayerAddItem(cid, k.item,1)
                            doPlayerSendTextMessage(cid, 25, "You made..."..k.name..".")
                            if k.aid then
                                local getItem = getPlayerItemById(cid, true, k.item)
                                doItemSetAttribute(getItem.uid, "aid", k.aid)
							end
                            if k.desc then
                                doItemSetAttribute(getItem.uid, "description", k.desc)
                            end
                        else
                            doPlayerSendCancel(cid, "The mix went wrong.")
                        end
						addCustomSkillTry(cid, "Alchemy", 50500)
                    else
                        doPlayerSendCancel(cid, "There are no Ingredients or the order of the ingredients are wrong.")
                    end            
                end
            end    
            if inContainer1.actionid == i then
                if #slots == 4 then
                    if (isInArray(k.slots, inContainer2.itemid)) and (isInArray(k.slots, inContainer3.itemid)) and (isInArray(k.slots, inContainer4.itemid)) and (isInArray(k.slots, inContainer5.itemid)) then    
                        doRemoveItem(inContainer2.uid)
                        doRemoveItem(inContainer3.uid)
                        doRemoveItem(inContainer4.uid)
                        doRemoveItem(inContainer5.uid)
                        if math.random(1, (100 + (getCustomSkill(cid, 50500) / 10))) <= getCustomSkill(cid, 50500) + cfg.chance then
                            doPlayerAddItem(cid, k.item,1)
                            doPlayerSendTextMessage(cid, 25, "You made..."..k.name..".")
                             if k.aid then
								local getItem = getPlayerItemById(cid, true, k.item)
                                doItemSetAttribute(getItem.uid, "aid", k.aid)
							end
                            if k.desc then
                                doItemSetAttribute(getItem.uid, "description", k.desc)
                            end
                        else
                            doPlayerSendCancel(cid, "The mix went wrong.")
                        end    
						addCustomSkillTry(cid, "Alchemy", 50500)
                    else
                        doPlayerSendCancel(cid, "There are no Ingredients or the order of the ingredients are wrong.")
                    end            
                end
            end    
            if inContainer1.actionid == i then
                if #slots == 3 then
                    if (isInArray(k.slots, inContainer2.itemid)) and (isInArray(k.slots, inContainer3.itemid)) and (isInArray(k.slots, inContainer4.itemid)) then
                        doRemoveItem(inContainer2.uid)
                        doRemoveItem(inContainer3.uid)
                        doRemoveItem(inContainer4.uid)
                        if math.random(1, (100 + (getCustomSkill(cid, 50500) / 10))) <= getCustomSkill(cid, 50500) + cfg.chance then
                            doPlayerAddItem(cid, k.item,1)
                            doPlayerSendTextMessage(cid, 25, "You made..."..k.name..".")
                            if k.aid then
                                local getItem = getPlayerItemById(cid, true, k.item)
                                doItemSetAttribute(getItem.uid, "aid", k.aid)
							end
                            if k.desc then
                                doItemSetAttribute(getItem.uid, "description", k.desc)
                            end
                        else
                            doPlayerSendCancel(cid, "The mix went wrong.")
                        end
						addCustomSkillTry(cid, "Alchemy", 50500)
                    else
                        doPlayerSendCancel(cid, "There are no Ingredients or the order of the ingredients are wrong.")
                    end            
                end
            end    
            if inContainer1.actionid == i then    
                if #slots == 2 then
                    if (isInArray(k.slots, inContainer2.itemid)) and (isInArray(k.slots, inContainer3.itemid)) then
                        doRemoveItem(inContainer2.uid)
                        doRemoveItem(inContainer3.uid)
                        if math.random(1, (100 + (getCustomSkill(cid, 50500) / 10))) <= getCustomSkill(cid, 50500) + cfg.chance then
                            doPlayerAddItem(cid, k.item,1)
                            doPlayerSendTextMessage(cid, 25, "You made..."..k.name..".")
                            if k.aid then
                                local getItem = getPlayerItemById(cid, true, k.item)
                                doItemSetAttribute(getItem.uid, "aid", k.aid)
							end
                            if k.desc then
                                doItemSetAttribute(getItem.uid, "aid", k.aid)
                            end
                        else
                            doPlayerSendCancel(cid, "The mix went wrong.")
                        end
						addCustomSkillTry(cid, "Alchemy", 50500)						
                    else
                        doPlayerSendCancel(cid, "There are no Ingredients or the order of the ingredients are wrong.")
                    end            
                end
            end  
        else
            doPlayerSendCancel(cid, "You haven't learned this recipe yet.")
        end						
    end          
	return true
end

edit: there is a small bug so everytime u mix is says "doPlayerSendCancel(cid, "You haven't learned this recipe yet.")" just ignore that for now ill fix it in the next update.

btw 375311 i dont mean to be stealing your thread's if u want i can stop posting the scripts i update.
 
Last edited:
No no, you're more than welcome to post updates plus you're of trust so all is fine.
also i don't know if it will work but try it in the parts of the script that have things like this:
Code:
doRemoveItem(inContainer2.uid)
                        doRemoveItem(inContainer3.uid)
                        doRemoveItem(inContainer4.uid)
                        doRemoveItem(inContainer5.uid)
                        doRemoveItem(inContainer6.uid)
                        doRemoveItem(inContainer7.uid)
                        doRemoveItem(inContainer8.uid)
                        doRemoveItem(inContainer9.uid)
try changing it for this:
Code:
local inContainers = {inContainer2, inContainer3, inContainer4, inContainer5, inContainer6, inContainer7, inContainer8}
		for i2 = 1, #inContainers do
			doRemoveItem(inContainers[i2].uid)
and see if it removes the items.
Edit:
at the idea of changing it to an addItem MoveEvent, I like it all we need to do is find a nice and small container type item that has more than 9 slots.
 
Last edited:
gonna test that for statement right now. i couldnt figure out how to write it.. lets hope it works.

edit:tested and works. thanks =] ill post the script here in a little bit.
---------------------------------
also wont additem work for any container type still?
<movevent type="AddItem" tileitem="1" itemid="1426" event="script" value="alchemy.lua"/>
adding it onto a unlit campfire.
just this line would have to change i think. just use position instead. b/c the container would be in the same spot
local container = getTileItemByType({x = toPosition.x+1, y = toPosition.y, z = toPosition.z}, 4)
and change the start of the function to use
function onAddItem(moveitem, tileitem, position)
but if we do just need 1 container item we could use a jewel box and expand it to 9 spaces in items.xml thats the best container item i can think of to use
----------------------------------------
here is the new mixing script got it down under 200lines yayaya! im sure someone could reduce it more but im happy with this. there are no errors that i know of so make sure to use this script instead of the one in my previous post.
Code:
	local cfg = {
        chance = 10, -- Change this to raise up the success chance--
        }
	local t =  {
        [50001] = {slots = {2794, 2760, 2007}, name = "Antidote", item = 8474},
        [50002] = {slots = {2787, 2804, 8302}, name = "Lesser Mana Potion", item = 7620},
        [50003] = {slots = {2787, 2803, 8302}, name = "Medium Mana Potion", item = 7589},
        [50004] = {slots = {2787, 2802, 8302}, name = "Strong Mana Potion", item = 7590},
        [50005] = {slots = {2794, 2799}, name = "Small Health Potion", item = 8704},
        [50006] = {slots = {2791, 2800, 8303}, name = "Lesser Health Potion", item = 7618},
        [50007] = {slots = {2791, 2759, 8303}, name = "Medium Health Potion", item = 7588},
        [50008] = {slots = {2791, 2801, 8303}, name = "Strong Health Potion", item = 7591},
        [50009] = {slots = {2791, 5921, 8303}, name = "Great Health Potion", item = 8473},
        [50010] = {slots = {2789, 2806, 8298}, name = "Spirit Potion", item = 8472},
        [50011] = {slots = {2789, 7732, 8305, 2007}, name = "Speed Potion", item = 7439, aid = 41501},
        [50012] = {slots = {2363, 2782, 8315}, name = "Potion of Strength", item = 7443, aid = 41502, desc = "This is a potion of strength."},
        [50013] = {slots = {2363, 2796, 8315}, name = "Potion of Dexterity", item = 7443, aid = 41503, desc = "This is a potion of dexterity."},
        [50014] = {slots = {2363, 2795, 8315}, name = "Potion of Endurance", item = 7443, aid = 41504, desc = "This is a potion of endurance."},
        [50015] = {slots = {2783, 8301, 2177}, name = "Potion of Magic Level", item = 7443, aid = 41505, desc = "This is a potion of magic level."},
        [50016] = {slots = {2788, 5015, 8299}, name = "Potion of Health", item = 7443, aid = 41506, desc = "This is a potion of health."},
        [50017] = {slots = {2790, 5922, 8299}, name = "Potion of Mana", item = 7443, aid = 41507, desc = "This is a potion of mana."},
        [50018] = {slots = {2798, 2177}, name = "Elixir", item = 7440, aid = 41508},
        [50019] = {slots = {2007, 8303, 8298}, name = "Blood Orb", item = 2363},
        [50020] = {slots = {2007, 2177, 8305, 8299}, name = "Soul Orb", item = 5944},
        [50021] = {slots = {2007, 2177, 8315, 8301}, name = "Mind Orb", item = 2178,},
        [50022] = {slots = {2178, 5944, 2363, 2153, 2154, 2155, 2156, 2158}, name = "Philosopher's Stone", item = 2348, aid = 41509}
        }              
function onUse(cid, item, toPosition, itemEx, fromPosition)     
    local container = getTileItemByType({x = toPosition.x+1, y = toPosition.y, z = toPosition.z}, 4)
    local inContainer1, inContainer2, inContainer3, inContainer4, inContainer5, inContainer6, inContainer7, inContainer8, inContainer9 = getContainerItem(container.uid, 0), getContainerItem(container.uid, 1), getContainerItem(container.uid, 2), getContainerItem(container.uid, 3), getContainerItem(container.uid, 4), getContainerItem(container.uid, 5), getContainerItem(container.uid, 6), getContainerItem(container.uid, 7), getContainerItem(container.uid, 8)
	local inContainers = {inContainer2, inContainer3, inContainer4, inContainer5, inContainer6, inContainer7, inContainer8}
	local k = t[inContainer1.actionid]
	if getPlayerStorageValue(cid, inContainer1.actionid) == inContainer1.actionid-50000 then
		if #k.slots == 8 then  
			if (isInArray(k.slots, inContainer2.itemid)) and (isInArray(k.slots, inContainer3.itemid)) and (isInArray(k.slots, inContainer4.itemid)) and (isInArray(k.slots, inContainer5.itemid)) and (isInArray(k.slots, inContainer6.itemid)) and (isInArray(k.slots, inContainer7.itemid)) and (isInArray(k.slots, inContainer8.itemid)) and (isInArray(k.slots, inContainer9.itemid)) then
				for i2 = 1, #k.slots do
					doRemoveItem(inContainers[i2].uid)
				end
                if math.random(1, (100 + (getCustomSkill(cid, 50500) / 10))) <= getCustomSkill(cid, 50500) + cfg.chance then
                    doPlayerAddItem(cid, k.item,1)
                    doPlayerSendTextMessage(cid, 25, "You made..."..k.name..".")
					doSendMagicEffect({x = toPosition.x, y = toPosition.y, z = toPosition.z},15)                    if k.aid then
						local getItem = getPlayerItemById(cid, true, k.item)
                        doItemSetAttribute(getItem.uid, "aid", k.aid)
					end
                    if k.desc then
                        doItemSetAttribute(getItem.uid, "description", k.desc)
                    end
                else
                    doPlayerSendCancel(cid, "The mix went wrong.")
                end
				addCustomSkillTry(cid, "Alchemy", 50500)						
			else
				doPlayerSendCancel(cid, "There are no Ingredients or the order of the ingredients are wrong.")
			end            
		elseif #k.slots == 7 then
			if (isInArray(k.slots, inContainer2.itemid)) and (isInArray(k.slots, inContainer3.itemid)) and (isInArray(k.slots, inContainer4.itemid)) and (isInArray(k.slots, inContainer5.itemid)) and (isInArray(k.slots, inContainer6.itemid)) and (isInArray(k.slots, inContainer7.itemid)) and (isInArray(k.slots, inContainer8.itemid)) then          
				for i2 = 1, #k.slots do
					doRemoveItem(inContainers[i2].uid)
				end
                if math.random(1, (100 + (getCustomSkill(cid, 50500) / 10))) <= getCustomSkill(cid, 50500) + cfg.chance then
                    doPlayerAddItem(cid, k.item,1)
                    doPlayerSendTextMessage(cid, 25, "You made..."..k.name..".")
                    if k.aid then
						local getItem = getPlayerItemById(cid, true, k.item)
                        doItemSetAttribute(getItem.uid, "aid", k.aid)
					end
                    if k.desc then
                        doItemSetAttribute(getItem.uid, "description", k.desc)
                    end
                else
                    doPlayerSendCancel(cid, "The mix went wrong.")
                end    
				addCustomSkillTry(cid, "Alchemy", 50500)
			else
				doPlayerSendCancel(cid, "There are no Ingredients or the order of the ingredients are wrong.")
			end            
		elseif #k.slots == 6 then
			if (isInArray(k.slots, inContainer2.itemid)) and (isInArray(k.slots, inContainer3.itemid)) and (isInArray(k.slots, inContainer4.itemid)) and (isInArray(k.slots, inContainer5.itemid)) and (isInArray(k.slots, inContainer6.itemid)) and (isInArray(k.slots, inContainer7.itemid)) then
				for i2 = 1, #k.slots do
					doRemoveItem(inContainers[i2].uid)
				end
                if math.random(1, (100 + (getCustomSkill(cid, 50500) / 10))) <= getCustomSkill(cid, 50500) + cfg.chance then
                    doPlayerAddItem(cid, k.item,1)
                    doPlayerSendTextMessage(cid, 25, "You made..."..k.name..".")
                    if k.aid then
                        local getItem = getPlayerItemById(cid, true, k.item)
                        doItemSetAttribute(getItem.uid, "aid", k.aid)
					end
                    if k.desc then
                        doItemSetAttribute(getItem.uid, "description", k.desc)
                    end
                else
                    doPlayerSendCancel(cid, "The mix went wrong.")
                end
				addCustomSkillTry(cid, "Alchemy", 50500)
			else
				doPlayerSendCancel(cid, "There are no Ingredients or the order of the ingredients are wrong.")
			end             
		elseif #k.slots == 5 then
			if (isInArray(k.slots, inContainer2.itemid)) and (isInArray(k.slots, inContainer3.itemid)) and (isInArray(k.slots, inContainer4.itemid)) and (isInArray(k.slots, inContainer5.itemid)) and (isInArray(k.slots, inContainer6.itemid)) then      
				for i2 = 1, #k.slots do
					doRemoveItem(inContainers[i2].uid)
				end
                if math.random(1, (100 + (getCustomSkill(cid, 50500) / 10))) <= getCustomSkill(cid, 50500) + cfg.chance then
                    doPlayerAddItem(cid, k.item,1)
                    doPlayerSendTextMessage(cid, 25, "You made..."..k.name..".")
                    if k.aid then
                        local getItem = getPlayerItemById(cid, true, k.item)
                        doItemSetAttribute(getItem.uid, "aid", k.aid)
					end
                    if k.desc then
                        doItemSetAttribute(getItem.uid, "description", k.desc)
                    end
                else
                    doPlayerSendCancel(cid, "The mix went wrong.")
                end
				addCustomSkillTry(cid, "Alchemy", 50500)
            else
                doPlayerSendCancel(cid, "There are no Ingredients or the order of the ingredients are wrong.")
            end            
        elseif #k.slots == 4 then
            if (isInArray(k.slots, inContainer2.itemid)) and (isInArray(k.slots, inContainer3.itemid)) and (isInArray(k.slots, inContainer4.itemid)) and (isInArray(k.slots, inContainer5.itemid)) then    
				for i2 = 1, #k.slots do
					doRemoveItem(inContainers[i2].uid)
				end
                if math.random(1, (100 + (getCustomSkill(cid, 50500) / 10))) <= getCustomSkill(cid, 50500) + cfg.chance then
                    doPlayerAddItem(cid, k.item,1)
                    doPlayerSendTextMessage(cid, 25, "You made..."..k.name..".")
                    if k.aid then
						local getItem = getPlayerItemById(cid, true, k.item)
                        doItemSetAttribute(getItem.uid, "aid", k.aid)
					end
                    if k.desc then
                        doItemSetAttribute(getItem.uid, "description", k.desc)
                    end
                else
                    doPlayerSendCancel(cid, "The mix went wrong.")
                end    
				addCustomSkillTry(cid, "Alchemy", 50500)
            else
                doPlayerSendCancel(cid, "There are no Ingredients or the order of the ingredients are wrong.")
            end            
        elseif #k.slots == 3 then
            if (isInArray(k.slots, inContainer2.itemid)) and (isInArray(k.slots, inContainer3.itemid)) and (isInArray(k.slots, inContainer4.itemid)) then
				for i2 = 1, #k.slots do
					doRemoveItem(inContainers[i2].uid)
				end
                if math.random(1, (100 + (getCustomSkill(cid, 50500) / 10))) <= getCustomSkill(cid, 50500) + cfg.chance then
                    doPlayerAddItem(cid, k.item,1)
                    doPlayerSendTextMessage(cid, 25, "You made..."..k.name..".")
                    if k.aid then
                        local getItem = getPlayerItemById(cid, true, k.item)
                        doItemSetAttribute(getItem.uid, "aid", k.aid)
					end
                    if k.desc then
                        doItemSetAttribute(getItem.uid, "description", k.desc)
                    end
                else
                    doPlayerSendCancel(cid, "The mix went wrong.")
                end
				addCustomSkillTry(cid, "Alchemy", 50500)
            else
                doPlayerSendCancel(cid, "There are no Ingredients or the order of the ingredients are wrong.")
            end              
        elseif #k.slots == 2 then
            if (isInArray(k.slots, inContainer2.itemid)) and (isInArray(k.slots, inContainer3.itemid)) then
                doRemoveItem(inContainer2.uid)
                doRemoveItem(inContainer3.uid)
                if math.random(1, (100 + (getCustomSkill(cid, 50500) / 10))) <= getCustomSkill(cid, 50500) + cfg.chance then
                    doPlayerAddItem(cid, k.item,1)
                    doPlayerSendTextMessage(cid, 25, "You made..."..k.name..".")
                    if k.aid then
                        local getItem = getPlayerItemById(cid, true, k.item)
                        doItemSetAttribute(getItem.uid, "aid", k.aid)
					end
                    if k.desc then
                        doItemSetAttribute(getItem.uid, "aid", k.aid)
                    end
                else
                    doPlayerSendCancel(cid, "The mix went wrong.")
                end
				addCustomSkillTry(cid, "Alchemy", 50500)						
            else
                doPlayerSendCancel(cid, "There are no Ingredients or the order of the ingredients are wrong.")
            end            
        end
    else
        doPlayerSendCancel(cid, "You haven't learned this recipe yet.")
    end						         
	return true
end
 
Last edited:
here try this but don't hold your breath:
Code:
local cfg = {
        chance = 10, -- Change this to raise up the success chance--
        }
	local t =  {
        [50001] = {slots = {2794, 2760, 2007}, slotamount = 3, name = "Antidote", item = 8474},
        [50002] = {slots = {2787, 2804, 8302}, slotamount = 3, name = "Lesser Mana Potion", item = 7620},
        [50003] = {slots = {2787, 2803, 8302}, slotamount = 3, name = "Medium Mana Potion", item = 7589},
        [50004] = {slots = {2787, 2802, 8302}, slotamount = 3, name = "Strong Mana Potion", item = 7590},
        [50005] = {slots = {2794, 2799}, slotamount = 2, name = "Small Health Potion", item = 8704},
        [50006] = {slots = {2791, 2800, 8303}, slotamount = 3, name = "Lesser Health Potion", item = 7618},
        [50007] = {slots = {2791, 2759, 8303}, slotamount = 3, name = "Medium Health Potion", item = 7588},
        [50008] = {slots = {2791, 2801, 8303}, slotamount = 3, name = "Strong Health Potion", item = 7591},
        [50009] = {slots = {2791, 5921, 8303}, slotamount = 3, name = "Great Health Potion", item = 8473},
        [50010] = {slots = {2789, 2806, 8298}, slotamount = 3, name = "Spirit Potion", item = 8472},
        [50011] = {slots = {2789, 7732, 8305, 2007}, slotamount = 4, name = "Speed Potion", item = 7439, aid = 41501},
        [50012] = {slots = {2363, 2782, 8315}, slotamount = 3, name = "Potion of Strength", item = 7443, aid = 41502, desc = "This is a potion of strength."},
        [50013] = {slots = {2363, 2796, 8315}, slotamount = 3, name = "Potion of Dexterity", item = 7443, aid = 41503, desc = "This is a potion of dexterity."},
        [50014] = {slots = {2363, 2795, 8315}, slotamount = 3, name = "Potion of Endurance", item = 7443, aid = 41504, desc = "This is a potion of endurance."},
        [50015] = {slots = {2783, 8301, 2177}, slotamount = 3, name = "Potion of Magic Level", item = 7443, aid = 41505, desc = "This is a potion of magic level."},
        [50016] = {slots = {2788, 5015, 8299}, slotamount = 3, name = "Potion of Health", item = 7443, aid = 41506, desc = "This is a potion of health."},
        [50017] = {slots = {2790, 5922, 8299}, slotamount = 3, name = "Potion of Mana", item = 7443, aid = 41507, desc = "This is a potion of mana."},
        [50018] = {slots = {2798, 2177}, slotamount = 2, name = "Elixir", item = 7440, aid = 41508},
        [50019] = {slots = {2007, 8303, 8298}, slotamount = 3, name = "Blood Orb", item = 2363},
        [50020] = {slots = {2007, 2177, 8305, 8299}, slotamount = 4, name = "Soul Orb", item = 5944},
        [50021] = {slots = {2007, 2177, 8315, 8301}, slotamount = 4, name = "Mind Orb", item = 2178,},
        [50022] = {slots = {2178, 5944, 2363, 2153, 2154, 2155, 2156, 2158}, slotamount = 8, name = "Philosopher's Stone", item = 2348, aid = 41509}
        }              
function onUse(cid, item, toPosition, itemEx, fromPosition)     
    local container = getTileItemByType({x = toPosition.x+1, y = toPosition.y, z = toPosition.z}, 4)
    local inContainer1, inContainer2, inContainer3, inContainer4, inContainer5, inContainer6, inContainer7, inContainer8, inContainer9 = getContainerItem(container.uid, 0), getContainerItem(container.uid, 1), getContainerItem(container.uid, 2), getContainerItem(container.uid, 3), getContainerItem(container.uid, 4), getContainerItem(container.uid, 5), getContainerItem(container.uid, 6), getContainerItem(container.uid, 7), getContainerItem(container.uid, 8)
	local inContainers = {inContainer2, inContainer3, inContainer4, inContainer5, inContainer6, inContainer7, inContainer8}
	local k = t[inContainer1.actionid]
	if getPlayerStorageValue(cid, inContainer1.actionid) == inContainer1.actionid-50000 then
		if #k.slots == 8 then  
			for i2 = 1, #k.slots do
				if (isInArray(k.slots, inContainers[i2].itemid)) then
					doRemoveItem(inContainers[i2].uid)
					if math.random(1, (100 + (getCustomSkill(cid, 50500) / 10))) <= getCustomSkill(cid, 50500) + cfg.chance then
						doPlayerAddItem(cid, k.item,1)
						doPlayerSendTextMessage(cid, 25, "You made..."..k.name..".")
						doSendMagicEffect({x = toPosition.x, y = toPosition.y, z = toPosition.z},15)                    
						if k.aid then
							local getItem = getPlayerItemById(cid, true, k.item)
							doItemSetAttribute(getItem.uid, "aid", k.aid)
						end
						if k.desc then
							doItemSetAttribute(getItem.uid, "description", k.desc)
						end
					else
						doPlayerSendCancel(cid, "The mix went wrong.")
					end
					addCustomSkillTry(cid, "Alchemy", 50500)						
				else
					doPlayerSendCancel(cid, "There are no Ingredients or the order of the ingredients are wrong.")
				end 
			end
		end
	end			         
	return true
end
 
didnt work and no errors :<

help me with this try
Code:
	local cfg = {
        chance = 10, -- Change this to raise up the success chance--
        }
	local t =  {
        [50001] = {slots = {2794, 2760, 2007}, name = "Antidote", item = 8474},
        [50002] = {slots = {2787, 2804, 8302}, name = "Lesser Mana Potion", item = 7620},
        [50003] = {slots = {2787, 2803, 8302}, name = "Medium Mana Potion", item = 7589},
        [50004] = {slots = {2787, 2802, 8302}, name = "Strong Mana Potion", item = 7590},
        [50005] = {slots = {2794, 2799}, name = "Small Health Potion", item = 8704},
        [50006] = {slots = {2791, 2800, 8303}, name = "Lesser Health Potion", item = 7618},
        [50007] = {slots = {2791, 2759, 8303}, name = "Medium Health Potion", item = 7588},
        [50008] = {slots = {2791, 2801, 8303}, name = "Strong Health Potion", item = 7591},
        [50009] = {slots = {2791, 5921, 8303}, name = "Great Health Potion", item = 8473},
        [50010] = {slots = {2789, 2806, 8298}, name = "Spirit Potion", item = 8472},
        [50011] = {slots = {2789, 7732, 8305, 2007}, name = "Speed Potion", item = 7439, aid = 41501},
        [50012] = {slots = {2363, 2782, 8315}, name = "Potion of Strength", item = 7443, aid = 41502, desc = "This is a potion of strength."},
        [50013] = {slots = {2363, 2796, 8315}, name = "Potion of Dexterity", item = 7443, aid = 41503, desc = "This is a potion of dexterity."},
        [50014] = {slots = {2363, 2795, 8315}, name = "Potion of Endurance", item = 7443, aid = 41504, desc = "This is a potion of endurance."},
        [50015] = {slots = {2783, 8301, 2177}, name = "Potion of Magic Level", item = 7443, aid = 41505, desc = "This is a potion of magic level."},
        [50016] = {slots = {2788, 5015, 8299}, name = "Potion of Health", item = 7443, aid = 41506, desc = "This is a potion of health."},
        [50017] = {slots = {2790, 5922, 8299}, name = "Potion of Mana", item = 7443, aid = 41507, desc = "This is a potion of mana."},
        [50018] = {slots = {2798, 2177}, name = "Elixir", item = 7440, aid = 41508},
        [50019] = {slots = {2007, 8303, 8298}, name = "Blood Orb", item = 2363},
        [50020] = {slots = {2007, 2177, 8305, 8299}, name = "Soul Orb", item = 5944},
        [50021] = {slots = {2007, 2177, 8315, 8301}, name = "Mind Orb", item = 2178,},
        [50022] = {slots = {2178, 5944, 2363, 2153, 2154, 2155, 2156, 2158}, name = "Philosopher's Stone", item = 2348, aid = 41509}
        }              
function onUse(cid, item, toPosition, itemEx, fromPosition)     
    local container = getTileItemByType({x = toPosition.x+1, y = toPosition.y, z = toPosition.z}, 4)
    local inContainer1, inContainer2, inContainer3, inContainer4, inContainer5, inContainer6, inContainer7, inContainer8, inContainer9 = getContainerItem(container.uid, 0), getContainerItem(container.uid, 1), getContainerItem(container.uid, 2), getContainerItem(container.uid, 3), getContainerItem(container.uid, 4), getContainerItem(container.uid, 5), getContainerItem(container.uid, 6), getContainerItem(container.uid, 7), getContainerItem(container.uid, 8)
	local pass = 0
	local inContainers = {inContainer2, inContainer3, inContainer4, inContainer5, inContainer6, inContainer7, inContainer8}
	local k = t[inContainer1.actionid]
	if getPlayerStorageValue(cid, inContainer1.actionid) == inContainer1.actionid-50000 then
		if #k.slots == 8 then  
			if (isInArray(k.slots, inContainer2.itemid)) and (isInArray(k.slots, inContainer3.itemid)) and (isInArray(k.slots, inContainer4.itemid)) and (isInArray(k.slots, inContainer5.itemid)) and (isInArray(k.slots, inContainer6.itemid)) and (isInArray(k.slots, inContainer7.itemid)) and (isInArray(k.slots, inContainer8.itemid)) and (isInArray(k.slots, inContainer9.itemid)) then
				for i2 = 1, #k.slots do
					doRemoveItem(inContainers[i2].uid)
				end
				pass = 1						
			else
				doPlayerSendCancel(cid, "There are no Ingredients or the order of the ingredients are wrong.")
			end            
		elseif #k.slots == 7 then
			if (isInArray(k.slots, inContainer2.itemid)) and (isInArray(k.slots, inContainer3.itemid)) and (isInArray(k.slots, inContainer4.itemid)) and (isInArray(k.slots, inContainer5.itemid)) and (isInArray(k.slots, inContainer6.itemid)) and (isInArray(k.slots, inContainer7.itemid)) and (isInArray(k.slots, inContainer8.itemid)) then          
				for i2 = 1, #k.slots do
					doRemoveItem(inContainers[i2].uid)
				end
				pass = 1
			else
				doPlayerSendCancel(cid, "There are no Ingredients or the order of the ingredients are wrong.")
			end            
		elseif #k.slots == 6 then
			if (isInArray(k.slots, inContainer2.itemid)) and (isInArray(k.slots, inContainer3.itemid)) and (isInArray(k.slots, inContainer4.itemid)) and (isInArray(k.slots, inContainer5.itemid)) and (isInArray(k.slots, inContainer6.itemid)) and (isInArray(k.slots, inContainer7.itemid)) then
				for i2 = 1, #k.slots do
					doRemoveItem(inContainers[i2].uid)
				end
				pass = 1
                else
                    doPlayerSendCancel(cid, "The mix went wrong.")
                end
				addCustomSkillTry(cid, "Alchemy", 50500)
			else
				doPlayerSendCancel(cid, "There are no Ingredients or the order of the ingredients are wrong.")
			end             
		elseif #k.slots == 5 then
			if (isInArray(k.slots, inContainer2.itemid)) and (isInArray(k.slots, inContainer3.itemid)) and (isInArray(k.slots, inContainer4.itemid)) and (isInArray(k.slots, inContainer5.itemid)) and (isInArray(k.slots, inContainer6.itemid)) then      
				for i2 = 1, #k.slots do
					doRemoveItem(inContainers[i2].uid)
				end
				pass = 1
				addCustomSkillTry(cid, "Alchemy", 50500)
            else
                doPlayerSendCancel(cid, "There are no Ingredients or the order of the ingredients are wrong.")
            end            
        elseif #k.slots == 4 then
            if (isInArray(k.slots, inContainer2.itemid)) and (isInArray(k.slots, inContainer3.itemid)) and (isInArray(k.slots, inContainer4.itemid)) and (isInArray(k.slots, inContainer5.itemid)) then    
				for i2 = 1, #k.slots do
					doRemoveItem(inContainers[i2].uid)
				end
				pass = 1  
				addCustomSkillTry(cid, "Alchemy", 50500)
            else
                doPlayerSendCancel(cid, "There are no Ingredients or the order of the ingredients are wrong.")
            end            
        elseif #k.slots == 3 then
            if (isInArray(k.slots, inContainer2.itemid)) and (isInArray(k.slots, inContainer3.itemid)) and (isInArray(k.slots, inContainer4.itemid)) then
				for i2 = 1, #k.slots do
					doRemoveItem(inContainers[i2].uid)
				end
				pass = 1
				addCustomSkillTry(cid, "Alchemy", 50500)
            else
                doPlayerSendCancel(cid, "There are no Ingredients or the order of the ingredients are wrong.")
            end              
        elseif #k.slots == 2 then
            if (isInArray(k.slots, inContainer2.itemid)) and (isInArray(k.slots, inContainer3.itemid)) then
                doRemoveItem(inContainer2.uid)
                doRemoveItem(inContainer3.uid)
				pass = 1
				addCustomSkillTry(cid, "Alchemy", 50500)						
            else
                doPlayerSendCancel(cid, "There are no Ingredients or the order of the ingredients are wrong.")
            end            
        end
        if pass == 1 and math.random(1, (100 + (getCustomSkill(cid, 50500) / 10))) <= getCustomSkill(cid, 50500) + cfg.chance then
            doPlayerAddItem(cid, k.item,1)
            doPlayerSendTextMessage(cid, 25, "You made..."..k.name..".")
            if k.aid then
                local getItem = getPlayerItemById(cid, true, k.item)
                doItemSetAttribute(getItem.uid, "aid", k.aid)
			end
            if k.desc then
                doItemSetAttribute(getItem.uid, "aid", k.aid)
            end
        else
            doPlayerSendCancel(cid, "The mix went wrong.")
        end
    else
        doPlayerSendCancel(cid, "You haven't learned this recipe yet.")
    end						         
	return true
end

[Error - LuaScriptInterface::loadFile] data/actions/scripts/alchemy.lua:119: 'en
d' expected (to close 'function' at line 28) near 'else'
[Warning - Event::loadScript] Cannot load script (data/actions/scripts/alchemy.l
ua)
data/actions/scripts/alchemy.lua:119: 'end' expected (to close 'function' at lin
e 28) near 'else'
 
didnt work and no errors :<

help me with this try
Code:
    local cfg = {
        chance = 10, -- Change this to raise up the success chance--
        }
    local t =  {
        [50001] = {slots = {2794, 2760, 2007}, name = "Antidote", item = 8474},
        [50002] = {slots = {2787, 2804, 8302}, name = "Lesser Mana Potion", item = 7620},
        [50003] = {slots = {2787, 2803, 8302}, name = "Medium Mana Potion", item = 7589},
        [50004] = {slots = {2787, 2802, 8302}, name = "Strong Mana Potion", item = 7590},
        [50005] = {slots = {2794, 2799}, name = "Small Health Potion", item = 8704},
        [50006] = {slots = {2791, 2800, 8303}, name = "Lesser Health Potion", item = 7618},
        [50007] = {slots = {2791, 2759, 8303}, name = "Medium Health Potion", item = 7588},
        [50008] = {slots = {2791, 2801, 8303}, name = "Strong Health Potion", item = 7591},
        [50009] = {slots = {2791, 5921, 8303}, name = "Great Health Potion", item = 8473},
        [50010] = {slots = {2789, 2806, 8298}, name = "Spirit Potion", item = 8472},
        [50011] = {slots = {2789, 7732, 8305, 2007}, name = "Speed Potion", item = 7439, aid = 41501},
        [50012] = {slots = {2363, 2782, 8315}, name = "Potion of Strength", item = 7443, aid = 41502, desc = "This is a potion of strength."},
        [50013] = {slots = {2363, 2796, 8315}, name = "Potion of Dexterity", item = 7443, aid = 41503, desc = "This is a potion of dexterity."},
        [50014] = {slots = {2363, 2795, 8315}, name = "Potion of Endurance", item = 7443, aid = 41504, desc = "This is a potion of endurance."},
        [50015] = {slots = {2783, 8301, 2177}, name = "Potion of Magic Level", item = 7443, aid = 41505, desc = "This is a potion of magic level."},
        [50016] = {slots = {2788, 5015, 8299}, name = "Potion of Health", item = 7443, aid = 41506, desc = "This is a potion of health."},
        [50017] = {slots = {2790, 5922, 8299}, name = "Potion of Mana", item = 7443, aid = 41507, desc = "This is a potion of mana."},
        [50018] = {slots = {2798, 2177}, name = "Elixir", item = 7440, aid = 41508},
        [50019] = {slots = {2007, 8303, 8298}, name = "Blood Orb", item = 2363},
        [50020] = {slots = {2007, 2177, 8305, 8299}, name = "Soul Orb", item = 5944},
        [50021] = {slots = {2007, 2177, 8315, 8301}, name = "Mind Orb", item = 2178,},
        [50022] = {slots = {2178, 5944, 2363, 2153, 2154, 2155, 2156, 2158}, name = "Philosopher's Stone", item = 2348, aid = 41509}
        }              
function onUse(cid, item, toPosition, itemEx, fromPosition)     
    local container = getTileItemByType({x = toPosition.x+1, y = toPosition.y, z = toPosition.z}, 4)
    local inContainer1, inContainer2, inContainer3, inContainer4, inContainer5, inContainer6, inContainer7, inContainer8, inContainer9 = getContainerItem(container.uid, 0), getContainerItem(container.uid, 1), getContainerItem(container.uid, 2), getContainerItem(container.uid, 3), getContainerItem(container.uid, 4), getContainerItem(container.uid, 5), getContainerItem(container.uid, 6), getContainerItem(container.uid, 7), getContainerItem(container.uid, 8)
    local pass = 0
    local inContainers = {inContainer2, inContainer3, inContainer4, inContainer5, inContainer6, inContainer7, inContainer8}
    local k = t[inContainer1.actionid]
    if getPlayerStorageValue(cid, inContainer1.actionid) == inContainer1.actionid-50000 then
        if #k.slots == 8 then  
            if (isInArray(k.slots, inContainer2.itemid)) and (isInArray(k.slots, inContainer3.itemid)) and (isInArray(k.slots, inContainer4.itemid)) and (isInArray(k.slots, inContainer5.itemid)) and (isInArray(k.slots, inContainer6.itemid)) and (isInArray(k.slots, inContainer7.itemid)) and (isInArray(k.slots, inContainer8.itemid)) and (isInArray(k.slots, inContainer9.itemid)) then
                for i2 = 1, #k.slots do
                    doRemoveItem(inContainers[i2].uid)
                end
                pass = 1                        
            else
                doPlayerSendCancel(cid, "There are no Ingredients or the order of the ingredients are wrong.")
            end            
        elseif #k.slots == 7 then
            if (isInArray(k.slots, inContainer2.itemid)) and (isInArray(k.slots, inContainer3.itemid)) and (isInArray(k.slots, inContainer4.itemid)) and (isInArray(k.slots, inContainer5.itemid)) and (isInArray(k.slots, inContainer6.itemid)) and (isInArray(k.slots, inContainer7.itemid)) and (isInArray(k.slots, inContainer8.itemid)) then          
                for i2 = 1, #k.slots do
                    doRemoveItem(inContainers[i2].uid)
                end
                pass = 1
            else
                doPlayerSendCancel(cid, "There are no Ingredients or the order of the ingredients are wrong.")
            end            
        elseif #k.slots == 6 then
            if (isInArray(k.slots, inContainer2.itemid)) and (isInArray(k.slots, inContainer3.itemid)) and (isInArray(k.slots, inContainer4.itemid)) and (isInArray(k.slots, inContainer5.itemid)) and (isInArray(k.slots, inContainer6.itemid)) and (isInArray(k.slots, inContainer7.itemid)) then
                for i2 = 1, #k.slots do
                    doRemoveItem(inContainers[i2].uid)
                end
                pass = 1
                else
                    doPlayerSendCancel(cid, "The mix went wrong.")
                end
                addCustomSkillTry(cid, "Alchemy", 50500)
            else
                doPlayerSendCancel(cid, "There are no Ingredients or the order of the ingredients are wrong.")
            end             
        elseif #k.slots == 5 then
            if (isInArray(k.slots, inContainer2.itemid)) and (isInArray(k.slots, inContainer3.itemid)) and (isInArray(k.slots, inContainer4.itemid)) and (isInArray(k.slots, inContainer5.itemid)) and (isInArray(k.slots, inContainer6.itemid)) then      
                for i2 = 1, #k.slots do
                    doRemoveItem(inContainers[i2].uid)
                end
                pass = 1
                addCustomSkillTry(cid, "Alchemy", 50500)
            else
                doPlayerSendCancel(cid, "There are no Ingredients or the order of the ingredients are wrong.")
            end            
        elseif #k.slots == 4 then
            if (isInArray(k.slots, inContainer2.itemid)) and (isInArray(k.slots, inContainer3.itemid)) and (isInArray(k.slots, inContainer4.itemid)) and (isInArray(k.slots, inContainer5.itemid)) then    
                for i2 = 1, #k.slots do
                    doRemoveItem(inContainers[i2].uid)
                end
                pass = 1  
                addCustomSkillTry(cid, "Alchemy", 50500)
            else
                doPlayerSendCancel(cid, "There are no Ingredients or the order of the ingredients are wrong.")
            end            
        elseif #k.slots == 3 then
            if (isInArray(k.slots, inContainer2.itemid)) and (isInArray(k.slots, inContainer3.itemid)) and (isInArray(k.slots, inContainer4.itemid)) then
                for i2 = 1, #k.slots do
                    doRemoveItem(inContainers[i2].uid)
                end
                pass = 1
                addCustomSkillTry(cid, "Alchemy", 50500)
            else
                doPlayerSendCancel(cid, "There are no Ingredients or the order of the ingredients are wrong.")
            end              
        elseif #k.slots == 2 then
            if (isInArray(k.slots, inContainer2.itemid)) and (isInArray(k.slots, inContainer3.itemid)) then
                doRemoveItem(inContainer2.uid)
                doRemoveItem(inContainer3.uid)
                pass = 1
                addCustomSkillTry(cid, "Alchemy", 50500)                        
            else
                doPlayerSendCancel(cid, "There are no Ingredients or the order of the ingredients are wrong.")
            end            
        end
        if pass == 1 and math.random(1, (100 + (getCustomSkill(cid, 50500) / 10))) <= getCustomSkill(cid, 50500) + cfg.chance then
            doPlayerAddItem(cid, k.item,1)
            doPlayerSendTextMessage(cid, 25, "You made..."..k.name..".")
            if k.aid then
                local getItem = getPlayerItemById(cid, true, k.item)
                doItemSetAttribute(getItem.uid, "aid", k.aid)
            end
            if k.desc then
                doItemSetAttribute(getItem.uid, "aid", k.aid)
            end
        else
            doPlayerSendCancel(cid, "The mix went wrong.")
        end
    else
        doPlayerSendCancel(cid, "You haven't learned this recipe yet.")
    end                                 
    return true
end

check line 60 ~ 62 A_A
 
fixed!
Code:
local t =  {
        [50001] = {slots = {2794, 2760, 2007}, name = "Antidote", item = 8474},
        [50002] = {slots = {2787, 2804, 8302}, name = "Lesser Mana Potion", item = 7620},
        [50003] = {slots = {2787, 2803, 8302}, name = "Medium Mana Potion", item = 7589},
        [50004] = {slots = {2787, 2802, 8302}, name = "Strong Mana Potion", item = 7590},
        [50005] = {slots = {2794, 2799}, name = "Small Health Potion", item = 8704},
        [50006] = {slots = {2791, 2800, 8303}, name = "Lesser Health Potion", item = 7618},
        [50007] = {slots = {2791, 2759, 8303}, name = "Medium Health Potion", item = 7588},
        [50008] = {slots = {2791, 2801, 8303}, name = "Strong Health Potion", item = 7591},
        [50009] = {slots = {2791, 5921, 8303}, name = "Great Health Potion", item = 8473},
        [50010] = {slots = {2789, 2806, 8298}, name = "Spirit Potion", item = 8472},
        [50011] = {slots = {2789, 7732, 8305, 2007}, name = "Speed Potion", item = 7439, aid = 41501},
        [50012] = {slots = {2363, 2782, 8315}, name = "Potion of Strength", item = 7443, aid = 41502, desc = "This is a potion of strength."},
        [50013] = {slots = {2363, 2796, 8315}, name = "Potion of Dexterity", item = 7443, aid = 41503, desc = "This is a potion of dexterity."},
        [50014] = {slots = {2363, 2795, 8315}, name = "Potion of Endurance", item = 7443, aid = 41504, desc = "This is a potion of endurance."},
        [50015] = {slots = {2783, 8301, 2177}, name = "Potion of Magic Level", item = 7443, aid = 41505, desc = "This is a potion of magic level."},
        [50016] = {slots = {2788, 5015, 8299}, name = "Potion of Health", item = 7443, aid = 41506, desc = "This is a potion of health."},
        [50017] = {slots = {2790, 5922, 8299}, name = "Potion of Mana", item = 7443, aid = 41507, desc = "This is a potion of mana."},
        [50018] = {slots = {2798, 2177}, name = "Elixir", item = 7440, aid = 41508},
        [50019] = {slots = {2007, 8303, 8298}, name = "Blood Orb", item = 2363},
        [50020] = {slots = {2007, 2177, 8305, 8299}, name = "Soul Orb", item = 5944},
        [50021] = {slots = {2007, 2177, 8315, 8301}, name = "Mind Orb", item = 2178,},
        [50022] = {slots = {2178, 5944, 2363, 2153, 2154, 2155, 2156, 2158}, name = "Philosopher's Stone", item = 2348, aid = 41509}
        }              
function onUse(cid, item, toPosition, itemEx, fromPosition)     
    local container = getTileItemByType({x = toPosition.x+1, y = toPosition.y, z = toPosition.z}, 4)
    local inContainer1, inContainer2, inContainer3, inContainer4, inContainer5, inContainer6, inContainer7, inContainer8, inContainer9 = getContainerItem(container.uid, 0), getContainerItem(container.uid, 1), getContainerItem(container.uid, 2), getContainerItem(container.uid, 3), getContainerItem(container.uid, 4), getContainerItem(container.uid, 5), getContainerItem(container.uid, 6), getContainerItem(container.uid, 7), getContainerItem(container.uid, 8)
	local pass = 0
	local inContainers = {inContainer2, inContainer3, inContainer4, inContainer5, inContainer6, inContainer7, inContainer8}
	local k = t[inContainer1.actionid]
	if getPlayerStorageValue(cid, inContainer1.actionid) == inContainer1.actionid-50000 then
		if #k.slots == 8 then  
			if (isInArray(k.slots, inContainer2.itemid)) and (isInArray(k.slots, inContainer3.itemid)) and (isInArray(k.slots, inContainer4.itemid)) and (isInArray(k.slots, inContainer5.itemid)) and (isInArray(k.slots, inContainer6.itemid)) and (isInArray(k.slots, inContainer7.itemid)) and (isInArray(k.slots, inContainer8.itemid)) and (isInArray(k.slots, inContainer9.itemid)) then
				for i2 = 1, #k.slots do
					doRemoveItem(inContainers[i2].uid)
				end
				pass = 1						
			else
				doPlayerSendCancel(cid, "There are no Ingredients or the order of the ingredients are wrong.")
			end            
		elseif #k.slots == 7 then
			if (isInArray(k.slots, inContainer2.itemid)) and (isInArray(k.slots, inContainer3.itemid)) and (isInArray(k.slots, inContainer4.itemid)) and (isInArray(k.slots, inContainer5.itemid)) and (isInArray(k.slots, inContainer6.itemid)) and (isInArray(k.slots, inContainer7.itemid)) and (isInArray(k.slots, inContainer8.itemid)) then          
				for i2 = 1, #k.slots do
					doRemoveItem(inContainers[i2].uid)
				end
				pass = 1
			else
				doPlayerSendCancel(cid, "There are no Ingredients or the order of the ingredients are wrong.")
			end            
		elseif #k.slots == 6 then
			if (isInArray(k.slots, inContainer2.itemid)) and (isInArray(k.slots, inContainer3.itemid)) and (isInArray(k.slots, inContainer4.itemid)) and (isInArray(k.slots, inContainer5.itemid)) and (isInArray(k.slots, inContainer6.itemid)) and (isInArray(k.slots, inContainer7.itemid)) then
				for i2 = 1, #k.slots do
					doRemoveItem(inContainers[i2].uid)
				end
				pass = 1
            else
				addCustomSkillTry(cid, "Alchemy", 50500)
			else
				doPlayerSendCancel(cid, "There are no Ingredients or the order of the ingredients are wrong.")
			end             
		elseif #k.slots == 5 then
			if (isInArray(k.slots, inContainer2.itemid)) and (isInArray(k.slots, inContainer3.itemid)) and (isInArray(k.slots, inContainer4.itemid)) and (isInArray(k.slots, inContainer5.itemid)) and (isInArray(k.slots, inContainer6.itemid)) then      
				for i2 = 1, #k.slots do
					doRemoveItem(inContainers[i2].uid)
				end
				pass = 1
				addCustomSkillTry(cid, "Alchemy", 50500)
            else
                doPlayerSendCancel(cid, "There are no Ingredients or the order of the ingredients are wrong.")
            end            
        elseif #k.slots == 4 then
            if (isInArray(k.slots, inContainer2.itemid)) and (isInArray(k.slots, inContainer3.itemid)) and (isInArray(k.slots, inContainer4.itemid)) and (isInArray(k.slots, inContainer5.itemid)) then    
				for i2 = 1, #k.slots do
					doRemoveItem(inContainers[i2].uid)
				end
				pass = 1  
				addCustomSkillTry(cid, "Alchemy", 50500)
            else
                doPlayerSendCancel(cid, "There are no Ingredients or the order of the ingredients are wrong.")
            end            
        elseif #k.slots == 3 then
            if (isInArray(k.slots, inContainer2.itemid)) and (isInArray(k.slots, inContainer3.itemid)) and (isInArray(k.slots, inContainer4.itemid)) then
				for i2 = 1, #k.slots do
					doRemoveItem(inContainers[i2].uid)
				end
				pass = 1
				addCustomSkillTry(cid, "Alchemy", 50500)
            else
                doPlayerSendCancel(cid, "There are no Ingredients or the order of the ingredients are wrong.")
            end              
        elseif #k.slots == 2 then
            if (isInArray(k.slots, inContainer2.itemid)) and (isInArray(k.slots, inContainer3.itemid)) then
                doRemoveItem(inContainer2.uid)
                doRemoveItem(inContainer3.uid)
				pass = 1
				addCustomSkillTry(cid, "Alchemy", 50500)						
            else
                doPlayerSendCancel(cid, "There are no Ingredients or the order of the ingredients are wrong.")
            end            
        end
        if pass == 1 and math.random(1, (100 + (getCustomSkill(cid, 50500) / 10))) <= getCustomSkill(cid, 50500) + cfg.chance then
            doPlayerAddItem(cid, k.item,1)
            doPlayerSendTextMessage(cid, 25, "You made..."..k.name..".")
            if k.aid then
                local getItem = getPlayerItemById(cid, true, k.item)
                doItemSetAttribute(getItem.uid, "aid", k.aid)
			end
            if k.desc then
                doItemSetAttribute(getItem.uid, "aid", k.aid)
            end
        else
            doPlayerSendCancel(cid, "The mix went wrong.")
        end
    else
        doPlayerSendCancel(cid, "You haven't learned this recipe yet.")
    end						         
	return true
end
 
@up and up
ahh thanks good catches.

here is the full alchemy system in one mod file. it use 0.3.6. also note that it doesn't include the potion effects. so they will just act as normal tibia potions would.
PHP:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Alchemy System" version="2.0" author="375311/soul4soul" enabled="yes">
	<action  itemid="2217"  event="script"><![CDATA[
	function onUse(cid, item, toPosition, fromPosition)
        local function burn()
        local Cpos = getCreaturePosition(cid)
        local north = {x = Cpos.x, y = Cpos.y-1, z = Cpos.z}
        local south = {x = Cpos.x, y = Cpos.y+1, z = Cpos.z}
        local west = {x = Cpos.x-1, y = Cpos.y, z = Cpos.z}
        local east = {x = Cpos.x+1, y = Cpos.y, z = Cpos.z}
                if getCreatureLookDirection(cid) == 0 then
                        doSendMagicEffect(north, 6)
                elseif getCreatureLookDirection(cid) == 1 then
                        doSendMagicEffect(east, 6)
                elseif getCreatureLookDirection(cid) == 2 then
                        doSendMagicEffect(south, 6)    
                elseif getCreatureLookDirection(cid) == 3 then
                        doSendMagicEffect(west, 6)
                end    
        end    
        local learned = getPlayerStorageValue(cid, 50000)
        if learned == -1 then  
                        for i = 41508, 41509 do
                                setPlayerStorageValue(cid, i, 0)
                        end
                        for i = 50001, 50022 do
                                setPlayerStorageValue(cid, i, 0)
                        end
                        setPlayerStorageValue(cid, 50500, 10)
                        setPlayerStorageValue(cid, 50000, 1)
                        doRemoveItem(item.uid)
                        doPlayerSendTextMessage(cid, 25, "You have learned Alchemy, then the book burned to ashes after learning its Alchemic Secrets.")
                        addEvent(burn, 300, {cid = cid, toPosition = toPosition, fromPosition = fromPosition})
        else
                doPlayerSendCancel(cid, "You already know Alchemy.")
        end
return true
end    
	]]></action>
	<action  itemid="1954"  event="script"><![CDATA[
		local t = {
                [50001] = {ref = 50001, recipe = "Antidote", pStorage = 1, alchemylvl = 10},
                [50002] = {ref = 50002, recipe = "Lesser Mana Potion", pStorage = 2, alchemylvl = 15},
                [50003] = {ref = 50003, recipe = "Medium Mana Potion", pStorage = 3, alchemylvl = 25},
                [50004] = {ref = 50004, recipe = "Strong Mana Potion", pStorage = 4, alchemylvl = 35},
                [50005] = {ref = 50005, recipe = "Small Health Potion", pStorage = 5, alchemylvl = 10},
                [50006] = {ref = 50006, recipe = "Lesser Health Potion", pStorage = 6, alchemylvl = 15},
                [50007] = {ref = 50007, recipe = "Medium Health Potion", pStorage = 7, alchemylvl = 25},
                [50008] = {ref = 50008, recipe = "Strong Health Potion", pStorage = 8, alchemylvl = 35},
                [50009] = {ref = 50009, recipe = "Great Health Potion", pStorage = 9, alchemylvl = 40},
                [50010] = {ref = 50010, recipe = "Spirit Potion", pStorage = 10, alchemylvl = 50},
                [50011] = {ref = 50011, recipe = "Speed Potion", pStorage = 11, alchemylvl = 50},
                [50012] = {ref = 50012, recipe = "Potion of Strength", pStorage = 12, alchemylvl = 70},
                [50013] = {ref = 50013, recipe = "Potion of Dexterity", pStorage = 13, alchemylvl = 70},
                [50014] = {ref = 50014, recipe = "Potion of Endurance", pStorage = 14, alchemylvl = 70},
                [50015] = {ref = 50015, recipe = "Potion of Magic Level", pStorage = 15, alchemylvl = 80},
                [50016] = {ref = 50016, recipe = "Potion of Health", pStorage = 16, alchemylvl = 60},
                [50017] = {ref = 50017, recipe = "Potion of Mana", pStorage = 17, alchemylvl = 60},
                [50018] = {ref = 50018, recipe = "Elixir", pStorage = 18, alchemylvl = 100},
                [50019] = {ref = 50019, recipe = "Blood Orb", pStorage = 19, alchemylvl = 40},
                [50020] = {ref = 50020, recipe = "Soul Orb", pStorage = 20, alchemylvl = 90},
                [50021] = {ref = 50021, recipe = "Mind Orb", pStorage = 21, alchemylvl = 90},
                [50022] = {ref = 50022, recipe = "Philosopher's Stone", pStorage = 22, alchemylvl = 100}
                }
function onUse(cid, item, toPosition, item2, fromPosition)
        for i, k in pairs(t) do
                        if item.actionid == i then
                                if getPlayerStorageValue(cid, k.ref) == 0 then
                                        if getCustomSkill(cid, 50500) >= k.alchemylvl then
                                                doPlayerSetStorageValue(cid, k.ref, k.pStorage)
                                                doPlayerSendTextMessage(cid, 25, "You learned how to make "..k.recipe..".")
                                                doSendMagicEffect(getCreaturePosition(cid), 13)
                                        else
                                                doPlayerSendCancel(cid, "You require "..k.alchemylvl.." in Alchemy or you don't know Alchemy.")
                                        end
                                else
                                        doPlayerSendCancel(cid, "You have already learned this recipe.")
                                end            
                        end
        end
return true
end    
--Ver.3hR7Ik5lz3wF1gX1-¥P0k_TnÖD-- 
	]]></action>
	<action  itemid="1965"  event="script"><![CDATA[
			local recipeIDs = {
                {50001, "Mushroom, Goat Grass and Hydrargyrum", "[Antidote]", 10},
                {50002, "White Mushroom, Shadow Herb and Aquamarine", "[Lesser Mana Potion]", 15},
                {50003, "White Mushroom, Powder Herb and Aquamarine", "[Medium Mana Potion]", 25},
                {50004, "White Mushroom, Siling Herb and Aquamarine", "[Strong Mana Potion]", 35},
                {50005, "Mushroom and Stone Herb", "[Small Health Potion]", 10},
                {50006, "Wood Mushroom, Star Herb and Vermillion", "[Lesser Health Potion]", 15},
                {50007, "Wood Mushroom, Orange Star and Vermillion", "[Medium Health Potion]", 25},
                {50008, "Wood Mushroom, Fern and Vermillion", "[Strong Health Potion]", 35},
                {50009, "Wood Mushroom, Heaven Blossom and Vermillion", "[Great Health Potion]", 40},
                {50010, "Brown Mushroom, Troll Green and Powder", "[Spirit Potion]", 50},
                {50011, "Brown Mushroom, Seeds, Quartzite and Hydrargyrum", "[Speed Potion]", 50},
                {50012, "Blood Orb, Dark Mushroom and Vitriol", "[Potion of Strength]", 70},
                {50013, "Blood Orb, Green Mushroom and Vitriol", "[Potion of Dexterity]", 70},
                {50014, "Blood Orb, Fire Mushroom and Vitriol", "[Potion of Endurance]", 70},
                {50015, "Little Mushroom, Quebrith and Crystal", "[Potion of Magic Level]", 80},
                {50016, "Red Mushroom, Mandrake and Tar", "[Potion of Health]", 60},
                {50017, "Orange Mushroom, Ancient Orchid and Tar", "[Potion of Mana]", 60},
                {50018, "Dragrot and Crystal", "[Elixir]", 100},
                {50019, "Hydrargyrum, Vermillion and Powder", "[Blood Orb]", 40},
                {50020, "Hydrargyrum, Crystal, Quarzite and Tar", "[Soul Orb]", 90},
                {50021, "Hydrargyrum, Crystal, Vitriol and Quebrith","[Mind Orb]", 90},
                {50022, "Mind Orb, Soul Orb, Blood Orb, Violet Gem, Yellow Gem, Green Gem, Red Gem, Blue Gem", "[Philosopher's Stone]", 100}
        }
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
        local a = {}
        table.insert(a, "Learned Recipe:\n\n")
 
        for i=1, #recipeIDs, 1 do
                if getPlayerStorageValue(cid, recipeIDs[i][1]) > 0 then
                        recipe = recipeIDs[i][3] .. ": 'Ingredients': " .. recipeIDs[i][2] .. ". 'Alchemy Level': " .. recipeIDs[i][4] .. ".\n"
                        table.insert(a, recipe)
                end            
        end
        doShowTextDialog(cid, item.itemid, table.concat(a, ""))
end
--Ver.3hR7Ik5lz3wF1gX1-¥P0k_TnÖD-- 
	]]></action>
	<action  itemid="1966"  event="script"><![CDATA[
		local skillIDs = {
                {50500, "Alchemy"} -- The first ID is the skill value, the second ID is the name of the skill
        }
		function onUse(cid, item, fromPosition, itemEx, toPosition)
        local a = {}
        table.insert(a, "Current Skills:\n\n")
 
                skill = skillIDs[1][2] .. ": " .. math.max(10, getCustomSkill(cid, skillIDs[1][1])) .. ". Percent to go: " .. getCustomSkillPercent(cid, skillIDs[1][1]) .. "%\n"
                table.insert(a, skill)
        doShowTextDialog(cid, item.itemid, table.concat(a, ""))
end 
	]]></action>
	<action  itemid="9825"  event="script"><![CDATA[
	local cfg = {
        chance = 10, -- Change this to raise up the success chance--
        }
	local t =  {
        [50001] = {slots = {2794, 2760, 2007}, name = "Antidote", item = 8474},
        [50002] = {slots = {2787, 2804, 8302}, name = "Lesser Mana Potion", item = 7620},
        [50003] = {slots = {2787, 2803, 8302}, name = "Medium Mana Potion", item = 7589},
        [50004] = {slots = {2787, 2802, 8302}, name = "Strong Mana Potion", item = 7590},
        [50005] = {slots = {2794, 2799}, name = "Small Health Potion", item = 8704},
        [50006] = {slots = {2791, 2800, 8303}, name = "Lesser Health Potion", item = 7618},
        [50007] = {slots = {2791, 2759, 8303}, name = "Medium Health Potion", item = 7588},
        [50008] = {slots = {2791, 2801, 8303}, name = "Strong Health Potion", item = 7591},
        [50009] = {slots = {2791, 5921, 8303}, name = "Great Health Potion", item = 8473},
        [50010] = {slots = {2789, 2806, 8298}, name = "Spirit Potion", item = 8472},
        [50011] = {slots = {2789, 7732, 8305, 2007}, name = "Speed Potion", item = 7439, aid = 41501},
        [50012] = {slots = {2363, 2782, 8315}, name = "Potion of Strength", item = 7443, aid = 41502, desc = "This is a potion of strength."},
        [50013] = {slots = {2363, 2796, 8315}, name = "Potion of Dexterity", item = 7443, aid = 41503, desc = "This is a potion of dexterity."},
        [50014] = {slots = {2363, 2795, 8315}, name = "Potion of Endurance", item = 7443, aid = 41504, desc = "This is a potion of endurance."},
        [50015] = {slots = {2783, 8301, 2177}, name = "Potion of Magic Level", item = 7443, aid = 41505, desc = "This is a potion of magic level."},
        [50016] = {slots = {2788, 5015, 8299}, name = "Potion of Health", item = 7443, aid = 41506, desc = "This is a potion of health."},
        [50017] = {slots = {2790, 5922, 8299}, name = "Potion of Mana", item = 7443, aid = 41507, desc = "This is a potion of mana."},
        [50018] = {slots = {2798, 2177}, name = "Elixir", item = 7440, aid = 41508},
        [50019] = {slots = {2007, 8303, 8298}, name = "Blood Orb", item = 2363},
        [50020] = {slots = {2007, 2177, 8305, 8299}, name = "Soul Orb", item = 5944},
        [50021] = {slots = {2007, 2177, 8315, 8301}, name = "Mind Orb", item = 2178,},
        [50022] = {slots = {2178, 5944, 2363, 2153, 2154, 2155, 2156, 2158}, name = "Philosopher's Stone", item = 2348, aid = 41509}
        }              
function onUse(cid, item, toPosition, itemEx, fromPosition)     
    local container = getTileItemByType({x = toPosition.x+1, y = toPosition.y, z = toPosition.z}, 4)
    local inContainer1, inContainer2, inContainer3, inContainer4, inContainer5, inContainer6, inContainer7, inContainer8, inContainer9 = getContainerItem(container.uid, 0), getContainerItem(container.uid, 1), getContainerItem(container.uid, 2), getContainerItem(container.uid, 3), getContainerItem(container.uid, 4), getContainerItem(container.uid, 5), getContainerItem(container.uid, 6), getContainerItem(container.uid, 7), getContainerItem(container.uid, 8)
	local pass = 0
	local inContainers = {inContainer2, inContainer3, inContainer4, inContainer5, inContainer6, inContainer7, inContainer8}
	local k = t[inContainer1.actionid]
	if getPlayerStorageValue(cid, inContainer1.actionid) == inContainer1.actionid-50000 then
		if #k.slots == 8 then  
			if (isInArray(k.slots, inContainer2.itemid)) and (isInArray(k.slots, inContainer3.itemid)) and (isInArray(k.slots, inContainer4.itemid)) and (isInArray(k.slots, inContainer5.itemid)) and (isInArray(k.slots, inContainer6.itemid)) and (isInArray(k.slots, inContainer7.itemid)) and (isInArray(k.slots, inContainer8.itemid)) and (isInArray(k.slots, inContainer9.itemid)) then
				for i2 = 1, #k.slots do
					doRemoveItem(inContainers[i2].uid)
				end
				pass = 1
				addCustomSkillTry(cid, "Alchemy", 50500)				
			else
				doPlayerSendCancel(cid, "There are no Ingredients or the order of the ingredients are wrong.")
			end            
		elseif #k.slots == 7 then
			if (isInArray(k.slots, inContainer2.itemid)) and (isInArray(k.slots, inContainer3.itemid)) and (isInArray(k.slots, inContainer4.itemid)) and (isInArray(k.slots, inContainer5.itemid)) and (isInArray(k.slots, inContainer6.itemid)) and (isInArray(k.slots, inContainer7.itemid)) and (isInArray(k.slots, inContainer8.itemid)) then          
				for i2 = 1, #k.slots do
					doRemoveItem(inContainers[i2].uid)
				end
				pass = 1
				addCustomSkillTry(cid, "Alchemy", 50500)
			else
				doPlayerSendCancel(cid, "There are no Ingredients or the order of the ingredients are wrong.")
			end            
		elseif #k.slots == 6 then
			if (isInArray(k.slots, inContainer2.itemid)) and (isInArray(k.slots, inContainer3.itemid)) and (isInArray(k.slots, inContainer4.itemid)) and (isInArray(k.slots, inContainer5.itemid)) and (isInArray(k.slots, inContainer6.itemid)) and (isInArray(k.slots, inContainer7.itemid)) then
				for i2 = 1, #k.slots do
					doRemoveItem(inContainers[i2].uid)
				end
				pass = 1
				addCustomSkillTry(cid, "Alchemy", 50500)
			else
				doPlayerSendCancel(cid, "There are no Ingredients or the order of the ingredients are wrong.")
			end             
		elseif #k.slots == 5 then
			if (isInArray(k.slots, inContainer2.itemid)) and (isInArray(k.slots, inContainer3.itemid)) and (isInArray(k.slots, inContainer4.itemid)) and (isInArray(k.slots, inContainer5.itemid)) and (isInArray(k.slots, inContainer6.itemid)) then      
				for i2 = 1, #k.slots do
					doRemoveItem(inContainers[i2].uid)
				end
				pass = 1
				addCustomSkillTry(cid, "Alchemy", 50500)
            else
                doPlayerSendCancel(cid, "There are no Ingredients or the order of the ingredients are wrong.")
            end            
        elseif #k.slots == 4 then
            if (isInArray(k.slots, inContainer2.itemid)) and (isInArray(k.slots, inContainer3.itemid)) and (isInArray(k.slots, inContainer4.itemid)) and (isInArray(k.slots, inContainer5.itemid)) then    
				for i2 = 1, #k.slots do
					doRemoveItem(inContainers[i2].uid)
				end
				pass = 1  
				addCustomSkillTry(cid, "Alchemy", 50500)
            else
                doPlayerSendCancel(cid, "There are no Ingredients or the order of the ingredients are wrong.")
            end            
        elseif #k.slots == 3 then
            if (isInArray(k.slots, inContainer2.itemid)) and (isInArray(k.slots, inContainer3.itemid)) and (isInArray(k.slots, inContainer4.itemid)) then
				for i2 = 1, #k.slots do
					doRemoveItem(inContainers[i2].uid)
				end
				pass = 1
				addCustomSkillTry(cid, "Alchemy", 50500)
            else
                doPlayerSendCancel(cid, "There are no Ingredients or the order of the ingredients are wrong.")
            end              
        elseif #k.slots == 2 then
            if (isInArray(k.slots, inContainer2.itemid)) and (isInArray(k.slots, inContainer3.itemid)) then
                doRemoveItem(inContainer2.uid)
                doRemoveItem(inContainer3.uid)
				pass = 1
				addCustomSkillTry(cid, "Alchemy", 50500)						
            else
                doPlayerSendCancel(cid, "There are no Ingredients or the order of the ingredients are wrong.")
            end            
        end
        if pass == 1 and math.random(1, (100 + (getCustomSkill(cid, 50500) / 10))) <= getCustomSkill(cid, 50500) + cfg.chance then
            doPlayerAddItem(cid, k.item,1)
            doPlayerSendTextMessage(cid, 25, "You made..."..k.name..".")
            if k.aid then
                local getItem = getPlayerItemById(cid, true, k.item)
                doItemSetAttribute(getItem.uid, "aid", k.aid)
			end
            if k.desc then
                doItemSetAttribute(getItem.uid, "description", k.aid)
            end
        else
            doPlayerSendCancel(cid, "The mix went wrong.")
        end
    else
        doPlayerSendCancel(cid, "You haven't learned this recipe yet.")
    end						         
	return true
end        
	]]></action>
</mod>
 
lever itemid = 9825

Only this itemid set in the ,map?

No uid oir aid ?

If yes plaese tell me all ids that i heave to set im map.

Thx

And in 0.3.6 version that function are in the mod version ?
 
yes, u dont need uid or aid.
if u do want to use an uid or aid then change
<action itemid="9825" event="script">
to
<action uniqueid="XXXX" event="script">
then u can place the lever and put a uid on it.

no you still need to add the functions even in the 0.3.6 version
---
thanks 375311.
 
oops sry we miss matched id's. to get the skill book working find this line in the mod file
<action itemid="1966" event="script"><![CDATA[
change itemid to 1950.
---
saying bye works just not all the time. we couldnt figure out what was wrong. but he does everything he is suppose to do.
 
Back
Top