Ir para conteúdo

[Npc] Simon The Beggar & Amber


Posts Recomendados

Fala ae galera XTibiana!

 

Alguns de vocês devem saber que eu sou o criador do Tibia World RPG OldSchool Server e como eu ando fazendo MUITOS NPCs para o meu Servidor, resolvi liberar alguns dos meus NPCs mais fáceis de fazer e é claro que não vou postar um dificil como a The Queen of the Banshee NPC até porque não sou nenhum idiota ;)

 

Só para lembrar que todos os meus NPCs são baseados nos arquivos originais de NPC da Cipsoft!

 

Vamos parar de conversa e vamos aos Scripts:

 

Amber.xml (Rookgaard)

<?xml version="1.0"?>
<npc name="Amber" script="amber.lua" walkinterval="1000" access="3" floorchange="0">
<health now="100" max="100"/>
<look type="137" head="59" body="113" legs="132" feet="76"/>
 <parameters>

   <parameter key="message_greet" value="Oh hello, nice to see you |PLAYERNAME|." />
   <parameter key="message_farewell" value="See you later." />

<parameter key="module_keywords" value="1" />
   <parameter key="keywords" value="how are you;job;explore;adventure;sea;time;help;information;dungeon;sewer;assistant;monster;cyclops;minotaur;dragon;raft;quest;mission;seymour;academy;king;thais;cipfried;dallheim;hyancith;willie;obi;weapon;magic;tibia;castle;orc" />

<parameter key="keyword_reply1" value="I am recovering from a sea journey." />
<parameter key="keyword_reply2" value="I explore and seek adventure." />
<parameter key="keyword_reply3" value="I have been almost everywhere in Tibia." />
<parameter key="keyword_reply4" value="I fought fierce monsters, climbed the highest mountains, and crossed the sea on a raft." />
<parameter key="keyword_reply5" value="My trip over the sea was horrible. The weather was bad, the waves high and my raft quite simple." />
<parameter key="keyword_reply6" value="Sorry, I lost my watch in a storm." />
<parameter key="keyword_reply7" value="I can't help you much beyond information." />
<parameter key="keyword_reply8" value="Just ask and I'll try to answer." />
<parameter key="keyword_reply9" value="I have not had the time to explore the dungeons of this isle, but I have seen two big caves in the east, and there is a ruined tower in the northwest." />
<parameter key="keyword_reply10" value="I like sewers. I made my very first battle experience in the Thais sewers. The small sewersystem of Rookgaard has some nasty rats to fight." />
<parameter key="keyword_reply11" value="I have a job of great responsibility. Mostly I keep annoying persons away from my boss." />
<parameter key="keyword_reply12" value="Oh, I fought orcs, cyclopses, minotaurs, and even green dragons." />
<parameter key="keyword_reply13" value="Horrible monsters they are." />
<parameter key="keyword_reply14" value="Horrible monsters they are." />
<parameter key="keyword_reply15" value="Horrible monsters they are." />
<parameter key="keyword_reply16" value="I left my raft at the south eastern shore. I forgot my private notebook on it. If you could return it to me I would be very grateful." />
<parameter key="keyword_reply17" value="I left my raft at the south eastern shore. I forgot my private notebook on it. If you could return it to me I would be very grateful." />
<parameter key="keyword_reply18" value="I left my raft at the south eastern shore. I forgot my private notebook on it. If you could return it to me I would be very grateful." />
<parameter key="keyword_reply19" value="I think this poor guy was a bad choice as the head of the academy." />
<parameter key="keyword_reply20" value="A fine institution, but it needs definitely more funds from the king." />
<parameter key="keyword_reply21" value="King Tibianus is the ruler of Thais." />
<parameter key="keyword_reply22" value="A fine city, but the king has some problems enforcing the law." />
<parameter key="keyword_reply23" value="A gentle person. You should visit him, if you have problems." />
<parameter key="keyword_reply24" value="An extraordinary warrior. He's the first and last line of defense of Rookgaard." />
<parameter key="keyword_reply25" value="Hyacinth is a great healer. He lives somewhere hidden on this isle." />
<parameter key="keyword_reply26" value="He's funny in his own, gruffy way." />
<parameter key="keyword_reply27" value="He's a funny little man." />
<parameter key="keyword_reply28" value="The best weapons on this isle are just toothpicks, compared with the weapons warriors of the mainland wield." />
<parameter key="keyword_reply29" value="You can learn spells only in the guildhalls of the mainland." />
<parameter key="keyword_reply30" value="I try to explore each spot of Tibia, and one day I will succeed." />
<parameter key="keyword_reply31" value="If you travel to Thais, you really should visit the marvelous castle." />
<parameter key="keyword_reply32" value="Not the nicest guys you can encounter. I had some clashes with them and was prisoner of the orcs for some months." />

