ZI

Todas As Potions Funcionando E Comprando

Por zimbituba, 11 de mar. de 2008 em Tutoriais de Scripting

otserv
tibia
script
20
6.3k
zimbitubaZ
11 de março de 2008 às 03:15

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 )

coritaC
11 de março de 2008 às 17:04

Bem olha so..

 

esse tutorial esta legal sim..

 

mas..

 

ja existem muitos " parecidos "....

 

=/

 

não sei se será aprovado

Teres*

vini_xxeV
11 de março de 2008 às 19:18

Concordo com o McTeres

Eh muito parecido com outros tutoriais

mas se foi você quem o fes

na minha opinião está aprovado

11 de março de 2008 às 21:08

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

JvchequerJ
12 de março de 2008 às 06:04

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

 

Aprovado

zimbitubaZ
12 de março de 2008 às 16:52

ufa...

pensei quenao iam gostar ^^

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

Editado Março 12 por Shynzo

OrLokoO
17 de março de 2008 às 19:07

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 !

MarcolinoGODM
19 de março de 2008 às 14:27
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...

zimbitubaZ
22 de março de 2008 às 11:38

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

3 meses depois...
lucasjockeyL
24 de junho de 2008 às 19:16
"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

BillyBolaB
27 de junho de 2008 às 17:18

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

1 mês depois...
jhoexxJ
24 de julho de 2008 às 18:05

meu nao funciono @@

 

ele tipo funciono mas nao aparece as potion...

jhoexxJ
25 de julho de 2008 às 00:32

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

 

onde consigo ? ;x

mcnymrM
25 de julho de 2008 às 20:04

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

Otimo

 

Muito bom cara você tá de parabens =]

1 mês depois...
fdpinhoF
16 de agosto de 2008 às 07:07

Vlw man

Bom trabalho