Oi
consegui faze a parte das potions auto agrupaveis \o/
para deixar as potions auto agrupaveis, coloquem no final de cada arquivo das potion (data\actions\scripts\liquids)no exemplo coloquei na ultimate health potion, vejam o arquivo original
ultimate_health.lua
local MIN = 800
local MAX = 1000
local EMPTY_POTION = 7635
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100))
function onUse(cid, item, fromPosition, itemEx, toPosition)
if isPlayer(itemEx.uid) == FALSE then
return FALSE
end
if hasCondition(cid, CONDITION_EXHAUST_HEAL) == TRUE then
doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
return TRUE
end
if((not(isKnight(itemEx.uid)) or getPlayerLevel(itemEx.uid) < 130) and getPlayerCustomFlagValue(itemEx.uid, PlayerCustomFlag_GamemasterPrivileges) == FALSE) then
doCreatureSay(itemEx.uid, "Only knights of level 130 or above may drink this fluid.", TALKTYPE_ORANGE_1)
return TRUE
end
if doCreatureAddHealth(itemEx.uid, math.random(MIN, MAX)) == LUA_ERROR then
return FALSE
end
doAddCondition(cid, exhaust)
doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)
doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1)
doRemoveItem(item.uid, 1)
---->> doPlayerAddItem(cid, EMPTY_POTION, 1) <<----
return TRUE
end
apaguem tudo DEPOIS de doPlayerAddItem(cid, EMPTY_POTION, 1) e coloquem
pot_count = getPlayerItemCount(cid, EMPTY_POTION)
doPlayerRemoveItem(cid, EMPTY_POTION, pot_count)
doPlayerAddItem(cid, EMPTY_POTION, pot_count)
return TRUE
end
ai vai ficar assim ali no final
doAddCondition(cid, exhaust)
doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)
doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1)
doRemoveItem(item.uid, 1)
doPlayerAddItem(cid, EMPTY_POTION, 1)
pot_count = getPlayerItemCount(cid, EMPTY_POTION)
doPlayerRemoveItem(cid, EMPTY_POTION, pot_count)
doPlayerAddItem(cid, EMPTY_POTION, pot_count)
return TRUE
end
é o mesmo esquema em todas potions :smile_positivo:
EU mesmo que fiz \o/
aqui testei e funcionou no Alissow Server 8.6 agrupo de boa
testem ai
qualquer coisa to ai
By M4th7uSZ.