Ir para conteúdo
  • 0

npc que recusa o promotion se o player for...


valakas

Pergunta

entao gente é assim se o jogador estiver com a vocação 9,10,11 e 12 o npc recuse a dar o promotion

 

 

segue abaixo a script do meu npc

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)


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

local node1 = keywordHandler:addKeyword({'promot'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can promote you for 20000 gold coins. Do you want me to promote you?'})
	node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 0,level = 1, promotion = 1, text = 'Congratulations! You are now promoted.'})
	node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then, come back when you are ready.', reset = true})



npcHandler:addModule(FocusModule:new())

Link para o comentário
Compartilhar em outros sites

3 respostass a esta questão

Posts Recomendados

  • 0
Troque:

node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 0, level = 1, promotion = 1, text = 'Congratulations! You are now promoted.'})

por:

node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, recuse = {9, 10, 11, 12}, cost = 0, level = 1, promotion = 1, text = 'Congratulations! You are now promoted.'})


Depois, em data/npc/lib/npcsystem/modules.lua, no código da função

function StdModule.promotePlayer(cid, message, keywords, parameters, node)

Abaixo de:


elseif(not doPlayerRemoveMoney(cid, parameters.cost)) then
npcHandler:say('You do not have enough money!', cid)

coloque:


elseif parameters.recuse and isInArray(parameters.recuse, getPlayerVocation(cid)) then
npcHandler:say("You can't change your vocation at the moment!", cid)

Link para o comentário
Compartilhar em outros sites

  • 0

 

Troque:
node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 0, level = 1, promotion = 1, text = 'Congratulations! You are now promoted.'})
por:
node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, recuse = {9, 10, 11, 12}, cost = 0, level = 1, promotion = 1, text = 'Congratulations! You are now promoted.'})
Depois, em data/npc/lib/npcsystem/modules.lua, no código da função
function StdModule.promotePlayer(cid, message, keywords, parameters, node)
Abaixo de:
elseif(not doPlayerRemoveMoney(cid, parameters.cost)) then
    npcHandler:say('You do not have enough money!', cid)
coloque:
elseif parameters.recuse and isInArray(parameters.recuse, getPlayerVocation(cid)) then
    npcHandler:say("You can't change your vocation at the moment!", cid)

 

zipter é o cara nunca descensona nas script vao tudo 100% funcional, até o momento, a proposito voce poderia me conseguir uma script de n se atacarem em party? grato, http://www.xtibia.com/forum/topic/238459-sem-danos-na-mesma-party/

Editado por valakas
Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...