Kayan
Active Member
Hello i need this npc working for free accounts.
I have removed
and
But no working ;x
Anybody can fixe?
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
function creatureSayCallback(cid, type, msg)
--- TODO: bless function in modules.lua
if(npcHandler.focus ~= cid) then
return FALSE
end
if msgcontains(msg, 'blessing') or msgcontains(msg, 'blessings') or msgcontains(msg, 'help') or msgcontains(msg, 'offer') then
npcHandler:say("I can provide you with five blessings... the 'the spiritual shielding', 'the spark of the phoenix', 'the embrace of tibia', 'the fire of the suns' and the 'the wisdom of solitude', they cost 20000 gold coins each.")
talkState = 0
elseif msgcontains(msg, 'the spiritual shielding') then
npcHandler:say("Do you want to buy the first blessing for 20000 gold?")
talkState = 1
elseif msgcontains(msg, 'the spark of the phoenix') then
npcHandler:say("Do you want to buy the second blessing for 20000 gold?")
talkState = 2
elseif msgcontains(msg, 'the embrace of tibia') then
npcHandler:say("Do you want to buy the third blessing for 20000 gold?")
talkState = 3
elseif msgcontains(msg, 'the fire of the suns') then
npcHandler:say("Do you want to buy the fourth blessing for 20000 gold?")
talkState = 4
elseif msgcontains(msg, 'the wisdom of solitude') then
npcHandler:say("Do you want to buy the the wisdom of solitude blessing for 20000 gold?")
talkState = 5
elseif talkState > 0 then
if msgcontains(msg, 'yes') then
if getPlayerBlessing(cid, talkState) then
npcHandler:say("A god has already blessed you with this blessing.")
elseif isPremium(cid) == TRUE then
if doPlayerRemoveMoney(cid, 20000) == TRUE then
doPlayerAddBlessing(cid, talkState)
npcHandler:say("You have been blessed by one of the five gods!")
else
npcHandler:say("You don't have enough money.")
end
else
npcHandler:say("You need a premium account to buy blessings.")
end
talkState = 0
elseif msgcontains(msg, 'no') then
npcHandler:say("Then not.")
talkState = 0
end
end
return TRUE
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
I have removed
Code:
elseif isPremium(cid) == TRUE then
and
Code:
else
npcHandler:say("You need a premium account to buy blessings.")
end
But no working ;x
Anybody can fixe?