Ir para conteúdo

Featured Replies

Postado

Tenta esse ae.

 

Mostrar conteúdo oculto
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid
local t = {
["light healing"] = {price = 15,vocations = {1,5},level = 1},
["find person"] = {price = 25,vocations = {1,5},level = 1},
["light magic missile"] = {price =30,vocations = {1,5},level = 1},
["energy strike"] = {price =20,vocations = {1,5},level = 1},
["flame strike"] = {price =100,vocations = {1,5},level = 1}
}
if (msgcontains(msg, 'SPELLS') or msgcontains(msg, 'spells'))then
local str = ""
str = str .. "Eu vendo estas Magias: "
for name, pos in pairs(t) do
if isInArray(pos.vocations, getPlayerVocation(cid)) then
str = str.." {"..name.."} = "..pos.price.." gold coins /"
end
end
if str == "" then
str = "Eu não tenho nenhuma magia para vender a você."
end
str = str .. "."
npcHandler:say(str, cid)
elseif t[msg] then
if not getPlayerLearnedInstantSpell(cid, msg) then
if getPlayerLevel(cid) >= t[msg].level then
if isInArray(t[msg].vocations, getPlayerVocation(cid)) then
if doPlayerRemoveMoney(cid, t[msg].price) then
doPlayerLearnInstantSpell(cid, msg)
npcHandler:say("Você aprendeu uma nova magia chamada ".. msg .."!", cid)
else
npcHandler:say("você não tem "..t[msg].price.." gold coins.", cid)
end
else
npcHandler:say("você não tem a vocação para comprar está spell.", cid)
end
else
npcHandler:say("você precisa ter level "..t[msg].level.." ou mais para comprar essa magia.", cid)
end
else
npcHandler:say("você já aprendeu essa magia.", cid)
end
end
return TRUE
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

Tony Araújo  ;D 

 

  • Respostas 5
  • Visualizações 480
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Substitua por isto: local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear

  • eu nao manjo muito, mas acho que é só você trocar aqui: local moeda = 2157   por : local moeda = 2160   *2160 é o ID da crystal coin!

  • Passei o sistema para a gold coins.   Para editar o script basta: ["light healing"] = {price = 15,vocations = {1,5},level = 1}, Price: 15 = 15 Gold Coins (1000 = 1k, 10000 = 10k) e assim sucessi

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo