Merge branch 'azerothcore:master' into Playerbot

This commit is contained in:
ZhengPeiRu21
2022-05-23 09:04:16 -06:00
committed by GitHub
67 changed files with 339 additions and 201 deletions

View File

@@ -203,7 +203,7 @@ public:
void EnterEvadeMode(EvadeReason /*why*/) override
{
me->RemoveAllAuras();
me->DeleteThreatList();
me->GetThreatMgr().ClearAllThreat();
me->CombatStop(true);
me->LoadCreaturesAddon(true);
if (me->IsAlive())

View File

@@ -779,7 +779,7 @@ public:
//do not call EnterEvadeMode(), it will create infinit loops
boss->Respawn();
boss->RemoveAllAuras();
boss->DeleteThreatList();
boss->GetThreatMgr().ClearAllThreat();
boss->CombatStop(true);
boss->LoadCreaturesAddon(true);
boss->GetMotionMaster()->MoveTargetedHome();

View File

@@ -1243,7 +1243,7 @@ public:
Julianne->GetMotionMaster()->Clear();
Julianne->setDeathState(JUST_DIED);
Julianne->CombatStop(true);
Julianne->DeleteThreatList();
Julianne->GetThreatMgr().ClearAllThreat();
Julianne->ReplaceAllDynamicFlags(UNIT_DYNFLAG_LOOTABLE);
}
return;
@@ -1546,7 +1546,7 @@ void boss_julianne::boss_julianneAI::DamageTaken(Unit* /*done_by*/, uint32& dama
Romulo->GetMotionMaster()->Clear();
Romulo->setDeathState(JUST_DIED);
Romulo->CombatStop(true);
Romulo->DeleteThreatList();
Romulo->GetThreatMgr().ClearAllThreat();
Romulo->ReplaceAllDynamicFlags(UNIT_DYNFLAG_LOOTABLE);
}

View File

