Oehoehflexi
New Member
Mana potion script
Strong mana potion script
Great mana potion script
Health potion script
Strong health potion
Great health
Ultimate health
Great spirit potion
It is possible you have to change 'local EMPTY_POTION =' to something else. do not forget to write this in Actions.XML
<action itemid="7591" script="liquids/great_health.lua" allowfaruse="1"/> you should do this with all the potions if you have got problems feel free to ask them by posting here or Private msg. (you can also ask other scripts you need)
Yours,
OehOehFlexi
Code:
local MIN = 70
local MAX = 130
local EMPTY_POTION = 7636
local exhaust = createConditionObject(CONDITION_EXHAUSTED)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, getConfigInfo('timeBetweenExActions'))
function onUse(cid, item, fromPosition, itemEx, toPosition)
if isPlayer(itemEx.uid) == FALSE then
return FALSE
end
if hasCondition(cid, CONDITION_EXHAUSTED) == TRUE then
doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
return TRUE
end
if doPlayerAddMana(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
Code:
local MIN = 110
local MAX = 190
local EMPTY_POTION = 7634
local exhaust = createConditionObject(CONDITION_EXHAUSTED)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, getConfigInfo('timeBetweenExActions'))
function onUse(cid, item, fromPosition, itemEx, toPosition)
if isPlayer(itemEx.uid) == FALSE then
return FALSE
end
if hasCondition(cid, CONDITION_EXHAUSTED) == TRUE then
doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
return TRUE
end
if not(isSorcerer(itemEx.uid) or isDruid(itemEx.uid) or isPaladin(itemEx.uid)) or getPlayerLevel(itemEx.uid) < 50 then
doCreatureSay(itemEx.uid, "Only sorcerers, druids and paladins of level 50 or above may drink this fluid.", TALKTYPE_ORANGE_1)
return TRUE
end
if doPlayerAddMana(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
Code:
local MIN = 200
local MAX = 300
local EMPTY_POTION = 7635
local exhaust = createConditionObject(CONDITION_EXHAUSTED)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, getConfigInfo('timeBetweenExActions'))
function onUse(cid, item, fromPosition, itemEx, toPosition)
if isPlayer(itemEx.uid) == FALSE then
return FALSE
end
if hasCondition(cid, CONDITION_EXHAUSTED) == TRUE then
doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
return TRUE
end
if not(isSorcerer(itemEx.uid) or isDruid(itemEx.uid)) or getPlayerLevel(itemEx.uid) < 50 then
doCreatureSay(itemEx.uid, "Only sorcerers and druids of level 80 or above may drink this fluid.", TALKTYPE_ORANGE_1)
return TRUE
end
if doPlayerAddMana(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
Health potion script
Code:
local MIN = 100
local MAX = 200
local EMPTY_POTION = 7636
local exhaust = createConditionObject(CONDITION_EXHAUSTED)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, getConfigInfo('timeBetweenExActions'))
function onUse(cid, item, fromPosition, itemEx, toPosition)
if isPlayer(itemEx.uid) == FALSE then
return FALSE
end
if hasCondition(cid, CONDITION_EXHAUSTED) == TRUE then
doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
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
Strong health potion
Code:
local MIN = 200
local MAX = 400
local EMPTY_POTION = 7634
local exhaust = createConditionObject(CONDITION_EXHAUSTED)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, getConfigInfo('timeBetweenExActions'))
function onUse(cid, item, fromPosition, itemEx, toPosition)
if isPlayer(itemEx.uid) == FALSE then
return FALSE
end
if hasCondition(cid, CONDITION_EXHAUSTED) == TRUE then
doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
return TRUE
end
if not(isKnight(itemEx.uid) or isPaladin(itemEx.uid)) or getPlayerLevel(itemEx.uid) < 50 then
doCreatureSay(itemEx.uid, "Only knights and paladins of level 50 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
Great health
Code:
local MIN = 500
local MAX = 700
local EMPTY_POTION = 7635
local exhaust = createConditionObject(CONDITION_EXHAUSTED)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, getConfigInfo('timeBetweenExActions'))
function onUse(cid, item, fromPosition, itemEx, toPosition)
if isPlayer(itemEx.uid) == FALSE then
return FALSE
end
if hasCondition(cid, CONDITION_EXHAUSTED) == TRUE then
doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
return TRUE
end
if not(isKnight(itemEx.uid)) or getPlayerLevel(itemEx.uid) < 50 then
doCreatureSay(itemEx.uid, "Only knights of level 80 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
Ultimate health
Code:
local MIN = 800
local MAX = 1000
local EMPTY_POTION = 7635
local exhaust = createConditionObject(CONDITION_EXHAUSTED)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, getConfigInfo('timeBetweenExActions'))
function onUse(cid, item, fromPosition, itemEx, toPosition)
if isPlayer(itemEx.uid) == FALSE then
return FALSE
end
if hasCondition(cid, CONDITION_EXHAUSTED) == TRUE then
doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
return TRUE
end
if not(isKnight(itemEx.uid)) or getPlayerLevel(itemEx.uid) < 130 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
Great spirit potion
Code:
local MIN_HEALTH = 200
local MAX_HEALTH = 400
local MIN_MANA = 110
local MAX_MANA = 190
local EMPTY_POTION = 7635
local exhaust = createConditionObject(CONDITION_EXHAUSTED)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, getConfigInfo('timeBetweenExActions'))
function onUse(cid, item, fromPosition, itemEx, toPosition)
if isPlayer(itemEx.uid) == FALSE then
return FALSE
end
if hasCondition(cid, CONDITION_EXHAUSTED) == TRUE then
doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
return TRUE
end
if not(isPaladin(itemEx.uid)) or getPlayerLevel(itemEx.uid) < 80 then
doCreatureSay(itemEx.uid, "Only paladins of level 80 or above may drink this fluid.", TALKTYPE_ORANGE_1)
return TRUE
end
if doCreatureAddHealth(itemEx.uid, math.random(MIN_HEALTH, MAX_HEALTH)) == LUA_ERROR or doPlayerAddMana(itemEx.uid, math.random(MIN_MANA, MAX_MANA)) == 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
It is possible you have to change 'local EMPTY_POTION =' to something else. do not forget to write this in Actions.XML
<action itemid="7591" script="liquids/great_health.lua" allowfaruse="1"/> you should do this with all the potions if you have got problems feel free to ask them by posting here or Private msg. (you can also ask other scripts you need)
Yours,
OehOehFlexi
Last edited: