fix(DB/Quest): Taken by the Scourge (#4079)

This commit is contained in:
Kitzunu 2021-01-16 13:43:49 +01:00 committed by GitHub
parent 19d474b338
commit d5c41aa5d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 2 deletions

View file

@ -374,9 +374,12 @@ public:
void JustDied(Unit* killer) override
{
Player* player = killer->ToPlayer();
if (!player)
if (!killer || killer->GetTypeId() != TYPEID_PLAYER)
{
return;
}
Player* player = killer->ToPlayer();
if (player->GetQuestStatus(QUEST_TAKEN_BY_THE_SCOURGE) == QUEST_STATUS_INCOMPLETE)
{
@ -387,7 +390,9 @@ public:
player->KilledMonsterCredit(NPC_WARSONG_PEON, 0);
}
else if (uiRand < 80)
{
player->CastSpell(me, nerubarVictims[urand(0, 2)], true);
}
}
}
};