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

Help with npc system

lol94

Loler
Joined
Dec 23, 2008
Messages
764
Reaction score
55
Location
Mexico
hey guys i got this really annoying bug please help:

helpplx.png
 
PHP:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Eremo" script="data/npc/scripts/Sell/eremo.lua" walkinterval="2000" floorchange="0">
    <health now="100" max="100"/>
    <look type="130" head="0" body="71" legs="128" feet="128"/>
    <parameters>
        <parameter key="message_greet" value="Welcome to my little garden, adventurer |PLAYERNAME|!" />
    </parameters>
</npc>

PHP:
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:addBuyableItem({'amulet of loss'}, 2173, 10000, 'amulet of loss')
shopModule:addBuyableItem({'protection amulet'}, 2200, 700, 'protection amulet')
shopModule:addSellableItem({'broken amulet'}, 2196, 50000, 'broken amulet')
shopModule:addSellableItem({'amulet of loss'}, 2173, 5000, 'amulet of loss')

local travelNode = keywordHandler:addKeyword({'cormaya'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to sail to Cormaya ?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=33287, y=31955, z=6} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Then stay here!'})
npcHandler:addModule(FocusModule:new())

where can I found the ShopModule ?
 
NPC libs, not needed.
I'll give you the correct script.

Lua:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Eremo" script="data/npc/scripts/Sell/eremo.lua" walkinterval="2000" floorchange="0">
    <health now="100" max="100"/>
    <look type="130" head="0" body="71" legs="128" feet="128"/>
    <parameters>
        <parameter key="message_greet" value="Welcome to my little garden, adventurer |PLAYERNAME|. I can bring you to {Cormaya} or {Carlin}" />

		<parameter key="module_travel" value="1"/>
		<parameter key="travel_destinations" value="cormaya,33287,31955,6,0;"/>
    </parameters>
</npc>
Lua:
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:addBuyableItem({'amulet of loss'}, 2173, 10000, 'amulet of loss')
shopModule:addBuyableItem({'protection amulet'}, 2200, 700, 'protection amulet')
npcHandler:addModule(FocusModule:new())
 
Last edited:
Lua:
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:addBuyableItem({'amulet of loss'}, 2173, 10000, 'amulet of loss')
shopModule:addBuyableItem({'protection amulet'}, 2200, 700, 'protection amulet')
npcHandler:addModule(FocusModule:new())

Its not working, the console says ShopModule.onBuy - Item not found on shopItems List
Please help me!
 
Back
Top