edita isso: é só vc modificar as msgs e as action ids e a id da ball =d
xml:
<?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>
script:
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", and "alchemic kits" , for sale which do you want to know more about?')
talk_state = 1
elseif talk_state == 1 then
if msgcontains(msg, 'recipe book') then
price = 1000
selfSay('I have this recipe book that you can use to see the recipes you have learned, do you want to buy it for '.. price ..' gold?')
talk_state = 4
item = 1965
rtrn = 1
elseif msgcontains(msg, 'recipes') then
if getPlayerStorageValue(cid, 50500) == -1 then
selfSay('You don\'t seem to know much about alchemy go study first.')
talk_state = 1
else
selfSay('Yes, I have a list of recipes for "beginner" and "advanced" Alchemists, which would you like to see?.')
talk_state = 2
end
elseif msgcontains(msg, 'alchemic kit') then
price = 10000
selfSay('This is a special kit used just for alchemy, would you like to buy it for '.. price ..' gold?.')
talk_state = 4
item = 6104
rtrn = 1
elseif msgcontains(msg, 'bye') then
selfSay('Good bye, ' .. getCreatureName(cid) .. '!')
focus = 0
talk_start = 0
end
elseif talk_state == 2 then
if msgcontains(msg, 'beginner') then
selfSay('At the beginner level I sell recipes for: "antidote", "platinum coin", "mind stone", "soul orb", "blood orb", "love potion", "ectoplasm", "weak mana rune", "crystal coin", "sparkling mummy doll". which one do you want?')
talk_state = 3
elseif msgcontains(msg, 'advanced') then
selfSay('At the Advanced level I sell recipes for: "berserk potion", "mastermind potion", "bullseye potion", "mead horn", "gold bar", "mana rune", "clover amulet", "sword", "magic", "arrow". which one do you want?')
talk_state = 3
else
selfSay('That\'s too bad, maybe next time.')
talk_state = 1
end
elseif talk_state == 3 then
item = 1954
rtrn = 2
if msgcontains(msg, 'antidote') then
price = 1000
selfSay('Do you want to buy an Antidote recipe for ' ..price.. ' gold?')
action = 50001
desc = 'This contains the recipe to make an Antidote.'
talk_state = 4
elseif msgcontains(msg, 'platinum coin') then
price = 2000
selfSay('For ' .. price ..' gold i can sell you the secert to minting platinum coins?')
action = 50002
desc = 'This contains the formula for minting Platinum Coins.'
talk_state = 4
elseif msgcontains(msg, 'mind stone') then
price = 2000
selfSay('Do you want to buy a Mind Stone recipe for ' ..price.. ' gold?')
action = 50003
desc = 'This contains the recipe to make a Mind Stones.'
talk_state = 4
elseif msgcontains(msg, 'soul orb') then
price = 2000
selfSay('Do you want to buy a Soul Orb recipe for ' ..price.. ' gold?')
action = 50004
desc = 'This contains the recipe to make a Soul Orbs.'
talk_state = 4
elseif msgcontains(msg, 'blood orb') then
price = 5000
selfSay('Do you want to buy a Blood Orb recipe for ' ..price.. ' gold?')
action = 50005
desc = 'This contains the recipe to make a Blood Orbs.'
talk_state = 4
elseif msgcontains(msg, 'love potion') then
price = 30000
selfSay('Do you want to buy a Love Potion recipe for ' ..price.. ' gold?')
action = 50006
desc = 'This contains the recipe to make a Love Potions.'
talk_state = 4
elseif msgcontains(msg, 'ectoplasm') then
price = 20000
selfSay('Do you want to buy a Ectoplasm recipe for ' ..price.. ' gold?')
action = 50007
desc = 'This contains the recipe to make some Ectoplasm.'
talk_state = 4
elseif msgcontains(msg, 'intense mana rune') then
price = 60000
selfSay('Do you want to buy a Intense Mana Rune recipe for ' ..price.. ' gold?')
action = 50008
desc = 'This contains the recipe to make a Intense Mana Runes.'
talk_state = 4
elseif msgcontains(msg, 'crystal coin') then
price = 100000
selfSay('For ' .. price ..' gold i can sell you the secert to minting crystal coins?')
action = 50009
desc = 'This contains the formula for minting Crystal coins.'
talk_state = 4
elseif msgcontains(msg, 'sparkling mummy doll') then
price = 100000
selfSay('Do you want to buy a Sparkling Mummy Doll Recipe for ' ..price.. ' gold?')
action = 50010
desc = 'This contains the recipe to make a Sparkling Mummy Doll.'
talk_state = 4
elseif msgcontains(msg, 'berserk potion') then
price = 100000
selfSay('Do you want to buy a Berserk Potion recipe for ' ..price.. ' gold?')
action = 50018
desc = 'This contains the recipe to make a Beserk Potion.'
talk_state = 4
elseif msgcontains(msg, 'mastermind potion') then
price = 100000
selfSay('Do you want to buy a Mastermind Potion recipe for ' ..price.. ' gold?')
action = 50019
desc = 'This contains the recipe to make a Mastermind Potion.'
talk_state = 4
elseif msgcontains(msg, 'bullseye potion') then
price = 100000
selfSay('Do you want to buy a Bullseye Potion Recipe for ' ..price.. ' gold?')
action = 50020
desc = 'This contains the recipe to make a Bullseye Potion.'
talk_state = 4
elseif msgcontains(msg, 'mead horn') then
price = 200000
selfSay('Do you want to buy a Mead Horn Recipe for ' ..price.. ' gold?')
action = 50021
desc = 'This contains the recipe to make a Mean Horn.'
talk_state = 4
elseif msgcontains(msg, 'gold bar') then
price = 10000000
selfSay('For ' .. price ..' gold i can sell you the secret to minting gold bars?')
action = 50022
desc = 'This contains the formula for minting Gold Bars.'
talk_state = 4
elseif msgcontains(msg, 'ultimate mana rune') then
price = 500000
selfSay('Do you want to buy a Potion of Ultimate Mana Recipe for ' ..price.. ' gold?')
action = 50023
desc = 'This contains the recipe to make a Ultimate Mana rune.'
talk_state = 4
elseif msgcontains(msg, 'clover amulet') then
price = 1000000
selfSay('Do you want to buy a Clover Amulet Recipe for ' ..price.. ' gold?')
action = 50024
desc = 'This contains the recipe to make a Clover Amulet.'
talk_state = 4
elseif msgcontains(msg, 'sword') then
price = 2000000
selfSay('Do you want to buy a sword Recipe for ' ..price.. ' gold?')
action = 50025
desc = 'This contains the recipe to make a sword.'
talk_state = 4
elseif msgcontains(msg, 'magic') then
price = 2000000
selfSay('Do you want to buy magic Recipe for ' ..price.. ' gold?')
action = 50026
desc = 'This contains the recipe to make magic.'
talk_state = 4
elseif msgcontains(msg, 'arrow') then
price = 2000000
selfSay('Do you want to buy an arrow Recipe for ' ..price.. ' gold?')
action = 50027
desc = 'This contains the recipe to make arrow.'
talk_state = 4
elseif msgcontains(msg, 'bye') then
selfSay('Good bye, ' .. getCreatureName(cid) .. '!')
focus = 0
talk_start = 0
end
elseif talk_state == 4 then
if msgcontains(msg, 'yes') then
if getPlayerMoney(cid) >= price then
selfSay('Here you go!')
doPlayerRemoveMoney(cid, price)
doPlayerAddItem(cid, item, 1)
if action then
doItemSetAttribute(getPlayerItemById(cid, true, 1954).uid, "aid", action)
end
if desc then
doItemSetAttribute(getPlayerItemById(cid, true, 1954).uid, "description", desc)
end
if rtrn == 1 then
talk_state = 2
else
talk_state = 3
end
else
selfSay('You don\'t seem to have enough money.')
if rtrn == 1 then
talk_state = 2
else
talk_state = 3
end
end
else
selfSay('That\'s too bad, maybe next time.')
if rtrn == 1 then
talk_state = 2
else
talk_state = 3
end
end
elseif msgcontains(msg, 'bye') then
selfSay('Good bye, ' .. getCreatureName(cid) .. '!')
focus = 0
talk_start = 0
end
elseif msgcontains(msg, 'bye') and focus == cid 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
créditos:
a todos os kra que contribuiram nesse sistema da otland.
http://otland.net/f81/mod-alchemy-system-new-update-85584/
=d





info
Group: Campones
Joined: 11/03/09
Posts: 23
Reputation: +24
Queria um NPC que vendesse pokeball com pokemon e meu sistem usa ACTION ID para cada poke ai keria que o kara vendesse os item com o ACTION ID porfavor ;D
AGRADEÇO DE JA VLW ;D