• 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
 
Dropping in 12 years later.. but just letting you know that in the PVP arena with the above script, you will be able to cast UE+SD at the same time instantly before CD sets. So it's unfortunately not a solution in my opinion.

If someone has a complete TFS 1.5 solution for infinite runes in PVP arena that doesn't mess with original outside of PVP arena behavior + correct exhaustion/cooldown setting, please let me know!

I'm using your system @ralke and all works great, potions too. Just infinite runes would be a nice addition, do you have that?

Best,
Z
 
Dropping in 12 years later.. but just letting you know that in the PVP arena with the above script, you will be able to cast UE+SD at the same time instantly before CD sets. So it's unfortunately not a solution in my opinion.

If someone has a complete TFS 1.5 solution for infinite runes in PVP arena that doesn't mess with original outside of PVP arena behavior + correct exhaustion/cooldown setting, please let me know!

I'm using your system @ralke and all works great, potions too. Just infinite runes would be a nice addition, do you have that?

Best,
Z
I thought runes we're infinite too, but, noticed that those are loosing charges inside the arena. I didn't craft the system myself so would be nice to open a new support thread, like it's done here: TFS 1.X+ - PVP Arena Modification (don't attack between the same town id) (https://otland.net/threads/pvp-arena-modification-dont-attack-between-the-same-town-id.287491/#post-2741360) comment the main thread here with the request: TFS [1.X] Infinite PVP Arena (https://otland.net/threads/tfs-1-x-infinite-pvp-arena.281814/#post-2701194) or ask @Itutorial if he can help us, since he was the one who crafted the system.

But i'm pretty sure that here's the key
C++:
switch (action) {
        case WEAPONACTION_REMOVECOUNT:
            if (g_config.getBoolean(ConfigManager::REMOVE_WEAPON_AMMO)) {
                if (!player->inPvPArenaPlayer()) {
                    Weapon::decrementItemCount(item);
                }
            }
            break;

        case WEAPONACTION_REMOVECHARGE: {
            uint16_t charges = item->getCharges();
            if (charges != 0 && g_config.getBoolean(ConfigManager::REMOVE_WEAPON_CHARGES)) {
                if (!player->inPvPArenaPlayer()) {
                    g_game.transformItem(item, item->getID(), charges - 1);
                }
            }
            break;
        }

If you can stablish a conditional with if (!player->inPvPArenaPlayer()) { for rune charges it will work, anyways, I can't make the troubleshoot myself due the lack of knowledge, probably I would miss something important there.

Regards!
 
Dropping in 12 years later.. but just letting you know that in the PVP arena with the above script, you will be able to cast UE+SD at the same time instantly before CD sets. So it's unfortunately not a solution in my opinion.

If someone has a complete TFS 1.5 solution for infinite runes in PVP arena that doesn't mess with original outside of PVP arena behavior + correct exhaustion/cooldown setting, please let me know!

I'm using your system @ralke and all works great, potions too. Just infinite runes would be a nice addition, do you have that?

Best,
Z
I thought runes we're infinite too, but, noticed that those are loosing charges inside the arena. I didn't craft the system myself so would be nice to open a new support thread, like it's done here: TFS 1.X+ - PVP Arena Modification (don't attack between the same town id) (https://otland.net/threads/pvp-arena-modification-dont-attack-between-the-same-town-id.287491/#post-2741360) comment the main thread here with the request: TFS [1.X] Infinite PVP Arena (https://otland.net/threads/tfs-1-x-infinite-pvp-arena.281814/#post-2701194) or ask @Itutorial if he can help us, since he was the one who crafted the system.

But i'm pretty sure that here's the key
C++:
switch (action) {
        case WEAPONACTION_REMOVECOUNT:
            if (g_config.getBoolean(ConfigManager::REMOVE_WEAPON_AMMO)) {
                if (!player->inPvPArenaPlayer()) {
                    Weapon::decrementItemCount(item);
                }
            }
            break;

        case WEAPONACTION_REMOVECHARGE: {
            uint16_t charges = item->getCharges();
            if (charges != 0 && g_config.getBoolean(ConfigManager::REMOVE_WEAPON_CHARGES)) {
                if (!player->inPvPArenaPlayer()) {
                    g_game.transformItem(item, item->getID(), charges - 1);
                }
            }
            break;
        }

If you can stablish a conditional with if (!player->inPvPArenaPlayer()) { for rune charges it will work, anyways, I can't make the troubleshoot myself due the lack of knowledge, probably I would miss something important there.

Regards!
Stop it don't do this.
 
Back
Top