diff options
Diffstat (limited to 'src')
22 files changed, 297 insertions, 397 deletions
diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp index 526daaffee1..f436b3c89ab 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp @@ -126,9 +126,10 @@ class boss_akilzon : public CreatureScript _JustDied(); } - void KilledUnit(Unit* /*victim*/) OVERRIDE + void KilledUnit(Unit* who) OVERRIDE { - Talk(SAY_KILL); + if (who->GetTypeId() == TYPEID_PLAYER) + Talk(SAY_KILL); } void SetWeather(uint32 weather, float grade) diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp index 52f706d5626..d61fbc153e9 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp @@ -83,9 +83,10 @@ public: Talk(SAY_ONAGGRO); } - void KilledUnit(Unit* /*victim*/) OVERRIDE + void KilledUnit(Unit* who) OVERRIDE { - Talk(SAY_ONSLAY); + if (who->GetTypeId() == TYPEID_PLAYER) + Talk(SAY_ONSLAY); } void WaypointReached(uint32 waypointId) OVERRIDE diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/boss_aeonus.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/boss_aeonus.cpp index c929a1b6a55..3817c2628e3 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/boss_aeonus.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/boss_aeonus.cpp @@ -97,9 +97,10 @@ public: } } - void KilledUnit(Unit* /*victim*/) OVERRIDE + void KilledUnit(Unit* who) OVERRIDE { - Talk(SAY_SLAY); + if (who->GetTypeId() == TYPEID_PLAYER) + Talk(SAY_SLAY); } void UpdateAI(uint32 diff) OVERRIDE diff --git a/src/server/scripts/Kalimdor/RazorfenDowns/boss_amnennar_the_coldbringer.cpp b/src/server/scripts/Kalimdor/RazorfenDowns/boss_amnennar_the_coldbringer.cpp index 323fd92a8f6..952ed5679f9 100644 --- a/src/server/scripts/Kalimdor/RazorfenDowns/boss_amnennar_the_coldbringer.cpp +++ b/src/server/scripts/Kalimdor/RazorfenDowns/boss_amnennar_the_coldbringer.cpp @@ -69,9 +69,10 @@ public: Talk(SAY_AGGRO); } - void KilledUnit(Unit* /*victim*/) OVERRIDE + void KilledUnit(Unit* who) OVERRIDE { - Talk(SAY_KILL); + if (who->GetTypeId() == TYPEID_PLAYER) + Talk(SAY_KILL); } void JustDied(Unit* /*killer*/) OVERRIDE diff --git a/src/server/scripts/Kalimdor/zone_the_barrens.cpp b/src/server/scripts/Kalimdor/zone_the_barrens.cpp index a97803cb9ce..5b057f27a48 100644 --- a/src/server/scripts/Kalimdor/zone_the_barrens.cpp +++ b/src/server/scripts/Kalimdor/zone_the_barrens.cpp @@ -345,10 +345,7 @@ public: BigWill = 0; } - void EnterCombat(Unit* /*who*/) OVERRIDE { } - void MoveInLineOfSight(Unit* who) OVERRIDE - { if (!who || !who->IsAlive() || EventInProgress) return; @@ -362,8 +359,6 @@ public: } } - void KilledUnit(Unit* /*victim*/) OVERRIDE { } - void UpdateAI(uint32 diff) OVERRIDE { if (EventInProgress) diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_herald_volazj.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_herald_volazj.cpp index 5bb68a4c886..e8e815db5d4 100644 --- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_herald_volazj.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_herald_volazj.cpp @@ -302,9 +302,10 @@ public: ResetPlayersPhaseMask(); } - void KilledUnit(Unit* /*victim*/) OVERRIDE + void KilledUnit(Unit* who) OVERRIDE { - Talk(SAY_SLAY); + if (who->GetTypeId() == TYPEID_PLAYER) + Talk(SAY_SLAY); } }; diff --git a/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp b/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp index 8c470f73e04..8375fb7f0a8 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp @@ -78,44 +78,34 @@ enum Misc DATA_CAN_LOOT = 0 }; -struct Location -{ - float x, y, z; -}; - -static Location FlameRight1Spawn = { 3200.00f, 573.211f, 57.1551f }; -static Location FlameRight1Direction = { 3289.28f, 573.211f, 57.1551f }; -static Location FlameRight2Spawn = { 3200.00f, 532.211f, 57.1551f }; -static Location FlameRight2Direction = { 3289.28f, 532.211f, 57.1551f }; -static Location FlameRight3Spawn = { 3200.00f, 491.211f, 57.1551f }; -static Location FlameRight3Direction = { 3289.28f, 491.211f, 57.1551f }; -static Location FlameLeft1Spawn = { 3289.28f, 511.711f, 57.1551f }; -static Location FlameLeft1Direction = { 3200.00f, 511.711f, 57.1551f }; -static Location FlameLeft2Spawn = { 3289.28f, 552.711f, 57.1551f }; -static Location FlameLeft2Direction = { 3200.00f, 552.711f, 57.1551f }; - -struct Waypoint -{ - float m_fX, m_fY, m_fZ; -}; +Position const FlameRight1Spawn = { 3200.00f, 573.211f, 57.1551f, 0.0f }; +Position const FlameRight1Direction = { 3289.28f, 573.211f, 57.1551f, 0.0f }; +Position const FlameRight2Spawn = { 3200.00f, 532.211f, 57.1551f, 0.0f }; +Position const FlameRight2Direction = { 3289.28f, 532.211f, 57.1551f, 0.0f }; +Position const FlameRight3Spawn = { 3200.00f, 491.211f, 57.1551f, 0.0f }; +Position const FlameRight3Direction = { 3289.28f, 491.211f, 57.1551f, 0.0f }; +Position const FlameLeft1Spawn = { 3289.28f, 511.711f, 57.1551f, 0.0f }; +Position const FlameLeft1Direction = { 3200.00f, 511.711f, 57.1551f, 0.0f }; +Position const FlameLeft2Spawn = { 3289.28f, 552.711f, 57.1551f, 0.0f }; +Position const FlameLeft2Direction = { 3200.00f, 552.711f, 57.1551f, 0.0f }; //each dragons special points. First where fly to before connect to connon, second where land point is. -Waypoint m_aTene[]= +Position const TenebronPositions[] = { - {3212.854f, 575.597f, 109.856f}, // init - {3246.425f, 565.367f, 61.249f} // end + { 3212.854f, 575.597f, 109.856f, 0.0f }, // init + { 3246.425f, 565.367f, 61.249f, 0.0f } // end }; -Waypoint m_aShad[]= +Position const ShadronPositions[] = { - {3293.238f, 472.223f, 106.968f}, - {3271.669f, 526.907f, 61.931f} + { 3293.238f, 472.223f, 106.968f, 0.0f }, + { 3271.669f, 526.907f, 61.931f, 0.0f } }; -Waypoint m_aVesp[]= +Position const VesperonPositions[] = { - {3193.310f, 472.861f, 102.697f}, - {3227.268f, 533.238f, 59.995f} + { 3193.310f, 472.861f, 102.697f, 0.0f }, + { 3227.268f, 533.238f, 59.995f, 0.0f } }; enum SartharionEvents @@ -156,11 +146,8 @@ public: me->SetHomePosition(3246.57f, 551.263f, 58.6164f, 4.66003f); - if (instance) - { - DrakeRespawn(); - instance->SetBossState(DATA_PORTAL_OPEN, NOT_STARTED); - } + DrakeRespawn(); + instance->SetBossState(DATA_PORTAL_OPEN, NOT_STARTED); } void JustReachedHome() OVERRIDE @@ -174,8 +161,7 @@ public: _EnterCombat(); DoZoneInCombat(); - if (instance) - FetchDragons(); + FetchDragons(); events.ScheduleEvent(EVENT_LAVA_STRIKE, 5000); events.ScheduleEvent(EVENT_CLEAVE_ATTACK, 7000); @@ -192,25 +178,23 @@ public: Talk(SAY_SARTHARION_DEATH); _JustDied(); - if (instance) - { - if (Creature* tenebron = Unit::GetCreature(*me, instance->GetData64(DATA_TENEBRON))) - if (tenebron->IsAlive()) - tenebron->DisappearAndDie(); + if (Creature* tenebron = Unit::GetCreature(*me, instance->GetData64(DATA_TENEBRON))) + if (tenebron->IsAlive()) + tenebron->DisappearAndDie(); - if (Creature* shadron = Unit::GetCreature(*me, instance->GetData64(DATA_SHADRON))) - if (shadron->IsAlive()) - shadron->DisappearAndDie(); + if (Creature* shadron = Unit::GetCreature(*me, instance->GetData64(DATA_SHADRON))) + if (shadron->IsAlive()) + shadron->DisappearAndDie(); - if (Creature* vesperon = Unit::GetCreature(*me, instance->GetData64(DATA_VESPERON))) - if (vesperon->IsAlive()) - vesperon->DisappearAndDie(); - } + if (Creature* vesperon = Unit::GetCreature(*me, instance->GetData64(DATA_VESPERON))) + if (vesperon->IsAlive()) + vesperon->DisappearAndDie(); } - void KilledUnit(Unit* /*victim*/) OVERRIDE + void KilledUnit(Unit* who) OVERRIDE { - Talk(SAY_SARTHARION_SLAY); + if (who->GetTypeId() == TYPEID_PLAYER) + Talk(SAY_SARTHARION_SLAY); } // me->ResetLootMode() is called from Reset() @@ -307,7 +291,7 @@ public: AddDrakeLootMode(); ++drakeCount; } - fetchTene->GetMotionMaster()->MovePoint(POINT_ID_INIT, m_aTene[0].m_fX, m_aTene[0].m_fY, m_aTene[0].m_fZ); + fetchTene->GetMotionMaster()->MovePoint(POINT_ID_INIT, TenebronPositions[0]); if (!fetchTene->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) fetchTene->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); @@ -325,7 +309,7 @@ public: AddDrakeLootMode(); ++drakeCount; } - fetchShad->GetMotionMaster()->MovePoint(POINT_ID_INIT, m_aShad[0].m_fX, m_aShad[0].m_fY, m_aShad[0].m_fZ); + fetchShad->GetMotionMaster()->MovePoint(POINT_ID_INIT, ShadronPositions[0]); if (!fetchShad->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) fetchShad->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); @@ -343,7 +327,7 @@ public: AddDrakeLootMode(); ++drakeCount; } - fetchVesp->GetMotionMaster()->MovePoint(POINT_ID_INIT, m_aVesp[0].m_fX, m_aVesp[0].m_fY, m_aVesp[0].m_fZ); + fetchVesp->GetMotionMaster()->MovePoint(POINT_ID_INIT, VesperonPositions[0]); if (!fetchVesp->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) fetchVesp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); @@ -367,24 +351,24 @@ public: if (temp->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) temp->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - int32 textId = 0; + uint8 textId = 0; switch (temp->GetEntry()) { case NPC_TENEBRON: textId = SAY_SARTHARION_CALL_TENEBRON; temp->AddAura(SPELL_POWER_OF_TENEBRON, temp); - temp->GetMotionMaster()->MovePoint(POINT_ID_LAND, m_aTene[1].m_fX, m_aTene[1].m_fY, m_aTene[1].m_fZ); + temp->GetMotionMaster()->MovePoint(POINT_ID_LAND, TenebronPositions[1]); break; case NPC_SHADRON: textId = SAY_SARTHARION_CALL_SHADRON; temp->AddAura(SPELL_POWER_OF_SHADRON, temp); - temp->GetMotionMaster()->MovePoint(POINT_ID_LAND, m_aShad[1].m_fX, m_aShad[1].m_fY, m_aShad[1].m_fZ); + temp->GetMotionMaster()->MovePoint(POINT_ID_LAND, ShadronPositions[1]); break; case NPC_VESPERON: textId = SAY_SARTHARION_CALL_VESPERON; temp->AddAura(SPELL_POWER_OF_VESPERON, temp); - temp->GetMotionMaster()->MovePoint(POINT_ID_LAND, m_aVesp[1].m_fX, m_aVesp[1].m_fY, m_aVesp[1].m_fZ); + temp->GetMotionMaster()->MovePoint(POINT_ID_LAND, VesperonPositions[1]); break; } @@ -402,20 +386,6 @@ public: return 0; } - void SendFlameTsunami() - { - if (Map* map = me->GetMap()) - if (map->IsDungeon()) - { - Map::PlayerList const &PlayerList = map->GetPlayers(); - - if (!PlayerList.isEmpty()) - for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) - if (i->GetSource() && i->GetSource()->IsAlive()) - Talk(WHISPER_LAVA_CHURN, i->GetSource()); - } - } - // Selects a random Fire Cyclone and makes it cast Lava Strike. // FIXME: Frequency of the casts reduced to compensate 100% chance of spawning a Lava Blaze add void CastLavaStrikeOnTarget(Unit* target) @@ -428,13 +398,7 @@ public: if (fireCyclonesList.empty()) return; - std::list<Creature*>::iterator itr = fireCyclonesList.begin(); - uint32 rnd = rand()%fireCyclonesList.size(); - - for (uint32 i = 0; i < rnd; ++i) - ++itr; - - (*itr)->CastSpell(target, SPELL_LAVA_STRIKE, true); + Trinity::Containers::SelectRandomContainerElement(fireCyclonesList)->CastSpell(target, SPELL_LAVA_STRIKE, true); } void UpdateAI(uint32 diff) OVERRIDE @@ -456,25 +420,25 @@ public: } break; case EVENT_FLAME_TSUNAMI: - SendFlameTsunami(); + Talk(WHISPER_LAVA_CHURN); switch (urand(0, 1)) { case 0: { - if (Creature* right1 = me->SummonCreature(NPC_FLAME_TSUNAMI, FlameRight1Spawn.x, FlameRight1Spawn.y, FlameRight1Spawn.z, 0, TEMPSUMMON_TIMED_DESPAWN, 12000)) - right1->GetMotionMaster()->MovePoint(0, FlameRight1Direction.x, FlameRight1Direction.y, FlameRight1Direction.z); - if (Creature* right2 = me->SummonCreature(NPC_FLAME_TSUNAMI, FlameRight2Spawn.x, FlameRight2Spawn.y, FlameRight2Spawn.z, 0, TEMPSUMMON_TIMED_DESPAWN, 12000)) - right2->GetMotionMaster()->MovePoint(0, FlameRight2Direction.x, FlameRight2Direction.y, FlameRight2Direction.z); - if (Creature* right3 = me->SummonCreature(NPC_FLAME_TSUNAMI, FlameRight3Spawn.x, FlameRight3Spawn.y, FlameRight3Spawn.z, 0, TEMPSUMMON_TIMED_DESPAWN, 12000)) - right3->GetMotionMaster()->MovePoint(0, FlameRight3Direction.x, FlameRight3Direction.y, FlameRight3Direction.z); + if (Creature* right1 = me->SummonCreature(NPC_FLAME_TSUNAMI, FlameRight1Spawn, TEMPSUMMON_TIMED_DESPAWN, 12000)) + right1->GetMotionMaster()->MovePoint(0, FlameRight1Direction); + if (Creature* right2 = me->SummonCreature(NPC_FLAME_TSUNAMI, FlameRight2Spawn, TEMPSUMMON_TIMED_DESPAWN, 12000)) + right2->GetMotionMaster()->MovePoint(0, FlameRight2Direction); + if (Creature* right3 = me->SummonCreature(NPC_FLAME_TSUNAMI, FlameRight3Spawn, TEMPSUMMON_TIMED_DESPAWN, 12000)) + right3->GetMotionMaster()->MovePoint(0, FlameRight3Direction); break; } case 1: { - if (Creature* left1 = me->SummonCreature(NPC_FLAME_TSUNAMI, FlameLeft1Spawn.x, FlameLeft1Spawn.y, FlameLeft1Spawn.z, 0, TEMPSUMMON_TIMED_DESPAWN, 12000)) - left1->GetMotionMaster()->MovePoint(0, FlameLeft1Direction.x, FlameLeft1Direction.y, FlameLeft1Direction.z); - if (Creature* left2 = me->SummonCreature(NPC_FLAME_TSUNAMI, FlameLeft2Spawn.x, FlameLeft2Spawn.y, FlameLeft2Spawn.z, 0, TEMPSUMMON_TIMED_DESPAWN, 12000)) - left2->GetMotionMaster()->MovePoint(0, FlameLeft2Direction.x, FlameLeft2Direction.y, FlameLeft2Direction.z); + if (Creature* left1 = me->SummonCreature(NPC_FLAME_TSUNAMI, FlameLeft1Spawn, TEMPSUMMON_TIMED_DESPAWN, 12000)) + left1->GetMotionMaster()->MovePoint(0, FlameLeft1Direction); + if (Creature* left2 = me->SummonCreature(NPC_FLAME_TSUNAMI, FlameLeft2Spawn, TEMPSUMMON_TIMED_DESPAWN, 12000)) + left2->GetMotionMaster()->MovePoint(0, FlameLeft2Direction); break; } } @@ -547,7 +511,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new boss_sartharionAI(creature); + return GetObsidianSanctumAI<boss_sartharionAI>(creature); } }; diff --git a/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/obsidian_sanctum.cpp b/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/obsidian_sanctum.cpp index 6aa1eb74706..9476f4161aa 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/obsidian_sanctum.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/obsidian_sanctum.cpp @@ -94,58 +94,44 @@ enum Misc DATA_CAN_LOOT = 0 }; -struct Location -{ - float x, y, z; -}; - -struct Locations -{ - float x, y, z; -}; - -struct Waypoint -{ - float m_fX, m_fY, m_fZ; -}; - #define MAX_WAYPOINT 6 //points around raid "isle", counter clockwise. should probably be adjusted to be more alike -Waypoint dragonCommon[MAX_WAYPOINT]= +Position const dragonCommon[MAX_WAYPOINT]= { - {3214.012f, 468.932f, 98.652f}, - {3244.950f, 468.427f, 98.652f}, - {3283.520f, 496.869f, 98.652f}, - {3287.316f, 555.875f, 98.652f}, - {3250.479f, 585.827f, 98.652f}, - {3209.969f, 566.523f, 98.652f} + { 3214.012f, 468.932f, 98.652f, 0.0f }, + { 3244.950f, 468.427f, 98.652f, 0.0f }, + { 3283.520f, 496.869f, 98.652f, 0.0f }, + { 3287.316f, 555.875f, 98.652f, 0.0f }, + { 3250.479f, 585.827f, 98.652f, 0.0f }, + { 3209.969f, 566.523f, 98.652f, 0.0f } }; -static Location AcolyteofShadron = { 3363.92f, 534.703f, 97.2683f }; -static Location AcolyteofShadron2 = { 3246.57f, 551.263f, 58.6164f }; -static Location AcolyteofVesperon = { 3145.68f, 520.71f, 89.7f }; -static Location AcolyteofVesperon2 = { 3246.57f, 551.263f, 58.6164f }; +Position const AcolyteofShadron = { 3363.92f, 534.703f, 97.2683f, 0.0f }; +Position const AcolyteofShadron2 = { 3246.57f, 551.263f, 58.6164f, 0.0f }; +Position const AcolyteofVesperon = { 3145.68f, 520.71f, 89.7f, 0.0f }; +Position const AcolyteofVesperon2 = { 3246.57f, 551.263f, 58.6164f, 0.0f }; -Locations TwilightEggs[] = +Position const TwilightEggs[] = { - {3219.28f, 669.121f, 88.5549f}, - {3221.55f, 682.852f, 90.5361f}, - {3239.77f, 685.94f, 90.3168f}, - {3250.33f, 669.749f, 88.7637f}, - {3246.6f, 642.365f, 84.8752f}, - {3233.68f, 653.117f, 85.7051f} + { 3219.28f, 669.121f, 88.5549f, 0.0f }, + { 3221.55f, 682.852f, 90.5361f, 0.0f }, + { 3239.77f, 685.94f, 90.3168f, 0.0f }, + { 3250.33f, 669.749f, 88.7637f, 0.0f }, + { 3246.6f, 642.365f, 84.8752f, 0.0f }, + { 3233.68f, 653.117f, 85.7051f, 0.0f } }; -Locations TwilightEggsSarth[] = + +Position const TwilightEggsSarth[] = { - {3252.73f, 515.762f, 58.5501f}, - {3256.56f, 521.119f, 58.6061f}, - {3255.63f, 527.513f, 58.7568f}, - {3264.90f, 525.865f, 58.6436f}, - {3264.26f, 516.364f, 58.8011f}, - {3257.54f, 502.285f, 58.2077f} + { 3252.73f, 515.762f, 58.5501f, 0.0f }, + { 3256.56f, 521.119f, 58.6061f, 0.0f }, + { 3255.63f, 527.513f, 58.7568f, 0.0f }, + { 3264.90f, 525.865f, 58.6436f, 0.0f }, + { 3264.26f, 516.364f, 58.8011f, 0.0f }, + { 3257.54f, 502.285f, 58.2077f, 0.0f } }; -enum SharedTextIDs +enum SharedTextIds { SAY_AGGRO = 0, SAY_SLAY = 1, @@ -157,12 +143,24 @@ enum SharedTextIDs WHISPER_OPENED_PORTAL = 7 }; -enum DummyDragonEvents +enum DragonEvents { - EVENT_FREE_MOVEMENT = 1 + // Shared Events + EVENT_FREE_MOVEMENT = 1, + EVENT_SHADOW_FISSURE = 2, + EVENT_SHADOW_BREATH = 3, + + // Tenebron + EVENT_HATCH_EGGS = 4, + + // Shadron + EVENT_ACOLYTE_SHADRON = 5, + + // Vesperon + EVENT_ACOLYTE_VESPERON = 6 }; -//to control each dragons common abilities +// to control each dragons common abilities struct dummy_dragonAI : public ScriptedAI { dummy_dragonAI(Creature* creature) : ScriptedAI(creature) @@ -175,12 +173,22 @@ struct dummy_dragonAI : public ScriptedAI if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + events.Reset(); waypointId = 0; portalRespawnTime = 30000; _canMoveFree = false; _canLoot = true; } + void EnterCombat(Unit* /*who*/) OVERRIDE + { + Talk(SAY_AGGRO); + DoZoneInCombat(); + + events.ScheduleEvent(EVENT_SHADOW_FISSURE, 5000); + events.ScheduleEvent(EVENT_SHADOW_BREATH, 20000); + } + void SetData(uint32 type, uint32 value) OVERRIDE { if (type == DATA_CAN_LOOT) @@ -217,14 +225,11 @@ struct dummy_dragonAI : public ScriptedAI return; } - // get amount of common points - uint32 commonWPCount = sizeof(dragonCommon)/sizeof(Waypoint); - // increase - waypointId = pointId+1; + waypointId = pointId + 1; // if we have reached a point bigger or equal to count, it mean we must reset to point 0 - if (waypointId >= commonWPCount) + if (waypointId >= MAX_WAYPOINT) { if (!_canMoveFree) _canMoveFree = true; @@ -235,23 +240,6 @@ struct dummy_dragonAI : public ScriptedAI events.ScheduleEvent(EVENT_FREE_MOVEMENT, 500); } - // used when open portal and spawn mobs in phase - void DoRaidWhisper(int32 iTextId) - { - Map* map = me->GetMap(); - - if (map && map->IsDungeon()) - { - Map::PlayerList const &PlayerList = map->GetPlayers(); - - if (!PlayerList.isEmpty()) - { - for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) - Talk(iTextId, i->GetSource()); - } - } - } - // "opens" the portal and does the "opening" whisper void OpenPortal() { @@ -268,21 +256,21 @@ struct dummy_dragonAI : public ScriptedAI if (instance && !instance->GetBossState(DATA_SARTHARION) == IN_PROGRESS) { for (uint32 i = 0; i < 6; ++i) - me->SummonCreature(NPC_TWILIGHT_EGG, TwilightEggs[i].x, TwilightEggs[i].y, TwilightEggs[i].z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000); + me->SummonCreature(NPC_TWILIGHT_EGG, TwilightEggs[i], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000); } else { for (uint32 i = 0; i < 6; ++i) - me->SummonCreature(NPC_SARTHARION_TWILIGHT_EGG, TwilightEggsSarth[i].x, TwilightEggsSarth[i].y, TwilightEggsSarth[i].z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000); + me->SummonCreature(NPC_SARTHARION_TWILIGHT_EGG, TwilightEggsSarth[i], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000); } break; } case NPC_SHADRON: { if (instance && !instance->GetBossState(DATA_SARTHARION) == IN_PROGRESS) - me->SummonCreature(NPC_ACOLYTE_OF_SHADRON, AcolyteofShadron.x, AcolyteofShadron.y, AcolyteofShadron.z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 28000); + me->SummonCreature(NPC_ACOLYTE_OF_SHADRON, AcolyteofShadron, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 28000); else - me->SummonCreature(NPC_ACOLYTE_OF_SHADRON, AcolyteofShadron2.x, AcolyteofShadron2.y, AcolyteofShadron2.z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 28000); + me->SummonCreature(NPC_ACOLYTE_OF_SHADRON, AcolyteofShadron2, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 28000); break; } @@ -290,7 +278,7 @@ struct dummy_dragonAI : public ScriptedAI { if (instance && !instance->GetBossState(DATA_SARTHARION) == IN_PROGRESS) { - if (Creature* acolyte = me->SummonCreature(NPC_ACOLYTE_OF_VESPERON, AcolyteofVesperon.x, AcolyteofVesperon.y, AcolyteofVesperon.z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000)) + if (Creature* acolyte = me->SummonCreature(NPC_ACOLYTE_OF_VESPERON, AcolyteofVesperon, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000)) { me->InterruptNonMeleeSpells(true); acolyte->InterruptNonMeleeSpells(true); @@ -299,7 +287,7 @@ struct dummy_dragonAI : public ScriptedAI } else { - if (Creature* acolyte = me->SummonCreature(NPC_ACOLYTE_OF_VESPERON, AcolyteofVesperon2.x, AcolyteofVesperon2.y, AcolyteofVesperon2.z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000)) + if (Creature* acolyte = me->SummonCreature(NPC_ACOLYTE_OF_VESPERON, AcolyteofVesperon2, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000)) { me->InterruptNonMeleeSpells(true); acolyte->InterruptNonMeleeSpells(true); @@ -307,12 +295,12 @@ struct dummy_dragonAI : public ScriptedAI } } - break; + break; } } - DoRaidWhisper(WHISPER_OPEN_PORTAL); - DoRaidWhisper(WHISPER_OPENED_PORTAL); + Talk(WHISPER_OPEN_PORTAL); + Talk(WHISPER_OPENED_PORTAL); // By using SetRespawnTime() we will actually "spawn" the object with our defined time. // Once time is up, portal will disappear again. @@ -323,6 +311,12 @@ struct dummy_dragonAI : public ScriptedAI // Refresh respawnTime so time again are set to 30secs? } + void KilledUnit(Unit* who) OVERRIDE + { + if (who->GetTypeId() == TYPEID_PLAYER) + Talk(SAY_SLAY); + } + void JustDied(Unit* /*killer*/) OVERRIDE { if (!_canLoot) @@ -365,7 +359,7 @@ struct dummy_dragonAI : public ScriptedAI return; // Twilight Revenge to main boss - if (Unit* sartharion = Unit::GetUnit(*me, instance->GetData64(DATA_SARTHARION))) + if (Unit* sartharion = ObjectAccessor::GetUnit(*me, instance->GetData64(DATA_SARTHARION))) if (sartharion->IsAlive()) { sartharion->RemoveAurasDueToSpell(spellId); @@ -381,11 +375,30 @@ struct dummy_dragonAI : public ScriptedAI if (events.ExecuteEvent() == EVENT_FREE_MOVEMENT) { if (_canMoveFree && waypointId < MAX_WAYPOINT) - me->GetMotionMaster()->MovePoint(waypointId, dragonCommon[waypointId].m_fX, dragonCommon[waypointId].m_fY, dragonCommon[waypointId].m_fZ); + me->GetMotionMaster()->MovePoint(waypointId, dragonCommon[waypointId]); } } - private: + void ExecuteEvent(uint32 eventId) + { + switch (eventId) + { + case EVENT_SHADOW_FISSURE: + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true)) + DoCast(target, RAID_MODE(SPELL_SHADOW_FISSURE, SPELL_SHADOW_FISSURE)); + events.ScheduleEvent(eventId, urand(15000, 20000)); + break; + case EVENT_SHADOW_BREATH: + Talk(SAY_BREATH); + DoCastVictim(RAID_MODE(SPELL_SHADOW_BREATH, SPELL_SHADOW_BREATH_H)); + events.ScheduleEvent(eventId, urand(20000, 25000)); + break; + default: + break; + } + } + + protected: InstanceScript* instance; EventMap events; uint32 waypointId; @@ -398,13 +411,6 @@ struct dummy_dragonAI : public ScriptedAI ## Tenebron ######*/ -enum TenebronEvents -{ - EVENT_SHADOW_FISSURE_TENEBRON = 2, - EVENT_HATCH_EGGS = 3, - EVENT_SHADOW_BREATH_TENEBRON = 4 -}; - class npc_tenebron : public CreatureScript { public: @@ -419,23 +425,16 @@ public: dummy_dragonAI::Reset(); } - void EnterCombat(Unit* /*who*/) OVERRIDE + void EnterCombat(Unit* who) OVERRIDE { - Talk(SAY_AGGRO); - DoZoneInCombat(); - events.ScheduleEvent(EVENT_SHADOW_FISSURE_TENEBRON, 5000); - events.ScheduleEvent(EVENT_HATCH_EGGS, 30000); - events.ScheduleEvent(EVENT_SHADOW_BREATH_TENEBRON, 20000); - } + dummy_dragonAI::EnterCombat(who); - void KilledUnit(Unit* /*victim*/) OVERRIDE - { - Talk(SAY_SLAY); + events.ScheduleEvent(EVENT_HATCH_EGGS, 30000); } void UpdateAI(uint32 diff) OVERRIDE { - //if no target, update dummy and return + // if no target, update dummy and return if (!UpdateVictim()) { dummy_dragonAI::UpdateAI(diff); @@ -448,32 +447,23 @@ public: { switch (eventId) { - case EVENT_SHADOW_FISSURE_TENEBRON: - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) - DoCast(target, RAID_MODE(SPELL_SHADOW_FISSURE, SPELL_SHADOW_FISSURE)); - events.ScheduleEvent(EVENT_SHADOW_FISSURE_TENEBRON, urand(15000, 20000)); - break; case EVENT_HATCH_EGGS: OpenPortal(); events.ScheduleEvent(EVENT_HATCH_EGGS, 30000); break; - case EVENT_SHADOW_BREATH_TENEBRON: - Talk(SAY_BREATH); - DoCastVictim(RAID_MODE(SPELL_SHADOW_BREATH, SPELL_SHADOW_BREATH_H)); - events.ScheduleEvent(EVENT_SHADOW_BREATH_TENEBRON, urand(20000, 25000)); + default: + dummy_dragonAI::ExecuteEvent(eventId); break; } } + DoMeleeAttackIfReady(); } - - private: - EventMap events; }; CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_tenebronAI(creature); + return GetObsidianSanctumAI<npc_tenebronAI>(creature); } }; @@ -481,13 +471,6 @@ public: ## Shadron ######*/ -enum ShadronEvents -{ - EVENT_SHADOW_FISSURE_SHADRON = 5, - EVENT_ACOLYTE_SHADRON = 6, - EVENT_SHADOW_BREATH_SHADRON = 7 -}; - class npc_shadron : public CreatureScript { public: @@ -495,10 +478,7 @@ public: struct npc_shadronAI : public dummy_dragonAI { - npc_shadronAI(Creature* creature) : dummy_dragonAI(creature) - { - instance = creature->GetInstanceScript(); - } + npc_shadronAI(Creature* creature) : dummy_dragonAI(creature) { } void Reset() OVERRIDE { @@ -510,27 +490,19 @@ public: if (me->HasAura(SPELL_GIFT_OF_TWILIGTH_SHA)) me->RemoveAurasDueToSpell(SPELL_GIFT_OF_TWILIGTH_SHA); - if (instance) - instance->SetBossState(DATA_PORTAL_OPEN, NOT_STARTED); + instance->SetBossState(DATA_PORTAL_OPEN, NOT_STARTED); } - void EnterCombat(Unit* /*who*/) OVERRIDE + void EnterCombat(Unit* who) OVERRIDE { - Talk(SAY_AGGRO); - DoZoneInCombat(); - events.ScheduleEvent(EVENT_SHADOW_FISSURE_SHADRON, 5000); - events.ScheduleEvent(EVENT_ACOLYTE_SHADRON, 60000); - events.ScheduleEvent(EVENT_SHADOW_BREATH_SHADRON, 20000); - } + dummy_dragonAI::EnterCombat(who); - void KilledUnit(Unit* /*victim*/) OVERRIDE - { - Talk(SAY_SLAY); + events.ScheduleEvent(EVENT_ACOLYTE_SHADRON, 60000); } void UpdateAI(uint32 diff) OVERRIDE { - //if no target, update dummy and return + // if no target, update dummy and return if (!UpdateVictim()) { dummy_dragonAI::UpdateAI(diff); @@ -543,11 +515,6 @@ public: { switch (eventId) { - case EVENT_SHADOW_FISSURE_SHADRON: - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) - DoCast(target, RAID_MODE(SPELL_SHADOW_FISSURE, SPELL_SHADOW_FISSURE_H)); - events.ScheduleEvent(EVENT_SHADOW_FISSURE_SHADRON, urand(15000, 20000)); - break; case EVENT_ACOLYTE_SHADRON: if (instance->GetBossState(DATA_PORTAL_OPEN) == NOT_STARTED) events.ScheduleEvent(EVENT_ACOLYTE_SHADRON, 10000); @@ -558,30 +525,24 @@ public: OpenPortal(); - if (instance) - instance->SetBossState(DATA_PORTAL_OPEN, IN_PROGRESS); + instance->SetBossState(DATA_PORTAL_OPEN, IN_PROGRESS); events.ScheduleEvent(EVENT_ACOLYTE_SHADRON, urand(60000, 65000)); } break; - case EVENT_SHADOW_BREATH_SHADRON: - Talk(SAY_BREATH); - DoCastVictim(RAID_MODE(SPELL_SHADOW_BREATH, SPELL_SHADOW_BREATH_H)); - events.ScheduleEvent(EVENT_SHADOW_BREATH_SHADRON, urand(20000, 25000)); + default: + dummy_dragonAI::ExecuteEvent(eventId); break; } } + DoMeleeAttackIfReady(); } - - private: - InstanceScript* instance; - EventMap events; }; CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_shadronAI(creature); + return GetObsidianSanctumAI<npc_shadronAI>(creature); } }; @@ -589,13 +550,6 @@ public: ## Vesperon ######*/ -enum VesperonEvents -{ - EVENT_SHADOW_FISSURE_VESPERON = 8, - EVENT_ACOLYTE_VESPERON = 9, - EVENT_SHADOW_BREATH_VESPERON = 10 -}; - class npc_vesperon : public CreatureScript { public: @@ -603,33 +557,23 @@ public: struct npc_vesperonAI : public dummy_dragonAI { - npc_vesperonAI(Creature* creature) : dummy_dragonAI(creature) - { - instance = creature->GetInstanceScript(); - } + npc_vesperonAI(Creature* creature) : dummy_dragonAI(creature) { } void Reset() OVERRIDE { dummy_dragonAI::Reset(); } - void EnterCombat(Unit* /*who*/) OVERRIDE + void EnterCombat(Unit* who) OVERRIDE { - Talk(SAY_AGGRO); - DoZoneInCombat(); - events.ScheduleEvent(EVENT_SHADOW_FISSURE_VESPERON, 5000); - events.ScheduleEvent(EVENT_ACOLYTE_VESPERON, 60000); - events.ScheduleEvent(EVENT_SHADOW_BREATH_VESPERON, 20000); - } + dummy_dragonAI::EnterCombat(who); - void KilledUnit(Unit* /*victim*/) OVERRIDE - { - Talk(SAY_SLAY); + events.ScheduleEvent(EVENT_ACOLYTE_VESPERON, 60000); } void UpdateAI(uint32 diff) OVERRIDE { - //if no target, update dummy and return + // if no target, update dummy and return if (!UpdateVictim()) { dummy_dragonAI::UpdateAI(diff); @@ -642,11 +586,6 @@ public: { switch (eventId) { - case EVENT_SHADOW_FISSURE_VESPERON: - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) - DoCast(target, RAID_MODE(SPELL_SHADOW_FISSURE, SPELL_SHADOW_FISSURE_H)); - events.ScheduleEvent(EVENT_SHADOW_FISSURE_VESPERON, urand(15000, 20000)); - break; case EVENT_ACOLYTE_VESPERON: if (instance->GetBossState(DATA_PORTAL_OPEN) == IN_PROGRESS) events.ScheduleEvent(EVENT_ACOLYTE_VESPERON, 10000); @@ -657,24 +596,19 @@ public: events.ScheduleEvent(EVENT_ACOLYTE_VESPERON, urand(60000, 70000)); } break; - case EVENT_SHADOW_BREATH_VESPERON: - Talk(SAY_BREATH); - DoCastVictim(RAID_MODE(SPELL_SHADOW_BREATH, SPELL_SHADOW_BREATH_H)); - events.ScheduleEvent(EVENT_SHADOW_BREATH_VESPERON, urand(20000, 25000)); + default: + dummy_dragonAI::ExecuteEvent(eventId); break; } } + DoMeleeAttackIfReady(); } - - private: - InstanceScript* instance; - EventMap events; }; CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_vesperonAI(creature); + return GetObsidianSanctumAI<npc_vesperonAI>(creature); } }; @@ -684,23 +618,21 @@ public: class npc_acolyte_of_shadron : public CreatureScript { -public: - npc_acolyte_of_shadron() : CreatureScript("npc_acolyte_of_shadron") { } - - struct npc_acolyte_of_shadronAI : public ScriptedAI - { - npc_acolyte_of_shadronAI(Creature* creature) : ScriptedAI(creature) - { - instance = creature->GetInstanceScript(); - } + public: + npc_acolyte_of_shadron() : CreatureScript("npc_acolyte_of_shadron") { } - void Reset() OVERRIDE + struct npc_acolyte_of_shadronAI : public ScriptedAI { - // Despawn the NPC automatically after 28 seconds - me->DespawnOrUnsummon(28000); + npc_acolyte_of_shadronAI(Creature* creature) : ScriptedAI(creature) + { + instance = creature->GetInstanceScript(); + } - if (instance) + void Reset() OVERRIDE { + // Despawn the NPC automatically after 28 seconds + me->DespawnOrUnsummon(28000); + //if not solo fight, buff main boss, else place debuff on mini-boss. both spells TARGET_SCRIPT if (instance->GetBossState(DATA_SARTHARION) == IN_PROGRESS) { @@ -712,14 +644,11 @@ public: if (Creature* shadron = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_SHADRON))) shadron->AddAura(SPELL_GIFT_OF_TWILIGTH_SHA, shadron); } - } - me->AddAura(SPELL_TWILIGHT_SHIFT_ENTER, me); - } + me->AddAura(SPELL_TWILIGHT_SHIFT_ENTER, me); + } - void JustDied(Unit* /*killer*/) OVERRIDE - { - if (instance) + void JustDied(Unit* /*killer*/) OVERRIDE { if (ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_SHADRON))) instance->SetBossState(DATA_PORTAL_OPEN, NOT_STARTED); @@ -727,7 +656,7 @@ public: Map* map = me->GetMap(); if (map->IsDungeon()) { - Map::PlayerList const &PlayerList = map->GetPlayers(); + Map::PlayerList const& PlayerList = map->GetPlayers(); if (PlayerList.isEmpty()) return; @@ -741,7 +670,7 @@ public: i->GetSource()->RemoveAurasDueToSpell(SPELL_TWILIGHT_SHIFT); i->GetSource()->RemoveAurasDueToSpell(SPELL_TWILIGHT_SHIFT_ENTER); } - } + } } // not solo fight, so main boss has debuff @@ -754,24 +683,23 @@ public: if (debuffTarget->IsAlive() && debuffTarget->HasAura(SPELL_GIFT_OF_TWILIGTH_SHA)) debuffTarget->RemoveAurasDueToSpell(SPELL_GIFT_OF_TWILIGTH_SHA); } - } - void UpdateAI(uint32 /*diff*/) OVERRIDE - { - if (!UpdateVictim()) - return; + void UpdateAI(uint32 /*diff*/) OVERRIDE + { + if (!UpdateVictim()) + return; - DoMeleeAttackIfReady(); - } + DoMeleeAttackIfReady(); + } - private: - InstanceScript* instance; - }; + private: + InstanceScript* instance; + }; - CreatureAI* GetAI(Creature* creature) const OVERRIDE - { - return new npc_acolyte_of_shadronAI(creature); - } + CreatureAI* GetAI(Creature* creature) const OVERRIDE + { + return GetObsidianSanctumAI<npc_acolyte_of_shadronAI>(creature); + } }; /*###### @@ -780,34 +708,31 @@ public: class npc_acolyte_of_vesperon : public CreatureScript { -public: - npc_acolyte_of_vesperon() : CreatureScript("npc_acolyte_of_vesperon") { } + public: + npc_acolyte_of_vesperon() : CreatureScript("npc_acolyte_of_vesperon") { } - struct npc_acolyte_of_vesperonAI : public ScriptedAI - { - npc_acolyte_of_vesperonAI(Creature* creature) : ScriptedAI(creature) + struct npc_acolyte_of_vesperonAI : public ScriptedAI { - instance = creature->GetInstanceScript(); - } + npc_acolyte_of_vesperonAI(Creature* creature) : ScriptedAI(creature) + { + instance = creature->GetInstanceScript(); + } - void Reset() OVERRIDE - { - // Despawn the NPC automatically after 28 seconds - me->DespawnOrUnsummon(28000); + void Reset() OVERRIDE + { + // Despawn the NPC automatically after 28 seconds + me->DespawnOrUnsummon(28000); - if (instance) me->AddAura(SPELL_TWILIGHT_SHIFT_ENTER, me); - DoCast(me, SPELL_TWILIGHT_TORMENT_VESP_ACO); - } - - void JustDied(Unit* /*killer*/) OVERRIDE - { - me->RemoveAurasDueToSpell(SPELL_TWILIGHT_TORMENT_VESP_ACO); + DoCast(me, SPELL_TWILIGHT_TORMENT_VESP_ACO); + } - // remove twilight torment on Vesperon - if (instance) + void JustDied(Unit* /*killer*/) OVERRIDE { + me->RemoveAurasDueToSpell(SPELL_TWILIGHT_TORMENT_VESP_ACO); + + // remove twilight torment on Vesperon if (Creature* vesperon = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_VESPERON))) { instance->SetBossState(DATA_PORTAL_OPEN, NOT_STARTED); @@ -842,24 +767,23 @@ public: instance->DoRemoveAurasDueToSpellOnPlayers(57935); instance->DoRemoveAurasDueToSpellOnPlayers(58835); // Components of spell Twilight Torment } - } - void UpdateAI(uint32 /*diff*/) OVERRIDE - { - if (!UpdateVictim()) - return; + void UpdateAI(uint32 /*diff*/) OVERRIDE + { + if (!UpdateVictim()) + return; - DoMeleeAttackIfReady(); - } + DoMeleeAttackIfReady(); + } - private: - InstanceScript* instance; - }; + private: + InstanceScript* instance; + }; - CreatureAI* GetAI(Creature* creature) const OVERRIDE - { - return new npc_acolyte_of_vesperonAI(creature); - } + CreatureAI* GetAI(Creature* creature) const OVERRIDE + { + return GetObsidianSanctumAI<npc_acolyte_of_vesperonAI>(creature); + } }; /*###### @@ -886,8 +810,7 @@ public: void Reset() OVERRIDE { - if (instance) - me->AddAura(SPELL_TWILIGHT_SHIFT_ENTER, me); + me->AddAura(SPELL_TWILIGHT_SHIFT_ENTER, me); events.ScheduleEvent(EVENT_TWILIGHT_EGGS, 20000); } @@ -928,7 +851,7 @@ public: CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return new npc_twilight_eggsAI(creature); + return GetObsidianSanctumAI<npc_twilight_eggsAI>(creature); } }; diff --git a/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/obsidian_sanctum.h b/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/obsidian_sanctum.h index 8cfb3931372..d8f49a06578 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/obsidian_sanctum.h +++ b/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/obsidian_sanctum.h @@ -15,8 +15,8 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef DEF_OBSIDIAN_SANCTUM_H -#define DEF_OBSIDIAN_SANCTUM_H +#ifndef OBSIDIAN_SANCTUM_H_ +#define OBSIDIAN_SANCTUM_H_ #define OSScriptName "instance_obsidian_sanctum" @@ -45,4 +45,10 @@ enum GameObjectIds GO_TWILIGHT_PORTAL = 193988 }; -#endif +template<class AI> +AI* GetObsidianSanctumAI(Creature* creature) +{ + return GetInstanceAI<AI>(creature, OSScriptName); +} + +#endif // OBSIDIAN_SANCTUM_H_ diff --git a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp index 7d923e7686f..f3ed568fe23 100644 --- a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp @@ -480,9 +480,7 @@ class spell_devourer_of_souls_mirrored_soul_target_selector : public SpellScript class achievement_three_faced : public AchievementCriteriaScript { public: - achievement_three_faced() : AchievementCriteriaScript("achievement_three_faced") - { - } + achievement_three_faced() : AchievementCriteriaScript("achievement_three_faced") { } bool OnCheck(Player* /*player*/, Unit* target) OVERRIDE { diff --git a/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp b/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp index 441149c6dd8..4c25bead1b4 100644 --- a/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp +++ b/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp @@ -184,9 +184,10 @@ public: instance->SetData(DATA_SLAD_RAN_EVENT, DONE); } - void KilledUnit(Unit* /*victim*/) OVERRIDE + void KilledUnit(Unit* who) OVERRIDE { - Talk(SAY_SLAY); + if (who->GetTypeId() == TYPEID_PLAYER) + Talk(SAY_SLAY); } void JustSummoned(Creature* summoned) OVERRIDE diff --git a/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp index 455653a136e..f598de52e49 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp @@ -116,9 +116,10 @@ public: instance->SetData(DATA_KERISTRASZA_EVENT, DONE); } - void KilledUnit(Unit* /*victim*/) OVERRIDE + void KilledUnit(Unit* who) OVERRIDE { - Talk(SAY_SLAY); + if (who->GetTypeId() == TYPEID_PLAYER) + Talk(SAY_SLAY); } bool CheckContainmentSpheres(bool remove_prison = false) diff --git a/src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp index 8a01c40186e..1656d4c5a72 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp @@ -138,9 +138,10 @@ public: instance->SetData(DATA_MAGUS_TELESTRA_EVENT, DONE); } - void KilledUnit(Unit* /*victim*/) OVERRIDE + void KilledUnit(Unit* who) OVERRIDE { - Talk(SAY_KILL); + if (who->GetTypeId() == TYPEID_PLAYER) + Talk(SAY_KILL); } void DoAction(int32 action) OVERRIDE diff --git a/src/server/scripts/Northrend/Nexus/Nexus/boss_ormorok.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_ormorok.cpp index e2789995ec7..d911aa8ed1a 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/boss_ormorok.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_ormorok.cpp @@ -106,9 +106,10 @@ public: instance->SetData(DATA_ORMOROK_EVENT, DONE); } - void KilledUnit(Unit* /*victim*/) OVERRIDE + void KilledUnit(Unit* who) OVERRIDE { - Talk(SAY_KILL); + if (who->GetTypeId() == TYPEID_PLAYER) + Talk(SAY_KILL); } void UpdateAI(uint32 diff) OVERRIDE diff --git a/src/server/scripts/Northrend/Nexus/Oculus/boss_eregos.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_eregos.cpp index ca6f580633c..875ddf8c9da 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/boss_eregos.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/boss_eregos.cpp @@ -99,9 +99,10 @@ class boss_eregos : public CreatureScript DoAction(ACTION_SET_NORMAL_EVENTS); } - void KilledUnit(Unit* /*victim*/) OVERRIDE + void KilledUnit(Unit* who) OVERRIDE { - Talk(SAY_KILL); + if (who->GetTypeId() == TYPEID_PLAYER) + Talk(SAY_KILL); } void EnterCombat(Unit* /*who*/) OVERRIDE diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp index af6beca608d..af89c7815ba 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp @@ -137,9 +137,10 @@ public: instance->SetBossState(DATA_IONAR, DONE); } - void KilledUnit(Unit* /*victim*/) OVERRIDE + void KilledUnit(Unit* who) OVERRIDE { - Talk(SAY_SLAY); + if (who->GetTypeId() == TYPEID_PLAYER) + Talk(SAY_SLAY); } void SpellHit(Unit* /*caster*/, const SpellInfo* spell) OVERRIDE diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp index 61687de1b58..af6cc7350c3 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp @@ -124,9 +124,10 @@ public: } } - void KilledUnit(Unit* /*victim*/) OVERRIDE + void KilledUnit(Unit* who) OVERRIDE { - Talk(SAY_SLAY); + if (who->GetTypeId() == TYPEID_PLAYER) + Talk(SAY_SLAY); } void UpdateAI(uint32 uiDiff) OVERRIDE diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp index b6790a088ad..5cd17a2c8d2 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp @@ -154,9 +154,10 @@ public: instance->SetBossState(DATA_VOLKHAN, DONE); } - void KilledUnit(Unit* /*victim*/) OVERRIDE + void KilledUnit(Unit* who) OVERRIDE { - Talk(SAY_SLAY); + if (who->GetTypeId() == TYPEID_PLAYER) + Talk(SAY_SLAY); } void DespawnGolem() diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp index 77c19422da0..7a25077cadd 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp @@ -193,9 +193,10 @@ public: //Talk(SAY_DEATH); } - void KilledUnit(Unit* /*victim*/) OVERRIDE + void KilledUnit(Unit* who) OVERRIDE { - Talk(SAY_SLAY); + if (who->GetTypeId() == TYPEID_PLAYER) + Talk(SAY_SLAY); } void DoAction(int32 actionId) OVERRIDE diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp index 01fcd9a665d..12d25045a92 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp @@ -415,9 +415,10 @@ public: instance->SetBossState(DATA_SKADI_THE_RUTHLESS, DONE); } - void KilledUnit(Unit* /*victim*/) OVERRIDE + void KilledUnit(Unit* who) OVERRIDE { - Talk(SAY_KILL); + if (who->GetTypeId() == TYPEID_PLAYER) + Talk(SAY_KILL); } void SpawnMobs() diff --git a/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp b/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp index ff3145c5c78..0e3018d3f98 100644 --- a/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp +++ b/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp @@ -116,11 +116,10 @@ class npc_millhouse_manastorm : public CreatureScript } } - void EnterCombat(Unit* /*who*/) OVERRIDE { } - - void KilledUnit(Unit* /*victim*/) OVERRIDE + void KilledUnit(Unit* who) OVERRIDE { - Talk(SAY_KILL); + if (who->GetTypeId() == TYPEID_PLAYER) + Talk(SAY_KILL); } void JustDied(Unit* /*killer*/) OVERRIDE diff --git a/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.h b/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.h index 1ebfad4dfeb..c3b7d754a0d 100644 --- a/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.h +++ b/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.h @@ -32,11 +32,11 @@ enum DataTypes // Additional Data DATA_CONVERSATION = 4, - DATA_WARDEN_1 = 5, // used by EventAI - DATA_WARDEN_2 = 6, // used by EventAI - DATA_WARDEN_3 = 7, // used by EventAI - DATA_WARDEN_4 = 8, // used by EventAI - DATA_WARDEN_5 = 9, // used by EventAI + DATA_WARDEN_1 = 5, // used by SmartAI + DATA_WARDEN_2 = 6, // used by SmartAI + DATA_WARDEN_3 = 7, // used by SmartAI + DATA_WARDEN_4 = 8, // used by SmartAI + DATA_WARDEN_5 = 9, // used by SmartAI DATA_MELLICHAR = 10, DATA_WARDENS_SHIELD = 11 }; |