• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

NPC Simon The Beggar & Amber

Nottinghster

Tibia World RPG Developer
Joined
Oct 24, 2007
Messages
1,570
Solutions
6
Reaction score
438
Location
Brazil - Rio de Janeiro
GitHub
Nottinghster
Hello Guys!

I have an OldSchool Project and I decide to release some of my npcs to you, they are 100%.
They are based on Cipsoft NPC Files!

Amber.xml
Code:
<?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
Code:
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 Simon NPC
	-- NPC Simon (Deeper Fibula Quest) feito por Rodrigo (Nottinghster)
	return true
end

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

Simon the Beggar.xml
Code:
<?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
Code:
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())

Have Fun! ;)
 
Back
Top Bottom