Ir para conteúdo

Featured Replies

Postado
  • Autor
53 minutos atrás, .Smile disse:

Corrigido, lembre-se de editar o valor minimo e o fee na lib e veja se tem os requisitos.

npc


--[[
            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 moneyId = 11192 -- ID da moeda
	local playerReward = getPlayerStorageValue(cid, bountyReward)
	local points = getPlayerStorageValue(cid, bountyPoints) > 0 and getPlayerStorageValue(cid, bountyPoints) or 0
	
	if msgcontains(msg,'assassin guild') then
		selfSay('Yess, I am the masster of the assasssinsss. What do you want with the guild? {Post} a bounty on someone? Get your {reward}, check the {most wanted} or your {points}? Or maybe some {information} about our bounty system?',cid)
		talkState[talkUser] = 1
	elseif talkState[talkUser] == 1 then
		if msgcontains(msg,'post') then
			selfSay('Yesss, a bounty?! Good for businessss. The death of whom do you wish? Give me a {name}.',cid)
			talkState[talkUser] = 2
		elseif msgcontains(msg,'information') then
			selfSay('It isss very sssimple. You give me a name and money and I\'ll put it at the bounty board. You can check who hasss an active bounty there too. Who kills that person, gets the money. Ssssimple. And, of course, you don\'t get paid to kill a person whose bounty you posted.',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,'reward') then
			if playerReward > 0 then
				doPlayerAddItem(cid, moneyId, 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, 'most wanted') 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('No, no, no. That is not a valid target. Give me a {name}!',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('Very well. The service has a minimum cost of '..bountyConfig.min..' and we take a '..bountyConfig.fee..'% fee of your bounty. How much do you want to deposit on your bounty?',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 doPlayerRemoveItem(cid, moneyId, 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('Would you like anything else? Maybe {post} a bounty on someone, check the {most wand} or your {points}? Get your {reward}? Or maybe some {information} about our bounty system?',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('I\'m still expecting a real bounty, my friend... it has to be bigger than '..bountyConfig.min..'.',cid)
		end
	end			
	return true
end

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

 

 

ele desconta os vip coins normal 

mas quando matamos o player que esta em hunt nao da os vip coins

6:22 You have killed a hunted target and won 45gps and 1 bounty points. Talk to the Assassin leader to withdraw your money.

opaa

deu certo sim

era erro meu

eu nao falei com o npc pra pegar o premium

obrigado

 

  • Respostas 5
  • Visualizações 456
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Corrigido, lembre-se de editar o valor minimo e o fee na lib e veja se tem os requisitos. npc --[[ SISTEMA DE CAÇADOR DE RECOMPENSAS FEITO POR LEORIC [OMEGA] ]]-- local keywordHan

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

Informação Importante

Confirmação de Termo