[Fix] Fix Spell Cast Time reduction issues (#1369)

Remove the overloads that don't make sense (bots probably doesn't make
sense either, but too lazy)

Fix the formulas

Removed the Spells:MaxCastTimeReduction rule since this is HARDCODED in
the client so it doesn't really make sense to have it as a customization
point. If you want to hack the client, change the hardcode as well I
guess.
This commit is contained in:
Michael Cook (mackal) 2021-05-24 21:21:39 -04:00 committed by GitHub
parent 93329b4b06
commit e5b9d72b81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 17 additions and 65 deletions

View File

@ -326,7 +326,6 @@ RULE_INT(Spells, CharismaEffectivenessCap, 255, "Determines how much resist modi
RULE_BOOL(Spells, CharismaCharmDuration, false, "Allow CHA resist mod to extend charm duration")
RULE_INT(Spells, CharmBreakCheckChance, 25, "Determines chance for a charm break check to occur each buff tick")
RULE_BOOL(Spells, CharmDisablesSpecialAbilities, false, "When charm is cast on an NPC, strip their special abilities")
RULE_INT(Spells, MaxCastTimeReduction, 50, "Maximum percent your spell cast time can be reduced by spell haste")
RULE_INT(Spells, RootBreakFromSpells, 55, "Chance for root to break when cast on")
RULE_INT(Spells, DeathSaveCharismaMod, 3, "Determines how much charisma effects chance of death save firing")
RULE_INT(Spells, DivineInterventionHeal, 8000, "Divine intervention heal amount")

View File

@ -7101,12 +7101,14 @@ int32 Bot::GetActSpellHealing(uint16 spell_id, int32 value, Mob* target) {
}
int32 Bot::GetActSpellCasttime(uint16 spell_id, int32 casttime) {
int32 cast_reducer = 0;
cast_reducer += GetBotFocusEffect(focusSpellHaste, spell_id);
int32 cast_reducer = GetBotFocusEffect(focusSpellHaste, spell_id);
uint8 botlevel = GetLevel();
uint8 botclass = GetClass();
if (botlevel >= 51 && casttime >= 3000 && !BeneficialSpell(spell_id) && (botclass == SHADOWKNIGHT || botclass == RANGER || botclass == PALADIN || botclass == BEASTLORD ))
cast_reducer += ((GetLevel() - 50) * 3);
if (botlevel >= 51 && casttime >= 3000 && !spells[spell_id].goodEffect &&
(botclass == SHADOWKNIGHT || botclass == RANGER || botclass == PALADIN || botclass == BEASTLORD)) {
int level_mod = std::min(15, botlevel - 50);
cast_reducer += level_mod * 3;
}
if((casttime >= 4000) && BeneficialSpell(spell_id) && IsBuffSpell(spell_id)) {
switch (GetAA(aaSpellCastingDeftness)) {
@ -7176,11 +7178,8 @@ int32 Bot::GetActSpellCasttime(uint16 spell_id, int32 casttime) {
}
}
if (cast_reducer > RuleI(Spells, MaxCastTimeReduction))
cast_reducer = RuleI(Spells, MaxCastTimeReduction);
casttime = (casttime * (100 - cast_reducer) / 100);
return casttime;
casttime = casttime * (100 - cast_reducer) / 100;
return std::max(casttime, casttime / 2);
}
int32 Bot::GetActSpellCost(uint16 spell_id, int32 cost) {

View File

@ -550,7 +550,6 @@ public:
inline virtual int32 GetDelayDeath() const { return aabonuses.DelayDeath + spellbonuses.DelayDeath + itembonuses.DelayDeath + 11; }
int32 GetActSpellCost(uint16 spell_id, int32);
int32 GetActSpellCasttime(uint16 spell_id, int32);
virtual bool CheckFizzle(uint16 spell_id);
virtual bool CheckSpellLevelRestriction(uint16 spell_id);
virtual int GetCurrentBuffSlots() const;

View File

@ -407,29 +407,6 @@ int32 Mob::GetActSpellDuration(uint16 spell_id, int32 duration)
return ifocused + 1;
}
int32 Client::GetActSpellCasttime(uint16 spell_id, int32 casttime)
{
int32 cast_reducer = 0;
cast_reducer += GetFocusEffect(focusSpellHaste, spell_id);
//this function loops through the effects of spell_id many times
//could easily be consolidated.
if (GetLevel() >= 51 && casttime >= 3000 && !BeneficialSpell(spell_id)
&& (GetClass() == SHADOWKNIGHT || GetClass() == RANGER
|| GetClass() == PALADIN || GetClass() == BEASTLORD ))
cast_reducer += (GetLevel()-50)*3;
//LIVE AA SpellCastingDeftness, QuickBuff, QuickSummoning, QuickEvacuation, QuickDamage
if (cast_reducer > RuleI(Spells, MaxCastTimeReduction))
cast_reducer = RuleI(Spells, MaxCastTimeReduction);
casttime = (casttime*(100 - cast_reducer)/100);
return casttime;
}
bool Client::TrainDiscipline(uint32 itemid) {
//get the item info

View File

@ -2756,19 +2756,6 @@ int32 Merc::GetActSpellCost(uint16 spell_id, int32 cost)
return cost;
}
int32 Merc::GetActSpellCasttime(uint16 spell_id, int32 casttime)
{
int32 cast_reducer = 0;
cast_reducer += GetFocusEffect(focusSpellHaste, spell_id);
if (cast_reducer > RuleI(Spells, MaxCastTimeReduction))
cast_reducer = RuleI(Spells, MaxCastTimeReduction);
casttime = (casttime*(100 - cast_reducer)/100);
return casttime;
}
int8 Merc::GetChanceToCastBySpellType(uint32 spellType) {
int mercStance = (int)GetStance();
int8 mercClass = GetClass();

View File

@ -83,7 +83,6 @@ public:
Corpse* GetGroupMemberCorpse();
// Merc Spell Casting Methods
virtual int32 GetActSpellCasttime(uint16 spell_id, int32 casttime);
virtual int32 GetActSpellCost(uint16 spell_id, int32 cost);
int8 GetChanceToCastBySpellType(uint32 spellType);
void SetSpellRecastTimer(uint16 timer_id, uint16 spellid, uint32 recast_delay);

View File

@ -3112,26 +3112,18 @@ uint32 Mob::GetLevelHP(uint8 tlevel)
return multiplier;
}
int32 Mob::GetActSpellCasttime(uint16 spell_id, int32 casttime) {
int32 Mob::GetActSpellCasttime(uint16 spell_id, int32 casttime)
{
int32 cast_reducer = GetFocusEffect(focusSpellHaste, spell_id);
int32 cast_reducer = 0;
cast_reducer += GetFocusEffect(focusSpellHaste, spell_id);
if (level >= 60 && casttime > 1000)
{
casttime = casttime / 2;
if (casttime < 1000)
casttime = 1000;
} else if (level >= 50 && casttime > 1000) {
int32 cast_deduction = (casttime*(level - 49))/5;
if (cast_deduction > casttime/2)
casttime /= 2;
else
casttime -= cast_deduction;
if (level > 50 && casttime >= 3000 && !spells[spell_id].goodEffect &&
(GetClass() == RANGER || GetClass() == SHADOWKNIGHT || GetClass() == PALADIN || GetClass() == BEASTLORD)) {
int level_mod = std::min(15, GetLevel() - 50);
cast_reducer += level_mod * 3;
}
casttime = (casttime*(100 - cast_reducer)/100);
return casttime;
casttime = casttime * (100 - cast_reducer) / 100;
return std::max(casttime, casttime / 2);
}
void Mob::ExecWeaponProc(const EQ::ItemInstance *inst, uint16 spell_id, Mob *on, int level_override) {