Ir para conteúdo

Perfects Potions 8.1 By Skulls V.1.1 (atualizado)


Skulls

Posts Recomendados

Pocoes 8.1.

 

Bem a pedido de um amigo criei poções 8.1 (health, strong health, great health, mana, strong mana, great mana.)

 

Então aí vai:

 

Primeiro Va na pasta actions/script, copie 6 vezes qualquer arquivo de lá e Renomeie-os para:

 

1ª Copia- Health Potion

2ª Copia- Strong Health Potion

3ª Copia- Great Health Potion

4ª Copia- Mana Potion

5ª Copia- Strong Mana Potion

6ª Copia-Great mana potion

 

Pronto, os arquivos estao criados agora vamos editá-los.

 

Abra o arquivo health Potion.lua e dentro dele cole:

 

-- Health potion By skulls

function onUse(cid, item, frompos, item2, topos)

playerpos = {x=topos.x, y=topos.y, z=topos.z, stackpos=253}     
player = getThingfromPos(playerpos)
ml = getPlayerMagLevel(cid)
lvl = getPlayerLevel(cid)
voc = getPlayerVocation(cid)
ex = getPlayerStorageValue(cid,4862)
r1 = math.random(100,300)

params = { [1]=cid, [2]=lvl, [3]=voc, [4]=ml } 

if item2.itemid == 1 then
	if item.itemid == 7636 then
		doPlayerSendCancel(cid,"It is empty.")
	else
		if item2.uid == cid then
								if ex == -1 then
									doPlayerAddHealth(cid,r1)
									doSendMagicEffect(playerpos,12)
									addEvent(ums,1000,params)
									setPlayerStorageValue(cid,4862, 1)
									doTransformItem(item.uid,7636)
									doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
								else
									doPlayerSendCancel(cid,'You are exhausted!')
									doSendMagicEffect(playerpos,2) 
								end                                    																		
		else
			splash = doCreateItem(1903,item.type,topos)
			doTransformItem(item.uid,7636)
			doDecayItem(splash)
		end																	
	end
else
 	if item.itemid == 7636 then
 		doPlayerSendCancel(cid,"It is empty.")
 	else
		splash = doCreateItem(1903,item.type,topos)
		doTransformItem(item.uid,7636)
		doDecayItem(splash)
 	end      
end 
return 1
end

function ums(params)	
 cid = params[1]
 setPlayerStorageValue(cid,4862, -1)	
end

 

Pronto, Sua Health Potion esta criada.

__

Agora Abra strong health potion.lua e cole isso dentro:

 

-- Strong Health potion By skulls

function onUse(cid, item, frompos, item2, topos)

playerpos = {x=topos.x, y=topos.y, z=topos.z, stackpos=253}     
player = getThingfromPos(playerpos)
ml = getPlayerMagLevel(cid)
lvl = getPlayerLevel(cid)
voc = getPlayerVocation(cid)
ex = getPlayerStorageValue(cid,4862)
r1 = math.random(200,600)

params = { [1]=cid, [2]=lvl, [3]=voc, [4]=ml } 

if item2.itemid == 1 then
	if item.itemid == 7634 then
		doPlayerSendCancel(cid,"It is empty.")
	else
		if item2.uid == cid then
					if lvl >= 50 then
						if voc == 4 or voc == 3 or voc == 7 or voc == 8 then
							if ex == -1 then
								doPlayerAddHealth(cid,r1)
								doSendMagicEffect(playerpos,12)
								addEvent(ums,1000,params)
								setPlayerStorageValue(cid,4862, 1)
								doTransformItem(item.uid,7634)
								doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
							else
								doPlayerSendCancel(cid,'You are exhausted!')
								doSendMagicEffect(playerpos,2) 
							end   
						else
							doPlayerSendCancel(cid, 'This potion can only be consumed by paladins and knights of level 50 or higher.') 
						end                                        
					else
						doPlayerSendCancel(cid,'This potion can only be consumed by paladins and knights of level 50 or higher.') 
					end																		
		else
			splash = doCreateItem(1903,item.type,topos)
			doTransformItem(item.uid,7634)
			doDecayItem(splash)
		end																	
	end
else
 	if item.itemid == 7634 then
 		doPlayerSendCancel(cid,"It is empty.")
 	else
		splash = doCreateItem(1903,item.type,topos)
		doTransformItem(item.uid,7634)
		doDecayItem(splash)
 	end      
end 
return 1
end

function ums(params)	
 cid = params[1]
 setPlayerStorageValue(cid,4862, -1)	
end

 

Pronto, Sua Strong Health Potion esta criada.

__

Agora abra o Great Health Potion.lua e cole isso dentro:

-- Great Health potion By skulls

function onUse(cid, item, frompos, item2, topos)

playerpos = {x=topos.x, y=topos.y, z=topos.z, stackpos=253}     
player = getThingfromPos(playerpos)
ml = getPlayerMagLevel(cid)
lvl = getPlayerLevel(cid)
voc = getPlayerVocation(cid)
ex = getPlayerStorageValue(cid,4862)
r1 = math.random(400,800)


params = { [1]=cid, [2]=lvl, [3]=voc, [4]=ml } 

if item2.itemid == 1 then
	if item.itemid == 7635 then
		doPlayerSendCancel(cid,"It is empty.")
	else
		if item2.uid == cid then
				if lvl >= 80 then
					if voc == 4 or voc == 8 then
							if ex == -1 then
								doPlayerAddHealth(cid,r1)
								doSendMagicEffect(playerpos,12)
								addEvent(ums,1000,params)
								setPlayerStorageValue(cid,4862, 1)
								doTransformItem(item.uid,7635)
								doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
							else
								doPlayerSendCancel(cid,'You are exhausted!')
								doSendMagicEffect(playerpos,2) 
							end
					else
						doPlayerSendCancel(cid, 'This potion can only be consumed by knights of level 80 or higher.')
					end                                        
				else
					doPlayerSendCancel(cid,'This potion can only be consumed by knights of level 80 or higher.')
				end																	
		else
			splash = doCreateItem(1903,item.type,topos)
			doTransformItem(item.uid,7635)
			doDecayItem(splash)
		end																	
	end
else
 	if item.itemid == 7635 then
 		doPlayerSendCancel(cid,"It is empty.")
 	else
		splash = doCreateItem(1903,item.type,topos)
		doTransformItem(item.uid,7635)
		doDecayItem(splash)
 	end      
end 
return 1
end

function ums(params)	
 cid = params[1]
 setPlayerStorageValue(cid,4862, -1)	
end

 

Pronto sua Great Health Potion está criada.

__

Agora abra o Mana Potion.lua e cole isso:

-- Mana potion By skulls

function onUse(cid, item, frompos, item2, topos)

playerpos = {x=topos.x, y=topos.y, z=topos.z, stackpos=253}     
player = getThingfromPos(playerpos)
ml = getPlayerMagLevel(cid)
lvl = getPlayerLevel(cid)
voc = getPlayerVocation(cid)
ex = getPlayerStorageValue(cid,4862)
r1 = math.random(50,150)

params = { [1]=cid, [2]=lvl, [3]=voc, [4]=ml } 

if item2.itemid == 1 then
	if item.itemid == 7636 then
		doPlayerSendCancel(cid,"It is empty.")
	else
		if item2.uid == cid then
							if ex == -1 then
								doPlayerAddMana(cid,r1)
								doSendMagicEffect(playerpos,12)
								addEvent(ums,1000,params)
								setPlayerStorageValue(cid,4862, 1)
								doTransformItem(item.uid,7636)
								doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
							else
								doPlayerSendCancel(cid,'You are exhausted!')
								doSendMagicEffect(playerpos,2) 
							end                                      																		
		else
			splash = doCreateItem(1903,item.type,topos)
			doTransformItem(item.uid,7636)
			doDecayItem(splash)
		end																	
	end
else
 	if item.itemid == 7636 then
 		doPlayerSendCancel(cid,"It is empty.")
 	else
		splash = doCreateItem(1903,item.type,topos)
		doTransformItem(item.uid,7636)
		doDecayItem(splash)
 	end      
end 
return 1
end

function ums(params)	
 cid = params[1]
 setPlayerStorageValue(cid,4862, -1)	
end

 

Mana potion criada.

__

Agora Abra Strong Mana potion.lua e cole isso dentro:

function onUse(cid, item, frompos, item2, topos)

playerpos = {x=topos.x, y=topos.y, z=topos.z, stackpos=253}     
player = getThingfromPos(playerpos)
ml = getPlayerMagLevel(cid)
lvl = getPlayerLevel(cid)
voc = getPlayerVocation(cid)
ex = getPlayerStorageValue(cid,4862)
r1 = math.random(100,300)

params = { [1]=cid, [2]=lvl, [3]=voc, [4]=ml } 

if item2.itemid == 1 then
	if item.itemid == 7634 then
		doPlayerSendCancel(cid,"It is empty.")
	else
		if item2.uid == cid then
				if lvl >= 50 then
						if voc == 1 or voc == 2 or voc == 3 or voc == 5 or voc == 6 or voc == 7 then
								if ex == -1 then
									doPlayerAddMana(cid,r1)
									doSendMagicEffect(playerpos,12)
									addEvent(ums,1000,params)
									setPlayerStorageValue(cid,4862, 1)
									doTransformItem(item.uid,7634)
									doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
								else
									doPlayerSendCancel(cid,'You are exhausted!')
									doSendMagicEffect(playerpos,2) 
								end
						else
							doPlayerSendCancel(cid, 'This potion can only be consumed by paladins, druids and sorcerers of level 50 or higher.') 
						end                                        
					else
						doPlayerSendCancel(cid,'This potion can only be consumed by paladins, druids and sorcerers of level 50 or higher.') 
					end																	
		else
			splash = doCreateItem(1903,item.type,topos)
			doTransformItem(item.uid,7634)
			doDecayItem(splash)
		end																	
	end
else
 	if item.itemid == 7634 then
 		doPlayerSendCancel(cid,"It is empty.")
 	else
		splash = doCreateItem(1903,item.type,topos)
		doTransformItem(item.uid,7634)
		doDecayItem(splash)
 	end      
end 
return 1
end

function ums(params)	
 cid = params[1]
 setPlayerStorageValue(cid,4862, -1)	
end

 

Sua Strong Mana Potion Esta Criada.

__

Agora abra o Great Mana Potion.lua e cole isso:

-- Great Mana potion By skulls

function onUse(cid, item, frompos, item2, topos)

playerpos = {x=topos.x, y=topos.y, z=topos.z, stackpos=253}     
player = getThingfromPos(playerpos)
ml = getPlayerMagLevel(cid)
lvl = getPlayerLevel(cid)
voc = getPlayerVocation(cid)
ex = getPlayerStorageValue(cid,4862)
r1 = math.random(150,450)


params = { [1]=cid, [2]=lvl, [3]=voc, [4]=ml } 

if item2.itemid == 1 then
	if item.itemid == 7635 then
		doPlayerSendCancel(cid,"It is empty.")
	else
		if item2.uid == cid then
				if lvl >= 80 then
						if voc == 1 or voc == 2 or voc == 5 or voc == 6 then
								if ex == -1 then
									doPlayerAddMana(cid,r1)
									doSendMagicEffect(playerpos,12)
									addEvent(ums,1000,params)
									setPlayerStorageValue(cid,4862, 1)
									doTransformItem(item.uid,7635)
									doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
								else
									doPlayerSendCancel(cid,'You are exhausted!')
									doSendMagicEffect(playerpos,2) 
								end
						else
							doPlayerSendCancel(cid, 'This potion can only be consumed by druids and sorcerers of level 80 or higher.') 
						end                                        
				else
					doPlayerSendCancel(cid,'This potion can only be consumed by druids and sorcerers of level 80 or higher.') 
				end															
		else
			splash = doCreateItem(1903,item.type,topos)
			doTransformItem(item.uid,7635)
			doDecayItem(splash)
		end																	
	end
else
 	if item.itemid == 7635 then
 		doPlayerSendCancel(cid,"It is empty.")
 	else
		splash = doCreateItem(1903,item.type,topos)
		doTransformItem(item.uid,7635)
		doDecayItem(splash)
 	end      
end 
return 1
end

function ums(params)	
 cid = params[1]
 setPlayerStorageValue(cid,4862, -1)	
end

 

Pronto Sua Great Mana Potion está criada.

Com todas as potions criadas só precisamos criar as tags.

Abra seu actions.xml e cole essa tag la:

 

--- Potions --

-- Life potions
<action itemid="7618" script="health potion.lua" /> 
<action itemid="7588" script="strong health potion.lua" /> 
<action itemid="7591" script="great health potion.lua" /> 
--- Mana potions
<action itemid="7620" script="mana potion.lua" />
<action itemid="7589" script="strong mana potion.lua" />
<action itemid="7590" script="great mana potion.lua" />

 

Pronto Suas Potions estao Prontas e Perfeitas.

 

 

 

Bom eu só tenho um detalhe a acrescentar:

Eu fiz essas Potions em ot 8.0 (so mudei o id dos "vials") então eu não tenho os id's dos "vials" vazios. Eu tive entao que usar o id do liquido (1=wather, 2=blood... 7=mana fluid). Nas manas Potion usei id do mana fluid, Mas na health potion eu usei o id do sangue (blood), entao pode ser que voce tenha que alterar o id do liquido de todas as health potions em: (if item.type == 2 then) e [doChangeTypeItem(item.uid,2] (é só substituir o numero 2 pelo id do life fluid, mas se eu nao me engano o id é sangue mesmo, e meu colega usou no ot 8.1 e funcionou direitinho.

 

Bom é isso.

Espero que Gostem.

 

Creditos 50% meus (Skulls) por ter criado.

Creditos 50% by Genoma, Sem o pedido dele eu nao teria tido um porque criar a potion.

 

Agradecimentos:

Maximusot -> por testar as potions

Jeanjc -> pelo id dos empty flasks

Capeta7 -> pelo bug do doPlayerAddMana(cid,r1) (tava addhealth antes nas mana potion auhehuae)

Sem mais.

 

Ps: Nao Reclamem de pouca explicação afinal não é um tutorial, são só as actions.

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

  • Respostas 51
  • Created
  • Última resposta

Top Posters In This Topic

diminui 3 scripts apenas para 1:

-- Health potion By skulls

 

function onUse(cid, item, frompos, item2, topos)

 

if item.itemid = 7618

 

playerpos = {x=topos.x, y=topos.y, z=topos.z, stackpos=253}

player = getThingfromPos(playerpos)

ml = getPlayerMagLevel(cid)

lvl = getPlayerLevel(cid)

voc = getPlayerVocation(cid)

ex = getPlayerStorageValue(cid,4862)

r1 = math.random(100,300)

 

params = { [1]=cid, [2]=lvl, [3]=voc, [4]=ml }

 

if item2.itemid == 1 then

if item.type == 0 then

doPlayerSendCancel(cid,"It is empty.")

else

if item2.uid == cid then

doChangeTypeItem(item.uid,0)

if item.type == 2 then

if ex == -1 then

doPlayerAddHealth(cid,r1)

doSendMagicEffect(playerpos,12)

addEvent(ums,1000,params)

setPlayerStorageValue(cid,4862, 1)

doChangeTypeItem(item.uid,0)

doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)

else

doPlayerSendCancel(cid,'You are exhausted!')

doSendMagicEffect(playerpos,2)

doChangeTypeItem(item.uid,2)

end

else

splash = doCreateItem(1903,item.type,topos)

doChangeTypeItem(item.uid,0)

doDecayItem(splash)

end

else

if item.type == 0 then

doPlayerSendCancel(cid,"It is empty.")

else

splash = doCreateItem(1903,item.type,topos)

doChangeTypeItem(item.uid,0)

doDecayItem(splash)

end

end

end

end

return 1

end

 

function ums(params)

cid = params[1]

setPlayerStorageValue(cid,4862, -1)

end

 

if item.itemid = 7588

 

playerpos = {x=topos.x, y=topos.y, z=topos.z, stackpos=253}

player = getThingfromPos(playerpos)

ml = getPlayerMagLevel(cid)

lvl = getPlayerLevel(cid)

voc = getPlayerVocation(cid)

ex = getPlayerStorageValue(cid,4862)

r1 = math.random(200,600)

 

params = { [1]=cid, [2]=lvl, [3]=voc, [4]=ml }

 

if item2.itemid == 1 then

if item.type == 0 then

doPlayerSendCancel(cid,"It is empty.")

else

if item2.uid == cid then

doChangeTypeItem(item.uid,0)

if item.type == 2 then

if lvl >= 50 then

if voc == 4 or voc == 3 or voc == 7 or voc == 8 then

if ex == -1 then

doPlayerAddHealth(cid,r1)

doSendMagicEffect(playerpos,12)

addEvent(ums,1000,params)

