• 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!

Solved Possible to make runes unlimited in specified area?

damnosus

New Member
Joined
Jan 26, 2009
Messages
17
Reaction score
1
I want players to have unlimited supplies inside the war arena on my server. I fixed the potions by adding a line in potions.lua, but have no idea if/how to make runes unlimited either within a range of coordinates or in pvp zones.

Anybody have a solution?
 
Lua:
if isInRange(getPlayerPosition(cid), {x = 90, y = 110, z = 7}, {x = 100, y = 120, z = 7}) then
	doCombat(cid, combat, var)
	return false
else
	return doCombat(cid, combat, var)
end
 
Last edited:
Working, thank you.

Edit: this removes exhaustion and a couple runes won't work at all (eg field runes and paralyze)

Any way to fix that?

Edit 2: Fixed the ones that weren't working (syntax errors), but still this removes exhaust. Still need a fix.
 
Last edited:
You can add an exhaustion condition in the rune, like potions have.
But what exactly doesn't work with the paralyze and field runes? just tested them myself and works fine for me.
 
You can add an exhaustion condition in the rune, like potions have.
But what exactly doesn't work with the paralyze and field runes? just tested them myself and works fine for me.

I messed up the syntax due to quickly copy/pasting. Could you give me an example of 2 second exhaustion?
 
Lua:
if(hasCondition(cid, CONDITION_EXHAUST)) then
        doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) 
	doPlayerSendCancel(cid, "You are exhausted")
	return false
end
if isInRange(getPlayerPosition(cid), {x = 94, y = 111, z = 7}, {x = 96, y = 113, z = 7}) then
	doCombat(cid, combat, var)
	doAddCondition(cid, exhaust)
	return false
else
	return doCombat(cid, combat, var)
end
The condition above function onCastSpell
Lua:
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, 2000) -- time in seconds x1000
 
Doesn't seem to be working, no exhaust still. Here's my sd rune as an example. Am I overlooking something?

Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, true)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)

function onGetFormulaValues(cid, level, maglevel)
	local min = level / 5 + maglevel * 4.3 + 32
	local max = level / 5 + maglevel * 7.4 + 48
	return -min, -max
end

local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, 1900) -- time in seconds x1000

setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
function onCastSpell(cid, var)
if isInRange(getPlayerPosition(cid), {x = 0, y = 0, z = 0}, {x = 1000, y = 1000, z = 15}) then
	doCombat(cid, combat, var)
	doAddCondition(cid, exhaust)
	return false
else
	return doCombat(cid, combat, var)
end
end
 
You forgot this part.
Lua:
if(hasCondition(cid, CONDITION_EXHAUST)) then
        doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) 
	doPlayerSendCancel(cid, "You are exhausted")
	return false
end
 
Back
Top