Ir para conteúdo

Posts Recomendados

Ripado do The forgotten Server, mas acho que funfa no evolutions tbm.

Precisa do level e a vocação certa, além disso tem exuasted.

 

Em data\actions\scripts\other ou data\actions crie potion.lua

bote isso la

 

local greatHealthPot = 7591
local greatManaPot = 7590
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, 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, 170, 230, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
		return FALSE
	end
	doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1)
		doRemoveItem(item.uid,1)

elseif(item.itemid == manaPot) then
	if(doTargetCombatMana(0, cid, 85, 150, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
		return FALSE
	end
	doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1)
		doRemoveItem(item.uid,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, 300, 500, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
		return FALSE
	end
	doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1)
		doRemoveItem(item.uid,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, 100, 200, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
		return FALSE
	end
	doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1)
		doRemoveItem(item.uid,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, 800, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
		return FALSE
	end
	doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1)
		doRemoveItem(item.uid,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.",

 

Em \data\actions\actions.xml

coloque

 

<action itemid="7588" script="potion.lua" allowfaruse="1"/>

<action itemid="7589" script="potion.lua" allowfaruse="1"/>

<action itemid="7590" script="potion.lua" allowfaruse="1"/>

<action itemid="7591" script="potion.lua" allowfaruse="1"/>

<action itemid="7618" script="potion.lua" allowfaruse="1"/>

<action itemid="7620" script="potion.lua" allowfaruse="1"/>

Editado por Nandu Minerim
Link para o comentário
https://xtibia.com/forum/topic/82807-potions-tudo-em-1-script/
Compartilhar em outros sites

×
×
  • Criar Novo...