Ir para conteúdo

[Pedido] Npc Ou Action Ou Talkaction De Bless


exevogranmasvis

Posts Recomendados

Tipo do script: Actions, Npc ou Talkaction

Protocolo (versão do Tibia):8.1

Servidor utilizado: Aries 0.4.0

Nível de experiência: Intermediário

Adicionais/Informações:

 

 

Então, boa tarde eu estou com 1 problema,

eu tenho esssa versao do aries que não consigo de jeito nenhum achar 1 script que pege no meu otserv,

1 de vcs poderiam me dar 1 luz, não queria muda de ot, poiz ja mexi bastante dele :|

 

 

 

 

Atenciosamente

Masvis ¬¬

 

Link para o comentário
Compartilhar em outros sites

tenta

 

function onSay(cid, words, param)

local price = 50000

for a = 1,5 do
if getPlayerBlessing(cid, a) then
return doPlayerSendCancel(cid,'You have already got one or more blessings!')
elseif doPlayerRemoveMoney(cid, price) == FALSE then
return doPlayerSendCancel(cid, 'You need '..price..' gold coins to get blessed!')
end
doPlayerAddBlessing(cid,a)
return doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE, 'You have been blessed by the gods!')
end
return TRUE
end

Link para o comentário
Compartilhar em outros sites

  • 2 weeks later...

Este NPC vem junto com um ot aqui q baixei, testa ele:

 

Blesser Man.XML

<npc name="Blesser Man" script="data/npc/scripts/bless.lua" floorchange="0" walkinterval="25" access="5" level="1" maglevel="1">

<health now="150" max="150"/>

<look type="152" head="114" body="114" legs="0" feet="0" addons="3"/>

<parameters>

<parameter key="message_greet" value="Hello |PLAYERNAME|. Eu vendo 5 Bless fale: First Bless ...." />

</parameters>

</npc>

 

e o 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

 

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, 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({'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, 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({'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, 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({'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, 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({'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, 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?'})

 

npcHandler:addModule(FocusModule:new())

 

Espero ter ajudado.

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...