Ir para conteúdo
Entre para seguir isso  
alisonjf

[8.11+] Potions Infinitas

Recommended Posts

alisonjf    2
alisonjf

Nome: Potions infinitas

Versão: 8.11+

Tipo de Script: Action

Servidor Testado: TFS

Créditos: Trepido (Idéia de fazer)

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

 

Bem, o script parece ser um script simples mas é bem chato vc ir comprar mana potions no OT e ter que ficar comprando e enchendo as bps não? Que tal se as potions fossem infinitas, seria mais fácil. Vamos a escrita xD

 

 

Crie um arquivo chamado Potions.lua na pasta data/actions/scripts e insira:

local ultimateHealthPot = 8473
local greatHealthPot = 7591
local greatManaPot = 7590
local greatSpiritPot = 8472
local strongHealthPot = 7588
local strongManaPot = 7589
local healthPot = 7618
local manaPot = 7620

function onUse(cid, item, fromPosition, itemEx, toPosition)
if itemEx.uid ~= cid or itemEx.itemid ~= 1 then
	return TRUE
end

if(item.itemid == healthPot) then
	if(doTargetCombatHealth(0, cid, COMBAT_HEALING, 100, 200, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
		return FALSE
	end
	doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1)

elseif(item.itemid == manaPot) then
	if(doTargetCombatMana(0, cid, 70, 130, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
		return FALSE
	end
	doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1)

elseif(item.itemid == strongHealthPot) then
	if (not(isKnight(cid) or isPaladin(cid)) or (getPlayerLevel(cid) < 50)) and not(getPlayerGroupId(cid) >= 2) then
		doCreatureSay(cid, "This potion can only be consumed by paladins and knights of level 50 or higher.", TALKTYPE_ORANGE_1)
		return TRUE
	end

	if(doTargetCombatHealth(0, cid, COMBAT_HEALING, 200, 400, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
		return FALSE
	end
	doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1)


elseif(item.itemid == strongManaPot) then
	if (not(isSorcerer(cid) or isDruid(cid) or isPaladin(cid)) or (getPlayerLevel(cid) < 50)) and not(getPlayerGroupId(cid) >= 2) then
		doCreatureSay(cid, "This potion can only be consumed by sorcerers, druids and paladins of level 50 or higher.", TALKTYPE_ORANGE_1)
		return TRUE
	end

	if(doTargetCombatMana(0, cid, 110, 190, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
		return FALSE
	end
	doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1)

elseif(item.itemid == greatSpiritPot) then
	if (not(isPaladin(cid)) or (getPlayerLevel(cid) < 80)) and not(getPlayerGroupId(cid) >= 2) then
		doCreatureSay(cid, "This potion can only be consumed by paladins of level 80 or higher.", TALKTYPE_ORANGE_1)
		return TRUE
	end

	if(doTargetCombatHealth(0, cid, COMBAT_HEALING, 200, 400, CONST_ME_MAGIC_BLUE) == LUA_ERROR or doTargetCombatMana(0, cid, 110, 190, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
		return FALSE
	end
	doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1)

elseif(item.itemid == greatHealthPot) then
	if (not(isKnight(cid)) or (getPlayerLevel(cid) < 80)) and not(getPlayerGroupId(cid) >= 2) then
		doCreatureSay(cid, "This potion can only be consumed by knights of level 80 or higher.", TALKTYPE_ORANGE_1)
		return TRUE
	end

	if(doTargetCombatHealth(0, cid, COMBAT_HEALING, 500, 700, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
		return FALSE
	end
	doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1)

elseif(item.itemid == greatManaPot) then
	if (not(isSorcerer(cid) or isDruid(cid)) or (getPlayerLevel(cid) < 80)) and not(getPlayerGroupId(cid) >= 2) then
		doCreatureSay(cid, "This potion can only be consumed by sorcerers and druids of level 80 or higher.", TALKTYPE_ORANGE_1)
		return TRUE
	end

	if(doTargetCombatMana(0, cid, 200, 300, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
		return FALSE
	end
	doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1)

elseif(item.itemid == ultimateHealthPot) then
	if (not(isKnight(cid)) or (getPlayerLevel(cid) < 130)) and not(getPlayerGroupId(cid) >= 2) then
		doCreatureSay(cid, "This potion can only be consumed by knights of level 130 or higher.", TALKTYPE_ORANGE_1)
		return TRUE
	end

	if(doTargetCombatHealth(0, cid, COMBAT_HEALING, 800, 1000, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
		return FALSE
	end
	doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1)

 

 

Agora na pasta data/actions, abra o actions.xml e adicione as seguintes linhas:

	<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" />
<action itemid="7618" script="potions.lua" />
<action itemid="7620" script="potions.lua" />
<action itemid="8472" script="potions.lua" />
<action itemid="8473" script="potions.lua" />

 

E é só, fácil não?

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

 

Gostaram: Doem OT$ :)

Reclamações/Dúvidas: Postem

Compartilhar este post


Link para o post
Nord    2
Nord

xD, foi só tirar os doTransformItem(item.uid, emptyFlask)

 

Aprovado

Compartilhar este post


Link para o post
rubicao    0
rubicao

esse funciona em 8.4??

me mane PM se possivel!

Compartilhar este post


Link para o post
541320    0
541320

Nem gostei pow... ja tinha pensado nessa possibilidade, mas fica escroto assim... só se for naqueles ots zuados d exp altona

Compartilhar este post


Link para o post
ricardinho1039    0
ricardinho1039

Eu gostei, um outro OT que eu usava tinha, e era muito bom ;)

Compartilhar este post


Link para o post
bolachapk    0
bolachapk

Perfeito ótimo Script

Compartilhar este post


Link para o post
Nihzinhu    0
Nihzinhu

Nossa, achei algo muito trabalhoso heim...

 

Sinceramente, nada de bom..

Até acho que coisas assim poderiam ser evitadas, seria tão bom.

Compartilhar este post


Link para o post
levijunior    0
levijunior

queria achar como tirar os empty do ot ;(

Compartilhar este post


Link para o post
Lord Cariokinha    0
Lord Cariokinha

Undewor.servegame 8.42

Compartilhar este post


Link para o post
felipelooco    0
felipelooco

Muito bom. Tava tentando faze. xD

Compartilhar este post


Link para o post
Visitante
Este tópico está impedido de receber novos posts.
Entre para seguir isso  
  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×