Ir para conteúdo
  • 0

Npc não vende promotion nem pra premium


Chupacabradoesgoto

Pergunta

NPC não reconhece premium, memso com premium ele fala que o jogador precisa de premium para comprar promotion, e nem até os npcs do barco mandam todos os players pra qualquer cidade, ate os free.
é TFS 0.3.0 do tibia 7.6
Config.lua:
    -- Premium account
    freePremium = false
    premiumForPromotion = true
    removePremiumOnInit = true
NPC/Scripts/Promotion.lua:
-- This is an example NPC script that can be used on Jiddo's NPC system
 
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
 
-- OTServ event handling functions start
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
-- OTServ event handling functions end
 
local node1 = keywordHandler:addKeyword({'promotion'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to be promoted in your vocation for 20000 gold?'})
    node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, promotion = 1, cost = 20000,  premium = false, level = 20, text = 'Congratulations! You are now promoted.'})
    node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Allright then. Come back when you are ready.', reset = true})
 
npcHandler:addModule(FocusModule:new())
Modules.lua:
    --Usage:
        -- local node1 = keywordHandler:addKeyword({'promot'}, StdModule.say, {npcHandler = npcHandler, text = 'I can promote you for 20000 gold coins. Do you want me to promote you?'})
        --         node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 20000, level = 20}, text = 'Congratulations! You are now promoted.')
        --         node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, text = 'Allright then. Come back when you are ready.'}, reset = true)
    function StdModule.promotePlayer(cid, message, keywords, parameters, node)
        local npcHandler = parameters.npcHandler
        if(npcHandler == nil) then
            error('StdModule.promotePlayer called without any npcHandler instance.')
        end
        if(cid ~= npcHandler.focus) then
            return false
        end
 
        if(isPremium(cid) or isPlayerPremiumCallback == nil or isPlayerPremiumCallback(cid) == true or parameters.premium == false) then
            local oldVoc = getPlayerVocation(cid)
            if(parameters.promotions[oldVoc] == oldVoc or parameters.promotions[oldVoc] == nil) then
                npcHandler:say('You are already promoted!')
            elseif(getPlayerLevel(cid) < parameters.level) then
                npcHandler:say('I am sorry, but I can only promote you once you have reached level ' .. parameters.level .. '.')
            elseif(doPlayerRemoveMoney(cid, parameters.cost) ~= TRUE) then
                npcHandler:say('You do not have enough money!')
            else
                doPlayerSetVocation(cid, parameters.promotions[oldVoc])
                npcHandler:say(parameters.text)
            end
        else
            npcHandler:say('Sorry, only premium characters are allowed to be promoted.')
        end
      
        npcHandler:resetNpc()
        return true
      
    end

 


ninguem? =(

Link para o comentário
Compartilhar em outros sites

0 respostass a esta questão

Posts Recomendados

Até agora não há respostas para essa pergunta

×
×
  • Criar Novo...