<parameter key="module_shop" value="1"/>
<parameter key="shop_buyable" value=""/>	

 </parameters>
</npc>

 

Amber.lua

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

function creatureSayCallback(cid, type, msg)
if(npcHandler.focus ~= cid) then
	return false
end

-- NPC Amber feito por Rodrigo (Nottinghster)
-- Inicio Amber NPC

if msgcontains(msg, 'book') or msgcontains(msg, 'notebook') then
selfSay('Do you bring me my notebook?')
talk_state = 1

elseif msgcontains(msg, 'yes') and talk_state == 1 and getPlayerItemCount(cid,1950) >= 1 then
selfSay('Excellent. Here, take this short sword, that might serve you well.')
doPlayerAddItem(cid, 2406)
doPlayerRemoveItem(cid,1950, 1)
talk_state = 0
elseif msgcontains(msg, 'yes') and talk_state == 1 and getPlayerItemCount(cid,1950) == 0 then
selfSay('Hm, you don\'t have it.')
talk_state = 0
elseif msgcontains(msg, 'no') and talk_state == 1 then
selfSay('Too bad.')
talk_state = 0

elseif msgcontains(msg, 'orcish') or msgcontains(msg, 'language') or msgcontains(msg, 'prisoner') then
selfSay('I speak some orcish words, not much though, just \'yes\' and \'no\' and such basic.')
talk_state = 2

elseif msgcontains(msg, 'yes') and talk_state == 2 then
selfSay('It\'s \'mok\' in orcish. I help you more about that if you have some food.')
elseif msgcontains(msg, 'no') and talk_state == 2 then
selfSay('In orcish that\'s \'burp\'. I help you more about that if you have some food.')

elseif msgcontains(msg, 'food') then
selfSay('My favorite dish is salmon. Oh please, bring me some of it.')

elseif msgcontains(msg, 'salmon') then
selfSay('Yeah! If you give me some salmon I will tell you more about the orcish language.')
talk_state = 3

elseif msgcontains(msg, 'yes') and talk_state == 3 and getPlayerItemCount(cid,2668) >= 1 then
selfSay('Thank you. Orcs call arrows \'pixo\'.')
doPlayerRemoveItem(cid,2668,1)
elseif msgcontains(msg, 'yes') and talk_state == 3 and getPlayerItemCount(cid,2668) == 0 then
selfSay('You don\'t have one!')
talk_state = 0

elseif msgcontains(msg, 'bye') and (talk_state >= 1 and talk_state <= 3) then
selfSay('See you later.')
talk_state = 0

end
-- Final Amber NPC
-- NPC Amber feito por Rodrigo (Nottinghster)
return true
end

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

 

Simon the Beggar.xml (Deeper Fibula Quest)

<?xml version="1.0"?>
<npc name="Simon the Beggar" script="simon.lua" walkinterval="1000" access="3" floorchange="0">
<health now="100" max="100"/>
<look type="128" head="116" body="123" legs="32" feet="40"/>
 <parameters>

   <parameter key="message_greet" value="Hello |PLAYERNAME|. I am a poor man. Please help me." />
   <parameter key="message_farewell" value="Have a nice day." />

