• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

NPC Parcel Seller

bomba

Member
Joined
Feb 26, 2008
Messages
635
Reaction score
7
Location
Brazil
It is not hard to do, but I like to publish.

The NPC:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Big Foose" script="data/npc/scripts/parcel_label_letter.lua" walkinterval="2000" floorchange="0">
	<health now="100" max="100"/>
	<look type="136" head="96" body="96" legs="85" feet="4" addons="3"/>
	<parameters>
        	<parameter key="message_greet" value="Hello. How may I help you |PLAYERNAME|? Ask me for a {trade} if you want to buy something. I can also explain the {mail} system." />
		<parameter key="module_keywords" value="1" />
		<parameter key="keywords" value="mail;letters;explain letters;parcels;explain parcels;label;city" />

		<parameter key="keyword_reply1" value="With our mail system you can send {letters} and {parcels} to other Tibians. I can either explain how {letters} and {parcels} work orsell them to you if you ask me for a {trade}." />
		<parameter key="keyword_reply2" value="If you want to buy a letter, ask me for a {trade}. Or do you want me to {explain letters} how letters work?" />
		<parameter key="keyword_reply3" value="With a letter you can send a message to another Tibian's depot. If you want to send it to 'Ben' in 'Thais', use the letter - sothat a form opens - and write 'Ben' in the first line and 'Erembor' in the second line. Write your message below that." />
		<parameter key="keyword_reply4" value="If you want to buy a parcel, ask me for a {trade}. Or do you want me to {explain parcels} how parcels work?" />
		<parameter key="keyword_reply5" value="In a parcel you can send items to another Tibian's depot. Put your items into the parcel and also place a completed {label} withthe name and the {city} of the receiver inside. Then drag your parcel on one of the blue mailboxes here to send it." />
		<parameter key="keyword_reply6" value="Including a label in your parcel is important. Imagine you want to send it to 'Ben' in 'Erembor'. Use the label - so that a formopens - and write 'Ben' in the first line and 'Erembor' in the second line. Check the spelling and put it in your parcel!" />
		<parameter key="keyword_reply7" value="The depots you can send parcels or letters to are in the following cities: Erembor." />
	</parameters>
</npc>

The Script:
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

local shopModule = ShopModule:new()
npcHandler:addModule(shopModule)

--NPC sell to Player--
shopModule:addBuyableItem({'parcel', 'parcel'},                  2595, 14,    'parcel')
shopModule:addBuyableItem({'letter', 'letter'},                  2597, 10,    'letter')
shopModule:addBuyableItem({'label', 'label'},                  2599, 1,    'label')

npcHandler:addModule(FocusModule:new())

Is very similar to the original.
Work on TFS-Alpha4
 
Nothing special at all. Do the buyable items have their prices at all? Nope.. :s
 
Back
Top