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

Solved Double spells NPC

medium

New Member
Joined
Nov 2, 2011
Messages
54
Reaction score
0
HI !

My npc sell me 2 x the same item as i check on trade.

NPC.xml :
Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Senzu Seller" script="data/npc/scripts/potion seller.lua" walkinterval="2000" floorchange="0">
<health now="150" max="150"/>
<look type="154"/>
<parameters>
<parameter key="message_greet" value="Hello |PLAYERNAME|. If need any heal item's, ask me for a trade."/>
      <parameter key="message_farewell" value="Good bye."/>
<parameter key="message_walkaway" value="Farewell then.." />
<parameter key="module_shop" value="1" />
<parameter key="shop_buyable" value="" />
</parameters>
</npc>

Poion seller.lua :

Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}

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({'senzu'}, 2673, 10000, 'senzu')

npcHandler:addModule(FocusModule:new())
 
Try removing those lines:
<parameter key="module_shop" value="1" /> <parameter key="shop_buyable" value="" />
 
Solved - >

Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Senzu Seller" script="senzu seller.lua" walkinterval="2000" floorchange="0">
    <health now="100" max="100"/>
    <look type="154"/>
    <parameters>
        <parameter key="module_shop" value="1"/>
        <parameter key="shop_buyable" value="senzu,2673,10000"/>
    </parameters>
</npc>
Senzu seller.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())
 
Back
Top