diff --git a/zone/common.h b/zone/common.h index 772441025..1f478c750 100644 --- a/zone/common.h +++ b/zone/common.h @@ -134,7 +134,7 @@ typedef enum { //focus types focusSwarmPetDuration, //@Fc, SPA: 398, SE_SwarmPetDuration, On Caster, swarm pet duration mod, base: milliseconds focusReduceRecastTime, //@Fc, SPA: 310, SE_ReduceReuseTimer, On Caster, disc reuse time mod, base: milliseconds focusBlockNextSpell, //@Fc, SPA: 335, SE_BlockNextSpellFocus, On Caster, chance to block next spell, base: chance - focusFcHealPctIncoming, //@Fc, SPA: 395, SE_FcHealPctCritIncoming, On Target, heal received mod pct, base: pct + focusFcHealPctIncoming, //@Fc, SPA: 393, SE_FcHealPctIncoming, On Target, heal received mod pct, base: pct focusFcDamageAmtIncoming, //@Fc, SPA: 297, SE_FcDamageAmtIncoming, On Target, damage taken flat amt, base: amt focusFcSpellDamageAmtIncomingPC, //@Fc, SPA: 484, SE_Fc_Spell_Damage_Amt_IncomingPC, On Target, damage taken flat amt, base: amt focusFcCastSpellOnLand, //@Fc, SPA: 481, SE_Fc_Cast_Spell_On_Land, On Target, cast spell if hit by spell, base: chance pct, limit: spellid @@ -151,7 +151,7 @@ typedef enum { //focus types focusFcAmplifyAmt, //@Fc, SPA: 508, SE_Fc_Amplify_Amt, On Caster, damage-heal-dot mod flat amt, base: amt focusFcCastTimeMod2, //@Fc, SPA: 500, SE_Fc_CastTimeMod2, On Caster, cast time mod pct, base: pct focusFcCastTimeAmt, //@Fc, SPA: 501, SE_Fc_CastTimeAmt, On Caster, cast time mod flat amt, base: milliseconds - focusFcHealPctCritIncoming, //@Fc, SPA: 393, SE_FcHealPctCritIncoming, On Target, heal received critical chance mod, base: chance pct + focusFcHealPctCritIncoming, //@Fc, SPA: 395, SE_FcHealPctCritIncoming, On Target, spell healing mod pct, base: pct focusFcHealAmt, //@Fc, SPA: 392, SE_FcHealAmt, On Caster, spell healing mod flat amt, base: amt focusFcHealAmtCrit, //@Fc, SPA: 396, SE_FcHealAmtCrit, On Caster, spell healing mod flat amt, base: amt } focusType; //Any new FocusType needs to be added to the Mob::IsFocus function diff --git a/zone/effects.cpp b/zone/effects.cpp index 7dc2c9efa..fcc4d8f1c 100644 --- a/zone/effects.cpp +++ b/zone/effects.cpp @@ -316,8 +316,8 @@ int32 Mob::GetActSpellHealing(uint16 spell_id, int32 value, Mob* target) { if (spells[spell_id].buffduration < 1) { if (target) { - value += int(value_BaseEffect + target->GetFocusIncoming(focusFcHealPctCritIncoming, SE_FcHealPctCritIncoming, this, spell_id) / 100); //SPA 395 ? Add before critical - value += int(value_BaseEffect + target->GetFocusIncoming(focusFcHealPctCritIncoming, SE_FcHealPctIncoming, this, spell_id) / 100); //SPA 393 Add before critical + value += int(value_BaseEffect + target->GetFocusIncoming(focusFcHealPctIncoming, SE_FcHealPctIncoming, this, spell_id) / 100); //SPA 393 Add before critical + value += int(value_BaseEffect + target->GetFocusIncoming(focusFcHealPctCritIncoming, SE_FcHealPctCritIncoming, this, spell_id) / 100); //SPA 395 Add before critical (?) } value += GetFocusEffect(focusFcHealAmtCrit, spell_id); //SPA 396 Add before critical @@ -331,8 +331,6 @@ int32 Mob::GetActSpellHealing(uint16 spell_id, int32 value, Mob* target) { incoming_heal_mod_percent = std::min(incoming_heal_mod_percent, -100); value += value * incoming_heal_mod_percent / 100; } - - //value += value * target->GetHealRate(spell_id, this) / 100; //SPA 120 modifies value after Focus Applied but before critical /* Apply critical hit modifier diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index 21a3a5f10..b8d9ec55b 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -5741,7 +5741,7 @@ int32 Mob::CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, boo case SE_FcHealPctCritIncoming: if (type == focusFcHealPctCritIncoming) { - value = focus_spell.base[i]; + value = GetFocusRandomEffectivenessValue(focus_spell.base[i], focus_spell.base2[i], best_focus); } break; @@ -5759,7 +5759,7 @@ int32 Mob::CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, boo case SE_FcHealPctIncoming: if (type == focusFcHealPctIncoming) { - value = focus_spell.base[i]; + value = GetFocusRandomEffectivenessValue(focus_spell.base[i], focus_spell.base2[i], best_focus); } break; @@ -5923,7 +5923,7 @@ void Mob::TryTriggerOnCastFocusEffect(focusType type, uint16 spell_id) } } - // Only use of this focus per AA effect. + // Only use one of this focus per AA effect. if (IsClient() && aabonuses.FocusEffects[type]) { for (const auto &aa : aa_ranks) { auto ability_rank = zone->GetAlternateAdvancementAbilityAndRank(aa.first, aa.second.first); @@ -6937,44 +6937,46 @@ int32 Mob::GetFocusIncoming(focusType type, int effect, Mob *caster, uint32 spel Example: When your target has a focus limited buff that increases amount of healing on them. */ - if (!caster) + if (!caster) { return 0; + } int value = 0; if (spellbonuses.FocusEffects[type]){ - int32 tmp_focus = 0; - int tmp_buffslot = -1; + int32 tmp_focus = 0; + int tmp_buffslot = -1; - int buff_count = GetMaxTotalSlots(); - for(int i = 0; i < buff_count; i++) { + int buff_count = GetMaxTotalSlots(); + for(int i = 0; i < buff_count; i++) { - if((IsValidSpell(buffs[i].spellid) && IsEffectInSpell(buffs[i].spellid, effect))){ + if((IsValidSpell(buffs[i].spellid) && IsEffectInSpell(buffs[i].spellid, effect))){ - int32 focus = caster->CalcFocusEffect(type, buffs[i].spellid, spell_id); + int32 focus = caster->CalcFocusEffect(type, buffs[i].spellid, spell_id); - if (!focus) - continue; + if (!focus) { + continue; + } - if (tmp_focus && focus > tmp_focus){ - tmp_focus = focus; - tmp_buffslot = i; - } + if (tmp_focus && focus > tmp_focus){ + tmp_focus = focus; + tmp_buffslot = i; + } - else if (!tmp_focus){ - tmp_focus = focus; - tmp_buffslot = i; - } + else if (!tmp_focus){ + tmp_focus = focus; + tmp_buffslot = i; } } - - value = tmp_focus; - - if (tmp_buffslot >= 0) - CheckNumHitsRemaining(NumHit::MatchingSpells, tmp_buffslot); } + value = tmp_focus; + + if (tmp_buffslot >= 0) + CheckNumHitsRemaining(NumHit::MatchingSpells, tmp_buffslot); + } + return value; } @@ -8496,6 +8498,8 @@ bool Mob::CanFocusUseRandomEffectivenessByType(focusType type) case focusSpellHateMod: case focusSpellVulnerability: case focusFcSpellDamagePctIncomingPC: + case focusFcHealPctIncoming: + case focusFcHealPctCritIncoming: return true; }