-- Greets a new player.
function NpcHandler:greet(cid)
if(cid ~= 0) then
local callback = self:getCallback(CALLBACK_GREET)
if(callback == nil or callback(cid)) then
if(self:processModuleCallback(CALLBACK_GREET, cid)) then
[B][COLOR="red"] if #self.shopItems ~= 0 then
openShopWindow(cid, self.shopItems,
function(cid, itemid, subType, amount, ignoreCap, inBackpacks)
self:onBuy(cid, itemid, subType, amount, ignoreCap, inBackpacks)
end,
function(cid, itemid, subType, amount, ignoreCap, inBackpacks)
self:onSell(cid, itemid, subType, amount, ignoreCap, inBackpacks)
end
)
end[/COLOR][/B]
local msg = self:getMessage(MESSAGE_GREET)
local parseInfo = { [TAG_PLAYERNAME] = getCreatureName(cid) }
msg = self:parseMessage(msg, parseInfo)
self:say(msg)
self:addFocus(cid)
self:say(msg, cid)
end
end
end
end