Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp
- index 6d70e56..fd5ea2b 100644
- --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp
- +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp
- @@ -15,53 +15,24 @@
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
- -/* ScriptData
- -SDName: Argent Challenge Encounter.
- -SD%Complete: 50 %
- -SDComment: AI for Argent Soldiers are not implemented. AI from bosses need more improvements.
- -SDCategory: Trial of the Champion
- -EndScriptData */
- -
- -#include "ScriptMgr.h"
- -#include "ScriptedCreature.h"
- -#include "SpellScript.h"
- +#include "ScriptPCH.h"
- #include "trial_of_the_champion.h"
- #include "ScriptedEscortAI.h"
- -/*
- -enum Yells
- -{
- - // Eadric the Pure
- - SAY_INTRO = 0,
- - SAY_AGGRO = 1,
- - EMOTE_RADIANCE = 2,
- - EMOTE_HAMMER_RIGHTEOUS = 3,
- - SAY_HAMMER_RIGHTEOUS = 4,
- - SAY_KILL_PLAYER = 5,
- - SAY_DEFEATED = 6,
- -
- - // Argent Confessor Paletress
- - SAY_INTRO_1 = 0,
- - SAY_INTRO_2 = 1,
- - SAY_AGGRO = 2,
- - SAY_MEMORY_SUMMON = 3,
- - SAY_MEMORY_DEATH = 4,
- - SAY_KILL_PLAYER = 5,
- - SAY_DEFEATED = 6,
- -
- - // Memory of X
- - EMOTE_WAKING_NIGHTMARE = 0
- -};
- -*/
- +
- enum Spells
- {
- - // Eadric the Pure
- + //Eadric
- SPELL_EADRIC_ACHIEVEMENT = 68197,
- SPELL_HAMMER_JUSTICE = 66863,
- + SPELL_HAMMER_JUSTICE_STUN = 66940,
- SPELL_HAMMER_RIGHTEOUS = 66867,
- + SPELL_HAMMER_OVERRIDE_BAR = 66904, // overrides players cast bar
- + SPELL_HAMMER_THROWBACK_DMG = 66905, // the hammer that is thrown back by the player
- SPELL_RADIANCE = 66935,
- SPELL_VENGEANCE = 66865,
- - // Paletress
- + //Paletress
- + SPELL_CONFESSOR_ACHIEVEMENT = 68206,
- SPELL_SMITE = 66536,
- SPELL_SMITE_H = 67674,
- SPELL_HOLY_FIRE = 66538,
- @@ -72,35 +43,27 @@ enum Spells
- SPELL_SHIELD = 66515,
- SPELL_CONFESS = 66680,
- SPELL_SUMMON_MEMORY = 66545,
- -
- - // Memory of X (Summon)
- - SPELL_MEMORY_ALGALON = 66715,
- - SPELL_MEMORY_ARCHIMONDE = 66704,
- - SPELL_MEMORY_CHROMAGGUS = 66697,
- - SPELL_MEMORY_CYANIGOSA = 66709,
- - SPELL_MEMORY_DELRISSA = 66706,
- - SPELL_MEMORY_ECK = 66710,
- - SPELL_MEMORY_ENTROPIUS = 66707,
- - SPELL_MEMORY_GRUUL = 66702,
- - SPELL_MEMORY_HAKKAR = 66698,
- - SPELL_MEMORY_HEIGAN = 66712,
- - SPELL_MEMORY_HEROD = 66694,
- - SPELL_MEMORY_HOGGER = 66543,
- - SPELL_MEMORY_IGNIS = 66713,
- - SPELL_MEMORY_ILLIDAN = 66705,
- - SPELL_MEMORY_INGVAR = 66708,
- - SPELL_MEMORY_KALITHRESH = 66700,
- - SPELL_MEMORY_LUCIFRON = 66695,
- - SPELL_MEMORY_MALCHEZAAR = 66701,
- - SPELL_MEMORY_MUTANUS = 66692,
- - SPELL_MEMORY_ONYXIA = 66711,
- - SPELL_MEMORY_THUNDERAAN = 66696,
- - SPELL_MEMORY_VANCLEEF = 66691,
- - SPELL_MEMORY_VASHJ = 66703,
- - SPELL_MEMORY_VEKNILASH = 66699,
- - SPELL_MEMORY_VEZAX = 66714,
- -
- - // Memory
- +
- + // Monk soldier
- + SPELL_PUMMEL = 67235,
- + SPELL_FLURRY = 67233,
- + SPELL_FINAL = 67255,
- + SPELL_DIVINE = 67251,
- +
- + // Lightwielder soldier
- + SPELL_LIGHT = 67247,
- + SPELL_CLEAVE = 15284,
- + SPELL_STRIKE = 67237,
- +
- + // Priest soldier
- + SPELL_HOLY_SMITE = 36176,
- + SPELL_HOLY_SMITE_H = 67289,
- + SPELL_SHADOW_WORD_PAIN = 34941,
- + SPELL_SHADOW_WORD_PAIN_H = 34942,
- + SPELL_MIND = 67229,
- + SPELL_FOUNTAIN_OF_LIGHT = 67194,
- +
- + //Memory
- SPELL_OLD_WOUNDS = 66620,
- SPELL_OLD_WOUNDS_H = 67679,
- SPELL_SHADOWS_PAST = 66619,
- @@ -109,11 +72,53 @@ enum Spells
- SPELL_WAKING_NIGHTMARE_H = 67677
- };
- -class OrientationCheck : public std::unary_function<Unit*, bool>
- +enum Misc
- +{
- + DATA_FACEROLLER = 1,
- + ACHIEV_CONF = 3802
- +};
- +
- +enum Talk
- +{
- + SAY_ARGENT_ENTERS = 19,
- + SAY_ARGENT_READY = 20,
- + SAY_MEMORY_NIGHTMARE = 0,
- +
- + // Paletress
- + SAY_PALETRESS_AGGRO = 2,
- + SAY_PALETRESS_SUMMON_MEMORY = 3,
- + SAY_PALETRESS_MEMORY_DIES = 4,
- + SAY_PALETRESS_PLAYER_DIES = 5,
- + SAY_PALETRESS_DEFEATED = 6,
- +
- + // Eadric
- + SAY_EADRIC_AGGRO = 1,
- + SAY_EADRIC_RADIATE_LIGHT = 2,
- + SAY_EADRIC_HAMMER_TARGET = 3,
- + SAY_EADRIC_HAMMER = 4,
- + SAY_EADRIC_PLAYER_DIES = 5,
- + SAY_EADRIC_DEFEATED = 6
- +};
- +
- +enum Events
- +{
- + EVENT_HOLYSMITE,
- + // Argent Soldiers
- + EVENT_CLEAVE,
- + EVENT_STRIKE,
- + EVENT_BLAZINGLIGHT,
- + EVENT_FLURRY,
- + EVENT_PUMMEL,
- + EVENT_MINDCONTROL,
- + EVENT_PAIN,
- + EVENT_FOUNTAIN
- +};
- +
- +class OrientationCheck
- {
- public:
- explicit OrientationCheck(Unit* _caster) : caster(_caster) { }
- - bool operator()(WorldObject* object)
- + bool operator() (WorldObject* object)
- {
- return !object->isInFront(caster, 2.5f) || !object->IsWithinDist(caster, 40.0f);
- }
- @@ -122,10 +127,11 @@ class OrientationCheck : public std::unary_function<Unit*, bool>
- Unit* caster;
- };
- -class spell_eadric_radiance : public SpellScriptLoader
- +class spell_eadric_radiance: public SpellScriptLoader
- {
- public:
- - spell_eadric_radiance() : SpellScriptLoader("spell_eadric_radiance") { }
- + spell_eadric_radiance(): SpellScriptLoader("spell_eadric_radiance") { }
- +
- class spell_eadric_radiance_SpellScript : public SpellScript
- {
- PrepareSpellScript(spell_eadric_radiance_SpellScript);
- @@ -135,41 +141,112 @@ class spell_eadric_radiance : public SpellScriptLoader
- unitList.remove_if(OrientationCheck(GetCaster()));
- }
- - void Register() override
- + void Register()
- {
- OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_eadric_radiance_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
- OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_eadric_radiance_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY);
- }
- };
- - SpellScript* GetSpellScript() const override
- + SpellScript* GetSpellScript() const
- {
- return new spell_eadric_radiance_SpellScript();
- }
- };
- +class spell_eadric_hammer_missile: public SpellScriptLoader
- +{
- + public:
- + spell_eadric_hammer_missile(): SpellScriptLoader("spell_eadric_hammer_missile") { }
- +
- + class spell_eadric_hammer_missile_SpellScript : public SpellScript
- + {
- + PrepareSpellScript(spell_eadric_hammer_missile_SpellScript);
- +
- + bool Validate(SpellInfo const* /*spellInfo*/)
- + {
- + if (!sSpellMgr->GetSpellInfo(SPELL_HAMMER_OVERRIDE_BAR))
- + return false;
- +
- + return true;
- + }
- +
- + void HandleTriggerMissile(SpellEffIndex /*effIndex*/)
- + {
- + Unit* caster = GetCaster();
- + Unit* target = GetHitUnit();
- +
- + if (caster && target && !target->HasAura(SPELL_HAMMER_JUSTICE_STUN))
- + {
- + PreventHitDefaultEffect(EFFECT_0);
- + caster->CastSpell(target, SPELL_HAMMER_OVERRIDE_BAR, true);
- + }
- + }
- +
- + void Register()
- + {
- + OnEffectHitTarget += SpellEffectFn(spell_eadric_hammer_missile_SpellScript::HandleTriggerMissile, EFFECT_0, SPELL_EFFECT_TRIGGER_MISSILE);
- + }
- + };
- +
- + SpellScript* GetSpellScript() const
- + {
- + return new spell_eadric_hammer_missile_SpellScript();
- + }
- +};
- +
- +class spell_eadric_hammer_throw_back: public SpellScriptLoader
- +{
- + public:
- + spell_eadric_hammer_throw_back(): SpellScriptLoader("spell_eadric_hammer_throw_back") { }
- +
- + class spell_eadric_hammer_throw_back_SpellScript : public SpellScript
- + {
- + PrepareSpellScript(spell_eadric_hammer_throw_back_SpellScript);
- +
- + void RemoveAura()
- + {
- + GetCaster()->RemoveAurasDueToSpell(SPELL_HAMMER_OVERRIDE_BAR);
- + }
- +
- + void CheckDamage()
- + {
- + Creature* target = GetHitCreature();
- + if (!target)
- + return;
- +
- + if (GetHitDamage() >= int32(target->GetHealth()))
- + target->AI()->SetData(DATA_FACEROLLER, 1);
- + }
- +
- + void Register()
- + {
- + AfterCast += SpellCastFn(spell_eadric_hammer_throw_back_SpellScript::RemoveAura);
- + OnHit += SpellHitFn(spell_eadric_hammer_throw_back_SpellScript::CheckDamage);
- + }
- + };
- +
- + SpellScript* GetSpellScript() const
- + {
- + return new spell_eadric_hammer_throw_back_SpellScript();
- + }
- +};
- +
- class boss_eadric : public CreatureScript
- {
- -public:
- - boss_eadric() : CreatureScript("boss_eadric") { }
- - struct boss_eadricAI : public ScriptedAI
- + public:
- + boss_eadric(): CreatureScript("boss_eadric") { }
- +
- + struct boss_eadricAI : public BossAI
- {
- - boss_eadricAI(Creature* creature) : ScriptedAI(creature)
- + boss_eadricAI(Creature* creature) : BossAI(creature, BOSS_ARGENT_CHALLENGE_E)
- {
- - Initialize();
- instance = creature->GetInstanceScript();
- creature->SetReactState(REACT_PASSIVE);
- creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- - }
- -
- - void Initialize()
- - {
- - uiVenganceTimer = 10000;
- - uiRadianceTimer = 16000;
- - uiHammerJusticeTimer = 25000;
- - uiResetTimer = 5000;
- - bDone = false;
- + hasBeenInCombat = false;
- + bCredit = false;
- }
- InstanceScript* instance;
- @@ -179,40 +256,123 @@ public:
- uint32 uiHammerJusticeTimer;
- uint32 uiResetTimer;
- + uint64 uiBasePoints;
- +
- bool bDone;
- + bool hasBeenInCombat;
- + bool bCredit;
- + bool _theFaceRoller;
- - void Reset() override
- + void Reset()
- {
- - Initialize();
- + uiVenganceTimer = 10000;
- + uiRadianceTimer = 16000;
- + uiHammerJusticeTimer = 25000;
- + uiResetTimer = 5000;
- + uiBasePoints = 0;
- +
- + _theFaceRoller = false;
- + bDone = false;
- + Map* pMap = me->GetMap();
- + if (hasBeenInCombat && pMap && pMap->IsDungeon())
- + {
- + Map::PlayerList const &players = pMap->GetPlayers();
- + for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
- + {
- + if (itr->GetSource() && itr->GetSource()->IsAlive() && !itr->GetSource()->IsGameMaster())
- + return;
- + }
- +
- + if (instance)
- + {
- + GameObject* GO = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(DATA_MAIN_GATE1));
- + if (GO)
- + instance->HandleGameObject(GO->GetGUID(),true);
- + Creature* announcer=pMap->GetCreature(instance->GetGuidData(DATA_ANNOUNCER));
- + instance->SetData(DATA_ARGENT_SOLDIER_DEFEATED,0);
- + announcer->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- + }
- +
- + me->RemoveFromWorld();
- + }
- }
- - void DamageTaken(Unit* /*done_by*/, uint32 &damage) override
- + void DamageTaken(Unit* /*who*/, uint32& damage)
- {
- if (damage >= me->GetHealth())
- {
- damage = 0;
- + if (!bCredit)
- + {
- + bCredit = true;
- + HandleSpellOnPlayersInInstanceToC5(me, 68575);
- + }
- EnterEvadeMode();
- + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- + Talk(SAY_EADRIC_DEFEATED);
- me->setFaction(35);
- bDone = true;
- + if (GameObject* pGO = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(DATA_MAIN_GATE)))
- + instance->HandleGameObject(pGO->GetGUID(),true);
- + if (GameObject* pGO = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(DATA_MAIN_GATE1)))
- + instance->HandleGameObject(pGO->GetGUID(),true);
- + if (instance)
- + instance->SetData(BOSS_ARGENT_CHALLENGE_E, DONE);
- + HandleKillCreditForAllPlayers(me);
- + HandleInstanceBind(me);
- }
- }
- - void MovementInform(uint32 MovementType, uint32 /*Data*/) override
- + void MovementInform(uint32 MovementType, uint32 /*Data*/)
- {
- if (MovementType != POINT_MOTION_TYPE)
- return;
- + }
- - instance->SetData(BOSS_ARGENT_CHALLENGE_E, DONE);
- + void EnterCombat(Unit* /*who*/)
- + {
- + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- + _EnterCombat();
- + me->SetHomePosition(746.843f, 665.000f, 412.339f, 4.670f);
- + Talk(SAY_EADRIC_AGGRO);
- + hasBeenInCombat = true;
- + }
- - me->DisappearAndDie();
- + void SetData(uint32 type, uint32 /*value*/)
- + {
- + if (type == DATA_FACEROLLER)
- + _theFaceRoller = true;
- + }
- +
- + void SpellHit(Unit* caster, SpellInfo const* spell)
- + {
- + if (IsHeroic() && !bDone && spell->Id == SPELL_HAMMER_THROWBACK_DMG && caster->GetTypeId() == TYPEID_PLAYER)
- + {
- + uiBasePoints = spell->Effects[0].BasePoints;
- + if (me->GetHealth() <= uiBasePoints)
- + {
- + _theFaceRoller = true;
- + HandleSpellOnPlayersInInstanceToC5(me, SPELL_EADRIC_ACHIEVEMENT);
- + }
- + }
- + }
- +
- + uint32 GetData(uint32 type) const override
- + {
- + if (type == DATA_THE_FACEROLLER)
- + return _theFaceRoller;
- +
- + return 0;
- }
- void UpdateAI(uint32 uiDiff) override
- {
- if (bDone && uiResetTimer <= uiDiff)
- {
- - me->GetMotionMaster()->MovePoint(0, 746.87f, 665.87f, 411.75f);
- + me->GetMotionMaster()->MovePoint(0,746.843f, 695.68f, 412.339f);
- bDone = false;
- + if (GameObject* pGO = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(DATA_MAIN_GATE)))
- + instance->HandleGameObject(pGO->GetGUID(),false);
- } else uiResetTimer -= uiDiff;
- if (!UpdateVictim())
- @@ -226,6 +386,8 @@ public:
- {
- if (target && target->IsAlive())
- {
- + Talk(SAY_EADRIC_HAMMER);
- + Talk(SAY_EADRIC_HAMMER_TARGET, target);
- DoCast(target, SPELL_HAMMER_JUSTICE);
- DoCast(target, SPELL_HAMMER_RIGHTEOUS);
- }
- @@ -243,7 +405,7 @@ public:
- if (uiRadianceTimer <= uiDiff)
- {
- DoCastAOE(SPELL_RADIANCE);
- -
- + Talk(SAY_EADRIC_RADIATE_LIGHT);
- uiRadianceTimer = 16000;
- } else uiRadianceTimer -= uiDiff;
- @@ -253,94 +415,144 @@ public:
- CreatureAI* GetAI(Creature* creature) const override
- {
- - return GetInstanceAI<boss_eadricAI>(creature);
- - }
- + return new boss_eadricAI(creature);
- + };
- };
- class boss_paletress : public CreatureScript
- {
- -public:
- - boss_paletress() : CreatureScript("boss_paletress") { }
- + public:
- + boss_paletress(): CreatureScript("boss_paletress") { }
- - struct boss_paletressAI : public ScriptedAI
- + struct boss_paletressAI : public BossAI
- {
- - boss_paletressAI(Creature* creature) : ScriptedAI(creature)
- + boss_paletressAI(Creature* creature) : BossAI(creature, BOSS_ARGENT_CHALLENGE_P)
- {
- - Initialize();
- instance = creature->GetInstanceScript();
- + hasBeenInCombat = false;
- + bCredit = false;
- +
- creature->SetReactState(REACT_PASSIVE);
- - creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- + creature->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE);
- creature->RestoreFaction();
- }
- - void Initialize()
- - {
- - uiHolyFireTimer = urand(9000, 12000);
- - uiHolySmiteTimer = urand(5000, 7000);
- - uiRenewTimer = urand(2000, 5000);
- -
- - uiResetTimer = 7000;
- -
- - bHealth = false;
- - bDone = false;
- - }
- -
- InstanceScript* instance;
- +
- + Creature* pMemory;
- ObjectGuid MemoryGUID;
- bool bHealth;
- bool bDone;
- + bool hasBeenInCombat;
- + bool bCredit;
- uint32 uiHolyFireTimer;
- uint32 uiHolySmiteTimer;
- uint32 uiRenewTimer;
- uint32 uiResetTimer;
- - void Reset() override
- + void Reset()
- {
- me->RemoveAllAuras();
- - Initialize();
- + uiHolyFireTimer = urand(9000,12000);
- + uiHolySmiteTimer = urand(5000,7000);
- + uiRenewTimer = urand(2000,5000);
- +
- + uiResetTimer = 7000;
- +
- + bHealth = false;
- + bDone = false;
- if (Creature* pMemory = ObjectAccessor::GetCreature(*me, MemoryGUID))
- if (pMemory->IsAlive())
- pMemory->RemoveFromWorld();
- +
- + Map* pMap = me->GetMap();
- + if (hasBeenInCombat && pMap && pMap->IsDungeon())
- + {
- + Map::PlayerList const &players = pMap->GetPlayers();
- + for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
- + {
- + if (itr->GetSource() && itr->GetSource()->IsAlive() && !itr->GetSource()->IsGameMaster())
- + return;
- + }
- +
- + if (instance)
- + {
- + GameObject* GO = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(DATA_MAIN_GATE1));
- + if(GO)
- + instance->HandleGameObject(GO->GetGUID(),true);
- + Creature* announcer = pMap->GetCreature(instance->GetGuidData(DATA_ANNOUNCER));
- + instance->SetData(DATA_ARGENT_SOLDIER_DEFEATED, 0);
- + announcer->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- + }
- +
- + me->RemoveFromWorld();
- + }
- + }
- +
- + void EnterCombat(Unit* /*who*/)
- + {
- + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- + _EnterCombat();
- + me->SetHomePosition(746.843f, 665.000f, 412.339f, 4.670f);
- + hasBeenInCombat = true;
- + Talk(SAY_PALETRESS_AGGRO);
- }
- - void SetData(uint32 uiId, uint32 /*uiValue*/) override
- + void SetData(uint32 uiId, uint32 /*uiValue*/)
- {
- if (uiId == 1)
- me->RemoveAura(SPELL_SHIELD);
- + Talk(SAY_PALETRESS_MEMORY_DIES);
- }
- - void DamageTaken(Unit* /*done_by*/, uint32 &damage) override
- + void DamageTaken(Unit* /*who*/, uint32& damage)
- {
- if (damage >= me->GetHealth())
- {
- damage = 0;
- + if (!bCredit)
- + {
- + bCredit = true;
- + HandleSpellOnPlayersInInstanceToC5(me, 68574);
- + }
- EnterEvadeMode();
- + me->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE);
- + Talk(SAY_PALETRESS_DEFEATED);
- me->setFaction(35);
- bDone = true;
- + if (GameObject* pGO = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(DATA_MAIN_GATE)))
- + instance->HandleGameObject(pGO->GetGUID(),true);
- + if (GameObject* pGO = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(DATA_MAIN_GATE1)))
- + instance->HandleGameObject(pGO->GetGUID(),true);
- + instance->SetData(BOSS_ARGENT_CHALLENGE_P, DONE);
- + HandleKillCreditForAllPlayers(me);
- + HandleInstanceBind(me);
- +
- + if (Creature* memory = me->GetMap()->ToInstanceMap()->GetCreature(MemoryGUID))
- + HandleSpellOnPlayersInInstanceToC5(memory, SPELL_CONFESSOR_ACHIEVEMENT);
- }
- }
- - void MovementInform(uint32 MovementType, uint32 Point) override
- + void MovementInform(uint32 MovementType, uint32 /*Data*/)
- {
- - if (MovementType != POINT_MOTION_TYPE || Point != 0)
- + if (MovementType != POINT_MOTION_TYPE)
- return;
- - instance->SetData(BOSS_ARGENT_CHALLENGE_P, DONE);
- -
- - me->DisappearAndDie();
- }
- - void UpdateAI(uint32 uiDiff) override
- + void UpdateAI(uint32 uiDiff)
- {
- if (bDone && uiResetTimer <= uiDiff)
- {
- - me->GetMotionMaster()->MovePoint(0, 746.87f, 665.87f, 411.75f);
- + me->GetMotionMaster()->MovePoint(0, 746.843f, 695.68f, 412.339f);
- bDone = false;
- + if (GameObject* pGO = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(DATA_MAIN_GATE)))
- + instance->HandleGameObject(pGO->GetGUID(),false);
- } else uiResetTimer -= uiDiff;
- if (!UpdateVictim())
- @@ -351,12 +563,12 @@ public:
- if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 250, true))
- {
- if (target && target->IsAlive())
- - DoCast(target, SPELL_HOLY_FIRE);
- + DoCast(target,DUNGEON_MODE(SPELL_HOLY_FIRE,SPELL_HOLY_FIRE_H));
- }
- - if (me->HasAura(SPELL_SHIELD))
- + if (me->HasAura(SPELL_SHIELD))
- uiHolyFireTimer = 13000;
- else
- - uiHolyFireTimer = urand(9000, 12000);
- + uiHolyFireTimer = urand(9000,12000);
- } else uiHolyFireTimer -= uiDiff;
- if (uiHolySmiteTimer <= uiDiff)
- @@ -364,12 +576,12 @@ public:
- if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 250, true))
- {
- if (target && target->IsAlive())
- - DoCast(target, SPELL_SMITE);
- + DoCast(target,DUNGEON_MODE(SPELL_SMITE,SPELL_SMITE_H));
- }
- if (me->HasAura(SPELL_SHIELD))
- uiHolySmiteTimer = 9000;
- else
- - uiHolySmiteTimer = urand(5000, 7000);
- + uiHolySmiteTimer = urand(5000,7000);
- } else uiHolySmiteTimer -= uiDiff;
- if (me->HasAura(SPELL_SHIELD))
- @@ -377,31 +589,32 @@ public:
- if (uiRenewTimer <= uiDiff)
- {
- me->InterruptNonMeleeSpells(true);
- - uint8 uiTarget = urand(0, 1);
- - switch (uiTarget)
- + uint8 uiTarget = urand(0,1);
- + switch(uiTarget)
- {
- case 0:
- - DoCast(me, SPELL_RENEW);
- + DoCast(me,DUNGEON_MODE(SPELL_RENEW,SPELL_RENEW_H));
- break;
- case 1:
- if (Creature* pMemory = ObjectAccessor::GetCreature(*me, MemoryGUID))
- if (pMemory->IsAlive())
- - DoCast(pMemory, SPELL_RENEW);
- + DoCast(pMemory, DUNGEON_MODE(SPELL_RENEW,SPELL_RENEW_H));
- break;
- }
- - uiRenewTimer = urand(15000, 17000);
- + uiRenewTimer = urand(15000,17000);
- } else uiRenewTimer -= uiDiff;
- }
- - if (!bHealth && !HealthAbovePct(25))
- + if (!bHealth && me->HealthBelowPct(25))
- {
- + Talk(SAY_PALETRESS_SUMMON_MEMORY);
- me->InterruptNonMeleeSpells(true);
- DoCastAOE(SPELL_HOLY_NOVA, false);
- DoCast(me, SPELL_SHIELD);
- - DoCastAOE(SPELL_SUMMON_MEMORY, false);
- DoCastAOE(SPELL_CONFESS, false);
- bHealth = true;
- + DoCast(SPELL_SUMMON_MEMORY);
- }
- DoMeleeAttackIfReady();
- @@ -413,38 +626,30 @@ public:
- }
- };
- - CreatureAI* GetAI(Creature* creature) const override
- + CreatureAI* GetAI(Creature* creature) const
- {
- - return GetInstanceAI<boss_paletressAI>(creature);
- - }
- + return new boss_paletressAI(creature);
- + };
- };
- class npc_memory : public CreatureScript
- {
- -public:
- - npc_memory() : CreatureScript("npc_memory") { }
- + public:
- + npc_memory(): CreatureScript("npc_memory") { }
- struct npc_memoryAI : public ScriptedAI
- {
- - npc_memoryAI(Creature* creature) : ScriptedAI(creature)
- - {
- - Initialize();
- - }
- -
- - void Initialize()
- - {
- - uiOldWoundsTimer = 12000;
- - uiShadowPastTimer = 5000;
- - uiWakingNightmare = 7000;
- - }
- + npc_memoryAI(Creature* creature) : ScriptedAI(creature) { }
- uint32 uiOldWoundsTimer;
- uint32 uiShadowPastTimer;
- uint32 uiWakingNightmare;
- - void Reset() override
- + void Reset()
- {
- - Initialize();
- + uiOldWoundsTimer = 12000;
- + uiShadowPastTimer = 5000;
- + uiWakingNightmare = 7000;
- }
- void UpdateAI(uint32 uiDiff) override
- @@ -454,242 +659,441 @@ public:
- if (uiOldWoundsTimer <= uiDiff)
- {
- - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
- + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM,0))
- {
- if (target && target->IsAlive())
- - DoCast(target, SPELL_OLD_WOUNDS);
- + DoCast(target, DUNGEON_MODE(SPELL_OLD_WOUNDS,SPELL_OLD_WOUNDS_H));
- }
- - uiOldWoundsTimer = 12000;
- - }else uiOldWoundsTimer -= uiDiff;
- + uiOldWoundsTimer = 23000;
- + } else uiOldWoundsTimer -= uiDiff;
- if (uiWakingNightmare <= uiDiff)
- {
- - DoCast(me, SPELL_WAKING_NIGHTMARE);
- - uiWakingNightmare = 7000;
- - }else uiWakingNightmare -= uiDiff;
- + Talk(SAY_MEMORY_NIGHTMARE);
- + DoCast(me, DUNGEON_MODE(SPELL_WAKING_NIGHTMARE,SPELL_WAKING_NIGHTMARE_H));
- + uiWakingNightmare = 15000;
- + } else uiWakingNightmare -= uiDiff;
- if (uiShadowPastTimer <= uiDiff)
- {
- - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
- + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM,1))
- {
- if (target && target->IsAlive())
- - DoCast(target, SPELL_SHADOWS_PAST);
- + DoCast(target, DUNGEON_MODE(SPELL_SHADOWS_PAST,SPELL_SHADOWS_PAST_H));
- }
- - uiShadowPastTimer = 5000;
- - }else uiShadowPastTimer -= uiDiff;
- + uiShadowPastTimer = 20000;
- + } else uiShadowPastTimer -= uiDiff;
- DoMeleeAttackIfReady();
- }
- void JustDied(Unit* /*killer*/) override
- {
- - if (TempSummon* summ = me->ToTempSummon())
- - if (Unit* summoner = summ->GetSummoner())
- - if (summoner->IsAlive())
- - summoner->GetAI()->SetData(1, 0);
- + if (me->IsSummon())
- + {
- + if (Unit* summoner = me->ToTempSummon()->GetSummoner())
- + {
- + if (summoner && summoner->IsAlive() && summoner->GetTypeId() == TYPEID_UNIT)
- + summoner->ToCreature()->AI()->SetData(1,0);
- + }
- + }
- }
- };
- - CreatureAI* GetAI(Creature* creature) const override
- + CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_memoryAI(creature);
- - }
- + };
- };
- class npc_argent_soldier : public CreatureScript
- {
- -public:
- - npc_argent_soldier() : CreatureScript("npc_argent_soldier") { }
- + public:
- + npc_argent_soldier(): CreatureScript("npc_argent_soldier") { }
- - // THIS AI NEEDS MORE IMPROVEMENTS
- - struct npc_argent_soldierAI : public npc_escortAI
- - {
- - npc_argent_soldierAI(Creature* creature) : npc_escortAI(creature)
- + struct npc_argent_soldierAI : public npc_escortAI
- {
- - instance = creature->GetInstanceScript();
- - me->SetReactState(REACT_DEFENSIVE);
- - SetDespawnAtEnd(false);
- - uiWaypoint = 0;
- - }
- -
- - InstanceScript* instance;
- + npc_argent_soldierAI(Creature* creature) : npc_escortAI(creature)
- + {
- + instance = creature->GetInstanceScript();
- + me->SetReactState(REACT_DEFENSIVE);
- + SetDespawnAtEnd(false);
- + uiWaypoint = 0;
- + }
- - uint8 uiWaypoint;
- + void Reset()
- + {
- + _shielded = false;
- + _events.Reset();
- + }
- - void WaypointReached(uint32 waypointId) override
- - {
- - if (waypointId == 0)
- + void EnterCombat(Unit* /*who*/)
- {
- - switch (uiWaypoint)
- + switch (me->GetEntry())
- {
- - case 0:
- - me->SetFacingTo(5.81f);
- + case NPC_ARGENT_LIGHWIELDER:
- + _events.ScheduleEvent(EVENT_CLEAVE, urand(4000, 8000));
- + _events.ScheduleEvent(EVENT_BLAZINGLIGHT, urand(7000, 10000));
- + if (IsHeroic())
- + _events.ScheduleEvent(EVENT_STRIKE, urand(9000, 12000));
- break;
- - case 1:
- - me->SetFacingTo(4.60f);
- + case NPC_ARGENT_MONK:
- + _events.ScheduleEvent(EVENT_FLURRY, urand(8000, 12000));
- + _events.ScheduleEvent(EVENT_PUMMEL, urand(5000, 6000));
- break;
- - case 2:
- - me->SetFacingTo(2.79f);
- + case NPC_PRIESTESS:
- + _events.ScheduleEvent(EVENT_PAIN, urand(3000, 6000));
- + _events.ScheduleEvent(EVENT_FOUNTAIN, urand(15000, 20000));
- + _events.ScheduleEvent(EVENT_HOLYSMITE, urand(4000, 8000));
- + if (IsHeroic())
- + _events.ScheduleEvent(EVENT_MINDCONTROL, urand(17000, 25000));
- break;
- }
- }
- - }
- - void SetData(uint32 uiType, uint32 /*uiData*/) override
- - {
- - switch (me->GetEntry())
- + void WaypointReached(uint32 uiPoint) override
- {
- - case NPC_ARGENT_LIGHWIELDER:
- - switch (uiType)
- + if (uiPoint == 0)
- + {
- + switch (uiWaypoint)
- {
- case 0:
- - AddWaypoint(0, 712.14f, 628.42f, 411.88f);
- + me->SetOrientation(5.81f);
- break;
- case 1:
- - AddWaypoint(0, 742.44f, 650.29f, 411.79f);
- + me->SetOrientation(4.60f);
- break;
- case 2:
- - AddWaypoint(0, 783.33f, 615.29f, 411.84f);
- + me->SetOrientation(2.79f);
- break;
- }
- - break;
- - case NPC_ARGENT_MONK:
- - switch (uiType)
- +
- + me->SendMovementFlagUpdate();
- + }
- + }
- +
- + void SetData(uint32 uiType, uint32 /*uiData*/) override
- + {
- + switch (me->GetEntry())
- + {
- + case NPC_ARGENT_LIGHWIELDER:
- + switch (uiType)
- + {
- + case 0:
- + AddWaypoint(0, 712.14f, 628.42f, 411.88f);
- + break;
- + case 1:
- + AddWaypoint(0, 742.44f, 650.29f, 411.79f);
- + break;
- + case 2:
- + AddWaypoint(0, 783.33f, 615.29f, 411.84f);
- + break;
- + }
- + break;
- + case NPC_ARGENT_MONK:
- + switch (uiType)
- + {
- + case 0:
- + AddWaypoint(0, 713.12f, 632.97f, 411.90f);
- + break;
- + case 1:
- + AddWaypoint(0, 746.73f, 650.24f, 411.56f);
- + break;
- + case 2:
- + AddWaypoint(0, 781.32f, 610.54f, 411.82f);
- + break;
- + }
- + break;
- + case NPC_PRIESTESS:
- + switch (uiType)
- + {
- + case 0:
- + AddWaypoint(0, 715.06f, 637.07f, 411.91f);
- + break;
- + case 1:
- + AddWaypoint(0, 750.72f, 650.20f, 411.77f);
- + break;
- + case 2:
- + AddWaypoint(0, 779.77f, 607.03f, 411.81f);
- + break;
- + }
- + break;
- + }
- +
- + Start(false, true);
- + uiWaypoint = uiType;
- + }
- +
- + void DamageTaken(Unit* /*attacker*/, uint32 &damage)
- + {
- + if (!IsHeroic() || _shielded || me->GetEntry() != NPC_ARGENT_MONK)
- + return;
- +
- + if (damage >= me->GetHealth())
- + {
- + DoCast(me, SPELL_FINAL);
- + DoCast(me, SPELL_DIVINE, true);
- + me->SetHealth(1);
- + damage = 0;
- + _shielded = true;
- + }
- + }
- +
- + void UpdateAI(uint32 uiDiff) override
- + {
- + npc_escortAI::UpdateAI(uiDiff);
- +
- + if (!UpdateVictim())
- + return;
- +
- + _events.Update(uiDiff);
- +
- + if (me->HasUnitState(UNIT_STATE_CASTING))
- + return;
- +
- + while (uint32 eventId = _events.ExecuteEvent())
- + {
- + switch (eventId)
- {
- - case 0:
- - AddWaypoint(0, 713.12f, 632.97f, 411.90f);
- + case EVENT_CLEAVE:
- + DoCastVictim(SPELL_CLEAVE);
- + _events.ScheduleEvent(EVENT_CLEAVE, urand(5000, 8000));
- break;
- - case 1:
- - AddWaypoint(0, 746.73f, 650.24f, 411.56f);
- + case EVENT_STRIKE:
- + DoCastVictim(SPELL_STRIKE);
- + _events.ScheduleEvent(EVENT_STRIKE, urand(10000, 12000));
- break;
- - case 2:
- - AddWaypoint(0, 781.32f, 610.54f, 411.82f);
- + case EVENT_BLAZINGLIGHT:
- + DoCast(me, SPELL_LIGHT);
- + _events.ScheduleEvent(EVENT_BLAZINGLIGHT, urand(9000, 13000));
- break;
- - }
- - break;
- - case NPC_PRIESTESS:
- - switch (uiType)
- - {
- - case 0:
- - AddWaypoint(0, 715.06f, 637.07f, 411.91f);
- + case EVENT_FLURRY:
- + DoCast(me, SPELL_FLURRY);
- + _events.ScheduleEvent(EVENT_FLURRY, urand(13000, 15000));
- break;
- - case 1:
- - AddWaypoint(0, 750.72f, 650.20f, 411.77f);
- + case EVENT_PUMMEL:
- + DoCastVictim(SPELL_PUMMEL);
- + _events.ScheduleEvent(EVENT_PUMMEL, urand(4000, 7000));
- break;
- - case 2:
- - AddWaypoint(0, 779.77f, 607.03f, 411.81f);
- + case EVENT_HOLYSMITE:
- + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 40.0f))
- + DoCast(target, DUNGEON_MODE(SPELL_HOLY_SMITE, SPELL_HOLY_SMITE_H));
- + _events.ScheduleEvent(EVENT_HOLYSMITE, urand(5000, 7000));
- + break;
- + case EVENT_MINDCONTROL:
- + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 30.0f))
- + DoCast(target, SPELL_MIND);
- + _events.ScheduleEvent(EVENT_MINDCONTROL, urand(20000, 25000));
- + break;
- + case EVENT_PAIN:
- + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 30.0f, false, DUNGEON_MODE(-SPELL_SHADOW_WORD_PAIN, -SPELL_SHADOW_WORD_PAIN_H)))
- + DoCast(target, DUNGEON_MODE(SPELL_SHADOW_WORD_PAIN, SPELL_SHADOW_WORD_PAIN_H));
- + _events.ScheduleEvent(EVENT_PAIN, urand(7000, 90000));
- + break;
- + case EVENT_FOUNTAIN:
- + DoCast(SPELL_FOUNTAIN_OF_LIGHT);
- + _events.ScheduleEvent(EVENT_FOUNTAIN, urand(20000, 30000));
- break;
- }
- - break;
- - }
- -
- - Start(false, true);
- - uiWaypoint = uiType;
- - }
- + }
- - void UpdateAI(uint32 uiDiff) override
- - {
- - npc_escortAI::UpdateAI(uiDiff);
- + DoMeleeAttackIfReady();
- + }
- - if (!UpdateVictim())
- - return;
- + void JustDied(Unit* /*killer*/) override
- + {
- + if (instance)
- + instance->SetData(DATA_ARGENT_SOLDIER_DEFEATED, instance->GetData(DATA_ARGENT_SOLDIER_DEFEATED) + 1);
- + }
- - DoMeleeAttackIfReady();
- - }
- + private:
- + InstanceScript* instance;
- + EventMap _events;
- + bool _shielded;
- + uint8 uiWaypoint;
- + };
- - void JustDied(Unit* /*killer*/) override
- + CreatureAI* GetAI(Creature* creature) const
- {
- - instance->SetData(DATA_ARGENT_SOLDIER_DEFEATED, instance->GetData(DATA_ARGENT_SOLDIER_DEFEATED) + 1);
- + return new npc_argent_soldierAI(creature);
- }
- - };
- -
- - CreatureAI* GetAI(Creature* creature) const override
- - {
- - return GetInstanceAI<npc_argent_soldierAI>(creature);
- - }
- };
- -uint32 const memorySpellId[25] =
- +enum ReflectiveShield
- {
- - SPELL_MEMORY_ALGALON,
- - SPELL_MEMORY_ARCHIMONDE,
- - SPELL_MEMORY_CHROMAGGUS,
- - SPELL_MEMORY_CYANIGOSA,
- - SPELL_MEMORY_DELRISSA,
- - SPELL_MEMORY_ECK,
- - SPELL_MEMORY_ENTROPIUS,
- - SPELL_MEMORY_GRUUL,
- - SPELL_MEMORY_HAKKAR,
- - SPELL_MEMORY_HEIGAN,
- - SPELL_MEMORY_HEROD,
- - SPELL_MEMORY_HOGGER,
- - SPELL_MEMORY_IGNIS,
- - SPELL_MEMORY_ILLIDAN,
- - SPELL_MEMORY_INGVAR,
- - SPELL_MEMORY_KALITHRESH,
- - SPELL_MEMORY_LUCIFRON,
- - SPELL_MEMORY_MALCHEZAAR,
- - SPELL_MEMORY_MUTANUS,
- - SPELL_MEMORY_ONYXIA,
- - SPELL_MEMORY_THUNDERAAN,
- - SPELL_MEMORY_VANCLEEF,
- - SPELL_MEMORY_VASHJ,
- - SPELL_MEMORY_VEKNILASH,
- - SPELL_MEMORY_VEZAX
- + SPELL_REFLECTIVE_SHIELD_TRIGGERED = 33619
- };
- -// 66545 - Summon Memory
- -class spell_paletress_summon_memory : public SpellScriptLoader
- +// Reflective Shield 66515
- +class spell_gen_reflective_shield : public SpellScriptLoader
- {
- public:
- - spell_paletress_summon_memory() : SpellScriptLoader("spell_paletress_summon_memory") { }
- + spell_gen_reflective_shield() : SpellScriptLoader("spell_gen_reflective_shield") { }
- - class spell_paletress_summon_memory_SpellScript : public SpellScript
- + class spell_gen_reflective_shield_AuraScript : public AuraScript
- {
- - PrepareSpellScript(spell_paletress_summon_memory_SpellScript);
- + PrepareAuraScript(spell_gen_reflective_shield_AuraScript);
- - bool Validate(SpellInfo const* /*spellInfo*/) override
- + bool Validate(SpellInfo const* /*spell*/) override
- {
- - for (uint8 i = 0; i < 25; ++i)
- - if (!sSpellMgr->GetSpellInfo(memorySpellId[i]))
- - return false;
- + if (!sSpellStore.LookupEntry(SPELL_REFLECTIVE_SHIELD_TRIGGERED))
- + return false;
- +
- return true;
- }
- - void FilterTargets(std::list<WorldObject*>& targets)
- + void Trigger(AuraEffect * aurEff, DamageInfo & dmgInfo, uint32 & absorbAmount)
- {
- - if (targets.empty())
- + Unit * target = dmgInfo.GetAttacker();
- + if (!target)
- return;
- + Unit * caster = GetCaster();
- + if (!caster)
- + return;
- + int32 bp = CalculatePct(absorbAmount, 25);
- + target->CastCustomSpell(target, SPELL_REFLECTIVE_SHIELD_TRIGGERED, &bp, NULL, NULL, true, NULL, aurEff);
- + }
- - WorldObject* target = Trinity::Containers::SelectRandomContainerElement(targets);
- - targets.clear();
- - targets.push_back(target);
- + void Register()
- + {
- + AfterEffectAbsorb += AuraEffectAbsorbFn(spell_gen_reflective_shield_AuraScript::Trigger, EFFECT_0);
- }
- + };
- - void HandleScript(SpellEffIndex /*effIndex*/)
- + AuraScript *GetAuraScript() const
- + {
- + return new spell_gen_reflective_shield_AuraScript();
- + }
- +};
- +
- +class achievement_toc5_argent_challenge : public AchievementCriteriaScript
- +{
- + public:
- + uint32 creature_entry;
- +
- + achievement_toc5_argent_challenge(const char* name, uint32 original_entry) : AchievementCriteriaScript(name) {
- + creature_entry = original_entry;
- + }
- +
- + bool OnCheck(Player* /*source*/, Unit* target) override
- + {
- + if (!target)
- + return false;
- +
- + if (Creature* creature = target->ToCreature())
- + if (creature->GetOriginalEntry() == creature_entry)
- + return true;
- +
- + return false;
- + }
- +};
- +
- +class achievement_toc5_argent_confessor : public AchievementCriteriaScript
- +{
- + public:
- + uint32 creature_entry;
- +
- + achievement_toc5_argent_confessor(const char* name, uint32 original_entry) : AchievementCriteriaScript(name)
- + {
- + creature_entry = original_entry;
- + }
- +
- + bool OnCheck(Player* /*source*/, Unit* target) override
- + {
- + if (!target)
- + return false;
- +
- + if (Creature* creature = target->ToCreature())
- + if (creature->GetEntry() == creature_entry && creature->GetMap()->ToInstanceMap()->IsHeroic())
- + return true;
- +
- + return false;
- + }
- +};
- +
- +class achievement_toc5_the_faceroller : public AchievementCriteriaScript
- +{
- + public:
- + achievement_toc5_the_faceroller(const char* name) : AchievementCriteriaScript(name) {}
- +
- + bool OnCheck(Player* /*source*/, Unit* target) override
- + {
- + if (target && target->GetMap()->ToInstanceMap()->IsHeroic())
- + return target->GetAI()->GetData(DATA_THE_FACEROLLER);
- +
- + return false;
- + }
- +};
- +
- +class spell_light_rain: public SpellScriptLoader
- +{
- + public:
- + spell_light_rain(): SpellScriptLoader("spell_light_rain") { }
- +
- + class spell_light_rain_SpellScript : public SpellScript
- + {
- + PrepareSpellScript(spell_light_rain_SpellScript);
- +
- + void SelectTarget(std::list<WorldObject*>& unitList)
- {
- - GetHitUnit()->CastSpell(GetHitUnit(), memorySpellId[urand(0, 24)], true, NULL, NULL, GetCaster()->GetGUID());
- + if (unitList.empty())
- + return;
- +
- + unitList.sort(Trinity::HealthPctOrderPred());
- + unitList.resize(1);
- }
- - void Register() override
- + void Register()
- {
- - OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_paletress_summon_memory_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
- - OnEffectHitTarget += SpellEffectFn(spell_paletress_summon_memory_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
- + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_light_rain_SpellScript::SelectTarget, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY);
- }
- };
- - SpellScript* GetSpellScript() const override
- + SpellScript* GetSpellScript() const
- {
- - return new spell_paletress_summon_memory_SpellScript();
- + return new spell_light_rain_SpellScript();
- }
- };
- void AddSC_boss_argent_challenge()
- {
- new boss_eadric();
- - new spell_eadric_radiance();
- new boss_paletress();
- new npc_memory();
- new npc_argent_soldier();
- - new spell_paletress_summon_memory();
- -}
- + new spell_gen_reflective_shield();
- + new spell_light_rain();
- + new spell_eadric_radiance();
- + new spell_eadric_hammer_missile();
- + new spell_eadric_hammer_throw_back();
- + new achievement_toc5_argent_challenge("achievement_toc5_paletress", NPC_PALETRESS);
- + new achievement_toc5_argent_challenge("achievement_toc5_eadric", NPC_EADRIC);
- +
- + new achievement_toc5_argent_confessor("achivement_toc5_argent_confessor_hogger", MEMORY_HOGGER);
- + new achievement_toc5_argent_confessor("achivement_toc5_argent_confessor_vancleef", MEMORY_VANCLEEF);
- + new achievement_toc5_argent_confessor("achivement_toc5_argent_confessor_mutanus", MEMORY_MUTANUS);
- + new achievement_toc5_argent_confessor("achivement_toc5_argent_confessor_herod", MEMORY_HEROD);
- + new achievement_toc5_argent_confessor("achivement_toc5_argent_confessor_lucifron", MEMORY_LUCIFRON);
- + new achievement_toc5_argent_confessor("achivement_toc5_argent_confessor_thunderaan", MEMORY_THUNDERAAN);
- + new achievement_toc5_argent_confessor("achivement_toc5_argent_confessor_chromaggus", MEMORY_CHROMAGGUS);
- + new achievement_toc5_argent_confessor("achivement_toc5_argent_confessor_hakkar", MEMORY_HAKKAR);
- + new achievement_toc5_argent_confessor("achivement_toc5_argent_confessor_veknilash", MEMORY_VEKNILASH);
- + new achievement_toc5_argent_confessor("achivement_toc5_argent_confessor_kalithresh", MEMORY_KALITHRESH);
- + new achievement_toc5_argent_confessor("achivement_toc5_argent_confessor_malchezar", MEMORY_MALCHEZAAR);
- + new achievement_toc5_argent_confessor("achivement_toc5_argent_confessor_gruul", MEMORY_GRUUL);
- + new achievement_toc5_argent_confessor("achivement_toc5_argent_confessor_vashj", MEMORY_VASHJ);
- + new achievement_toc5_argent_confessor("achivement_toc5_argent_confessor_archimonde", MEMORY_ARCHIMONDE);
- + new achievement_toc5_argent_confessor("achivement_toc5_argent_confessor_illidan", MEMORY_ILLIDAN);
- + new achievement_toc5_argent_confessor("achivement_toc5_argent_confessor_delrissa", MEMORY_DELRISSA);
- + new achievement_toc5_argent_confessor("achivement_toc5_argent_confessor_muru", MEMORY_ENTROPIUS);
- + new achievement_toc5_argent_confessor("achivement_toc5_argent_confessor_ingvar", MEMORY_INGVAR);
- + new achievement_toc5_argent_confessor("achivement_toc5_argent_confessor_cyanigosa", MEMORY_CYANIGOSA);
- + new achievement_toc5_argent_confessor("achivement_toc5_argent_confessor_eck", MEMORY_ECK);
- + new achievement_toc5_argent_confessor("achivement_toc5_argent_confessor_onyxia", MEMORY_ONYXIA);
- + new achievement_toc5_argent_confessor("achivement_toc5_argent_confessor_heigan", MEMORY_HEIGAN);
- + new achievement_toc5_argent_confessor("achivement_toc5_argent_confessor_ignis", MEMORY_IGNIS);
- + new achievement_toc5_argent_confessor("achivement_toc5_argent_confessor_vezax", MEMORY_VEZAX);
- + new achievement_toc5_argent_confessor("achivement_toc5_argent_confessor_algalon", MEMORY_ALGALON);
- +
- + new achievement_toc5_the_faceroller("achievement_toc5_the_faceroller");
- +}
- \ No newline at end of file
- diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp
- index e375a0a..ea744ba 100644
- --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp
- +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp
- @@ -15,50 +15,64 @@
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
- -/* ScriptData
- -SDName: Boss Black Knight
- -SD%Complete: 80%
- -SDComment: missing yells. not sure about timers.
- -SDCategory: Trial of the Champion
- -EndScriptData */
- -
- -#include "ScriptMgr.h"
- -#include "ScriptedCreature.h"
- +#include "ScriptPCH.h"
- #include "ScriptedEscortAI.h"
- #include "trial_of_the_champion.h"
- +#include "Vehicle.h"
- +
- +enum Talk
- +{
- + SAY_INTRO_1 = 0, // You spoiled my grand entrance, Rat.
- + SAY_INTRO_2 = 56, // What is the meaning of this? -Tirion
- + SAY_INTRO_3 = 1, // Did you honestly think an agent of the Lich King would be bested on the field of your pathetic little tournament?
- + SAY_INTRO_4 = 2, // I have come to finish my task
- + SAY_AGGRO = 3, // This farce ends here!
- + SAY_AGGRO_OUTRO = 51, // Varian - Don't just stand there; kill him! | Garrosh - Tear him apart!
- + SAY_KILLED_PLAYER = 6, // Pathetic | A waste of flesh.
- + SAY_PHASE_1 = 4, // My roting flash was just getting in the way!
- + SAY_PHASE_2 = 5, // I have no need for bones to best you!
- + SAY_DEATH = 7 // No! I must not fail...again...
- +};
- +
- enum Spells
- {
- //phase 1
- - SPELL_PLAGUE_STRIKE = 67884,
- - SPELL_PLAGUE_STRIKE_2 = 67724,
- - SPELL_ICY_TOUCH_H = 67881,
- + SPELL_PLAGUE_STRIKE = 67724,
- SPELL_ICY_TOUCH = 67718,
- + SPELL_ICY_TOUCH_H = 67881,
- SPELL_DEATH_RESPITE = 67745,
- - SPELL_DEATH_RESPITE_2 = 68306,
- - SPELL_DEATH_RESPITE_3 = 66798,
- - SPELL_OBLITERATE_H = 67883,
- + SPELL_DEATH_RESPITE_H = 68306,
- SPELL_OBLITERATE = 67725,
- - //in this phase should rise herald (the spell is missing)
- + SPELL_OBLITERATE_H = 67883,
- + ZOMBIE_JAEREN = 67715,
- + ZOMBIE_ARELAS = 67705,
- + KILL_HERALD = 66804,
- + SPELL_RESPITE_HERALD = 66798,
- //phase 2 - During this phase, the Black Knight will use the same abilities as in phase 1, except for Death's Respite
- SPELL_ARMY_DEAD = 67761,
- - SPELL_DESECRATION = 67778,
- - SPELL_DESECRATION_2 = 67778,
- + SPELL_DESECRATION = 68766,
- SPELL_GHOUL_EXPLODE = 67751,
- //phase 3
- - SPELL_DEATH_BITE_H = 67875,
- SPELL_DEATH_BITE = 67808,
- + SPELL_DEATH_BITE_H = 67875,
- SPELL_MARKED_DEATH = 67882,
- - SPELL_MARKED_DEATH_2 = 67823,
- SPELL_BLACK_KNIGHT_RES = 67693,
- SPELL_LEAP = 67749,
- SPELL_LEAP_H = 67880,
- + SPELL_CLAW = 67774,
- + SPELL_CLAW_H = 67879,
- +
- + GHOUL_EXPLODE_DAMAGE = 67729,
- + H_GHOUL_EXPLODE_DAMAGE = 67886,
- - SPELL_KILL_CREDIT = 68663
- + SPELL_KILL_CREDIT = 68663,
- +
- + SPELL_MOUNT_VEHICLE = 46598
- };
- enum Models
- @@ -67,13 +81,35 @@ enum Models
- MODEL_GHOST = 21300
- };
- +enum Equip
- +{
- + EQUIP_SWORD = 40343
- +};
- +
- +enum IntroPhase
- +{
- + IDLE,
- + INTRO,
- + NORMAL,
- + FINISHED
- +};
- +
- enum Phases
- {
- - PHASE_UNDEAD = 1,
- - PHASE_SKELETON = 2,
- - PHASE_GHOST = 3
- + PHASE_UNDEAD = 3,
- + PHASE_SKELETON = 4,
- + PHASE_GHOST = 5
- +
- +};
- +
- +enum Creatures
- +{
- + CREATURE_HIGHLORD = 34996,
- + CREATURE_ANNOUNCER = 35004
- };
- +const Position MoveKnightPos = {746.993286f, 622.990784f, 411.417237f, 4.712464f};
- +
- class boss_black_knight : public CreatureScript
- {
- public:
- @@ -81,49 +117,43 @@ public:
- struct boss_black_knightAI : public ScriptedAI
- {
- - boss_black_knightAI(Creature* creature) : ScriptedAI(creature), summons(creature)
- + boss_black_knightAI(Creature* creature) : ScriptedAI(creature)
- {
- - Initialize();
- instance = creature->GetInstanceScript();
- - }
- -
- - void Initialize()
- - {
- - bEventInProgress = false;
- - bEvent = false;
- - bSummonArmy = false;
- - bDeathArmyDone = false;
- -
- - uiPhase = PHASE_UNDEAD;
- -
- - uiIcyTouchTimer = urand(5000, 9000);
- - uiPlagueStrikeTimer = urand(10000, 13000);
- - uiDeathRespiteTimer = urand(15000, 16000);
- - uiObliterateTimer = urand(17000, 19000);
- - uiDesecration = urand(15000, 16000);
- - uiDeathArmyCheckTimer = 7000;
- - uiResurrectTimer = 4000;
- - uiGhoulExplodeTimer = 8000;
- - uiDeathBiteTimer = urand(2000, 4000);
- - uiMarkedDeathTimer = urand(5000, 7000);
- + Phase = IDLE;
- + bCredit = false;
- }
- InstanceScript* instance;
- - SummonList summons;
- + GuidList SummonList;
- bool bEventInProgress;
- bool bEvent;
- bool bSummonArmy;
- bool bDeathArmyDone;
- + bool bEventInBattle;
- + bool bFight;
- + bool bCredit;
- + bool iveHadWorse;
- uint8 uiPhase;
- + uint8 uiIntroPhase;
- +
- + Creature* pHighlord;
- + Creature* pAnnouncer;
- + IntroPhase Phase;
- +
- + uint32 uiIntroTimer;
- uint32 uiPlagueStrikeTimer;
- + uint32 uiPlagueStrike1Timer;
- uint32 uiIcyTouchTimer;
- + uint32 uiIcyTouch1Timer;
- uint32 uiDeathRespiteTimer;
- uint32 uiObliterateTimer;
- - uint32 uiDesecration;
- + uint32 uiObliterate1Timer;
- + uint32 uiDesecrationTimer;
- uint32 uiResurrectTimer;
- uint32 uiDeathArmyCheckTimer;
- uint32 uiGhoulExplodeTimer;
- @@ -132,28 +162,154 @@ public:
- void Reset() override
- {
- - summons.DespawnAll();
- + RemoveSummons();
- me->SetDisplayId(me->GetNativeDisplayId());
- me->ClearUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED);
- - Initialize();
- + bEventInProgress = false;
- + bEvent = false;
- + bSummonArmy = false;
- + bDeathArmyDone = false;
- + bFight = false;
- + iveHadWorse = true;
- + pAnnouncer = NULL;
- +
- + if (instance)
- + {
- + if (GameObject* go = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(DATA_MAIN_GATE)))
- + instance->HandleGameObject(go->GetGUID(), false);
- +
- + if (GameObject* go = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(DATA_MAIN_GATE1)))
- + instance->HandleGameObject(go->GetGUID(), true);
- + }
- +
- + if (bEventInBattle)
- + {
- + me->GetMotionMaster()->MovePoint(1, 743.396f, 635.411f, 411.575f);
- + me->setFaction(14);
- + me->SetReactState(REACT_AGGRESSIVE);
- + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
- + }
- +
- + uiPhase = PHASE_UNDEAD;
- + uiIcyTouchTimer = urand(5000, 9000);
- + uiIcyTouch1Timer = urand(15000, 15000);
- + uiPlagueStrikeTimer = urand(10000, 13000);
- + uiDeathRespiteTimer = 17000;
- + uiPlagueStrike1Timer = urand(14000, 14000);
- + uiObliterateTimer = urand(17000, 19000);
- + uiObliterate1Timer = urand(15000, 15000);
- + uiDesecrationTimer = urand(15000, 16000);
- + uiDesecrationTimer = 22000;
- + uiDeathArmyCheckTimer = 7000;
- + uiResurrectTimer = 4000;
- + uiGhoulExplodeTimer = 8000;
- + uiDeathBiteTimer = urand (2000, 4000);
- + uiMarkedDeathTimer = urand (5000, 7000);
- + uiIntroTimer = 15000;
- + uiIntroPhase = 0;
- + Phase = IDLE;
- }
- - void JustSummoned(Creature* summon) override
- + void MoveInLineOfSight(Unit* who) override
- {
- - summons.Summon(summon);
- - summon->AI()->AttackStart(me->GetVictim());
- + if (!who)
- + return;
- +
- + if (Phase == IDLE && me->IsValidAttackTarget(who) && me->IsWithinDistInMap(who, 200.0f))
- + {
- + me->SetReactState(REACT_PASSIVE);
- + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
- + Phase = INTRO;
- + }
- }
- - void SummonedCreatureDespawn(Creature* summon) override
- + void RemoveSummons()
- {
- - summons.Despawn(summon);
- + if (SummonList.empty())
- + return;
- +
- + for(GuidList::const_iterator itr = SummonList.begin(); itr != SummonList.end(); ++itr)
- + {
- + if (Creature* temp = ObjectAccessor::GetCreature(*me, *itr))
- + {
- + if (temp)
- + {
- + // Let all remaining ghouls explode
- + if ((temp->GetEntry() == 35590 || temp->GetEntry() == 12444) && temp->IsAlive())
- + {
- + me->CastSpell(temp, SPELL_GHOUL_EXPLODE, true);
- + }
- + else
- + temp->DisappearAndDie();
- + }
- + }
- + }
- + SummonList.clear();
- + }
- +
- + void JustSummoned(Creature* summon) override
- + {
- + SummonList.push_back(summon->GetGUID());
- }
- void UpdateAI(uint32 uiDiff) override
- {
- - //Return since we have no target
- - if (!UpdateVictim())
- + if (Phase == IDLE)
- + return;
- +
- + if (Phase == INTRO)
- + {
- + if (uiIntroTimer <= uiDiff)
- + {
- + switch (uiIntroPhase)
- + {
- + case 0:
- + ++uiIntroPhase;
- + uiIntroTimer = 3000;
- + break;
- + case 1: // MEH
- + ++uiIntroPhase;
- + uiIntroTimer = 2000;
- + break;
- + case 2:
- + if (Creature* announcer = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_ANNOUNCER)))
- + announcer->DisappearAndDie();
- +
- + me->SetUnitMovementFlags(MOVEMENTFLAG_WALKING);
- + me->GetMotionMaster()->MovePoint(0, MoveKnightPos);
- + ++uiIntroPhase;
- + uiIntroTimer = 2000;
- + break;
- + case 3:
- + Talk(SAY_INTRO_3);
- + ++uiIntroPhase;
- + uiIntroTimer = 6000;
- + break;
- + case 4:
- + Talk(SAY_INTRO_4);
- + ++uiIntroPhase;
- + uiIntroTimer = 3000;
- + break;
- + case 5:
- + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NON_ATTACKABLE);
- + me->SetReactState(REACT_AGGRESSIVE);
- + ++uiIntroPhase;
- + uiIntroTimer = 3000;
- + if (Unit* unit = me->SelectNearestTarget())
- + AttackStart(unit);
- + DoZoneInCombat();
- + Phase = NORMAL;
- + break;
- + }
- + }
- + else
- + uiIntroTimer -= uiDiff;
- + return;
- + }
- +
- + if (!UpdateVictim() || me->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT) || me->GetVehicle())
- return;
- if (bEventInProgress)
- @@ -161,9 +317,22 @@ public:
- if (uiResurrectTimer <= uiDiff)
- {
- me->SetFullHealth();
- + me->AttackStop();
- +
- + switch (uiPhase)
- + {
- + case PHASE_UNDEAD:
- + Talk(SAY_PHASE_1);
- + break;
- + case PHASE_SKELETON:
- + Talk(SAY_PHASE_2);
- + break;
- + }
- +
- DoCast(me, SPELL_BLACK_KNIGHT_RES, true);
- + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- uiPhase++;
- - uiResurrectTimer = 4000;
- + uiResurrectTimer = 3000;
- bEventInProgress = false;
- me->ClearUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED);
- } else uiResurrectTimer -= uiDiff;
- @@ -172,82 +341,125 @@ public:
- switch (uiPhase)
- {
- case PHASE_UNDEAD:
- - case PHASE_SKELETON:
- {
- - if (uiIcyTouchTimer <= uiDiff)
- - {
- - DoCastVictim(SPELL_ICY_TOUCH);
- - uiIcyTouchTimer = urand(5000, 7000);
- - } else uiIcyTouchTimer -= uiDiff;
- if (uiPlagueStrikeTimer <= uiDiff)
- {
- - DoCastVictim(SPELL_ICY_TOUCH);
- + DoCastVictim(SPELL_PLAGUE_STRIKE);
- uiPlagueStrikeTimer = urand(12000, 15000);
- } else uiPlagueStrikeTimer -= uiDiff;
- +
- if (uiObliterateTimer <= uiDiff)
- {
- - DoCastVictim(SPELL_OBLITERATE);
- + DoCastVictim(DUNGEON_MODE(SPELL_OBLITERATE, SPELL_OBLITERATE_H));
- uiObliterateTimer = urand(17000, 19000);
- } else uiObliterateTimer -= uiDiff;
- - switch (uiPhase)
- +
- + if (uiIcyTouchTimer <= uiDiff)
- {
- - case PHASE_UNDEAD:
- + DoCastVictim(DUNGEON_MODE(SPELL_ICY_TOUCH, SPELL_ICY_TOUCH_H));
- + uiIcyTouchTimer = urand(5000, 7000);
- + } else uiIcyTouchTimer -= uiDiff;
- + break;
- + }
- + case PHASE_SKELETON:
- + {
- + if (!bSummonArmy)
- + {
- + bSummonArmy = true;
- + me->AddUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED);
- + me->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE);
- + DoCast(me, SPELL_ARMY_DEAD);
- + }
- +
- + if (!bDeathArmyDone)
- + {
- + if (uiDeathArmyCheckTimer <= uiDiff)
- {
- - if (uiDeathRespiteTimer <= uiDiff)
- - {
- - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
- - {
- - if (target && target->IsAlive())
- - DoCast(target, SPELL_DEATH_RESPITE);
- - }
- - uiDeathRespiteTimer = urand(15000, 16000);
- - } else uiDeathRespiteTimer -= uiDiff;
- - break;
- + me->ClearUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED);
- + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- + uiDeathArmyCheckTimer = 0;
- + bDeathArmyDone = true;
- + } else uiDeathArmyCheckTimer -= uiDiff;
- + }
- +
- + if (uiDesecrationTimer <= uiDiff)
- + {
- + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
- + {
- + if (target->IsAlive())
- + DoCast(target, SPELL_DESECRATION);
- }
- - case PHASE_SKELETON:
- + uiDesecrationTimer = urand(15000,16000);
- + } else uiDesecrationTimer -= uiDiff;
- +
- + if (uiGhoulExplodeTimer <= uiDiff)
- + {
- + if (!SummonList.empty())
- {
- - if (!bSummonArmy)
- - {
- - bSummonArmy = true;
- - me->AddUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED);
- - DoCast(me, SPELL_ARMY_DEAD);
- - }
- - if (!bDeathArmyDone)
- - {
- - if (uiDeathArmyCheckTimer <= uiDiff)
- - {
- - me->ClearUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED);
- - uiDeathArmyCheckTimer = 0;
- - bDeathArmyDone = true;
- - } else uiDeathArmyCheckTimer -= uiDiff;
- - }
- - if (uiDesecration <= uiDiff)
- + for(GuidList::const_iterator itr = SummonList.begin(); itr != SummonList.end(); ++itr)
- {
- - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
- + if (Creature* temp = ObjectAccessor::GetCreature(*me, *itr))
- {
- - if (target && target->IsAlive())
- - DoCast(target, SPELL_DESECRATION);
- + if (temp)
- + {
- + // Let all remaining ghouls explode
- + if (temp->GetEntry() == 35590 || temp->GetEntry() == 12444)
- + {
- + if (temp->IsAlive())
- + {
- + me->CastSpell(temp, SPELL_GHOUL_EXPLODE, true);
- + break;
- + }
- + else
- + continue;
- + }
- + }
- }
- - uiDesecration = urand(15000, 16000);
- - } else uiDesecration -= uiDiff;
- - if (uiGhoulExplodeTimer <= uiDiff)
- - {
- - DoCast(me, SPELL_GHOUL_EXPLODE);
- - uiGhoulExplodeTimer = 8000;
- - } else uiGhoulExplodeTimer -= uiDiff;
- - break;
- + }
- }
- - break;
- - }
- +
- + uiGhoulExplodeTimer = 8000;
- + } else uiGhoulExplodeTimer -= uiDiff;
- +
- + if (uiPlagueStrike1Timer <= uiDiff)
- + {
- + DoCastVictim(SPELL_PLAGUE_STRIKE);
- + uiPlagueStrike1Timer = urand(12000, 15000);
- + } else uiPlagueStrike1Timer -= uiDiff;
- +
- + if (uiObliterate1Timer <= uiDiff)
- + {
- + DoCastVictim(SPELL_OBLITERATE);
- + uiObliterate1Timer = urand(17000, 19000);
- + } else uiObliterate1Timer -= uiDiff;
- +
- + if (uiIcyTouch1Timer <= uiDiff)
- + {
- + DoCastVictim(SPELL_ICY_TOUCH);
- + uiIcyTouch1Timer = urand(5000, 7000);
- + } else uiIcyTouch1Timer -= uiDiff;
- +
- + if (uiDeathRespiteTimer <= uiDiff)
- + {
- + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
- + {
- + if (target && target->IsAlive())
- + DoCast(target, SPELL_DEATH_RESPITE);
- + }
- + uiDeathRespiteTimer = urand(15000, 16000);
- + } else uiDeathRespiteTimer -= uiDiff;
- break;
- }
- +
- case PHASE_GHOST:
- {
- if (uiDeathBiteTimer <= uiDiff)
- {
- - DoCastAOE(SPELL_DEATH_BITE);
- - uiDeathBiteTimer = urand(2000, 4000);
- + SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE);
- + DoCast(me, DUNGEON_MODE(SPELL_DEATH_BITE, SPELL_DEATH_BITE_H));
- + uiDeathBiteTimer = urand (2000, 4000);
- } else uiDeathBiteTimer -= uiDiff;
- +
- if (uiMarkedDeathTimer <= uiDiff)
- {
- if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
- @@ -255,7 +467,7 @@ public:
- if (target && target->IsAlive())
- DoCast(target, SPELL_MARKED_DEATH);
- }
- - uiMarkedDeathTimer = urand(5000, 7000);
- + uiMarkedDeathTimer = urand (10000, 12000);
- } else uiMarkedDeathTimer -= uiDiff;
- break;
- }
- @@ -265,14 +477,52 @@ public:
- DoMeleeAttackIfReady();
- }
- - void DamageTaken(Unit* /*pDoneBy*/, uint32& uiDamage) override
- + void EnterCombat(Unit* /*who*/) override
- {
- - if (uiDamage > me->GetHealth() && uiPhase <= PHASE_SKELETON)
- + bEventInBattle = true;
- + Talk(SAY_AGGRO);
- +
- + SetEquipmentSlots(false, EQUIP_SWORD, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE);
- +
- + if (instance->GetData(DATA_TEAM_IN_INSTANCE) == HORDE)
- + {
- + DoCast(me, ZOMBIE_JAEREN);
- + if (Creature* garrosh = me->FindNearestCreature(NPC_GARROSH, 200.0f))
- + garrosh->AI()->Talk(SAY_AGGRO_OUTRO);
- + }
- + else
- + {
- + DoCast(me, ZOMBIE_ARELAS);
- + if (Creature* varian = me->FindNearestCreature(NPC_VARIAN, 200.0f))
- + varian->AI()->Talk(SAY_AGGRO_OUTRO);
- + }
- +
- + if (instance)
- {
- - uiDamage = 0;
- + if (GameObject* go = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(DATA_MAIN_GATE1)))
- + instance->HandleGameObject(go->GetGUID(), false);
- +
- + if (GameObject* go = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(DATA_MAIN_GATE)))
- + instance->HandleGameObject(go->GetGUID(), false);
- +
- + instance->SetData(BOSS_BLACK_KNIGHT, IN_PROGRESS);
- + }
- + }
- +
- + void KilledUnit(Unit* /*victim*/) override
- + {
- + Talk(SAY_KILLED_PLAYER);
- + }
- +
- + void DamageTaken(Unit* /*who*/, uint32& damage) override
- + {
- + if (damage >= me->GetHealth() && uiPhase <= PHASE_SKELETON)
- + {
- + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- + damage = 0;
- me->SetHealth(0);
- me->AddUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED);
- - summons.DespawnAll();
- + RemoveSummons();
- switch (uiPhase)
- {
- case PHASE_UNDEAD:
- @@ -280,24 +530,61 @@ public:
- break;
- case PHASE_SKELETON:
- me->SetDisplayId(MODEL_GHOST);
- + SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE);
- break;
- }
- bEventInProgress = true;
- }
- + else if (damage >= me->GetHealth() && uiPhase == PHASE_GHOST && !bCredit)
- + {
- + bCredit = true;
- + HandleSpellOnPlayersInInstanceToC5(me, 68663);
- + }
- + }
- +
- + uint32 GetData(uint32 type) const override
- + {
- + if (type == DATA_IVE_HAD_WORSE)
- + return iveHadWorse;
- +
- + return 0;
- + }
- +
- + void SetData(uint32 uiType, uint32 uiData) override
- + {
- + if (uiType == DATA_IVE_HAD_WORSE)
- + iveHadWorse = uiData;
- }
- void JustDied(Unit* /*killer*/) override
- {
- DoCast(me, SPELL_KILL_CREDIT);
- + Talk(SAY_DEATH);
- + if (TempSummon* summ = me->ToTempSummon())
- + summ->SetTempSummonType(TEMPSUMMON_DEAD_DESPAWN);
- +
- + if (instance)
- + {
- + instance->SetData(BOSS_BLACK_KNIGHT, DONE);
- +
- + instance->DoCastSpellOnPlayers(SPELL_KILL_CREDIT);
- - instance->SetData(BOSS_BLACK_KNIGHT, DONE);
- + // Instance encounter counting mechanics
- + //instance->UpdateEncounterState(ENCOUNTER_CREDIT_CAST_SPELL, 68663, me);
- +
- + if (GameObject* go = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(DATA_MAIN_GATE1)))
- + instance->HandleGameObject(go->GetGUID(), true);
- + }
- }
- + private:
- + EventMap _events;
- };
- - CreatureAI* GetAI(Creature* creature) const override
- + CreatureAI* GetAI(Creature* creature) const
- {
- - return GetInstanceAI<boss_black_knightAI>(creature);
- + return new boss_black_knightAI (creature);
- }
- +
- };
- class npc_risen_ghoul : public CreatureScript
- @@ -307,37 +594,91 @@ public:
- struct npc_risen_ghoulAI : public ScriptedAI
- {
- - npc_risen_ghoulAI(Creature* creature) : ScriptedAI(creature)
- + npc_risen_ghoulAI(Creature* creature) : ScriptedAI(creature) { }
- +
- + uint32 uiAttackTimer;
- + InstanceScript* instance;
- +
- + void Reset() override
- + {
- + uiAttackTimer = 3500;
- + }
- +
- + void UpdateAI(uint32 diff) override
- {
- - Initialize();
- + if (!UpdateVictim())
- + return;
- +
- + if (uiAttackTimer <= diff)
- + {
- + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true))
- + {
- + if (target && target->IsAlive())
- + DoCast(target, DUNGEON_MODE(SPELL_LEAP, SPELL_LEAP_H));
- + }
- + uiAttackTimer = 3500;
- + } else uiAttackTimer -= diff;
- +
- + DoMeleeAttackIfReady();
- }
- - void Initialize()
- + void SpellHitTarget(Unit* target, const SpellInfo* spell) override
- {
- - uiAttackTimer = 3500;
- + if (target->GetTypeId() == TYPEID_PLAYER && (spell->Id == GHOUL_EXPLODE_DAMAGE || spell->Id == H_GHOUL_EXPLODE_DAMAGE || spell->Id == SPELL_GHOUL_EXPLODE))
- + if (Creature* knight = me->FindNearestCreature(NPC_BLACK_KNIGHT, 200.0f))
- + knight->AI()->SetData(DATA_IVE_HAD_WORSE, false);
- }
- + };
- - uint32 uiAttackTimer;
- + CreatureAI* GetAI(Creature* creature) const override
- + {
- + return new npc_risen_ghoulAI(creature);
- + }
- +};
- +
- +class npc_risen_announcer : public CreatureScript
- +{
- +public:
- + npc_risen_announcer() : CreatureScript("npc_risen_announcer") { }
- +
- + struct npc_risen_announcerAI : public ScriptedAI
- + {
- + npc_risen_announcerAI(Creature* creature) : ScriptedAI(creature)
- + {
- + me->setFaction(14);
- + }
- +
- + uint32 uiLeapTimer;
- + uint32 uiClawTimer;
- void Reset() override
- {
- - Initialize();
- + uiLeapTimer = 10000;
- + uiClawTimer = 1000;
- }
- - void UpdateAI(uint32 uiDiff) override
- + void UpdateAI(uint32 diff) override
- {
- if (!UpdateVictim())
- return;
- - if (uiAttackTimer <= uiDiff)
- + if (uiLeapTimer <= diff)
- {
- if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true))
- {
- if (target && target->IsAlive())
- - DoCast(target, (SPELL_LEAP));
- + DoCast(target, DUNGEON_MODE(SPELL_LEAP, SPELL_LEAP_H));
- }
- - uiAttackTimer = 3500;
- - } else uiAttackTimer -= uiDiff;
- + uiLeapTimer = 10000;
- + } else uiLeapTimer -= diff;
- +
- + if (uiClawTimer <= diff)
- + {
- + DoCastVictim(DUNGEON_MODE(SPELL_CLAW, SPELL_CLAW_H));
- + uiClawTimer = 1000;
- + } else uiClawTimer -= diff;
- +
- +
- DoMeleeAttackIfReady();
- }
- @@ -345,7 +686,7 @@ public:
- CreatureAI* GetAI(Creature* creature) const override
- {
- - return new npc_risen_ghoulAI(creature);
- + return new npc_risen_announcerAI(creature);
- }
- };
- @@ -359,17 +700,61 @@ public:
- npc_black_knight_skeletal_gryphonAI(Creature* creature) : npc_escortAI(creature)
- {
- Start(false, true);
- + instance = creature->GetInstanceScript();
- + }
- +
- + Creature* pHighlord;
- + InstanceScript* instance;
- +
- + void Reset() override
- + {
- + pHighlord = NULL;
- }
- - void WaypointReached(uint32 /*waypointId*/) override { }
- + void WaypointReached(uint32 uiPointId) override
- + {
- + switch (uiPointId)
- + {
- + case 1:
- + me->SetSpeed(MOVE_FLIGHT, 2.0f);
- + break;
- + case 2:
- + me->SetSpeed(MOVE_FLIGHT, 2.0f);
- + if (Creature* blackknight = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_BLACK_KNIGHT)))
- + blackknight->AI()->Talk(SAY_INTRO_1);
- + break;
- + case 3:
- + case 4:
- + case 5:
- + me->SetSpeed(MOVE_FLIGHT, 2.0f);
- + break;
- + case 6:
- + me->SetSpeed(MOVE_FLIGHT, 2.0f);
- + if (Creature* tirion = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_HIGHLORD)))
- + tirion->AI()->Talk(SAY_INTRO_2);
- + break;
- + case 7:
- + case 8:
- + case 9:
- + me->SetSpeed(MOVE_FLIGHT, 2.0f);
- + break;
- + case 10:
- + me->SetUnitMovementFlags(MOVEMENTFLAG_WALKING);
- + me->SetSpeed(MOVE_RUN, 2.0f);
- + if (!me->FindNearestCreature(NPC_BLACK_KNIGHT, 200.0f))
- + if (Creature* announcer = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_ANNOUNCER)))
- + announcer->AI()->DoAction(ACTION_RESET_BLACK_KNIGHT);
- + break;
- + }
- + }
- void UpdateAI(uint32 uiDiff) override
- {
- npc_escortAI::UpdateAI(uiDiff);
- - UpdateVictim();
- + if (!UpdateVictim())
- + return;
- }
- -
- };
- CreatureAI* GetAI(Creature* creature) const override
- @@ -378,9 +763,29 @@ public:
- }
- };
- +class achievement_ive_had_worse : public AchievementCriteriaScript
- +{
- + public:
- + achievement_ive_had_worse() : AchievementCriteriaScript("TW_achievement_ive_had_worse") { }
- +
- + bool OnCheck(Player* /*player*/, Unit* target) override
- + {
- + if (!target)
- + return false;
- +
- + if (Creature* Knight = target->ToCreature())
- + if (Knight->AI()->GetData(DATA_IVE_HAD_WORSE) && Knight->GetMap()->ToInstanceMap()->IsHeroic())
- + return true;
- +
- + return false;
- + }
- +};
- +
- void AddSC_boss_black_knight()
- {
- new boss_black_knight();
- new npc_risen_ghoul();
- + new npc_risen_announcer();
- new npc_black_knight_skeletal_gryphon();
- -}
- + new achievement_ive_had_worse();
- +}
- \ No newline at end of file
- diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp
- index c375e5c..4cf5d8b 100644
- --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp
- +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp
- @@ -1,6 +1,5 @@
- /*
- * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/>
- - * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- @@ -16,15 +15,7 @@
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
- -/* ScriptData
- -SDName: boss_grand_champions
- -SD%Complete: 50 %
- -SDComment: Is missing the ai to make the npcs look for a new mount and use it.
- -SDCategory: Trial Of the Champion
- -EndScriptData */
- -
- -#include "ScriptMgr.h"
- -#include "ScriptedCreature.h"
- +#include "ScriptPCH.h"
- #include "ScriptedEscortAI.h"
- #include "Vehicle.h"
- #include "trial_of_the_champion.h"
- @@ -32,10 +23,22 @@ EndScriptData */
- enum Spells
- {
- - //Vehicle
- + // Defend
- + SPELL_DEFEND_2 = 66482,
- + SPELL_VISUAL_SHIELD_1 = 63130,
- + SPELL_VISUAL_SHIELD_2 = 63131,
- + SPELL_VISUAL_SHIELD_3 = 63132,
- +
- + // Shield break
- + SPELL_THROW_VISUAL = 45827,
- +
- + // Vehicle
- + SPELL_SHIELD_BREAKER = 62575,
- + SPELL_SHIELD = 62544,
- + SPELL_THRUST = 68505,
- + SPELL_SHIELD_1 = 66482,
- SPELL_CHARGE = 63010,
- - SPELL_SHIELD_BREAKER = 68504,
- - SPELL_SHIELD = 66482,
- + SPELL_DEFEND = 62719,
- // Marshal Jacob Alerius && Mokra the Skullcrusher || Warrior
- SPELL_MORTAL_STRIKE = 68783,
- @@ -60,11 +63,12 @@ enum Spells
- SPELL_HEALING_WAVE = 67528,
- SPELL_HEALING_WAVE_H = 68318,
- SPELL_HEX_OF_MENDING = 67534,
- + SPELL_HEX_OF_MENDING_HEAL = 67535,
- // Jaelyne Evensong && Zul'tore || Hunter
- SPELL_DISENGAGE = 68340, //not implemented in the AI yet...
- SPELL_LIGHTNING_ARROWS = 66083,
- - SPELL_MULTI_SHOT = 66081,
- + SPELL_MULTI_SHOT = 49047,
- SPELL_SHOOT = 65868,
- SPELL_SHOOT_H = 67988,
- @@ -72,35 +76,83 @@ enum Spells
- SPELL_EVISCERATE = 67709,
- SPELL_EVISCERATE_H = 68317,
- SPELL_FAN_OF_KNIVES = 67706,
- - SPELL_POISON_BOTTLE = 67701
- + SPELL_POISON_BOTTLE = 67701,
- +
- + // Achievement Credit
- + SPELL_GRAND_CHAMPIONS_CREDIT = 68572
- };
- -enum Seats
- +enum Talk
- +{
- + SAY_CHAMPION_DEFEAT = 0,
- + WARNING_WEAPONS = 1
- +};
- +
- +enum Seat
- {
- SEAT_ID_0 = 0
- };
- +enum Events
- +{
- + // Warrior
- + EVENT_BLADESTORM = 1,
- + EVENT_MORTAL_STRIKE = 2,
- +
- + // Mage
- + EVENT_FIREBALL = 3,
- + EVENT_BLASTWAVE = 4,
- + EVENT_HASTE = 5,
- + EVENT_POLYMORPH = 6,
- +
- + // Shaman
- + EVENT_EARTH_SHIELD = 7,
- + EVENT_CHAIN_LIGHTNING = 8,
- + EVENT_HEALING_WAVE = 9,
- + EVENT_HEX = 10,
- +
- + // Hunter
- + EVENT_SHOOT = 11,
- + EVENT_MULTI_SHOOT = 12,
- + EVENT_DISENGAGE = 13,
- + EVENT_LIGHTNING_ARROWS = 14,
- +
- + // Rogue
- + EVENT_EVISCERATE = 15,
- + EVENT_FAN_OF_KNIVES = 16,
- + EVENT_POISON_BOTTLE = 17,
- +
- + EVENT_PHASE_SWITCH
- +};
- +
- +enum Phases
- +{
- + PHASE_IDLE = 1,
- + PHASE_COMBAT = 2
- +};
- +
- /*
- struct Point
- {
- - float x, y, z;
- + float x,y,z;
- };
- const Point MovementPoint[] =
- {
- - {746.84f, 623.15f, 411.41f},
- - {747.96f, 620.29f, 411.09f},
- - {750.23f, 618.35f, 411.09f}
- + {746.84f,623.15f,411.41f},
- + {747.96f,620.29f,411.09f},
- + {750.23f,618.35f,411.09f}
- };
- */
- +
- void AggroAllPlayers(Creature* temp)
- {
- Map::PlayerList const &PlList = temp->GetMap()->GetPlayers();
- if (PlList.isEmpty())
- - return;
- + return;
- - for (Map::PlayerList::const_iterator i = PlList.begin(); i != PlList.end(); ++i)
- + for(Map::PlayerList::const_iterator i = PlList.begin(); i != PlList.end(); ++i)
- {
- if (Player* player = i->GetSource())
- {
- @@ -109,7 +161,7 @@ void AggroAllPlayers(Creature* temp)
- if (player->IsAlive())
- {
- - temp->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC);
- + temp->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC);
- temp->SetReactState(REACT_AGGRESSIVE);
- temp->SetInCombatWith(player);
- player->SetInCombatWith(temp);
- @@ -133,8 +185,11 @@ bool GrandChampionsOutVehicle(Creature* me)
- if (pGrandChampion1 && pGrandChampion2 && pGrandChampion3)
- {
- if (!pGrandChampion1->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT) &&
- + !pGrandChampion1->GetVehicle() &&
- !pGrandChampion2->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT) &&
- - !pGrandChampion3->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT))
- + !pGrandChampion2->GetVehicle() &&
- + !pGrandChampion3->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT) &&
- + !pGrandChampion3->GetVehicle())
- return true;
- }
- @@ -148,211 +203,362 @@ bool GrandChampionsOutVehicle(Creature* me)
- class generic_vehicleAI_toc5 : public CreatureScript
- {
- -public:
- - generic_vehicleAI_toc5() : CreatureScript("generic_vehicleAI_toc5") { }
- + public:
- + generic_vehicleAI_toc5(): CreatureScript("generic_vehicleAI_toc5") { }
- struct generic_vehicleAI_toc5AI : public npc_escortAI
- {
- generic_vehicleAI_toc5AI(Creature* creature) : npc_escortAI(creature)
- {
- - Initialize();
- + hasBeenInCombat = false;
- SetDespawnAtEnd(false);
- uiWaypointPath = 0;
- -
- + uiCheckTimer = 5000;
- instance = creature->GetInstanceScript();
- }
- - void Initialize()
- - {
- - uiChargeTimer = 5000;
- - uiShieldBreakerTimer = 8000;
- - uiBuffTimer = urand(30000, 60000);
- - }
- -
- InstanceScript* instance;
- - uint32 uiChargeTimer;
- + bool hasBeenInCombat;
- + bool combatEntered;
- +
- + uint32 combatCheckTimer;
- uint32 uiShieldBreakerTimer;
- + uint32 uiTimerSpell1;
- + uint32 uiTimerSpell2;
- + uint32 uiTimerSpell3;
- uint32 uiBuffTimer;
- -
- + uint32 uiCheckTimer;
- + uint32 uiDefendTimer;
- + uint32 uiChargeTimer;
- + uint32 uiThrustTimer;
- uint32 uiWaypointPath;
- void Reset() override
- {
- - Initialize();
- + combatCheckTimer = 500;
- + uiShieldBreakerTimer = 8000;
- + uiBuffTimer = urand(30000,60000);
- + uiTimerSpell1= urand(4000,10000);
- + uiTimerSpell2= urand(4000,10000);
- + uiTimerSpell3= urand(1000,2000);
- + uiDefendTimer = urand(30000, 60000);
- }
- - void SetData(uint32 uiType, uint32 /*uiData*/) override
- + void SetData(uint32 uiType, uint32 /*uiData8*/) override
- {
- - switch (uiType)
- + switch(uiType)
- {
- case 1:
- - AddWaypoint(0, 747.36f, 634.07f, 411.572f);
- - AddWaypoint(1, 780.43f, 607.15f, 411.82f);
- - AddWaypoint(2, 785.99f, 599.41f, 411.92f);
- - AddWaypoint(3, 778.44f, 601.64f, 411.79f);
- + AddWaypoint(0, 746.45f, 647.03f, 411.57f);
- + AddWaypoint(1, 771.434f, 642.606f, 411.9f);
- + AddWaypoint(2, 779.807f, 617.535f, 411.716f);
- + AddWaypoint(3, 771.098f, 594.635f, 411.625f);
- + AddWaypoint(4, 746.887f, 583.425f, 411.668f);
- + AddWaypoint(5, 715.176f, 583.782f, 412.394f);
- + AddWaypoint(6, 720.719f, 591.141f, 411.737f);
- uiWaypointPath = 1;
- break;
- case 2:
- - AddWaypoint(0, 747.35f, 634.07f, 411.57f);
- - AddWaypoint(1, 768.72f, 581.01f, 411.92f);
- - AddWaypoint(2, 763.55f, 590.52f, 411.71f);
- + AddWaypoint(0, 746.45f, 647.03f, 411.57f);
- + AddWaypoint(1, 771.434f, 642.606f, 411.9f);
- + AddWaypoint(2, 779.807f, 617.535f, 411.716f);
- + AddWaypoint(3, 771.098f, 594.635f, 411.625f);
- + AddWaypoint(4, 746.887f, 583.425f, 411.668f);
- + AddWaypoint(5, 746.16f, 571.678f, 412.389f);
- + AddWaypoint(6, 746.887f, 583.425f, 411.668f);
- uiWaypointPath = 2;
- break;
- case 3:
- - AddWaypoint(0, 747.35f, 634.07f, 411.57f);
- - AddWaypoint(1, 784.02f, 645.33f, 412.39f);
- - AddWaypoint(2, 775.67f, 641.91f, 411.91f);
- + AddWaypoint(0, 746.45f, 647.03f, 411.57f);
- + AddWaypoint(1, 771.434f, 642.606f, 411.9f);
- + AddWaypoint(2, 779.807f, 617.535f, 411.716f);
- + AddWaypoint(3, 771.098f, 594.635f, 411.625f);
- + AddWaypoint(4, 777.759f, 584.577f, 412.393f);
- + AddWaypoint(5, 772.48f, 592.99f, 411.68f);
- uiWaypointPath = 3;
- break;
- + case 4:
- + combatEntered = true;
- + break;
- }
- if (uiType <= 3)
- Start(false, true);
- }
- - void WaypointReached(uint32 waypointId) override
- + void WaypointReached(uint32 i) override
- {
- - switch (waypointId)
- + if (!instance)
- + return;
- +
- + switch(i)
- {
- case 2:
- if (uiWaypointPath == 3 || uiWaypointPath == 2)
- instance->SetData(DATA_MOVEMENT_DONE, instance->GetData(DATA_MOVEMENT_DONE)+1);
- break;
- case 3:
- - instance->SetData(DATA_MOVEMENT_DONE, instance->GetData(DATA_MOVEMENT_DONE)+1);
- + instance->SetData(DATA_MOVEMENT_DONE, instance->GetData(DATA_MOVEMENT_DONE)+1);
- break;
- }
- }
- void EnterCombat(Unit* /*who*/) override
- {
- - DoCastSpellShield();
- + hasBeenInCombat = true;
- + DoCastSpellDefend();
- }
- - void DoCastSpellShield()
- + void DoCastSpellDefend()
- {
- - for (uint8 i = 0; i < 3; ++i)
- - DoCast(me, SPELL_SHIELD, true);
- + for(uint8 i = 0; i < 3; ++i)
- + DoCast(me, SPELL_DEFEND, true);
- }
- - void UpdateAI(uint32 uiDiff) override
- + void SpellHit(Unit* source, const SpellInfo* spell) override
- {
- - npc_escortAI::UpdateAI(uiDiff);
- - if (!UpdateVictim())
- - return;
- + uint32 defendAuraStackAmount = 0;
- +
- + if (me->HasAura(SPELL_DEFEND))
- + if (Aura* defendAura = me->GetAura(SPELL_DEFEND))
- + defendAuraStackAmount = defendAura->GetStackAmount();
- +
- + // Shield-Break by player vehicle
- + if (spell->Id == 62575)
- + {
- + source->DealDamage(me, uint32(2000 * (1 - 0.3f * defendAuraStackAmount)));
- + source->SendSpellNonMeleeDamageLog(me, 62575, uint32(2000 * (1 - 0.3f * defendAuraStackAmount)), SPELL_SCHOOL_MASK_NORMAL, 0, 0, true, 0, false);
- - if (uiBuffTimer <= uiDiff)
- + if (me->HasAura(SPELL_DEFEND))
- + me->RemoveAuraFromStack(SPELL_DEFEND);
- + }
- +
- + // Charge by player vehicle
- + if (spell->Id == 68282)
- {
- - if (!me->HasAura(SPELL_SHIELD))
- - DoCastSpellShield();
- + source->DealDamage(me, uint32(20000 * (1 - 0.3f * defendAuraStackAmount)));
- + source->SendSpellNonMeleeDamageLog(me, 68282, uint32(20000 * (1 - 0.3f * defendAuraStackAmount)), SPELL_SCHOOL_MASK_NORMAL, 0, 0, true, 0, false);
- - uiBuffTimer = urand(30000, 45000);
- - }else uiBuffTimer -= uiDiff;
- + if (source->GetMotionMaster())
- + source->GetMotionMaster()->MoveCharge(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ());
- - if (uiChargeTimer <= uiDiff)
- + if (me->HasAura(SPELL_DEFEND))
- + me->RemoveAuraFromStack(SPELL_DEFEND);
- + }
- + }
- +
- + bool StayInCombatAndCleanup(bool combat, bool cleanup)
- + {
- + if (me->GetMap())
- {
- Map::PlayerList const& players = me->GetMap()->GetPlayers();
- + bool foundtarget = false;
- +
- if (me->GetMap()->IsDungeon() && !players.isEmpty())
- {
- for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
- {
- Player* player = itr->GetSource();
- - if (player && !player->IsGameMaster() && me->IsInRange(player, 8.0f, 25.0f, false))
- + if (player && !player->IsGameMaster() && player->IsAlive())
- {
- - DoResetThreat();
- - me->AddThreat(player, 1.0f);
- - DoCast(player, SPELL_CHARGE);
- - break;
- + // Handle combat variable
- + if (combat)
- + {
- + if (combatEntered)
- + {
- + me->SetInCombatWith(player);
- + player->SetInCombatWith(me);
- + me->AddThreat(player, 0.0f);
- +
- + foundtarget = true;
- +
- + if (Vehicle* pVehicle = player->GetVehicle()) // If no mounted player is found, first encounter bugs. This might cause it, needs further tests
- + {
- + if (Unit* vehicleCreature = pVehicle->GetBase())
- + {
- + me->SetInCombatWith(vehicleCreature);
- + vehicleCreature->SetInCombatWith(me);
- + me->AddThreat(vehicleCreature, 0.0f);
- + }
- + }
- + }
- + }
- +
- + // Handle cleanup variable
- + if (cleanup)
- + if (player->HasAura(SPELL_DEFEND))
- + player->RemoveAurasDueToSpell(SPELL_DEFEND);
- }
- }
- }
- - uiChargeTimer = 5000;
- - }else uiChargeTimer -= uiDiff;
- - //dosen't work at all
- + if (combatEntered && combat && !foundtarget)
- + {
- + me->SetFullHealth();
- + return false;
- + }
- + }
- +
- + return true;
- + }
- +
- + void EnterEvadeMode() override
- + {
- + // Try to stay in combat, otherwise reset
- + if (!StayInCombatAndCleanup(true, false))
- + ScriptedAI::EnterEvadeMode();
- + }
- +
- + bool CheckPlayersAlive()
- + {
- + Map* pMap = me->GetMap();
- + if (pMap && pMap->IsDungeon())
- + {
- + Map::PlayerList const &players = pMap->GetPlayers();
- + for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
- + {
- + if (itr->GetSource() && itr->GetSource()->IsAlive() && !itr->GetSource()->IsGameMaster())
- + return true;
- + }
- + }
- + return false;
- + }
- +
- + void DoCastSpellShield()
- + {
- + for(uint8 i = 0; i < 3; ++i)
- + DoCast(me,SPELL_SHIELD,true);
- + }
- +
- + void UpdateAI(uint32 uiDiff) override
- + {
- + // Try to keep players clean of defend aura
- + if (combatEntered)
- + {
- + if (combatCheckTimer <= uiDiff)
- + {
- + StayInCombatAndCleanup(false, true);
- + combatCheckTimer = 1000;
- + } else combatCheckTimer -= uiDiff;
- + }
- +
- + npc_escortAI::UpdateAI(uiDiff);
- +
- + if (!UpdateVictim())
- + return;
- +
- + if (uiDefendTimer <= uiDiff)
- + {
- + DoCastSpellDefend();
- + uiDefendTimer = urand(30000, 45000);
- + } else uiDefendTimer -= uiDiff;
- +
- if (uiShieldBreakerTimer <= uiDiff)
- {
- - Vehicle* pVehicle = me->GetVehicleKit();
- - if (!pVehicle)
- - return;
- + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
- + {
- + if (target->GetTypeId() == TYPEID_PLAYER && me->GetDistance(target) > 10.0f && me->GetDistance(target) < 30.0f)
- + {
- + if (target->GetVehicle())
- + {
- + if (Unit* vehTarget = target->GetVehicle()->GetBase())
- + {
- + DoCast(vehTarget, SPELL_SHIELD_BREAKER);
- + vehTarget->RemoveAuraFromStack(SPELL_DEFEND);
- + }
- + }
- + }
- + else if (target->GetTypeId() == TYPEID_UNIT && me->GetDistance(target) > 8.0f && me->GetDistance(target) < 25.0f)
- + {
- + DoCast(target, SPELL_SHIELD_BREAKER);
- + target->RemoveAuraFromStack(SPELL_DEFEND);
- + }
- + }
- +
- + uiShieldBreakerTimer = urand(15000, 20000);
- + } else uiShieldBreakerTimer -= uiDiff;
- - if (Unit* pPassenger = pVehicle->GetPassenger(SEAT_ID_0))
- + if (uiChargeTimer <= uiDiff)
- + {
- + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
- {
- - Map::PlayerList const& players = me->GetMap()->GetPlayers();
- - if (me->GetMap()->IsDungeon() && !players.isEmpty())
- + if (target->GetTypeId() == TYPEID_PLAYER && me->GetDistance(target) > 8.0f && me->GetDistance(target) < 25.0f)
- {
- - for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
- + if (target->GetVehicle())
- {
- - Player* player = itr->GetSource();
- - if (player && !player->IsGameMaster() && me->IsInRange(player, 10.0f, 30.0f, false))
- + if (Unit* vehTarget = target->GetVehicle()->GetBase())
- {
- - pPassenger->CastSpell(player, SPELL_SHIELD_BREAKER, true);
- - break;
- + DoCast(vehTarget, SPELL_CHARGE);
- +
- + if (vehTarget->HasAura(SPELL_DEFEND))
- + vehTarget->RemoveAuraFromStack(SPELL_DEFEND);
- }
- }
- }
- + else if (target->GetTypeId() == TYPEID_UNIT && me->GetDistance(target) > 8.0f && me->GetDistance(target) < 25.0f)
- + {
- + DoCast(target, SPELL_CHARGE);
- +
- + if (target->HasAura(SPELL_DEFEND))
- + target->RemoveAuraFromStack(SPELL_DEFEND);
- + }
- }
- - uiShieldBreakerTimer = 7000;
- - }else uiShieldBreakerTimer -= uiDiff;
- +
- + uiChargeTimer = urand(10000, 30000);
- + } else uiChargeTimer -= uiDiff;
- +
- + if (uiThrustTimer <= uiDiff)
- + {
- + if (me->GetVictim() && me->GetDistance(me->GetVictim()) < 5.0f)
- + DoCast(me->GetVictim(), SPELL_THRUST);
- +
- + uiThrustTimer = urand(8000, 14000);
- + } else uiThrustTimer -= uiDiff;
- DoMeleeAttackIfReady();
- }
- };
- - CreatureAI* GetAI(Creature* creature) const override
- + CreatureAI* GetAI(Creature* creature) const
- {
- - return GetInstanceAI<generic_vehicleAI_toc5AI>(creature);
- + return new generic_vehicleAI_toc5AI(creature);
- }
- };
- +// Marshal Jacob Alerius && Mokra the Skullcrusher || Warrior
- class boss_warrior_toc5 : public CreatureScript
- {
- -public:
- - boss_warrior_toc5() : CreatureScript("boss_warrior_toc5") { }
- + public:
- + boss_warrior_toc5(): CreatureScript("boss_warrior_toc5") {}
- - // Marshal Jacob Alerius && Mokra the Skullcrusher || Warrior
- - struct boss_warrior_toc5AI : public ScriptedAI
- + struct boss_warrior_toc5AI : public BossAI
- {
- - boss_warrior_toc5AI(Creature* creature) : ScriptedAI(creature)
- + boss_warrior_toc5AI(Creature* creature) : BossAI(creature, BOSS_GRAND_CHAMPIONS)
- {
- - Initialize();
- instance = creature->GetInstanceScript();
- bDone = false;
- bHome = false;
- -
- - uiPhase = 0;
- - uiPhaseTimer = 0;
- -
- - me->SetReactState(REACT_PASSIVE);
- - // THIS IS A HACK, SHOULD BE REMOVED WHEN THE EVENT IS FULL SCRIPTED
- - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC);
- - }
- -
- - void Initialize()
- - {
- - uiBladeStormTimer = urand(15000, 20000);
- - uiInterceptTimer = 7000;
- - uiMortalStrikeTimer = urand(8000, 12000);
- + bCredit = false;
- + hasBeenInCombat = false;
- }
- InstanceScript* instance;
- - uint8 uiPhase;
- - uint32 uiPhaseTimer;
- -
- - uint32 uiBladeStormTimer;
- uint32 uiInterceptTimer;
- - uint32 uiMortalStrikeTimer;
- bool bDone;
- bool bHome;
- + bool bCredit;
- + bool hasBeenInCombat;
- void Reset() override
- {
- - Initialize();
- + uiInterceptTimer = 7000;
- + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- + events.SetPhase(PHASE_IDLE);
- }
- void JustReachedHome() override
- @@ -362,47 +568,54 @@ public:
- if (!bHome)
- return;
- - uiPhaseTimer = 15000;
- - uiPhase = 1;
- + events.ScheduleEvent(EVENT_PHASE_SWITCH, 15000, 0, PHASE_IDLE);
- bHome = false;
- }
- + void EnterCombat(Unit* /*who*/) override
- + {
- + _EnterCombat();
- + hasBeenInCombat = true;
- + events.ScheduleEvent(EVENT_BLADESTORM, urand(15000, 25000), 0, PHASE_COMBAT);
- + events.ScheduleEvent(EVENT_MORTAL_STRIKE, urand(8000,12000), 0, PHASE_COMBAT);
- + events.SetPhase(PHASE_COMBAT);
- + }
- +
- void UpdateAI(uint32 uiDiff) override
- {
- + if (!me->GetVehicle())
- + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- +
- + if (!UpdateVictim())
- + return;
- +
- + events.Update(uiDiff);
- +
- if (!bDone && GrandChampionsOutVehicle(me))
- {
- bDone = true;
- + Talk(WARNING_WEAPONS);
- + me->RemoveAura(64723); // [DND] ReadyJoust Pose Effect
- - if (me->GetGUID() == instance->GetGuidData(DATA_GRAND_CHAMPION_1))
- - me->SetHomePosition(739.678f, 662.541f, 412.393f, 4.49f);
- - else if (me->GetGUID() == instance->GetGuidData(DATA_GRAND_CHAMPION_2))
- - me->SetHomePosition(746.71f, 661.02f, 411.69f, 4.6f);
- - else if (me->GetGUID() == instance->GetGuidData(DATA_GRAND_CHAMPION_3))
- - me->SetHomePosition(754.34f, 660.70f, 412.39f, 4.79f);
- + if (instance && me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_1))
- + me->SetHomePosition(739.678f, 662.541f, 413.395f, 4.49f);
- + else if (instance && me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_2))
- + me->SetHomePosition(746.71f, 661.02f, 412.695f, 4.6f);
- + else if (instance && me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_3))
- + me->SetHomePosition(754.34f, 660.70f, 413.395f, 4.79f);
- + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- EnterEvadeMode();
- bHome = true;
- }
- - if (uiPhaseTimer <= uiDiff)
- - {
- - if (uiPhase == 1)
- - {
- - AggroAllPlayers(me);
- - uiPhase = 0;
- - }
- - }else uiPhaseTimer -= uiDiff;
- -
- - if (!UpdateVictim() || me->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT))
- - return;
- -
- - if (uiInterceptTimer <= uiDiff)
- + if (uiInterceptTimer <= uiDiff && events.GetPhaseMask() == PHASE_COMBAT)
- {
- Map::PlayerList const& players = me->GetMap()->GetPlayers();
- if (me->GetMap()->IsDungeon() && !players.isEmpty())
- {
- - for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
- + for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
- {
- Player* player = itr->GetSource();
- if (player && !player->IsGameMaster() && me->IsInRange(player, 8.0f, 25.0f, false))
- @@ -417,81 +630,102 @@ public:
- uiInterceptTimer = 7000;
- } else uiInterceptTimer -= uiDiff;
- - if (uiBladeStormTimer <= uiDiff)
- + while (uint32 eventID = events.ExecuteEvent())
- {
- - DoCastVictim(SPELL_BLADESTORM);
- - uiBladeStormTimer = urand(15000, 20000);
- - } else uiBladeStormTimer -= uiDiff;
- + switch (eventID)
- + {
- + case EVENT_BLADESTORM:
- + DoCastVictim(SPELL_BLADESTORM);
- + events.ScheduleEvent(EVENT_BLADESTORM, urand(15000, 25000), 0, PHASE_COMBAT);
- + break;
- + case EVENT_MORTAL_STRIKE:
- + DoCastVictim(SPELL_MORTAL_STRIKE);
- + events.ScheduleEvent(EVENT_MORTAL_STRIKE, urand(8000,12000), 0, PHASE_COMBAT);
- + break;
- + case EVENT_PHASE_SWITCH:
- + if (events.GetPhaseMask() == PHASE_IDLE)
- + {
- + AggroAllPlayers(me);
- + events.SetPhase(PHASE_COMBAT);
- + }
- + break;
- + }
- + }
- +
- + if (events.GetPhaseMask() == PHASE_COMBAT)
- + DoMeleeAttackIfReady();
- + }
- - if (uiMortalStrikeTimer <= uiDiff)
- + void DamageTaken(Unit* /*who*/, uint32& damage) override
- + {
- + if (damage >= me->GetHealth())
- {
- - DoCastVictim(SPELL_MORTAL_STRIKE);
- - uiMortalStrikeTimer = urand(8000, 12000);
- - } else uiMortalStrikeTimer -= uiDiff;
- + damage = 0;
- + hasBeenInCombat = false;
- + Talk(SAY_CHAMPION_DEFEAT);
- - DoMeleeAttackIfReady();
- + if (instance)
- + instance->SetData(BOSS_GRAND_CHAMPIONS, DONE);
- +
- + // Instance encounter counting mechanics
- + if (!bCredit)
- + {
- + bCredit = true;
- + HandleSpellOnPlayersInInstanceToC5(me, SPELL_GRAND_CHAMPIONS_CREDIT);
- + }
- +
- + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- + me->setFaction(35);
- + me->GetMotionMaster()->MovePoint(0,746.843f, 695.68f, 412.339f);
- + HandleKillCreditForAllPlayers(me);
- + HandleInstanceBind(me);
- + }
- }
- - void JustDied(Unit* /*killer*/) override
- + void JustDied(Unit* /*killer*/)
- {
- - instance->SetData(BOSS_GRAND_CHAMPIONS, DONE);
- + if (instance)
- + instance->SetData(BOSS_GRAND_CHAMPIONS, DONE);
- }
- };
- - CreatureAI* GetAI(Creature* creature) const override
- + CreatureAI* GetAI(Creature* creature) const
- {
- - return GetInstanceAI<boss_warrior_toc5AI>(creature);
- + return new boss_warrior_toc5AI(creature);
- }
- };
- +// Ambrose Boltspark && Eressea Dawnsinger || Mage
- class boss_mage_toc5 : public CreatureScript
- {
- -public:
- - boss_mage_toc5() : CreatureScript("boss_mage_toc5") { }
- + public:
- + boss_mage_toc5(): CreatureScript("boss_mage_toc5") {}
- - // Ambrose Boltspark && Eressea Dawnsinger || Mage
- - struct boss_mage_toc5AI : public ScriptedAI
- + struct boss_mage_toc5AI : public BossAI
- {
- - boss_mage_toc5AI(Creature* creature) : ScriptedAI(creature)
- + boss_mage_toc5AI(Creature* creature) : BossAI(creature, BOSS_GRAND_CHAMPIONS)
- {
- - Initialize();
- instance = creature->GetInstanceScript();
- bDone = false;
- bHome = false;
- + bCredit = false;
- - uiPhase = 0;
- - uiPhaseTimer = 0;
- + hasBeenInCombat = false;
- - me->SetReactState(REACT_PASSIVE);
- - // THIS IS A HACK, SHOULD BE REMOVED WHEN THE EVENT IS FULL SCRIPTED
- - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC);
- - }
- -
- - void Initialize()
- - {
- - uiFireBallTimer = 5000;
- - uiPolymorphTimer = 8000;
- - uiBlastWaveTimer = 12000;
- - uiHasteTimer = 22000;
- + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- }
- InstanceScript* instance;
- - uint8 uiPhase;
- - uint32 uiPhaseTimer;
- -
- - uint32 uiFireBallTimer;
- - uint32 uiBlastWaveTimer;
- - uint32 uiHasteTimer;
- - uint32 uiPolymorphTimer;
- -
- bool bDone;
- bool bHome;
- + bool hasBeenInCombat;
- + bool bCredit;
- void Reset() override
- {
- - Initialize();
- + events.SetPhase(PHASE_IDLE);
- }
- void JustReachedHome() override
- @@ -501,146 +735,167 @@ public:
- if (!bHome)
- return;
- - uiPhaseTimer = 15000;
- - uiPhase = 1;
- + events.ScheduleEvent(EVENT_PHASE_SWITCH, 15000, 0, PHASE_IDLE);
- bHome = false;
- }
- + void EnterCombat(Unit* /*who*/) override
- + {
- + _EnterCombat();
- + hasBeenInCombat = true;
- + events.ScheduleEvent(EVENT_FIREBALL, 5000, 0, PHASE_COMBAT);
- + events.ScheduleEvent(EVENT_POLYMORPH, 8000, 0, PHASE_COMBAT);
- + events.ScheduleEvent(EVENT_BLASTWAVE, 12000, 0, PHASE_COMBAT);
- + events.ScheduleEvent(EVENT_HASTE, 22000, 0, PHASE_COMBAT);
- + events.SetPhase(PHASE_COMBAT);
- + }
- +
- void UpdateAI(uint32 uiDiff) override
- {
- + if (!me->GetVehicle())
- + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- +
- if (!bDone && GrandChampionsOutVehicle(me))
- {
- bDone = true;
- + me->RemoveAura(64723); // [DND] ReadyJoust Pose Effect
- - if (me->GetGUID() == instance->GetGuidData(DATA_GRAND_CHAMPION_1))
- - me->SetHomePosition(739.678f, 662.541f, 412.393f, 4.49f);
- - else if (me->GetGUID() == instance->GetGuidData(DATA_GRAND_CHAMPION_2))
- - me->SetHomePosition(746.71f, 661.02f, 411.69f, 4.6f);
- - else if (me->GetGUID() == instance->GetGuidData(DATA_GRAND_CHAMPION_3))
- - me->SetHomePosition(754.34f, 660.70f, 412.39f, 4.79f);
- + if (instance && me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_1))
- + me->SetHomePosition(739.678f, 662.541f, 413.395f, 4.49f);
- + else if (instance && me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_2))
- + me->SetHomePosition(746.71f, 661.02f, 412.695f, 4.6f);
- + else if (instance && me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_3))
- + me->SetHomePosition(754.34f, 660.70f, 413.395f, 4.79f);
- - instance->SetData(BOSS_GRAND_CHAMPIONS, IN_PROGRESS);
- + if (instance)
- + instance->SetData(BOSS_GRAND_CHAMPIONS, IN_PROGRESS);
- +
- + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- EnterEvadeMode();
- bHome = true;
- }
- - if (uiPhaseTimer <= uiDiff)
- - {
- - if (uiPhase == 1)
- - {
- - AggroAllPlayers(me);
- - uiPhase = 0;
- - }
- - }else uiPhaseTimer -= uiDiff;
- -
- - if (uiFireBallTimer <= uiDiff)
- - {
- - if (me->GetVictim())
- - DoCastVictim(SPELL_FIREBALL);
- - uiFireBallTimer = 5000;
- - } else uiFireBallTimer -= uiDiff;
- -
- - if (!UpdateVictim() || me->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT))
- + if (!UpdateVictim() || me->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT) || me->GetVehicle())
- return;
- - if (uiFireBallTimer <= uiDiff)
- - {
- - DoCastVictim(SPELL_FIREBALL);
- - uiFireBallTimer = 5000;
- - } else uiFireBallTimer -= uiDiff;
- -
- - if (uiPolymorphTimer <= uiDiff)
- - {
- - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
- - DoCast(target, SPELL_POLYMORPH);
- - uiPolymorphTimer = 8000;
- - } else uiPolymorphTimer -= uiDiff;
- + events.Update(uiDiff);
- - if (uiBlastWaveTimer <= uiDiff)
- + while (uint32 eventID = events.ExecuteEvent())
- {
- - DoCastAOE(SPELL_BLAST_WAVE, false);
- - uiBlastWaveTimer = 13000;
- - } else uiBlastWaveTimer -= uiDiff;
- + switch (eventID)
- + {
- + case EVENT_FIREBALL:
- + DoCastVictim(DUNGEON_MODE(SPELL_FIREBALL,SPELL_FIREBALL_H));
- + events.ScheduleEvent(EVENT_FIREBALL, 17000, 0, PHASE_COMBAT);
- + break;
- + case EVENT_POLYMORPH:
- + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM,0))
- + DoCast(target, DUNGEON_MODE(SPELL_POLYMORPH,SPELL_POLYMORPH_H));
- + events.ScheduleEvent(EVENT_POLYMORPH, 22000, 0, PHASE_COMBAT);
- + break;
- + case EVENT_BLASTWAVE:
- + DoCastAOE(DUNGEON_MODE(SPELL_BLAST_WAVE,SPELL_BLAST_WAVE_H),false);
- + events.ScheduleEvent(EVENT_BLADESTORM, 30000, 0, PHASE_COMBAT);
- + break;
- + case EVENT_HASTE:
- + me->InterruptNonMeleeSpells(true);
- + DoCast(me,SPELL_HASTE);
- + events.ScheduleEvent(EVENT_HASTE, 40000, 0, PHASE_COMBAT);
- + break;
- + case EVENT_PHASE_SWITCH:
- + if (events.GetPhaseMask() == PHASE_IDLE)
- + {
- + AggroAllPlayers(me);
- + events.SetPhase(PHASE_COMBAT);
- + }
- + break;
- + }
- + }
- + if (events.GetPhaseMask() == PHASE_COMBAT)
- + DoMeleeAttackIfReady();
- + }
- - if (uiHasteTimer <= uiDiff)
- + void DamageTaken(Unit* /*who*/, uint32& damage) override
- + {
- + if (damage >= me->GetHealth())
- {
- - me->InterruptNonMeleeSpells(true);
- + damage = 0;
- + hasBeenInCombat = false;
- + Talk(SAY_CHAMPION_DEFEAT);
- - DoCast(me, SPELL_HASTE);
- - uiHasteTimer = 22000;
- - } else uiHasteTimer -= uiDiff;
- + if (instance)
- + instance->SetData(BOSS_GRAND_CHAMPIONS, DONE);
- - DoMeleeAttackIfReady();
- - }
- -
- - void JustDied(Unit* /*killer*/) override
- - {
- - instance->SetData(BOSS_GRAND_CHAMPIONS, DONE);
- + // Instance encounter counting mechanics
- + if (!bCredit)
- + {
- + bCredit = true;
- + HandleSpellOnPlayersInInstanceToC5(me, SPELL_GRAND_CHAMPIONS_CREDIT);
- + }
- + me->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE);
- + me->setFaction(35);
- + me->GetMotionMaster()->MovePoint(0,746.843f, 695.68f, 412.339f);
- + HandleKillCreditForAllPlayers(me);
- + HandleInstanceBind(me);
- + }
- }
- };
- - CreatureAI* GetAI(Creature* creature) const override
- + CreatureAI* GetAI(Creature* creature) const
- {
- - return GetInstanceAI<boss_mage_toc5AI>(creature);
- - }
- + return new boss_mage_toc5AI(creature);
- + };
- };
- +// Colosos && Runok Wildmane || Shaman
- class boss_shaman_toc5 : public CreatureScript
- {
- -public:
- - boss_shaman_toc5() : CreatureScript("boss_shaman_toc5") { }
- + public:
- + boss_shaman_toc5(): CreatureScript("boss_shaman_toc5") {}
- - // Colosos && Runok Wildmane || Shaman
- - struct boss_shaman_toc5AI : public ScriptedAI
- + struct boss_shaman_toc5AI : public BossAI
- {
- - boss_shaman_toc5AI(Creature* creature) : ScriptedAI(creature)
- + boss_shaman_toc5AI(Creature* creature) : BossAI(creature, BOSS_GRAND_CHAMPIONS)
- {
- - Initialize();
- instance = creature->GetInstanceScript();
- bDone = false;
- bHome = false;
- + bCredit = false;
- + hasBeenInCombat = false;
- - uiPhase = 0;
- - uiPhaseTimer = 0;
- -
- - me->SetReactState(REACT_PASSIVE);
- - // THIS IS A HACK, SHOULD BE REMOVED WHEN THE EVENT IS FULL SCRIPTED
- - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC);
- - }
- -
- - void Initialize()
- - {
- - uiChainLightningTimer = 16000;
- - uiHealingWaveTimer = 12000;
- - uiEartShieldTimer = urand(30000, 35000);
- - uiHexMendingTimer = urand(20000, 25000);
- + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- }
- InstanceScript* instance;
- - uint8 uiPhase;
- - uint32 uiPhaseTimer;
- -
- - uint32 uiChainLightningTimer;
- - uint32 uiEartShieldTimer;
- - uint32 uiHealingWaveTimer;
- - uint32 uiHexMendingTimer;
- -
- bool bDone;
- bool bHome;
- + bool hasBeenInCombat;
- + bool bCredit;
- + bool bChance;
- void Reset() override
- {
- - Initialize();
- + events.SetPhase(PHASE_IDLE);
- }
- void EnterCombat(Unit* who) override
- {
- - DoCast(me, SPELL_EARTH_SHIELD);
- - DoCast(who, SPELL_HEX_OF_MENDING);
- + _EnterCombat();
- + hasBeenInCombat = true;
- + if (!me->GetVehicle())
- + {
- + DoCast(me, SPELL_EARTH_SHIELD);
- + DoCast(who, SPELL_HEX_OF_MENDING);
- + }
- + events.ScheduleEvent(EVENT_CHAIN_LIGHTNING, 16000, 0, PHASE_COMBAT);
- + events.ScheduleEvent(EVENT_HEALING_WAVE, 12000, 0, PHASE_COMBAT);
- + events.ScheduleEvent(EVENT_EARTH_SHIELD, urand(30000, 35000), 0, PHASE_COMBAT);
- + events.ScheduleEvent(EVENT_HEX, urand(20000, 25000), 0, PHASE_COMBAT);
- + events.SetPhase(PHASE_COMBAT);
- };
- void JustReachedHome() override
- @@ -650,147 +905,174 @@ public:
- if (!bHome)
- return;
- - uiPhaseTimer = 15000;
- - uiPhase = 1;
- + events.ScheduleEvent(EVENT_PHASE_SWITCH, 15000, 0, PHASE_IDLE);
- bHome = false;
- }
- void UpdateAI(uint32 uiDiff) override
- {
- + if (!me->GetVehicle())
- + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- +
- if (!bDone && GrandChampionsOutVehicle(me))
- {
- bDone = true;
- - if (me->GetGUID() == instance->GetGuidData(DATA_GRAND_CHAMPION_1))
- - me->SetHomePosition(739.678f, 662.541f, 412.393f, 4.49f);
- - else if (me->GetGUID() == instance->GetGuidData(DATA_GRAND_CHAMPION_2))
- - me->SetHomePosition(746.71f, 661.02f, 411.69f, 4.6f);
- - else if (me->GetGUID() == instance->GetGuidData(DATA_GRAND_CHAMPION_3))
- - me->SetHomePosition(754.34f, 660.70f, 412.39f, 4.79f);
- + me->RemoveAura(64723); // [DND] ReadyJoust Pose Effect
- - instance->SetData(BOSS_GRAND_CHAMPIONS, IN_PROGRESS);
- + if (instance && me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_1))
- + me->SetHomePosition(739.678f,662.541f,413.395f,4.49f);
- + else if (instance && me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_2))
- + me->SetHomePosition(746.71f,661.02f,412.695f,4.6f);
- + else if (instance && me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_3))
- + me->SetHomePosition(754.34f,660.70f,413.395f,4.79f);
- +
- + if (instance)
- + instance->SetData(BOSS_GRAND_CHAMPIONS, IN_PROGRESS);
- EnterEvadeMode();
- bHome = true;
- }
- - if (uiPhaseTimer <= uiDiff)
- - {
- - if (uiPhase == 1)
- - {
- - AggroAllPlayers(me);
- - uiPhase = 0;
- - }
- - }else uiPhaseTimer -= uiDiff;
- -
- - if (!UpdateVictim() || me->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT))
- + if (!UpdateVictim() || me->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT) || me->GetVehicle())
- return;
- - if (uiChainLightningTimer <= uiDiff)
- - {
- - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
- - DoCast(target, SPELL_CHAIN_LIGHTNING);
- -
- - uiChainLightningTimer = 16000;
- - } else uiChainLightningTimer -= uiDiff;
- + events.Update(uiDiff);
- - if (uiHealingWaveTimer <= uiDiff)
- + while (uint32 eventId = events.ExecuteEvent())
- {
- - bool bChance = roll_chance_i(50);
- -
- - if (!bChance)
- + switch (eventId)
- {
- - if (Unit* pFriend = DoSelectLowestHpFriendly(40))
- - DoCast(pFriend, SPELL_HEALING_WAVE);
- - } else
- - DoCast(me, SPELL_HEALING_WAVE);
- -
- - uiHealingWaveTimer = 12000;
- - } else uiHealingWaveTimer -= uiDiff;
- -
- - if (uiEartShieldTimer <= uiDiff)
- - {
- - DoCast(me, SPELL_EARTH_SHIELD);
- -
- - uiEartShieldTimer = urand(30000, 35000);
- - } else uiEartShieldTimer -= uiDiff;
- + case EVENT_EARTH_SHIELD:
- + DoCast(me, SPELL_EARTH_SHIELD);
- + events.ScheduleEvent(EVENT_EARTH_SHIELD, urand(40000,45000), 0, PHASE_COMBAT);
- + break;
- + case EVENT_CHAIN_LIGHTNING:
- + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM,0))
- + DoCast(target, DUNGEON_MODE(SPELL_CHAIN_LIGHTNING,SPELL_CHAIN_LIGHTNING_H));
- + events.ScheduleEvent(EVENT_CHAIN_LIGHTNING, 23000, 0, PHASE_COMBAT);
- + break;
- + case EVENT_HEALING_WAVE:
- + bChance = urand(0,1);
- + if (!bChance)
- + {
- + if (Unit* pFriend = DoSelectLowestHpFriendly(40))
- + DoCast(pFriend, DUNGEON_MODE(SPELL_HEALING_WAVE, SPELL_HEALING_WAVE_H));
- + } else
- + DoCast(me, DUNGEON_MODE(SPELL_HEALING_WAVE, SPELL_HEALING_WAVE_H));
- + events.ScheduleEvent(EVENT_HEALING_WAVE, 19000, 0, PHASE_COMBAT);
- + break;
- + case EVENT_HEX:
- + DoCastVictim(SPELL_HEX_OF_MENDING, true);
- + events.ScheduleEvent(EVENT_HEX, urand(30000,35000), 0, PHASE_COMBAT);
- + break;
- + case EVENT_PHASE_SWITCH:
- + if (events.GetPhaseMask() == PHASE_IDLE)
- + {
- + AggroAllPlayers(me);
- + events.SetPhase(PHASE_COMBAT);
- + }
- + break;
- + }
- + }
- +
- + if (events.GetPhaseMask() == PHASE_COMBAT)
- + DoMeleeAttackIfReady();
- + }
- - if (uiHexMendingTimer <= uiDiff)
- + void DamageTaken(Unit* /*who*/, uint32& damage) override
- + {
- + if (damage >= me->GetHealth())
- {
- - DoCastVictim(SPELL_HEX_OF_MENDING, true);
- + damage = 0;
- + hasBeenInCombat = false;
- + Talk(SAY_CHAMPION_DEFEAT);
- - uiHexMendingTimer = urand(20000, 25000);
- - } else uiHexMendingTimer -= uiDiff;
- -
- - DoMeleeAttackIfReady();
- - }
- + if (instance)
- + instance->SetData(BOSS_GRAND_CHAMPIONS, DONE);
- - void JustDied(Unit* /*killer*/) override
- - {
- - instance->SetData(BOSS_GRAND_CHAMPIONS, DONE);
- + // Instance encounter counting mechanics
- + if (!bCredit)
- + {
- + bCredit = true;
- + HandleSpellOnPlayersInInstanceToC5(me, SPELL_GRAND_CHAMPIONS_CREDIT);
- + }
- + EnterEvadeMode();
- + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- + me->setFaction(35);
- + me->GetMotionMaster()->MovePoint(0,746.843f, 695.68f, 412.339f);
- + HandleKillCreditForAllPlayers(me);
- + HandleInstanceBind(me);
- + }
- }
- };
- - CreatureAI* GetAI(Creature* creature) const override
- + CreatureAI* GetAI(Creature* creature) const
- {
- - return GetInstanceAI<boss_shaman_toc5AI>(creature);
- + return new boss_shaman_toc5AI(creature);
- }
- };
- +// Jaelyne Evensong && Zul'tore || Hunter
- class boss_hunter_toc5 : public CreatureScript
- {
- -public:
- - boss_hunter_toc5() : CreatureScript("boss_hunter_toc5") { }
- + public:
- + boss_hunter_toc5(): CreatureScript("boss_hunter_toc5") {}
- - // Jaelyne Evensong && Zul'tore || Hunter
- - struct boss_hunter_toc5AI : public ScriptedAI
- + struct boss_hunter_toc5AI : public BossAI
- {
- - boss_hunter_toc5AI(Creature* creature) : ScriptedAI(creature)
- + boss_hunter_toc5AI(Creature* creature) : BossAI(creature, BOSS_GRAND_CHAMPIONS)
- {
- - Initialize();
- instance = creature->GetInstanceScript();
- bDone = false;
- bHome = false;
- + hasBeenInCombat = false;
- + bCredit = false;
- - uiPhase = 0;
- - uiPhaseTimer = 0;
- -
- - me->SetReactState(REACT_PASSIVE);
- - // THIS IS A HACK, SHOULD BE REMOVED WHEN THE EVENT IS FULL SCRIPTED
- - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC);
- - }
- -
- - void Initialize()
- - {
- - uiShootTimer = 12000;
- - uiMultiShotTimer = 0;
- - uiLightningArrowsTimer = 7000;
- -
- - uiTargetGUID.Clear();
- -
- - bShoot = false;
- + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- }
- InstanceScript* instance;
- - uint8 uiPhase;
- - uint32 uiPhaseTimer;
- -
- - uint32 uiShootTimer;
- - uint32 uiMultiShotTimer;
- - uint32 uiLightningArrowsTimer;
- -
- ObjectGuid uiTargetGUID;
- bool bShoot;
- bool bDone;
- bool bHome;
- + bool hasBeenInCombat;
- + bool bCredit;
- void Reset() override
- {
- - Initialize();
- + uiTargetGUID.Clear();
- +
- + bShoot = false;
- +
- + Map* pMap = me->GetMap();
- + if (hasBeenInCombat && pMap && pMap->IsDungeon())
- + {
- + Map::PlayerList const &players = pMap->GetPlayers();
- + for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
- + {
- + if (itr->GetSource() && itr->GetSource()->IsAlive() && !itr->GetSource()->IsGameMaster())
- + return;
- + }
- +
- + if (instance)
- + instance->SetData(BOSS_GRAND_CHAMPIONS, FAIL);
- +
- + if (instance)
- + {
- + GameObject* GO = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(DATA_MAIN_GATE1));
- + if (GO)
- + instance->HandleGameObject(GO->GetGUID(),true);
- + }
- +
- + me->RemoveFromWorld();
- + events.SetPhase(PHASE_IDLE);
- + }
- }
- void JustReachedHome() override
- @@ -800,149 +1082,205 @@ public:
- if (!bHome)
- return;
- - uiPhaseTimer = 15000;
- - uiPhase = 1;
- + events.ScheduleEvent(EVENT_PHASE_SWITCH, 15000, 0, PHASE_IDLE);
- bHome = false;
- }
- + void EnterCombat(Unit* /*who*/) override
- + {
- + _EnterCombat();
- + hasBeenInCombat = true;
- + events.ScheduleEvent(EVENT_SHOOT, 12000, 0, PHASE_COMBAT);
- + events.ScheduleEvent(EVENT_LIGHTNING_ARROWS, 7000, 0, PHASE_COMBAT);
- + events.ScheduleEvent(EVENT_DISENGAGE, 10000, 0, PHASE_COMBAT);
- + events.SetPhase(PHASE_COMBAT);
- + }
- +
- void UpdateAI(uint32 uiDiff) override
- {
- + if (!me->GetVehicle())
- + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- +
- if (!bDone && GrandChampionsOutVehicle(me))
- {
- bDone = true;
- - if (me->GetGUID() == instance->GetGuidData(DATA_GRAND_CHAMPION_1))
- - me->SetHomePosition(739.678f, 662.541f, 412.393f, 4.49f);
- - else if (me->GetGUID() == instance->GetGuidData(DATA_GRAND_CHAMPION_2))
- - me->SetHomePosition(746.71f, 661.02f, 411.69f, 4.6f);
- - else if (me->GetGUID() == instance->GetGuidData(DATA_GRAND_CHAMPION_3))
- - me->SetHomePosition(754.34f, 660.70f, 412.39f, 4.79f);
- + me->RemoveAura(64723); // [DND] ReadyJoust Pose Effect
- +
- + if (instance && me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_1))
- + me->SetHomePosition(739.678f,662.541f,413.395f,4.49f);
- + else if (instance && me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_2))
- + me->SetHomePosition(746.71f,661.02f,412.695f,4.6f);
- + else if (instance && me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_3))
- + me->SetHomePosition(754.34f,660.70f,413.395f,4.79f);
- - instance->SetData(BOSS_GRAND_CHAMPIONS, IN_PROGRESS);
- + if (instance)
- + instance->SetData(BOSS_GRAND_CHAMPIONS, IN_PROGRESS);
- EnterEvadeMode();
- bHome = true;
- }
- - if (uiPhaseTimer <= uiDiff)
- - {
- - if (uiPhase == 1)
- - {
- - AggroAllPlayers(me);
- - uiPhase = 0;
- - }
- - }else uiPhaseTimer -= uiDiff;
- -
- - if (!UpdateVictim() || me->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT))
- + if (!UpdateVictim() || me->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT) || me->GetVehicle())
- return;
- - if (uiLightningArrowsTimer <= uiDiff)
- - {
- - DoCastAOE(SPELL_LIGHTNING_ARROWS, false);
- - uiLightningArrowsTimer = 7000;
- - } else uiLightningArrowsTimer -= uiDiff;
- + events.Update(uiDiff);
- - if (uiShootTimer <= uiDiff)
- + while (uint32 eventId = events.ExecuteEvent())
- {
- - if (Unit* target = SelectTarget(SELECT_TARGET_FARTHEST, 0, 30.0f))
- + switch (eventId)
- {
- - uiTargetGUID = target->GetGUID();
- - DoCast(target, SPELL_SHOOT);
- - }
- - uiShootTimer = 12000;
- - uiMultiShotTimer = 3000;
- - bShoot = true;
- - } else uiShootTimer -= uiDiff;
- -
- - if (bShoot && uiMultiShotTimer <= uiDiff)
- - {
- - me->InterruptNonMeleeSpells(true);
- - Unit* target = ObjectAccessor::GetUnit(*me, uiTargetGUID);
- -
- - if (target && me->IsInRange(target, 5.0f, 30.0f, false))
- - {
- - DoCast(target, SPELL_MULTI_SHOT);
- - }
- - else
- - {
- - Map::PlayerList const& players = me->GetMap()->GetPlayers();
- - if (me->GetMap()->IsDungeon() && !players.isEmpty())
- - {
- - for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
- + case EVENT_SHOOT:
- + if (Unit* target = SelectTarget(SELECT_TARGET_FARTHEST, 0, 30.0f))
- {
- - Player* player = itr->GetSource();
- - if (player && !player->IsGameMaster() && me->IsInRange(player, 5.0f, 30.0f, false))
- + uiTargetGUID = target->GetGUID();
- + DoCast(target, DUNGEON_MODE(SPELL_SHOOT, SPELL_SHOOT_H));
- + }
- + bShoot = true;
- + events.ScheduleEvent(EVENT_SHOOT, 19000, 0, PHASE_COMBAT);
- + events.ScheduleEvent(EVENT_MULTI_SHOOT, 8000, 0, PHASE_COMBAT);
- + break;
- + case EVENT_MULTI_SHOOT:
- + if (bShoot)
- + {
- + me->InterruptNonMeleeSpells(true);
- + Unit* target = ObjectAccessor::GetUnit(*me, uiTargetGUID);
- +
- + if (target && me->IsInRange(target, 5.0f, 30.0f, false))
- + DoCast(target, SPELL_MULTI_SHOT);
- + else
- {
- - DoCast(player, SPELL_MULTI_SHOT);
- - break;
- + Map::PlayerList const& players = me->GetMap()->GetPlayers();
- + if (me->GetMap()->IsDungeon() && !players.isEmpty())
- + {
- + for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
- + {
- + Player* player = itr->GetSource();
- + if (player && me->IsInRange(player, 5.0f, 30.0f, false))
- + {
- + DoCast(target, SPELL_MULTI_SHOT);
- + break;
- + }
- + }
- + }
- }
- + bShoot = false;
- }
- - }
- + break;
- + case EVENT_DISENGAGE:
- + if (me->IsWithinDistInMap(me->GetVictim(), 5))
- + {
- + DoCast(me, SPELL_DISENGAGE);
- + events.ScheduleEvent(EVENT_DISENGAGE, 20000, 0, PHASE_COMBAT);
- + }
- + else
- + events.ScheduleEvent(EVENT_DISENGAGE, 10000, 0, PHASE_COMBAT);
- + break;
- + case EVENT_LIGHTNING_ARROWS:
- + DoCastAOE(SPELL_LIGHTNING_ARROWS, false);
- + events.ScheduleEvent(EVENT_LIGHTNING_ARROWS, 15000, 0, PHASE_COMBAT);
- + break;
- + case EVENT_PHASE_SWITCH:
- + if (events.GetPhaseMask() == PHASE_IDLE)
- + {
- + AggroAllPlayers(me);
- + events.SetPhase(PHASE_COMBAT);
- + }
- + break;
- }
- - bShoot = false;
- - } else uiMultiShotTimer -= uiDiff;
- -
- - DoMeleeAttackIfReady();
- + }
- + if (events.GetPhaseMask() == PHASE_COMBAT)
- + DoMeleeAttackIfReady();
- }
- - void JustDied(Unit* /*killer*/) override
- + void DamageTaken(Unit* /*who*/, uint32& damage) override
- {
- - instance->SetData(BOSS_GRAND_CHAMPIONS, DONE);
- + if (damage >= me->GetHealth())
- + {
- + damage = 0;
- + hasBeenInCombat = false;
- + Talk(SAY_CHAMPION_DEFEAT);
- +
- + if (instance)
- + instance->SetData(BOSS_GRAND_CHAMPIONS, DONE);
- +
- + // Instance encounter counting mechanics
- + if (!bCredit)
- + {
- + bCredit = true;
- + HandleSpellOnPlayersInInstanceToC5(me, SPELL_GRAND_CHAMPIONS_CREDIT);
- + }
- + EnterEvadeMode();
- + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- + me->setFaction(35);
- + me->GetMotionMaster()->MovePoint(0, 746.843f, 695.68f, 412.339f);
- + HandleKillCreditForAllPlayers(me);
- + HandleInstanceBind(me);
- + }
- }
- };
- - CreatureAI* GetAI(Creature* creature) const override
- + CreatureAI* GetAI(Creature* creature) const
- {
- - return GetInstanceAI<boss_hunter_toc5AI>(creature);
- + return new boss_hunter_toc5AI(creature);
- }
- };
- -class boss_rouge_toc5 : public CreatureScript
- +// Lana Stouthammer Evensong && Deathstalker Visceri || Rogue
- +class boss_rogue_toc5 : public CreatureScript
- {
- -public:
- - boss_rouge_toc5() : CreatureScript("boss_rouge_toc5") { }
- + public:
- + boss_rogue_toc5(): CreatureScript("boss_rogue_toc5") { }
- - // Lana Stouthammer Evensong && Deathstalker Visceri || Rouge
- - struct boss_rouge_toc5AI : public ScriptedAI
- + struct boss_rogue_toc5AI : public BossAI
- {
- - boss_rouge_toc5AI(Creature* creature) : ScriptedAI(creature)
- + boss_rogue_toc5AI(Creature* creature) : BossAI(creature, BOSS_GRAND_CHAMPIONS)
- {
- - Initialize();
- instance = creature->GetInstanceScript();
- bDone = false;
- bHome = false;
- + bCredit = false;
- - uiPhase = 0;
- - uiPhaseTimer = 0;
- -
- - me->SetReactState(REACT_PASSIVE);
- - // THIS IS A HACK, SHOULD BE REMOVED WHEN THE EVENT IS FULL SCRIPTED
- - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC);
- - }
- -
- - void Initialize()
- - {
- - uiEviscerateTimer = 8000;
- - uiFanKivesTimer = 14000;
- - uiPosionBottleTimer = 19000;
- + hasBeenInCombat = false;
- + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- }
- InstanceScript* instance;
- - uint8 uiPhase;
- - uint32 uiPhaseTimer;
- - uint32 uiEviscerateTimer;
- - uint32 uiFanKivesTimer;
- - uint32 uiPosionBottleTimer;
- -
- bool bDone;
- bool bHome;
- + bool hasBeenInCombat;
- + bool bCredit;
- void Reset() override
- {
- - Initialize();
- +
- + Map* pMap = me->GetMap();
- +
- + if (hasBeenInCombat && pMap && pMap->IsDungeon())
- + {
- + Map::PlayerList const &players = pMap->GetPlayers();
- + for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
- + {
- + if (itr->GetSource() && itr->GetSource()->IsAlive() && !itr->GetSource()->IsGameMaster())
- + return;
- + }
- +
- + if (instance)
- + instance->SetData(BOSS_GRAND_CHAMPIONS, FAIL);
- +
- + if (instance)
- + {
- + GameObject* GO = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(DATA_MAIN_GATE1));
- + if (GO)
- + instance->HandleGameObject(GO->GetGUID(),true);
- + }
- +
- + events.SetPhase(PHASE_IDLE);
- + me->RemoveFromWorld();
- + }
- }
- void JustReachedHome() override
- @@ -952,75 +1290,339 @@ public:
- if (!bHome)
- return;
- - uiPhaseTimer = 15000;
- - uiPhase = 1;
- + events.ScheduleEvent(EVENT_PHASE_SWITCH, 15000, 0, PHASE_IDLE);
- bHome = false;
- }
- + void EnterCombat(Unit* /*who*/) override
- + {
- + _EnterCombat();
- + hasBeenInCombat = true;
- + events.ScheduleEvent(EVENT_EVISCERATE, 8000, 0, PHASE_COMBAT);
- + events.ScheduleEvent(EVENT_FAN_OF_KNIVES, 14000, 0, PHASE_COMBAT);
- + events.ScheduleEvent(EVENT_POISON_BOTTLE, 19000, 0, PHASE_COMBAT);
- + events.SetPhase(PHASE_COMBAT);
- + }
- +
- void UpdateAI(uint32 uiDiff) override
- {
- if (!bDone && GrandChampionsOutVehicle(me))
- {
- bDone = true;
- - if (me->GetGUID() == instance->GetGuidData(DATA_GRAND_CHAMPION_1))
- - me->SetHomePosition(739.678f, 662.541f, 412.393f, 4.49f);
- - else if (me->GetGUID() == instance->GetGuidData(DATA_GRAND_CHAMPION_2))
- - me->SetHomePosition(746.71f, 661.02f, 411.69f, 4.6f);
- - else if (me->GetGUID() == instance->GetGuidData(DATA_GRAND_CHAMPION_3))
- - me->SetHomePosition(754.34f, 660.70f, 412.39f, 4.79f);
- + me->RemoveAura(64723); // [DND] ReadyJoust Pose Effect
- +
- + if (instance && me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_1))
- + me->SetHomePosition(739.678f,662.541f,413.395f,4.49f);
- + else if (instance && me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_2))
- + me->SetHomePosition(746.71f,661.02f,412.695f,4.6f);
- + else if (instance && me->GetGUID() == instance->GetData64(DATA_GRAND_CHAMPION_3))
- + me->SetHomePosition(754.34f,660.70f,413.395f,4.79f);
- - instance->SetData(BOSS_GRAND_CHAMPIONS, IN_PROGRESS);
- + if (instance)
- + instance->SetData(BOSS_GRAND_CHAMPIONS, IN_PROGRESS);
- EnterEvadeMode();
- bHome = true;
- }
- - if (uiPhaseTimer <= uiDiff)
- + if (!UpdateVictim() || me->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT) || me->GetVehicle())
- + return;
- +
- + events.Update(uiDiff);
- +
- + while (uint32 eventId = events.ExecuteEvent())
- {
- - if (uiPhase == 1)
- + switch (eventId)
- {
- - AggroAllPlayers(me);
- - uiPhase = 0;
- + case EVENT_EVISCERATE:
- + DoCast(me->GetVictim(),DUNGEON_MODE(SPELL_EVISCERATE, SPELL_EVISCERATE_H));
- + events.ScheduleEvent(EVENT_EVISCERATE, 12000, 0, PHASE_COMBAT);
- + break;
- + case EVENT_FAN_OF_KNIVES:
- + DoCastAOE(SPELL_FAN_OF_KNIVES, false);
- + events.ScheduleEvent(EVENT_FAN_OF_KNIVES, 20000, 0, PHASE_COMBAT);
- + break;
- + case EVENT_POISON_BOTTLE:
- + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
- + DoCast(target, SPELL_POISON_BOTTLE);
- + events.ScheduleEvent(EVENT_POISON_BOTTLE, 19000, 0, PHASE_COMBAT);
- + break;
- + case EVENT_PHASE_SWITCH:
- + if (events.GetPhaseMask() == PHASE_IDLE)
- + {
- + AggroAllPlayers(me);
- + events.SetPhase(PHASE_COMBAT);
- + }
- + break;
- }
- - } else uiPhaseTimer -= uiDiff;
- + }
- + if (events.GetPhaseMask() == PHASE_COMBAT)
- + DoMeleeAttackIfReady();
- + }
- - if (!UpdateVictim() || me->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT))
- - return;
- + void DamageTaken(Unit* /*who*/, uint32& damage) override
- + {
- + if (damage >= me->GetHealth())
- + {
- + damage = 0;
- + hasBeenInCombat = false;
- + Talk(SAY_CHAMPION_DEFEAT);
- +
- + if (instance)
- + instance->SetData(BOSS_GRAND_CHAMPIONS, DONE);
- - if (uiEviscerateTimer <= uiDiff)
- + // Instance encounter counting mechanics
- + if (!bCredit)
- + {
- + bCredit = true;
- + HandleSpellOnPlayersInInstanceToC5(me, SPELL_GRAND_CHAMPIONS_CREDIT);
- + }
- + EnterEvadeMode();
- + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- + me->setFaction(35);
- + me->GetMotionMaster()->MovePoint(0, 746.843f, 695.68f, 412.339f);
- + HandleKillCreditForAllPlayers(me);
- + HandleInstanceBind(me);
- + }
- + }
- + };
- +
- + CreatureAI* GetAI(Creature* creature) const
- + {
- + return new boss_rogue_toc5AI(creature);
- + }
- +};
- +
- +class achievement_toc5_grand_champions : public AchievementCriteriaScript
- +{
- + public:
- + uint32 creature_entry;
- +
- + achievement_toc5_grand_champions(const char* name, uint32 original_entry) : AchievementCriteriaScript(name)
- + {
- + creature_entry = original_entry;
- + }
- +
- + bool OnCheck(Player* /*source*/, Unit* target) override
- + {
- + if (!target)
- + return false;
- +
- + if (Creature* creature = target->ToCreature())
- + if (creature->GetEntry() == creature_entry)
- + return true;
- +
- + return false;
- + }
- +};
- +
- +void HandleInstanceBind(Creature* source)
- +{
- + Map::PlayerList const& players = source->GetMap()->GetPlayers();
- + if (!players.isEmpty() && source->GetMap()->ToInstanceMap()->IsHeroic())
- + {
- + for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
- + {
- + Player* player = itr->GetSource();
- + if (player)
- + source->GetMap()->ToInstanceMap()->PermBindAllPlayers(player);
- + }
- + }
- +}
- +
- +void HandleKillCreditForAllPlayers(Creature* credit)
- +{
- + InstanceScript* instance = credit->GetInstanceScript();
- + if (instance)
- + {
- + Map::PlayerList const &PlayerList = instance->instance->GetPlayers();
- + for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
- + if (Player* player = i->GetSource())
- + player->KilledMonsterCredit(credit->GetEntry());
- + }
- +}
- +
- +class spell_toc5_ride_mount : public SpellScriptLoader
- +{
- + public:
- + spell_toc5_ride_mount() : SpellScriptLoader("spell_toc5_ride_mount") {}
- +
- + class spell_toc5_ride_mount_SpellScript : public SpellScript
- + {
- + PrepareSpellScript(spell_toc5_ride_mount_SpellScript);
- +
- + SpellCastResult CheckRequirement()
- {
- - DoCastVictim(SPELL_EVISCERATE);
- - uiEviscerateTimer = 8000;
- - } else uiEviscerateTimer -= uiDiff;
- + if(GetCaster()->GetUInt32Value(PLAYER_VISIBLE_ITEM_16_ENTRYID) == 46106)
- + {
- + GetCaster()->RemoveAurasByType(SPELL_AURA_MOD_SHAPESHIFT);
- + return SPELL_CAST_OK;
- + } else {
- + SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_MUST_HAVE_LANCE_EQUIPPED);
- + return SPELL_FAILED_CUSTOM_ERROR;
- + }
- + }
- - if (uiFanKivesTimer <= uiDiff)
- + void Register()
- {
- - DoCastAOE(SPELL_FAN_OF_KNIVES, false);
- - uiFanKivesTimer = 14000;
- - } else uiFanKivesTimer -= uiDiff;
- + OnCheckCast += SpellCheckCastFn(spell_toc5_ride_mount_SpellScript::CheckRequirement);
- + }
- + };
- - if (uiPosionBottleTimer <= uiDiff)
- + class spell_toc5_ride_mount_AuraScript : public AuraScript
- + {
- + PrepareAuraScript(spell_toc5_ride_mount_AuraScript);
- +
- + void HandleOnEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
- {
- - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
- - DoCast(target, SPELL_POISON_BOTTLE);
- - uiPosionBottleTimer = 19000;
- - } else uiPosionBottleTimer -= uiDiff;
- + if (Unit* target = GetTarget())
- + target->RemoveAurasDueToSpell(SPELL_DEFEND_2);
- + if (Unit* caster = GetCaster())
- + {
- + caster->RemoveAurasDueToSpell(SPELL_DEFEND_2);
- + for (uint8 i = 0; i < 3; i++)
- + caster->RemoveAurasDueToSpell(SPELL_VISUAL_SHIELD_1 + i);
- + }
- + }
- - DoMeleeAttackIfReady();
- + void Register()
- + {
- + OnEffectApply += AuraEffectApplyFn(spell_toc5_ride_mount_AuraScript::HandleOnEffect, EFFECT_0, SPELL_AURA_CONTROL_VEHICLE, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
- + OnEffectRemove += AuraEffectRemoveFn(spell_toc5_ride_mount_AuraScript::HandleOnEffect, EFFECT_0, SPELL_AURA_CONTROL_VEHICLE, AURA_EFFECT_HANDLE_REAL);
- + }
- + };
- +
- + AuraScript* GetAuraScript() const
- + {
- + return new spell_toc5_ride_mount_AuraScript();
- }
- - void JustDied(Unit* /*killer*/) override
- + SpellScript* GetSpellScript() const
- {
- - instance->SetData(BOSS_GRAND_CHAMPIONS, DONE);
- + return new spell_toc5_ride_mount_SpellScript();
- }
- - };
- +};
- - CreatureAI* GetAI(Creature* creature) const override
- - {
- - return GetInstanceAI<boss_rouge_toc5AI>(creature);
- - }
- +class spell_toc5_defend : public SpellScriptLoader
- +{
- + public:
- + spell_toc5_defend() : SpellScriptLoader("spell_toc5_defend") { }
- +
- + class spell_toc5_defendAuraScript : public AuraScript
- + {
- + PrepareAuraScript(spell_toc5_defendAuraScript);
- +
- + bool Validate(SpellInfo const* /*spellEntry*/)
- + {
- + if (!sSpellMgr->GetSpellInfo(SPELL_VISUAL_SHIELD_1))
- + return false;
- + if (!sSpellMgr->GetSpellInfo(SPELL_VISUAL_SHIELD_2))
- + return false;
- + if (!sSpellMgr->GetSpellInfo(SPELL_VISUAL_SHIELD_3))
- + return false;
- + return true;
- + }
- +
- + void RefreshVisualShields(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
- + {
- + Unit* caster = GetCaster();
- +
- + if(!caster)
- + return;
- +
- + if(Unit* rider = caster->GetCharmer())
- + {
- + for(uint8 i = 0; i < 3; ++i)
- + rider->RemoveAurasDueToSpell(SPELL_VISUAL_SHIELD_1 + i);
- +
- + if(Aura* defend = caster->GetAura(GetId()))
- + rider->CastSpell(rider, SPELL_VISUAL_SHIELD_1 + (defend->GetStackAmount()-1), true);
- + }else
- + {
- + for(uint8 i = 0; i < 3; ++i)
- + caster->RemoveAurasDueToSpell(SPELL_VISUAL_SHIELD_1 + i);
- +
- + if(Aura* defend = caster->GetAura(GetId()))
- + caster->CastSpell(caster, SPELL_VISUAL_SHIELD_1 + (defend->GetStackAmount()-1), true);
- + }
- + }
- +
- + void Register()
- + {
- + OnEffectApply += AuraEffectApplyFn(spell_toc5_defendAuraScript::RefreshVisualShields, EFFECT_FIRST_FOUND, SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_SEND_FOR_CLIENT_MASK);
- + OnEffectRemove += AuraEffectRemoveFn(spell_toc5_defendAuraScript::RefreshVisualShields, EFFECT_FIRST_FOUND, SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_SEND_FOR_CLIENT_MASK);
- + }
- + };
- +
- + AuraScript* GetAuraScript() const
- + {
- + return new spell_toc5_defendAuraScript();
- + }
- +};
- +
- +class player_hex_mendingAI : public PlayerAI
- +{
- + public:
- + player_hex_mendingAI(Player* player) : PlayerAI(player) { }
- +
- + void HealReceived(Unit* healer, uint32 & addHealth)
- + {
- + PlayerAI::HealReceived(healer, addHealth);
- + me->CastCustomSpell(SPELL_HEX_OF_MENDING_HEAL, SPELLVALUE_BASE_POINT0, int32(addHealth*2.0f), me, true);
- + }
- +
- + void UpdateAI(const uint32 /*diff*/) { }
- +
- + private:
- + ObjectGuid casterGUID;
- +};
- +
- +class spell_toc5_hex_mending : public SpellScriptLoader
- +{
- + public:
- + spell_toc5_hex_mending() : SpellScriptLoader("spell_toc5_hex_mending") { }
- +
- + class spell_toc5_hex_mending_AuraScript : public AuraScript
- + {
- + PrepareAuraScript(spell_toc5_hex_mending_AuraScript);
- +
- + void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
- + {
- + if (GetTarget()->GetTypeId() != TYPEID_PLAYER)
- + return;
- +
- + oldAI = GetTarget()->GetAI();
- + GetTarget()->SetAI(new player_hex_mendingAI(GetTarget()->ToPlayer()));
- + oldAIState = GetTarget()->IsAIEnabled;
- + GetTarget()->IsAIEnabled = true;
- + }
- +
- + void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
- + {
- + if (GetTarget()->GetTypeId() != TYPEID_PLAYER)
- + return;
- +
- + delete GetTarget()->GetAI();
- + GetTarget()->SetAI(oldAI);
- + GetTarget()->IsAIEnabled = oldAIState;
- + }
- +
- + void Register()
- + {
- + AfterEffectApply += AuraEffectApplyFn(spell_toc5_hex_mending_AuraScript::OnApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
- + AfterEffectRemove += AuraEffectRemoveFn(spell_toc5_hex_mending_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
- + }
- +
- + UnitAI* oldAI;
- + bool oldAIState;
- + };
- +
- + AuraScript* GetAuraScript() const
- + {
- + return new spell_toc5_hex_mending_AuraScript();
- + }
- };
- void AddSC_boss_grand_champions()
- @@ -1030,5 +1632,19 @@ void AddSC_boss_grand_champions()
- new boss_mage_toc5();
- new boss_shaman_toc5();
- new boss_hunter_toc5();
- - new boss_rouge_toc5();
- -}
- + new boss_rogue_toc5();
- + new achievement_toc5_grand_champions("achievement_toc5_champions_mokra", NPC_MOKRA);
- + new achievement_toc5_grand_champions("achievement_toc5_champions_eressea", NPC_ERESSEA);
- + new achievement_toc5_grand_champions("achievement_toc5_champions_runok", NPC_RUNOK);
- + new achievement_toc5_grand_champions("achievement_toc5_champions_zultore", NPC_ZULTORE);
- + new achievement_toc5_grand_champions("achievement_toc5_champions_visceri", NPC_VISCERI);
- + new achievement_toc5_grand_champions("achievement_toc5_champions_alerius", NPC_JACOB);
- + new achievement_toc5_grand_champions("achievement_toc5_champions_ambrose", NPC_AMBROSE);
- + new achievement_toc5_grand_champions("achievement_toc5_champions_colosos", NPC_COLOSOS);
- + new achievement_toc5_grand_champions("achievement_toc5_champions_jaelyne", NPC_JAELYNE);
- + new achievement_toc5_grand_champions("achievement_toc5_champions_lana", NPC_LANA);
- +
- + new spell_toc5_ride_mount();
- + new spell_toc5_defend();
- + new spell_toc5_hex_mending();
- +};
- \ No newline at end of file
- diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/instance_trial_of_the_champion.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/instance_trial_of_the_champion.cpp
- index cacef99..b366a50 100644
- --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/instance_trial_of_the_champion.cpp
- +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/instance_trial_of_the_champion.cpp
- @@ -15,52 +15,56 @@
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
- -/* ScriptData
- -SDName: Instance Trial of the Champion
- -SDComment:
- -SDCategory: Trial Of the Champion
- -EndScriptData */
- -
- -#include "ScriptMgr.h"
- -#include "ScriptedCreature.h"
- -#include "InstanceScript.h"
- +#include "ScriptPCH.h"
- #include "trial_of_the_champion.h"
- #include "Player.h"
- #define MAX_ENCOUNTER 4
- +enum Events
- +{
- + EVENT_OUTRO_1 = 1,
- + EVENT_OUTRO_2 = 2,
- + EVENT_OUTRO_3 = 3
- +};
- +
- +enum Texts
- +{
- + SAY_OUTRO_1_TIRION = 57,
- + SAY_OUTRO_2_TIRION = 58,
- + SAY_OUTRO_3_ALLY = 53,
- + SAY_OUTRO_3_HORDE = 1
- +};
- +
- class instance_trial_of_the_champion : public InstanceMapScript
- {
- public:
- instance_trial_of_the_champion() : InstanceMapScript("instance_trial_of_the_champion", 650) { }
- - InstanceScript* GetInstanceScript(InstanceMap* map) const override
- + InstanceScript* GetInstanceScript(InstanceMap* pMap) const
- {
- - return new instance_trial_of_the_champion_InstanceMapScript(map);
- + return new instance_trial_of_the_champion_InstanceMapScript(pMap);
- }
- struct instance_trial_of_the_champion_InstanceMapScript : public InstanceScript
- {
- - instance_trial_of_the_champion_InstanceMapScript(Map* map) : InstanceScript(map)
- - {
- - SetHeaders(DataHeader);
- - uiMovementDone = 0;
- - uiGrandChampionsDeaths = 0;
- - uiArgentSoldierDeaths = 0;
- -
- - bDone = false;
- -
- - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
- - }
- + instance_trial_of_the_champion_InstanceMapScript(Map* pMap) : InstanceScript(pMap) { }
- uint32 m_auiEncounter[MAX_ENCOUNTER];
- + uint32 TeamInInstance;
- uint16 uiMovementDone;
- uint16 uiGrandChampionsDeaths;
- uint8 uiArgentSoldierDeaths;
- + uint8 uiAggroDone;
- ObjectGuid uiAnnouncerGUID;
- + ObjectGuid blackknightGUID;
- + ObjectGuid uiThrallGUID;
- + ObjectGuid uiVarianGUID;
- + ObjectGuid uiHighlordGUID;
- ObjectGuid uiMainGateGUID;
- + ObjectGuid uiMainGate1GUID;
- ObjectGuid uiGrandChampionVehicle1GUID;
- ObjectGuid uiGrandChampionVehicle2GUID;
- ObjectGuid uiGrandChampionVehicle3GUID;
- @@ -74,11 +78,29 @@ public:
- std::string str_data;
- + EventMap events;
- +
- bool bDone;
- + bool HasChestSpawned;
- - bool IsEncounterInProgress() const override
- + void Initialize() override
- {
- - for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
- + uiMovementDone = 0;
- + uiGrandChampionsDeaths = 0;
- + uiArgentSoldierDeaths = 0;
- + TeamInInstance = 0;
- +
- + bDone = false;
- + HasChestSpawned = false;
- +
- + VehicleList.clear();
- +
- + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
- + }
- +
- + bool IsEncounterInProgress() const
- + {
- + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i)
- {
- if (m_auiEncounter[i] == IN_PROGRESS)
- return true;
- @@ -87,10 +109,9 @@ public:
- return false;
- }
- - void OnCreatureCreate(Creature* creature) override
- + void OnCreatureCreate(Creature* creature) override
- {
- Map::PlayerList const &players = instance->GetPlayers();
- - uint32 TeamInInstance = 0;
- if (!players.isEmpty())
- {
- @@ -98,34 +119,99 @@ public:
- TeamInInstance = player->GetTeam();
- }
- - switch (creature->GetEntry())
- + switch(creature->GetEntry())
- {
- - // Champions
- + // Gran Champions
- case VEHICLE_MOKRA_SKILLCRUSHER_MOUNT:
- if (TeamInInstance == HORDE)
- creature->UpdateEntry(VEHICLE_MARSHAL_JACOB_ALERIUS_MOUNT);
- break;
- + case NPC_MOKRA:
- + if (TeamInInstance == HORDE)
- + creature->UpdateEntry(NPC_JACOB);
- + break;
- case VEHICLE_ERESSEA_DAWNSINGER_MOUNT:
- if (TeamInInstance == HORDE)
- creature->UpdateEntry(VEHICLE_AMBROSE_BOLTSPARK_MOUNT);
- break;
- + case NPC_ERESSEA:
- + if (TeamInInstance == HORDE)
- + creature->UpdateEntry(NPC_AMBROSE);
- + break;
- case VEHICLE_RUNOK_WILDMANE_MOUNT:
- if (TeamInInstance == HORDE)
- creature->UpdateEntry(VEHICLE_COLOSOS_MOUNT);
- break;
- + case NPC_RUNOK:
- + if (TeamInInstance == HORDE)
- + creature->UpdateEntry(NPC_COLOSOS);
- + break;
- case VEHICLE_ZUL_TORE_MOUNT:
- if (TeamInInstance == HORDE)
- creature->UpdateEntry(VEHICLE_EVENSONG_MOUNT);
- break;
- + case NPC_ZULTORE:
- + if (TeamInInstance == HORDE)
- + creature->UpdateEntry(NPC_JAELYNE);
- + break;
- case VEHICLE_DEATHSTALKER_VESCERI_MOUNT:
- if (TeamInInstance == HORDE)
- creature->UpdateEntry(VEHICLE_LANA_STOUTHAMMER_MOUNT);
- break;
- + case NPC_VISCERI:
- + if (TeamInInstance == HORDE)
- + creature->UpdateEntry(NPC_LANA);
- + break;
- + // Faction champions vehicles
- + case VEHICLE_FORSAKE_WARHORSE:
- + if (TeamInInstance == HORDE)
- + creature->UpdateEntry(VEHICLE_IRONFORGE_RAM);
- + break;
- + case VEHICLE_THUNDER_BLUFF_KODO:
- + if (TeamInInstance == HORDE)
- + creature->UpdateEntry(VEHICLE_EXODAR_ELEKK);
- + break;
- + case VEHICLE_ORGRIMMAR_WOLF:
- + if (TeamInInstance == HORDE)
- + creature->UpdateEntry(VEHICLE_STORMWIND_STEED);
- + break;
- + case VEHICLE_SILVERMOON_HAWKSTRIDER:
- + if (TeamInInstance == HORDE)
- + creature->UpdateEntry(VEHICLE_GNOMEREGAN_MECHANOSTRIDER);
- + break;
- + case VEHICLE_DARKSPEAR_RAPTOR:
- + if (TeamInInstance == HORDE)
- + creature->UpdateEntry(VEHICLE_DARNASSIA_NIGHTSABER);
- + break;
- + // Faction champios
- + case NPC_ORGRIMAR_CHAMPION:
- + if (TeamInInstance == HORDE)
- + creature->UpdateEntry(NPC_STORMWIND_CHAMPION);
- + break;
- + case NPC_SILVERMOON_CHAMPION:
- + if (TeamInInstance == HORDE)
- + creature->UpdateEntry(NPC_GNOMERAGN_CHAMPION);
- + break;
- + case NPC_THUNDER_CHAMPION:
- + if (TeamInInstance == HORDE)
- + creature->UpdateEntry(NPC_EXODAR_CHAMPION);
- + break;
- + case NPC_TROLL_CHAMPION:
- + if (TeamInInstance == HORDE)
- + creature->UpdateEntry(NPC_DRNASSUS_CHAMPION);
- + break;
- + case NPC_UNDERCITY_CHAMPION:
- + if (TeamInInstance == HORDE)
- + creature->UpdateEntry(NPC_IRONFORGE_CHAMPION);
- + break;
- // Coliseum Announcer || Just NPC_JAEREN must be spawned.
- + case NPC_HIGHLORD:
- + uiHighlordGUID = creature->GetGUID();
- + break;
- case NPC_JAEREN:
- - uiAnnouncerGUID = creature->GetGUID();
- if (TeamInInstance == ALLIANCE)
- creature->UpdateEntry(NPC_ARELAS);
- + uiAnnouncerGUID = creature->GetGUID();
- break;
- case VEHICLE_ARGENT_WARHORSE:
- case VEHICLE_ARGENT_BATTLEWORG:
- @@ -135,16 +221,43 @@ public:
- case NPC_PALETRESS:
- uiArgentChampionGUID = creature->GetGUID();
- break;
- + case NPC_BLACK_KNIGHT:
- + blackknightGUID = creature->GetGUID();
- + break;
- + case NPC_THRALL:
- + uiThrallGUID = creature->GetGUID();
- + break;
- + case NPC_VARIAN:
- + uiVarianGUID = creature->GetGUID();
- + break;
- + }
- + }
- +
- + bool CheckAchievementCriteriaMeet(uint32 criteriaId, Player const*, Unit const* /* = NULL */, uint32 /* = 0 */) override
- + {
- + switch (criteriaId)
- + {
- + case CRITERIA_IVE_HAD_WORSE:
- + if (Creature* knight = instance->GetCreature(blackknightGUID))
- + return knight->AI()->GetData(DATA_IVE_HAD_WORSE);
- + break;
- + default:
- + break;
- }
- +
- + return false;
- }
- void OnGameObjectCreate(GameObject* go) override
- {
- - switch (go->GetEntry())
- + switch(go->GetEntry())
- {
- case GO_MAIN_GATE:
- uiMainGateGUID = go->GetGUID();
- break;
- + case GO_MAIN_GATE1:
- + uiMainGate1GUID = go->GetGUID();
- + break;
- case GO_CHAMPIONS_LOOT:
- case GO_CHAMPIONS_LOOT_H:
- uiChampionLootGUID = go->GetGUID();
- @@ -154,7 +267,7 @@ public:
- void SetData(uint32 uiType, uint32 uiData) override
- {
- - switch (uiType)
- + switch(uiType)
- {
- case DATA_MOVEMENT_DONE:
- uiMovementDone = uiData;
- @@ -171,16 +284,24 @@ public:
- for (GuidList::const_iterator itr = VehicleList.begin(); itr != VehicleList.end(); ++itr)
- if (Creature* summon = instance->GetCreature(*itr))
- summon->RemoveFromWorld();
- - }else if (uiData == DONE)
- + } else if (uiData == DONE)
- {
- ++uiGrandChampionsDeaths;
- - if (uiGrandChampionsDeaths == 3)
- + if (uiGrandChampionsDeaths >= 3 && !HasChestSpawned)
- {
- if (Creature* pAnnouncer = instance->GetCreature(uiAnnouncerGUID))
- {
- + HasChestSpawned = true;
- + pAnnouncer->AI()->SetData(DATA_RESET,0);
- + m_auiEncounter[0] = uiData;
- pAnnouncer->GetMotionMaster()->MovePoint(0, 748.309f, 619.487f, 411.171f);
- pAnnouncer->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- - pAnnouncer->SummonGameObject(instance->IsHeroic()? GO_CHAMPIONS_LOOT_H : GO_CHAMPIONS_LOOT, 746.59f, 618.49f, 411.09f, 1.42f, 0, 0, 0, 0, 90000);
- + pAnnouncer->SummonGameObject(instance->IsHeroic()? GO_CHAMPIONS_LOOT_H : GO_CHAMPIONS_LOOT, 746.59f, 618.49f, 411.09f, 1.42f, 0, 0, 0, 0, 90000000);
- +
- + for (GuidList::const_iterator itr = VehicleList.begin(); itr != VehicleList.end(); ++itr)
- + if (Creature* unit = instance->GetCreature(*itr))
- + if (unit->GetEntry() == NPC_ARGENT_WARHORSE || unit->GetEntry() == NPC_ARGENT_BATTLEWORG)
- + unit->DespawnOrUnsummon();
- }
- }
- }
- @@ -194,36 +315,64 @@ public:
- pBoss->GetMotionMaster()->MovePoint(0, 746.88f, 618.74f, 411.06f);
- pBoss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- pBoss->SetReactState(REACT_AGGRESSIVE);
- + pBoss->setFaction(16);
- }
- }
- break;
- case BOSS_ARGENT_CHALLENGE_E:
- m_auiEncounter[1] = uiData;
- - if (Creature* pAnnouncer = instance->GetCreature(uiAnnouncerGUID))
- + if (uiData == IN_PROGRESS)
- + {
- + for(GuidList::const_iterator itr = VehicleList.begin(); itr != VehicleList.end(); ++itr)
- + if (Creature* pSummon = instance->GetCreature(*itr))
- + pSummon->RemoveFromWorld();
- + } else if (uiData == DONE)
- {
- - pAnnouncer->GetMotionMaster()->MovePoint(0, 748.309f, 619.487f, 411.171f);
- - pAnnouncer->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- - pAnnouncer->SummonGameObject(instance->IsHeroic()? GO_EADRIC_LOOT_H : GO_EADRIC_LOOT, 746.59f, 618.49f, 411.09f, 1.42f, 0, 0, 0, 0, 90000);
- + if (Creature* pAnnouncer = instance->GetCreature(uiAnnouncerGUID))
- + {
- + pAnnouncer->GetMotionMaster()->MovePoint(0,748.309f, 619.487f, 411.171f);
- + pAnnouncer->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- + pAnnouncer->SummonGameObject(instance->IsHeroic()? GO_EADRIC_LOOT_H : GO_EADRIC_LOOT,746.59f, 618.49f, 411.09f, 1.42f, 0, 0, 0, 0,90000000);
- + }
- + }
- + break;
- + case DATA_AGRO_DONE:
- + uiAggroDone = uiData;
- + if (Creature* pAnnouncer = instance->GetCreature(uiAnnouncerGUID))
- + {
- + pAnnouncer->SetVisible(false);
- }
- break;
- case BOSS_ARGENT_CHALLENGE_P:
- m_auiEncounter[2] = uiData;
- - if (Creature* pAnnouncer = instance->GetCreature(uiAnnouncerGUID))
- + if (uiData == IN_PROGRESS)
- {
- - pAnnouncer->GetMotionMaster()->MovePoint(0, 748.309f, 619.487f, 411.171f);
- - pAnnouncer->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- - pAnnouncer->SummonGameObject(instance->IsHeroic()? GO_PALETRESS_LOOT_H : GO_PALETRESS_LOOT, 746.59f, 618.49f, 411.09f, 1.42f, 0, 0, 0, 0, 90000);
- + for(GuidList::const_iterator itr = VehicleList.begin(); itr != VehicleList.end(); ++itr)
- + if (Creature* pSummon = instance->GetCreature(*itr))
- + pSummon->RemoveFromWorld();
- + } else if (uiData == DONE)
- + {
- + if (Creature* pAnnouncer = instance->GetCreature(uiAnnouncerGUID))
- + {
- + pAnnouncer->GetMotionMaster()->MovePoint(0,748.309f, 619.487f, 411.171f);
- + pAnnouncer->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- + pAnnouncer->SummonGameObject(instance->IsHeroic()? GO_PALETRESS_LOOT_H : GO_PALETRESS_LOOT,746.59f, 618.49f, 411.09f, 1.42f, 0, 0, 0, 0,90000000);
- + }
- }
- break;
- + case BOSS_BLACK_KNIGHT:
- + if (uiData == DONE)
- + events.ScheduleEvent(EVENT_OUTRO_1, 4000);
- + break;
- }
- if (uiData == DONE)
- SaveToDB();
- }
- - uint32 GetData(uint32 uiData) const override
- + uint32 GetData(uint32 uiData) const
- {
- - switch (uiData)
- + switch(uiData)
- {
- case BOSS_GRAND_CHAMPIONS: return m_auiEncounter[0];
- case BOSS_ARGENT_CHALLENGE_E: return m_auiEncounter[1];
- @@ -232,6 +381,7 @@ public:
- case DATA_MOVEMENT_DONE: return uiMovementDone;
- case DATA_ARGENT_SOLDIER_DEFEATED: return uiArgentSoldierDeaths;
- + case DATA_TEAM_IN_INSTANCE: return TeamInInstance;
- }
- return 0;
- @@ -239,10 +389,14 @@ public:
- ObjectGuid GetGuidData(uint32 uiData) const override
- {
- - switch (uiData)
- + switch(uiData)
- {
- case DATA_ANNOUNCER: return uiAnnouncerGUID;
- + case DATA_ARGENT_CHAMPION: return uiArgentChampionGUID;
- + case DATA_BLACK_KNIGHT: return blackknightGUID;
- + case DATA_HIGHLORD: return uiHighlordGUID;
- case DATA_MAIN_GATE: return uiMainGateGUID;
- + case DATA_MAIN_GATE1: return uiMainGate1GUID;
- case DATA_GRAND_CHAMPION_1: return uiGrandChampion1GUID;
- case DATA_GRAND_CHAMPION_2: return uiGrandChampion2GUID;
- @@ -254,7 +408,7 @@ public:
- void SetGuidData(uint32 uiType, ObjectGuid uiData) override
- {
- - switch (uiType)
- + switch(uiType)
- {
- case DATA_GRAND_CHAMPION_1:
- uiGrandChampion1GUID = uiData;
- @@ -268,18 +422,18 @@ public:
- }
- }
- - std::string GetSaveData() override
- + std::string GetSaveData()
- {
- OUT_SAVE_INST_DATA;
- std::ostringstream saveStream;
- saveStream << "T C " << m_auiEncounter[0]
- - << ' ' << m_auiEncounter[1]
- - << ' ' << m_auiEncounter[2]
- - << ' ' << m_auiEncounter[3]
- - << ' ' << uiGrandChampionsDeaths
- - << ' ' << uiMovementDone;
- + << " " << m_auiEncounter[1]
- + << " " << m_auiEncounter[2]
- + << " " << m_auiEncounter[3]
- + << " " << uiGrandChampionsDeaths
- + << " " << uiMovementDone;
- str_data = saveStream.str();
- @@ -287,7 +441,7 @@ public:
- return str_data;
- }
- - void Load(const char* in) override
- + void Load(const char* in)
- {
- if (!in)
- {
- @@ -310,7 +464,7 @@ public:
- m_auiEncounter[2] = data2;
- m_auiEncounter[3] = data3;
- - for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
- + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i)
- if (m_auiEncounter[i] == IN_PROGRESS)
- m_auiEncounter[i] = NOT_STARTED;
- @@ -320,11 +474,62 @@ public:
- OUT_LOAD_INST_DATA_COMPLETE;
- }
- +
- + void Update(uint32 uiDiff) override
- + {
- + events.Update(uiDiff);
- +
- + while (uint32 eventId = events.ExecuteEvent())
- + {
- + switch (eventId)
- + {
- + case EVENT_OUTRO_1:
- + if (Creature* tirion = instance->GetCreature(uiHighlordGUID))
- + tirion->AI()->Talk(SAY_OUTRO_1_TIRION);
- + events.ScheduleEvent(EVENT_OUTRO_2, 5000);
- + break;
- + case EVENT_OUTRO_2:
- + if (Creature* tirion = instance->GetCreature(uiHighlordGUID))
- + tirion->AI()->Talk(SAY_OUTRO_2_TIRION);
- + events.ScheduleEvent(EVENT_OUTRO_3, 5000);
- + break;
- + case EVENT_OUTRO_3:
- + if (GetData(DATA_TEAM_IN_INSTANCE) == HORDE)
- + {
- + if (Creature* thrall = instance->GetCreature(uiThrallGUID))
- + thrall->AI()->Talk(SAY_OUTRO_3_HORDE);
- + }
- + else
- + if (Creature* varian = instance->GetCreature(uiVarianGUID))
- + varian->AI()->Talk(SAY_OUTRO_3_ALLY);
- + break;
- + }
- + }
- + }
- };
- };
- +void HandleSpellOnPlayersInInstanceToC5(Unit* caller, uint32 spellId)
- +{
- + if (spellId <= 0 || !caller)
- + return;
- +
- + Map* map = caller->GetMap();
- + if (map && map->IsDungeon())
- + {
- + Map::PlayerList const &PlayerList = map->GetPlayers();
- +
- + if (PlayerList.isEmpty())
- + return;
- +
- + for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
- + if (i->GetSource() && i->GetSource()->IsAlive() && !i->GetSource()->IsGameMaster())
- + caller->CastSpell(i->GetSource(), spellId);
- + }
- +}
- +
- void AddSC_instance_trial_of_the_champion()
- {
- new instance_trial_of_the_champion();
- -}
- +}
- \ No newline at end of file
- diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp
- index 96dc372..58c6dcb 100644
- --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp
- +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp
- @@ -1,5 +1,6 @@
- /*
- * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- @@ -15,124 +16,266 @@
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
- -/* ScriptData
- -SDName: Trial Of the Champion
- -SD%Complete:
- -SDComment:
- -SDCategory: trial_of_the_champion
- -EndScriptData */
- -
- -/* ContentData
- -npc_announcer_toc5
- -EndContentData */
- -
- -#include "ScriptMgr.h"
- -#include "ScriptedCreature.h"
- -#include "ScriptedGossip.h"
- +#include "ScriptPCH.h"
- #include "trial_of_the_champion.h"
- #include "Vehicle.h"
- #include "Player.h"
- -enum Yells
- -{
- - SAY_INTRO_1 = 0,
- - SAY_INTRO_2 = 1,
- - SAY_INTRO_3 = 2,
- - SAY_AGGRO = 3,
- - SAY_PHASE_2 = 4,
- - SAY_PHASE_3 = 5,
- - SAY_KILL_PLAYER = 6,
- - SAY_DEATH = 7
- -};
- -
- -#define GOSSIP_START_EVENT1 "I'm ready to start challenge."
- -#define GOSSIP_START_EVENT2 "I'm ready for the next challenge."
- +#define GOSSIP_START_EVENT1 "Я готов начать испытание."
- +#define GOSSIP_START_EVENT2 "Я готов к следующему испытанию."
- #define ORIENTATION 4.714f
- /*######
- -## npc_announcer_toc5
- +## npc_herald_toc5
- ######*/
- -const Position SpawnPosition = {746.261f, 657.401f, 411.681f, 4.65f};
- +const Position SpawnPosition = {746.843f, 695.68f, 412.339f, 4.70776f};
- +const Position SpawnPosition1 = {746.71f, 661.02f, 411.69f, 4.66995f};
- -class npc_announcer_toc5 : public CreatureScript
- +enum Texts
- {
- -public:
- - npc_announcer_toc5() : CreatureScript("npc_announcer_toc5") { }
- + // Starts when you enter toc
- + SAY_INTRO_HERALD_1 = 27,
- + SAY_INTRO_HERALD_2 = 50,
- + H_SAY_INTRO_HERALD_3 = 0,
- + A_SAY_INTRO_HERALD_3 = 50,
- + H_SAY_INTRO_HERALD_4 = 50,
- + A_SAY_INTRO_HERALD_4 = 10,
- + SAY_INTRO_HERALD_5 = 52,
- + H_SAY_INTRO_HERALD_6 = 11,
- + A_SAY_INTRO_HERALD_6 = 2,
- + SAY_INTRO_HERALD_7 = 51,
- +
- + // Horde - Announcing the fighters
- + H_SAY_WARRIOR_ENTERS = 6,
- + H_SAY_MAGE_ENTERS = 5,
- + H_SAY_SHAMAN_ENTERS = 3,
- + H_SAY_ROGUE_ENTERS = 7,
- +
- + // Alliance - Announcing the fighters
- + A_SAY_WARRIOR_ENTERS = 5,
- + A_SAY_MAGE_ENTERS = 3,
- + A_SAY_SHAMAN_ENTERS = 7,
- + A_SAY_ROGUE_ENTERS = 6,
- +
- + // Shared emotes - announcer
- + SAY_WARRIOR_CHEER = 20,
- + SAY_MAGE_CHEER = 21,
- + SAY_SHAMAN_CHEER = 22,
- + SAY_HUNTER_CHEER = 23,
- + SAY_ROGUE_CHEER = 24,
- + SAY_HUNTER_ENTERS = 4,
- +
- + // Argent Champion
- + SAY_ARGENT_CHAMP_ENTERS = 53,
- + SAY_PALETRESS_INTRO_1 = 1,
- + SAY_PALETRESS_INTRO_2 = 25,
- + SAY_PALETRESS_INTRO_3 = 0,
- + SAY_PALETRESS_INTRO_4 = 1,
- + SAY_EADRIC_INTRO_1 = 0,
- + SAY_EADRIC_INTRO_2 = 26,
- + SAY_EADRIC_INTRO_3 = 0,
- +
- + // Black Knight
- + SAY_INTRO_BLACK_KNIGHT_TIRION = 55,
- + SAY_HERALD_RAFTERS = 8
- +};
- +
- +enum Gossip
- +{
- + GOSSIP_NOT_MOUNTED_A = 14757,
- + GOSSIP_NOT_MOUNTED_H = 15043
- +};
- +
- +enum Events
- +{
- + EVENT_INTRO_1 = 1,
- + EVENT_INTRO_2 = 2,
- + EVENT_INTRO_3 = 3,
- + EVENT_INTRO_4 = 4,
- + EVENT_INTRO_5 = 5,
- + EVENT_INTRO_6 = 6,
- + EVENT_INTRO_7 = 7,
- + EVENT_INTRO_8 = 8,
- + EVENT_SUMMON_FACTION_2 = 9,
- + EVENT_SUMMON_FACTION_3 = 10,
- + EVENT_AGGRO_FACTION = 11,
- + EVENT_PALETRESS_1 = 12,
- + EVENT_PALETRESS_2 = 13,
- + EVENT_PALETRESS_3 = 14,
- + EVENT_EADRIC_1 = 15,
- + EVENT_EADRIC_2 = 16
- +};
- +
- +enum Phases
- +{
- + PHASE_INTRO = 1,
- + PHASE_INPROGRESS = 2,
- +
- + PHASE_INTRO_MASK = 1 << PHASE_INTRO,
- + PHASE_INPROGRESS_MASK = 2 << PHASE_INPROGRESS
- +};
- +
- +enum Spells
- +{
- + SPELL_FACE_BLACKKNIGHT = 67482,
- + SPELL_HERALD_ARGENT = 64787
- +};
- +
- +class npc_herald_toc5 : public CreatureScript
- +{
- + public:
- + npc_herald_toc5(): CreatureScript("npc_herald_toc5") { }
- +
- + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
- + {
- + player->PlayerTalkClass->ClearMenus();
- + if (action == GOSSIP_ACTION_INFO_DEF + 1)
- + {
- + player->CLOSE_GOSSIP_MENU();
- + CAST_AI(npc_herald_toc5::npc_herald_toc5AI, creature->AI())->StartEncounter();
- + }
- - struct npc_announcer_toc5AI : public ScriptedAI
- + return true;
- + }
- +
- + bool OnGossipHello(Player* player, Creature* creature) override
- {
- - npc_announcer_toc5AI(Creature* creature) : ScriptedAI(creature)
- + InstanceScript* instance = creature->GetInstanceScript();
- +
- + if (!player->GetVehicle() && instance->GetData(BOSS_GRAND_CHAMPIONS) == NOT_STARTED)
- + {
- + if (instance->GetData(DATA_TEAM_IN_INSTANCE) == HORDE)
- + player->SEND_GOSSIP_MENU(GOSSIP_NOT_MOUNTED_H, creature->GetGUID());
- + else
- + player->SEND_GOSSIP_MENU(GOSSIP_NOT_MOUNTED_A, creature->GetGUID());
- +
- + return true;
- + }
- +
- + else
- + {
- + if (instance &&
- + instance->GetData(BOSS_GRAND_CHAMPIONS) == DONE &&
- + instance->GetData(BOSS_BLACK_KNIGHT) == DONE &&
- + (instance->GetData(BOSS_ARGENT_CHALLENGE_E) == DONE ||
- + instance->GetData(BOSS_ARGENT_CHALLENGE_P) == DONE))
- +
- + return false;
- +
- + if (instance &&
- + instance->GetData(BOSS_GRAND_CHAMPIONS) == NOT_STARTED &&
- + instance->GetData(BOSS_ARGENT_CHALLENGE_E) == NOT_STARTED &&
- + instance->GetData(BOSS_ARGENT_CHALLENGE_P) == NOT_STARTED &&
- + instance->GetData(BOSS_BLACK_KNIGHT) == NOT_STARTED)
- + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_START_EVENT1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- + else if (instance)
- + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_START_EVENT2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- +
- + player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
- +
- + return true;
- + }
- + }
- +
- + struct npc_herald_toc5AI : public ScriptedAI
- + {
- + npc_herald_toc5AI(Creature *creature) : ScriptedAI(creature)
- {
- instance = creature->GetInstanceScript();
- uiSummonTimes = 0;
- uiPosition = 0;
- uiLesserChampions = 0;
- + uiDefeatedGrandChampions = 0;
- uiFirstBoss = 0;
- uiSecondBoss = 0;
- uiThirdBoss = 0;
- - uiArgentChampion = 0;
- + ArgentChampion = 0;
- - uiPhase = 0;
- - uiTimer = 0;
- + Champion1List.clear();
- + Champion2List.clear();
- + Champion3List.clear();
- - me->SetReactState(REACT_PASSIVE);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- -
- SetGrandChampionsForEncounter();
- SetArgentChampion();
- }
- + EventMap events;
- InstanceScript* instance;
- + Creature* vehicle_black_knight;
- uint8 uiSummonTimes;
- uint8 uiPosition;
- uint8 uiLesserChampions;
- + uint8 uiIntroPhase;
- + uint8 uiDefeatedGrandChampions;
- - uint32 uiArgentChampion;
- -
- + uint32 ArgentChampion;
- uint32 uiFirstBoss;
- uint32 uiSecondBoss;
- uint32 uiThirdBoss;
- - uint32 uiPhase;
- - uint32 uiTimer;
- + ObjectGuid thrallGUID;
- + ObjectGuid garroshGUID;
- + ObjectGuid varianGUID;
- + ObjectGuid proudmooreGUID;
- + ObjectGuid tirionGUID;
- + ObjectGuid BlackKnightGUID;
- ObjectGuid uiVehicle1GUID;
- ObjectGuid uiVehicle2GUID;
- ObjectGuid uiVehicle3GUID;
- + ObjectGuid GrandChampionBoss;
- GuidList Champion1List;
- GuidList Champion2List;
- GuidList Champion3List;
- - void NextStep(uint32 uiTimerStep, bool bNextStep = true, uint8 uiPhaseStep = 0)
- + bool _introDone;
- +
- + void Reset() override
- {
- - uiTimer = uiTimerStep;
- - if (bNextStep)
- - ++uiPhase;
- - else
- - uiPhase = uiPhaseStep;
- + _introDone = false;
- + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- }
- - void SetData(uint32 uiType, uint32 /*uiData*/) override
- + void MoveInLineOfSight(Unit* who) override
- + {
- + if (!_introDone && (instance->GetData(BOSS_GRAND_CHAMPIONS) != DONE && instance->GetData(BOSS_GRAND_CHAMPIONS) != FAIL) && me->IsWithinDistInMap(who, 75.0f))
- + {
- + _introDone = true;
- + me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- +
- + events.SetPhase(PHASE_INTRO);
- + events.ScheduleEvent(EVENT_INTRO_1, 10000, 0, PHASE_INTRO);
- +
- + SummonNpcs();
- + }
- + }
- +
- + void SetData(uint32 uiType, uint32 uiData) override
- {
- switch (uiType)
- {
- case DATA_START:
- + if (GameObject* pGO = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(DATA_MAIN_GATE)))
- + instance->HandleGameObject(pGO->GetGUID(),true);
- + if (GameObject* pGO = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(DATA_MAIN_GATE1)))
- + instance->HandleGameObject(pGO->GetGUID(),false);
- DoSummonGrandChampion(uiFirstBoss);
- - NextStep(10000, false, 1);
- + events.ScheduleEvent(EVENT_SUMMON_FACTION_2, 10000, 0, PHASE_INPROGRESS);
- break;
- - case DATA_IN_POSITION: //movement done.
- - me->GetMotionMaster()->MovePoint(1, 735.81f, 661.92f, 412.39f);
- - if (GameObject* go = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(DATA_MAIN_GATE)))
- - instance->HandleGameObject(go->GetGUID(), false);
- - NextStep(10000, false, 3);
- + case DATA_IN_POSITION:
- + me->GetMotionMaster()->MovePoint(1, 735.898f, 651.961f, 411.93f);
- + if (GameObject* pGO = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(DATA_MAIN_GATE)))
- + instance->HandleGameObject(pGO->GetGUID(),false);
- + events.ScheduleEvent(EVENT_AGGRO_FACTION, 15000, 0, PHASE_INPROGRESS);
- break;
- case DATA_LESSER_CHAMPIONS_DEFEATED:
- {
- @@ -140,7 +283,7 @@ public:
- GuidList TempList;
- if (uiLesserChampions == 3 || uiLesserChampions == 6)
- {
- - switch (uiLesserChampions)
- + switch(uiLesserChampions)
- {
- case 3:
- TempList = Champion2List;
- @@ -150,17 +293,49 @@ public:
- break;
- }
- - for (GuidList::const_iterator itr = TempList.begin(); itr != TempList.end(); ++itr)
- + for(GuidList::const_iterator itr = TempList.begin(); itr != TempList.end(); ++itr)
- if (Creature* summon = ObjectAccessor::GetCreature(*me, *itr))
- AggroAllPlayers(summon);
- - }else if (uiLesserChampions == 9)
- + } else if (uiLesserChampions == 9)
- StartGrandChampionsAttack();
- -
- break;
- }
- + case DATA_GRAND_CHAMPIONS_DEFEATED:
- + uiDefeatedGrandChampions = uiData;
- + if (uiDefeatedGrandChampions == 3)
- + {
- + for (uint8 i = 0; i < 3; ++i)
- + if (Creature* GrandChampion = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_GRAND_CHAMPION_1 + i)))
- + {
- + switch (i)
- + {
- + case 0:
- + GrandChampion->SetHomePosition(739.678f, 662.541f, 412.393f, 4.6f);
- + break;
- + case 1:
- + GrandChampion->SetHomePosition(746.71f, 661.02f, 411.69f, 4.6f);
- + break;
- + case 2:
- + GrandChampion->SetHomePosition(754.34f, 660.70f, 412.39f, 4.6f);
- + break;
- + }
- + GrandChampion->AI()->SetData(10, 0);
- + }
- +
- + instance->SetData(BOSS_GRAND_CHAMPIONS, IN_PROGRESS);
- + }
- + break;
- }
- }
- + uint32 GetData(uint32 type)
- + {
- + if (type == DATA_GRAND_CHAMPIONS_DEFEATED)
- + return uiDefeatedGrandChampions;
- +
- + return 0;
- + }
- +
- void StartGrandChampionsAttack()
- {
- Creature* pGrandChampion1 = ObjectAccessor::GetCreature(*me, uiVehicle1GUID);
- @@ -175,15 +350,46 @@ public:
- }
- }
- - void MovementInform(uint32 uiType, uint32 uiPointId) override
- + void MovementInform(uint32 uiType, uint32 uiPointId) override
- {
- if (uiType != POINT_MOTION_TYPE)
- return;
- if (uiPointId == 1)
- - me->SetFacingTo(ORIENTATION);
- + {
- + me->SetOrientation(ORIENTATION);
- + me->SendMovementFlagUpdate();
- + }
- + }
- +
- + void JustSummoned(Creature* summon) override
- + {
- + if (instance && instance->GetData(BOSS_GRAND_CHAMPIONS) == NOT_STARTED)
- + {
- + summon->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE);
- + summon->SetReactState(REACT_PASSIVE);
- + }
- }
- + void SummonedCreatureDespawn(Creature* summon) override
- + {
- + switch(summon->GetEntry())
- + {
- + case VEHICLE_DARNASSIA_NIGHTSABER:
- + case VEHICLE_EXODAR_ELEKK:
- + case VEHICLE_STORMWIND_STEED:
- + case VEHICLE_GNOMEREGAN_MECHANOSTRIDER:
- + case VEHICLE_IRONFORGE_RAM:
- + case VEHICLE_FORSAKE_WARHORSE:
- + case VEHICLE_THUNDER_BLUFF_KODO:
- + case VEHICLE_ORGRIMMAR_WOLF:
- + case VEHICLE_SILVERMOON_HAWKSTRIDER:
- + case VEHICLE_DARKSPEAR_RAPTOR:
- + me->AI()->SetData(DATA_LESSER_CHAMPIONS_DEFEATED, 0);
- + break;
- + }
- + }
- +
- void DoSummonGrandChampion(uint32 uiBoss)
- {
- ++uiSummonTimes;
- @@ -192,22 +398,44 @@ public:
- switch (uiBoss)
- {
- case 0:
- + if (instance->GetData(DATA_TEAM_IN_INSTANCE) == HORDE)
- + Talk(H_SAY_WARRIOR_ENTERS);
- + else
- + Talk(A_SAY_WARRIOR_ENTERS);
- + Talk(SAY_WARRIOR_CHEER);
- VEHICLE_TO_SUMMON1 = VEHICLE_MOKRA_SKILLCRUSHER_MOUNT;
- VEHICLE_TO_SUMMON2 = VEHICLE_ORGRIMMAR_WOLF;
- break;
- case 1:
- + if (instance->GetData(DATA_TEAM_IN_INSTANCE) == HORDE)
- + Talk(H_SAY_MAGE_ENTERS);
- + else
- + Talk(A_SAY_MAGE_ENTERS);
- + Talk(SAY_MAGE_CHEER);
- VEHICLE_TO_SUMMON1 = VEHICLE_ERESSEA_DAWNSINGER_MOUNT;
- VEHICLE_TO_SUMMON2 = VEHICLE_SILVERMOON_HAWKSTRIDER;
- break;
- case 2:
- + if (instance->GetData(DATA_TEAM_IN_INSTANCE) == HORDE)
- + Talk(H_SAY_SHAMAN_ENTERS);
- + else
- + Talk(A_SAY_SHAMAN_ENTERS);
- + Talk(SAY_SHAMAN_CHEER);
- VEHICLE_TO_SUMMON1 = VEHICLE_RUNOK_WILDMANE_MOUNT;
- VEHICLE_TO_SUMMON2 = VEHICLE_THUNDER_BLUFF_KODO;
- break;
- case 3:
- + Talk(SAY_HUNTER_ENTERS);
- + Talk(SAY_HUNTER_CHEER);
- VEHICLE_TO_SUMMON1 = VEHICLE_ZUL_TORE_MOUNT;
- VEHICLE_TO_SUMMON2 = VEHICLE_DARKSPEAR_RAPTOR;
- break;
- case 4:
- + if (instance->GetData(DATA_TEAM_IN_INSTANCE) == HORDE)
- + Talk(H_SAY_ROGUE_ENTERS);
- + else
- + Talk(A_SAY_ROGUE_ENTERS);
- + Talk(SAY_ROGUE_CHEER);
- VEHICLE_TO_SUMMON1 = VEHICLE_DEATHSTALKER_VESCERI_MOUNT;
- VEHICLE_TO_SUMMON2 = VEHICLE_FORSAKE_WARHORSE;
- break;
- @@ -215,43 +443,55 @@ public:
- return;
- }
- - if (Creature* pBoss = me->SummonCreature(VEHICLE_TO_SUMMON1, SpawnPosition))
- + if (Creature* pBoss = me->SummonCreature(VEHICLE_TO_SUMMON1,SpawnPosition))
- {
- - switch (uiSummonTimes)
- + switch(uiSummonTimes)
- {
- case 1:
- {
- uiVehicle1GUID = pBoss->GetGUID();
- - ObjectGuid uiGrandChampionBoss1;
- - if (Vehicle* pVehicle = pBoss->GetVehicleKit())
- - if (Unit* unit = pVehicle->GetPassenger(0))
- - uiGrandChampionBoss1 = unit->GetGUID();
- - instance->SetGuidData(DATA_GRAND_CHAMPION_VEHICLE_1, uiVehicle1GUID);
- - instance->SetGuidData(DATA_GRAND_CHAMPION_1, uiGrandChampionBoss1);
- - pBoss->AI()->SetData(1, 0);
- + uint64 uiGrandChampionBoss1 = 0;
- + if (Creature* pBoss = ObjectAccessor::GetCreature(*me, uiVehicle1GUID))
- + if (Vehicle* pVehicle = pBoss->GetVehicleKit())
- + if (Unit* pUnit = pVehicle->GetPassenger(0))
- + uiGrandChampionBoss1 = pUnit->GetGUID();
- + if (instance)
- + {
- + instance->SetData64(DATA_GRAND_CHAMPION_VEHICLE_1, uiVehicle1GUID);
- + instance->SetData64(DATA_GRAND_CHAMPION_1, uiGrandChampionBoss1);
- + }
- + pBoss->AI()->SetData(1,0);
- break;
- }
- case 2:
- {
- uiVehicle2GUID = pBoss->GetGUID();
- - ObjectGuid uiGrandChampionBoss2;
- - if (Vehicle* pVehicle = pBoss->GetVehicleKit())
- - if (Unit* unit = pVehicle->GetPassenger(0))
- - uiGrandChampionBoss2 = unit->GetGUID();
- - instance->SetGuidData(DATA_GRAND_CHAMPION_VEHICLE_2, uiVehicle2GUID);
- - instance->SetGuidData(DATA_GRAND_CHAMPION_2, uiGrandChampionBoss2);
- + uint64 uiGrandChampionBoss2 = 0;
- + if (Creature* pBoss = ObjectAccessor::GetCreature(*me, uiVehicle2GUID))
- + if (Vehicle* pVehicle = pBoss->GetVehicleKit())
- + if (Unit* pUnit = pVehicle->GetPassenger(0))
- + uiGrandChampionBoss2 = pUnit->GetGUID();
- + if (instance)
- + {
- + instance->SetData64(DATA_GRAND_CHAMPION_VEHICLE_2, uiVehicle2GUID);
- + instance->SetData64(DATA_GRAND_CHAMPION_2, uiGrandChampionBoss2);
- + }
- pBoss->AI()->SetData(2, 0);
- break;
- }
- case 3:
- {
- uiVehicle3GUID = pBoss->GetGUID();
- - ObjectGuid uiGrandChampionBoss3;
- - if (Vehicle* pVehicle = pBoss->GetVehicleKit())
- - if (Unit* unit = pVehicle->GetPassenger(0))
- - uiGrandChampionBoss3 = unit->GetGUID();
- - instance->SetGuidData(DATA_GRAND_CHAMPION_VEHICLE_3, uiVehicle3GUID);
- - instance->SetGuidData(DATA_GRAND_CHAMPION_3, uiGrandChampionBoss3);
- + uint64 uiGrandChampionBoss3 = 0;
- + if (Creature* pBoss = ObjectAccessor::GetCreature(*me, uiVehicle3GUID))
- + if (Vehicle* pVehicle = pBoss->GetVehicleKit())
- + if (Unit* pUnit = pVehicle->GetPassenger(0))
- + uiGrandChampionBoss3 = pUnit->GetGUID();
- + if (instance)
- + {
- + instance->SetData64(DATA_GRAND_CHAMPION_VEHICLE_3, uiVehicle3GUID);
- + instance->SetData64(DATA_GRAND_CHAMPION_3, uiGrandChampionBoss3);
- + }
- pBoss->AI()->SetData(3, 0);
- break;
- }
- @@ -261,7 +501,7 @@ public:
- for (uint8 i = 0; i < 3; ++i)
- {
- - if (Creature* pAdd = me->SummonCreature(VEHICLE_TO_SUMMON2, SpawnPosition, TEMPSUMMON_CORPSE_DESPAWN))
- + if (Creature* pAdd = me->SummonCreature(VEHICLE_TO_SUMMON2,SpawnPosition,TEMPSUMMON_CORPSE_DESPAWN))
- {
- switch (uiSummonTimes)
- {
- @@ -279,95 +519,130 @@ public:
- switch (i)
- {
- case 0:
- - pAdd->GetMotionMaster()->MoveFollow(pBoss, 2.0f, float(M_PI));
- + pAdd->GetMotionMaster()->MoveFollow(pBoss, 2.5f, M_PI);
- break;
- case 1:
- - pAdd->GetMotionMaster()->MoveFollow(pBoss, 2.0f, float(M_PI) / 2);
- + pAdd->GetMotionMaster()->MoveFollow(pBoss, 2.5f, M_PI / 2);
- break;
- case 2:
- - pAdd->GetMotionMaster()->MoveFollow(pBoss, 2.0f, float(M_PI) / 2 + float(M_PI));
- + pAdd->GetMotionMaster()->MoveFollow(pBoss, 2.5f, M_PI / 2 + M_PI);
- break;
- }
- }
- -
- }
- }
- }
- void DoStartArgentChampionEncounter()
- {
- - me->GetMotionMaster()->MovePoint(1, 735.81f, 661.92f, 412.39f);
- + if (Creature* tirion = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_HIGHLORD)))
- + tirion->AI()->Talk(SAY_ARGENT_CHAMP_ENTERS);
- +
- + if (ArgentChampion == NPC_PALETRESS)
- + events.ScheduleEvent(EVENT_PALETRESS_1, 5000);
- + else
- + events.ScheduleEvent(EVENT_EADRIC_1, 5000);
- - if (me->SummonCreature(uiArgentChampion, SpawnPosition))
- + if (Creature* pBoss = me->SummonCreature(ArgentChampion,SpawnPosition))
- {
- + pBoss->GetMotionMaster()->MovePoint(1,746.71f,661.02f,411.69f);
- for (uint8 i = 0; i < 3; ++i)
- {
- - if (Creature* pTrash = me->SummonCreature(NPC_ARGENT_LIGHWIELDER, SpawnPosition))
- - pTrash->AI()->SetData(i, 0);
- - if (Creature* pTrash = me->SummonCreature(NPC_ARGENT_MONK, SpawnPosition))
- - pTrash->AI()->SetData(i, 0);
- - if (Creature* pTrash = me->SummonCreature(NPC_PRIESTESS, SpawnPosition))
- - pTrash->AI()->SetData(i, 0);
- + if (Creature* pTrash = me->SummonCreature(NPC_ARGENT_LIGHWIELDER,SpawnPosition))
- + pTrash->AI()->SetData(i,0);
- + if (Creature* pTrash = me->SummonCreature(NPC_ARGENT_MONK,SpawnPosition))
- + pTrash->AI()->SetData(i,0);
- + if (Creature* pTrash = me->SummonCreature(NPC_PRIESTESS,SpawnPosition))
- + pTrash->AI()->SetData(i,0);
- }
- }
- }
- +
- + void DoAction(int32 actionID)
- + {
- + if (actionID == ACTION_RESET_BLACK_KNIGHT)
- + StartEncounter();
- + }
- +
- + void EnterCombat(Unit* /*who*/) override
- + {
- + me->SetReactState(REACT_PASSIVE);
- + if (Creature* pGhoul = me->SummonCreature(NPC_RISEN_JAEREN, 742.835f, 639.134f, 411.571f, 1.05731f))
- + {
- + pGhoul->setFaction(14);
- + }
- + if (instance)
- + instance->SetData(DATA_AGRO_DONE,DONE);
- + }
- void SetGrandChampionsForEncounter()
- {
- - uiFirstBoss = urand(0, 4);
- + uiFirstBoss = urand(0,4);
- - while (uiSecondBoss == uiFirstBoss || uiThirdBoss == uiFirstBoss || uiThirdBoss == uiSecondBoss)
- + while(uiSecondBoss == uiFirstBoss || uiThirdBoss == uiFirstBoss || uiThirdBoss == uiSecondBoss)
- {
- - uiSecondBoss = urand(0, 4);
- - uiThirdBoss = urand(0, 4);
- + uiSecondBoss = urand(0,4);
- + uiThirdBoss = urand(0,4);
- }
- }
- void SetArgentChampion()
- {
- - uint8 uiTempBoss = urand(0, 1);
- + uint8 uiTempBoss = urand(0,1);
- - switch (uiTempBoss)
- - {
- + switch(uiTempBoss)
- + {
- case 0:
- - uiArgentChampion = NPC_EADRIC;
- + ArgentChampion = NPC_EADRIC;
- break;
- case 1:
- - uiArgentChampion = NPC_PALETRESS;
- + ArgentChampion = NPC_PALETRESS;
- break;
- - }
- + }
- }
- void StartEncounter()
- {
- + if (!instance)
- + return;
- +
- me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- + if (GameObject* pGO = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(DATA_MAIN_GATE1)))
- + instance->HandleGameObject(pGO->GetGUID(),false);
- if (instance->GetData(BOSS_BLACK_KNIGHT) == NOT_STARTED)
- {
- if (instance->GetData(BOSS_ARGENT_CHALLENGE_E) == NOT_STARTED && instance->GetData(BOSS_ARGENT_CHALLENGE_P) == NOT_STARTED)
- {
- if (instance->GetData(BOSS_GRAND_CHAMPIONS) == NOT_STARTED)
- - SetData(DATA_START, 0);
- + me->AI()->SetData(DATA_START,NOT_STARTED);
- if (instance->GetData(BOSS_GRAND_CHAMPIONS) == DONE)
- DoStartArgentChampionEncounter();
- }
- - if ((instance->GetData(BOSS_GRAND_CHAMPIONS) == DONE &&
- - instance->GetData(BOSS_ARGENT_CHALLENGE_E) == DONE) ||
- - instance->GetData(BOSS_ARGENT_CHALLENGE_P) == DONE)
- - me->SummonCreature(VEHICLE_BLACK_KNIGHT, 769.834f, 651.915f, 447.035f, 0);
- + if (instance->GetData(BOSS_GRAND_CHAMPIONS) == DONE && (instance->GetData(BOSS_ARGENT_CHALLENGE_E) == DONE || instance->GetData(BOSS_ARGENT_CHALLENGE_P) == DONE))
- + {
- + SummonNpcs();
- + me->SummonCreature(VEHICLE_BLACK_KNIGHT, 801.369507f, 640.574280f, 469.314362f, 3.97124f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
- + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- + me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- + me->SetReactState(REACT_AGGRESSIVE);
- + if (Creature* tirion = ObjectAccessor::GetCreature(*me, tirionGUID))
- + tirion->AI()->Talk(SAY_INTRO_BLACK_KNIGHT_TIRION);
- + Talk(SAY_HERALD_RAFTERS);
- + }
- }
- }
- - void AggroAllPlayers(Creature* temp)
- + void AggroAllPlayers(Creature* pTemp)
- {
- Map::PlayerList const &PlList = me->GetMap()->GetPlayers();
- if (PlList.isEmpty())
- return;
- - for (Map::PlayerList::const_iterator i = PlList.begin(); i != PlList.end(); ++i)
- + for(Map::PlayerList::const_iterator i = PlList.begin(); i != PlList.end(); ++i)
- {
- if (Player* player = i->GetSource())
- {
- @@ -376,122 +651,185 @@ public:
- if (player->IsAlive())
- {
- - temp->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation());
- - temp->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- - temp->SetReactState(REACT_AGGRESSIVE);
- - temp->SetInCombatWith(player);
- - player->SetInCombatWith(temp);
- - temp->AddThreat(player, 0.0f);
- + pTemp->SetHomePosition(me->GetPositionX(),me->GetPositionY(),me->GetPositionZ(),me->GetOrientation());
- + pTemp->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- + pTemp->SetReactState(REACT_AGGRESSIVE);
- + pTemp->SetInCombatWith(player);
- + player->SetInCombatWith(pTemp);
- + pTemp->AddThreat(player, 0.0f);
- }
- }
- }
- }
- - void UpdateAI(uint32 uiDiff) override
- + // Why can't these be pre-spawned already? -- Something to look forward...
- + void SummonNpcs()
- {
- - ScriptedAI::UpdateAI(uiDiff);
- + if (!me->FindNearestCreature(NPC_THRALL, 200.0f))
- + if (Creature* Thrall = me->SummonCreature(NPC_THRALL, 685.569f, 615.103f, 435.396f, 6.23544f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000))
- + {
- + thrallGUID = Thrall->GetGUID();
- + Thrall->SetReactState(REACT_PASSIVE);
- + Thrall->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- + }
- - if (uiTimer <= uiDiff)
- + if (!me->FindNearestCreature(NPC_GARROSH, 200.0f))
- + if (Creature* Garrosh = me->SummonCreature(NPC_GARROSH, 685.7f, 621.134f, 435.396f, 6.259f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000))
- + {
- + garroshGUID = Garrosh->GetGUID();
- + Garrosh->SetReactState(REACT_PASSIVE);
- + Garrosh->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- + }
- +
- + if (!me->FindNearestCreature(NPC_VARIAN, 200.0f))
- + if (Creature* Varian = me->SummonCreature(NPC_VARIAN, 807.724f, 617.9f, 435.396f, 3.18416f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000))
- + {
- + varianGUID = Varian->GetGUID();
- + Varian->SetReactState(REACT_PASSIVE);
- + Varian->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- + }
- +
- + if (!me->FindNearestCreature(NPC_JAINA_PROUDMOORE, 200.0f))
- + if (Creature* Proudmoore = me->SummonCreature(NPC_JAINA_PROUDMOORE, 807.401f, 613.667f, 435.397f, 3.0585f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000))
- + {
- + proudmooreGUID = Proudmoore->GetGUID();
- + Proudmoore->SetReactState(REACT_PASSIVE);
- + Proudmoore->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- + }
- +
- + if (!me->FindNearestCreature(NPC_HIGHLORD, 200.0f))
- + if (Creature* Tirion = me->SummonCreature(NPC_HIGHLORD, 746.482f, 556.857f, 435.396f, 1.5898f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000))
- + {
- + tirionGUID = Tirion->GetGUID();
- + Tirion->SetReactState(REACT_PASSIVE);
- + Tirion->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- + }
- + }
- +
- + void UpdateAI(uint32 diff) override
- + {
- + if (!(thrallGUID || garroshGUID || varianGUID || proudmooreGUID || tirionGUID))
- + return;
- +
- + events.Update(diff);
- +
- + while (uint32 eventId = events.ExecuteEvent())
- {
- - switch (uiPhase)
- + switch (eventId)
- {
- - case 1:
- + case EVENT_INTRO_1:
- + instance->DoCastSpellOnPlayers(SPELL_HERALD_ARGENT);
- + Talk(SAY_INTRO_HERALD_1);
- + events.ScheduleEvent(EVENT_INTRO_2, 5000, 0, PHASE_INTRO);
- + break;
- + case EVENT_INTRO_2:
- + if (Creature* tirion = ObjectAccessor::GetCreature(*me, tirionGUID))
- + tirion->AI()->Talk(SAY_INTRO_HERALD_2);
- + events.ScheduleEvent(EVENT_INTRO_3, 13000, 0, PHASE_INTRO);
- + break;
- + case EVENT_INTRO_3:
- + if (instance->GetData(DATA_TEAM_IN_INSTANCE) == HORDE)
- + {
- + if (Creature* thrall = ObjectAccessor::GetCreature(*me, thrallGUID))
- + thrall->AI()->Talk(H_SAY_INTRO_HERALD_3);
- + }
- + else
- + if (Creature* varian = ObjectAccessor::GetCreature(*me, varianGUID))
- + varian->AI()->Talk(A_SAY_INTRO_HERALD_3);
- + events.ScheduleEvent(EVENT_INTRO_4, 4000, 0, PHASE_INTRO);
- + break;
- + case EVENT_INTRO_4:
- + if (instance->GetData(DATA_TEAM_IN_INSTANCE) == HORDE)
- + {
- + if (Creature* garrosh = ObjectAccessor::GetCreature(*me, garroshGUID))
- + garrosh->AI()->Talk(H_SAY_INTRO_HERALD_4);
- + }
- + else
- + if (Creature* proudmoore = ObjectAccessor::GetCreature(*me, proudmooreGUID))
- + proudmoore->AI()->Talk(A_SAY_INTRO_HERALD_4);
- + events.ScheduleEvent(EVENT_INTRO_5, 4000, 0, PHASE_INTRO);
- + break;
- + case EVENT_INTRO_5:
- + if (instance->GetData(DATA_TEAM_IN_INSTANCE) == HORDE)
- + {
- + if (Creature* varian = ObjectAccessor::GetCreature(*me, varianGUID))
- + varian->AI()->Talk(SAY_INTRO_HERALD_5);
- + }
- + else
- + if (Creature* garrosh = ObjectAccessor::GetCreature(*me, garroshGUID))
- + garrosh->AI()->Talk(SAY_INTRO_HERALD_5);
- + events.ScheduleEvent(EVENT_INTRO_6, 6000, 0, PHASE_INTRO);
- + break;
- + case EVENT_INTRO_6:
- + if (instance->GetData(DATA_TEAM_IN_INSTANCE) == HORDE)
- + {
- + if (Creature* proudmoore = ObjectAccessor::GetCreature(*me, proudmooreGUID))
- + proudmoore->AI()->Talk(H_SAY_INTRO_HERALD_6);
- + }
- + else
- + if (Creature* thrall = ObjectAccessor::GetCreature(*me, thrallGUID))
- + thrall->AI()->Talk(A_SAY_INTRO_HERALD_6);
- + events.ScheduleEvent(EVENT_INTRO_7, 6000, 0, PHASE_INTRO);
- + break;
- + case EVENT_INTRO_7:
- + if (Creature* tirion = ObjectAccessor::GetCreature(*me, tirionGUID))
- + tirion->AI()->Talk(SAY_INTRO_HERALD_7);
- + events.ScheduleEvent(EVENT_INTRO_8, 1000, 0, PHASE_INTRO);
- + break;
- + case EVENT_INTRO_8:
- + me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- + events.SetPhase(PHASE_INPROGRESS);
- + break;
- + case EVENT_SUMMON_FACTION_2:
- DoSummonGrandChampion(uiSecondBoss);
- - NextStep(10000, true);
- + events.ScheduleEvent(EVENT_SUMMON_FACTION_3, 10000, 0, PHASE_INPROGRESS);
- break;
- - case 2:
- + case EVENT_SUMMON_FACTION_3:
- DoSummonGrandChampion(uiThirdBoss);
- - NextStep(0, false);
- break;
- - case 3:
- + case EVENT_AGGRO_FACTION:
- if (!Champion1List.empty())
- {
- - for (GuidList::const_iterator itr = Champion1List.begin(); itr != Champion1List.end(); ++itr)
- + for(GuidList::const_iterator itr = Champion1List.begin(); itr != Champion1List.end(); ++itr)
- if (Creature* summon = ObjectAccessor::GetCreature(*me, *itr))
- AggroAllPlayers(summon);
- - NextStep(0, false);
- }
- break;
- + case EVENT_PALETRESS_1:
- + Talk(SAY_PALETRESS_INTRO_1);
- + Talk(SAY_PALETRESS_INTRO_2);
- + events.ScheduleEvent(EVENT_PALETRESS_2, 5000, 0, PHASE_INPROGRESS);
- + break;
- + case EVENT_PALETRESS_2:
- + if (Creature* argentchamp = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_ARGENT_CHAMPION)))
- + argentchamp->AI()->Talk(SAY_PALETRESS_INTRO_3);
- + events.ScheduleEvent(EVENT_PALETRESS_3, 5000);
- + case EVENT_PALETRESS_3:
- + if (Creature* argentchamp = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_ARGENT_CHAMPION)))
- + argentchamp->AI()->Talk(SAY_PALETRESS_INTRO_4);
- + events.CancelEvent(EVENT_PALETRESS_3);
- + break;
- + case EVENT_EADRIC_1:
- + Talk(SAY_EADRIC_INTRO_1);
- + Talk(SAY_EADRIC_INTRO_2);
- + events.ScheduleEvent(EVENT_EADRIC_2, 5000);
- + break;
- + case EVENT_EADRIC_2:
- + if (Creature* argentchamp = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_ARGENT_CHAMPION)))
- + argentchamp->AI()->Talk(SAY_EADRIC_INTRO_3);
- + break;
- }
- - } else uiTimer -= uiDiff;
- -
- - if (!UpdateVictim())
- - return;
- - }
- -
- - void JustSummoned(Creature* summon) override
- - {
- - if (instance->GetData(BOSS_GRAND_CHAMPIONS) == NOT_STARTED)
- - {
- - summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- - summon->SetReactState(REACT_PASSIVE);
- - }
- - }
- -
- - void SummonedCreatureDespawn(Creature* summon) override
- - {
- - switch (summon->GetEntry())
- - {
- - case VEHICLE_DARNASSIA_NIGHTSABER:
- - case VEHICLE_EXODAR_ELEKK:
- - case VEHICLE_STORMWIND_STEED:
- - case VEHICLE_GNOMEREGAN_MECHANOSTRIDER:
- - case VEHICLE_IRONFORGE_RAM:
- - case VEHICLE_FORSAKE_WARHORSE:
- - case VEHICLE_THUNDER_BLUFF_KODO:
- - case VEHICLE_ORGRIMMAR_WOLF:
- - case VEHICLE_SILVERMOON_HAWKSTRIDER:
- - case VEHICLE_DARKSPEAR_RAPTOR:
- - SetData(DATA_LESSER_CHAMPIONS_DEFEATED, 0);
- - break;
- }
- }
- };
- CreatureAI* GetAI(Creature* creature) const override
- {
- - return GetInstanceAI<npc_announcer_toc5AI>(creature);
- - }
- -
- - bool OnGossipHello(Player* player, Creature* creature) override
- - {
- - InstanceScript* instance = creature->GetInstanceScript();
- -
- - if (instance &&
- - ((instance->GetData(BOSS_GRAND_CHAMPIONS) == DONE &&
- - instance->GetData(BOSS_BLACK_KNIGHT) == DONE &&
- - instance->GetData(BOSS_ARGENT_CHALLENGE_E) == DONE) ||
- - instance->GetData(BOSS_ARGENT_CHALLENGE_P) == DONE))
- - return false;
- -
- - if (instance &&
- - instance->GetData(BOSS_GRAND_CHAMPIONS) == NOT_STARTED &&
- - instance->GetData(BOSS_ARGENT_CHALLENGE_E) == NOT_STARTED &&
- - instance->GetData(BOSS_ARGENT_CHALLENGE_P) == NOT_STARTED &&
- - instance->GetData(BOSS_BLACK_KNIGHT) == NOT_STARTED)
- - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_START_EVENT1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- - else if (instance)
- - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_START_EVENT2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- -
- - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
- -
- - return true;
- - }
- -
- - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
- - {
- - player->PlayerTalkClass->ClearMenus();
- - if (action == GOSSIP_ACTION_INFO_DEF+1)
- - {
- - player->CLOSE_GOSSIP_MENU();
- - ENSURE_AI(npc_announcer_toc5::npc_announcer_toc5AI, creature->AI())->StartEncounter();
- - }
- -
- - return true;
- - }
- + return new npc_herald_toc5AI (creature);
- + };
- };
- void AddSC_trial_of_the_champion()
- {
- - new npc_announcer_toc5();
- -}
- + new npc_herald_toc5();
- +}
- \ No newline at end of file
- diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.h b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.h
- index 8367436..b210818 100644
- --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.h
- +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.h
- @@ -1,6 +1,5 @@
- /*
- * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/>
- - * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- @@ -19,8 +18,6 @@
- #ifndef DEF_TOC_H
- #define DEF_TOC_H
- -#define DataHeader "TC"
- -
- enum Data
- {
- BOSS_GRAND_CHAMPIONS,
- @@ -29,15 +26,27 @@ enum Data
- BOSS_BLACK_KNIGHT,
- DATA_MOVEMENT_DONE,
- DATA_LESSER_CHAMPIONS_DEFEATED,
- + DATA_GRAND_CHAMPIONS_DEFEATED,
- DATA_START,
- DATA_IN_POSITION,
- - DATA_ARGENT_SOLDIER_DEFEATED
- + DATA_ARGENT_SOLDIER_DEFEATED,
- + DATA_TEAM_IN_INSTANCE,
- + DATA_RESET,
- + DATA_AGGRO_DONE,
- + DATA_AGRO_DONE,
- + DATA_BLACK_KNIGHT,
- + DATA_KNIGHT,
- + DATA_THE_FACEROLLER,
- + DATA_IVE_HAD_WORSE
- };
- enum Data64
- {
- DATA_ANNOUNCER,
- + DATA_ARGENT_CHAMPION,
- + DATA_HIGHLORD,
- DATA_MAIN_GATE,
- + DATA_MAIN_GATE1,
- DATA_GRAND_CHAMPION_VEHICLE_1,
- DATA_GRAND_CHAMPION_VEHICLE_2,
- @@ -48,7 +57,7 @@ enum Data64
- DATA_GRAND_CHAMPION_3
- };
- -enum CreatureIds
- +enum Npcs
- {
- // Horde Champions
- NPC_MOKRA = 35572,
- @@ -64,6 +73,20 @@ enum CreatureIds
- NPC_JAELYNE = 34657,
- NPC_LANA = 34703,
- + // Faction champions horde
- + NPC_ORGRIMAR_CHAMPION = 35314,
- + NPC_SILVERMOON_CHAMPION = 35326,
- + NPC_THUNDER_CHAMPION = 35325,
- + NPC_TROLL_CHAMPION = 35323,
- + NPC_UNDERCITY_CHAMPION = 35327,
- +
- + // Faction champions alliance
- + NPC_STORMWIND_CHAMPION = 35328,
- + NPC_GNOMERAGN_CHAMPION = 35331,
- + NPC_EXODAR_CHAMPION = 35330,
- + NPC_DRNASSUS_CHAMPION = 35332,
- + NPC_IRONFORGE_CHAMPION = 35329,
- +
- NPC_EADRIC = 35119,
- NPC_PALETRESS = 34928,
- @@ -75,23 +98,61 @@ enum CreatureIds
- NPC_RISEN_JAEREN = 35545,
- NPC_RISEN_ARELAS = 35564,
- -
- +
- + // Announcer Start Event
- NPC_JAEREN = 35004,
- - NPC_ARELAS = 35005
- + NPC_ARELAS = 35005,
- + NPC_HIGHLORD = 34996,
- + NPC_THRALL = 34994,
- + NPC_GARROSH = 34995,
- + NPC_VARIAN = 34990,
- + NPC_JAINA_PROUDMOORE = 34992,
- +
- + // Memory
- + MEMORY_ALGALON = 35052,
- + MEMORY_ARCHIMONDE = 35041,
- + MEMORY_CHROMAGGUS = 35033,
- + MEMORY_CYANIGOSA = 35046,
- + MEMORY_DELRISSA = 35043,
- + MEMORY_ECK = 35047,
- + MEMORY_ENTROPIUS = 35044,
- + MEMORY_GRUUL = 35039,
- + MEMORY_HAKKAR = 35034,
- + MEMORY_HEIGAN = 35049,
- + MEMORY_HEROD = 35030,
- + MEMORY_HOGGER = 34942,
- + MEMORY_IGNIS = 35050,
- + MEMORY_ILLIDAN = 35042,
- + MEMORY_INGVAR = 35045,
- + MEMORY_KALITHRESH = 35037,
- + MEMORY_LUCIFRON = 35031,
- + MEMORY_MALCHEZAAR = 35038,
- + MEMORY_MUTANUS = 35029,
- + MEMORY_ONYXIA = 35048,
- + MEMORY_THUNDERAAN = 35032,
- + MEMORY_VANCLEEF = 35028,
- + MEMORY_VASHJ = 35040,
- + MEMORY_VEKNILASH = 35036,
- + MEMORY_VEZAX = 35051,
- +
- + // Vehicles
- + NPC_ARGENT_WARHORSE = 35644,
- + NPC_ARGENT_BATTLEWORG = 36558
- };
- enum GameObjects
- {
- GO_MAIN_GATE = 195647,
- + GO_MAIN_GATE1 = 195650,
- GO_CHAMPIONS_LOOT = 195709,
- - GO_CHAMPIONS_LOOT_H = 195710,
- + GO_CHAMPIONS_LOOT_H = 195710,
- GO_EADRIC_LOOT = 195374,
- GO_EADRIC_LOOT_H = 195375,
- GO_PALETRESS_LOOT = 195323,
- - GO_PALETRESS_LOOT_H = 195324
- + GO_PALETRESS_LOOT_H = 195324
- };
- enum Vehicles
- @@ -123,8 +184,24 @@ enum Vehicles
- VEHICLE_ARGENT_WARHORSE = 35644,
- VEHICLE_ARGENT_BATTLEWORG = 36558,
- -
- + VEHICLE_GR = 35492,
- VEHICLE_BLACK_KNIGHT = 35491
- };
- -#endif
- +enum Actions
- +{
- + ACTION_OUTRO = 0,
- + ACTION_RESET_BLACK_KNIGHT = 1
- +};
- +
- +enum Criterias
- +{
- + CRITERIA_IVE_HAD_WORSE = 11789
- +};
- +
- +void HandleSpellOnPlayersInInstanceToC5(Unit* caller, uint32 spellId);
- +void HandleKillCreditForAllPlayers(Creature* credit);
- +void HandleInstanceBind(Creature* source);
- +
- +
- +#endif
- \ No newline at end of file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement