Core/Spells: Defined and implemented some new spell attributes

Port From (https://github.com/TrinityCore/TrinityCore/commit/1912999b9e4b1f1b7503e404d359dfeac38c3d29)
This commit is contained in:
hondacrx
2021-05-18 13:08:05 -04:00
parent 58bbbade44
commit 0f16ad75d0
9 changed files with 23 additions and 23 deletions
+1 -1
View File
@@ -891,7 +891,7 @@ namespace Game.Entities
}
// negative effects should continue counting down after logout
if (remainTime != -1 && !spellInfo.IsPositive())
if (remainTime != -1 && (!spellInfo.IsPositive() || spellInfo.HasAttribute(SpellAttr4.AuraExpiresOffline)))
{
if (remainTime / Time.InMilliseconds <= timediff)
continue;
+1 -1
View File
@@ -521,7 +521,7 @@ namespace Game.Entities
}
// negative effects should continue counting down after logout
if (remainTime != -1 && !spellInfo.IsPositive())
if (remainTime != -1 && (!spellInfo.IsPositive() || spellInfo.HasAttribute(SpellAttr4.AuraExpiresOffline)))
{
if (remainTime / Time.InMilliseconds <= timediff)
continue;
+5 -4
View File
@@ -172,7 +172,7 @@ namespace Game.Entities
return 1.0f;
// Some spells don't benefit from pct done mods
if (spellProto.HasAttribute(SpellAttr6.NoDonePctDamageMods))
if (spellProto.HasAttribute(SpellAttr6.IgnoreCasterDamageModifiers))
return 1.0f;
// For totems pct done mods are calculated when its calculation is run on the player in SpellDamageBonusDone.
@@ -3761,9 +3761,10 @@ namespace Game.Entities
RemoveAppliedAuras(aurApp =>
{
Aura aura = aurApp.GetBase();
return !aura.GetSpellInfo().HasAttribute(SpellAttr4.DontRemoveInArena) // don't remove stances, shadowform, pally/hunter auras
&& !aura.IsPassive() // don't remove passive auras
&& (aurApp.IsPositive() || !aura.GetSpellInfo().HasAttribute(SpellAttr3.DeathPersistent)); // not negative death persistent auras
return (!aura.GetSpellInfo().HasAttribute(SpellAttr4.DontRemoveInArena) // don't remove stances, shadowform, pally/hunter auras
&& !aura.IsPassive() // don't remove passive auras
&& (aurApp.IsPositive() || !aura.GetSpellInfo().HasAttribute(SpellAttr3.DeathPersistent))) || // not negative death persistent auras
aura.GetSpellInfo().HasAttribute(SpellAttr5.RemoveEnteringArena); // special marker, always remove
});
}
public void RemoveAllAurasExceptType(AuraType type)
+2 -3
View File
@@ -490,7 +490,6 @@ namespace Game.Entities
m_Events.KillAllEvents(false); // non-delatable (currently casted spells) will not deleted now but it will deleted at call in Map.RemoveAllObjectsInRemoveList
CombatStop();
GetThreatManager().ClearAllThreat();
}
public override void CleanupsBeforeDelete(bool finalCleanup = true)
{
@@ -2970,7 +2969,7 @@ namespace Game.Entities
if (damagetype != DamageEffectType.NoDamage)
{
if (victim != this && (spellProto == null || !spellProto.HasAttribute(SpellAttr7.NoPushbackOnDamage)))
if (victim != this && (spellProto == null || !(spellProto.HasAttribute(SpellAttr7.NoPushbackOnDamage) || spellProto.HasAttribute(SpellAttr3.TreatAsPeriodic))))
{
if (damagetype != DamageEffectType.DOT)
{
@@ -3829,7 +3828,7 @@ namespace Game.Entities
{
// Some spells don't benefit from pct done mods
// mods for SPELL_SCHOOL_MASK_NORMAL are already factored in base melee damage calculation
if (!spellProto.HasAttribute(SpellAttr6.NoDonePctDamageMods) && !spellProto.GetSchoolMask().HasAnyFlag(SpellSchoolMask.Normal))
if (!spellProto.HasAttribute(SpellAttr6.IgnoreCasterDamageModifiers) && !spellProto.GetSchoolMask().HasAnyFlag(SpellSchoolMask.Normal))
{
float maxModDamagePercentSchool = 0.0f;
Player thisPlayer = ToPlayer();