• 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!

NPC Script + Item request

Epic

Banned User
Joined
Mar 30, 2009
Messages
1,142
Reaction score
1
Location
Barcelona (Spain)
Hello.

I wish to have an NPC that sells a vase of beer, wisky, ron or vodka, each item for 1cc ( rich stuff :p ) How should the script be? Thanks beforehand

Also, what should i put on items.xml to make a vase of those things makes you get Drunk status for like 1 minute? Thanks too!

I really need this NPC + items :S
 
Explaining it better xD:

-NPC Barman, which sells: Vase of whisky, Vase of Vodka, Vase of Beer and Vase of ron. Words needed: "hi" "vase of whisky/vodka/beer/ron" "yes". Each vase cost 1cc.

-Add 4 items on items.xml which are the 4 vases up there. Each vase gives Drunk Status during 1 minute. Just give me the item properties, and i'll put the ItemID.

Please i've got the Tabern and all mapped. I need it alot! Thankkss! :D
 
Last edited:
This is the xml & scrip files i've made for the Barman, tell me if they're ok!

XML:

Code:
<npc name="Barman" Script="data/npc/scripts/bar.lua" walkinterval="25" floorchange="0" access="3" level="1" maglevel="1">
	<health now="150" max="150"/>
	<look type="73" head="0" body="0" legs="0" feet="0"/>
	<parameters>
		<parameter key="module_shop" value="1" />
		<parameter key="message_greet" value="Welcome to my tabern |PLAYERNAME|! Have a good driking & smoking time :D. I sell a vase of whisky(4cc), a vase of vodka(6cc), a cup of ron(4cc) and a bottle of beer(1cc)!" />
		<parameter key="shop_buyable" value="vase of whisky,3941,40000;vase of vodka,3942,60000;;cup of ron,2013,40000;;bottle of beer,2015,10000;;" />
	</parameters>
</npc>

Script:

Code:
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

npcHandler:addModule(FocusModule:new())
 
for items , make an npc like other sellers , Hi | Trade and items shows...

for drunk status you need a script in actions , search for it in your files there should be one for beer
 
there you are for Drunk condition , i need to g2g bb
Lua:
local drunk = createConditionObject(CONDITION_DRUNK)
setConditionParam(drunk, CONDITION_PARAM_TICKS, 1000)
 
Back
Top