AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
instance_nexus::instance_nexus_InstanceMapScript Struct Reference
Inheritance diagram for instance_nexus::instance_nexus_InstanceMapScript:
InstanceScript ZoneScript

Public Member Functions

 instance_nexus_InstanceMapScript (Map *map)
 
void Initialize () override
 
void OnCreatureCreate (Creature *creature) override
 
void OnGameObjectCreate (GameObject *gameObject) override
 
void OnGameObjectRemove (GameObject *gameObject) override
 
void SetData (uint32 type, uint32) override
 
bool SetBossState (uint32 id, EncounterState state) override
 
- Public Member Functions inherited from InstanceScript
 InstanceScript (Map *map)
 
 ~InstanceScript () override
 
virtual void Initialize ()
 
virtual void Load (char const *data)
 
virtual void CreatureLooted (Creature *, LootType)
 
virtual std::string GetSaveData ()
 
void SaveToDB ()
 
virtual void Update (uint32)
 
virtual bool IsEncounterInProgress () const
 
void OnCreatureCreate (Creature *creature) override
 
void OnCreatureRemove (Creature *creature) override
 
void OnGameObjectCreate (GameObject *go) override
 
void OnGameObjectRemove (GameObject *go) override
 
ObjectGuid GetObjectGuid (uint32 type) const
 
ObjectGuid GetGuidData (uint32 type) const override
 
CreatureGetCreature (uint32 type)
 
GameObjectGetGameObject (uint32 type)
 
virtual void OnPlayerEnter (Player *)
 
virtual void OnPlayerAreaUpdate (Player *, uint32, uint32)
 
virtual void OnPlayerInWaterStateUpdate (Player *, bool)
 
void HandleGameObject (ObjectGuid guid, bool open, GameObject *go=nullptr)
 
void DoUseDoorOrButton (ObjectGuid guid, uint32 withRestoreTime=0, bool useAlternativeState=false)
 
void DoRespawnGameObject (ObjectGuid guid, uint32 timeToDespawn=MINUTE)
 
void DoRespawnCreature (ObjectGuid guid, bool force=false)
 
void DoRespawnCreature (uint32 type, bool force=false)
 
void DoUpdateWorldState (uint32 worldstateId, uint32 worldstateValue)
 
void DoSendNotifyToInstance (char const *format,...)
 
void DoUpdateAchievementCriteria (AchievementCriteriaTypes type, uint32 miscValue1=0, uint32 miscValue2=0, Unit *unit=nullptr)
 
void DoStartTimedAchievement (AchievementCriteriaTimedTypes type, uint32 entry)
 
void DoStopTimedAchievement (AchievementCriteriaTimedTypes type, uint32 entry)
 
void DoRemoveAurasDueToSpellOnPlayers (uint32 spell)
 
void DoCastSpellOnPlayers (uint32 spell)
 
void DoCastSpellOnPlayer (Player *player, uint32 spell, bool includePets, bool includeControlled)
 
bool ServerAllowsTwoSideGroups ()
 
virtual bool SetBossState (uint32 id, EncounterState state)
 
EncounterState GetBossState (uint32 id) const
 
CreatureBoundary const * GetBossBoundary (uint32 id) const
 
BossInfo const * GetBossInfo (uint32 id) const
 
uint32 GetPersistentData (uint32 index) const
 
void StorePersistentData (uint32 index, uint32 data)
 
virtual bool CheckAchievementCriteriaMeet (uint32, Player const *, Unit const *=nullptr, uint32=0)
 
virtual bool CheckRequiredBosses (uint32, Player const *=nullptr) const
 
void SetCompletedEncountersMask (uint32 newMask, bool save)
 
uint32 GetCompletedEncounterMask () const
 
void SendEncounterUnit (uint32 type, Unit *unit=nullptr, uint8 param1=0, uint8 param2=0)
 
virtual void FillInitialWorldStates (WorldPacket &)
 
uint32 GetEncounterCount () const
 
void MarkAreaTriggerDone (uint32 id)
 
void ResetAreaTriggerDone (uint32 id)
 
bool IsAreaTriggerDone (uint32 id) const
 
virtual void DoAction (int32)
 
void DoForAllMinions (uint32 id, std::function< void(Creature *)> exec)
 
void StoreGameObjectState (ObjectGuid::LowType spawnId, uint8 state)
 
uint8 GetStoredGameObjectState (ObjectGuid::LowType spawnId) const
 
void LoadInstanceSavedGameobjectStateData ()
 
bool IsBossDone (uint32 bossId) const
 
bool AllBossesDone () const
 
bool AllBossesDone (std::initializer_list< uint32 > bossIds) const
 
- Public Member Functions inherited from ZoneScript
 ZoneScript ()
 
virtual ~ZoneScript ()
 
virtual uint32 GetCreatureEntry (ObjectGuid::LowType, CreatureData const *data)
 
virtual uint32 GetGameObjectEntry (ObjectGuid::LowType, uint32 entry)
 
virtual void OnCreatureCreate (Creature *)
 
virtual void OnCreatureRemove (Creature *)
 
virtual void OnGameObjectCreate (GameObject *)
 
virtual void OnGameObjectRemove (GameObject *)
 
virtual void OnUnitDeath (Unit *)
 
virtual void OnCreatureEvade (Creature *)
 
virtual ObjectGuid GetGuidData (uint32) const
 
virtual void SetGuidData (uint32, ObjectGuid)
 
virtual uint64 GetData64 (uint32) const
 
virtual void SetData64 (uint32, uint64)
 
virtual uint32 GetData (uint32) const
 
virtual void SetData (uint32, uint32)
 
virtual void ProcessEvent (WorldObject *, uint32)
 

Additional Inherited Members

- Static Public Member Functions inherited from InstanceScript
static std::string GetBossStateName (uint8 state)
 
- Public Attributes inherited from InstanceScript
Mapinstance
 
TaskScheduler scheduler
 
- Protected Member Functions inherited from InstanceScript
void SetHeaders (std::string const &dataHeaders)
 
void SetBossNumber (uint32 number)
 
void SetPersistentDataCount (uint32 number)
 
void LoadBossBoundaries (BossBoundaryData const &data)
 
void LoadDoorData (DoorData const *data)
 
void LoadMinionData (MinionData const *data)
 
void LoadObjectData (ObjectData const *creatureData, ObjectData const *gameObjectData)
 
void AddObject (Creature *obj, bool add=true)
 
void RemoveObject (Creature *obj)
 
void AddObject (GameObject *obj, bool add=true)
 
void RemoveObject (GameObject *obj)
 
void AddObject (WorldObject *obj, uint32 type, bool add=true)
 
void RemoveObject (WorldObject *obj, uint32 type)
 
void AddDoor (GameObject *door, bool add=true)
 
void RemoveDoor (GameObject *door)
 
void AddMinion (Creature *minion, bool add=true)
 
void RemoveMinion (Creature *minion)
 
void UpdateDoorState (GameObject *door)
 
void UpdateMinionState (Creature *minion, EncounterState state)
 
bool ReadSaveDataHeaders (std::istringstream &data)
 
void ReadSaveDataBossStates (std::istringstream &data)
 
void ReadSavePersistentData (std::istringstream &data)
 
virtual void ReadSaveDataMore (std::istringstream &)
 
void WriteSaveDataHeaders (std::ostringstream &data)
 
void WriteSaveDataBossStates (std::ostringstream &data)
 
void WritePersistentData (std::ostringstream &data)
 
virtual void WriteSaveDataMore (std::ostringstream &)
 

Detailed Description

Constructor & Destructor Documentation

◆ instance_nexus_InstanceMapScript()

instance_nexus::instance_nexus_InstanceMapScript::instance_nexus_InstanceMapScript ( Map map)
inline
44: InstanceScript(map) {}
Definition: InstanceScript.h:142

Member Function Documentation

◆ Initialize()

void instance_nexus::instance_nexus_InstanceMapScript::Initialize ( )
inlineoverridevirtual

Reimplemented from InstanceScript.

47 {
51 }
DoorData const doorData[]
Definition: instance_nexus.cpp:24
#define DataHeader
Definition: blackrock_depths.h:23
@ MAX_ENCOUNTERS
Definition: deadmines.h:30
void SetBossNumber(uint32 number)
Definition: InstanceScript.h:285
void LoadDoorData(DoorData const *data)
Definition: InstanceScript.cpp:161
void SetHeaders(std::string const &dataHeaders)
Definition: InstanceScript.cpp:138

References DataHeader, doorData, InstanceScript::LoadDoorData(), MAX_ENCOUNTERS, InstanceScript::SetBossNumber(), and InstanceScript::SetHeaders().