<parameter key="module_keywords" value="1" />
   <parameter key="keywords" value="job;beggar;gold;name;simon;dermot;village;key;dungeon;fibula;timur;worlf;flute;minotaurs;minos;treasure;giant spider;monster;jetty;ship;tibia" />

<parameter key="keyword_reply1" value="I have no job. I am a beggar." />
<parameter key="keyword_reply2" value="I have no gold and no job, so I am a beggar." />
<parameter key="keyword_reply3" value="I need gold. I love gold. I need help." />
<parameter key="keyword_reply4" value="My name is Simon. I am a very poor man." />
<parameter key="keyword_reply5" value="I am Simon. The poorest human all over the continent." />
<parameter key="keyword_reply6" value="The magistrate of the village. I heard he is selling something for the Fibula Dungeon." />
<parameter key="keyword_reply7" value="To the north is the village Fibula. A very small village." />
<parameter key="keyword_reply8" value="Key? There are a lot of keys. Please change the topic." />
<parameter key="keyword_reply9" value="I heard a lot about the Fibula Dungeon. But I never was there." />
<parameter key="keyword_reply10" value="I hate Fibula. Too many wolves are here." />
<parameter key="keyword_reply11" value="I hate Timur. He is too expensive. But sometimes I find maces and hatchets. Timur is buying these items." />
<parameter key="keyword_reply12" value="Please kill them ... ALL." />
<parameter key="keyword_reply13" value="Har, har. The stupid Dermot lost his flute. I know that some minotaurs have it in their treasure room." />
<parameter key="keyword_reply14" value="Very rich monsters. But they are too strong for me. However, there are even stronger monsters." />
<parameter key="keyword_reply15" value="Very rich monsters. But they are too strong for me. However, there are even stronger monsters." />
<parameter key="keyword_reply16" value="I know there are two rooms. And I know you can pass only the first door. The second door can't be opened." />
<parameter key="keyword_reply17" value="I know that terrible monster. It killed the fishers on the isle to the north." />
<parameter key="keyword_reply18" value="The strongest monster I know is the giant spider." />
<parameter key="keyword_reply19" value="I hate this jetty. I have never seen a ship here." />
<parameter key="keyword_reply20" value="There is a large sea-monster outside. I think there is no gritty captain to sail in this quarter." />
<parameter key="keyword_reply21" value="Hehe, do you have a shovel? I can sell you a shovel if you want to return to Tibia." />

<parameter key="module_shop" value="1"/>
<parameter key="shop_buyable" value="shovel,2554,50;"/>	

 </parameters>
</npc>

 

Simon.lua

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

function creatureSayCallback(cid, type, msg)
if(npcHandler.focus ~= cid) then
	return false
end

-- NPC Simon (Deeper Fibula Quest) feito por Rodrigo (Nottinghster)
-- Inicio Simon NPC

local player_gold     = getPlayerItemCount(cid,2148)
   local player_plat     = getPlayerItemCount(cid,2152)*100
   local player_crys     = getPlayerItemCount(cid,2160)*10000
   local player_money    = player_gold + player_plat + player_crys

if msgcontains(msg, 'help') then
selfSay('I need gold. Can you spend me 100 gold pieces?')
talk_state = 1

elseif msgcontains(msg, 'yes') and talk_state == 1 and player_money >= 100 then
selfSay('Thank you very much. Can you spend me 500 more gold pieces? I will give you a nice hint.')
doPlayerRemoveMoney(cid, 100)
talk_state = 2
elseif msgcontains(msg, 'yes') and talk_state == 1 and player_money < 100 then
selfSay('You\'ve not enough money for me.')

elseif msgcontains(msg, 'yes') and talk_state == 2 and player_money >= 500 then
doPlayerRemoveMoney(cid, 500)
selfSay('That\'s great! I have stolen something from Dermot. You can buy it for 200 gold. Do you want to buy it?')
talk_state = 3
elseif msgcontains(msg, 'yes') and talk_state == 2 and player_money < 500 then
selfSay('You\'ve not enough money for me.')

