[Spells] Update to SPA 297 and 484 to support focus from AA and items. (#1858)

[Spells] Update to SPA 297 and 484 to support focus from  AA and items.
This commit is contained in:
KayenEQ
2021-12-03 15:39:06 -05:00
committed by GitHub
parent 4a154686e1
commit 82000949e3
5 changed files with 9 additions and 69 deletions
+4 -64
View File
@@ -7102,72 +7102,12 @@ bool Mob::DoHPToManaCovert(uint16 mana_cost)
return false;
}
int32 Mob::GetFcDamageAmtIncoming(Mob *caster, uint32 spell_id, bool use_skill, uint16 skill )
int32 Mob::GetFcDamageAmtIncoming(Mob *caster, int32 spell_id)
{
//Used to check focus derived from SE_FcDamageAmtIncoming which adds direct damage to Spells or Skill based attacks.
//Used to check focus derived from SE_Fc_Spell_Damage_Amt_IncomingPC which adds direct damage to Spells.
//THIS is target of spell cast
int32 dmg = 0;
bool limit_exists = false;
bool skill_found = false;
if (!caster)
return 0;
if (spellbonuses.FocusEffects[focusFcDamageAmtIncoming]){
int buff_count = GetMaxTotalSlots();
for(int i = 0; i < buff_count; i++){
if( (IsValidSpell(buffs[i].spellid) && (IsEffectInSpell(buffs[i].spellid, SE_FcDamageAmtIncoming))) ){
if (use_skill){
int32 temp_dmg = 0;
for (int e = 0; e < EFFECT_COUNT; e++) {
if (spells[buffs[i].spellid].effect_id[e] == SE_FcDamageAmtIncoming){
temp_dmg += spells[buffs[i].spellid].base_value[e];
continue;
}
if (!skill_found){
if ((spells[buffs[i].spellid].effect_id[e] == SE_LimitToSkill) ||
(spells[buffs[i].spellid].effect_id[e] == SE_LimitCastingSkill)){
limit_exists = true;
if (spells[buffs[i].spellid].base_value[e] == skill)
skill_found = true;
}
}
}
if ((!limit_exists) || (limit_exists && skill_found)){
dmg += temp_dmg;
CheckNumHitsRemaining(NumHit::MatchingSpells, i);
}
}
else{
int32 focus = caster->CalcFocusEffect(focusFcDamageAmtIncoming, buffs[i].spellid, spell_id);
if(focus){
dmg += focus;
CheckNumHitsRemaining(NumHit::MatchingSpells, i);
}
}
}
}
}
if (spellbonuses.FocusEffects[focusFcSpellDamageAmtIncomingPC]) {
int buff_count = GetMaxTotalSlots();
for (int i = 0; i < buff_count; i++) {
if ((IsValidSpell(buffs[i].spellid) && (IsEffectInSpell(buffs[i].spellid, SE_FcDamageAmtIncoming)))) {
int32 focus = caster->CalcFocusEffect(focusFcSpellDamageAmtIncomingPC, buffs[i].spellid, spell_id);
if (focus) {
dmg += focus;
CheckNumHitsRemaining(NumHit::MatchingSpells, i);
}
}
}
}
dmg += GetFocusEffect(focusFcDamageAmtIncoming, spell_id); //SPA 297 SE_FcDamageAmtIncoming
dmg += GetFocusEffect(focusFcSpellDamageAmtIncomingPC, spell_id); //SPA 484 SE_Fc_Spell_Damage_Amt_IncomingPC
return dmg;
}