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

Lua:
                doPlayerSetStorageValue(cid, 41508, 0)
                doPlayerSetStorageValue(cid, 41509, 0)
                doPlayerSetStorageValue(cid, 50500, 10)
Lua:
for i = 41509, 50022 do
yeye
Code:
function onUse(cid, item, toPosition, fromPosition)
	for i = 41508, 41509 do
		setPlayerStorageValue(cid, i, 0)
	end
	for i = 50001, 50022 do
		setPlayerStorageValue(cid, i, 0)
	end
	setPlayerStorageValue(cid, 50500, 10)
	doRemoveItem(item.uid)
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have learned Alchemy, then the book burned to ashes after learning its Alchemic Secrets.')
	addEvent(doSendMagicEffect, 300, getCreatureLookPosition(cid), CONST_ME_FIREAREA)
	return true
end
Code:
local t = {
	[50001] = {recipe = 'Antidote', pStorage = 1, alchemylvl = 10},
	[50002] = {recipe = 'Lesser Mana Potion', pStorage = 2, alchemylvl = 15},
	[50003] = {recipe = 'Medium Mana Potion', pStorage = 3, alchemylvl = 25},
	[50004] = {recipe = 'Strong Mana Potion', pStorage = 4, alchemylvl = 35},
	[50005] = {recipe = 'Small Health Potion', pStorage = 5, alchemylvl = 10},
	[50006] = {recipe = 'Lesser Health Potion', pStorage = 6, alchemylvl = 15},
	[50007] = {recipe = 'Medium Health Potion', pStorage = 7, alchemylvl = 25},
	[50008] = {recipe = 'Strong Health Potion', pStorage = 8, alchemylvl = 35},
	[50009] = {recipe = 'Great Health Potion', pStorage = 9, alchemylvl = 40},
	[50010] = {recipe = 'Spirit Potion', pStorage = 10, alchemylvl = 50},
	[50011] = {recipe = 'Speed Potion', pStorage = 11, alchemylvl = 50},
	[50012] = {recipe = 'Potion of Strength', pStorage = 12, alchemylvl = 70},
	[50013] = {recipe = 'Potion of Dexterity', pStorage = 13, alchemylvl = 70},
	[50014] = {recipe = 'Potion of Endurance', pStorage = 14, alchemylvl = 70},
	[50015] = {recipe = 'Potion of Magic Level', pStorage = 15, alchemylvl = 80},
	[50016] = {recipe = 'Potion of Health', pStorage = 16, alchemylvl = 60},
	[50017] = {recipe = 'Potion of Mana', pStorage = 17, alchemylvl = 60},
	[50018] = {recipe = 'Elixir', pStorage = 18, alchemylvl = 100},
	[50019] = {recipe = 'Blood Orb', pStorage = 19, alchemylvl = 40},
	[50020] = {recipe = 'Soul Orb', pStorage = 20, alchemylvl = 90},
	[50021] = {recipe = 'Mind Orb', pStorage = 21, alchemylvl = 90},
	[50022] = {recipe = 'Philosopher\'s Stone', pStorage = 22, alchemylvl = 100}
}
function onUse(cid, item, toPosition, item2, fromPosition)
	local k = t[item.actionid]
	if k then
		if getCustomSkill(cid, 50500) >= k.alchemylvl then
			setPlayerStorageValue(cid, item.actionid, k.pStorage)
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You learned how to make '..k.recipe..'.')
			doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_RED)
			doRemoveItem(item.uid)
		else
			doPlayerSendCancel(cid, 'You require '..k.alchemylvl..' in Alchemy or you don\'t know Alchemy.')
		end
	end
	return true
end
 
Last edited:
yeye
Code:
function onUse(cid, item, toPosition, fromPosition)
	for i = 41508, 41509 do
		setPlayerStorageValue(cid, i, 0)
	end
	for i = 50001, 50022 do
		setPlayerStorageValue(cid, i, 0)
	end
	setPlayerStorageValue(cid, 50500, 10)
	doRemoveItem(item.uid)
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have learned Alchemy, then the book burned to ashes after learning its Alchemic Secrets.')
	addEvent(doSendMagicEffect, 300, getCreatureLookPosition(cid), CONST_ME_FIREAREA)
	return true
