• 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 potion & runes

Walking Hell

Fast Attack hoster
Joined
Jan 23, 2008
Messages
61
Reaction score
0
well, taked some time to make it, but here it is:

WARNING:you need Advanced BuyContainer found here: http://otland.net/showthread.php?t=1375
PHP:
<npc name="Eryn" script="data/npc/scripts/potion.lua" access="5" lookdir="1">
	<health now="1000" max="1000"/>
<look type="133" head="0" body="86" legs="0" feet="38" addons="1"/>
</npc>

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

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

shopModule:addBuyableItem({'light wand', 'lightwand'}, 		2163, 500, 		'magic light wand')
shopModule:addBuyableItem({'heavy magic missile'}, 	2311, 1250, 	100,	'heavy magic missile rune')
shopModule:addBuyableItem({'great fireball'}, 			2304, 1800, 	100, 	'great fireball rune')
shopModule:addBuyableItem({'explosion'}, 					2313, 2500, 	100, 	'explosion rune')
shopModule:addBuyableItem({'ultimate healing'}, 		2273, 1750, 	100, 	'ultimate healing rune')
shopModule:addBuyableItem({'sudden death'}, 			2268, 3200, 	100, 	'sudden death rune')
shopModule:addBuyableItem({'blank'}, 					2260, 10, 		'blank rune')


shopModule:buyContainer({'bp sd'}, 	             2003, 2268, 8000, 20,  'Backpack of sudden death')
shopModule:buyContainer({'bp uh'}, 	             2002, 2273, 5000, 20,  'Backpack of ultimate healing')
shopModule:buyContainer({'bp gfb'},              2000, 2304, 2500, 20,  'Backpack of great fireball')
shopModule:buyContainer({'bp hmm'},              2001, 2311, 3000, 20,  'Backpack of heavy magic missile')
shopModule:buyContainer({'bp exp'},              2001, 2313, 4500, 20,  'Backpack of explosion rune')
shopModule:buyContainer({'bp hp'}, 	             1998, 7618, 1000, 1,   'backpack health potion')
shopModule:buyContainer({'bp shp'}, 	       1998, 7589, 2200, 1, 	'Backpack strong health potion')
shopModule:buyContainer({'bp ghp'}, 	       1998, 7591, 5000, 1,  	'backpack great health potion')
shopModule:buyContainer({'bp mp'}, 	             2004, 7620, 2000, 1,  	'Backpack mana potion')
shopModule:buyContainer({'bp smp'}, 	       2004, 7588, 2200, 1,  	'Backpack strong mana potion')
shopModule:buyContainer({'bp gmp'}, 	       2004, 7590, 5000, 1,  	'Backpack great mana potion')
npcHandler:addModule(FocusModule:new())

hope its usefully for some :thumbup:
 
Last edited:
well, taked some time to make it, but here it is:

PHP:
<npc name="Eryn" script="data/npc/scripts/potion.lua" access="5" lookdir="1">
	<health now="1000" max="1000"/>
<look type="133" head="0" body="86" legs="0" feet="38" addons="1"/>
</npc>

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

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

shopModule:addBuyableItem({'light wand', 'lightwand'}, 		2163, 500, 		'magic light wand')
shopModule:addBuyableItem({'heavy magic missile'}, 	2311, 1250, 	100,	'heavy magic missile rune')
shopModule:addBuyableItem({'great fireball'}, 			2304, 1800, 	100, 	'great fireball rune')
shopModule:addBuyableItem({'explosion'}, 					2313, 2500, 	100, 	'explosion rune')
shopModule:addBuyableItem({'ultimate healing'}, 		2273, 1750, 	100, 	'ultimate healing rune')
shopModule:addBuyableItem({'sudden death'}, 			2268, 3200, 	100, 	'sudden death rune')
shopModule:addBuyableItem({'blank'}, 					2260, 10, 		'blank rune')


shopModule:buyContainer({'bp sd'}, 	             2003, 2268, 8000, 20,  'Backpack of sudden death')
shopModule:buyContainer({'bp uh'}, 	             2002, 2273, 5000, 20,  'Backpack of ultimate healing')
shopModule:buyContainer({'bp gfb'},              2000, 2304, 2500, 20,  'Backpack of great fireball')
shopModule:buyContainer({'bp hmm'},              2001, 2311, 3000, 20,  'Backpack of heavy magic missile')
shopModule:buyContainer({'bp exp'},              2001, 2313, 4500, 20,  'Backpack of explosion rune')
shopModule:buyContainer({'bp hp'}, 	             1998, 7618, 1000, 1,   'backpack health potion')
shopModule:buyContainer({'bp shp'}, 	       1998, 7589, 2200, 1, 	'Backpack strong health potion')
shopModule:buyContainer({'bp ghp'}, 	       1998, 7591, 5000, 1,  	'backpack great health potion')
shopModule:buyContainer({'bp mp'}, 	             2004, 7620, 2000, 1,  	'Backpack mana potion')
shopModule:buyContainer({'bp smp'}, 	       2004, 7588, 2200, 1,  	'Backpack strong mana potion')
shopModule:buyContainer({'bp gmp'}, 	       2004, 7590, 5000, 1,  	'Backpack great mana potion')
npcHandler:addModule(FocusModule:new())

hope its usefully for some :thumbup:


does this works with tfs?
 
well, taked some time to make it, but here it is:

PHP:
<npc name="Eryn" script="data/npc/scripts/potion.lua" access="5" lookdir="1">
	<health now="1000" max="1000"/>
