[Pedido] Bless

alemao
Por alemao
em Lixeira Pública

alemao

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 15/10/05Posts: 13

Preciso de um npc bless, consegui esse aqui mas ele está configurado so para premium...ja tentei colocar no config lua que nao precisa de premium mas nao adianta!

 

Alguem sabe tirar premium dele?

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 buyBlessing(cid, message, keywords, parameters, node)

if(not npcHandler:isFocused(cid)) then

return false

end

 

if getPlayerBlessing(cid, parameters.blessing) then

npcHandler:say("A god has already blessed you with this blessing.", cid)

elseif isPremium(cid) == TRUE then

if doPlayerRemoveMoney(cid, 10000) == TRUE then

doPlayerAddBlessing(cid, parameters.blessing)

npcHandler:say("You have been blessed by one of the five gods!", cid)

else

npcHandler:say("You don't have enough money.", cid)

end

else

npcHandler:say("You need a premium account to buy blessings.", cid)

end

 

keywordHandler:moveUp(1)

return true

end

 

local node1 = keywordHandler:addKeyword({'first bless'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to buy the first blessing for 10000 gold coins?'})

node1:addChildKeyword({'yes'}, buyBlessing, {blessing = 1})

node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, moveup = 1, text = 'Then not.'})

 

local node2 = keywordHandler:addKeyword({'second bless'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to buy the second blessing for 10000 gold coins?'})

node2:addChildKeyword({'yes'}, buyBlessing, {blessing = 2})

node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, moveup = 1, text = 'Then not.'})

 

local node3 = keywordHandler:addKeyword({'third bless'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to buy the third blessing for 10000 gold coins?'})

node3:addChildKeyword({'yes'}, buyBlessing, {blessing = 3})

node3:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, moveup = 1, text = 'Then not.'})

 

local node4 = keywordHandler:addKeyword({'fourth bless'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to buy the fourth blessing for 10000 gold coins?'})

node4:addChildKeyword({'yes'}, buyBlessing, {blessing = 4})

node4:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, moveup = 1, text = 'Then not.'})

 

local node5 = keywordHandler:addKeyword({'fifth bless'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to buy the fifth blessing for 10000 gold coins?'})

node5:addChildKeyword({'yes'}, buyBlessing, {blessing = 5})

node5:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, moveup = 1, text = 'Then not.'})

 