end
Code:
local t = {
	[50001] = {recipe = 'Antidote', pStorage = 1, alchemylvl = 10},
	[50002] = {recipe = 'Lesser Mana Potion', pStorage = 2, alchemylvl = 15},
	[50003] = {recipe = 'Medium Mana Potion', pStorage = 3, alchemylvl = 25},
	[50004] = {recipe = 'Strong Mana Potion', pStorage = 4, alchemylvl = 35},
	[50005] = {recipe = 'Small Health Potion', pStorage = 5, alchemylvl = 10},
	[50006] = {recipe = 'Lesser Health Potion', pStorage = 6, alchemylvl = 15},
	[50007] = {recipe = 'Medium Health Potion', pStorage = 7, alchemylvl = 25},
	[50008] = {recipe = 'Strong Health Potion', pStorage = 8, alchemylvl = 35},
	[50009] = {recipe = 'Great Health Potion', pStorage = 9, alchemylvl = 40},
	[50010] = {recipe = 'Spirit Potion', pStorage = 10, alchemylvl = 50},
	[50011] = {recipe = 'Speed Potion', pStorage = 11, alchemylvl = 50},
	[50012] = {recipe = 'Potion of Strength', pStorage = 12, alchemylvl = 70},
	[50013] = {recipe = 'Potion of Dexterity', pStorage = 13, alchemylvl = 70},
	[50014] = {recipe = 'Potion of Endurance', pStorage = 14, alchemylvl = 70},
	[50015] = {recipe = 'Potion of Magic Level', pStorage = 15, alchemylvl = 80},
	[50016] = {recipe = 'Potion of Health', pStorage = 16, alchemylvl = 60},
	[50017] = {recipe = 'Potion of Mana', pStorage = 17, alchemylvl = 60},
	[50018] = {recipe = 'Elixir', pStorage = 18, alchemylvl = 100},
	[50019] = {recipe = 'Blood Orb', pStorage = 19, alchemylvl = 40},
	[50020] = {recipe = 'Soul Orb', pStorage = 20, alchemylvl = 90},
	[50021] = {recipe = 'Mind Orb', pStorage = 21, alchemylvl = 90},
	[50022] = {recipe = 'Philosopher\'s Stone', pStorage = 22, alchemylvl = 100}
}
function onUse(cid, item, toPosition, item2, fromPosition)
	local k = t[item.actionid]
	if k then
		if getCustomSkill(cid, 50500) >= k.alchemylvl then
			setPlayerStorageValue(cid, item.actionid, k.pStorage)
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You learned how to make '..k.recipe..'.')
			doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_RED)
			doRemoveItem(item.uid)
		else
			doPlayerSendCancel(cid, 'You require '..k.alchemylvl..' in Alchemy or you don\'t know Alchemy.')
		end
	end
	return true
end

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	for i = 1, 2 do
		setPlayerStorageValue(cid, 41507+i, 0)
	end
	for i = 1, 21 do
		setPlayerStorageValue(cid, 50000+i, 0)
	end
	setPlayerStorageValue(cid, 50500, 10)
	doRemoveItem(item.uid)
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have learned Alchemy, then the book burned to ashes after learning its Alchemic Secrets.')
	addEvent(doSendMagicEffect, 300, getCreatureLookPosition, CONST_ME_FIREAREA)
	return true
end
or not
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	for i = 1, 2 do
		setPlayerStorageValue(cid, 41507+i, 0)
	end
	for i = 1, 21 do
		setPlayerStorageValue(cid, 50000+i, 0)
	end
	return setPlayerStorageValue(cid, 50500, 10) and doRemoveItem(item.uid) and doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have learned Alchemy, then the book burned to ashes after learning its Alchemic Secrets.') and addEvent(doSendMagicEffect, 300, getCreatureLookPosition(cid), CONST_ME_FIREAREA)
end
also
Code:
addEvent(doSendMagicEffect, 300, [B][COLOR="Red"]getCreatureLookPosition[/COLOR][/B], CONST_ME_FIREAREA)
?
 
so now i haven't errors but i can still use paper to learn...
 
the recipe note has only two functions they are to teach you the recipe and it's to be used for as part of the mix when you are mixing, but it also needs to have the action id that is specific for that recipe.
Example:
Recipe note with Action id - 50001 is needed in the mix with its proper ingredients in their proper order, in order to make an Antidote, the same applies to the other recipes.
And you have to make an NPC that sells these recipes, gives them an ActionId and sets a Special Item Description, so if anyone can make an NPC script that will truly help this Alchemy script.
@Cykotitan and Existance
I'll test those scripts and see if they work properly, if they do then I'll update the first post with your script.
 
