AR

Npc's Bless

Por Arcavier, 27 de mar. de 2007 em NPCs, monsters e raids

tibia
script
otserv
1.0 (1)
23
12.7k
ArcavierA
27 de março de 2007 às 01:31

Funçao Avançada

 

Necessita NPC Jiddo system

 

NPC's Bless Created 100% By Me:

 

Aqui em casa naum funciono perfeitamente pq eu axo q a funçao getPlayerBlessing esta com problemas.

 

Mas porque esta com problemas?

bom, o comando getPlayerBlessing verifica se o player ja tem uma determinada bless para depois ele vende ou não para o comprador, e no caso quando vc vai compra ele fala direto que vc ja tem sem vc ter comprado alguma vez, mas quando eu mostrei pro xidaozu ele disse que estava ótimo, portando isto talvez deverá algum problema nesta função.

Enfim, peço se este problema acontece com vcs, que retire a função:

if getPlayerBlessing(cid,1) == 0 then do script

 

nos outros npc's para vc n ter duvida a funçoes saum as msm so q elas mudam de acordo com a bless, ali no caso esta (cid,1), pois ele ira verifica se vc tem a bless 1. Mas voltando a parte de retira a funçao, depois q vc retira-la retire tbm:

else

selfSay('Sorry, you already have this blessing.')

end

 

NPC 1

-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
----------------------------------- Npc of Bless ----------------------------------
---------------------------- Credits 100% by Arcavier -----------------------------
-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------

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

function creatureSayCallback(cid, type, msg)
-- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
if(npcHandler.focus ~= cid) then
	return false
end


	if msgcontains(msg, 'bless') then
		selfSay('I sell the \"Spiritual Shielding\" Blessing.')
------------------------------------------------ bless ------------------------------------------------
	elseif msgcontains(msg, 'Spiritual Shielding') or msgcontains(msg, 'spiritual shielding') then
		if isPremium(cid) then
			selfSay('Do you want to buy the Spiritual Shielding Blessing for 20k?')
			talk_state = 1
		else
			selfSay('Sorry, you need a premium account to get bless.')
			talk_state = 0
		end
------------------------------------------------ confirm yes ------------------------------------------------
	elseif msgcontains(msg, 'yes') and talk_state == 1 then
		talk_state = 0

					if getPlayerBlessing(cid,1) == 0 then
					if doPlayerRemoveMoney(cid,20000) == 1 then
					selfSay('Now the gods blessed you.') 
						doPlayerAddBlessing(cid,1)
			else
			selfSay('Sorry, you dont have enough money.')
			end
			else
		selfSay('Sorry, you already have this blessing.')
			end
------------------------------------------------ confirm no ------------------------------------------------
	elseif msgcontains(msg, 'no') and (talk_state >= 1 and talk_state <= 2) then
		selfSay('Ok then.')
		talk_state = 0
	end
-- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
return true
end

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

 

NPC 2

-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
----------------------------------- Npc of Bless ----------------------------------
---------------------------- Credits 100% by Arcavier -----------------------------
-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------

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

function creatureSayCallback(cid, type, msg)
-- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
if(npcHandler.focus ~= cid) then
	return false
end


	if msgcontains(msg, 'bless') then
		selfSay('I sell the \"Spark of the Phoenix\" blessing.')
------------------------------------------------ bless ------------------------------------------------
	elseif msgcontains(msg, 'Spark of the Phoenix') or msgcontains(msg, 'spark of the phoenix') then
		if isPremium(cid) then
			selfSay('Do you want to buy the Spark of the Phoenix Blessing for 20k?')
			talk_state = 1
		else
			selfSay('Sorry, you need a premium account to get bless.')
			talk_state = 0
		end
------------------------------------------------ confirm yes ------------------------------------------------
	elseif msgcontains(msg, 'yes') and talk_state == 1 then
		talk_state = 0

					if getPlayerBlessing(cid,2) == 0 then
					if doPlayerRemoveMoney(cid,20000) == 1 then
					selfSay('Now the gods blessed you.') 
						doPlayerAddBlessing(cid,2)
			else
			selfSay('Sorry, you dont have enough money.')
			end
			else
		selfSay('Sorry, you already have this blessing.')
			end