<look type="133" head="0" body="86" legs="0" feet="38" addons="1"/>
</npc>

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

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

shopModule:addBuyableItem({'light wand', 'lightwand'}, 		2163, 500, 		'magic light wand')
shopModule:addBuyableItem({'heavy magic missile'}, 	2311, 1250, 	100,	'heavy magic missile rune')
shopModule:addBuyableItem({'great fireball'}, 			2304, 1800, 	100, 	'great fireball rune')
shopModule:addBuyableItem({'explosion'}, 					2313, 2500, 	100, 	'explosion rune')
shopModule:addBuyableItem({'ultimate healing'}, 		2273, 1750, 	100, 	'ultimate healing rune')
shopModule:addBuyableItem({'sudden death'}, 			2268, 3200, 	100, 	'sudden death rune')
shopModule:addBuyableItem({'blank'}, 					2260, 10, 		'blank rune')


shopModule:buyContainer({'bp sd'}, 	             2003, 2268, 8000, 20,  'Backpack of sudden death')
shopModule:buyContainer({'bp uh'}, 	             2002, 2273, 5000, 20,  'Backpack of ultimate healing')
shopModule:buyContainer({'bp gfb'},              2000, 2304, 2500, 20,  'Backpack of great fireball')
shopModule:buyContainer({'bp hmm'},              2001, 2311, 3000, 20,  'Backpack of heavy magic missile')
shopModule:buyContainer({'bp exp'},              2001, 2313, 4500, 20,  'Backpack of explosion rune')
shopModule:buyContainer({'bp hp'}, 	             1998, 7618, 1000, 1,   'backpack health potion')
shopModule:buyContainer({'bp shp'}, 	       1998, 7589, 2200, 1, 	'Backpack strong health potion')
shopModule:buyContainer({'bp ghp'}, 	       1998, 7591, 5000, 1,  	'backpack great health potion')
shopModule:buyContainer({'bp mp'}, 	             2004, 7620, 2000, 1,  	'Backpack mana potion')
shopModule:buyContainer({'bp smp'}, 	       2004, 7588, 2200, 1,  	'Backpack strong mana potion')
shopModule:buyContainer({'bp gmp'}, 	       2004, 7590, 5000, 1,  	'Backpack great mana potion')
npcHandler:addModule(FocusModule:new())

hope its usefully for some :thumbup:

To apply this NPC you need buyContainer function which can be found on this forum. Also, if that has taken much time... lol, its just copy/paste and change the ids.
 
Can someone upload modules.lua with the buy container functions. I've tryed hundred times to make it work but still not able to get it work:S Thx
 
For this script i only need to add BuyCOntainer or?

u said change ids or so....??
 
Last edited:
can someone post the modules.lua and the global.lua please? i have also tested but i just get bugs..
 
well, taked some time to make it, but here it is:

WARNING:you need Advanced BuyContainer found here: http://otland.net/showthread.php?t=1375
PHP:
<npc name="Eryn" script="data/npc/scripts/potion.lua" access="5" lookdir="1">
	<health now="1000" max="1000"/>
<look type="133" head="0" body="86" legs="0" feet="38" addons="1"/>
</npc>

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

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

shopModule:addBuyableItem({'light wand', 'lightwand'}, 		2163, 500, 		'magic light wand')
shopModule:addBuyableItem({'heavy magic missile'}, 	2311, 1250, 	100,	'heavy magic missile rune')
shopModule:addBuyableItem({'great fireball'}, 			2304, 1800, 	100, 	'great fireball rune')
shopModule:addBuyableItem({'explosion'}, 					2313, 2500, 	100, 	'explosion rune')
shopModule:addBuyableItem({'ultimate healing'}, 		2273, 1750, 	100, 	'ultimate healing rune')
shopModule:addBuyableItem({'sudden death'}, 			2268, 3200, 	100, 	'sudden death rune')
shopModule:addBuyableItem({'blank'}, 					2260, 10, 		'blank rune')


shopModule:buyContainer({'bp sd'}, 	             2003, 2268, 8000, 20,  'Backpack of sudden death')
shopModule:buyContainer({'bp uh'}, 	             2002, 2273, 5000, 20,  'Backpack of ultimate healing')
shopModule:buyContainer({'bp gfb'},              2000, 2304, 2500, 20,  'Backpack of great fireball')
shopModule:buyContainer({'bp hmm'},              2001, 2311, 3000, 20,  'Backpack of heavy magic missile')
shopModule:buyContainer({'bp exp'},              2001, 2313, 4500, 20,  'Backpack of explosion rune')
shopModule:buyContainer({'bp hp'}, 	             1998, 7618, 1000, 1,   'backpack health potion')
shopModule:buyContainer({'bp shp'}, 	       1998, 7589, 2200, 1, 	'Backpack strong health potion')
shopModule:buyContainer({'bp ghp'}, 	       1998, 7591, 5000, 1,  	'backpack great health potion')
shopModule:buyContainer({'bp mp'}, 	             2004, 7620, 2000, 1,  	'Backpack mana potion')
shopModule:buyContainer({'bp smp'}, 	       2004, 7588, 2200, 1,  	'Backpack strong mana potion')
shopModule:buyContainer({'bp gmp'}, 	       2004, 7590, 5000, 1,  	'Backpack great mana potion')
npcHandler:addModule(FocusModule:new())

hope its usefully for some :thumbup:

it doesnt take anytime to make this maybe 5minutes in total
 
can someone post the modules.lua and the global.lua please, that is complete and working with this npc thingy..
 
Back
Top