Todas As Potions Funcionando E Comprando

zimbituba
em Tutoriais de Scripting
  • 1
  • 2

zimbituba

Crystal Server Founder
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 19/01/08Posts: 704Char no Tibia: Atera Knight

Ai galera, procurei no forum mas não achei nenhuma das Novas Potions, criadas pela CipSoft na atual versão do Tibia (8.1).

Peguei da Versão Aries 0.4 (créditos Equip Aries), só estou passando a vocês.

 

Agora vou ensinar vocês a criarem as 6 Novas Potions:

-Great Health Pot

-Great Mana Pot

-Strong Health Pot

-Strong Mana Pot

-Health Pot

-Mana Pot

 

1º Passo - Criar as actions

 

Vá em data/actions/scripts, copie um arquivo lua qualquer renomeie para Potions.lua e apague tudo de dentro e bote isto:

 

 

local strongHealthPot = 7588
local strongManaPot = 7589
local healthPot = 7618
local manaPot = 7620
local greatEmptyPot = 7635
local strongEmptyPot = 7634
local emptyPot = 7636
function onUse(cid, item, frompos, item2, topos)
if(exhaust(cid, storevalue, exhausttime) == 1) then
if(item.itemid == healthPot) then
doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
if(doTargetCombatHealth(0, cid, COMBAT_HEALING, 150, 210, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
return FALSE
end
doTransformItem(item.uid, emptyPot)
elseif(item.itemid == manaPot) then
doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
if(doTargetCombatMana(0, cid, 70, 110, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
return FALSE
end
doTransformItem(item.uid, emptyPot)
elseif(item.itemid == strongHealthPot) then
doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
if(doTargetCombatHealth(0, cid, COMBAT_HEALING, 320, 420, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
return FALSE
end
doTransformItem(item.uid, strongEmptyPot)
elseif(item.itemid == strongManaPot) then
doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
if(doTargetCombatMana(0, cid, 150, 220, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
return FALSE
end
doTransformItem(item.uid, strongEmptyPot)
elseif(item.itemid == greatHealthPot) then
doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
if(doTargetCombatHealth(0, cid, COMBAT_HEALING, 500, 650, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
return FALSE
end
doTransformItem(item.uid, greatEmptyPot)
elseif(item.itemid == greatManaPot) then
doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
if(doTargetCombatMana(0, cid, 250, 320, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
return FALSE
end
doTransformItem(item.uid, greatEmptyPot)
end
else
doPlayerSendCancel(cid, "You are exhausted.")
doSendMagicEffect(frompos, 2)
end

return TRUE
end

 

 

 

Onde você pode editar eles:

 

if(doTargetCombatHealth(0, cid, COMBAT_HEALING, 170, 230, CONST_ME_MAGIC_BLUE)
if(doTargetCombatMana(0, cid, [color="#FF0000"]170[/color], [color="#FF0000"]230[/color], CONST_ME_MAGIC_BLUE)
if(doTargetCombatHealth(0, cid, COMBAT_HEALING, [color="#FF0000"]300[/color], [color="#FF0000"]500[/color], CONST_ME_MAGIC_BLUE)
if(doTargetCombatMana(0, cid, [color="#FF0000"]300[/color], [color="#FF0000"]500[/color], CONST_ME_MAGIC_BLUE)
if(doTargetCombatHealth(0, cid, COMBAT_HEALING, [color="#FF0000"]500[/color], [color="#FF0000"]800[/color], CONST_ME_MAGIC_BLUE)
if(doTargetCombatMana(0, cid, [color="#FF0000"]500[/color], [color="#FF0000"]800[/color], CONST_ME_MAGIC_BLUE)

 

 

Onde ta escrito em vermelho é onde você arruma o quanto de HP ou Mana ele vai recuperar.

 

2º Passo - Ligar as actions àos itens (potions)

 

Vá na pasta actions/actions.xml, abrá-o como bloco de notas e adicione isto:

 

<!-- Potions --> 
<action itemid="7588" script="potions.lua" /> 
<action itemid="7589" script="potions.lua" /> 
<action itemid="7590" script="potions.lua" /> 
<action itemid="7591" script="potions.lua" /> 
<action itemid="7618" script="potions.lua" /> 
<action itemid="7620" script="potions.lua" />

 

 

Isso são as actions de cada um das Novas Potions.

 

E agora adicionando elas no items.xml para aqueles que não tem. Abra o Items.xml e adicione isto:

 

 

<item id="7620" article="a" name="mana potion">
	<attribute key="weight" value="180"/>
<item id="7618" article="a" name="health potion">
	<attribute key="weight" value="180"/>
</item>
<item id="7588" article="a" name="strong health potion">
	<attribute key="weight" value="200"/>
	<attribute key="description" value="This potion can only be consumed by paladins and knights of level 80 or higher."/>
</item>
<item id="7589" article="a" name="strong mana potion">
	<attribute key="weight" value="200"/>
	<attribute key="description" value="This potion can only be consumed by sorcerers, druids and paladins of level 50 or higher."/>
</item>
<item id="7590" article="a" name="great mana potion">
	<attribute key="weight" value="220"/>
	<attribute key="description" value="This potion can only be consumed by sorcerers and druids of level 80 or higher."/>
</item>
<item id="7591" article="a" name="great health potion">
	<attribute key="weight" value="220"/>
	<attribute key="description" value="This potion can only be consumed by sorcerers and druids of level 80 or higher."/>
</item>

 

 

 

 

Pronto, estão adicionadas no items.xml

 

As Novas Potoins ja estão criadas! Agora vamos bota no NPC para poder vender elas.

 

3º Passo - Colocando o npc para vende-las

 

Abra a pasta npc/scripts/seller.lua(não nescessáriamente deve ser o Seller, você bota no npc que quiser!), então abra o npc que deseja vender e adicione isto:

 

 

local focus = 0
local talk_start = 0
local target = 0
local following = false
local attacking = false

function onThingMove(creature, thing, oldpos, oldstackpos)

end


function onCreatureAppear(creature)

end


function onCreatureDisappear(cid, pos)
 	if focus == cid then
         selfSay('Good bye then.')
         focus = 0
         talk_start = 0
 	end
end


function onCreatureTurn(creature)

end


function msgcontains(txt, str)
 	return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))
end


function onCreatureSay(cid, type, msg)
 	msg = string.lower(msg)

 	if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then
 		selfSay('Hello, ' .. creatureGetName(cid) .. '! I sell ropes (50gp), shovels (20gp), backpacks (10gp), manafluids (100gp), lifefluids (60gp), health pot (150gp), mana pot (100gp), stronghealth pot (300gp), greathealth pot (500gp), greatmana pot (450gp), strongmana pot (250gp), fishing rods (100gp), amulet of loss (10k), and torches (2gp). I buy vials (10gp).')
 		focus = cid
 		talk_start = os.clock()

 	elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
 		selfSay('Sorry, ' .. creatureGetName(cid) .. '! I talk to you in a minute.')

elseif focus == cid then
	talk_start = os.clock()

	if msgcontains(msg, 'shovel') then
		buy(cid,2554,getCount(msg),20)
	elseif msgcontains(msg, 'backpack') then
		buy(cid,1988,getCount(msg),10)
	elseif msgcontains(msg, 'rope') then
		buy(cid,2120,getCount(msg),40)
	elseif msgcontains(msg, 'manafluid') or msgcontains(msg, 'mana fluid') then
		buyFluidContainer(cid,2006,getCount(msg),100,7)
	elseif msgcontains(msg, 'lifefluid') or msgcontains(msg, 'life fluid') then
		buyFluidContainer(cid,2006,getCount(msg),60,10)
	elseif msgcontains(msg, 'fishing rod') then
		buy(cid,2580,getCount(msg),100)
	elseif msgcontains(msg, 'torch') then
		buy(cid,2050,getCount(msg),2)
	elseif msgcontains(msg, 'aol') then
		buy(cid,2173,getCount(msg),10000)	
	elseif msgcontains(msg, 'vial') or msgcontains(msg, 'flask') then
		sell(cid,2006,getCount(msg),10)
	elseif msgcontains(msg, 'mana potion') or msgcontains(msg, 'mp') then
		buy(cid,7620,getCount(msg),100)
	elseif msgcontains(msg, 'health potion') or msgcontains(msg, 'hp') then
		buy(cid,7618,getCount(msg),150)
	elseif msgcontains(msg, 'strongmana potion') or msgcontains(msg, 'smp') then
		buy(cid,7589,getCount(msg),250)
	elseif msgcontains(msg, 'stronghealth potion') or msgcontains(msg, 'shp') then
		buy(cid,7588,getCount(msg),300)
	elseif msgcontains(msg, 'greatmana potion') or msgcontains(msg, 'gmp') then
		buy(cid,7590,getCount(msg),400)
	elseif msgcontains(msg, 'greathealth potion') or msgcontains(msg, 'ghp') then
		buy(cid,7591,getCount(msg),500)

	elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
		selfSay('Good bye, ' .. creatureGetName(cid) .. '!')
		focus = 0
		talk_start = 0
	end
end
end


function onCreatureChangeOutfit(creature)

end


function onThink()
 	if (os.clock() - talk_start) > 30 then
 		if focus > 0 then
 			selfSay('Next Please...')
 		end
 			focus = 0
 	end
	if focus ~= 0 then
		if getDistanceToCreature(focus) > 5 then
			selfSay('Good bye then.')
			focus = 0
		end
	end
end

 

 

 

Pronto terminei espero que gostem :bigsmile:

 

 

 

Créditos 50% a mim por criar as potions ( shynzo )

e 50 % ao meu amigo Zikpeta por aolocalas no npc( não é do Xtibia )

If you would like to thank me for my Crystal Server and others, feel free to donate.
Paypal: shynzomapper@hotmail.com

corita

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 09/03/08Posts: 24Char no Tibia: Paladinu Das Estrelas

Bem olha so..

 

esse tutorial esta legal sim..

 

mas..

 

ja existem muitos " parecidos "....

 

=/

 

não sei se será aprovado

Teres*

Melhor Naum..
Piorr Naum...
Diferente Naum..


Apenas eu e nada mas ..




----------------------------------------------------------

Meu Time De Coraçao!

Meu Time De Coraçao!





--------------------------------------------------------------

Frases Para Ela =* ( Não seja curioso )


É mais fácil uma estrela cair do céu com o vento, do que você sair do meu pensamento.

Outra?


Você não morre quando deixa de viver, mas sim quando deixa de amar

=P


Fan meu? Use..

vini_xxe

avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 03/11/06Posts: 260

Concordo com o McTeres

Eh muito parecido com outros tutoriais

mas se foi você quem o fes

na minha opinião está aprovado

Bem na moral galera
Enquanto vocês ficam ae preocupados com uns OT SERVER
com um joguinho MEDIOCRE que nao leva a NADA
A vida ta passando
Comecei a jogar de brincadeira, quando me dei conta
4 ANOS se passaram, e ai, oq eu ganhei?
Perdi muitas minas, perdi muitas festas, muitos jogos :S
PAREI, PEGO GERAL, TO EM TODAS AS FESTAS
Fiquem ae jogando NERDS
Que eu vo vive minha vida
@@@@@@@@@@@@@@@@@@@@@@@@@@@@;

TIBIA, UM JOGO QUE VICIA, E EH PIOR QUE ALCOOL
NAO MATA A PESSOA
SOH ACABA COM SEU CONVIVIO SOCIAL
VOCE DEIXA SUA MAE LA SOZINHA PRA PEGA UM SKILL DE SWORD
WTF?
VC NAO SAI COM A GALERA PRA PEGA MINA, PQ TEM Q UPA --"
NERD !@;

maximusot

avatar
Barão
Barão

INFOS

Grupo: BarãoRegistrado: 05/03/07Posts: 219

O skulls já fez um bem mais organizado (só não tem a parte do npc), mas mesmo assim que aprovo.



CLIQUE AKI DEPOIS CLIQUE NO CLICK AQUI DA SEGUNDA LINHA NÃO DEMORA NEM 1 MINUTO


MINHAS METAS

~~~~~~~~~~~~~~
~~
MINHAS METAS~~
~~~~~~~~~~~~~~


1 post (X)
10 posts (X)
20 posts (X)
30 posts (X)
40 posts (X)
50 posts (X)
60 posts (X)
70 posts (X)
80 posts (X)
90 posts (X)
100 posts (X)
120 posts (X)
150 posts (X)
200 posts (X)
300 posts (X)
400 posts (X)
500 posts (X)
600 posts (X)
700 posts (X)
800 posts (_)
900 posts (_)
1000 potsts (_)
1300 posts (_)
1500 posts (_)
1800 posts (_)
2000 posts (_)
----------------------------------------------------

MEUS TRABALHOS

Jvchequer

"Veni, vidi, vici."
avatar
Lenda
Lenda

INFOS

Grupo: LendaRegistrado: 10/10/05Posts: 2161Char no Tibia: Master Chequer

Mesmo com o mesmo intuito, são tutoriais diferentes, portanto.

 

Aprovado

1271330714-U1306.gif

 

~ Fiz parte da Equipe Xtibia em um tempo que Tibia era minha família. Saudades de todos vocês.

zimbituba

Crystal Server Founder
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 19/01/08Posts: 704Char no Tibia: Atera Knight

ufa...

pensei quenao iam gostar ^^

mais vlw pelos coments, se mais alguem tiver duvidas post aqui

If you would like to thank me for my Crystal Server and others, feel free to donate.
Paypal: shynzomapper@hotmail.com

OrLoko

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 08/12/05Posts: 12

antes de aprovar alguma coisa teste-os !

os numeros fornecidos estao claramente invalidos !

esses itens nao existem como vai funcionar ?? -.-

testei em 8.0 nao funfo !





By OrLoko.

MarcolinoGOD

Byte que eu gosto! (TI na veia)
avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 19/06/07Posts: 267Gênero: MasculinoChar no Tibia: Rambocop Infernus
antes de aprovar alguma coisa teste-os !

os numeros fornecidos estao claramente invalidos !

esses itens nao existem como vai funcionar ?? -.-

testei em 8.0 nao funfo !

 

Não sei se você notou mais ele disse claramente:

"Ai galera, procurei no forum mas não achei nenhuma das Novas Potions, criadas pela CipSoft na atual versão do Tibia (8.1)."

Tibia 8.1 e acho que isto explica tudo!

Leia bem antes de postar!

 

@Topic

Esse ai ta bem configurado?

Tipo, oque eu tenho aqui eu uso

ele no chão e aparece "Ahh..." como se

eu tivesse usado em mim mesmo e

não fica o liquido no chão!

 

Sem mais...

--

zimbituba

Crystal Server Founder
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 19/01/08Posts: 704Char no Tibia: Atera Knight

sim está, pq há o npc de vendas e muitos não colocam

If you would like to thank me for my Crystal Server and others, feel free to donate.
Paypal: shynzomapper@hotmail.com

lucasjockey

avatar
Artesão
Artesão

INFOS

Grupo: ArtesãoRegistrado: 30/07/07Posts: 101
"2º Passo - Ligar as actions àos itens (potions)"

 

Da onde já se viu "ÀOS"? Crase não vai antes de palavra masculina e ainda você junta: AO (masculina) com À (feminina).

 

Espero ter ajudado xD.

 

A, e bom tutorial ;D

x[sup]2[/sup]=-1
x=i
:D

BillyBola

Ex-Imprensa XTibia
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 08/06/08Posts: 676Char no Tibia: Kimera De Pegasus

esse eu coloco no meu xD e dificil ot com novos potion

jhoexx

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 01/06/07Posts: 6

meu nao funciono @@

 

ele tipo funciono mas nao aparece as potion...

jhoexx

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 01/06/07Posts: 6

nao to consegindo...acho q preciso atualiza o items.otb

 

onde consigo ? ;x

mcnymr

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 01/10/06Posts: 1

Nossa minhas potions só começou a funcionar depois que vi este scrip.

Otimo

 

Muito bom cara você tá de parabens =]

fdpinho

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 06/10/07Posts: 19

Vlw man

Bom trabalho

  • 1
  • 2