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

Compiling [TFS 1.2] Resist Condition

Cornwallis

Member
Joined
Jan 3, 2010
Messages
480
Reaction score
16
Hello, I'm trying to add a resist condition that can be applied by spells and such. All I want to do is reference the param of the condition, like whether the character is recieving 10% resistance, or 20% resistance, and so on. I'm trying to put something like this in game.cpp:
Code:
        if (target->hasCondition(CONDITION_RESIST) {
            damage.primary.value -= damage.primary.value * (resistPercent / 100.);
            damage.secondary.value -= damage.secondary.value * (resistPercent / 100.);
        }
and I put this inside:
Code:
bool Game::combatChangeHealth(Creature* attacker, Creature* target, CombatDamage& damage)
any help is accepted.
 
What exactly do you want help with? Did you intend this post as a request, or is there anything you don't understand or something that you're struggling to accomplish or have you encountered any issues?
 
I'm struggling to accomplish a complete resistance condition, with param that I set in the spell file. What I don't understand is how to reference the param from the spell file so that I can incorporate it into the damage in game.cpp. So say I have in a spell:
Code:
condition:setParameter(COMBAT_PARAM_RESISTPERCENT, 30)
how do I get resistPercent to return 30:
Code:
damage.primary.value -= damage.primary.value * (resistPercent / 100.);
 
why do you want to return the percent value from setParameter?
are you planning on using flexible percents or something?
 
you don't really need to get the value if you're already setting it
you can save the value and set it in the parameter, and send the player how much % they got from the same saved value
 
Back
Top