Ir para conteúdo

Featured Replies

Postado
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 shopWindow = {}

local spells = {

{id=1950, buy = 150, name = "Exana Pox", spell_name = "Andidote", vocations = {1,2,3,4,5,6,7,8}, level = 10},

{id=1950, buy = 2500, name = "Exori", spell_name = "Berserk", vocations = {4,8}, level = 35},

{id=1950, buy = 80, name = "Exiva", spell_name = "Find Person", vocations = {1,2,3,4,5,6,7,8}, level = 8},

{id=2182, buy = 5000, name = "Exori Flam", spell_name = "Flame Strike", vocations = {1,2,5,6}, level = 12},

{id=1950, buy = 8000, name = "Utito Tempo", spell_name = "Blood Rage", vocations = {4,8}, level = 60},

{id=1950, buy = 2000, name = "Exeta Res", spell_name = "Challenge", vocations = {8}, level = 20},

{id=1950, buy = 5000, name = "Exori Gran", spell_name = "Fierce Berserk", vocations = {4,8}, level = 70},

{id=1950, buy = 500, name = "Utevo Gran Lux", spell_name = "Great Light", vocations = {1,2,3,4,5,6,7,8}, level = 13},

{id=1950, buy = 1500, name = "Exori Mas", spell_name = "Groundshaker", vocations = {4,8}, level = 33},

{id=1950, buy = 1500, name = "Exana Mort", spell_name = "Wound Cleansing", vocations = {4,8}, level = 30}

}

local onBuy = function(cid, item, subType, amount, ignoreCap, inBackpacks)

if not getPlayerLearnedInstantSpell(cid, shopWindow[item].Words) then

if getPlayerLevel(cid) >= shopWindow[item].Level then

if isInArray(shopWindow[item].Vocs, getPlayerVocation(cid)) then

doPlayerRemoveMoney(cid, shopWindow[item].Price)

doPlayerLearnInstantSpell(cid, shopWindow[item].Words)

npcHandler:say("você aprendeu uma nova magia chamada "..shopWindow[item].Words, cid)

else

npcHandler:say("você não tem a vocação para comprar está spell.", cid)

end

else

npcHandler:say("você precisa ter level "..shopWindow[item].Level.." ou mais para comprar essa magia.", cid)

end

else

npcHandler:say("você já aprendeu essa magia.", cid)

end

return true

end

if msgcontains(msg, 'trade') or msgcontains(msg, 'spell') then

for var, item in pairs(spells) do

shopWindow[item.id] = {Level = item.level, Vocs = item.vocations, item_id = item.id, Price = item.buy, subType = 0, Words = item.spell_name, SpellName = item.name}

end

openShopWindow(cid, spells, onBuy, onSell)

end

return true

end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)

npcHandler:addModule(FocusModule:new())

Editado por Vodkart (veja o histórico de edições)

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

  • Respostas 8
  • Visualizações 2k
  • Created
  • Última resposta

Top Posters In This Topic

Postado
  • Autor

Isso aew E Bom Pra Queles Ots Que e 999 kk Mas Parabéns Bom Script @

Nada a ver.

é um npc normal que vende spell, só que ao invés de falar "find person" é só clicar e pronto

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

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.7k

Informação Importante

Confirmação de Termo