Ir para conteúdo
  • 0

God Bounty Hunter


Adriez

Pergunta

fala galera boa tarde, é o seguinte está dando pra adcionar o god na lista de procurados do bounty hunter system teria como bloquear ??

 

Spoiler

--[[
            SISTEMA DE CAÇADOR DE RECOMPENSAS FEITO POR LEORIC [OMEGA]
]]--
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 playerReward = getPlayerStorageValue(cid, bountyReward)
    local points = getPlayerStorageValue(cid, bountyPoints) > 0 and getPlayerStorageValue(cid, bountyPoints) or 0
    
    if msgcontains(msg,'mafia assassina') then
        selfSay('Sim, eu sou o lider da Guild dos Assassinos. Voce quer dar {hunted} em alguem, ver os players {mais procurados} ou quer {informacoes} sobre o sistema?',cid)
        talkState[talkUser] = 1
    elseif talkState[talkUser] == 1 then
        if msgcontains(msg,'hunted') then
            selfSay('Muito bem... Me diga o {nome} do jogador que voce quer dar hunted.',cid)
            talkState[talkUser] = 2
        elseif msgcontains(msg,'informacoes') then
            selfSay('Muito simples: voce me diz o nome e me de o dinheiro que eu coloco um premio pela cabeca desse jogador e quem matar ele recebe o dinheiro. Voce pode conferir nestes quadros ao meu lado quem sao os cacadores de recompensa ativos e quais jogadores estao hunted.',cid)
        elseif msgcontains(msg, 'points') then
            if bountyConfig.points == false and bountyConfig.omegaPointSystem == false then
                selfSay('Point system is currently disabled.',cid)
            else
                selfSay('You have '..points..' bounty points.',cid)
            end
        elseif msgcontains(msg,'recompensa') then
            if playerReward > 0 then
                doPlayerAddMoney(cid, playerReward)
                selfSay('Here you go, my bounty hunter friend, '..playerReward..' gps.', cid)
                setPlayerStorageValue(cid, bountyReward, 0)
                talkState[talkUser] = 1
            else
                selfSay('Nope, you have no reward to collect.',cid)
                talkState[talkUser] = 1
            end
        elseif msgcontains(msg, 'mais procurados') then
            local players = getTopBounties(10)
            local names = {}
            local str = ''
            if not players then
                selfSay('There are no active bounties at this moment.',cid)
                return true
            end
            for index, pid in ipairs(players) do
                table.insert(names,'{'..index..'} '..getPlayerNameByGUID(pid)..' ['..getPlayerBounty(getPlayerNameByGUID(pid))..']\n')
            end
            str = table.concat(names)
            doPlayerPopupFYI(cid, str)
        end            
    elseif talkState[talkUser] == 2 then
        if not playerExist(msg) then
            selfSay('Este jogador nao existe! Me diga um {nome} certo!',cid)
        elseif string.lower(msg) == string.lower(getCreatureName(cid)) then
            selfSay('You can\'t post a bounty on yourself, stupid!', cid)
        else
            playername = {}
            playername[cid] = msg
            selfSay('Muito bem, o valor minimo para um hunted e de '..bountyConfig.min..' e eu cobro uma taxa de '..bountyConfig.fee..'% pelo servico. Quanto de dinheiro voce quer oferecer pela cabeca deste jogador??',cid)
            talkState[talkUser] = 3
        end
    elseif talkState[talkUser] == 3 then
        if tonumber(msg) ~= nil and tonumber(msg) and tonumber(msg) >= bountyConfig.min then
            bounty = tonumber(msg)
            if doPlayerRemoveMoney(cid, bounty) then
                doPlayerAddBounty(playername[cid], math.ceil(((1-(bountyConfig.fee/100))*bounty)))
                setGlobalStorageValue(getPlayerGUIDByName(playername[cid])+20000, getPlayerGUIDByName(getCreatureName(cid)))
                selfSay('You have sssuccessfully posted a bounty for '..playername[cid]..'.',cid)
                selfSay('Voce gostaria de mais alguma coisa? Talvez {hunted} uma recompensa por alguem, verifique o {mais procurados} ou Receber sua {recompensa}? Ou talvez algum {informacao} informacoes sobre o nosso sistema de recompensas?',cid)
                playername[cid] = nil
                talkState[talkUser] = 1
            else
                selfSay('You can\'t fool me, you basssstard! You don\'t pay, I add no bounty!',cid)
                talkState[talkUser] = 1
            end
        else
            selfSay('Voce precisa me dar um valor de verdade meu amigo... E precisa ser maior que '..bountyConfig.min..'.',cid)
        end
    end            
    return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

 

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