PDA

View Full Version : Custom Haste Caps for Level-Limited servers


Nydosa
12-14-2013, 04:42 AM
I couldn't find anything on the forums pointing me directly to this line of code, so I'd like to share it and jointly request a possibility to nullify the haste cap by levels through the variables table... Anyways, in mob.cpp go to the follow area of code, and edit your level caps at will.

int Mob::GetHaste() {
int h = spellbonuses.haste + spellbonuses.hastetype2 + itembonuses.haste;
int cap = 0;
int level = GetLevel();

if(level < 30) { // Rogean: Are these caps correct? Will use for now.
cap = 50;
} else if(level < 50) {
cap = 74;
} else {
cap = RuleI(Character, HasteCap);
}

if(h > cap) h = cap;

h += spellbonuses.hastetype3;
h += ExtraHaste; //GM granted haste.

if (spellbonuses.inhibitmelee){
if (h >= 0)
h -= spellbonuses.inhibitmelee;

else
h -=((100+h)*spellbonuses.inhibitmelee/100);
}

return(h);
}

Nydosa
12-15-2013, 03:44 PM
I spoke too soon. I'm assuming that will only remove the haste cap for pets and other NPCs. There's identical code in client_mods.cpp that you can fiddle with.