Gabriel Tibiano
New Member
- Joined
- Nov 21, 2009
- Messages
- 420
- Reaction score
- 4
Hello guys, can anyone do/explain how to do that
in my Bless NPC script?
in my Bless NPC script?
11737 = Phoenix's Egg
LUA:
if getPlayerItemCount(cid, 11737) >= 1 then
and then Player have to pay a half Bless?
LUA:
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
-- ADD Information --
function inquibless(cid, message, keywords, parameters, node)
if(not npcHandler:isFocused(cid)) then
return false
end
if getPlayerMoney(cid) >= 120000 and not getPlayerBlessing(cid, 1) then
if getPlayerStorageValue(cid, 13444) >= 1 then
doPlayerAddBlessing(cid, 1)
doPlayerAddBlessing(cid, 2)
doPlayerAddBlessing(cid, 3)
doPlayerAddBlessing(cid, 4)
doPlayerAddBlessing(cid, 5)
doPlayerRemoveMoney(cid, 120000)
npcHandler:say("You have been blessed by five gods of Inquisitor\'s Blessing!", cid)
doSendMagicEffect(getCreaturePosition(cid), 49)
else
npcHandler:say('You can\'t receive Inquisitor\'s Blessing '..getCreatureName(cid)..'. It\'s only for Braver Warriors.', cid)
end
else
npcHandler:say("You don't have enough money for blessing.", cid)
end
end
local node1 = keywordHandler:addKeyword({'the spiritual shielding'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to buy \'{The Spiritual Shielding}\' Bless for 2000 gold ?(Plus level depending your Level).'})
node1:addChildKeyword({'yes'}, StdModule.bless, {npcHandler = npcHandler, number = 1, premium = true, baseCost = 2000, levelCost = 200, startLevel = 30, endLevel = 120})
node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Too expensive, eh?'})
local node2 = keywordHandler:addKeyword({'the embrace of tibia'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to buy \'{The Embrace of Tibia}\' Bless for 2000 gold ?(Plus level depending your Level).'})
node2:addChildKeyword({'yes'}, StdModule.bless, {npcHandler = npcHandler, number = 2, premium = true, baseCost = 2000, levelCost = 200, startLevel = 30, endLevel = 120})
node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Too expensive, eh?'})
local node3 = keywordHandler:addKeyword({'the fire of the suns'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to buy \'{The Fire of the Suns}\' Bless for 2000 gold ?(Plus level depending your Level).'})
node3:addChildKeyword({'yes'}, StdModule.bless, {npcHandler = npcHandler, number = 3, premium = true, baseCost = 2000, levelCost = 200, startLevel = 30, endLevel = 120})
node3:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Too expensive, eh?'})
local node4 = keywordHandler:addKeyword({'the wisdom of solitude'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to buy \'{The Wisdom of Solitude}\' Bless for 2000 gold ?(Plus level depending your Level).'})
node4:addChildKeyword({'yes'}, StdModule.bless, {npcHandler = npcHandler, number = 4, premium = true, baseCost = 2000, levelCost = 200, startLevel = 30, endLevel = 120})
node4:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Too expensive, eh?'})
local node5 = keywordHandler:addKeyword({'the spark of the phoenix'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to buy \'{The Spark of the Phoenix}\' Bless for 2000 gold ?(Plus level depending your Level).'})
node5:addChildKeyword({'yes'}, StdModule.bless, {npcHandler = npcHandler, number = 5, premium = true, baseCost = 2000, levelCost = 200, startLevel = 30, endLevel = 120})
node5:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Too expensive, eh?'})
local node6 = keywordHandler:addKeyword({'the inquisition blessing'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to acquire \'{The Inquisition}\' Blessing for 120000 gold coins?'})
node6:addChildKeyword({'yes'}, inquibless, {npcHandler = npcHandler, onlyFocus = true, reset = true})
node6:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Too expensive, eh?', reset = true})
npcHandler:addModule(FocusModule:new())
Last edited: