diff options
Diffstat (limited to 'src/game/Player.cpp')
| -rw-r--r-- | src/game/Player.cpp | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp index fd27607a402..27014c97f76 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -13807,7 +13807,17 @@ void Player::ItemRemovedQuestCheck( uint32 entry, uint32 count ) UpdateForQuestWorldObjects(); } -void Player::KilledMonster( uint32 entry, uint64 guid ) +void Player::KilledMonster( CreatureInfo const* cInfo, uint64 guid ) +{ + if(cInfo->Entry) + KilledMonsterCredit(cInfo->Entry,guid); + + for(int i = 0; i < MAX_KILL_CREDIT; ++i) + if(cInfo->KillCredit[i]) + KilledMonsterCredit(cInfo->KillCredit[i],guid); +} + +void Player::KilledMonsterCredit( uint32 entry, uint64 guid ) { uint32 addkillcount = 1; GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE, entry, addkillcount); @@ -19795,7 +19805,7 @@ bool Player::RewardPlayerAndGroupAtKill(Unit* pVictim) { // normal creature (not pet/etc) can be only in !PvP case if(pVictim->GetTypeId()==TYPEID_UNIT) - pGroupGuy->KilledMonster(pVictim->GetEntry(), pVictim->GetGUID()); + pGroupGuy->KilledMonster(((Creature*)pVictim)->GetCreatureInfo(), pVictim->GetGUID()); } } } @@ -19820,7 +19830,7 @@ bool Player::RewardPlayerAndGroupAtKill(Unit* pVictim) // normal creature (not pet/etc) can be only in !PvP case if(pVictim->GetTypeId()==TYPEID_UNIT) - KilledMonster(pVictim->GetEntry(),pVictim->GetGUID()); + KilledMonster(((Creature*)pVictim)->GetCreatureInfo(), pVictim->GetGUID()); } } return xp || honored_kill; @@ -19844,11 +19854,11 @@ void Player::RewardPlayerAndGroupAtEvent(uint32 creature_id, WorldObject* pRewar // quest objectives updated only for alive group member or dead but with not released body if(pGroupGuy->isAlive()|| !pGroupGuy->GetCorpse()) - pGroupGuy->KilledMonster(creature_id, creature_guid); + pGroupGuy->KilledMonsterCredit(creature_id, creature_guid); } } else // if (!pGroup) - KilledMonster(creature_id, creature_guid); + KilledMonsterCredit(creature_id, creature_guid); } bool Player::IsAtGroupRewardDistance(WorldObject const* pRewardSource) const |
