• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Level Based Fluids

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.
^_^
 
PHP:
random = math.random(getPlayerLevel(cid),getPlayerLevel(cid)*2)
doPlayerAddHealth(cid, random)
It adds player health: min = his level, max = his lvl 2x. :p
 
Code:
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
So where would i add that?
 
PHP:
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

Something like that. :p
 
This isnt working for some reason o_O
Code:
[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 ')'
 
PHP:
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
 
Code:
[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>'
Hmm...any help?
 
Back
Top Bottom