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

-

How can i change so that it would look like this:

(example exhaust)
aggressive -> agressive = 7.5 seconds
heal -> heal = 6.5 seconds

// i want to add this
aggressive -> heal = 2.5 seconds
heal -> aggressive = 2.5 seconds


Code:
void Spell::postCastSpell(Player* player, bool finishedCast /*= true*/, bool payCost /*= true*/) const
{

    if(finishedCast){
        if(!player->hasFlag(PlayerFlag_HasNoExhaustion)){
            if(exhaustion != 0){
                if(isAggressive){
                    if(exhaustion == -1)
                        player->addCombatExhaust(g_config.getNumber(ConfigManager::COMBAT_EXHAUSTED));
                    else
                        player->addCombatExhaust(exhaustion);
                }else{
                    if(exhaustion == -1)
                        player->addHealExhaust(g_config.getNumber(ConfigManager::HEAL_EXHAUSTED));
                    else
                        player->addHealExhaust(exhaustion);
                }
            }
        }
    }

All you have to do is to change the number declared at ConfigManager::COMBAT_EXAUSTED or HEAL_EXAUSTED.
 
not what i talked about, read again (the number's don't matter, was just an example).

i need some kind of new exhaust or a different if statement to add exhaust time between attack and heal and versa.
 
Last edited:
It sounds like you want an exhaust for ALL spells.

Using a spell gives you a regular (short) exhaust.
Using an aggressive spell gives you an "aggressive" exhaust.
Using a healing spell gives you a "healing" exhaust.

Is this right? So, you become exhausted between spell types?
 
yes that may be correct, since the spell you mean is inbetween both of them, i gave example above

I'm pretty sure three types of exhaust already exist:

EXHAUST (CONDITION_EXHAUST)
COMBAT_EXHAUST (CONDITION_EXHAUST_COMBAT)
HEAL_EXHAUST (CONDITION_EXHAUST_HEAL)

You just need to edit that portion in the C++ file to add "EXHAUST" after you've used the aggressive spell AND a healing spell OR a healing spell AND an aggressive spell.

http://pastebin.com/qvM8VsNy

You'll also need to check for regular exhaust. Give it a shot.
 
Code:
    &       //acts as AND in operations.
    &&      //if the left-hand side expression is false, the combined result is false.
    |       //acts as OR in operations.
    ||      //if the left-hand side expression is true, the combined result is true.

This is also possible in Lua, but you'll have to edit every spell. :p
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)

local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, 10 * 1000)
setCombatCondition(combat, exhaust)
 
Last edited:
Since "addExhaust" doesn't exist, you'll have to do much more editing that this single part.

Unfortunately, I can't help you. I'm not good with C++. Just know how to read & edit. Maybe @Ninja can help.

It sounds to me like you want something similar to cooldowns.
 
not sure how to do it since the heal exhaust is added in the else statement, and there is no "addExhaust()", just addHealExhaust() and addCombatExhaust()
u don't need addExhaust functions.
u can already use storagevalues to create exhausts/cooldowns. a quick example:
Code:
function onCastSpell(cid, var)
    player = Player(cid)
    if player:getStorageValue(7238) >= os.time() then -- here we check if the player is exhausted
        player:sendTextMessage(MESSAGE_INFO_DESCR, "You're exhausted")
    else
        player:setStorageValue(7238, os.time()+6.5) -- here we add the exhaust to the player (6.5 is how long exhaust is)
        return doCombat(cid, combat, var)
    end
end
now this is for tfs 1.x, but u should see how it works and be able to reproduce for other versions.
with different exhausts like this you could easily make the system that you have in mind.

now this isnt source edit like u requested but maybe it can help u anyways :)
 
maybe part of my attack speed function will help

Code:
function checkWeaponCooldown(player)
    if weaponHitCooldowns[player:getId()] then return true end
end

function addWeaponCooldown(player, weaponT)
local cid = player:getId()
local weaponAS = weaponT[3]
local extraAS = leatherSetAS(player)
local cd = weaponAS-extraAS

    if cd > 0 then
        weaponHitCooldowns[cid] = true
        addEvent(function() weaponHitCooldowns[cid] = nil end, cd)
    end
end
 
Back
Top