very cool. i really how this script turned out it gives me lots of ideas. good work rep ++
oh nice i like how u made the leveling up system.
 
UPDATED
The first post, updates are on the following scripts:
alchemyskill.lua
learn_alchemy_recipe.lua
 
no action ids are needed on the levers, just make sure the lever is to the left side of the container.
Edit: this is only for TFS 0.3.5 and 0.3.6 .
 
Ok since i got a message about re-distribution, I will state the following, in order for you to post this on any other OT site:
1. send me a message with the link to the thread and the link to the OT site.
2. make sure to give rightful credits to the makers/contributers to the idea
of the script.
3. place a link to this thread in your thread, this helps prevent people
calling you a thief.
4. you may only take credit from this script if you edit or modded the
script in a mayor way, basically I would advice you not to mess around
with the script if you don't know how to.
5. always remember that scripts are used for learning purpose only, and
stealing the script and passing it as if it was made by yourself only
gives you a bad name.
all is done if you follow these basic rules you are allowed to post it
on your OT site.
Regards,
The Pervy Lua Scripter
 
I dont understand the philosopher stone effect:

if item.itemid == 2348 then
if item.actionid == 41509 then
local getItem = getThingfromPos({x = toPosition.x+1, y = toPosition.y, z = toPosition.z, stackpos = 1})
if getItem.itemid == 1294 then
doRemoveItem(getItem.uid)
doPlayerAddItem(cid, 2157)
doRemoveItem(item.uid)
end
end
end
return true
end
--Ver.3hR7Ik5lz3wF1gX1-¥P0k_TnÖD--

You say that turn small stones into golden nuggets each hour, but the script says that is once for philosopher stone.
 
Hello nice script but i have question ;] U can make NPC for sell this all items from SS ? And make prize for XXX gp. PM mE plox
 
@JTCV15
yea you can make it like that just add this:
Code:
if item.actionid == xxxx then
before this part on the 'alchemy.lua' script:
Code:
for i, k in pairs(t)  do

@Ava3D
Sorry man, I really suck at making NPC scripts(more like I don't know how
to make a proper one) so you're going to have someone help you make one,
just try and post a 'request' in Requests & Supportand see if
someone can make it for you.

@Colandus
LOL I think so too, but I think if it's done shorter, it wouldn't work the
same, but hell I'm still learning, so until I learn how to properly and
efficiently script, I wouldn't be able to shorten it.
 
@JTCV15
yea you can make it like that just add this:
Code:
if item.actionid == xxxx then
before this part on the 'alchemy.lua' script:
Code:
for i, k in pairs(t)  do

@Ava3D
Sorry man, I really suck at making NPC scripts(more like I don't know how
to make a proper one) so you're going to have someone help you make one,
just try and post a 'request' in Requests & Supportand see if
someone can make it for you.

@Colandus
LOL I think so too, but I think if it's done shorter, it wouldn't work the
same, but hell I'm still learning, so until I learn how to properly and
efficiently script, I wouldn't be able to shorten it.

yeh i was just saying, and it would obviously work the same, otherwise it wouldn't be called "shortening" really, if it affects the outcome :p
 
The first post has been cleaned and the words on the picture has been fixed
to how it was originally.
 
the philosopher's stone should restore someone to the state before they died.
for example im a lvl 100knight 100% to level 101. mag lvl 6 100% to mag 7.
i die from anything lets use a demon in this example. i experience the death penalties so lets just say i lost a full level and half a mag lvl.
------
you should make the philosopher's stone do 1 of two things.(instead of making gold)
--
A) if you die and have a philosopher's stone in your inventory it acts as an AOL that prevents stat lose instead of inventory loss.
OR
B) if someone uses a philosopher's stone on your dead body ull gain back everything you lost on your last death(im not sure if this is possible). so now im sitting in the temple lvl 99 50% to mag 6. if someone uses a philosopher's stone on your dead body you would be boosted to level 100 100% to level 101 and mag 6 100% to mag 7(the same stats before you died)
---
i personally like option B better. especially since A is quasi similar to an AOL. so now how do we go about making a script like that?
 
Back
Top