ziggy46802
Active Member
- Joined
- Aug 19, 2012
- Messages
- 418
- Reaction score
- 27
Here is my go at an "updated" fletcher that actually sells some useful stuff and will buy back arrows and bolts that you either collect as a different vocation or choose not to use.
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
local shopModule = ShopModule:new()
npcHandler:addModule(shopModule)
--------------------sells-------------------------
--singles
shopModule:addBuyableItem({'assassin star'}, 7368, 100, 1,'assassin star')
shopModule:addBuyableItem({'throwing knife'}, 2410, 25, 1,'throwing knife')
shopModule:addBuyableItem({'throwing star'}, 2399, 42, 1,'throwing star')
shopModule:addBuyableItem({'small stone'}, 1294, 35, 1,'small stone')
shopModule:addBuyableItem({'viper star'}, 7366, 35, 1,'viper star')
--bows
shopModule:addBuyableItem({'bow'}, 2456, 400, 1,'bow')
shopModule:addBuyableItem({'composite hornbow'}, 8855, 100000, 1,'composite hornbow')
shopModule:addBuyableItem({'elvish bow'}, 7438, 10000, 1,'elvish bow')
shopModule:addBuyableItem({'silkweaver bow'}, 8857, 20000, 1,'silkweaver bow')
shopModule:addBuyableItem({'warsinger bow'}, 8854, 1000000, 1,'warsinger bow')
--bow ammunition
shopModule:addBuyableItem({'arrow'}, 2544, 3, 1,'arrow')
shopModule:addBuyableItem({'earth arrow'}, 7850, 5, 1,'earth arrow')
shopModule:addBuyableItem({'flaming arrow'}, 7840, 5, 1,'flaming arrow')
shopModule:addBuyableItem({'flash arrow'}, 7838, 5, 1,'flash arrow')
shopModule:addBuyableItem({'onyx arrow'}, 7365, 7, 1,'onyx arrow')
shopModule:addBuyableItem({'shiver arrow'}, 7839, 5, 1,'shiver arrow')
shopModule:addBuyableItem({'sniper arrow'}, 7364, 5, 1,'sniper arrow')
--crossbows
shopModule:addBuyableItem({'crossbow'}, 2455, 500, 1,'crossbow')
shopModule:addBuyableItem({'chain bolter'}, 8850, 200000, 1,'chain bolter')
shopModule:addBuyableItem({'modified crossbow'}, 8849, 30000, 1,'modified crossbow')
shopModule:addBuyableItem({'royal crossbow'}, 8851, 1500000, 1,'royal crossbow')
--crossbow ammunition
shopModule:addBuyableItem({'bolt'}, 2543, 4, 1,'bolt')
shopModule:addBuyableItem({'piercing bolt'}, 7363, 5, 1,'piercing bolt')
shopModule:addBuyableItem({'power bolt'}, 2547, 7, 1,'power bolt')
--spears
shopModule:addBuyableItem({'hunting spear'}, 3965, 100, 1, 'hunting spear')
shopModule:addBuyableItem({'spear'}, 2389, 9, 1,'spear')
shopModule:addBuyableItem({'royal spear'}, 7378, 15, 1,'royal spear')
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------buys----------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--singles
shopModule:addSellableItem({'throwing knife'}, 2410, 8, 1,'throwing knife')
shopModule:addSellableItem({'assassin star'}, 7368, 25, 1,'assassin star')
shopModule:addSellableItem({'throwing star'}, 2399, 12, 1,'throwing star')
shopModule:addSellableItem({'small stone'}, 1294, 10, 1,'small stone')
shopModule:addSellableItem({'viper star'}, 7366, 10, 1,'viper star')
--bows
shopModule:addSellableItem({'bow'}, 2456, 100, 1,'bow')
shopModule:addSellableItem({'composite hornbow'}, 8855, 25000, 1,'composite hornbow')
shopModule:addSellableItem({'elvish bow'}, 7438, 2000, 1,'elvish bow')
shopModule:addSellableItem({'silkweaver bow'}, 8857, 12000, 1,'silkweaver bow')
shopModule:addSellableItem({'warsinger bow'}, 8854, 200000, 1,'warsinger bow')
--bow ammunition
shopModule:addSellableItem({'arrow'}, 2544, 1, 1,'arrow')
shopModule:addSellableItem({'earth arrow'}, 7850, 3, 1,'earth arrow')
shopModule:addSellableItem({'flaming arrow'}, 7840, 3, 1,'flaming arrow')
shopModule:addSellableItem({'flash arrow'}, 7838, 3, 1,'flash arrow')
shopModule:addSellableItem({'onyx arrow'}, 7365, 4, 1,'onyx arrow')
shopModule:addSellableItem({'shiver arrow'}, 7839, 3, 1,'shiver arrow')
shopModule:addSellableItem({'sniper arrow'}, 7364, 3, 1,'sniper arrow')
--crossbows
shopModule:addSellableItem({'crossbow'}, 2455, 120, 1,'crossbow')
shopModule:addSellableItem({'chain bolter'}, 8850, 40000, 1,'chain bolter')
shopModule:addSellableItem({'modified crossbow'}, 8849, 10000, 1,'modified crossbow')
shopModule:addSellableItem({'royal crossbow'}, 8851, 200000, 1,'royal crossbow')
--crossbow ammunition
shopModule:addSellableItem({'bolt'}, 2543, 2, 1,'bolt')
shopModule:addSellableItem({'piercing bolt'}, 7363, 3, 1,'piercing bolt')
shopModule:addSellableItem({'power bolt'}, 2547, 4, 1,'power bolt')
--spears
shopModule:addSellableItem({'hunting spear'}, 3965, 25, 1,'hunting spear')
shopModule:addSellableItem({'spear'}, 2389, 3, 1,'spear')
shopModule:addSellableItem({'royal spear'}, 7378, 5, 1,'royal spear')
npcHandler:addModule(FocusModule:new())