Cykotitan
Experienced G'
- Joined
- Nov 4, 2008
- Messages
- 16,892
- Solutions
- 5
- Reaction score
- 849
yeyeLua:doPlayerSetStorageValue(cid, 41508, 0) doPlayerSetStorageValue(cid, 41509, 0) doPlayerSetStorageValue(cid, 50500, 10)
Lua:for i = 41509, 50022 do
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: