E ae Galerinha do xtibia. Tava fussando ake no forum procurando como fazer com que a potion suma ao ser usada (obs: no meu server nao veio assim, no caso o server do styller) e nao achei.
Dai resolvi eu mesmo fazer
Versao testada: 8.5-8.52
Vou dar um exemplo so. O da Ultimate healing potion. Depois ensino a vcs como por todas do mesmo jeito.
va na sua pasta actions/scripts/liquids e abra o script ultimate_health.lua
Vai estar mais ou menos assim:
local MIN = 800 local MAX = 1010 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) doTransformItem(item.uid, EMPTY_POTION) return TRUE end
Agora mude a parte doTransformItem(item.uid, EMPTY_POTION)
Para doRemoveItem(item.uid, EMPTY_POTION)
Pronto agora salve e feche.
Mas como fazer para as outras potions?
Basta fazer a mesma troca :smile_positivo: