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
function buyAssassinOutfit(cid, message, keywords, parameters, node)
if(not npcHandler:isFocused(cid)) then
return false
end
local cost = parameters.cost
local premium = (parameters.premium ~= nil and parameters.premium)
if getPlayerStorageValue(cid, 35000 + parameters.looktypeFemale) == -1 and getPlayerStorageValue(cid, 35000 + parameters.looktypeFemale) == -1 then
if isPlayerPremiumCallback == nil or (isPlayerPremiumCallback(cid) and premium) then
if doPlayerRemoveMoney(cid, cost) == TRUE then
if getPlayerSex(cid) == 0 then
setPlayerStorageValue(cid, 35000 + parameters.looktypeFemale, 1)
else
setPlayerStorageValue(cid, 35000 + parameters.looktypeMale, 1)
end
npcHandler:say('There you go, you may use the assassin outfit now!', cid)
else
npcHandler:say('Sorry, you do not have enough money.', cid)
end
else
npcHandler:say('I only serve customers with premium accounts.', cid)
end
else
npcHandler:say('You already have the assassin outfit.', cid)
end
keywordHandler:moveUp(1)
return true
end
local node1 = keywordHandler:addKeyword({'assassin'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to buy the assassin outfit for 10000 gold coins?'})
node1:addChildKeyword({'yes'}, buyAssassinOutfit, {looktypeFemale = 156, looktypeMale = 152, cost = 10000, premium = true})
node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, moveup = 1, text = 'Too expensive, eh?'})
keywordHandler:addKeyword({'outfit'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can sell you the assassin outfit.'})
npcHandler:addModule(FocusModule:new())