@@ -242,7 +242,7 @@ public:
void EnterEvadeMode(EvadeReason /*why*/) override
{
me->DeleteThreatList();
me->GetThreatMgr().ClearAllThreat();
me->CombatStop(false);
me->SetLootRecipient(nullptr);

View File

@@ -697,13 +697,13 @@ public:
if (Creature* summon = ObjectAccessor::GetCreature(*me, *itr))
{
summon->CombatStop(true);
summon->DeleteThreatList();
summon->GetThreatMgr().ClearAllThreat();
summon->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
summon->SetReactState(REACT_PASSIVE);
summon->GetMotionMaster()->Clear(false);
}
me->CombatStop(true);
me->DeleteThreatList();
me->GetThreatMgr().ClearAllThreat();
me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
me->SetReactState(REACT_PASSIVE);
me->GetMotionMaster()->Clear(false);

View File

@@ -329,7 +329,7 @@ public:
me->SetTarget();
me->SetReactState(REACT_PASSIVE);
me->RemoveAllAuras();
me->DeleteThreatList();
me->GetThreatMgr().ClearAllThreat();
me->SetRegeneratingHealth(false);
me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
me->HandleEmoteCommand(EMOTE_ONESHOT_DROWN);

View File

@@ -137,31 +137,31 @@ public:
if (DoGetThreat(me->GetVictim()))
DoModifyThreatPercent(target, -100);
Creature* SacrificedTroll;
SacrificedTroll = me->SummonCreature(NPC_SACRIFICED_TROLL, target->GetPositionX() + 2, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
SacrificedTroll = me->SummonCreature(NPC_SACRIFICED_TROLL, TeleportLoc.m_positionX + 2, TeleportLoc.m_positionY, TeleportLoc.m_positionZ, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (SacrificedTroll)
SacrificedTroll->AI()->AttackStart(target);
SacrificedTroll = me->SummonCreature(NPC_SACRIFICED_TROLL, target->GetPositionX() - 2, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
SacrificedTroll = me->SummonCreature(NPC_SACRIFICED_TROLL, TeleportLoc.m_positionX - 2, TeleportLoc.m_positionY, TeleportLoc.m_positionZ, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (SacrificedTroll)
SacrificedTroll->AI()->AttackStart(target);
SacrificedTroll = me->SummonCreature(NPC_SACRIFICED_TROLL, target->GetPositionX() + 4, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
SacrificedTroll = me->SummonCreature(NPC_SACRIFICED_TROLL, TeleportLoc.m_positionX + 4, TeleportLoc.m_positionY, TeleportLoc.m_positionZ, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (SacrificedTroll)
SacrificedTroll->AI()->AttackStart(target);
SacrificedTroll = me->SummonCreature(NPC_SACRIFICED_TROLL, target->GetPositionX() - 4, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
SacrificedTroll = me->SummonCreature(NPC_SACRIFICED_TROLL, TeleportLoc.m_positionX - 4, TeleportLoc.m_positionY, TeleportLoc.m_positionZ, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (SacrificedTroll)
SacrificedTroll->AI()->AttackStart(target);
SacrificedTroll = me->SummonCreature(NPC_SACRIFICED_TROLL, target->GetPositionX(), target->GetPositionY() + 2, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
SacrificedTroll = me->SummonCreature(NPC_SACRIFICED_TROLL, TeleportLoc.m_positionX, TeleportLoc.m_positionY + 2, TeleportLoc.m_positionZ, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (SacrificedTroll)
SacrificedTroll->AI()->AttackStart(target);
SacrificedTroll = me->SummonCreature(NPC_SACRIFICED_TROLL, target->GetPositionX(), target->GetPositionY() - 2, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
SacrificedTroll = me->SummonCreature(NPC_SACRIFICED_TROLL, TeleportLoc.m_positionX, TeleportLoc.m_positionY - 2, TeleportLoc.m_positionZ, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (SacrificedTroll)
SacrificedTroll->AI()->AttackStart(target);
SacrificedTroll = me->SummonCreature(NPC_SACRIFICED_TROLL, target->GetPositionX(), target->GetPositionY() + 4, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
SacrificedTroll = me->SummonCreature(NPC_SACRIFICED_TROLL, TeleportLoc.m_positionX, TeleportLoc.m_positionY + 4, TeleportLoc.m_positionZ, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (SacrificedTroll)
SacrificedTroll->AI()->AttackStart(target);
SacrificedTroll = me->SummonCreature(NPC_SACRIFICED_TROLL, target->GetPositionX(), target->GetPositionY() - 4, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
SacrificedTroll = me->SummonCreature(NPC_SACRIFICED_TROLL, TeleportLoc.m_positionX, TeleportLoc.m_positionY - 4, TeleportLoc.m_positionZ, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (SacrificedTroll)
SacrificedTroll->AI()->AttackStart(target);
SacrificedTroll = me->SummonCreature(NPC_SACRIFICED_TROLL, target->GetPositionX() + 3, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
SacrificedTroll = me->SummonCreature(NPC_SACRIFICED_TROLL, TeleportLoc.m_positionX + 3, TeleportLoc.m_positionY, TeleportLoc.m_positionZ, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (SacrificedTroll)
SacrificedTroll->AI()->AttackStart(target);
}

View File

@@ -71,8 +71,8 @@ public:
if (player->GetQuestStatus(592) == QUEST_STATUS_INCOMPLETE) //Yenniku's Release
{
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_STUN);
me->CombatStop(); //stop combat
me->DeleteThreatList(); //unsure of this
me->CombatStop(); //stop combat
me->GetThreatMgr().ClearAllThreat(); //unsure of this
me->SetFaction(FACTION_HORDE_GENERIC);
bReset = true;
@@ -104,7 +104,7 @@ public:
if (player->GetTeamId() == TEAM_HORDE)
{
me->CombatStop();
me->DeleteThreatList();
me->GetThreatMgr().ClearAllThreat();
}
}
}

View File

@@ -1013,7 +1013,7 @@ public:
void EnterEvadeMode(EvadeReason /*why*/) override
{
me->DeleteThreatList();
me->GetThreatMgr().ClearAllThreat();
me->CombatStop(true);
me->SetLootRecipient(nullptr);
@@ -2356,7 +2356,7 @@ public:
void EnterEvadeMode(EvadeReason /*why*/) override
{
me->RemoveAura(SPELL_HEROIC_VANGUARD);
me->DeleteThreatList();
me->GetThreatMgr().ClearAllThreat();
me->CombatStop(true);
me->SetLootRecipient(nullptr);

View File

@@ -118,7 +118,7 @@ public:
me->RestoreFaction();
me->RemoveAllAuras();
me->DeleteThreatList();
me->GetThreatMgr().ClearAllThreat();
me->CombatStop(true);
SetRun(false);

View File

@@ -410,7 +410,7 @@ void hyjalAI::EnterEvadeMode(EvadeReason /*why*/)
{
if (me->GetEntry() != JAINA)
me->RemoveAllAuras();
me->DeleteThreatList();
me->GetThreatMgr().ClearAllThreat();
me->CombatStop(true);
me->LoadCreaturesAddon(true);

View File

@@ -178,7 +178,7 @@ public:
void DoFriend()
{
me->RemoveAllAuras();
me->DeleteThreatList();
me->GetThreatMgr().ClearAllThreat();
me->CombatStop(true);
me->StopMoving();

View File

@@ -550,7 +550,7 @@ public:
me->SetReactState(REACT_PASSIVE);
me->RemoveAllAuras();
AddCreatureAddonAuras();
me->DeleteThreatList();
me->GetThreatMgr().ClearAllThreat();
me->CombatStop(true);
me->GetMotionMaster()->Clear();
me->StopMoving();
@@ -580,7 +580,7 @@ public:
me->SetReactState(REACT_PASSIVE);
me->RemoveAllAuras();
AddCreatureAddonAuras();
me->DeleteThreatList();
me->GetThreatMgr().ClearAllThreat();
me->CombatStop(true);
me->GetMotionMaster()->Clear();
me->SetRegeneratingHealth(false);

View File

@@ -133,7 +133,7 @@ public:
{
t->RemoveAura(SPELL_CHANGE_VEHICLE);
me->RemoveAllAuras();
me->DeleteThreatList();
me->GetThreatMgr().ClearAllThreat();
me->CombatStop(true);
me->SetHealth(me->GetMaxHealth());
if( pInstance )

View File

@@ -523,7 +523,7 @@ public:
if (TeamIdInInstance == TEAM_ALLIANCE)
c->UpdateEntry(NPC_JAINA_PART2);
}
c->DeleteThreatList();
c->GetThreatMgr().ClearAllThreat();
c->CombatStop(true);
c->InterruptNonMeleeSpells(true);
c->GetMotionMaster()->Clear();
@@ -540,7 +540,7 @@ public:
}
if (Creature* c = instance->GetCreature(NPC_LichKingGUID))
{
c->DeleteThreatList();
c->GetThreatMgr().ClearAllThreat();
c->CombatStop(true);
c->InterruptNonMeleeSpells(true);
c->GetMotionMaster()->Clear();
@@ -915,7 +915,7 @@ public:
if (TrashActive[i])
if (Creature* c = instance->GetCreature(NPC_TrashGUID[i]))
{
c->DeleteThreatList();
c->GetThreatMgr().ClearAllThreat();
c->CombatStop(true);
c->InterruptNonMeleeSpells(true);
c->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_NOT_SELECTABLE);
@@ -1126,7 +1126,7 @@ public:
if (Creature* c = instance->GetCreature(NPC_LichKingGUID))
{
c->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE);
c->DeleteThreatList();
c->GetThreatMgr().ClearAllThreat();
c->CombatStop(true);
c->InterruptNonMeleeSpells(true);
c->SetVisible(false);

View File

@@ -1123,7 +1123,7 @@ public:
return;
me->RemoveEvadeAuras();
me->DeleteThreatList();
me->GetThreatMgr().ClearAllThreat();
me->CombatStop(true);
me->LoadCreaturesAddon(true);
me->SetLootRecipient(nullptr);

View File

@@ -1202,7 +1202,7 @@ public:
if (!attacker || attacker == me || attacker == me->GetVictim() || (det != DIRECT_DAMAGE && det != SPELL_DIRECT_DAMAGE))
return;
me->DeleteThreatList();
me->GetThreatMgr().ClearAllThreat();
me->AddThreat(attacker, 500000000.0f);
}

View File

@@ -784,7 +784,7 @@ public:
{
if (!me->IsAlive())
return;
me->DeleteThreatList();
me->GetThreatMgr().ClearAllThreat();
me->CombatStop(true);
me->GetMotionMaster()->MoveTargetedHome();
Reset();
@@ -1120,7 +1120,7 @@ public:
{
if (!me->IsAlive())
return;
me->DeleteThreatList();
me->GetThreatMgr().ClearAllThreat();
me->CombatStop(true);
me->GetMotionMaster()->MoveTargetedHome();
Reset();
@@ -1496,7 +1496,7 @@ struct gunship_npc_AI : public ScriptedAI
{
if (!me->IsAlive() || !me->IsInCombat())
return;
me->DeleteThreatList();
me->GetThreatMgr().ClearAllThreat();
me->CombatStop(true);
me->GetMotionMaster()->MoveTargetedHome();
Reset();
@@ -1557,7 +1557,7 @@ struct npc_gunship_boarding_addAI : public ScriptedAI
{
if (!me->IsAlive() || !me->IsInCombat())
return;
me->DeleteThreatList();
me->GetThreatMgr().ClearAllThreat();
me->CombatStop(true);
me->GetMotionMaster()->MoveTargetedHome();
Reset();

View File

@@ -515,7 +515,7 @@ public:
{
darnavan->RemoveAllAuras();
darnavan->SetFaction(FACTION_FRIENDLY);
darnavan->DeleteThreatList();
darnavan->GetThreatMgr().ClearAllThreat();
darnavan->CombatStop(true);
darnavan->GetMotionMaster()->MoveIdle();
darnavan->StopMoving();

View File

@@ -1139,7 +1139,7 @@ public:
void StartAttack()
{
GetCaster()->ClearUnitState(UNIT_STATE_CASTING);
GetCaster()->DeleteThreatList();
GetCaster()->GetThreatMgr().ClearAllThreat();
GetCaster()->ToCreature()->SetInCombatWithZone();
GetCaster()->ToCreature()->AI()->AttackStart(GetHitUnit());
GetCaster()->AddThreat(GetHitUnit(), 500000000.0f); // value seen in sniff

View File

@@ -1647,7 +1647,7 @@ public:
return;
}
me->DeleteThreatList();
me->GetThreatMgr().ClearAllThreat();
me->CombatStop(false);
}
@@ -3370,7 +3370,7 @@ public:
if (!me->IsAlive())
return;
me->DeleteThreatList();
me->GetThreatMgr().ClearAllThreat();
me->CombatStop(false);
}
};

View File

@@ -766,7 +766,7 @@ public:
_handledWP4 = false;
me->CombatStop();
me->DeleteThreatList();
me->GetThreatMgr().ClearAllThreat();
}
}

View File

@@ -710,7 +710,7 @@ public:
me->SendMeleeAttackStop(me->GetVictim());
me->GetMotionMaster()->MoveTakeoff(MI_POINT_PH_3_FIGHT_POSITION, CenterPos.GetPositionX(), CenterPos.GetPositionY(), CenterPos.GetPositionZ() - 5.0f, me->GetSpeed(MOVE_RUN));
me->DeleteThreatList(); // players on vehicle are unattackable -> leads to EnterEvadeMode() because target is not acceptable!
me->GetThreatMgr().ClearAllThreat(); // players on vehicle are unattackable -> leads to EnterEvadeMode() because target is not acceptable!
// mount players:
Map::PlayerList const& PlayerList = me->GetMap()->GetPlayers();

View File

@@ -239,7 +239,7 @@ public:
if (!_allowDeath)
{
me->RemoveAllAuras();
me->DeleteThreatList();
me->GetThreatMgr().ClearAllThreat();
me->CombatStop(true);
damage = 0;

View File

@@ -208,7 +208,7 @@ public:
void LeaveCombat()
{
me->RemoveAllAuras();
me->DeleteThreatList();
me->GetThreatMgr().ClearAllThreat();
me->CombatStop(true);
me->LoadCreaturesAddon(true);
me->SetLootRecipient(nullptr);

View File

@@ -258,7 +258,7 @@ public:
if (param == ACTION_CALLBACK)
{
me->SetSpeed(MOVE_RUN, 2.5f);
me->DeleteThreatList();
me->GetThreatMgr().ClearAllThreat();
me->CombatStop(true);
me->GetMotionMaster()->MoveTargetedHome();
returning = true;

View File

@@ -384,7 +384,7 @@ struct violet_hold_trashAI : public npc_escortAI
me->SetHomePosition(1845.577759f + rand_norm() * 5 - 2.5f, 800.681152f + rand_norm() * 5 - 2.5f, 44.104248f, M_PI);
}
me->DeleteThreatList();
me->GetThreatMgr().ClearAllThreat();
me->CombatStop(true);
if (HasEscortState(STATE_ESCORT_ESCORTING))
{

View File

@@ -74,7 +74,7 @@ public:
Creature* owner = GetOwner()->ToCreature();
owner->RemoveAllAurasExceptType(SPELL_AURA_DUMMY);
owner->CombatStop(true);
owner->DeleteThreatList();
owner->GetThreatMgr().ClearAllThreat();
owner->GetMotionMaster()->Clear(false);
owner->GetMotionMaster()->MoveFollow(GetCaster(), 4.0f, M_PI, MOTION_SLOT_ACTIVE);
owner->CastSpell(owner, SPELL_SUBDUED, true);

View File

@@ -127,7 +127,7 @@ public:
me->SetFaction(FACTION_FRIENDLY);
me->SetNpcFlag(UNIT_NPC_FLAG_QUESTGIVER);
me->RemoveAllAuras();
me->DeleteThreatList();
me->GetThreatMgr().ClearAllThreat();
me->CombatStop(true);
Talk(SAY_FREE);
return;

View File

@@ -374,7 +374,7 @@ public:
me->SetFaction(FACTION_FRIENDLY);
me->SetStandState(UNIT_STAND_STATE_SIT);
me->RemoveAllAuras();
me->DeleteThreatList();
me->GetThreatMgr().ClearAllThreat();
me->CombatStop(true);
UnkorUnfriendly_Timer = 60000;
}

View File

@@ -52,7 +52,7 @@ struct npc_pet_hunter_snake_trap : public ScriptedAI
void EnterEvadeMode(EvadeReason /*why*/) override
{
// _EnterEvadeMode();
me->DeleteThreatList();
me->GetThreatMgr().ClearAllThreat();
me->CombatStop(true);
me->LoadCreaturesAddon(true);
me->SetLootRecipient(nullptr);

View File

@@ -283,7 +283,7 @@ class spell_hun_taming_the_beast : public AuraScript
{
if (Creature* creature = target->ToCreature())
{
creature->DeleteThreatList();
creature->GetThreatMgr().ClearAllThreat();
}
}
}

View File

@@ -841,7 +841,23 @@ class spell_pri_vampiric_touch : public AuraScript
bool CheckProc(ProcEventInfo& eventInfo)
{
return eventInfo.GetActionTarget() && eventInfo.GetActionTarget()->IsAlive() && GetOwner()->GetGUID() == eventInfo.GetActionTarget()->GetGUID();
if (!eventInfo.GetActionTarget() || GetOwner()->GetGUID() != eventInfo.GetActionTarget()->GetGUID())
return false;
if (eventInfo.GetTypeMask() & PROC_FLAG_KILLED)
{
if (SpellInfo const* spellInfo = eventInfo.GetSpellInfo())
{
if (spellInfo->SpellFamilyName == SPELLFAMILY_PRIEST && (spellInfo->SpellFamilyFlags[0] & 0x00002000))
{
return true;
}
}
return false;
}
return eventInfo.GetActionTarget()->IsAlive();
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)

View File

@@ -50,14 +50,16 @@ enum WarriorSpells
SPELL_WARRIOR_RETALIATION_DAMAGE = 22858,
SPELL_WARRIOR_SLAM = 50783,
SPELL_WARRIOR_SUNDER_ARMOR = 58567,
SPELL_WARRIOR_SWEEPING_STRIKES_EXTRA_ATTACK = 26654,
SPELL_WARRIOR_SWEEPING_STRIKES_EXTRA_ATTACK_1 = 12723,
SPELL_WARRIOR_SWEEPING_STRIKES_EXTRA_ATTACK_2 = 26654,
SPELL_WARRIOR_TAUNT = 355,
SPELL_WARRIOR_UNRELENTING_ASSAULT_RANK_1 = 46859,
SPELL_WARRIOR_UNRELENTING_ASSAULT_RANK_2 = 46860,
SPELL_WARRIOR_UNRELENTING_ASSAULT_TRIGGER_1 = 64849,
SPELL_WARRIOR_UNRELENTING_ASSAULT_TRIGGER_2 = 64850,
SPELL_WARRIOR_VIGILANCE_PROC = 50725,
SPELL_WARRIOR_VIGILANCE_REDIRECT_THREAT = 59665
SPELL_WARRIOR_VIGILANCE_REDIRECT_THREAT = 59665,
SPELL_WARRIOR_WHIRLWIND_OFF = 44949
};
enum WarriorSpellIcons
@@ -613,7 +615,7 @@ class spell_warr_sweeping_strikes : public AuraScript
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_WARRIOR_SWEEPING_STRIKES_EXTRA_ATTACK });
return ValidateSpellInfo({ SPELL_WARRIOR_SWEEPING_STRIKES_EXTRA_ATTACK_1, SPELL_WARRIOR_SWEEPING_STRIKES_EXTRA_ATTACK_2 });
}
bool Load() override
@@ -624,21 +626,27 @@ class spell_warr_sweeping_strikes : public AuraScript
bool CheckProc(ProcEventInfo& eventInfo)
{
if (!eventInfo.GetActor() || eventInfo.GetProcTarget())
Unit* actor = eventInfo.GetActor();
if (!actor)
{
return false;
}
if (SpellInfo const* spellInfo = eventInfo.GetSpellInfo())
{
switch (spellInfo->Id)
{
case SPELL_WARRIOR_SWEEPING_STRIKES_EXTRA_ATTACK_1:
case SPELL_WARRIOR_SWEEPING_STRIKES_EXTRA_ATTACK_2:
case SPELL_WARRIOR_WHIRLWIND_OFF:
return false;
default:
break;
}
}
_procTarget = eventInfo.GetActor()->SelectNearbyNoTotemTarget(eventInfo.GetProcTarget());
DamageInfo* damageInfo = eventInfo.GetDamageInfo();
if (!damageInfo || !damageInfo->GetSpellInfo())
{
return false;
}
return _procTarget && !damageInfo->GetSpellInfo();
return _procTarget != nullptr;
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
@@ -646,8 +654,17 @@ class spell_warr_sweeping_strikes : public AuraScript
PreventDefaultAction();
if (DamageInfo* damageInfo = eventInfo.GetDamageInfo())
{
int32 damage = damageInfo->GetUnmitigatedDamage();
GetTarget()->CastCustomSpell(_procTarget, SPELL_WARRIOR_SWEEPING_STRIKES_EXTRA_ATTACK, &damage, 0, 0, true, nullptr, aurEff);
SpellInfo const* spellInfo = damageInfo->GetSpellInfo();
if (spellInfo && spellInfo->Id == SPELL_WARRIOR_EXECUTE && !_procTarget->HasAuraState(AURA_STATE_HEALTHLESS_20_PERCENT))
{
// If triggered by Execute (while target is not under 20% hp) deals normalized weapon damage
GetTarget()->CastSpell(_procTarget, SPELL_WARRIOR_SWEEPING_STRIKES_EXTRA_ATTACK_2, aurEff);
}
else
{
int32 damage = damageInfo->GetUnmitigatedDamage();
GetTarget()->CastCustomSpell(_procTarget, SPELL_WARRIOR_SWEEPING_STRIKES_EXTRA_ATTACK_1, &damage, 0, 0, true, nullptr, aurEff);
}
}
}
@@ -658,7 +675,7 @@ class spell_warr_sweeping_strikes : public AuraScript
}
private:
Unit* _procTarget;
Unit* _procTarget = nullptr;
};
// 50720 - Vigilance