setPlayerStorageValue(cid,4862, 1)

doChangeTypeItem(item.uid,0)

doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)

else

doPlayerSendCancel(cid,'You are exhausted!')

doSendMagicEffect(playerpos,2)

doChangeTypeItem(item.uid,2)

end

else

doPlayerSendCancel(cid, 'This potion can only be consumed by paladins and knights of level 50 or higher.')

doChangeTypeItem(item.uid,2)

end

else

doPlayerSendCancel(cid,'This potion can only be consumed by paladins and knights of level 50 or higher.')

doChangeTypeItem(item.uid,2)

end

end

else

splash = doCreateItem(1903,item.type,topos)

doChangeTypeItem(item.uid,0)

doDecayItem(splash)

end

end

else

if item.type == 0 then

doPlayerSendCancel(cid,"It is empty.")

else

splash = doCreateItem(1903,item.type,topos)

doChangeTypeItem(item.uid,0)

doDecayItem(splash)

end

end

return 1

end

 

function ums(params)

cid = params[1]

setPlayerStorageValue(cid,4862, -1)

end

 

if item.itemid = 7591

playerpos = {x=topos.x, y=topos.y, z=topos.z, stackpos=253}

player = getThingfromPos(playerpos)

ml = getPlayerMagLevel(cid)

lvl = getPlayerLevel(cid)

voc = getPlayerVocation(cid)

ex = getPlayerStorageValue(cid,4862)

r1 = math.random(400,800)

 

 

params = { [1]=cid, [2]=lvl, [3]=voc, [4]=ml }

 

if item2.itemid == 1 then

if item.type == 0 then

doPlayerSendCancel(cid,"It is empty.")

else

if item2.uid == cid then

doChangeTypeItem(item.uid,0)

if item.type == 2 then

if lvl >= 80 then

if voc == 4 or voc == 8 then

if ex == -1 then

doPlayerAddHealth(cid,r1)

doSendMagicEffect(playerpos,12)

addEvent(ums,1000,params)

setPlayerStorageValue(cid,4862, 1)

doChangeTypeItem(item.uid,0)

doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)

else

doPlayerSendCancel(cid,'You are exhausted!')

doSendMagicEffect(playerpos,2)

doChangeTypeItem(item.uid,2)

end

else

doPlayerSendCancel(cid, 'This potion can only be consumed by knights of level 80 or higher.')

doChangeTypeItem(item.uid,2)

end

else

doPlayerSendCancel(cid,'This potion can only be consumed by knights of level 80 or higher.')

doChangeTypeItem(item.uid,2)

end

end

else

splash = doCreateItem(1903,item.type,topos)

doChangeTypeItem(item.uid,0)

doDecayItem(splash)

end

end

else

if item.type == 0 then

doPlayerSendCancel(cid,"It is empty.")

else

splash = doCreateItem(1903,item.type,topos)

doChangeTypeItem(item.uid,0)

doDecayItem(splash)

end

end

return 1

end

 

function ums(params)

cid = params[1]

setPlayerStorageValue(cid,4862, -1)

end

coloque este script em um arquivo chamado: potions health.lua e as tags adicionem:

-- Life potions

<action itemid="7618" script="potions health.lua" />

<action itemid="7588" script="potions health.lua" />

<action itemid="7591" script="potions health.lua" />

nao testei

porem provavelmente funcionará

caso encontrem bugs me avisem por MP

Link para o comentário
Compartilhar em outros sites

@maneirinho

da na mesma usar os 3 ou usar um.. sao 3 tag.. e 3 arquivos pekenos

ai no seu sao 3 tags e 1 arquivo grande =O

 

qual a diferença?

@all

vlw pelos elogios

 

flw

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

@_Ferrari_

 

Eu nao fiz em um unico script porque meu colega pediu scripts diferentes separados, mas realmente da para fazer em um só

 

@Adriano

 

Voce fez algo errado.

Testaram em 8.1 e da certo =x.

 

abraços

Link para o comentário
Compartilhar em outros sites

Fiz tudo direitinho aqui também e sempre que uso as potions, com ou sem hotkey aparece "Its empty"...

Parece que pra 8.1, no Aries 0.40 não funciona não.

~

PS: Tenho uma pergunta... Qual o motivo do script pegar o ml do player? o.O

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


×
×
  • Criar Novo...