// Infitiny Mana Potion [random mana]
// by vimoco
local MIN = 300
local MAX = 500
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 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)
return TRUE
end
<action itemid="7488" script="[B]infinitypotion.lua[/B]"/>
<action itemid="7478" script="[B]healthpotion.lua[/B]"/>
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, 1000)
function onUse(cid, item, fromPosition, itemEx, toPosition)
local manaAdd = {
["Sorcerer"]={math.random(75, 125), math.random(180, 220), math.random(280, 320)}, ["Druid"]={math.random(75, 125), math.random(180, 220), math.random(280, 320)}, ["Paladin"]={math.random(75, 125), math.random(180, 220), math.random(180, 220)}, ["Knight"]={math.random(75, 125), math.random(75, 125), math.random(75, 125)},
["Master Sorcerer"]={math.random(75, 125), math.random(180, 220), math.random(280, 320)}, ["Elder Druid"]={math.random(75, 125), math.random(180, 220), math.random(280, 320)}, ["Royal Paladin"]={math.random(75, 125), math.random(180, 220), math.random(180, 220)}, ["Elite Knight"]={math.random(75, 125), math.random(75, 125), math.random(75, 125)}
}
if(isPlayer(itemEx.uid) == TRUE) then
if(hasCondition(itemEx.uid, CONDITION_EXHAUST) == FALSE) then
if(getPlayerLevel(itemEx.uid) < 50) then
doCreatureAddMana(itemEx.uid, manaAdd[getPlayerVocationName(itemEx.uid)][1])
elseif(getPlayerLevel(itemEx.uid) >= 50) and (getPlayerLevel(itemEx.uid) < 80) then
doCreatureAddMana(itemEx.uid, manaAdd[getPlayerVocationName(itemEx.uid)][2])
else
doCreatureAddMana(itemEx.uid, manaAdd[getPlayerVocationName(itemEx.uid)][3])
end
doAddCondition(itemEx.uid, exhaust)
doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)
doSendAnimatedText(getCreaturePosition(itemEx.uid), "Aaaah...", TEXTCOLOR_DARKYELLOW)
else
doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
return TRUE
end
else
return FALSE
end
end
local MIN = 650
local MAX = 1550
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 1500))
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 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)
return TRUE
end
dziękuje :*
tylko ten infinity mana potion nie chce działać.. jak go stworzę:
/i 7488 1
coś źle robie?
"You can use the object" ;'o
I ten vial wygłada jak by był pusty w srodku, więc nie wiem czemu tak.
Lua Script Error: [Action Interface]
data/actions/scripts/infinitypotion.lua:onUse
data/actions/scripts/infinitypotion.lua:11: attempt to index field '?' (a nil value)
stack traceback:
data/actions/scripts/infinitypotion.lua:11: in function <data/actions/scripts/infinitypotion.lua:3>
no to nie wiem, wszystko git jest.. hp działa tylko ten infinity nie działa ;:/
Code:Lua Script Error: [Action Interface] data/actions/scripts/infinitypotion.lua:onUse data/actions/scripts/infinitypotion.lua:11: attempt to index field '?' (a nil value) stack traceback: data/actions/scripts/infinitypotion.lua:11: in function <data/actions/scripts/infinitypotion.lua:3>