fix(Core/Spell): Implement SPELL_ATTR1_AURA_STAYS_AFTER_COMBAT (#19254)
feat(Core/Spell): Implement SPELL_ATTR1_AURA_STAYS_AFTER_COMBAT * closes https://github.com/azerothcore/azerothcore-wotlk/issues/19248
This commit is contained in:
@@ -15,8 +15,8 @@
|
|||||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "Define.h"
|
|
||||||
#include "LogCommon.h"
|
#include "LogCommon.h"
|
||||||
|
#include "Define.h"
|
||||||
#include "SmartEnum.h"
|
#include "SmartEnum.h"
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
|
||||||
|
|||||||
@@ -15,8 +15,8 @@
|
|||||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "Define.h"
|
|
||||||
#include "Item.h"
|
#include "Item.h"
|
||||||
|
#include "Define.h"
|
||||||
#include "SmartEnum.h"
|
#include "SmartEnum.h"
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
|
||||||
|
|||||||
@@ -3453,7 +3453,8 @@ SpellMissInfo Unit::SpellHitResult(Unit* victim, SpellInfo const* spell, bool Ca
|
|||||||
return SPELL_MISS_NONE;
|
return SPELL_MISS_NONE;
|
||||||
|
|
||||||
// Return evade for units in evade mode
|
// Return evade for units in evade mode
|
||||||
if (victim->GetTypeId() == TYPEID_UNIT && victim->ToCreature()->IsEvadingAttacks() && !spell->HasAura(SPELL_AURA_CONTROL_VEHICLE) && !spell->HasAttribute(SPELL_ATTR0_CU_IGNORE_EVADE))
|
if (victim->GetTypeId() == TYPEID_UNIT && victim->ToCreature()->IsEvadingAttacks() && !spell->HasAura(SPELL_AURA_CONTROL_VEHICLE)
|
||||||
|
&& !spell->HasAttribute(SPELL_ATTR0_CU_IGNORE_EVADE) && !spell->HasAttribute(SPELL_ATTR1_AURA_STAYS_AFTER_COMBAT))
|
||||||
return SPELL_MISS_EVADE;
|
return SPELL_MISS_EVADE;
|
||||||
|
|
||||||
// Try victim reflect spell
|
// Try victim reflect spell
|
||||||
@@ -3528,7 +3529,7 @@ SpellMissInfo Unit::SpellHitResult(Unit* victim, Spell const* spell, bool CanRef
|
|||||||
|
|
||||||
// Return evade for units in evade mode
|
// Return evade for units in evade mode
|
||||||
if (victim->GetTypeId() == TYPEID_UNIT && victim->ToCreature()->IsEvadingAttacks() && !spellInfo->HasAura(SPELL_AURA_CONTROL_VEHICLE) &&
|
if (victim->GetTypeId() == TYPEID_UNIT && victim->ToCreature()->IsEvadingAttacks() && !spellInfo->HasAura(SPELL_AURA_CONTROL_VEHICLE) &&
|
||||||
!spellInfo->HasAttribute(SPELL_ATTR0_CU_IGNORE_EVADE))
|
!spellInfo->HasAttribute(SPELL_ATTR0_CU_IGNORE_EVADE) && !spellInfo->HasAttribute(SPELL_ATTR1_AURA_STAYS_AFTER_COMBAT))
|
||||||
{
|
{
|
||||||
return SPELL_MISS_EVADE;
|
return SPELL_MISS_EVADE;
|
||||||
}
|
}
|
||||||
@@ -5384,7 +5385,8 @@ void Unit::RemoveEvadeAuras()
|
|||||||
{
|
{
|
||||||
Aura const* aura = iter->second->GetBase();
|
Aura const* aura = iter->second->GetBase();
|
||||||
SpellInfo const* spellInfo = aura->GetSpellInfo();
|
SpellInfo const* spellInfo = aura->GetSpellInfo();
|
||||||
if (spellInfo->HasAttribute(SPELL_ATTR0_CU_IGNORE_EVADE) || spellInfo->HasAura(SPELL_AURA_CONTROL_VEHICLE) || spellInfo->HasAura(SPELL_AURA_CLONE_CASTER) || (aura->IsPassive() && GetOwnerGUID().IsPlayer()))
|
if (spellInfo->HasAttribute(SPELL_ATTR0_CU_IGNORE_EVADE) || spellInfo->HasAttribute(SPELL_ATTR1_AURA_STAYS_AFTER_COMBAT) || spellInfo->HasAura(SPELL_AURA_CONTROL_VEHICLE)
|
||||||
|
|| spellInfo->HasAura(SPELL_AURA_CLONE_CASTER) || (aura->IsPassive() && GetOwnerGUID().IsPlayer()))
|
||||||
++iter;
|
++iter;
|
||||||
else
|
else
|
||||||
_UnapplyAura(iter, AURA_REMOVE_BY_DEFAULT);
|
_UnapplyAura(iter, AURA_REMOVE_BY_DEFAULT);
|
||||||
@@ -5394,7 +5396,8 @@ void Unit::RemoveEvadeAuras()
|
|||||||
{
|
{
|
||||||
Aura* aura = iter->second;
|
Aura* aura = iter->second;
|
||||||
SpellInfo const* spellInfo = aura->GetSpellInfo();
|
SpellInfo const* spellInfo = aura->GetSpellInfo();
|
||||||
if (spellInfo->HasAttribute(SPELL_ATTR0_CU_IGNORE_EVADE) || spellInfo->HasAura(SPELL_AURA_CONTROL_VEHICLE) || spellInfo->HasAura(SPELL_AURA_CLONE_CASTER) || (aura->IsPassive() && GetOwnerGUID().IsPlayer()))
|
if (spellInfo->HasAttribute(SPELL_ATTR0_CU_IGNORE_EVADE) || spellInfo->HasAttribute(SPELL_ATTR1_AURA_STAYS_AFTER_COMBAT) || spellInfo->HasAura(SPELL_AURA_CONTROL_VEHICLE)
|
||||||
|
|| spellInfo->HasAura(SPELL_AURA_CLONE_CASTER) || (aura->IsPassive() && GetOwnerGUID().IsPlayer()))
|
||||||
++iter;
|
++iter;
|
||||||
else
|
else
|
||||||
RemoveOwnedAura(iter, AURA_REMOVE_BY_DEFAULT);
|
RemoveOwnedAura(iter, AURA_REMOVE_BY_DEFAULT);
|
||||||
|
|||||||
@@ -15,9 +15,9 @@
|
|||||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "Unit.h"
|
||||||
#include "Define.h"
|
#include "Define.h"
|
||||||
#include "SmartEnum.h"
|
#include "SmartEnum.h"
|
||||||
#include "Unit.h"
|
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
|
||||||
namespace Acore::Impl::EnumUtilsImpl
|
namespace Acore::Impl::EnumUtilsImpl
|
||||||
|
|||||||
@@ -15,8 +15,8 @@
|
|||||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "Define.h"
|
|
||||||
#include "QuestDef.h"
|
#include "QuestDef.h"
|
||||||
|
#include "Define.h"
|
||||||
#include "SmartEnum.h"
|
#include "SmartEnum.h"
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
|
||||||
|
|||||||
@@ -15,9 +15,9 @@
|
|||||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "WardenCheckMgr.h"
|
||||||
#include "Define.h"
|
#include "Define.h"
|
||||||
#include "SmartEnum.h"
|
#include "SmartEnum.h"
|
||||||
#include "WardenCheckMgr.h"
|
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
|
||||||
namespace Acore::Impl::EnumUtilsImpl
|
namespace Acore::Impl::EnumUtilsImpl
|
||||||
|
|||||||
@@ -441,7 +441,7 @@ enum SpellAttr1 : uint32
|
|||||||
SPELL_ATTR1_FINISHING_MOVE_DURATION = 0x00400000, // TITLE Requires combo points (type 2)
|
SPELL_ATTR1_FINISHING_MOVE_DURATION = 0x00400000, // TITLE Requires combo points (type 2)
|
||||||
SPELL_ATTR1_IGNORE_OWNERS_DEATH = 0x00800000, // TITLE Unknwon attribute 23@Attr1
|
SPELL_ATTR1_IGNORE_OWNERS_DEATH = 0x00800000, // TITLE Unknwon attribute 23@Attr1
|
||||||
SPELL_ATTR1_SPECIAL_SKILLUP = 0x01000000, // TITLE Fishing (client only)
|
SPELL_ATTR1_SPECIAL_SKILLUP = 0x01000000, // TITLE Fishing (client only)
|
||||||
SPELL_ATTR1_AURA_STAYS_AFTER_COMBAT = 0x02000000, // TITLE Unknown attribute 25@Attr1
|
SPELL_ATTR1_AURA_STAYS_AFTER_COMBAT = 0x02000000, // TITLE Aura stays after combat DESCRIPTION Aura will not be removed when the unit leaves combat
|
||||||
SPELL_ATTR1_REQUIRE_ALL_TARGETS = 0x04000000, // TITLE Unknown attribute 26@Attr1 DESCRIPTION Related to [target=focus] and [target=mouseover] macros?
|
SPELL_ATTR1_REQUIRE_ALL_TARGETS = 0x04000000, // TITLE Unknown attribute 26@Attr1 DESCRIPTION Related to [target=focus] and [target=mouseover] macros?
|
||||||
SPELL_ATTR1_DISCOUNT_POWER_ON_MISS = 0x08000000, // TITLE Unknown attribute 27@Attr1 DESCRIPTION Melee spell?
|
SPELL_ATTR1_DISCOUNT_POWER_ON_MISS = 0x08000000, // TITLE Unknown attribute 27@Attr1 DESCRIPTION Melee spell?
|
||||||
SPELL_ATTR1_NO_AURA_ICON = 0x10000000, // TITLE Hide in aura bar (client only)
|
SPELL_ATTR1_NO_AURA_ICON = 0x10000000, // TITLE Hide in aura bar (client only)
|
||||||
|
|||||||
@@ -15,8 +15,8 @@
|
|||||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "Define.h"
|
|
||||||
#include "SharedDefines.h"
|
#include "SharedDefines.h"
|
||||||
|
#include "Define.h"
|
||||||
#include "SmartEnum.h"
|
#include "SmartEnum.h"
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
|
||||||
@@ -311,7 +311,7 @@ AC_API_EXPORT EnumText EnumUtils<SpellAttr1>::ToString(SpellAttr1 value)
|
|||||||
case SPELL_ATTR1_FINISHING_MOVE_DURATION: return { "SPELL_ATTR1_FINISHING_MOVE_DURATION", "Requires combo points (type 2)", "" };
|
case SPELL_ATTR1_FINISHING_MOVE_DURATION: return { "SPELL_ATTR1_FINISHING_MOVE_DURATION", "Requires combo points (type 2)", "" };
|
||||||
case SPELL_ATTR1_IGNORE_OWNERS_DEATH: return { "SPELL_ATTR1_IGNORE_OWNERS_DEATH", "Unknwon attribute 23@Attr1", "" };
|
case SPELL_ATTR1_IGNORE_OWNERS_DEATH: return { "SPELL_ATTR1_IGNORE_OWNERS_DEATH", "Unknwon attribute 23@Attr1", "" };
|
||||||
case SPELL_ATTR1_SPECIAL_SKILLUP: return { "SPELL_ATTR1_SPECIAL_SKILLUP", "Fishing (client only)", "" };
|
case SPELL_ATTR1_SPECIAL_SKILLUP: return { "SPELL_ATTR1_SPECIAL_SKILLUP", "Fishing (client only)", "" };
|
||||||
case SPELL_ATTR1_AURA_STAYS_AFTER_COMBAT: return { "SPELL_ATTR1_AURA_STAYS_AFTER_COMBAT", "Unknown attribute 25@Attr1", "" };
|
case SPELL_ATTR1_AURA_STAYS_AFTER_COMBAT: return { "SPELL_ATTR1_AURA_STAYS_AFTER_COMBAT", "Aura stays after combat", "Aura will not be removed when the unit leaves combat" };
|
||||||
case SPELL_ATTR1_REQUIRE_ALL_TARGETS: return { "SPELL_ATTR1_REQUIRE_ALL_TARGETS", "Unknown attribute 26@Attr1", "Related to [target=focus] and [target=mouseover] macros?" };
|
case SPELL_ATTR1_REQUIRE_ALL_TARGETS: return { "SPELL_ATTR1_REQUIRE_ALL_TARGETS", "Unknown attribute 26@Attr1", "Related to [target=focus] and [target=mouseover] macros?" };
|
||||||
case SPELL_ATTR1_DISCOUNT_POWER_ON_MISS: return { "SPELL_ATTR1_DISCOUNT_POWER_ON_MISS", "Unknown attribute 27@Attr1", "Melee spell?" };
|
case SPELL_ATTR1_DISCOUNT_POWER_ON_MISS: return { "SPELL_ATTR1_DISCOUNT_POWER_ON_MISS", "Unknown attribute 27@Attr1", "Melee spell?" };
|
||||||
case SPELL_ATTR1_NO_AURA_ICON: return { "SPELL_ATTR1_NO_AURA_ICON", "Hide in aura bar (client only)", "" };
|
case SPELL_ATTR1_NO_AURA_ICON: return { "SPELL_ATTR1_NO_AURA_ICON", "Hide in aura bar (client only)", "" };
|
||||||
|
|||||||
Reference in New Issue
Block a user