------------------------------------------------ confirm no ------------------------------------------------
	elseif msgcontains(msg, 'no') and (talk_state >= 1 and talk_state <= 2) then
		selfSay('Ok then.')
		talk_state = 0
	end
-- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
return true
end

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

 

NPC 3

-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
----------------------------------- Npc of Bless ----------------------------------
---------------------------- Credits 100% by Arcavier -----------------------------
-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------

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

function creatureSayCallback(cid, type, msg)
-- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
if(npcHandler.focus ~= cid) then
	return false
end


	if msgcontains(msg, 'bless') then
		selfSay('I sell the \"Embrace of Tibia\" Blessing.')
------------------------------------------------ bless ------------------------------------------------
	elseif msgcontains(msg, 'Embrace of Tibia') or msgcontains(msg, 'embrace of tibia') then
		if isPremium(cid) then
			selfSay('Do you want to buy the Embrace of Tibia Blessing for 20k?')
			talk_state = 1
		else
			selfSay('Sorry, you need a premium account to get bless.')
			talk_state = 0
		end
------------------------------------------------ confirm yes ------------------------------------------------
	elseif msgcontains(msg, 'yes') and talk_state == 1 then
		talk_state = 0

					if getPlayerBlessing(cid,3) == 0 then
					if doPlayerRemoveMoney(cid,20000) == 1 then
					selfSay('Now the gods blessed you.') 
						doPlayerAddBlessing(cid,3)
			else
			selfSay('Sorry, you dont have enough money.')
			end
			else
		selfSay('Sorry, you already have this blessing.')
			end
------------------------------------------------ confirm no ------------------------------------------------
	elseif msgcontains(msg, 'no') and (talk_state >= 1 and talk_state <= 2) then
		selfSay('Ok then.')
		talk_state = 0
	end
-- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
return true
end

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

 

NPC 4

-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
----------------------------------- Npc of Bless ----------------------------------
---------------------------- Credits 100% by Arcavier -----------------------------
-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------

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

function creatureSayCallback(cid, type, msg)
-- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
if(npcHandler.focus ~= cid) then
	return false
end


	if msgcontains(msg, 'bless') then
		selfSay('I sell the \"Fire of the Suns\" Blessing.')
------------------------------------------------ bless ------------------------------------------------
	elseif msgcontains(msg, 'Fire of the Suns') or msgcontains(msg, 'fire of the suns') then
		if isPremium(cid) then
			selfSay('Do you want to buy the Fire of the Suns Blessing for 20k?')
			talk_state = 1
		else
			selfSay('Sorry, you need a premium account to get bless.')
			talk_state = 0
		end
------------------------------------------------ confirm yes ------------------------------------------------
	elseif msgcontains(msg, 'yes') and talk_state == 1 then
		talk_state = 0

					if getPlayerBlessing(cid,4) == 0 then
					if doPlayerRemoveMoney(cid,20000) == 1 then
					selfSay('Now the gods blessed you.') 
						doPlayerAddBlessing(cid,4)
			else
			selfSay('Sorry, you dont have enough money.')
			end
			else
		selfSay('Sorry, you already have this blessing.')
			end
------------------------------------------------ confirm no ------------------------------------------------
	elseif msgcontains(msg, 'no') and (talk_state >= 1 and talk_state <= 2) then
		selfSay('Ok then.')
		talk_state = 0
	end
-- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
return true
end

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

 

NPC 5

-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
----------------------------------- Npc of Bless ----------------------------------
---------------------------- Credits 100% by Arcavier -----------------------------
-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------

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

function creatureSayCallback(cid, type, msg)
-- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
if(npcHandler.focus ~= cid) then
	return false
end


	if msgcontains(msg, 'bless') then
		selfSay('I sell the \"Wisdom of Solitude\" Blessing.')
------------------------------------------------ bless ------------------------------------------------
	elseif msgcontains(msg, 'Wisdom of Solitude') or msgcontains(msg, 'wisdom of solitude') then
		if isPremium(cid) then
			selfSay('Do you want to buy the Wisdom of Solitude Blessing for 20k?')
			talk_state = 1
		else
			selfSay('Sorry, you need a premium account to get bless.')
			talk_state = 0
		end
