Ir para conteúdo

Posts Recomendados

o Topico postado O Addon De Blessing foi este

<a href="http://www.xtibia.com/forum/index.php?showtopic=46229" target="_blank">http://www.xtibia.com/forum/index.php?showtopic=46229</a>

Postado Por ArcavieR

................

COmo ele TInha Dito

O npc Estava danduh Erro

Na Hora de COnferiR c o YPC Tinha Ou nao o Bless

Bom Dei Uma Arrumadinha

e Fiz Mais q ISsuh

Colokei Todos Os 5 Npc de Bless em apenas UM

e Em Vez De Falar o nome Do Bless Q eh um saco

Eh Soh falar Hi

bless1,bless2.bless3.bless4.bless5

ProNTUH

POde Reparar q na hora q vc falar bless1 ele Pergunta apra vc Voce ker emsmo comprar "nome do bless" por 20k?

Dah apra Ver Q n eh o MEsmo bless instalado

No Bugs Please xDDDD

 

Chega De COnvercar Vamos Ao Trabalho

em data/npc/script

abra qualquer .lua e adicione istuh (salve como todos.lua)

 

 

local keywordHandler = KeywordHandler:new()

local npcHandler = NpcHandler:new(keywordHandler)

NpcSystem.parseParameters(npcHandler)

 

-- OTServ event handling functions start

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

-- OTServ event handling functions end

 

function creatureSayCallback(cid, type, msg)

-- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.

if(npcHandler.focus ~= cid) then

return false

end

 

 

if msgcontains(msg, 'bless') then

selfSay('I sell the \"Spiritual Shielding\" Blessing.')

------------------------------------------------ bless ------------------------------------------------

elseif msgcontains(msg, 'bless1') or msgcontains(msg, 'spiritual shielding') then

if isPremium(cid) then

selfSay('Do you want to buy the Spiritual Shielding Blessing for 20k?')

talk_state = 1

else

selfSay('Sorry, you need a premium account to get bless.')

talk_state = 0

end

 

elseif msgcontains(msg, 'bless2') or msgcontains(msg, 'spark of the phoenix') then

if isPremium(cid) then

selfSay('Do you want to buy the Spark of the Phoenix Blessing for 20k?')

talk_state = 1

else

selfSay('Sorry, you need a premium account to get bless.')

talk_state = 0

end

 

elseif msgcontains(msg, 'bless3') or msgcontains(msg, 'embrace of tibia') then

if isPremium(cid) then

selfSay('Do you want to buy the Embrace of Tibia Blessing for 20k?')

talk_state = 1

else

selfSay('Sorry, you need a premium account to get bless.')

talk_state = 0

end

 

elseif msgcontains(msg, 'bless4') or msgcontains(msg, 'fire of the suns') then

if isPremium(cid) then

selfSay('Do you want to buy the Fire of the Suns Blessing for 20k?')

talk_state = 1

else

selfSay('Sorry, you need a premium account to get bless.')

talk_state = 0

end

 

elseif msgcontains(msg, 'bless5') or msgcontains(msg, 'wisdom of solitude') then

if isPremium(cid) then

selfSay('Do you want to buy the Wisdom of Solitude Blessing for 20k?')

talk_state = 1

else

selfSay('Sorry, you need a premium account to get bless.')

talk_state = 0

end

------------------------------------------------ confirm yes ------------------------------------------------

elseif msgcontains(msg, 'yes') and talk_state == 1 then

talk_state = 0

 

if doPlayerRemoveMoney(cid,20000) == 1 then

selfSay('Now the gods blessed you.')

doPlayerAddBlessing(cid,1)

else

selfSay('Sorry, you dont have enough money.')

end

 

elseif msgcontains(msg, 'yes') and talk_state == 1 then

talk_state = 0

 

if doPlayerRemoveMoney(cid,20000) == 1 then

selfSay('Now the gods blessed you.')

doPlayerAddBlessing(cid,2)

else

selfSay('Sorry, you dont have enough money.')

end

 

elseif msgcontains(msg, 'yes') and talk_state == 1 then

talk_state = 0

 

if doPlayerRemoveMoney(cid,20000) == 1 then

selfSay('Now the gods blessed you.')

doPlayerAddBlessing(cid,3)

else

selfSay('Sorry, you dont have enough money.')

end

 

elseif msgcontains(msg, 'yes') and talk_state == 1 then

talk_state = 0

 

if doPlayerRemoveMoney(cid,20000) == 1 then

selfSay('Now the gods blessed you.')

doPlayerAddBlessing(cid,4)

else

selfSay('Sorry, you dont have enough money.')

end

 

elseif msgcontains(msg, 'yes') and talk_state == 1 then

talk_state = 0

 

if doPlayerRemoveMoney(cid,20000) == 1 then

selfSay('Now the gods blessed you.')

doPlayerAddBlessing(cid,5)

else

selfSay('Sorry, you dont have enough money.')

end

------------------------------------------------ confirm no ------------------------------------------------

elseif msgcontains(msg, 'no') and (talk_state >= 1 and talk_state <= 2) then

selfSay('Ok then.')

talk_state = 0

end

-- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.

return true

end

 

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)

npcHandler:addModule(FocusModule:new())

 

agora em data/npc

abra qualquer xml lah com o bloko de notas e adicione isto(salve como Bless todos.xml)

 

 

<?xml version="1.0"?>

 

<npc name="Bless Todos" script="data/npc/scripts/todos.lua" access="1" lookdir="2">

<mana now="800" max="800"/>

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

<look type="266" head="114" body="113" legs="113" feet="113"/>

</npc>

 

Tah feiTo xD..C kISer Add o npc em seu Mapeditor

vai na pasta do mapeditor abra o xml creatures com o bloko de notas

e adicione estah linha

<creature looktype="266" name="Bless Todos" head="123" body="123" legs="123" feet="21" addons="3" type="npc"/>

 

FeiTo

 

Creditos 70% para o Arcavier POr Fazer O NPC

30% para mim por arrumar juntar Entre OUtras COisinhas q n tinha

Flws abrAco!

Editado por AOSIDoasiosadsa
Link para o comentário
Compartilhar em outros sites

  • 4 weeks later...

hehe vlw q BOm q v6 gostarraum x)

 

Kem Fez esse Npc Fui E

eu Sou o AOSidAOSDiOASID

Eh q eu mUdei De NiCk

BOm n tem nada V Neah

AOSDIAOSIdoaSD

FIK FeIU enTaum Fiz Essa AKi Vlws =**!

Editado por GuTOcS
Link para o comentário
Compartilhar em outros sites

  • 4 months later...
  • 2 weeks later...
×
×
  • Criar Novo...