elseif msgcontains(msg, 'yes') and talk_state == 3 and player_money >= 200 then
selfSay('Now you own the hot key.')
doPlayerRemoveMoney(cid, 200)
key = doPlayerAddItem(cid, 2087,1)
doSetItemActionId(key,3940)
talk_state = 0
elseif msgcontains(msg, 'yes') and talk_state == 3 and player_money < 200 then
selfSay('Pah! I said 200 gold. You don\'t have so much.')

elseif msgcontains(msg, 'bye') and (talk_state >= 1 and talk_state <= 3) then
selfSay('Have a nice day.')
talk_state = 0

end
-- Final Simon NPC
-- NPC Simon (Deeper Fibula Quest) feito por Rodrigo (Nottinghster)
return true
end

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

 

Agora se divirtam! ;)

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

Ih brother, então ficará no aguardo pelo The Queen of the Banshee NPC porque esse eu não irei postar de jeito nenhum, até hoje não vi nenhum OTServ que tenha esse NPC que seja idêntico ao Global, se quiser somente o XML dele, sem problemas, mas agora o arquivo LUA dele de jeito nenhum, lá está o código inteiro ;)

 

Ai o XML do NPC se quiser:

 

The Queen of the Banshee.xml

<?xml version="1.0" encoding="UTF-8"?>
<npc name="The Queen of the Banshee" script="banshee_queen.lua" walkinterval="1000" access="3" floorchange="0">
   <health now="100" max="100"/>
   <look type="78" head="0" body="0" legs="0" feet="0"/>
   <parameters>

       <parameter key="message_greet" value="Be greeted, dear visitor. Come and stay ... a while."/>
	<parameter key="message_farewell" value="We will meet again."/>

	<parameter key="module_keywords" value="1" />
       <parameter key="keywords" value="name;job;place;race;seed;destruction;complex;ghostlands;banshee;seal;guardian;" />
       <parameter key="keyword_reply1" value="It hurts me to even think about my mortal past. Its long lost and forgotten. So don't ask me about it!" />
       <parameter key="keyword_reply2" value="It is my curse to be the eternal guardian of this ancient place." />
	<parameter key="keyword_reply3" value="It served as a temple, a source of power and ... as a sender for an ancient race in time long gone by and forgotten." />
	<parameter key="keyword_reply4" value="The race that built this edifice came to this place from the stars. They ran from an enemy even more horrible than even themselves. But they carried the seed of their own destruction in them." />
	<parameter key="keyword_reply5" value="This ancient race was annihilated by its own doings, that's all I know. Aeons have passed since then, but the sheer presence of this complex is still defiling and desecrating this area." />
	<parameter key="keyword_reply6" value="This ancient race was annihilated by its own doings, that's all I know. Aeons have passed since then, but the sheer presence of this complex is still defiling and desecrating this area." />
	<parameter key="keyword_reply7" value="Its constructors were too strange for you or even me to understand. We cannot know what this ... thing they have built was supposed to be good for. All I can feel is a constant twisting and binding of souls, though that is probably only a side-effect." />
	<parameter key="keyword_reply8" value="The place you know as the Ghostlands had a different name once ... and many names thereafter. Too many for me to remember them all." />
	<parameter key="keyword_reply9" value="They are my maidens. They give me comfort in my eternal vigil over the last seal." />
	<parameter key="keyword_reply10" value="I am the guardian of the SEVENTH and final seal. The seal to open the last door before ... but perhaps it is better you see it with your own eyes." />
	<parameter key="keyword_reply11" value="I am the guardian of the SEVENTH and final seal. The seal to open the last door before ... but perhaps it is better you see it with your own eyes." />

   </parameters>
</npc>

Link para o comentário
Compartilhar em outros sites

  • 2 weeks later...
  • 6 months later...
  • 2 weeks later...
×
×
  • Criar Novo...