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

Volti

New Member
Joined
Nov 14, 2009
Messages
25
Reaction score
0
Hello,
i have problem with npc's i'll try sell 100 black pearl on trade of npc system but i cant sell anything of pearls , i have this problem with all npc whose use script :default.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

npcHandler:addModule(FocusModule:new())

Anybody can help me??
 
here it is:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Hanna" script="citizen.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="136" head="113" body="65" legs="0" feet="96" addons="2"/>
<parameters>
<parameter key="message_greet" value="Oh, please come in, |PLAYERNAME|. What do you need? Have a look at my wonderful offers in gems and jewellery."/>
<parameter key="message_farewell" value="Good bye."/>
<parameter key="module_keywords" value="1" />
<parameter key="keywords" value="job;" />
<parameter key="keyword_reply1" value="I am a jeweler. Maybe you want to have a look at my wonderful offers." />
<parameter key="module_shop" value="1"/>
<parameter key="shop_buyable" value="black pearl,2144,560;golden amulet,2130,6600;ruby necklace,2133,3560;small amethyst,2150,400;small diamond,2145,600;small sapphire,2146,500;wedding ring,2121,990;white pearl,2143,320;small ruby,2147,500;small emerald,2149,500;bronze goblet,5807,2000;golden goblet,5805,5000;silver goblet,5806,3000;" />
<parameter key="shop_sellable" value="black pearl,2144,280;giant shimmering pearl,7633,3000;giant shimmering pearl,7632,3000;small amethyst,2150,200;small diamond,2145,300;small sapphire,2146,250;white pearl,2143,160;small ruby,2147,250;small emerald,2149,250;" />
</parameters>
</npc>

but with other npc i have this same problem, when i want sell everything with all items, pearl, pieces and a lot of other items
 
oh sorry its my faults its citizen.lua:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

function onCreatureAppear(cid) npcHandler:eek:nCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:eek:nCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:eek:nCreatureSay(cid, type, msg) end
function onThink() npcHandler:eek:nThink() end

-- Storage IDs --
local citizen = 22227


local newaddon = 'Here you are, enjoy your brand new addon!'
local noitems = 'You do not have all the required items.'
local noitems2 = 'You do not have all the required items or you do not have the first addon, which by the way, is a requirement for this addon.'
local already = 'It seems you already have this addon, don\'t you try to mock me son!'

-- CITIZEN START --
function CitizenFirst(cid, message, keywords, parameters, node)

if(not npcHandler:isFocused(cid)) then
return false
end

if isPremium(cid) then
addon = getPlayerStorageValue(cid,citizen)
if addon == -1 then
if getPlayerItemCount(cid,5878) >= 100 then
if doPlayerRemoveItem(cid,5878,100) then
selfSay(newaddon)

doSendMagicEffect(getCreaturePosition(cid), 13)
doPlayerAddOutfit(cid, 128, 1)
doPlayerAddOutfit(cid, 136, 1)
setPlayerStorageValue(cid,citizen,1)
end
else
selfSay(noitems)
end
else
selfSay(already)
end
end

end

function CitizenSecond(cid, message, keywords, parameters, node)

if(not npcHandler:isFocused(cid)) then
return false
end

if isPremium(cid) then
addon = getPlayerStorageValue(cid,citizen+1)
if addon == -1 then
if getPlayerItemCount(cid,5890) >= 100 and getPlayerItemCount(cid,5902) >= 50 and getPlayerItemCount(cid,2480) >= 1 then
if doPlayerRemoveItem(cid,5890,100) and doPlayerRemoveItem(cid,5902,50) and doPlayerRemoveItem(cid,2480,1) then
selfSay(newaddon)

doSendMagicEffect(getCreaturePosition(cid), 13)
doPlayerAddOutfit(cid, 128, 2)
doPlayerAddOutfit(cid, 136, 2)
setPlayerStorageValue(cid,citizen+1,1)
end
else
selfSay(noitems)
end
else
selfSay(already)
end
end

end

keywordHandler:addKeyword({'addons'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can offer you first & second addons of the Citizen outfit."})
keywordHandler:addKeyword({'help'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "What you do is that you type 'first citizen addon' or 'second citizen addon'. Assuming that you already collected all the required pieces, say 'yes' and voíla - you got yourself an addon!"})

local node1 = keywordHandler:addKeyword({'first citizen addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To achieve the first citizen addon you need to give me 100 minotaur leathers. Do you have them with you?'})
node1:addChildKeyword({'yes'}, CitizenFirst, {npcHandler = npcHandler, onlyFocus = true, reset = true})
node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true})

local node2 = keywordHandler:addKeyword({'second citizen addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To achieve the first citizen addon you need to give me 100 chicken feathers, 50 honeycombs and a legion helmet. Do you have them with you?'})
node2:addChildKeyword({'yes'}, CitizenSecond, {npcHandler = npcHandler, onlyFocus = true, reset = true})
node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true})

npcHandler:addModule(FocusModule:new())

but in this i have this same problem in citizen.lua, default too
 
Strange, works for me (TFS 0.3.6pl1)

17:13 Sold 100x small sapphire for 25000 gold.
17:13 Sold 100x black pearl for 28000 gold.
 
Back
Top