Ir para conteúdo
  • Cadastre-se

NPC terceira vocação - Ajuda


Posts Recomendados

Boa noite galera!

 

 Aguém poderia me ajudar com relação ao NPC abaixo ? Uso o TheForgottenServer 4.4.0

 

 Aparentemente ele não entende o código: "msgcontains(msg, 'high saintess')"

 

 

local sorcId = 9 -- id da vocation sorc vip

local druidId = 10 -- id da vocation druid vip
local pallyId = 11 -- id da vocation pally vip
local kinaId = 12 -- id da vocation kina vip
local cost = 100000 -- 1 kk
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
---------------------------------------Epic Elder Druid------------------------------
if msgcontains(msg, 'high saintess') then
selfSay("Do you kill Malekith?! Alright, I can promote you by "..cost.." golds. Ok?", cid)
talkState[cid] = 1
end
if talkState[cid] == 1
if msgcontains(msg, 'yes') then
if getPlayerMoney(cid) >= cost
doPlayerRemoveMoney(cid,cost)
doPlayerSetVocation(cid, druidId)
selfSay("Ok, as your wish. Congratulations, now you are a High Saintess, the most powerful of druids.", cid)
talkState[cid] = 0
else
selfSay("Sorry, you don´t have enough gold.", cid)
talkState[cid] = 0
end
end
end
-----------------------------------------Epic Master Sorcerer------------------------------
if msgcontains(msg, 'hell wizard') then
selfSay("Do you kill Malekith?! Alright, I can promote you by "..cost.." golds. Ok?", cid)
talkState[cid] = 2
end
if talkState[cid] == 2
if msgcontains(msg, 'yes') then
if getPlayerMoney(cid) >= cost
doPlayerRemoveMoney(cid,cost)
doPlayerSetVocation(cid, sorcId)
selfSay("Ok, as your wish. Congratulations, now you are a Hell Wizard, the most powerful of sorcerers.", cid)
talkState[cid] = 0
else
selfSay("Sorry, you don´t have enough gold.", cid)
talkState[cid] = 0
end
end
end
---------------------------------------Epic Royal Paladin------------------------------
if msgcontains(msg, 'force archer') then
selfSay("Do you kill Malekith?! Alright, I can promote you by "..cost.." golds. Ok?", cid)
talkState[cid] = 3
end
if talkState[cid] == 3
if msgcontains(msg, 'yes') then
if getPlayerMoney(cid) >= cost
doPlayerRemoveMoney(cid,cost)
doPlayerSetVocation(cid, pallyId)
selfSay("Ok, as your wish. Congratulations, now you are a Force Archer, the most powerful of paladins.", cid)
talkState[cid] = 0
else
selfSay("Sorry, you don´t have enough gold.", cid)
talkState[cid] = 0
end
end
end
---------------------------------------Epic Elite Knight------------------------------
if msgcontains(msg, 'titan blader') then
selfSay("Do you kill Malekith?! Alright, I can promote you by "..cost.." golds. Ok?", cid)
talkState[cid] = 4
end
if talkState[cid] == 4
if msgcontains(msg, 'yes') then
if getPlayerMoney(cid) >= cost
doPlayerRemoveMoney(cid,cost)
doPlayerSetVocation(cid, kinaId)
selfSay("Ok, as your wish. Congratulations, now you are a Titan Blader, the most powerful of paladins.", cid)
talkState[cid] = 0
else
selfSay("Sorry, you don´t have enough gold.", cid)
talkState[cid] = 0
end
end
end
return TRUE
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

 

O mesmo quando abro o OT, causa o erro abaixo na distro:

 

 

[29/07/2014 18:20:03] [Error - LuaScriptInterface::loadFile] data/npc/scripts/divine_promotion.lua:24: 'then' expected near 'if'

[29/07/2014 18:20:03] [Warning - NpcScript::NpcScript] Cannot load script: data/npc/scripts/divine_promotion.lua
[29/07/2014 18:20:03] data/npc/scripts/divine_promotion.lua:24: 'then' expected near 'if'

 

 


Bump!

Link para o post
Compartilhar em outros sites

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

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo