diff options
Diffstat (limited to 'src')
12 files changed, 344 insertions, 320 deletions
diff --git a/src/bindings/scripts/include/sc_creature.cpp b/src/bindings/scripts/include/sc_creature.cpp index c80f55fc0f5..0ed59db42bf 100644 --- a/src/bindings/scripts/include/sc_creature.cpp +++ b/src/bindings/scripts/include/sc_creature.cpp @@ -174,14 +174,14 @@ void ScriptedAI::DoWhisper(const char* text, Unit* reciever, bool IsBossWhisper) m_creature->MonsterWhisper(text, reciever->GetGUID(), IsBossWhisper); } -void ScriptedAI::DoPlaySoundToSet(Unit* pSource, uint32 uiSoundId) +void ScriptedAI::DoPlaySoundToSet(WorldObject* pSource, uint32 uiSoundId) { if (!pSource) return; if (!GetSoundEntriesStore()->LookupEntry(uiSoundId)) { - error_log("TSCR: Invalid soundId %u used in DoPlaySoundToSet (by unit TypeId %u, guid %u)", uiSoundId, pSource->GetTypeId(), pSource->GetGUID()); + error_log("TSCR: Invalid soundId %u used in DoPlaySoundToSet (Source: TypeId %u, GUID %u)", uiSoundId, pSource->GetTypeId(), pSource->GetGUIDLow()); return; } diff --git a/src/bindings/scripts/include/sc_creature.h b/src/bindings/scripts/include/sc_creature.h index 666ec1fad44..e4142780443 100644 --- a/src/bindings/scripts/include/sc_creature.h +++ b/src/bindings/scripts/include/sc_creature.h @@ -143,7 +143,7 @@ struct TRINITY_DLL_DECL ScriptedAI : public CreatureAI void DoWhisper(const char* text, Unit* reciever, bool IsBossWhisper = false); //Plays a sound to all nearby players - void DoPlaySoundToSet(Unit* unit, uint32 sound); + void DoPlaySoundToSet(WorldObject* pSource, uint32 sound); //Drops all threat to 0%. Does not remove players from the threat list void DoResetThreat(); diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_bloodboil.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_bloodboil.cpp index 04cd1799195..92c203232ab 100644 --- a/src/bindings/scripts/scripts/zone/black_temple/boss_bloodboil.cpp +++ b/src/bindings/scripts/scripts/zone/black_temple/boss_bloodboil.cpp @@ -52,16 +52,6 @@ EndScriptData */ #define SPELL_BERSERK 45078 //This is used to sort the players by distance in preparation for the Bloodboil cast. -struct TargetDistanceOrder : public std::binary_function<const Unit, const Unit, bool> -{ - const Unit* MainTarget; - TargetDistanceOrder(const Unit* Target) : MainTarget(Target) {}; - // functor for operator ">" - bool operator()(const Unit* _Left, const Unit* _Right) const - { - return !MainTarget->GetDistanceOrder(_Left, _Right); - } -}; struct TRINITY_DLL_DECL boss_gurtogg_bloodboilAI : public ScriptedAI { @@ -160,7 +150,7 @@ struct TRINITY_DLL_DECL boss_gurtogg_bloodboilAI : public ScriptedAI } //Sort the list of players - targets.sort(TargetDistanceOrder(m_creature)); + targets.sort(ObjectDistanceOrderReversed(m_creature)); //Resize so we only get top 5 targets.resize(5); diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_reliquary_of_souls.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_reliquary_of_souls.cpp index e3a29813977..66f4d3b4c63 100644 --- a/src/bindings/scripts/scripts/zone/black_temple/boss_reliquary_of_souls.cpp +++ b/src/bindings/scripts/scripts/zone/black_temple/boss_reliquary_of_souls.cpp @@ -334,18 +334,6 @@ struct TRINITY_DLL_DECL boss_reliquary_of_soulsAI : public ScriptedAI } }; -//This is used to sort the players by distance in preparation for the Fixate cast. -struct TargetDistanceOrder : public std::binary_function<const Unit, const Unit, bool> -{ - const Unit* MainTarget; - TargetDistanceOrder(const Unit* Target) : MainTarget(Target) {}; - // functor for operator "<" - bool operator()(const Unit* _Left, const Unit* _Right) const - { - return MainTarget->GetDistanceOrder(_Left, _Right); - } -}; - struct TRINITY_DLL_DECL boss_essence_of_sufferingAI : public ScriptedAI { boss_essence_of_sufferingAI(Creature *c) : ScriptedAI(c) {} @@ -418,7 +406,7 @@ struct TRINITY_DLL_DECL boss_essence_of_sufferingAI : public ScriptedAI } if(targets.empty()) return; // No targets added for some reason. No point continuing. - targets.sort(TargetDistanceOrder(m_creature)); // Sort players by distance. + targets.sort(ObjectDistanceOrder(m_creature)); // Sort players by distance. targets.resize(1); // Only need closest target. Unit* target = targets.front(); // Get the first target. if(target) diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_teron_gorefiend.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_teron_gorefiend.cpp index 633a38c4b00..466417eef3e 100644 --- a/src/bindings/scripts/scripts/zone/black_temple/boss_teron_gorefiend.cpp +++ b/src/bindings/scripts/scripts/zone/black_temple/boss_teron_gorefiend.cpp @@ -103,18 +103,6 @@ struct TRINITY_DLL_DECL mob_doom_blossomAI : public ScriptedAI void SetTeronGUID(uint64 guid){ TeronGUID = guid; } }; -//This is used to sort the players by distance for Constructs to see who to cast Atrophy on -struct TargetDistanceOrder : public std::binary_function<const Unit, const Unit, bool> -{ - const Unit* MainTarget; - TargetDistanceOrder(const Unit* Target) : MainTarget(Target) {}; - // functor for operator "<" - bool operator()(const Unit* _Left, const Unit* _Right) const - { - return MainTarget->GetDistanceOrder(_Left, _Right); - } -}; - struct TRINITY_DLL_DECL mob_shadowy_constructAI : public ScriptedAI { mob_shadowy_constructAI(Creature* c) : ScriptedAI(c) {} @@ -165,7 +153,7 @@ struct TRINITY_DLL_DECL mob_shadowy_constructAI : public ScriptedAI if(pUnit && pUnit->isAlive()) targets.push_back(pUnit); } - targets.sort(TargetDistanceOrder(m_creature)); + targets.sort(ObjectDistanceOrder(m_creature)); Unit* target = targets.front(); if(target && m_creature->IsWithinDistInMap(target, m_creature->GetAttackDistance(target))) { diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_archimonde.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_archimonde.cpp index 423ada87927..25e0ed6b38d 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_archimonde.cpp +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_archimonde.cpp @@ -183,18 +183,6 @@ struct TRINITY_DLL_DECL mob_doomfire_targettingAI : public ScriptedAI For Doomfire, we summon a mob (Doomfire Spirit) for the Doomfire mob to follow. It's spirit will randomly select it's target to follow and then we create the random movement making it unpredictable. */ -// This is used to sort by distance in order to see who is the closest target, when checking for Finger of Death -struct TargetDistanceOrder : public std::binary_function<const Unit, const Unit, bool> -{ - const Unit* MainTarget; - TargetDistanceOrder(const Unit* Target) : MainTarget(Target) {}; - // functor for operator "<" - bool operator()(const Unit* _Left, const Unit* _Right) const - { - return MainTarget->GetDistanceOrder(_Left, _Right); - } -}; - struct TRINITY_DLL_DECL boss_archimondeAI : public hyjal_trashAI { boss_archimondeAI(Creature *c) : hyjal_trashAI(c) @@ -335,7 +323,7 @@ struct TRINITY_DLL_DECL boss_archimondeAI : public hyjal_trashAI if (targets.empty()) return false; - targets.sort(TargetDistanceOrder(m_creature)); + targets.sort(ObjectDistanceOrder(m_creature)); Unit* target = targets.front(); if (target) { diff --git a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_mograine_and_whitemane.cpp b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_mograine_and_whitemane.cpp index 68bdcf9fa10..85f74cf2a9b 100644 --- a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_mograine_and_whitemane.cpp +++ b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_mograine_and_whitemane.cpp @@ -16,280 +16,307 @@ /* ScriptData SDName: Boss_Mograine_And_Whitemane -SD%Complete: 75 -SDComment: Event not implemented +SD%Complete: 90 +SDComment: SDCategory: Scarlet Monastery EndScriptData */ #include "precompiled.h" #include "def_scarlet_monastery.h" -#define SAY_MO_AGGRO -1189005 -#define SAY_MO_KILL -1189006 -#define SAY_MO_RESSURECTED -1189007 - -#define SAY_WH_INTRO -1189008 -#define SAY_WH_KILL -1189009 -#define SAY_WH_RESSURECT -1189010 - -#define SPELL_DIVINESHIELD2 1020 -#define SPELL_CRUSADERSTRIKE5 35395 -#define SPELL_HAMMEROFJUSTICE3 5589 -#define SPELL_HOLYLIGHT6 3472 -#define SPELL_CONSECRATION3 20922 -#define SPELL_BLESSINGOFWISDOM 1044 -#define SPELL_RETRIBUTIONAURA3 10299 -#define SPELL_BLESSINGOFPROTECTION3 10278 -#define SPELL_FLASHHEAL6 10916 +enum +{ + //Mograine says + SAY_MO_AGGRO = -1189005, + SAY_MO_KILL = -1189006, + SAY_MO_RESSURECTED = -1189007, + + //Whitemane says + SAY_WH_INTRO = -1189008, + SAY_WH_KILL = -1189009, + SAY_WH_RESSURECT = -1189010, + + //Mograine Spells + SPELL_CRUSADERSTRIKE = 14518, + SPELL_HAMMEROFJUSTICE = 5589, + SPELL_LAYONHANDS = 9257, + SPELL_RETRIBUTIONAURA = 8990, + + //Whitemanes Spells + SPELL_DEEPSLEEP = 9256, + SPELL_SCARLETRESURRECTION = 9232, + SPELL_DOMINATEMIND = 14515, + SPELL_HOLYSMITE = 9481, + SPELL_HEAL = 12039, + SPELL_POWERWORDSHIELD = 22187 +}; struct TRINITY_DLL_DECL boss_scarlet_commander_mograineAI : public ScriptedAI { - boss_scarlet_commander_mograineAI(Creature *c) : ScriptedAI(c) + boss_scarlet_commander_mograineAI(Creature* pCreature) : ScriptedAI(pCreature) { - pInstance = m_creature->GetInstanceData(); + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); } - ScriptedInstance* pInstance; + ScriptedInstance* m_pInstance; + + uint32 m_uiCrusaderStrike_Timer; + uint32 m_uiHammerOfJustice_Timer; - uint32 Heal_Timer; - uint32 DivineShield2_Timer; - uint32 CrusaderStrike5_Timer; - uint32 HammerOfJustice3_Timer; - uint32 Consecration3_Timer; - uint32 BlessingOfWisdom_Timer; - uint32 BlessingOfProtection3_Timer; + bool m_bHasDied; + bool m_bHeal; + bool m_bFakeDeath; void Reset() { - Heal_Timer = 80000; - DivineShield2_Timer = 60000; - CrusaderStrike5_Timer = 20000; - HammerOfJustice3_Timer = 80000; - Consecration3_Timer = 30000; - BlessingOfWisdom_Timer = 45000; - BlessingOfProtection3_Timer = 45000; + m_uiCrusaderStrike_Timer = 10000; + m_uiHammerOfJustice_Timer = 10000; + + //Incase wipe during phase that mograine fake death + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + + if (m_pInstance) + if (m_creature->isAlive()) + m_pInstance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT,NOT_STARTED); + + m_bHasDied = false; + m_bHeal = false; + m_bFakeDeath = false; } - void EnterCombat(Unit *who) + void JustReachedHome() + { + if (m_pInstance) + { + if (m_pInstance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT != NOT_STARTED)) + m_pInstance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, FAIL); + } + } + + void EnterCombat(Unit* pWho) { DoScriptText(SAY_MO_AGGRO, m_creature); - DoCast(m_creature,SPELL_RETRIBUTIONAURA3); + DoCast(m_creature,SPELL_RETRIBUTIONAURA); } - void KilledUnit(Unit *victim) + void KilledUnit(Unit* pVictim) { DoScriptText(SAY_MO_KILL, m_creature); } - void UpdateAI(const uint32 diff) + void DamageTaken(Unit* pDoneBy, uint32 &uiDamage) { - if (!UpdateVictim()) + if (uiDamage < m_creature->GetHealth() || m_bHasDied) return; - //If we are <50% hp cast Arcane Bubble and start casting SPECIAL Arcane Explosion - if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 50 && !m_creature->IsNonMeleeSpellCasted(false)) + if (!m_pInstance) + return; + + //On first death, fake death and open door, as well as initiate whitemane if exist + if (Unit* Whitemane = Unit::GetUnit((*m_creature), m_pInstance->GetData64(DATA_WHITEMANE))) { - //heal_Timer - if (Heal_Timer < diff) - { - //Switch between 2 different charge methods - switch (rand()%2) - { - case 0: - DoCast(m_creature,SPELL_HOLYLIGHT6); - break; - case 1: - DoCast(m_creature,SPELL_FLASHHEAL6); - break; - } - return; + m_pInstance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, IN_PROGRESS); - //60 seconds until we should cast this agian - Heal_Timer = 60000; - }else Heal_Timer -= diff; + Whitemane->GetMotionMaster()->MovePoint(1,1163.113370,1398.856812,32.527786); + + m_creature->GetMotionMaster()->MovementExpired(); + m_creature->GetMotionMaster()->MoveIdle(); + + m_creature->SetHealth(0); + + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(false); + + m_creature->ClearComboPointHolders(); + m_creature->RemoveAllAuras(); + m_creature->ClearAllReactives(); + + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->SetStandState(UNIT_STAND_STATE_DEAD); + + m_bHasDied = true; + m_bFakeDeath = true; + + uiDamage = 0; } + } - //DivineShield2_Timer - if (DivineShield2_Timer < diff) + void SpellHit(Unit* pWho, const SpellEntry* pSpell) + { + //When hit with ressurection say text + if (pSpell->Id == SPELL_SCARLETRESURRECTION) { - DoCast(m_creature,SPELL_DIVINESHIELD2); - DivineShield2_Timer = 60000; - }else DivineShield2_Timer -= diff; + DoScriptText(SAY_MO_RESSURECTED, m_creature); + m_bFakeDeath = false; - //CrusaderStrike5_Timer - if (CrusaderStrike5_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_CRUSADERSTRIKE5); - CrusaderStrike5_Timer = 20000; - }else CrusaderStrike5_Timer -= diff; + if (m_pInstance) + m_pInstance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, SPECIAL); + } + } - //HammerOfJustice3_Timer - if (HammerOfJustice3_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_HAMMEROFJUSTICE3); - HammerOfJustice3_Timer = 30000; - }else HammerOfJustice3_Timer -= diff; - //Consecration3_Timer - if (Consecration3_Timer < diff) + void UpdateAI(const uint32 uiDiff) + { + if (!UpdateVictim()) + return; + + if (m_bHasDied && !m_bHeal && m_pInstance && m_pInstance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) == SPECIAL) { - DoCast(m_creature->getVictim(),SPELL_CONSECRATION3); - Consecration3_Timer = 20000; - }else Consecration3_Timer -= diff; + //On ressurection, stop fake death and heal whitemane and resume fight + if (Unit* Whitemane = Unit::GetUnit((*m_creature), m_pInstance->GetData64(DATA_WHITEMANE))) + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + DoCast(Whitemane, SPELL_LAYONHANDS); - //BlessingOfWisdom_Timer - if (BlessingOfWisdom_Timer < diff) + m_uiCrusaderStrike_Timer = 10000; + m_uiHammerOfJustice_Timer = 10000; + + if (m_creature->getVictim()) + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); + + m_bHeal = true; + } + } + + //This if-check to make sure mograine does not attack while fake death + if (m_bFakeDeath) + return; + + //m_uiCrusaderStrike_Timer + if (m_uiCrusaderStrike_Timer < uiDiff) { - DoCast(m_creature,SPELL_BLESSINGOFWISDOM); - BlessingOfWisdom_Timer = 45000; - }else BlessingOfWisdom_Timer -= diff; + DoCast(m_creature->getVictim(),SPELL_CRUSADERSTRIKE); + m_uiCrusaderStrike_Timer = 10000; + }else m_uiCrusaderStrike_Timer -= uiDiff; - //BlessingOfProtection3_Timer - if (BlessingOfProtection3_Timer < diff) + //m_uiHammerOfJustice_Timer + if (m_uiHammerOfJustice_Timer < uiDiff) { - DoCast(m_creature,SPELL_BLESSINGOFPROTECTION3); - BlessingOfProtection3_Timer = 50000; - }else BlessingOfProtection3_Timer -= diff; + DoCast(m_creature->getVictim(),SPELL_HAMMEROFJUSTICE); + m_uiHammerOfJustice_Timer = 60000; + }else m_uiHammerOfJustice_Timer -= uiDiff; DoMeleeAttackIfReady(); } }; -#define SPELL_DEEPSLEEP 9256 -#define SPELL_SCARLETRESURRECTION 9232 - -#define SPELL_CRUSADERSTRIKE 17281 -#define SPELL_HAMMEROFJUSTICE 13005 -#define SPELL_HOLYSMITE6 9481 -#define SPELL_HOLYFIRE5 15265 -#define SPELL_MINDBLAST6 8106 - -#define SPELL_POWERWORDSHIELD 6065 - -#define SPELL_RENEW 6078 -#define SPELL_FLASHHEAL6 10916 - struct TRINITY_DLL_DECL boss_high_inquisitor_whitemaneAI : public ScriptedAI { - boss_high_inquisitor_whitemaneAI(Creature *c) : ScriptedAI(c) + boss_high_inquisitor_whitemaneAI(Creature* pCreature) : ScriptedAI(pCreature) { - pInstance = m_creature->GetInstanceData(); + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); } - ScriptedInstance* pInstance; + ScriptedInstance* m_pInstance; + + uint32 m_uiHeal_Timer; + uint32 m_uiPowerWordShield_Timer; + uint32 m_uiHolySmite_Timer; + uint32 m_uiWait_Timer; - uint32 Healing_Timer; - uint32 Renew_Timer; - uint32 PowerWordShield_Timer; - uint32 CrusaderStrike_Timer; - uint32 HammerOfJustice_Timer; - uint32 HolySmite6_Timer; - uint32 HolyFire5_Timer; - uint32 MindBlast6_Timer; + bool m_bCanResurrectCheck; + bool m_bCanResurrect; void Reset() { - Healing_Timer = 0; - Renew_Timer= 0; - PowerWordShield_Timer = 2000; - CrusaderStrike_Timer = 12000; - HammerOfJustice_Timer = 18000; - HolySmite6_Timer = 10000; - HolyFire5_Timer = 20000; - MindBlast6_Timer = 6000; + m_uiWait_Timer = 7000; + m_uiHeal_Timer = 10000; + m_uiPowerWordShield_Timer = 15000; + m_uiHolySmite_Timer = 6000; + + m_bCanResurrectCheck = false; + m_bCanResurrect = false; + + if (m_pInstance) + if (m_creature->isAlive()) + m_pInstance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, NOT_STARTED); } - void EnterCombat(Unit *who) + void EnterCombat(Unit* pWho) { DoScriptText(SAY_WH_INTRO, m_creature); } - void KilledUnit(Unit *victim) + void KilledUnit(Unit* pVictim) { DoScriptText(SAY_WH_KILL, m_creature); } - void UpdateAI(const uint32 diff) + void UpdateAI(const uint32 uiDiff) { if (!UpdateVictim()) return; - /* - //This is going to be a routine to make the resurrection event... - if (m_creature->isAlive && m_creature->isAlive) + if (m_bCanResurrect) { - m_creature->Relocate(1163.113370,1398.856812,32.527786,3.171014); - - DoScriptText(SAY_WH_RESSURECT, m_creature); - - DoCast(m_creature->getVictim(),SPELL_DEEPSLEEP); - DoCast(m-creature->GetGUID(51117),SPELL_SCARLETRESURRECTION) + //When casting resuruction make sure to delay so on rez when reinstate battle deepsleep runs out + if (m_pInstance && m_uiWait_Timer < uiDiff) + { + if (Unit* Mograine = Unit::GetUnit((*m_creature), m_pInstance->GetData64(DATA_MOGRAINE))) + { + DoCast(Mograine, SPELL_SCARLETRESURRECTION); + DoScriptText(SAY_WH_RESSURECT, m_creature); + m_bCanResurrect = false; + } + } + else m_uiWait_Timer -= uiDiff; } - */ - //If we are <75% hp cast healing spells at self and Mograine - if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 75 ) + //Cast Deep sleep when health is less than 50% + if (!m_bCanResurrectCheck && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 50) { - if (Healing_Timer < diff) - { - DoCast(m_creature,SPELL_FLASHHEAL6); - return; + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(false); - //22-32 seconds until we should cast this agian - Healing_Timer = 22000 + rand()%10000; - }else Healing_Timer -= diff; + DoCast(m_creature->getVictim(), SPELL_DEEPSLEEP); + m_bCanResurrectCheck = true; + m_bCanResurrect = true; + return; } - if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 30) - { - if (Renew_Timer < diff) - { - DoCast(m_creature,SPELL_RENEW); - Renew_Timer = 30000; - }else Renew_Timer -= diff; - } + //while in "resurrect-mode", don't do anything + if (m_bCanResurrect) + return; - //PowerWordShield_Timer - if (PowerWordShield_Timer < diff) + //If we are <75% hp cast healing spells at self or Mograine + if (m_uiHeal_Timer < uiDiff) { - DoCast(m_creature,SPELL_POWERWORDSHIELD); - PowerWordShield_Timer = 25000; - }else PowerWordShield_Timer -= diff; + Creature* pTarget = NULL; - //CrusaderStrike_Timer - if (CrusaderStrike_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_CRUSADERSTRIKE); - CrusaderStrike_Timer = 15000; - }else CrusaderStrike_Timer -= diff; + if (!m_creature->HasAuraState(AURA_STATE_HEALTH_ABOVE_75_PERCENT)) + pTarget = m_creature; - //HammerOfJustice_Timer - if (HammerOfJustice_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_HAMMEROFJUSTICE); - HammerOfJustice_Timer = 12000; - }else HammerOfJustice_Timer -= diff; + if (m_pInstance) + { + if (Creature* pMograine = (Creature*)Unit::GetUnit((*m_creature), m_pInstance->GetData64(DATA_MOGRAINE))) + { + if (pMograine->isAlive() && !pMograine->HasAuraState(AURA_STATE_HEALTH_ABOVE_75_PERCENT)) + pTarget = pMograine; + } + } - //HolySmite6_Timer - if (HolySmite6_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_HOLYSMITE6); - HolySmite6_Timer = 10000; - }else HolySmite6_Timer -= diff; + if (pTarget) + DoCast(pTarget, SPELL_HEAL); - //HolyFire5_Timer - if (HolyFire5_Timer < diff) + m_uiHeal_Timer = 13000; + }else m_uiHeal_Timer -= uiDiff; + + //m_uiPowerWordShield_Timer + if (m_uiPowerWordShield_Timer < uiDiff) { - DoCast(m_creature->getVictim(),SPELL_HOLYFIRE5); - HolyFire5_Timer = 15000; - }else HolyFire5_Timer -= diff; + DoCast(m_creature,SPELL_POWERWORDSHIELD); + m_uiPowerWordShield_Timer = 15000; + }else m_uiPowerWordShield_Timer -= uiDiff; - //MindBlast6_Timer - if (MindBlast6_Timer < diff) + //m_uiHolySmite_Timer + if (m_uiHolySmite_Timer < uiDiff) { - DoCast(m_creature->getVictim(),SPELL_MINDBLAST6); - MindBlast6_Timer = 8000; - }else MindBlast6_Timer -= diff; + DoCast(m_creature->getVictim(),SPELL_HOLYSMITE); + m_uiHolySmite_Timer = 6000; + }else m_uiHolySmite_Timer -= uiDiff; DoMeleeAttackIfReady(); } diff --git a/src/bindings/scripts/scripts/zone/scarlet_monastery/instance_scarlet_monastery.cpp b/src/bindings/scripts/scripts/zone/scarlet_monastery/instance_scarlet_monastery.cpp index 280a2869948..61576780cec 100644 --- a/src/bindings/scripts/scripts/zone/scarlet_monastery/instance_scarlet_monastery.cpp +++ b/src/bindings/scripts/scripts/zone/scarlet_monastery/instance_scarlet_monastery.cpp @@ -91,6 +91,11 @@ struct TRINITY_DLL_DECL instance_scarlet_monastery : public ScriptedInstance switch(type) { case TYPE_MOGRAINE_AND_WHITE_EVENT: + if (data == IN_PROGRESS) + DoUseDoorOrButton(DoorHighInquisitorGUID); + if (data == FAIL) + DoUseDoorOrButton(DoorHighInquisitorGUID); + Encounter[0] = data; break; case GAMEOBJECT_PUMPKIN_SHRINE: diff --git a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_ingvar_the_plunderer.cpp b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_ingvar_the_plunderer.cpp index 2d8ce56428a..df9a01046a4 100644 --- a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_ingvar_the_plunderer.cpp +++ b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_ingvar_the_plunderer.cpp @@ -26,44 +26,47 @@ EndScriptData */ #include "precompiled.h" #include "def_utgarde_keep.h" -//Yells Ingvar -#define YELL_AGGRO_1 -1574015 -#define YELL_AGGRO_2 -1574022 +enum +{ + //Yells Ingvar + YELL_AGGRO_1 = -1574005, + YELL_AGGRO_2 = -1574006, -#define YELL_DEAD_1 -1574017 -#define YELL_DEAD_2 -1574024 + YELL_DEAD_1 = -1574007, + YELL_DEAD_2 = -1574008, -#define YELL_KILL_1 -1574023 -#define YELL_KILL_2 -1574016 + YELL_KILL_1 = -1574009, + YELL_KILL_2 = -1574010, //Ingvar Spells human form -#define MOB_INGVAR_HUMAN 23954 -#define SPELL_CLEAVE 42724 -#define SPELL_SMASH 42669 -#define H_SPELL_SMASH 59706 -#define SPELL_STAGGERING_ROAR 42708 -#define H_SPELL_STAGGERING_ROAR 59708 -#define SPELL_ENRAGE 42705 -#define H_SPELL_ENRAGE 59707 - -#define MOB_ANNHYLDE_THE_CALLER 24068 -#define SPELL_INGVAR_FEIGN_DEATH 42795 -#define SPELL_SUMMON_BANSHEE 42912 -#define SPELL_SCOURG_RESURRECTION_EFFEKTSPAWN 42863 //Spawn resurrecteffekt around Ingvar - -#define MODEL_INGVAR_UNDEAD 26351 -#define MODEL_INGVAR_HUMAN 21953 + MOB_INGVAR_HUMAN = 23954, + SPELL_CLEAVE = 42724, + SPELL_SMASH = 42669, + H_SPELL_SMASH = 59706, + SPELL_STAGGERING_ROAR = 42708, + H_SPELL_STAGGERING_ROAR = 59708, + SPELL_ENRAGE = 42705, + H_SPELL_ENRAGE = 59707, + + MOB_ANNHYLDE_THE_CALLER = 24068, + SPELL_INGVAR_FEIGN_DEATH = 42795, + SPELL_SUMMON_BANSHEE = 42912, + SPELL_SCOURG_RESURRECTION_EFFEKTSPAWN = 42863, //Spawn resurrecteffekt around Ingvar + + MODEL_INGVAR_UNDEAD = 26351, + MODEL_INGVAR_HUMAN = 21953, //Ingvar Spells undead form -#define MOB_INGVAR_UNDEAD 23980 -#define SPELL_DARK_SMASH 42723 -#define SPELL_DREADFUL_ROAR 42729 -#define H_SPELL_DREADFUL_ROAR 59734 -#define SPELL_WOE_STRIKE 42730 -#define H_SPELL_WOE_STRIKE 59735 - -#define ENTRY_THROW_TARGET 23996 -#define SPELL_SHADOW_AXE_SUMMON 42749 + MOB_INGVAR_UNDEAD = 23980, + SPELL_DARK_SMASH = 42723, + SPELL_DREADFUL_ROAR = 42729, + H_SPELL_DREADFUL_ROAR = 59734, + SPELL_WOE_STRIKE = 42730, + H_SPELL_WOE_STRIKE = 59735, + + ENTRY_THROW_TARGET = 23996, + SPELL_SHADOW_AXE_SUMMON = 42749 +}; struct TRINITY_DLL_DECL boss_ingvar_the_plundererAI : public ScriptedAI { @@ -273,13 +276,17 @@ CreatureAI* GetAI_boss_ingvar_the_plunderer(Creature *_Creature) return new boss_ingvar_the_plundererAI (_Creature); } -#define YELL_RESSURECT -1574025 +enum +{ +//we don't have that text in db so comment it until we get this text +// YELL_RESSURECT = -1574025, //Spells for Annhylde -#define SPELL_SCOURG_RESURRECTION_HEAL 42704 //Heal Max + DummyAura -#define SPELL_SCOURG_RESURRECTION_BEAM 42857 //Channeling Beam of Annhylde -#define SPELL_SCOURG_RESURRECTION_DUMMY 42862 //Some Emote Dummy? -#define SPELL_INGVAR_TRANSFORM 42796 + SPELL_SCOURG_RESURRECTION_HEAL = 42704, //Heal Max + DummyAura + SPELL_SCOURG_RESURRECTION_BEAM = 42857, //Channeling Beam of Annhylde + SPELL_SCOURG_RESURRECTION_DUMMY = 42862, //Some Emote Dummy? + SPELL_INGVAR_TRANSFORM = 42796 +}; struct TRINITY_DLL_DECL mob_annhylde_the_callerAI : public ScriptedAI { @@ -309,7 +316,7 @@ struct TRINITY_DLL_DECL mob_annhylde_the_callerAI : public ScriptedAI { m_creature->GetMotionMaster()->MovePoint(1,x,y,z+15); - DoScriptText(YELL_RESSURECT,m_creature); +// DoScriptText(YELL_RESSURECT,m_creature); } } @@ -381,8 +388,11 @@ CreatureAI* GetAI_mob_annhylde_the_caller(Creature *_Creature) return new mob_annhylde_the_callerAI (_Creature); } -#define SPELL_SHADOW_AXE_DAMAGE 42750 -#define H_SPELL_SHADOW_AXE_DAMAGE 59719 +enum +{ + SPELL_SHADOW_AXE_DAMAGE = 42750, + H_SPELL_SHADOW_AXE_DAMAGE = 59719 +}; struct TRINITY_DLL_DECL mob_ingvar_throw_dummyAI : public ScriptedAI { diff --git a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_keleseth.cpp b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_keleseth.cpp index c05d28bc58b..9f3164d9b89 100644 --- a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_keleseth.cpp +++ b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_keleseth.cpp @@ -26,20 +26,23 @@ EndScriptData */ #include "precompiled.h" #include "def_utgarde_keep.h" -#define SPELL_SHADOWBOLT 43667 -#define SPELL_SHADOWBOLT_HEROIC 59389 -#define SPELL_FROST_TOMB 48400 -#define SPELL_FROST_TOMB_SUMMON 42714 -#define SPELL_DECREPIFY 42702 -#define SPELL_SCOURGE_RESSURRECTION 42704 -#define CREATURE_FROSTTOMB 23965 -#define CREATURE_SKELETON 23970 - -#define SAY_AGGRO -1574000 -#define SAY_KILL -1574001 -#define SAY_DEATH -1574002 -#define SAY_FROST_TOMB -1574003 -#define SAY_SKELETONS -1574004 +enum +{ + SPELL_SHADOWBOLT = 43667, + SPELL_SHADOWBOLT_HEROIC = 59389, + SPELL_FROST_TOMB = 48400, + SPELL_FROST_TOMB_SUMMON = 42714, + SPELL_DECREPIFY = 42702, + SPELL_SCOURGE_RESSURRECTION = 42704, + CREATURE_FROSTTOMB = 23965, + CREATURE_SKELETON = 23970, + + SAY_AGGRO = -1574000, + SAY_FROST_TOMB = -1574001, + SAY_SKELETONS = -1574002, + SAY_KILL = -1574003, + SAY_DEATH = -1574004 +}; #define SKELETONSPAWN_Z 42.8668 diff --git a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_skarvald_dalronn.cpp b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_skarvald_dalronn.cpp index 5c5a5ba2f16..8bbb871a0b2 100644 --- a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_skarvald_dalronn.cpp +++ b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_skarvald_dalronn.cpp @@ -26,34 +26,35 @@ EndScriptData */ #include "precompiled.h" #include "def_utgarde_keep.h" -#define YELL_SKARVALD_AGGRO -1574010 -#define YELL_DALRONN_AGGRO -1574005 - -#define YELL_SKARVALD_KILL -1574011 -#define YELL_DALRONN_KILL -1574006 - -#define YELL_DALRONN_DAL_DIEDFIRST -1574007 -#define YELL_SKARVALD_DAL_DIEDFIRST -1574014 -#define YELL_SKARVALD_DAL_DIED -1574013 - -#define YELL_SKARVALD_SKA_DIEDFIRST -1574012 -#define YELL_DALRONN_SKA_DIEDFIRST -1574009 -#define YELL_DALRONN_SKA_DIED -1574008 +enum +{ + YELL_SKARVALD_AGGRO = -1574011, + YELL_SKARVALD_DAL_DIED = -1574012, + YELL_SKARVALD_SKA_DIEDFIRST = -1574013, + YELL_SKARVALD_KILL = -1574014, + YELL_SKARVALD_DAL_DIEDFIRST = -1574015, + + YELL_DALRONN_AGGRO = -1574016, + YELL_DALRONN_SKA_DIED = -1574017, + YELL_DALRONN_DAL_DIEDFIRST = -1574018, + YELL_DALRONN_KILL = -1574019, + YELL_DALRONN_SKA_DIEDFIRST = -1574020, //Spells of Skarvald and his Ghost -#define MOB_SKARVALD_THE_CONSTRUCTOR 24200 -#define SPELL_CHARGE 43651 -#define SPELL_STONE_STRIKE 48583 -#define SPELL_SUMMON_SKARVALD_GHOST 48613 -#define MOB_SKARVALD_GHOST 27390 + MOB_SKARVALD_THE_CONSTRUCTOR = 24200, + SPELL_CHARGE = 43651, + SPELL_STONE_STRIKE = 48583, + SPELL_SUMMON_SKARVALD_GHOST = 48613, + MOB_SKARVALD_GHOST = 27390, //Spells of Dalronn and his Ghost -#define MOB_DALRONN_THE_CONTROLLER 24201 -#define SPELL_SHADOW_BOLT 43649 -#define H_SPELL_SHADOW_BOLT 59575 -#define H_SPELL_SUMMON_SKELETONS 52611 -#define SPELL_DEBILITATE 43650 -#define SPELL_SUMMON_DALRONN_GHOST 48612 -#define MOB_DALRONN_GHOST 27389 + MOB_DALRONN_THE_CONTROLLER = 24201, + SPELL_SHADOW_BOLT = 43649, + H_SPELL_SHADOW_BOLT = 59575, + H_SPELL_SUMMON_SKELETONS = 52611, + SPELL_DEBILITATE = 43650, + SPELL_SUMMON_DALRONN_GHOST = 48612, + MOB_DALRONN_GHOST = 27389 +}; struct TRINITY_DLL_DECL boss_skarvald_the_constructorAI : public ScriptedAI { diff --git a/src/game/GridNotifiersImpl.h b/src/game/GridNotifiersImpl.h index 6502c2ea7c8..211bca9cd3c 100644 --- a/src/game/GridNotifiersImpl.h +++ b/src/game/GridNotifiersImpl.h @@ -631,4 +631,28 @@ void MaNGOS::LocalizedPacketListDo<Builder>::operator()( Player* p ) p->SendDirectMessage((*data_list)[i]); } +struct ObjectDistanceOrder : public std::binary_function<const WorldObject, const WorldObject, bool> +{ + const Unit* m_pSource; + + ObjectDistanceOrder(const Unit* pSource) : m_pSource(pSource) {}; + + bool operator()(const WorldObject* pLeft, const WorldObject* pRight) const + { + return m_pSource->GetDistanceOrder(pLeft, pRight); + } +}; + +struct ObjectDistanceOrderReversed : public std::binary_function<const WorldObject, const WorldObject, bool> +{ + const Unit* m_pSource; + + ObjectDistanceOrderReversed(const Unit* pSource) : m_pSource(pSource) {}; + + bool operator()(const WorldObject* pLeft, const WorldObject* pRight) const + { + return !m_pSource->GetDistanceOrder(pLeft, pRight); + } +}; + #endif // MANGOS_GRIDNOTIFIERSIMPL_H |