Likes: 0
Results 1 to 1 of 1
-
26-01-13, 09:41 AM #1
[C++] Adding a haste/parry/dodge/block cap to your core [Trinity/3.3.5a]
Register to remove this adGood mornin',
So yes, I counted them.. about 13819053715 ( not sure if I missed one ) people are searching for a cap on one of the above stats, so I thought let's make a guide how to add it.
note #2 : This is just a flat cap, I know it's better to edit the formula's for the stat percentages if you want to scale, but I figured this out in ~10 minutes so formula editing is not for now.
Okay, after the bunch of notes, let's start.
How to make a cap on the haste percentage ( spell haste ofc ) :
1. Open up Object.h
2. go to line 212.
3. You'll see :
Code:void ApplyPercentModFloatValue(uint16 index, float val, bool apply) { float value = GetFloatValue(index); ApplyPercentModFloatVar(value, val, apply); SetFloatValue(index, value); }
Code:void ApplyPercentModFloatValue(uint16 index, float val, bool apply) { float value = GetFloatValue(index); ApplyPercentModFloatVar(value, val, apply); if(apply && index == CR_HASTE_SPELL && value > /*the haste cap, 50 for example*/ 50) value = 50; SetFloatValue(index, value); }
Code:if(apply && index == CR_HASTE_SPELL && value > /*the haste cap, 50 for example*/ 50) value = 50;
4. Recompile ( skip this if you want to add more caps).
5. Celebrate ( I guess? ).
How to make a cap on the parry percentage :
1. Open up Statsystem.cpp
2. Go to line 702.
3. You'll see :
Code:SetStatFloatValue(PLAYER_PARRY_PERCENTAGE, value); }
Code:if(value > 50) value = 50; SetStatFloatValue(PLAYER_PARRY_PERCENTAGE, value); }
4. Recompile ( skip this if you want to add more caps).
5. Celebrate ( again ) .
How to make a cap on the dodge percentage :
1. Open up Statsytem.cpp
2. Go to line : 738
3. You'll see:
Code:SetStatFloatValue(PLAYER_DODGE_PERCENTAGE, value); }
Code:if(value > 50) value = 50; SetStatFloatValue(PLAYER_DODGE_PERCENTAGE, value); }
4. Recompile ( skip this if you want to add more caps).
5. Celebrate ( aaand again ) .
How to make a cap on the block percentage :
1. Open up Statsystem.cpp
2. go to line : 577
3. You'll see:
Code:SetStatFloatValue(PLAYER_BLOCK_PERCENTAGE, value); }
Code:if(value > 50) value = 50; SetStatFloatValue(PLAYER_BLOCK_PERCENTAGE, value); }
4. Recompile ( Now you will NEED to since this is the last cap).
5. Celebrate ( I should get a cake now ) .
The haste cap has not been tested yet.
The parry/dodge/block caps work as intended.
Credits for making this guide goes to Jameyboor
› See More: [C++] Adding a haste/parry/dodge/block cap to your core [Trinity/3.3.5a]