diff options
Diffstat (limited to 'src/game')
-rw-r--r-- | src/game/InstanceData.cpp | 36 | ||||
-rw-r--r-- | src/game/InstanceData.h | 11 |
2 files changed, 47 insertions, 0 deletions
diff --git a/src/game/InstanceData.cpp b/src/game/InstanceData.cpp index 567c06ac5ec..1398038d724 100644 --- a/src/game/InstanceData.cpp +++ b/src/game/InstanceData.cpp @@ -296,3 +296,39 @@ void InstanceData::DoUpdateWorldState(uint32 uiStateId, uint32 uiStateData) else debug_log("TSCR: DoUpdateWorldState attempt send data but no players in map."); } + +/* Not used anywhere yet, not sure if they're needed: +// Send Notify to all players in instance +void InstanceData::DoSendNotifyToInstance(const char *format, ...) +{ + InstanceMap::PlayerList const &PlayerList = instance->GetPlayers(); + InstanceMap::PlayerList::const_iterator i; + + if (!PlayerList.isEmpty()) + for (i = PlayerList.begin(); i != PlayerList.end(); ++i) + if ((*i).getSource() && (*i).getSource()->GetSession()) + (*i).getSource()->GetSession()->SendNotification(format); +} + +// Complete Achievement for all players in instance +void InstanceData::DoCompleteAchievement(uint32 achievement) +{ + AchievementEntry const* AE = GetAchievementStore()->LookupEntry(achievement); + Map::PlayerList const &PlayerList = instance->GetPlayers(); + + if (!PlayerList.isEmpty()) + for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) + if (i->getSource()) + i->getSource()->CompletedAchievement(AE); +} +*/ + +// Remove Auras due to Spell on all players in instance +void InstanceData::DoRemoveAurasDueToSpellOnPlayers(uint32 spell) +{ + Map::PlayerList const &PlayerList = instance->GetPlayers(); + + if (!PlayerList.isEmpty()) + for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) + if (i->getSource() && i->getSource()->HasAura(spell)) i->getSource()->RemoveAurasDueToSpell(spell); +} diff --git a/src/game/InstanceData.h b/src/game/InstanceData.h index 90be75fa5da..010a3d44d42 100644 --- a/src/game/InstanceData.h +++ b/src/game/InstanceData.h @@ -152,6 +152,17 @@ class TRINITY_DLL_SPEC InstanceData : public ZoneScript //sends world state update to all players in instance void DoUpdateWorldState(uint32 uiStateId, uint32 uiStateData); + /* Not used anywhere yet, not sure if they're needed: + // Send Notify to all players in instance + void DoSendNotifyToInstance(const char *format,...); + + // Complete Achievement for all players in instance + void DoCompleteAchievement(uint32 achievement); + */ + + // Remove Auras due to Spell on all players in instance + void DoRemoveAurasDueToSpellOnPlayers(uint32 spell); + virtual bool SetBossState(uint32 id, EncounterState state); EncounterState GetBossState(uint32 id) const { return id < bosses.size() ? bosses[id].state : TO_BE_DECIDED; } const BossBoundaryMap * GetBossBoundary(uint32 id) const { return id < bosses.size() ? &bosses[id].boundary : NULL; } |