• 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

rodrigosch

New Member
Joined
Aug 20, 2008
Messages
77
Reaction score
0
Hello!

First, I dont know if is here I need to post it, but if dont are here, please only move! :thumbup:

So, let's go!

I want to know, how I can create a npc, with sell example: bp of sd and all with 100 charges?

Because, I need npc seller of bp potions, and dont know how to make :confused:

If someone can help me, thanks!

Thanks to now,
RodS.
Cya!
 
Try:

shopModule:addBuyableItemContainer({'sd','sudden death'}, <BACKPACK_ID>, <SD ID>, <PRICE>, <CHARGES>, 'backpack of sudden death rune')
 
Bro, can you help me more?

Where I write it?

How i make, sorry, i dont understand!

Thanks to now!
 
You write it in the NPC.lua script...

Sample, Runes.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

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

shopModule:addBuyableItemContainer({'bp ap','bp antidote'}, 2002, 8378, 2000, 1, 'backpack of antidote potions')
shopModule:addBuyableItemContainer({'bp hp','bp health'}, 2000, 7618, 900, 1, 'backpack of health potions')
shopModule:addBuyableItemContainer({'bp mp','bp mana'}, 2001, 7620, 1000, 1, 'backpack of mana potions')
shopModule:addBuyableItemContainer({'bp shp','bp strong health '}, 2000, 7588, 2000, 1, 'backpack of strong health potions')
shopModule:addBuyableItemContainer({'bp smp','bp strong mana'}, 2001, 7589, 1600, 1, 'backpack of strong mana potions')
shopModule:addBuyableItemContainer({'bp ghp','bp great health'}, 2000, 7591, 3800, 1, 'backpack of great health potions')
shopModule:addBuyableItemContainer({'bp gmp','bp great mana'}, 2001, 7590, 2400, 1, 'backpack of great mana potions')
shopModule:addBuyableItemContainer({'bp gsp','bp great spirit'}, 1999, 8472, 3800, 1, 'backpack of great spirit potions')
shopModule:addBuyableItemContainer({'bp uhp','bp ultimate health'}, 2000, 8473, 6200, 1, 'backpack of ultimate health potions')

shopModule:addBuyableItem({'instense healing','ih'}, 2265, 950, 10, 'intense healing rune')
shopModule:addBuyableItem({'ultimate healing','uh'}, 2273, 1750, 10, 'ultimate healing rune')
shopModule:addBuyableItem({'magic wall','mw'}, 2293, 1100, 10, 'magic wall rune')
shopModule:addBuyableItem({'destroy field','df'}, 2261, 150, 10, 'destroy field rune')
shopModule:addBuyableItem({'light magic missile','lmm'}, 2287, 40, 10, 'light magic missile rune')
shopModule:addBuyableItem({'heavy magic missile','hmm'}, 2311, 120, 10, 'heavy magic missile rune')
shopModule:addBuyableItem({'great fireball'}, 2304, 450, 10, 'great fireball rune')
shopModule:addBuyableItem({'explosion','exp'}, 2313, 420, 10, 'explosion rune')
shopModule:addBuyableItem({'sudden death', 'sd'}, 2268, 1100, 10, 'sudden death rune')
shopModule:addBuyableItem({'paralyze'}, 2278, 7000, 10, 'paralyze rune')
shopModule:addBuyableItem({'animate dead'}, 2316, 3750, 10, 'animate dead rune')
shopModule:addBuyableItem({'convince creature'}, 2290, 800, 10, 'convince creature rune')
shopModule:addBuyableItem({'chameleon'}, 2291, 2100, 10, 'chameleon rune')
shopModule:addBuyableItem({'desintegrate'}, 2310, 80,  3, 'desintegreate rune')
shopModule:addBuyableItem({'firebomb', 'fb'}, 2305, 1150,  10, 'firebomb rune')


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


It's not complete.

But it sells Runes and BP's of Potions.

YOu can read, understand and do your own.
If not, try to look for one complete npc.
 
Bro, its dont work :(

No appears on the buy window :/

Could you help me, please?
 
Back
Top