fix(Scripts/Creature): multi-raid faction leader credit (#22168)
This commit is contained in:
@@ -269,6 +269,16 @@ void ScriptedAI::DoStopAttack()
|
||||
me->AttackStop();
|
||||
}
|
||||
|
||||
void ScriptedAI::DoRewardPlayersInArea()
|
||||
{
|
||||
me->GetMap()->DoForAllPlayers([&](Player* player)
|
||||
{
|
||||
if (player->GetFaction() != me->GetCreatureTemplate()->faction && !player->IsGameMaster())
|
||||
if (player->GetAreaId() == me->GetAreaId())
|
||||
player->KilledMonsterCredit(me->GetEntry());
|
||||
});
|
||||
}
|
||||
|
||||
void ScriptedAI::DoCastSpell(Unit* target, SpellInfo const* spellInfo, bool triggered)
|
||||
{
|
||||
if (!target || me->IsNonMeleeSpellCast(false))
|
||||
|
||||
@@ -306,6 +306,9 @@ struct ScriptedAI : public CreatureAI
|
||||
//Stop attack of current victim
|
||||
void DoStopAttack();
|
||||
|
||||
//Reward kill credit to all players from the oposing faction in the area (faction leaders)
|
||||
void DoRewardPlayersInArea();
|
||||
|
||||
//Cast spell by spell info
|
||||
void DoCastSpell(Unit* target, SpellInfo const* spellInfo, bool triggered = false);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user