diff options
| author | Trazom62 <none@none> | 2010-04-27 22:26:30 +0200 |
|---|---|---|
| committer | Trazom62 <none@none> | 2010-04-27 22:26:30 +0200 |
| commit | e719bd32a37152ed7ff978e18e4f5f610472d81e (patch) | |
| tree | f254ff3ba090c71f1c99b42b92850b18b594ef6a /src/game | |
| parent | 36ebd58b37aa70e3c68c00ac7126810da39f2de1 (diff) | |
Fix timed achievement checks for boss killed in instance.
Requires DB update.
--HG--
branch : trunk
Diffstat (limited to 'src/game')
| -rw-r--r-- | src/game/InstanceData.cpp | 22 | ||||
| -rw-r--r-- | src/game/InstanceData.h | 4 |
2 files changed, 26 insertions, 0 deletions
diff --git a/src/game/InstanceData.cpp b/src/game/InstanceData.cpp index 890733b5a20..214c5ca2327 100644 --- a/src/game/InstanceData.cpp +++ b/src/game/InstanceData.cpp @@ -339,6 +339,28 @@ void InstanceData::DoUpdateAchievementCriteria(AchievementCriteriaTypes type, ui pPlayer->UpdateAchievementCriteria(type, miscvalue1, miscvalue2, unit, time); } +// Start timed achievement for all players in instance +void InstanceData::DoStartTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry) +{ + Map::PlayerList const &PlayerList = instance->GetPlayers(); + + if (!PlayerList.isEmpty()) + for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) + if (Player *pPlayer = i->getSource()) + pPlayer->GetAchievementMgr().StartTimedAchievement(type, entry); +} + +// Stop timed achievement for all players in instance +void InstanceData::DoStopTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry) +{ + Map::PlayerList const &PlayerList = instance->GetPlayers(); + + if (!PlayerList.isEmpty()) + for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) + if (Player *pPlayer = i->getSource()) + pPlayer->GetAchievementMgr().RemoveTimedAchievement(type, entry); +} + // Remove Auras due to Spell on all players in instance void InstanceData::DoRemoveAurasDueToSpellOnPlayers(uint32 spell) { diff --git a/src/game/InstanceData.h b/src/game/InstanceData.h index 31536a03a22..eb2c781aa91 100644 --- a/src/game/InstanceData.h +++ b/src/game/InstanceData.h @@ -162,6 +162,10 @@ class InstanceData : public ZoneScript // Update Achievement Criteria for all players in instance void DoUpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscvalue1=0, uint32 miscvalue2=0, Unit *unit=NULL, uint32 time=0); + // Start/Stop Timed Achievement Criteria for all players in instance + void DoStartTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry); + void DoStopTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry); + // Remove Auras due to Spell on all players in instance void DoRemoveAurasDueToSpellOnPlayers(uint32 spell); |
