diff options
| author | Adam B <adam@asblab.work> | 2023-04-11 15:11:48 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-11 23:11:48 +0200 |
| commit | 63790adbfea2b9a7665f72ae6b9fe254ce195682 (patch) | |
| tree | fe9aea62508ce628af45ceaf132fe416a58542ae | |
| parent | c3e43d3d31d8413dd3571f323310bddb677ae426 (diff) | |
Add code that changes the faction of Tortheldrin in Dire Maul (#28581)
* Add code that changes the faction of Tortheldrin
Per WoW Classic, Tortheldrin becomes hostile after Immolthar is killed. This code implements an event that does this.
* Bug fix.
Fixed a bug where the server would crash if the bosses were already dead and the player zoned in.
* Recommited with the correct path.
Signed-off-by: Adam Bajac <adam@asblab.work>
* Removed wrong file.
Signed-off-by: Adam Bajac <adam@asblab.work>
* Made changes requested by jackpoz.
Signed-off-by: Adam Bajac <adam@asblab.work>
* Corrected a syntax error after testing.
- Tested in game and confirmed all is working.
Signed-off-by: Adam Bajac <adam@asblab.work>
* Removed whitespace changes.
Signed-off-by: Adam Bajac <adam@asblab.work>
* Changed the script to use OnUnitDeath rather than an event.
Signed-off-by: Adam Bajac <adam@asblab.work>
* Removed the IMMO_DEAD_CHECK event.
Signed-off-by: Adam Bajac <adam@asblab.work>
* Removed redundant comma.
Signed-off-by: Adam Bajac <adam@asblab.work>
---------
Signed-off-by: Adam Bajac <adam@asblab.work>
Co-authored-by: Adam B <adam@avalonglobal.com>
| -rw-r--r-- | src/server/scripts/Kalimdor/DireMaul/instance_dire_maul.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/server/scripts/Kalimdor/DireMaul/instance_dire_maul.cpp b/src/server/scripts/Kalimdor/DireMaul/instance_dire_maul.cpp index 36fd1c605d7..0dce5d2e81f 100644 --- a/src/server/scripts/Kalimdor/DireMaul/instance_dire_maul.cpp +++ b/src/server/scripts/Kalimdor/DireMaul/instance_dire_maul.cpp @@ -93,6 +93,9 @@ public: if (GetBossState(DATA_FORCEFIELD) != DONE) creature->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE); break; + case NPC_TORTHELDRIN: + _tortheldrinGUID = creature->GetGUID(); + break; default: break; } @@ -147,6 +150,8 @@ public: return _forcefieldGUID; case NPC_IMMOLTHAR: return _immoGUID; + case NPC_TORTHELDRIN: + return _tortheldrinGUID; default: break; } @@ -266,12 +271,22 @@ public: } } + void OnUnitDeath(Unit* unit) override + { + if (unit->GetGUID() == _immoGUID) + { + if (Creature* tortheldrin = instance->GetCreature(_tortheldrinGUID)) + tortheldrin->SetFaction(FACTION_ENEMY); + } + } + protected: EventMap _events; std::array<ObjectGuid, 5> _crystalGUIDs; std::array<std::array<ObjectGuid, 4>, 5> _crystalCreatureGUIDs; // 5 different Crystals, maximum of 4 Creatures ObjectGuid _forcefieldGUID; ObjectGuid _immoGUID; + ObjectGuid _tortheldrinGUID; }; InstanceScript* GetInstanceScript(InstanceMap* map) const override |
