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

TFS 1.X+ increase magic attribute bug

abdala ragab

Veteran OT User
Joined
Aug 18, 2018
Messages
447
Solutions
11
Reaction score
331
Location
gamelaot.sytes.net
i use tfs 1.5 and i have added this attribute boost system here
and i have added 1 new combat by follow this thread Feature - New types of DAMAGE (how to create) (https://otland.net/threads/new-types-of-damage-how-to-create.233109/)
and this Feature - New types of DAMAGE (how to create) (https://otland.net/threads/new-types-of-damage-how-to-create.233109/page-2#post-2407886)

now i try to add my new combat to the attribute boost in items.cpp and items.h
and when i add it like this in items.cpp
Lua:
{"boostpercentwand", ITEM_PARSE_BOOSTPERCENTWAND},
case ITEM_PARSE_BOOSTPERCENTWAND: {
int16_t value = pugi::cast<int16_t>(valueAttribute.value());
abilities.boostPercent[combatTypeToIndex(COMBAT_ABDALAONEDAMAGE)] += value;
abilities.boostPercent[combatTypeToIndex(COMBAT_ABDALATWODAMAGE)] += value;
break;
}
items.h
Code:
ITEM_PARSE_BOOSTPERCENTWAND,
items.xml
Code:
<attribute key="boostpercentwand" value="50" />
and in items.h like this ITEM_PARSE_BOOSTPERCENTWAND,
i add in items.xml like this <attribute key="boostpercentwand" value="50" />
it show in game
abdalaone +1400%, abdalatwo +1400%
and it bug absorbpercentall and boostpercentphysical too i have to add something else? what my mistake
 
Last edited:
Solution
combatTypeToIndex returns 0 for unknown types, you didn't probably edit this method and added your new types, so your new boosts adds value to physical damage, which is boost number 0.
i use tfs 1.5 and i have added this attribute boost system here
and i have added 1 new combat by follow this thread Feature - New types of DAMAGE (how to create) (https://otland.net/threads/new-types-of-damage-how-to-create.233109/)
and this Feature - New types of DAMAGE (how to create) (https://otland.net/threads/new-types-of-damage-how-to-create.233109/page-2#post-2407886)

now i try to add my new combat to the attribute boost in items.cpp and items.h
and when i add it like this in items.cpp
Lua:
{"boostpercentweapon", ITEM_PARSE_BOOSTPERCENTWAND}, and this case ITEM_PARSE_BOOSTPERCENTWAND: {

                    int16_t value = pugi::cast<int16_t>(valueAttribute.value());

                    abilities.boostPercent[combatTypeToIndex(COMBAT_ABDALAONEDAMAGE)] += value;

                    abilities.boostPercent[combatTypeToIndex(COMBAT_ABDALATWODAMAGE)] += value;

                    break;

                }
and in items.h like this ITEM_PARSE_BOOSTPERCENTWAND,
i add in items.xml like this <attribute key="boostpercentwand" value="50" />
it show in game
abdaladamageone +1400%, abdaladamagetwo +1400%
and it bug absorbpercentall and boostpercentphysical too i have to add something else? what my mistake
You aren't using 1.5 then, if you were using 1.5, then you wouldn't need to add something that is already there. That "feature" has many more commits that are required that came later for bug fixes, you will need to search through all the commits and find the ones that are related to the commit you posted, in other words, find all commits after that, that are pertaining to the "item attributes".
 
You aren't using 1.5 then, if you were using 1.5, then you wouldn't need to add something that is already there. That "feature" has many more commits that are required that came later for bug fixes, you will need to search through all the commits and find the ones that are related to the commit you posted, in other words, find all commits after that, that are pertaining to the "item attributes".
i use tfs 1.5
It works 100% before adding the new boost, after adding it values go too weird 1400% and sometimes 1650% and its not items description only, damage actually read as 1400% or 1650%
And it also affect absorbpercent values
And affect boostpercentphysical
I added it to items.cpp and items.h
 
combatTypeToIndex returns 0 for unknown types, you didn't probably edit this method and added your new types, so your new boosts adds value to physical damage, which is boost number 0.
 
Solution
Back
Top