------------------------------------------------ confirm yes ------------------------------------------------
	elseif msgcontains(msg, 'yes') and talk_state == 1 then
		talk_state = 0

					if getPlayerBlessing(cid,5) == 0 then
					if doPlayerRemoveMoney(cid,20000) == 1 then
					selfSay('Now the gods blessed you.') 
						doPlayerAddBlessing(cid,5)
			else
			selfSay('Sorry, you dont have enough money.')
			end
			else
		selfSay('Sorry, you already have this blessing.')
			end
------------------------------------------------ confirm no ------------------------------------------------
	elseif msgcontains(msg, 'no') and (talk_state >= 1 and talk_state <= 2) then
		selfSay('Ok then.')
		talk_state = 0
	end
-- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
return true
end

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

Editado Março 28 por Arcavier

2 meses depois...
HugoBeolchiH
06 de maio de 2007 às 22:03

Em qual servidor q vc testo?

zorzin ou evolution?

Vlw

BonzinB
10 de maio de 2007 às 11:13

Se não for pedir muito posta o Npc e o Scritp já prontos??? Obrigado...

BfalcaoB
10 de maio de 2007 às 11:51

Putz cara muito bom esses npcs principalmente que em quase nenhum ou nenhum tem esse npc incluido.

Bom trabalho cara.

3 meses depois...
brunororatoB
26 de agosto de 2007 às 21:23

Nossa eu to precisanu disso ae mais n sei montra o npc sera q vc poderia me ajuda ou alguem ae q saiba fazer vlw

1 mês depois...
Hrk123H
16 de setembro de 2007 às 14:26

posta link cum os 5 pra baxa

 

a mais uma coisa vi isso ai no otservbrasil igualzinho lol

Editado Setembro 16 por Hrk1321

flokosF
20 de setembro de 2007 às 18:49

YES

 

Muito bom...

E verdade esses NPCs nen são valorizados.

Deverian ser.

 

Aplausos

 

Clap! Clap! Clap! Clap! Clap! Clap! Clap!

1 mês depois...
celohereC
06 de outubro de 2007 às 09:40

cara , meus parabéns não foi facil achar esses npcs. aqui ta funcionando certinho :lol: valeu mesmo

2 semanas depois...
13 de outubro de 2007 às 12:49

Bem legal , eu tava procurando issu mesmo , mas...vc só coloco o script deles , vc podia dar mais informações , ajuda para colocar no map editor pra poupar tempo de quem lê o topic e coisas do tipo , pq sem issu vc só da mais trabalho pra quem quer isso mas não sabe arrumar direito

 

Eu sei arrumar então vo por no meu OT , parece que está pegando , parabéns e se der edita c/ + informações para ajudar como eu já disse

 

Flws ;D

2 semanas depois...
41513474
22 de outubro de 2007 às 23:34

Esse npc funciona no Yurots normal?

1 mês depois...
jmazzacaroJ
30 de novembro de 2007 às 10:08

ai cara nao entendi direito o topico vc bem q podia posta o link com os 5 pra baixa se nao for pedir de mais

1 mês depois...
08 de dezembro de 2007 às 19:22

opa

vlws viu !

vo coloca imediatamente no meu ot ^.^

1 mês depois...
31 de janeiro de 2008 às 08:44

CARaKAa veLhOW

PerFieTOWW

Eu Tava ProCURanDO Esse NPc

Vc N Tem Nocao De COmo Me AjUDoW Cara!

De+ d++

VO TeNTar InvoLVer as % scripts

em 1 uma SOh

1 Uniko Npc q VenDe dah first bless ateh a fight bless

Mtu Bom =]

DaNDaNrOxXD
31 de janeiro de 2008 às 14:08

Nussa muito bom vo por no meu ot ^^ vlw mesmo!

ClaudiooC
31 de janeiro de 2008 às 16:40

Os Npcs funcionam aqui (aries) mas efetivamente as bless nao servem pra nada, antes da bless meu char perdeu 4 levels, depois perdeu 4 também :S

 

Ta certo isso?