Adding a haste/parry/dodge/block cap to your core 3.3.5 trinitycore

cliffsmits

Senior User
Superior Member
262
2014
31
Location
netherlands
How to make a cap on the haste percentage ( spell haste ofc ) :
1. Open up Object.h
2. go to line 28.
3. You'll see :


Code:
#include "Map.h"
replace it with:
#include "Map.h"
#include "Unit.h"

4. then go to line 212.
5. You'll see :


Code:
void ApplyPercentModFloatValue(uint16 index, float val, bool apply)
        {
            float value = GetFloatValue(index);
            ApplyPercentModFloatVar(value, val, apply);
            SetFloatValue(index, value);
        }
Edit it like I did :

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);
        }

So, that little if makes the difference, let me explain how it works:
Code:
if(apply && index == CR_HASTE_SPELL && value > /*the haste cap, [COLOR="#FF0000"]50 [/COLOR]for example*/ [COLOR="#FF0000"]50[/COLOR])
value =  50;

Change the numbers in red to your desired haste cap, in percentages.
6. Recompile ( skip this if you want to add more caps).


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);
}
Replace it with :

Code:
  if(value > 50)
		value = 50;
    SetStatFloatValue(PLAYER_PARRY_PERCENTAGE, value);
}
Again, change the red numbers to your desired parry cap.
4. Recompile ( skip this if you want to add more caps).



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);
}
Replace with :

Code:
if(value > 50)
		value = 50;
    SetStatFloatValue(PLAYER_DODGE_PERCENTAGE, value);
}
Again, change the red numbers to your desired dodge cap.
4. Recompile ( skip this if you want to add more caps).


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);
}
Replace it with :
Code:
if(value > 50)
		value = 50;
    SetStatFloatValue(PLAYER_BLOCK_PERCENTAGE, value);
}

Again, change the red numbers to your desired block ( percentage ) cap.
4. Recompile ( Now you will NEED to since this is the last cap).

i didnt had time to test the haste
The parry/dodge/block caps work as intended.


sc6vpv.jpg
 
Last edited:

ExO

Admin
5,084
2014
1,442
Good one, I know a lot of people have been asking for this, thank you!
 

ahmad2020ayyat

Trial Member
2
2016
0
in the haste cap part the number 50 means 50 haste = cap??
and when I recompile do I have to use Microsoft visual c++ again because when I rebuild using Microsoft visual it error at object.h
 
Last edited:
Top