keywordHandler:addKeyword({'blessing'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can provide you with five blessings... the 'first bless', 'second bless', 'third bless', 'fourth bless' and the 'fifth bless', they cost 10000 gold coins each."})

keywordHandler:addKeyword({'blessings'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can provide you with five blessings... the 'first bless', 'second bless', 'third bless', 'fourth bless' and the 'fifth bless', they cost 10000 gold coins each."})

keywordHandler:addKeyword({'offer'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can provide you with five blessings... the 'first bless', 'second bless', 'third bless', 'fourth bless' and the 'fifth bless', they cost 10000 gold coins each."})

keywordHandler:addKeyword({'help'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can provide you with five blessings... the 'first bless', 'second bless', 'third bless', 'fourth bless' and the 'fifth bless', they cost 10000 gold coins each."})

 

npcHandler:addModule(FocusModule:new())

 

Se alguem tiver outro npc melhor de bless se possivel traduzido pode ser tambem

Obrigado!

joaohd

Neox Boy
avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 03/02/09Posts: 361Char no Tibia: Fearless Man

Tente este:

 

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 buyBlessing(cid, message, keywords, parameters, node)
if(not npcHandler:isFocused(cid)) then
return false
end

if getPlayerBlessing(cid, parameters.blessing) then
npcHandler:say("A god has already blessed you with this blessing.", cid)
end

if doPlayerRemoveMoney(cid, 10000)  then
doPlayerAddBlessing(cid, parameters.blessing)
npcHandler:say("You have been blessed by one of the five gods!", cid)
else
npcHandler:say("You don't have enough money.", cid)
end

keywordHandler:moveUp(1)
return true
end

local node1 = keywordHandler:addKeyword({'first bless'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to buy the first blessing for 10000 gold coins?'})
node1:addChildKeyword({'yes'}, buyBlessing, {blessing = 1})
node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, moveup = 1, text = 'Then not.'})

local node2 = keywordHandler:addKeyword({'second bless'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to buy the second blessing for 10000 gold coins?'})
node2:addChildKeyword({'yes'}, buyBlessing, {blessing = 2})
node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, moveup = 1, text = 'Then not.'})

local node3 = keywordHandler:addKeyword({'third bless'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to buy the third blessing for 10000 gold coins?'})
node3:addChildKeyword({'yes'}, buyBlessing, {blessing = 3})
node3:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, moveup = 1, text = 'Then not.'})

local node4 = keywordHandler:addKeyword({'fourth bless'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to buy the fourth blessing for 10000 gold coins?'})
node4:addChildKeyword({'yes'}, buyBlessing, {blessing = 4})
node4:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, moveup = 1, text = 'Then not.'})

local node5 = keywordHandler:addKeyword({'fifth bless'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to buy the fifth blessing for 10000 gold coins?'})
node5:addChildKeyword({'yes'}, buyBlessing, {blessing = 5})
node5:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, moveup = 1, text = 'Then not.'})

keywordHandler:addKeyword({'blessing'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can provide you with five blessings... the 'first bless', 'second bless', 'third bless', 'fourth bless' and the 'fifth bless', they cost 10000 gold coins each."})
keywordHandler:addKeyword({'blessings'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can provide you with five blessings... the 'first bless', 'second bless', 'third bless', 'fourth bless' and the 'fifth bless', they cost 10000 gold coins each."})
keywordHandler:addKeyword({'offer'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can provide you with five blessings... the 'first bless', 'second bless', 'third bless', 'fourth bless' and the 'fifth bless', they cost 10000 gold coins each."})
keywordHandler:addKeyword({'help'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can provide you with five blessings... the 'first bless', 'second bless', 'third bless', 'fourth bless' and the 'fifth bless', they cost 10000 gold coins each."})

npcHandler:addModule(FocusModule:new())

 

 

flw

alemao

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 15/10/05Posts: 13

Funcionou porem...

7:22 Queen Eloise: Do you want to buy the third blessing for 10000 gold coins?

17:22 GOD Trinity [9999]: yes

17:22 Queen Eloise: You have been blessed by one of the five gods!

17:22 GOD Trinity [9999]: third bless

17:22 Queen Eloise: Do you want to buy the third blessing for 10000 gold coins?

17:22 GOD Trinity [9999]: yes

17:22 Queen Eloise: A god has already blessed you with this blessing.

17:22 Queen Eloise: You have been blessed by one of the five gods!

17:22 GOD Trinity [9999]: third bless

17:22 Queen Eloise: Do you want to buy the third blessing for 10000 gold coins?

17:22 GOD Trinity [9999]: yes

17:22 Queen Eloise: A god has already blessed you with this blessing.

17:22 Queen Eloise: You have been blessed by one of the five gods!

 

Sera que ta funcionando? parece ke ele nao ta abencoando realmente pq ela repete You have been blessed by one of the five gods!

pegarapa

King Scripting
avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 27/08/10Posts: 29Char no Tibia: Lordizinha

É carinha acho que nao esta funfando , vou tentar editar e disponizalo para você !

3008a432f49d41d7913db942e1f7bae9.0.gif

 

É meu fan , use minha FAN BAR ↓ .

 

peegarapafanpng.png

 

 

 

<~~~Scripter~~~>

 

 

Metas:

[X]5 Posts (Aprendiz)

[X]25 Posts (Mago)

[ ]50 Posts (Sacerdote)

[ ]75 Posts (Necromancer)

[ ]100 Posts (Dracomancer)

[ ]125 Posts (Embaixador)

[ ]150 Posts (Lorde)

[ ]175 Posts (Rei)

[ ]200 Posts (Semi-Deus)

[ ]225 Posts (Deus)

[ ]250 Posts (Deus dos Deuses)

[ ]500 Posts (Sou Demais)

Sinos

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 26/03/06Posts: 11Char no Tibia: Knight Behe Soul -- Lost

Mano, não sei se vai funfar legal, mas tenta esse aqui:

 

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

 

 

local node1 = keywordHandler:addKeyword({'first bless'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to buy the first blessing for 2000 (plus level depending amount) gold?'})

node1:addChildKeyword({'yes'}, StdModule.bless, {npcHandler = npcHandler, number = 1, 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({'second bless'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to buy the second blessing for 2000 (plus level depending amount) gold?'})

node2:addChildKeyword({'yes'}, StdModule.bless, {npcHandler = npcHandler, number = 2, 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({'third bless'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to buy the third blessing for 2000 (plus level depending amount) gold?'})

node3:addChildKeyword({'yes'}, StdModule.bless, {npcHandler = npcHandler, number = 3, 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({'fourth bless'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to buy the fourth blessing for 2000 (plus level depending amount) gold?'})

node4:addChildKeyword({'yes'}, StdModule.bless, {npcHandler = npcHandler, number = 4, 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({'fifth bless'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to buy the fifth blessing for 2000 (plus level depending amount) gold?'})

node5:addChildKeyword({'yes'}, StdModule.bless, {npcHandler = npcHandler, number = 5, baseCost = 2000, levelCost = 200, startLevel = 30, endLevel = 120})

node5:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Too expensive, eh?'})

 

 

npcHandler:addModule(FocusModule:new())

 

Flw

:worriedsmiley:

SERVIDOR 100% DEDICADO:

 

amafia.jpg

 

Entrem Logo e se Divirta!!! ----- SERVIDOR EM MANUTENÇÃO