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

C++ Boostpercenthealing attribute by Nekiro

Addams

OTMadness.com OTSes Services
Staff member
Board Moderator
Joined
Sep 29, 2009
Messages
2,920
Solutions
342
Reaction score
1,688
Location
Egypt
I have added those attributes to TFS 1.4.2
But I have an issue that I cannot solve by myself.
  • Attribute boostpercenthealing isn't working, That is a known bug and has an issue opened here, but it's been long enough and no one tried yet, so I decided to try finding a solution here.
 
Last edited:
Any idea? Somebody told me that it was working before. So I've been reverting the commits 1 by 1 the past few hours. Still, all it resulted in was stopping damage boosts (boostpeercentenergy, boostpercentmagic etc..) from working properly and nothing happened to boostpercenthealing.
 
I got this from Nekiro but I am still unable to do it myself.
Nekirosmsg.PNG
Any more hints? Where should I move it to allow it to read damages and healing or do I have to duplicate/separate the attribute boostpercenthealing somewhere else? Any TFS forks solved the issue out there? I checked OTA fork but it's not fixed there either.
 
I got this from Nekiro but I am still unable to do it myself.
View attachment 72337
Any more hints? Where should I move it to allow it to read damages and healing or do I have to duplicate/separate the attribute boostpercenthealing somewhere else? Any TFS forks solved the issue out there? I checked OTA fork but it's not fixed there either.
probably combat.cpp, maybe you need to add the technique used for damage boost for the healing
 
Thank you, I will give it a try. Any specific function in mind? I can't think of any.
I always thought that I need to move it to creature.cpp in function Creature::gainHealth but I was worried that I could affect/bug something else.
 
Thank you, I will give it a try. Any specific function in mind? I can't think of any.
I always thought that I need to move it to creature.cpp in function Creature::gainHealth but I was worried that I could affect/bug something else.
I believe it won’t bug anything i would prefer adding it in doTargetCombat & doAreaCombat

but GainHealth works too (Correct checks will prevent other issues to start showing)
 
Last edited by a moderator:
Alright, I will do the change and test it in every possible way to see how it goes. Thank you.
 
I got this from Nekiro but I am still unable to do it myself.
View attachment 72337
Any more hints? Where should I move it to allow it to read damages and healing or do I have to duplicate/separate the attribute boostpercenthealing somewhere else? Any TFS forks solved the issue out there? I checked OTA fork but it's not fixed there either.
I guess you'll need to modify the blockHit method to take into account the boostpercenthealing attribute when calculating the amount of healing applied.

One way to do this would be to add a check for the boostpercenthealing attribute in the blockHit method, and apply the boost to the healing amount if the attribute is present.

C++:
void Creature::blockHit(CombatType_t combatType, Creature* attacker, int32_t& damage, bool checkDefense /* = false */, bool checkArmor /* = false */)
{
  // ... other code

  // Check for boostpercenthealing attribute
  int32_t boostHealing = getBoostPercentHealing();
  if (boostHealing != 0) {
    // Apply boost to healing amount
    int32_t healing = std::max<int32_t>(0, -damage);
    damage -= static_cast<int32_t>(healing * boostHealing / 100.);
  }

  // ... other code
}
This will apply the boostpercenthealing attribute to the healing amount if it is present, which should fix the issue you described I guess.
 
So, I've been trying for the past few hours with the help of @Shalaby on DMs but still couldn't get it to work, We tried blockHit and on combat.cpp considering Shadow_'s hints but still cannot get it to work.
 
This is my last attempt to fix this by myself, I will try to mimic similar code from 0.4 to 1.4.2 to check it in player.cpp by following this HEALING_PERCENT.
In the meanwhile any other help is appreciated.
 
Back
Top