• 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++ Boostpercentmagic 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 boostpercentmagic is stacking the damage. It increases the total damage instead of the player's primary damage.
Example: If I am dealing "1000 damage" and use an item that increases 20% of magic, I will deal "1200 damage." Then, if I use another item that increases 20% of magic, I will deal "1440 damage" instead of "1400." (Because it increased 20% of the total value (1200)) rather than increasing 20% of the primary damage (1000). The correct damage I should deal is (1400).
 
Last edited:
Solution
Attribute boostpercentmagic is stacking the damage.

It happens to all damage boosts
What you can do is copy/store the true damage outside the loop

creature.cpp
C++:
int32_t baseDamage = damage;
for (int32_t slot = CONST_SLOT_FIRST; slot <= CONST_SLOT_LAST; ++slot) {
    if (!attackerPlayer->isItemAbilityEnabled(static_cast<slots_t>(slot))) {
        continue;
    }

    Item* item = attackerPlayer->getInventoryItem(static_cast<slots_t>(slot));
    if (!item) {
        continue;
    }

    const uint16_t boostPercent = item->getBoostPercent(combatType);
    if (boostPercent != 0) {
        damage += std::round(baseDamage * (boostPercent / 100.));
    }
}
Attribute boostpercentmagic is stacking the damage.

It happens to all damage boosts
What you can do is copy/store the true damage outside the loop

creature.cpp
C++:
int32_t baseDamage = damage;
for (int32_t slot = CONST_SLOT_FIRST; slot <= CONST_SLOT_LAST; ++slot) {
    if (!attackerPlayer->isItemAbilityEnabled(static_cast<slots_t>(slot))) {
        continue;
    }

    Item* item = attackerPlayer->getInventoryItem(static_cast<slots_t>(slot));
    if (!item) {
        continue;
    }

    const uint16_t boostPercent = item->getBoostPercent(combatType);
    if (boostPercent != 0) {
        damage += std::round(baseDamage * (boostPercent / 100.));
    }
}
 
Solution
Thank you!, Worked
I have edited the thread to have one issue and I will create another thread for the healing issue so I can close this one.
 
Last edited:
I have added those attributes to TFS 1.4.2
But I have an issue that I cannot solve by myself.
  • Attribute boostpercentmagic is stacking the damage. It increases the total damage instead of the player's primary damage.
Example: If I am dealing "1000 damage" and use an item that increases 20% of magic, I will deal "1200 damage." Then, if I use another item that increases 20% of magic, I will deal "1440 damage" instead of "1400." (Because it increased 20% of the total value (1200)) rather than increasing 20% of the primary damage (1000). The correct damage I should deal is (1400).
can you explain better? what should i put in items.xml?
<attribute key="boostpercentmagic" value="20"/> << is that so?
I have added those attributes to TFS 1.4.2
I was also added to my source 1.5 8.0 neirko
It's already registering in movesents.xml and nothing happened how to resolve this please?
 
How do I put this boostpercentmagic attribute in tfs 1.5 downgrade nekiro? 8.0
you have to add it to your source
I already added it to my source 1.5 8.0 nekiro, very easy
 
you have to add it to your source
I already added it to my source 1.5 8.0 nekiro, very easy
I saw the link, but I don't know how to install it... Can you help me?
 
I saw the link, but I don't know how to install it... Can you help me?
you need to calmly "copy" and "paste" and recompile be happy


find this line
1.png
and then add the following looks like this
2.png

just compile via microsoft visual code 2018+ program

hope i helped!
 
[Warning - Items::parseItemNode] Unknown key value: boostpercentmagic
you need to calmly "copy" and "paste" and recompile be happy


find this line
View attachment 75526
and then add the following looks like this
View attachment 75527

just compile via microsoft visual code 2018+ program

hope i helped!

I did the step by step that you followed but I got this error
[Warning - Items::parseItemNode] Unknown key value: boostpercentmagic
 
Back
Top