Roa Supporter
New Member
- Joined
- Apr 21, 2009
- Messages
- 26
- Reaction score
- 0
Would any 1 be willing to me make me level based fluids?
The higher the lvl the more it heals.
^_^
The higher the lvl the more it heals.
^_^
doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_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
local RANDOM = math.random(getPlayerLevel(cid),getPlayerLevel(cid)*2)
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) < 80) and getPlayerCustomFlagValue(itemEx.uid, PlayerCustomFlag_GamemasterPrivileges) == FALSE) 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, RANDOM)) == 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
[30/04/2009 12:43:32] data/actions/scripts/liquids/great_health.lua:1: bad argument #2 to 'random' (interval is empty)
[30/04/2009 12:43:32] [Warning - Event::loadScript] Can not load script (data/actions/scripts/liquids/great_health.lua)
[30/04/2009 12:43:32] data/actions/scripts/liquids/great_health.lua:22: 'then' expected near ')'
local RANDOM = math.random(getPlayerLevel(cid),getPlayerLevel(cid)*2)
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) < 80) and getPlayerCustomFlagValue(itemEx.uid, PlayerCustomFlag_GamemasterPrivileges) == FALSE) then
doCreatureSay(itemEx.uid, "Only knights of level 80 or above may drink this fluid.", TALKTYPE_ORANGE_1)
return TRUE
end
end
[30/04/2009 22:46:05] data/actions/scripts/liquids/great_health.lua:1: bad argument #2 to 'random' (interval is empty)
[30/04/2009 22:46:05] [Warning - Event::loadScript] Can not load script (data/actions/scripts/liquids/great_health.lua)
[30/04/2009 22:46:05] data/actions/scripts/liquids/great_health.lua:20: 'end' expected (to close 'function' at line 7) near '<eof>'