From c0ea82f9e108a43c6bede64a6c5a05bf46917e08 Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Sun, 21 Jun 2015 02:58:43 -0400 Subject: [PATCH] SE_MeleeVulnerability really really is Max Mana limit Also found the cause of bard song tick increase and removed the uneeded code Also removed the IsBardSong check from GetFocusEffect, it really shouldn't be needed, but will need to keep an eye out. The focus effects should most often limit out the bard songs anyways --- common/spdat.h | 2 +- zone/bonuses.cpp | 14 -------------- zone/common.h | 1 - zone/effects.cpp | 6 ------ zone/mob.cpp | 3 --- zone/spell_effects.cpp | 21 ++++++++++++++------- 6 files changed, 15 insertions(+), 32 deletions(-) diff --git a/common/spdat.h b/common/spdat.h index c8e039f15..938b659e1 100644 --- a/common/spdat.h +++ b/common/spdat.h @@ -544,7 +544,7 @@ typedef enum { //#define SE_SummonCorpseZone 388 // *not implemented - summons a corpse from any zone(nec AA) #define SE_FcTimerRefresh 389 // implemented - Refresh spell icons //#define SE_FcTimerLockout 390 // *not implemented - Sets recast timers to specific value, focus limited. -#define SE_MeleeVulnerability 391 // implemented [Live SPA has this as LimitManaMax however that is clearly not the effect used] +#define SE_LimitManaMax 391 // implemented #define SE_FcHealAmt 392 // implemented - Adds or removes healing from spells #define SE_FcHealPctIncoming 393 // implemented - HealRate with focus restrictions. #define SE_FcHealAmtIncoming 394 // implemented - Adds/Removes amount of healing on target by X value with foucs restrictions. diff --git a/zone/bonuses.cpp b/zone/bonuses.cpp index e90f9626a..7ff8e7fc7 100644 --- a/zone/bonuses.cpp +++ b/zone/bonuses.cpp @@ -1333,10 +1333,6 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon) newbon->PetMeleeMitigation += base1; break; - case SE_MeleeVulnerability: - newbon->MeleeVulnerability += base1; - break; - case SE_FactionModPct: { if ((base1 < 0) && (newbon->FactionModPct > base1)) newbon->FactionModPct = base1; @@ -3008,10 +3004,6 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne new_bonus->PetMeleeMitigation += effect_value; break; - case SE_MeleeVulnerability: - new_bonus->MeleeVulnerability += effect_value; - break; - case SE_Sanctuary: new_bonus->Sanctuary = true; break; @@ -4588,12 +4580,6 @@ void Mob::NegateSpellsBonuses(uint16 spell_id) aabonuses.FactionModPct = effect_value; break; - case SE_MeleeVulnerability: - spellbonuses.MeleeVulnerability = effect_value; - itembonuses.MeleeVulnerability = effect_value; - aabonuses.MeleeVulnerability = effect_value; - break; - case SE_IllusionPersistence: spellbonuses.IllusionPersistence = false; itembonuses.IllusionPersistence = false; diff --git a/zone/common.h b/zone/common.h index d21a0039d..e9521cb94 100644 --- a/zone/common.h +++ b/zone/common.h @@ -400,7 +400,6 @@ struct StatBonuses { int32 Metabolism; // Food/drink consumption rates. bool Sanctuary; // Sanctuary effect, lowers place on hate list until cast on others. int32 FactionModPct; // Modifies amount of faction gained. - int32 MeleeVulnerability; // Weakness/mitigation to melee damage bool LimitToSkill[HIGHEST_SKILL+2]; // Determines if we need to search for a skill proc. uint32 SkillProc[MAX_SKILL_PROCS]; // Max number of spells containing skill_procs. uint32 SkillProcSuccess[MAX_SKILL_PROCS]; // Max number of spells containing skill_procs_success. diff --git a/zone/effects.cpp b/zone/effects.cpp index 68e68e78d..85a858c94 100644 --- a/zone/effects.cpp +++ b/zone/effects.cpp @@ -421,12 +421,6 @@ int32 Mob::GetActSpellDuration(uint16 spell_id, int32 duration) int tic_inc = 0; tic_inc = GetFocusEffect(focusSpellDurByTic, spell_id); - // unsure on the exact details, but bard songs that don't cost mana at some point get an extra tick, 60 for now - // a level 53 bard reported getting 2 tics - // bard DOTs do get this extra tick, but beneficial long bard songs don't? (invul, crescendo) - if ((IsShortDurationBuff(spell_id) || IsDetrimentalSpell(spell_id)) && IsBardSong(spell_id) && - spells[spell_id].mana == 0 && GetClass() == BARD && GetLevel() > 60) - tic_inc++; float focused = ((duration * increase) / 100.0f) + tic_inc; int ifocused = static_cast(focused); diff --git a/zone/mob.cpp b/zone/mob.cpp index 4eb87f7ad..1777bb7a3 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -3769,11 +3769,8 @@ int16 Mob::GetSkillDmgTaken(const SkillUseTypes skill_used) skilldmg_mod += itembonuses.SkillDmgTaken[HIGHEST_SKILL+1] + spellbonuses.SkillDmgTaken[HIGHEST_SKILL+1] + itembonuses.SkillDmgTaken[skill_used] + spellbonuses.SkillDmgTaken[skill_used]; - skilldmg_mod += SkillDmgTaken_Mod[skill_used] + SkillDmgTaken_Mod[HIGHEST_SKILL+1]; - skilldmg_mod += spellbonuses.MeleeVulnerability + itembonuses.MeleeVulnerability + aabonuses.MeleeVulnerability; - if(skilldmg_mod < -100) skilldmg_mod = -100; diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index 5c30185aa..71740e589 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -2948,7 +2948,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove case SE_FcIncreaseNumHits: case SE_CastonFocusEffect: case SE_FcHealAmtIncoming: - case SE_MeleeVulnerability: + case SE_LimitManaMax: case SE_DoubleRangedAttack: case SE_ShieldEquipHateMod: case SE_ShieldEquipDmgMod: @@ -3356,7 +3356,7 @@ void Mob::BuffProcess() { --buffs[buffs_i].ticsremaining; - if ((buffs[buffs_i].ticsremaining == 0 && !IsShortDurationBuff(buffs[buffs_i].spellid)) || buffs[buffs_i].ticsremaining < 0) { + if ((buffs[buffs_i].ticsremaining == 0 && !(IsShortDurationBuff(buffs[buffs_i].spellid) || IsBardSong(buffs[buffs_i].spellid))) || buffs[buffs_i].ticsremaining < 0) { Log.Out(Logs::Detail, Logs::Spells, "Buff %d in slot %d has expired. Fading.", buffs[buffs_i].spellid, buffs_i); BuffFadeBySlot(buffs_i); } @@ -4301,6 +4301,11 @@ int16 Client::CalcAAFocus(focusType type, const AA::Rank &rank, uint16 spell_id) LimitFailure = true; break; + case SE_LimitManaMax: + if (spell.mana > base1) + LimitFailure = true; + break; + case SE_LimitTarget: if (base1 < 0) { if (-base1 == spell.targettype) // Exclude @@ -4719,6 +4724,11 @@ int16 Mob::CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, boo return 0; break; + case SE_LimitManaMax: + if (spell.mana > focus_spell.base[i]) + return 0; + break; + case SE_LimitTarget: if (focus_spell.base[i] < 0) { if (-focus_spell.base[i] == spell.targettype) // Exclude @@ -5178,11 +5188,8 @@ uint16 Client::GetSympatheticFocusEffect(focusType type, uint16 spell_id) { return 0; } -int16 Client::GetFocusEffect(focusType type, uint16 spell_id) { - - if (IsBardSong(spell_id) && type != focusFcBaseEffects) - return 0; - +int16 Client::GetFocusEffect(focusType type, uint16 spell_id) +{ int16 realTotal = 0; int16 realTotal2 = 0; int16 realTotal3 = 0;