◆ OnCreatureCreate()

void instance_nexus::instance_nexus_InstanceMapScript::OnCreatureCreate ( Creature creature)
inlineoverridevirtual

Reimplemented from InstanceScript.

54 {
55 Map::PlayerList const& players = instance->GetPlayers();
56 TeamId TeamIdInInstance = TEAM_NEUTRAL;
57 if (!players.IsEmpty())
58 if (Player* pPlayer = players.begin()->GetSource())
59 TeamIdInInstance = pPlayer->GetTeamId();
60
61 switch (creature->GetEntry())
62 {
65 if (TeamIdInInstance == TEAM_ALLIANCE)
67 break;
70 if (TeamIdInInstance == TEAM_ALLIANCE)
72 break;
75 if (TeamIdInInstance == TEAM_ALLIANCE)
77 break;
80 if (TeamIdInInstance == TEAM_ALLIANCE)
82 break;
85 if (TeamIdInInstance == TEAM_ALLIANCE)
87 break;
88 }
89 }
@ NPC_COMMANDER_KOLURG
Definition: nexus.h:52
@ NPC_HORDE_COMMANDER
Definition: nexus.h:48
@ NPC_HORDE_RANGER
Definition: nexus.h:46
@ NPC_COMMANDER_STOUTBEARD
Definition: nexus.h:51
@ NPC_HORDE_CLERIC
Definition: nexus.h:49
@ NPC_ALLIANCE_RANGER
Definition: nexus.h:42
@ NPC_HORDE_BERSERKER
Definition: nexus.h:47
@ NPC_ALLIANCE_BERSERKER
Definition: nexus.h:43
@ NPC_ALLIANCE_CLERIC
Definition: nexus.h:45
@ NPC_ALLIANCE_COMMANDER
Definition: icecrown_citadel.h:166
TeamId
Definition: SharedDefines.h:759
@ TEAM_NEUTRAL
Definition: SharedDefines.h:762
@ TEAM_ALLIANCE
Definition: SharedDefines.h:760
@ FACTION_MONSTER_2
Definition: SharedDefines.h:196
bool IsEmpty() const
Definition: LinkedList.h:97
FROM * GetSource() const
Definition: Reference.h:97
bool UpdateEntry(uint32 entry, const CreatureData *data=nullptr, bool changelevel=true, bool updateAI=false)
Definition: Creature.cpp:538
uint32 GetEntry() const
Definition: Object.h:112
Definition: Player.h:1064
void SetFaction(uint32 faction)
Definition: Unit.cpp:10018
Map * instance
Definition: InstanceScript.h:148
PlayerList const & GetPlayers() const
Definition: Map.h:486
Definition: MapRefMgr.h:26
iterator begin()
Definition: MapRefMgr.h:36

References MapRefMgr::begin(), FACTION_MONSTER_2, Object::GetEntry(), Map::GetPlayers(), Reference< TO, FROM >::GetSource(), InstanceScript::instance, LinkedListHead::IsEmpty(), NPC_ALLIANCE_BERSERKER, NPC_ALLIANCE_CLERIC, NPC_ALLIANCE_COMMANDER, NPC_ALLIANCE_RANGER, NPC_COMMANDER_KOLURG, NPC_COMMANDER_STOUTBEARD, NPC_HORDE_BERSERKER, NPC_HORDE_CLERIC, NPC_HORDE_COMMANDER, NPC_HORDE_RANGER, Unit::SetFaction(), TEAM_ALLIANCE, TEAM_NEUTRAL, and Creature::UpdateEntry().

◆ OnGameObjectCreate()

void instance_nexus::instance_nexus_InstanceMapScript::OnGameObjectCreate ( GameObject gameObject)
inlineoverridevirtual

Reimplemented from InstanceScript.

92 {
93 switch (gameObject->GetEntry())
94 {
98 AddDoor(gameObject);
99 break;
103 AddDoor(gameObject);
104 break;
108 AddDoor(gameObject);
109 break;
110 }
111 }
@ DONE
Definition: InstanceScript.h:60
@ GO_TELESTRA_SPHERE
Definition: nexus.h:54
@ GO_ANOMALUS_SPHERE
Definition: nexus.h:55
@ GO_ORMOROK_SPHERE
Definition: nexus.h:56
@ DATA_ORMOROK_ORB
Definition: nexus.h:36
@ DATA_MAGUS_TELESTRA_EVENT
Definition: nexus.h:29
@ DATA_ORMOROK_EVENT
Definition: nexus.h:31
@ DATA_TELESTRA_ORB
Definition: nexus.h:34
@ DATA_ANOMALUS_ORB
Definition: nexus.h:35
@ DATA_ANOMALUS_EVENT
Definition: nexus.h:30
@ GO_FLAG_NOT_SELECTABLE
Definition: SharedDefines.h:1607
void RemoveGameObjectFlag(GameObjectFlags flags)
Definition: GameObject.h:220
EncounterState GetBossState(uint32 id) const
Definition: InstanceScript.h:235
void AddDoor(GameObject *door, bool add=true)
Definition: InstanceScript.cpp:307

References InstanceScript::AddDoor(), DATA_ANOMALUS_EVENT, DATA_ANOMALUS_ORB, DATA_MAGUS_TELESTRA_EVENT, DATA_ORMOROK_EVENT, DATA_ORMOROK_ORB, DATA_TELESTRA_ORB, DONE, InstanceScript::GetBossState(), Object::GetEntry(), GO_ANOMALUS_SPHERE, GO_FLAG_NOT_SELECTABLE, GO_ORMOROK_SPHERE, GO_TELESTRA_SPHERE, and GameObject::RemoveGameObjectFlag().

◆ OnGameObjectRemove()

void instance_nexus::instance_nexus_InstanceMapScript::OnGameObjectRemove ( GameObject gameObject)
inlineoverridevirtual

Reimplemented from InstanceScript.

114 {
115 switch (gameObject->GetEntry())
116 {
120 RemoveDoor(gameObject);
121 break;
122 }
123 }
void RemoveDoor(GameObject *door)
Definition: InstanceScript.cpp:329

References Object::GetEntry(), GO_ANOMALUS_SPHERE, GO_ORMOROK_SPHERE, GO_TELESTRA_SPHERE, and InstanceScript::RemoveDoor().

◆ SetBossState()

bool instance_nexus::instance_nexus_InstanceMapScript::SetBossState ( uint32  id,
EncounterState  state 
)
inlineoverridevirtual

Reimplemented from InstanceScript.

145 {
146 if (!InstanceScript::SetBossState(id, state))
147 return false;
148
149 if (state != DONE || id > DATA_ORMOROK_EVENT)
150 return true;
151
152 BossInfo const* bossInfo = GetBossInfo(id + DATA_TELESTRA_ORB);
153 for (DoorSet::const_iterator i = bossInfo->door[DOOR_TYPE_PASSAGE].begin(); i != bossInfo->door[DOOR_TYPE_PASSAGE].end(); ++i)
154 (*i)->RemoveGameObjectFlag(GO_FLAG_NOT_SELECTABLE);
155 return true;
156 }
@ DOOR_TYPE_PASSAGE
Definition: InstanceScript.h:68
Definition: InstanceScript.h:111
DoorSet door[MAX_DOOR_TYPES]
Definition: InstanceScript.h:114
virtual bool SetBossState(uint32 id, EncounterState state)
Definition: InstanceScript.cpp:351
BossInfo const * GetBossInfo(uint32 id) const
Definition: InstanceScript.h:238

References DATA_ORMOROK_EVENT, DATA_TELESTRA_ORB, DONE, BossInfo::door, DOOR_TYPE_PASSAGE, InstanceScript::GetBossInfo(), GO_FLAG_NOT_SELECTABLE, and InstanceScript::SetBossState().

Referenced by SetData().

◆ SetData()

void instance_nexus::instance_nexus_InstanceMapScript::SetData ( uint32  type,
uint32   
)
inlineoverridevirtual

Reimplemented from ZoneScript.

126 {
127 switch (type)
128 {
132 break;
136 break;
140 break;
141 }
142 }
@ NOT_STARTED
Definition: InstanceScript.h:57
bool SetBossState(uint32 id, EncounterState state) override
Definition: instance_nexus.cpp:144

References DATA_ANOMALUS_ORB, DATA_ORMOROK_ORB, DATA_TELESTRA_ORB, DONE, GO_ANOMALUS_SPHERE, GO_ORMOROK_SPHERE, GO_TELESTRA_SPHERE, NOT_STARTED, and SetBossState().