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

Public Member Functions

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

Public Attributes

bool CLEANED
 
uint32 EncounterStatus
 
uint32 InstanceProgress
 
uint32 AttemptsLeft
 
TeamId TeamIdInInstance
 
uint8 Counter
 
uint8 northrendBeastsMask
 
uint32 AchievementTimer
 
bool bDedicatedInsanity
 
bool bSwitcher
 
bool bNooneDied
 
std::string str_data
 
EventMap events
 
ObjectGuid NPC_BarrettGUID
 
ObjectGuid NPC_TirionGUID
 
ObjectGuid NPC_FizzlebangGUID
 
ObjectGuid NPC_GarroshGUID
 
ObjectGuid NPC_VarianGUID
 
ObjectGuid NPC_GormokGUID
 
ObjectGuid NPC_DreadscaleGUID
 
ObjectGuid NPC_AcidmawGUID
 
ObjectGuid NPC_IcehowlGUID
 
ObjectGuid NPC_JaraxxusGUID
 
GuidVector NPC_ChampionGUIDs
 
ObjectGuid NPC_LightbaneGUID
 
ObjectGuid NPC_DarkbaneGUID
 
ObjectGuid NPC_LichKingGUID
 
ObjectGuid NPC_AnubarakGUID
 
ObjectGuid NPC_PurpleGroundGUID
 
ObjectGuid NPC_PortalGUID
 
ObjectGuid GO_MainGateGUID
 
ObjectGuid GO_EnterGateGUID
 
ObjectGuid GO_WebDoorGUID
 
ObjectGuid GO_FloorGUID
 
- Public Attributes inherited from InstanceScript
Mapinstance
 
TaskScheduler scheduler
 

Additional Inherited Members

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

Detailed Description

Constructor & Destructor Documentation

◆ instance_trial_of_the_crusader_InstanceMapScript()

instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::instance_trial_of_the_crusader_InstanceMapScript ( Map pMap)
inline
34 : InstanceScript(pMap)
35 {
37 Initialize();
38 }
#define DataHeader
Definition: blackrock_depths.h:23
Definition: InstanceScript.h:142
void SetHeaders(std::string const &dataHeaders)
Definition: InstanceScript.cpp:141
void Initialize() override
Definition: instance_trial_of_the_crusader.cpp:165

References DataHeader, Initialize(), and InstanceScript::SetHeaders().

Member Function Documentation

◆ CheckAchievementCriteriaMeet()

bool instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::CheckAchievementCriteriaMeet ( uint32  criteria_id,
Player const *  ,
Unit const *  ,
uint32   
)
inlineoverridevirtual

Reimplemented from InstanceScript.

1623 {
1624 switch (criteria_id)
1625 {
1629 {
1630 std::list<Creature*> L;
1631 uint8 count = 0;
1632 c->GetCreaturesWithEntryInRange(L, 200.0f, 34800); // find all snobolds
1633 for( std::list<Creature*>::const_iterator itr = L.begin(); itr != L.end(); ++itr )
1634 if ((*itr)->GetVehicle())
1635 ++count;
1636 return (count >= 2);
1637 }
1638 break;
1642 {
1643 std::list<Creature*> L;
1644 uint8 count = 0;
1645 c->GetCreaturesWithEntryInRange(L, 200.0f, 34800); // find all snobolds
1646 for( std::list<Creature*>::const_iterator itr = L.begin(); itr != L.end(); ++itr )
1647 if ((*itr)->GetVehicle())
1648 ++count;
1649 return (count >= 4);
1650 }
1651 break;
1657 {
1658 std::list<Creature*> L;
1659 uint8 count = 0;
1660 c->GetCreaturesWithEntryInRange(L, 200.0f, 34826); // find all mistress of pain
1661 for( std::list<Creature*>::const_iterator itr = L.begin(); itr != L.end(); ++itr )
1662 if ((*itr)->IsAlive())
1663 ++count;
1664 return (count >= 2);
1665 }
1666 break;
1669 return AttemptsLeft >= 25;
1672 return AttemptsLeft >= 45;
1676 return AttemptsLeft == 50;
1679 return AttemptsLeft == 50 && bNooneDied;
1681 return AttemptsLeft == 50 && bDedicatedInsanity;
1682 }
1683 return false;
1684 }
std::uint8_t uint8
Definition: Define.h:109
@ ACHIEV_CRITERIA_THREE_SIXTY_PAIN_SPIKE_25_H
Definition: trial_of_the_crusader.h:368
@ ACHIEV_CRITERIA_A_TRIBUTE_TO_SKILL_10_PLAYER
Definition: trial_of_the_crusader.h:370
@ ACHIEV_CRITERIA_UPPER_BACK_PAIN_25_H
Definition: trial_of_the_crusader.h:364
@ ACHIEV_CRITERIA_A_TRIBUTE_TO_INSANITY_10_PLAYER
Definition: trial_of_the_crusader.h:374
@ ACHIEV_CRITERIA_A_TRIBUTE_TO_INSANITY_25_PLAYER
Definition: trial_of_the_crusader.h:375
@ ACHIEV_CRITERIA_A_TRIBUTE_TO_DEDICATED_INSANITY
Definition: trial_of_the_crusader.h:378
@ ACHIEV_CRITERIA_A_TRIBUTE_TO_IMMORTALITY_ALLIANCE
Definition: trial_of_the_crusader.h:377
@ ACHIEV_CRITERIA_REALM_FIRST_GRAND_CRUSADER
Definition: trial_of_the_crusader.h:379
@ ACHIEV_CRITERIA_A_TRIBUTE_TO_SKILL_25_PLAYER
Definition: trial_of_the_crusader.h:371
@ ACHIEV_CRITERIA_A_TRIBUTE_TO_MAD_SKILL_25_PLAYER
Definition: trial_of_the_crusader.h:373
@ ACHIEV_CRITERIA_A_TRIBUTE_TO_MAD_SKILL_10_PLAYER
Definition: trial_of_the_crusader.h:372
@ ACHIEV_CRITERIA_THREE_SIXTY_PAIN_SPIKE_25_N
Definition: trial_of_the_crusader.h:367
@ ACHIEV_CRITERIA_UPPER_BACK_PAIN_10_N
Definition: trial_of_the_crusader.h:361
@ ACHIEV_CRITERIA_THREE_SIXTY_PAIN_SPIKE_10_H
Definition: trial_of_the_crusader.h:366
@ ACHIEV_CRITERIA_THREE_SIXTY_PAIN_SPIKE_10_N
Definition: trial_of_the_crusader.h:365
@ ACHIEV_CRITERIA_UPPER_BACK_PAIN_25_N
Definition: trial_of_the_crusader.h:363
@ ACHIEV_CRITERIA_UPPER_BACK_PAIN_10_H
Definition: trial_of_the_crusader.h:362
@ ACHIEV_CRITERIA_A_TRIBUTE_TO_IMMORTALITY_HORDE
Definition: trial_of_the_crusader.h:376
Definition: Creature.h:43
Map * instance
Definition: InstanceScript.h:148
Creature * GetCreature(ObjectGuid const guid)
Definition: Map.cpp:3317
bool bNooneDied
Definition: instance_trial_of_the_crusader.cpp:50
ObjectGuid NPC_BarrettGUID
Definition: instance_trial_of_the_crusader.cpp:54
uint32 AttemptsLeft
Definition: instance_trial_of_the_crusader.cpp:43
bool bDedicatedInsanity
Definition: instance_trial_of_the_crusader.cpp:48

References ACHIEV_CRITERIA_A_TRIBUTE_TO_DEDICATED_INSANITY, ACHIEV_CRITERIA_A_TRIBUTE_TO_IMMORTALITY_ALLIANCE, ACHIEV_CRITERIA_A_TRIBUTE_TO_IMMORTALITY_HORDE, ACHIEV_CRITERIA_A_TRIBUTE_TO_INSANITY_10_PLAYER, ACHIEV_CRITERIA_A_TRIBUTE_TO_INSANITY_25_PLAYER, ACHIEV_CRITERIA_A_TRIBUTE_TO_MAD_SKILL_10_PLAYER, ACHIEV_CRITERIA_A_TRIBUTE_TO_MAD_SKILL_25_PLAYER, ACHIEV_CRITERIA_A_TRIBUTE_TO_SKILL_10_PLAYER, ACHIEV_CRITERIA_A_TRIBUTE_TO_SKILL_25_PLAYER, ACHIEV_CRITERIA_REALM_FIRST_GRAND_CRUSADER, ACHIEV_CRITERIA_THREE_SIXTY_PAIN_SPIKE_10_H, ACHIEV_CRITERIA_THREE_SIXTY_PAIN_SPIKE_10_N, ACHIEV_CRITERIA_THREE_SIXTY_PAIN_SPIKE_25_H, ACHIEV_CRITERIA_THREE_SIXTY_PAIN_SPIKE_25_N, ACHIEV_CRITERIA_UPPER_BACK_PAIN_10_H, ACHIEV_CRITERIA_UPPER_BACK_PAIN_10_N, ACHIEV_CRITERIA_UPPER_BACK_PAIN_25_H, ACHIEV_CRITERIA_UPPER_BACK_PAIN_25_N, AttemptsLeft, bDedicatedInsanity, bNooneDied, Map::GetCreature(), InstanceScript::instance, and NPC_BarrettGUID.

◆ DoCheckDedicatedInsanity()

void instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::DoCheckDedicatedInsanity ( )
inline
130 {
131 if (!bDedicatedInsanity || AttemptsLeft < 50 || instance->GetDifficulty() != RAID_DIFFICULTY_10MAN_HEROIC)
132 return;
133
134 if (validDedicatedInsanityItems.empty())
135 {
136 for (uint32 i = 0; i < dIIc; ++i)
138 }
139
140 Map::PlayerList const& pl = instance->GetPlayers();
141 for (Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr)
142 if (Player* plr = itr->GetSource())
143 if (!plr->IsGameMaster() && plr->IsInCombat() /*performance*/)
144 {
145 for (uint8 i = EQUIPMENT_SLOT_START; i < EQUIPMENT_SLOT_END; ++i) // loop through equipped items
146 if (Item* item = plr->GetItemByPos(INVENTORY_SLOT_BAG_0, i))
147 if (!IsValidDedicatedInsanityItem(item->GetTemplate()))
148 {
149 bDedicatedInsanity = false;
150 SaveToDB();
151 return;
152 }
153 }
154 }
std::uint32_t uint32
Definition: Define.h:107
std::map< uint32, bool > validDedicatedInsanityItems
Definition: instance_trial_of_the_crusader.cpp:25
const uint32 dIIc
Definition: trial_of_the_crusader.h:388
const uint32 dedicatedInsanityItems[405]
Definition: trial_of_the_crusader.h:389
@ RAID_DIFFICULTY_10MAN_HEROIC
Definition: DBCEnums.h:275
@ EQUIPMENT_SLOT_END
Definition: Player.h:699
@ EQUIPMENT_SLOT_START
Definition: Player.h:679
#define INVENTORY_SLOT_BAG_0
Definition: Player.h:675
Definition: LinkedList.h:139
Definition: Item.h:220
Definition: Player.h:1081
void SaveToDB()
Definition: InstanceScript.cpp:41
PlayerList const & GetPlayers() const
Definition: Map.h:484
Definition: MapRefMgr.h:26
iterator begin()
Definition: MapRefMgr.h:36
iterator end()
Definition: MapRefMgr.h:37
bool IsValidDedicatedInsanityItem(ItemTemplate const *item)
Definition: instance_trial_of_the_crusader.cpp:113

References bDedicatedInsanity, MapRefMgr::begin(), dedicatedInsanityItems, dIIc, MapRefMgr::end(), EQUIPMENT_SLOT_END, EQUIPMENT_SLOT_START, Map::GetPlayers(), InstanceScript::instance, INVENTORY_SLOT_BAG_0, IsValidDedicatedInsanityItem(), RAID_DIFFICULTY_10MAN_HEROIC, InstanceScript::SaveToDB(), and validDedicatedInsanityItems.

Referenced by Update().

◆ DoNeedCleanup()

bool instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::DoNeedCleanup ( Player ignoredPlayer = nullptr)
inline
1420 {
1421 uint8 aliveCount = 0;
1422 for (auto const& itr: instance->GetPlayers())
1423 {
1424 if (Player* plr = itr.GetSource())
1425 {
1426 if (plr != ignoredPlayer && plr->IsAlive() && !plr->IsGameMaster())
1427 {
1428 ++aliveCount;
1429 }
1430 }
1431 }
1432
1433 bool need = aliveCount == 0;
1434 if (!need && CLEANED)
1435 {
1436 CLEANED = false;
1437 }
1438
1439 return need;
1440 }
bool CLEANED
Definition: instance_trial_of_the_crusader.cpp:40

References CLEANED, Map::GetPlayers(), and InstanceScript::instance.

Referenced by OnPlayerEnter(), and Update().

◆ GetData()

uint32 instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::GetData ( uint32  type) const
inlineoverridevirtual

Reimplemented from ZoneScript.

530 {
531 switch (type)
532 {
534 return InstanceProgress;
535 }
536 return 0;
537 }
@ TYPE_INSTANCE_PROGRESS
Definition: trial_of_the_crusader.h:31
uint32 InstanceProgress
Definition: instance_trial_of_the_crusader.cpp:42

References InstanceProgress, and TYPE_INSTANCE_PROGRESS.

◆ GetGuidData()

ObjectGuid instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::GetGuidData ( uint32  type) const
inlineoverridevirtual

Reimplemented from InstanceScript.

540 {
541 switch (type)
542 {
543 case TYPE_GORMOK:
544 return NPC_GormokGUID;
545 case TYPE_DREADSCALE:
546 return NPC_DreadscaleGUID;
547 case TYPE_ACIDMAW:
548 return NPC_AcidmawGUID;
549 case NPC_DARKBANE:
550 return NPC_DarkbaneGUID;
551 case NPC_LIGHTBANE:
552 return NPC_LightbaneGUID;
553 case TYPE_ANUBARAK:
554 return NPC_AnubarakGUID;
555 }
556
557 return ObjectGuid::Empty;
558 }
@ NPC_LIGHTBANE
Definition: trial_of_the_crusader.h:184
@ NPC_DARKBANE
Definition: trial_of_the_crusader.h:185
@ TYPE_DREADSCALE
Definition: trial_of_the_crusader.h:37
@ TYPE_ACIDMAW
Definition: trial_of_the_crusader.h:38
@ TYPE_ANUBARAK
Definition: trial_of_the_crusader.h:44
@ TYPE_GORMOK
Definition: trial_of_the_crusader.h:35
static ObjectGuid const Empty
Definition: ObjectGuid.h:120
ObjectGuid NPC_DreadscaleGUID
Definition: instance_trial_of_the_crusader.cpp:61
ObjectGuid NPC_LightbaneGUID
Definition: instance_trial_of_the_crusader.cpp:66
ObjectGuid NPC_AnubarakGUID
Definition: instance_trial_of_the_crusader.cpp:69
ObjectGuid NPC_AcidmawGUID
Definition: instance_trial_of_the_crusader.cpp:62
ObjectGuid NPC_GormokGUID
Definition: instance_trial_of_the_crusader.cpp:60
ObjectGuid NPC_DarkbaneGUID
Definition: instance_trial_of_the_crusader.cpp:67

References ObjectGuid::Empty, NPC_AcidmawGUID, NPC_AnubarakGUID, NPC_DARKBANE, NPC_DarkbaneGUID, NPC_DreadscaleGUID, NPC_GormokGUID, NPC_LIGHTBANE, NPC_LightbaneGUID, TYPE_ACIDMAW, TYPE_ANUBARAK, TYPE_DREADSCALE, and TYPE_GORMOK.

◆ Initialize()

void instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::Initialize ( )
inlineoverridevirtual

Reimplemented from InstanceScript.

166 {
167 CLEANED = false;
170 AttemptsLeft = 50;
172 Counter = 0;
175 bDedicatedInsanity = true;
176 bSwitcher = false;
177 bNooneDied = true;
178 events.Reset();
179 events.RescheduleEvent(EVENT_CHECK_PLAYERS, 0);
180
181 NPC_ChampionGUIDs.clear();
182 }
events
Definition: boss_sartura.cpp:43
@ EVENT_CHECK_PLAYERS
Definition: trial_of_the_champion.h:67
@ INSTANCE_PROGRESS_INITIAL
Definition: trial_of_the_champion.h:52
@ TEAM_NEUTRAL
Definition: SharedDefines.h:762
@ NOT_STARTED
Definition: InstanceScript.h:57
bool bSwitcher
Definition: instance_trial_of_the_crusader.cpp:49
TeamId TeamIdInInstance
Definition: instance_trial_of_the_crusader.cpp:44
uint8 northrendBeastsMask
Definition: instance_trial_of_the_crusader.cpp:46
uint32 AchievementTimer
Definition: instance_trial_of_the_crusader.cpp:47
GuidVector NPC_ChampionGUIDs
Definition: instance_trial_of_the_crusader.cpp:65
uint8 Counter
Definition: instance_trial_of_the_crusader.cpp:45
uint32 EncounterStatus
Definition: instance_trial_of_the_crusader.cpp:41

References AchievementTimer, AttemptsLeft, bDedicatedInsanity, bNooneDied, bSwitcher, CLEANED, Counter, EncounterStatus, EVENT_CHECK_PLAYERS, INSTANCE_PROGRESS_INITIAL, InstanceProgress, northrendBeastsMask, NOT_STARTED, NPC_ChampionGUIDs, TEAM_NEUTRAL, and TeamIdInInstance.

Referenced by instance_trial_of_the_crusader_InstanceMapScript().

◆ InstanceCleanup()

void instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::InstanceCleanup ( bool  fromFailed = false)
inline
1443 {
1444 if (CLEANED)
1445 return;
1446 CLEANED = true;
1447
1448 switch (InstanceProgress)
1449 {
1452 c->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
1453 break;
1456 c->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
1458 {
1459 c->AI()->DoAction(-1); // despawn summons
1460 c->DespawnOrUnsummon();
1461 }
1464 c->DespawnOrUnsummon();
1467 c->DespawnOrUnsummon();
1470 c->DespawnOrUnsummon();
1473 break;
1476 c->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
1478 c->DespawnOrUnsummon();
1481 c->DespawnOrUnsummon();
1484 c->DespawnOrUnsummon();
1487 c->DespawnOrUnsummon();
1489 break;
1492 c->DespawnOrUnsummon();
1494 {
1495 c->RemoveNpcFlag(UNIT_NPC_FLAG_GOSSIP);
1497 {
1498 jaraxxus->CastSpell(jaraxxus, 67924, true);
1499 jaraxxus->SetReactState(REACT_AGGRESSIVE);
1500 jaraxxus->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
1501 jaraxxus->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
1502 }
1503 }
1504 break;
1507 c->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
1508 for (ObjectGuid const& guid : NPC_ChampionGUIDs)
1509 if (Creature* c = instance->GetCreature(guid))
1510 c->DespawnOrUnsummon();
1511 NPC_ChampionGUIDs.clear();
1512 break;
1515 c->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
1517 {
1518 c->AI()->DoAction(-1);
1519 c->DespawnOrUnsummon();
1520 }
1523 {
1524 c->AI()->DoAction(-1);
1525 c->DespawnOrUnsummon();
1526 }
1528 break;
1531 /*if (GameObject* floor = instance->GetGameObject(GO_FloorGUID))
1532 floor->SetDestructibleState(GO_DESTRUCTIBLE_REBUILDING, nullptr, true);*/
1534 {
1536 {
1537 c->SetVisible(false);
1538 c->RemoveNpcFlag(UNIT_NPC_FLAG_GOSSIP);
1539 }
1540 else
1541 {
1542 c->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
1543 c->SetVisible(true);
1544 c->SetFacingTo(c->GetOrientation());
1545 }
1546 if (Creature* t = c->FindNearestCreature(NPC_WORLD_TRIGGER, 500.0f, true))
1547 t->DespawnOrUnsummon();
1548 }
1550 c->DespawnOrUnsummon();
1552
1554 {
1555 c->AI()->DoAction(-1);
1556 c->DespawnOrUnsummon();
1557 }
1559
1560 break;
1563 floor->SetDestructibleState(GO_DESTRUCTIBLE_REBUILDING, nullptr, true);
1565 {
1566 c->SetVisible(false);
1567 c->RemoveNpcFlag(UNIT_NPC_FLAG_GOSSIP);
1568 }
1569 break;
1570 }
1571
1572 if (instance->IsHeroic() && AttemptsLeft > 0 && !fromFailed && EncounterStatus == IN_PROGRESS)
1573 {
1574 --AttemptsLeft;
1575 Map::PlayerList const& pl = instance->GetPlayers();
1576 for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
1577 if (Player* plr = itr->GetSource())
1578 plr->SendUpdateWorldState(UPDATE_STATE_UI_COUNT, AttemptsLeft);
1579 }
1580
1581 if (instance->IsHeroic() && AttemptsLeft == 0 )
1583 c->RemoveNpcFlag(UNIT_NPC_FLAG_GOSSIP);
1584
1588 Counter = 0;
1590 events.Reset();
1591 events.RescheduleEvent(EVENT_CHECK_PLAYERS, 5s);
1592 }
const Position Locs[]
Definition: trial_of_the_crusader.h:274
@ LOC_CENTER
Definition: trial_of_the_crusader.h:304
@ UPDATE_STATE_UI_COUNT
Definition: trial_of_the_crusader.h:385
@ NPC_WORLD_TRIGGER
Definition: trial_of_the_crusader.h:152
@ NPC_JARAXXUS
Definition: trial_of_the_crusader.h:149
@ INSTANCE_PROGRESS_INTRO_DONE
Definition: trial_of_the_crusader.h:53
@ INSTANCE_PROGRESS_BEASTS_DEAD
Definition: trial_of_the_crusader.h:54
@ INSTANCE_PROGRESS_DONE
Definition: trial_of_the_crusader.h:60
@ INSTANCE_PROGRESS_VALKYR_DEAD
Definition: trial_of_the_crusader.h:58
@ INSTANCE_PROGRESS_ANUB_ARAK
Definition: trial_of_the_crusader.h:59
@ INSTANCE_PROGRESS_JARAXXUS_DEAD
Definition: trial_of_the_crusader.h:56
@ INSTANCE_PROGRESS_FACTION_CHAMPIONS_DEAD
Definition: trial_of_the_crusader.h:57
@ INSTANCE_PROGRESS_JARAXXUS_INTRO_DONE
Definition: trial_of_the_crusader.h:55
@ GO_DESTRUCTIBLE_REBUILDING
Definition: SharedDefines.h:1630
@ IN_PROGRESS
Definition: InstanceScript.h:58
@ TEMPSUMMON_CORPSE_TIMED_DESPAWN
Definition: Object.h:51
@ REACT_AGGRESSIVE
Definition: Unit.h:550
@ MOVEMENTFLAG_WALKING
Definition: UnitDefines.h:352
@ UNIT_NPC_FLAG_GOSSIP
Definition: UnitDefines.h:294
@ UNIT_FLAG_NON_ATTACKABLE
Definition: UnitDefines.h:230
Definition: GameObject.h:120
TempSummon * SummonCreature(uint32 id, const Position &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0, SummonPropertiesEntry const *properties=nullptr, bool visibleBySummonerOnly=false) const
Definition: Object.cpp:2366
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition: Object.cpp:2457
Definition: ObjectGuid.h:118
void Clear()
Definition: ObjectGuid.h:138
float GetPositionZ() const
Definition: Position.h:118
float GetOrientation() const
Definition: Position.h:119
float GetPositionX() const
Definition: Position.h:116
float GetPositionY() const
Definition: Position.h:117
void HandleGameObject(ObjectGuid guid, bool open, GameObject *go=nullptr)
Definition: InstanceScript.cpp:113
GameObject * GetGameObject(ObjectGuid const guid)
Definition: Map.cpp:3322
bool IsHeroic() const
Definition: Map.h:450
ObjectGuid GO_WebDoorGUID
Definition: instance_trial_of_the_crusader.cpp:76
ObjectGuid NPC_PurpleGroundGUID
Definition: instance_trial_of_the_crusader.cpp:71
ObjectGuid GO_EnterGateGUID
Definition: instance_trial_of_the_crusader.cpp:75
ObjectGuid NPC_JaraxxusGUID
Definition: instance_trial_of_the_crusader.cpp:64
ObjectGuid NPC_FizzlebangGUID
Definition: instance_trial_of_the_crusader.cpp:56
ObjectGuid NPC_IcehowlGUID
Definition: instance_trial_of_the_crusader.cpp:63
ObjectGuid NPC_PortalGUID
Definition: instance_trial_of_the_crusader.cpp:72
ObjectGuid GO_MainGateGUID
Definition: instance_trial_of_the_crusader.cpp:74
ObjectGuid GO_FloorGUID
Definition: instance_trial_of_the_crusader.cpp:77
ObjectGuid NPC_LichKingGUID
Definition: instance_trial_of_the_crusader.cpp:68

References AttemptsLeft, MapRefMgr::begin(), CLEANED, ObjectGuid::Clear(), Counter, EncounterStatus, MapRefMgr::end(), EVENT_CHECK_PLAYERS, WorldObject::FindNearestCreature(), Map::GetCreature(), Map::GetGameObject(), Position::GetOrientation(), Map::GetPlayers(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), GO_DESTRUCTIBLE_REBUILDING, GO_EnterGateGUID, GO_FloorGUID, GO_MainGateGUID, GO_WebDoorGUID, InstanceScript::HandleGameObject(), IN_PROGRESS, InstanceScript::instance, INSTANCE_PROGRESS_ANUB_ARAK, INSTANCE_PROGRESS_BEASTS_DEAD, INSTANCE_PROGRESS_DONE, INSTANCE_PROGRESS_FACTION_CHAMPIONS_DEAD, INSTANCE_PROGRESS_INITIAL, INSTANCE_PROGRESS_INTRO_DONE, INSTANCE_PROGRESS_JARAXXUS_DEAD, INSTANCE_PROGRESS_JARAXXUS_INTRO_DONE, INSTANCE_PROGRESS_VALKYR_DEAD, InstanceProgress, Map::IsHeroic(), LOC_CENTER, Locs, MOVEMENTFLAG_WALKING, northrendBeastsMask, NOT_STARTED, NPC_AcidmawGUID, NPC_AnubarakGUID, NPC_BarrettGUID, NPC_ChampionGUIDs, NPC_DarkbaneGUID, NPC_DreadscaleGUID, NPC_FizzlebangGUID, NPC_GormokGUID, NPC_IcehowlGUID, NPC_JARAXXUS, NPC_JaraxxusGUID, NPC_LichKingGUID, NPC_LightbaneGUID, NPC_PortalGUID, NPC_PurpleGroundGUID, NPC_WORLD_TRIGGER, REACT_AGGRESSIVE, WorldObject::SummonCreature(), TEMPSUMMON_CORPSE_TIMED_DESPAWN, UNIT_FLAG_NON_ATTACKABLE, UNIT_NPC_FLAG_GOSSIP, and UPDATE_STATE_UI_COUNT.

Referenced by OnPlayerEnter(), SetData(), and Update().

◆ IsEncounterInProgress()

bool instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::IsEncounterInProgress ( ) const
inlineoverridevirtual

Reimplemented from InstanceScript.

185 {
186 Map::PlayerList const& pl = instance->GetPlayers();
187 for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
188 if (Player* plr = itr->GetSource())
189 if (plr->IsAlive() && !plr->IsGameMaster())
190 return EncounterStatus == IN_PROGRESS; // found alive player
191
193 *(const_cast<uint32*>(&EncounterStatus)) = NOT_STARTED;
194 return false;
195 }

References MapRefMgr::begin(), EncounterStatus, MapRefMgr::end(), Map::GetPlayers(), IN_PROGRESS, InstanceScript::instance, and NOT_STARTED.

◆ IsValidDedicatedInsanityItem()

bool instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::IsValidDedicatedInsanityItem ( ItemTemplate const *  item)
inline
114 {
115 if (!item) // should not happen, but checked in GetAverageItemLevel()
116 return true;
117 if (item->ItemLevel < 245)
118 return true;
119 if (item->ItemId == 46017) // Val'anyr, Hammer of Ancient Kings - exception, too powerful
120 return false;
121 if (item->ItemLevel == 245 && item->Bonding == BIND_WHEN_EQUIPPED) // this also includes items crafted from patterns obtained in ToC 10 norm/hc
122 return true;
123 if (validDedicatedInsanityItems.find(item->ItemId) != validDedicatedInsanityItems.end()) // list of items dropping from ToC 10 norm/hc and also items ilevel 245 buyable for emblems of triumph
124 return true;
125
126 return false;
127 }
@ BIND_WHEN_EQUIPPED
Definition: ItemTemplate.h:97

References BIND_WHEN_EQUIPPED, ItemTemplate::Bonding, ItemTemplate::ItemId, ItemTemplate::ItemLevel, and validDedicatedInsanityItems.

Referenced by DoCheckDedicatedInsanity().

◆ OnCreatureCreate()

void instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::OnCreatureCreate ( Creature creature)
inlineoverridevirtual

Reimplemented from InstanceScript.

198 {
199 switch (creature->GetEntry())
200 {
201 case NPC_BARRENT:
202 NPC_BarrettGUID = creature->GetGUID();
203 break;
204 case NPC_TIRION:
205 NPC_TirionGUID = creature->GetGUID();
206 break;
207 case NPC_GARROSH:
208 NPC_GarroshGUID = creature->GetGUID();
209 break;
210 case NPC_VARIAN:
211 NPC_VarianGUID = creature->GetGUID();
212 break;
213 case NPC_FIZZLEBANG:
214 NPC_FizzlebangGUID = creature->GetGUID();
215 break;
216
217 case NPC_GORMOK:
218 NPC_GormokGUID = creature->GetGUID();
219 break;
220 case NPC_DREADSCALE:
221 NPC_DreadscaleGUID = creature->GetGUID();
222 break;
223 case NPC_ACIDMAW:
224 NPC_AcidmawGUID = creature->GetGUID();
225 break;
226 case NPC_ICEHOWL:
227 NPC_IcehowlGUID = creature->GetGUID();
228 break;
229 case NPC_JARAXXUS:
230 NPC_JaraxxusGUID = creature->GetGUID();
231 break;
232 case NPC_LIGHTBANE:
233 NPC_LightbaneGUID = creature->GetGUID();
234 break;
235 case NPC_DARKBANE:
236 NPC_DarkbaneGUID = creature->GetGUID();
237 break;
238 case NPC_LICH_KING:
239 NPC_LichKingGUID = creature->GetGUID();
240 break;
241 case NPC_ANUBARAK:
242 NPC_AnubarakGUID = creature->GetGUID();
243 break;
244 }
245 }
@ NPC_TIRION
Definition: trial_of_the_champion.h:147
@ NPC_DREADSCALE
Definition: trial_of_the_crusader.h:146
@ NPC_VARIAN
Definition: trial_of_the_crusader.h:138
@ NPC_ICEHOWL
Definition: trial_of_the_crusader.h:148
@ NPC_ACIDMAW
Definition: trial_of_the_crusader.h:147
@ NPC_GARROSH
Definition: trial_of_the_crusader.h:136
@ NPC_ANUBARAK
Definition: trial_of_the_crusader.h:187
@ NPC_BARRENT
Definition: trial_of_the_crusader.h:134
@ NPC_LICH_KING
Definition: trial_of_the_crusader.h:143
@ NPC_FIZZLEBANG
Definition: trial_of_the_crusader.h:142
@ NPC_GORMOK
Definition: trial_of_the_crusader.h:145
uint32 GetEntry() const
Definition: Object.h:115
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:112
ObjectGuid NPC_TirionGUID
Definition: instance_trial_of_the_crusader.cpp:55
ObjectGuid NPC_VarianGUID
Definition: instance_trial_of_the_crusader.cpp:58
ObjectGuid NPC_GarroshGUID
Definition: instance_trial_of_the_crusader.cpp:57

References Object::GetEntry(), Object::GetGUID(), NPC_ACIDMAW, NPC_AcidmawGUID, NPC_ANUBARAK, NPC_AnubarakGUID, NPC_BARRENT, NPC_BarrettGUID, NPC_DARKBANE, NPC_DarkbaneGUID, NPC_DREADSCALE, NPC_DreadscaleGUID, NPC_FIZZLEBANG, NPC_FizzlebangGUID, NPC_GARROSH, NPC_GarroshGUID, NPC_GORMOK, NPC_GormokGUID, NPC_ICEHOWL, NPC_IcehowlGUID, NPC_JARAXXUS, NPC_JaraxxusGUID, NPC_LICH_KING, NPC_LichKingGUID, NPC_LIGHTBANE, NPC_LightbaneGUID, NPC_TIRION, NPC_TirionGUID, NPC_VARIAN, and NPC_VarianGUID.

◆ OnGameObjectCreate()

void instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::OnGameObjectCreate ( GameObject go)
inlineoverridevirtual

Reimplemented from InstanceScript.

248 {
249 switch (go->GetEntry())
250 {
252 GO_MainGateGUID = go->GetGUID();
254 break;
255 case GO_WEB_DOOR:
256 GO_WebDoorGUID = go->GetGUID();
258 break;
260 GO_FloorGUID = go->GetGUID();
263 break;
266 HandleGameObject(go->GetGUID(), false, go);
267 break;
269 HandleGameObject(go->GetGUID(), true, go);
271 break;
272 }
273 }
@ GO_SOUTH_PORTCULLIS
Definition: trial_of_the_champion.h:170
@ GO_EAST_PORTCULLIS
Definition: trial_of_the_champion.h:171
@ GO_NORTH_PORTCULLIS
Definition: trial_of_the_champion.h:172
@ GO_ARGENT_COLISEUM_FLOOR
Definition: trial_of_the_crusader.h:192
@ GO_MAIN_GATE_DOOR
Definition: trial_of_the_crusader.h:193
@ GO_WEB_DOOR
Definition: trial_of_the_crusader.h:194
@ GO_DESTRUCTIBLE_DAMAGED
Definition: SharedDefines.h:1628
void SetDestructibleState(GameObjectDestructibleState state, Player *eventInvoker=nullptr, bool setHealth=false)
Definition: GameObject.cpp:2342

References Object::GetEntry(), Object::GetGUID(), GO_ARGENT_COLISEUM_FLOOR, GO_DESTRUCTIBLE_DAMAGED, GO_EAST_PORTCULLIS, GO_EnterGateGUID, GO_FloorGUID, GO_MAIN_GATE_DOOR, GO_MainGateGUID, GO_NORTH_PORTCULLIS, GO_SOUTH_PORTCULLIS, GO_WEB_DOOR, GO_WebDoorGUID, InstanceScript::HandleGameObject(), INSTANCE_PROGRESS_ANUB_ARAK, InstanceProgress, and GameObject::SetDestructibleState().

◆ OnPlayerEnter()

void instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::OnPlayerEnter ( Player plr)
inlineoverridevirtual

Reimplemented from InstanceScript.

1399 {
1400 if (instance->IsHeroic())
1401 {
1404 }
1405 else
1407
1408 if (DoNeedCleanup(plr))
1409 {
1411 }
1412
1413 // if missing spawn anub'arak
1414 SpawnAnubArak();
1415
1416 events.RescheduleEvent(EVENT_CHECK_PLAYERS, 5s);
1417 }
@ UPDATE_STATE_UI_SHOW
Definition: trial_of_the_crusader.h:384
void SendUpdateWorldState(uint32 variable, uint32 value) const
Definition: PlayerUpdates.cpp:2197
void InstanceCleanup(bool fromFailed=false)
Definition: instance_trial_of_the_crusader.cpp:1442
bool DoNeedCleanup(Player *ignoredPlayer=nullptr)
Definition: instance_trial_of_the_crusader.cpp:1419
void SpawnAnubArak()
Definition: instance_trial_of_the_crusader.cpp:79

References AttemptsLeft, DoNeedCleanup(), EVENT_CHECK_PLAYERS, InstanceScript::instance, InstanceCleanup(), Map::IsHeroic(), Player::SendUpdateWorldState(), SpawnAnubArak(), UPDATE_STATE_UI_COUNT, and UPDATE_STATE_UI_SHOW.

◆ OnUnitDeath()

void instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::OnUnitDeath ( Unit u)
inlineoverridevirtual

Reimplemented from ZoneScript.

157 {
158 if (bNooneDied && u->IsPlayer())
159 {
160 bNooneDied = false;
161 SaveToDB();
162 }
163 }
bool IsPlayer() const
Definition: Object.h:200

References bNooneDied, Object::IsPlayer(), and InstanceScript::SaveToDB().

◆ ReadSaveDataMore()

void instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::ReadSaveDataMore ( std::istringstream &  data)
inlineoverridevirtual

Reimplemented from InstanceScript.

1595 {
1596 data >> InstanceProgress;
1597
1598 if (instance->IsHeroic())
1599 {
1600 data >> AttemptsLeft;
1601 uint32 temp = 0;
1602 data >> temp;
1603 bDedicatedInsanity = !!temp;
1604 data >> temp;
1605 bNooneDied = !!temp;
1606 }
1607 }

References AttemptsLeft, bDedicatedInsanity, bNooneDied, InstanceScript::instance, InstanceProgress, and Map::IsHeroic().

◆ SetData()

void instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::SetData ( uint32  type,
uint32  data 
)
inlineoverridevirtual

Reimplemented from ZoneScript.

276 {
277 switch (type)
278 {
279 case TYPE_FAILED:
280 // - some scene here?
281 if (instance->IsHeroic() && !CLEANED )
282 {
283 if (AttemptsLeft > 0)
284 --AttemptsLeft;
285 Map::PlayerList const& pl = instance->GetPlayers();
286 for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
287 if (Player* plr = itr->GetSource())
288 plr->SendUpdateWorldState(UPDATE_STATE_UI_COUNT, AttemptsLeft);
289 }
290 InstanceCleanup(true);
291 SaveToDB();
292 break;
294 if (instance->IsHeroic() && AttemptsLeft == 0 )
295 break;
296 switch (InstanceProgress)
297 {
299 events.RescheduleEvent(EVENT_SCENE_001, 0);
300 break;
302 events.RescheduleEvent(EVENT_SCENE_004, 0);
303 break;
305 events.RescheduleEvent(EVENT_SCENE_101, 0);
306 break;
308 events.RescheduleEvent(EVENT_SCENE_201, 0);
309 break;
311 events.RescheduleEvent(EVENT_SCENE_301, 0);
312 break;
314 events.RescheduleEvent(EVENT_SCENE_401, 0);
315 break;
316 }
317 break;
318 case TYPE_GORMOK:
319 if (data == DONE)
320 {
321 if (Creature* trigger = instance->SummonCreature(WORLD_TRIGGER, Locs[LOC_CENTER], nullptr, 25000))
322 {
323 trigger->SetDisplayId(11686);
324 trigger->ReplaceAllUnitFlags(UNIT_FLAG_NOT_SELECTABLE);
325 trigger->SetFaction(FACTION_MONSTER);
326 trigger->SetInCombatWithZone();
327 }
328
330
332 if ((northrendBeastsMask & 7) == 7)
334 else if ((northrendBeastsMask & 16) == 0)
335 events.RescheduleEvent(EVENT_SCENE_005, 2500);
336 }
337 break;
338 case TYPE_JORMUNGAR:
339 if (data == DONE)
340 {
341 if (++Counter == 2)
342 {
343 if (Creature* trigger = instance->SummonCreature(WORLD_TRIGGER, Locs[LOC_CENTER], nullptr, 25000))
344 {
345 trigger->SetDisplayId(11686);
346 trigger->ReplaceAllUnitFlags(UNIT_FLAG_NOT_SELECTABLE);
347 trigger->SetFaction(FACTION_MONSTER);
348 trigger->SetInCombatWithZone();
349 }
350
352 c->DespawnOrUnsummon(10000);
354 c->DespawnOrUnsummon(10000);
355 if (AchievementTimer + 10 >= GameTime::GetGameTime().count())
358
360
362 if ((northrendBeastsMask & 7) == 7)
364 else if ((northrendBeastsMask & 32) == 0)
365 {
366 Counter = 0;
367 events.RescheduleEvent(EVENT_SCENE_006, 2500);
368 }
369 }
370 else // first one died, start timer for achievement
371 {
373 }
374 }
375 else
377 break;
378 case TYPE_ICEHOWL:
379 if (data == DONE)
380 {
382 if ((northrendBeastsMask & 7) == 7)
384 }
385 break;
387 if (data == DONE)
388 {
394 events.RescheduleEvent(EVENT_SCENE_BEASTS_DONE, 2500);
395 SaveToDB();
396 }
397 break;
398 case TYPE_JARAXXUS:
400 if (data == IN_PROGRESS)
402 else if (data == DONE)
403 {
406 events.RescheduleEvent(EVENT_SCENE_110, 2500);
407 SaveToDB();
408 }
409 break;
411 if (data == DONE)
412 {
413 if (++Counter >= NPC_ChampionGUIDs.size())
414 {
416 c->CastSpell(c, SPELL_FACTION_CHAMPIONS_KILL_CREDIT, true);
417 Counter = 0;
420 events.RescheduleEvent(EVENT_SCENE_FACTION_CHAMPIONS_DEAD, 2500);
421
422 for (ObjectGuid const& guid : NPC_ChampionGUIDs)
423 if (Creature* c = instance->GetCreature(guid))
424 c->DespawnOrUnsummon(15000);
425 NPC_ChampionGUIDs.clear();
426
428 {
429 uint32 cacheEntry = 0;
430 switch (instance->GetDifficulty())
431 {
433 cacheEntry = GO_CRUSADERS_CACHE_10;
434 break;
436 cacheEntry = GO_CRUSADERS_CACHE_25;
437 break;
439 cacheEntry = GO_CRUSADERS_CACHE_10_H;
440 break;
442 cacheEntry = GO_CRUSADERS_CACHE_25_H;
443 break;
444 }
445
446 if (GameObject* go = c->SummonGameObject(cacheEntry, Locs[LOC_CENTER].GetPositionX(), Locs[LOC_CENTER].GetPositionY(), Locs[LOC_CENTER].GetPositionZ(), Locs[LOC_CENTER].GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 630000000))
447 {
448 go->SetLootRecipient(instance);
449 }
450 }
451
453
454 if (AchievementTimer + 60 >= GameTime::GetGameTime().count())
457
458 SaveToDB();
459 }
460 else if (Counter == 1)
462 }
463 break;
465 {
468 for (ObjectGuid const& guid : NPC_ChampionGUIDs)
469 if (Creature* c = instance->GetCreature(guid))
470 if (!c->IsInCombat())
471 if (Unit* target = c->SelectNearestTarget(200.0f))
472 c->AI()->AttackStart(target);
473 }
474 break;
476 if (urand(0, 2) == 0 )
477 {
479 {
481 pTemp->AI()->Talk(SAY_VARIAN_KILL_HORDE_PLAYER_1);
482 }
483 else if (Creature* pTemp = instance->GetCreature(NPC_GarroshGUID))
484 pTemp->AI()->Talk(SAY_GARROSH_KILL_ALLIANCE_PLAYER_1);
485 }
486 break;
487 case TYPE_VALKYR:
488 if (data == DONE && ++Counter >= 2)
489 {
490 Counter = 0;
495 events.RescheduleEvent(EVENT_SCENE_VALKYR_DEAD, 2500);
497 SaveToDB();
498 }
499 break;
500 case TYPE_ANUBARAK:
501 if (data == IN_PROGRESS)
502 {
505 }
506 else if (data == DONE)
507 {
508 Counter = 0;
513 SaveToDB();
514
516 {
517 c->UpdatePosition(Locs[LOC_TIRION_FINAL], true);
518 c->StopMovingOnCurrentPos();
519 c->SetFacingTo(Locs[LOC_TIRION_FINAL].GetOrientation());
520 events.RescheduleEvent(EVENT_SCENE_501, 20000);
521 }
523 floor->SetDestructibleState(GO_DESTRUCTIBLE_REBUILDING, nullptr, true);
524 }
525 break;
526 }
527 }
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:44
@ GO_CRUSADERS_CACHE_10_H
Definition: trial_of_the_crusader.h:201
@ GO_CRUSADERS_CACHE_10
Definition: trial_of_the_crusader.h:199
@ GO_CRUSADERS_CACHE_25_H
Definition: trial_of_the_crusader.h:202
@ GO_CRUSADERS_CACHE_25
Definition: trial_of_the_crusader.h:200
@ LOC_TIRION_FINAL
Definition: trial_of_the_crusader.h:318
@ SAY_GARROSH_KILL_ALLIANCE_PLAYER_1
Definition: trial_of_the_crusader.h:252
@ SAY_VARIAN_KILL_HORDE_PLAYER_1
Definition: trial_of_the_crusader.h:243
@ SPELL_FACTION_CHAMPIONS_KILL_CREDIT
Definition: trial_of_the_crusader.h:352
@ SPELL_RESILIENCE_WILL_FIX_IT_CREDIT
Definition: trial_of_the_crusader.h:353
@ SPELL_JORMUNGAR_ACHIEV
Definition: trial_of_the_crusader.h:351
@ EVENT_SCENE_005
Definition: trial_of_the_crusader.h:75
@ EVENT_SCENE_501
Definition: trial_of_the_crusader.h:128
@ EVENT_SCENE_101
Definition: trial_of_the_crusader.h:85
@ EVENT_SCENE_201
Definition: trial_of_the_crusader.h:101
@ EVENT_SCENE_BEASTS_DONE
Definition: trial_of_the_crusader.h:82
@ EVENT_SCENE_VALKYR_DEAD
Definition: trial_of_the_crusader.h:115
@ EVENT_SCENE_401
Definition: trial_of_the_crusader.h:117
@ EVENT_SCENE_301
Definition: trial_of_the_crusader.h:110
@ EVENT_SCENE_001
Definition: trial_of_the_crusader.h:69
@ EVENT_NORTHREND_BEASTS_ENRAGE
Definition: trial_of_the_crusader.h:83
@ EVENT_SCENE_110
Definition: trial_of_the_crusader.h:96
@ EVENT_SCENE_004
Definition: trial_of_the_crusader.h:72
@ EVENT_SCENE_006
Definition: trial_of_the_crusader.h:79
@ EVENT_SCENE_FACTION_CHAMPIONS_DEAD
Definition: trial_of_the_crusader.h:108
@ TYPE_ANNOUNCER_GOSSIP_SELECT
Definition: trial_of_the_crusader.h:32
@ TYPE_ICEHOWL
Definition: trial_of_the_crusader.h:39
@ TYPE_JARAXXUS
Definition: trial_of_the_crusader.h:40
@ TYPE_NORTHREND_BEASTS_ALL
Definition: trial_of_the_crusader.h:47
@ TYPE_VALKYR
Definition: trial_of_the_crusader.h:43
@ TYPE_FAILED
Definition: trial_of_the_crusader.h:33
@ TYPE_FACTION_CHAMPIONS
Definition: trial_of_the_crusader.h:41
@ TYPE_FACTION_CHAMPIONS_PLAYER_DIED
Definition: trial_of_the_crusader.h:42
@ TYPE_FACTION_CHAMPIONS_START
Definition: trial_of_the_crusader.h:46
@ TYPE_JORMUNGAR
Definition: trial_of_the_crusader.h:36
@ RAID_DIFFICULTY_25MAN_HEROIC
Definition: DBCEnums.h:276
@ RAID_DIFFICULTY_10MAN_NORMAL
Definition: DBCEnums.h:273
@ RAID_DIFFICULTY_25MAN_NORMAL
Definition: DBCEnums.h:274
@ ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET
Definition: DBCEnums.h:142
@ ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE
Definition: DBCEnums.h:122
@ TEAM_HORDE
Definition: SharedDefines.h:761
@ FACTION_MONSTER
Definition: SharedDefines.h:195
@ DONE
Definition: InstanceScript.h:60
#define WORLD_TRIGGER
Definition: Unit.h:37
@ UNIT_FLAG_NOT_SELECTABLE
Definition: UnitDefines.h:254
Seconds GetGameTime()
Definition: GameTime.cpp:38
GameObject * SummonGameObject(uint32 entry, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime, bool checkTransport=true, GOSummonType summonType=GO_SUMMON_TIMED_OR_CORPSE_DESPAWN)
Definition: Object.cpp:2380
Definition: Unit.h:630
void DoUpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1=0, uint32 miscValue2=0, Unit *unit=nullptr)
Definition: InstanceScript.cpp:638
Difficulty GetDifficulty() const
Definition: Map.h:441
TempSummon * SummonCreature(uint32 entry, Position const &pos, SummonPropertiesEntry const *properties=nullptr, uint32 duration=0, WorldObject *summoner=nullptr, uint32 spellId=0, uint32 vehId=0, bool visibleBySummonerOnly=false)
Definition: Object.cpp:2174
void SetData(uint32 type, uint32 data) override
Definition: instance_trial_of_the_crusader.cpp:275

References ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE, AchievementTimer, AttemptsLeft, MapRefMgr::begin(), CLEANED, Counter, DONE, InstanceScript::DoUpdateAchievementCriteria(), EncounterStatus, MapRefMgr::end(), EVENT_NORTHREND_BEASTS_ENRAGE, EVENT_SCENE_001, EVENT_SCENE_004, EVENT_SCENE_005, EVENT_SCENE_006, EVENT_SCENE_101, EVENT_SCENE_110, EVENT_SCENE_201, EVENT_SCENE_301, EVENT_SCENE_401, EVENT_SCENE_501, EVENT_SCENE_BEASTS_DONE, EVENT_SCENE_FACTION_CHAMPIONS_DEAD, EVENT_SCENE_VALKYR_DEAD, FACTION_MONSTER, Map::GetCreature(), Map::GetDifficulty(), Map::GetGameObject(), GameTime::GetGameTime(), Position::GetOrientation(), Map::GetPlayers(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), GO_CRUSADERS_CACHE_10, GO_CRUSADERS_CACHE_10_H, GO_CRUSADERS_CACHE_25, GO_CRUSADERS_CACHE_25_H, GO_DESTRUCTIBLE_REBUILDING, GO_EnterGateGUID, GO_FloorGUID, GO_WebDoorGUID, InstanceScript::HandleGameObject(), IN_PROGRESS, InstanceScript::instance, INSTANCE_PROGRESS_BEASTS_DEAD, INSTANCE_PROGRESS_DONE, INSTANCE_PROGRESS_FACTION_CHAMPIONS_DEAD, INSTANCE_PROGRESS_INITIAL, INSTANCE_PROGRESS_INTRO_DONE, INSTANCE_PROGRESS_JARAXXUS_DEAD, INSTANCE_PROGRESS_VALKYR_DEAD, InstanceCleanup(), InstanceProgress, Map::IsHeroic(), LOC_CENTER, LOC_TIRION_FINAL, Locs, northrendBeastsMask, NOT_STARTED, NPC_AcidmawGUID, NPC_ChampionGUIDs, NPC_DreadscaleGUID, NPC_GarroshGUID, NPC_TirionGUID, NPC_VarianGUID, RAID_DIFFICULTY_10MAN_HEROIC, RAID_DIFFICULTY_10MAN_NORMAL, RAID_DIFFICULTY_25MAN_HEROIC, RAID_DIFFICULTY_25MAN_NORMAL, InstanceScript::SaveToDB(), SAY_GARROSH_KILL_ALLIANCE_PLAYER_1, SAY_VARIAN_KILL_HORDE_PLAYER_1, SetData(), SPELL_FACTION_CHAMPIONS_KILL_CREDIT, SPELL_JORMUNGAR_ACHIEV, SPELL_RESILIENCE_WILL_FIX_IT_CREDIT, Map::SummonCreature(), WorldObject::SummonGameObject(), TEAM_HORDE, TeamIdInInstance, TYPE_ANNOUNCER_GOSSIP_SELECT, TYPE_ANUBARAK, TYPE_FACTION_CHAMPIONS, TYPE_FACTION_CHAMPIONS_PLAYER_DIED, TYPE_FACTION_CHAMPIONS_START, TYPE_FAILED, TYPE_GORMOK, TYPE_ICEHOWL, TYPE_JARAXXUS, TYPE_JORMUNGAR, TYPE_NORTHREND_BEASTS_ALL, TYPE_VALKYR, UNIT_FLAG_NOT_SELECTABLE, UPDATE_STATE_UI_COUNT, urand(), and WORLD_TRIGGER.

Referenced by SetData().

◆ SpawnAnubArak()

void instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::SpawnAnubArak ( )
inline
80 {
82 {
84 {
85 barrett->SetVisible(false);
86 if (AttemptsLeft)
88 barrett->SummonCreature(NPC_ANUBARAK, Locs[LOC_ANUB].GetPositionX(), Locs[LOC_ANUB].GetPositionY(), Locs[LOC_ANUB].GetPositionZ(), Locs[LOC_ANUB].GetOrientation(), TEMPSUMMON_CORPSE_TIMED_DESPAWN, 630000000);
89 }
90
91 // move corpses
93 for (ObjectGuid const& i : npcs)
94 {
95 if (Creature* c = instance->GetCreature(i))
96 {
97 if (c->GetGUID() == NPC_IcehowlGUID)
98 c->UpdatePosition(626.57f, 162.8f, 140.25f, 4.44f, true);
99 else if (c->GetGUID() == NPC_JaraxxusGUID)
100 c->UpdatePosition(603.92f, 102.61f, 141.85f, 1.4f, true);
101 else if (c->GetGUID() == NPC_LightbaneGUID)
102 c->UpdatePosition(634.58f, 147.16f, 140.5f, 3.02f, true);
103 else if (c->GetGUID() == NPC_DarkbaneGUID)
104 c->UpdatePosition(630.88f, 131.39f, 140.8f, 3.02f, true);
105
106 c->StopMovingOnCurrentPos();
107 c->DestroyForNearbyPlayers();
108 }
109 }
110 }
111 }
npcs
Definition: halls_of_stone.h:75
@ LOC_ANUB
Definition: trial_of_the_crusader.h:317
Creature * GetCreature(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:210

References AttemptsLeft, Map::GetCreature(), ObjectAccessor::GetCreature(), InstanceScript::instance, INSTANCE_PROGRESS_ANUB_ARAK, InstanceProgress, LOC_ANUB, Locs, NPC_ANUBARAK, NPC_AnubarakGUID, NPC_BarrettGUID, NPC_DarkbaneGUID, NPC_IcehowlGUID, NPC_JaraxxusGUID, NPC_LightbaneGUID, and TEMPSUMMON_CORPSE_TIMED_DESPAWN.

Referenced by OnPlayerEnter(), and Update().

◆ Update()

void instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::Update ( uint32  diff)
inlineoverridevirtual

Reimplemented from InstanceScript.

561 {
562 events.Update(diff);
563 switch (events.ExecuteEvent())
564 {
565 case 0:
566 break;
568 {
569 if (bSwitcher) // used to double the check interval
572
573 if (DoNeedCleanup())
574 {
576 }
577 events.Repeat(5s);
578 }
579 break;
580 case EVENT_OPEN_GATE:
581 {
583 break;
584 }
585 case EVENT_CLOSE_GATE:
586 {
588 }
589 break;
590 case EVENT_SCENE_001:
591 {
593 c->AI()->Talk(SAY_STAGE_0_01);
594
595 events.RescheduleEvent(EVENT_SCENE_002, 22000);
596 }
597 break;
598 case EVENT_SCENE_002:
599 {
601 c->AI()->Talk(SAY_STAGE_0_03a);
602
603 events.RescheduleEvent(EVENT_SCENE_003, 5000);
604 }
605 break;
606 case EVENT_SCENE_003:
607 {
609 c->AI()->Talk(SAY_STAGE_0_03h);
610
611 events.RescheduleEvent(EVENT_SCENE_004, 8000);
612 }
613 break;
614 case EVENT_SCENE_004:
615 {
618
620 c->AI()->Talk(SAY_STAGE_0_02);
623
624 events.RescheduleEvent(EVENT_SUMMON_GORMOK, 1000);
625 if (instance->IsHeroic())
626 {
627 events.RescheduleEvent(EVENT_SCENE_005, 150000);
628 events.RescheduleEvent(EVENT_SCENE_006, 340000);
629 events.RescheduleEvent(EVENT_NORTHREND_BEASTS_ENRAGE, 520000);
630 }
631 }
632 break;
635 if (c->IsAlive())
636 c->CastSpell(c, 26662, true);
638 if (c->IsAlive())
639 c->CastSpell(c, 26662, true);
641 if (c->IsAlive())
642 c->CastSpell(c, 26662, true);
644 if (c->IsAlive())
645 c->CastSpell(c, 26662, true);
646
647 break;
649 {
652 gormok->GetMotionMaster()->MovePoint(0, Locs[LOC_GATE_FRONT].GetPositionX(), Locs[LOC_GATE_FRONT].GetPositionY(), Locs[LOC_GATE_FRONT].GetPositionZ());
653
654 events.RescheduleEvent(EVENT_GORMOK_ATTACK, 10000);
655 events.RescheduleEvent(EVENT_CLOSE_GATE, 6000);
656 }
657 break;
659 {
662 {
663 c->SetReactState(REACT_AGGRESSIVE);
664 c->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
665 c->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
666 if (Unit* target = c->SelectNearestTarget(200.0f))
667 {
668 c->AI()->AttackStart(target);
669 c->AI()->DoZoneInCombat();
670 }
671 }
672 break;
673 }
674 case EVENT_SCENE_005:
675 {
678 c->AI()->Talk(SAY_STAGE_0_04);
679
680 events.RescheduleEvent(EVENT_OPEN_GATE, 3000);
681 events.RescheduleEvent(EVENT_SUMMON_ACIDMAW_AND_DREADSCALE, 4000);
682 break;
683 }
685 {
687 {
689 dreadscale->GetMotionMaster()->MovePoint(0, Locs[LOC_BEHIND_GATE].GetPositionX(), Locs[LOC_BEHIND_GATE].GetPositionY() - 25.0f, Locs[LOC_BEHIND_GATE].GetPositionZ());
691 acidmaw->AddAura(53421, acidmaw);
692 }
693
694 events.RescheduleEvent(EVENT_SCENE_005_2, 4000);
695 break;
696 }
697
699 {
701 dreadscale->GetMotionMaster()->MovePoint(0, Locs[LOC_DREADSCALE].GetPositionX(), Locs[LOC_DREADSCALE].GetPositionY(), Locs[LOC_DREADSCALE].GetPositionZ());
702
703 events.RescheduleEvent(EVENT_ACIDMAW_AND_DREADSCALE_ATTACK, 7000);
704 break;
705 }
707 {
710 {
711 c->SetReactState(REACT_AGGRESSIVE);
712 c->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
713 c->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
714 if (Unit* target = c->SelectNearestTarget(200.0f))
715 {
716 c->AI()->AttackStart(target);
717 c->AI()->DoZoneInCombat();
718 }
719 }
721 {
722 c->SetReactState(REACT_AGGRESSIVE);
723 c->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
724 c->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
725 if (Unit* target = c->SelectNearestTarget(200.0f))
726 {
727 c->RemoveAura(53421);
728 c->CastSpell(c, 66947, false);
729 c->AI()->AttackStart(target);
730 c->AI()->DoZoneInCombat();
731 }
732 }
733 break;
734 }
735 case EVENT_SCENE_006:
736 {
739 c->AI()->Talk(SAY_STAGE_0_05);
740
741 events.RescheduleEvent(EVENT_OPEN_GATE, 2000);
742 events.RescheduleEvent(EVENT_SUMMON_ICEHOWL, 3000);
743 break;
744 }
746 {
749 icehowl->GetMotionMaster()->MovePoint(0, Locs[LOC_GATE_FRONT].GetPositionX(), Locs[LOC_GATE_FRONT].GetPositionY(), Locs[LOC_GATE_FRONT].GetPositionZ());
750
751 events.RescheduleEvent(EVENT_ICEHOWL_ATTACK, 10000);
752 events.RescheduleEvent(EVENT_CLOSE_GATE, 6000);
753 break;
754 }
756 {
758 {
759 c->SetReactState(REACT_AGGRESSIVE);
760 c->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
761 c->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
762 if (Unit* target = c->SelectNearestTarget(200.0f))
763 {
764 c->AI()->AttackStart(target);
765 c->AI()->DoZoneInCombat();
766 }
767 }
768 break;
769 }
771 {
773 c->AI()->Talk(SAY_STAGE_0_06);
775 c->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
776 break;
777 }
778 case EVENT_SCENE_101:
779 {
781 {
783 c->AI()->Talk(SAY_STAGE_1_01);
785 {
786 fizzlebang->AddUnitMovementFlag(MOVEMENTFLAG_WALKING);
787 fizzlebang->GetMotionMaster()->MovePoint(0, Locs[LOC_BEHIND_GATE].GetPositionX(), Locs[LOC_BEHIND_GATE].GetPositionY() - 65.0f, Locs[LOC_BEHIND_GATE].GetPositionZ() - 1.0f);
788 }
789 events.RescheduleEvent(EVENT_SCENE_102, 20000);
790
791 // move Icehowl to side, can't remove corpse because of loot!
793 {
794 icehowl->UpdatePosition(513.19f, 139.48f, 395.22f, 3 * M_PI / 2, true);
795 icehowl->StopMovingOnCurrentPos();
796 icehowl->DestroyForNearbyPlayers();
797 }
798 }
799 break;
800 }
801 case EVENT_SCENE_102:
802 {
805 c->AI()->Talk(SAY_STAGE_1_02);
806
807 events.RescheduleEvent(EVENT_SCENE_103, 11000);
808 break;
809 }
810 case EVENT_SCENE_103:
811 {
813 {
814 c->AI()->Talk(SAY_STAGE_1_03);
815 c->HandleEmoteCommand(EMOTE_STATE_SPELL_PRECAST);
817 NPC_PurpleGroundGUID = trigger->GetGUID();
818 }
819
820 events.RescheduleEvent(EVENT_SCENE_104, 5000);
821 break;
822 }
823 case EVENT_SCENE_104:
824 {
826 {
828 {
829 NPC_PortalGUID = portal->GetGUID();
830 portal->SetObjectScale(3.0f);
831 portal->SetReactState(REACT_PASSIVE);
832 portal->CastSpell(portal, SPELL_WILFRED_PORTAL, true);
833 }
834 c->HandleEmoteCommand(EMOTE_STATE_SPELL_PRECAST);
835 }
836
837 events.RescheduleEvent(EVENT_SUMMON_JARAXXUS, 5000);
838 break;
839 }
841 {
843 {
845 jaraxxus->GetMotionMaster()->MovePoint(0, Locs[LOC_CENTER].GetPositionX(), Locs[LOC_CENTER].GetPositionY() - 10.0f, Locs[LOC_CENTER].GetPositionZ());
846 c->HandleEmoteCommand(EMOTE_STATE_NONE);
847 c->AI()->Talk(SAY_STAGE_1_04);
848 }
849
850 events.RescheduleEvent(EVENT_SCENE_105, 3000);
851 break;
852 }
853 case EVENT_SCENE_105:
854 {
856 c->SetFacingTo(M_PI / 2);
858 c->DespawnOrUnsummon();
861 c->DespawnOrUnsummon();
863
864 events.RescheduleEvent(EVENT_SCENE_106, 10000);
865 break;
866 }
867 case EVENT_SCENE_106:
868 {
870 c->AI()->Talk(SAY_STAGE_1_05);
871
872 events.RescheduleEvent(EVENT_SCENE_107, 5000);
873 break;
874 }
875 case EVENT_SCENE_107:
876 {
878 c->AI()->Talk(SAY_STAGE_1_06);
879
880 events.RescheduleEvent(EVENT_SCENE_108, 800);
881 break;
882 }
883 case EVENT_SCENE_108:
884 {
886 {
887 c->AI()->Talk(SAY_STAGE_1_06_1);
889 {
890 c->CastSpell(f, 67888, true);
891 Unit::Kill(f, f);
892 }
893 }
894
895 events.RescheduleEvent(EVENT_SCENE_109, 5000);
896 break;
897 }
898 case EVENT_SCENE_109:
899 {
901 c->SetFacingTo(3 * M_PI / 2);
903 c->AI()->Talk(SAY_STAGE_1_07);
904
905 events.RescheduleEvent(EVENT_JARAXXUS_ATTACK, 6000);
906 break;
907 }
909 {
912 {
913 c->SetReactState(REACT_AGGRESSIVE);
914 c->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
915 c->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
916 if (Unit* target = c->SelectNearestTarget(200.0f))
917 {
918 c->AI()->AttackStart(target);
919 c->AI()->DoZoneInCombat();
920 }
921 }
922 break;
923 }
924 case EVENT_SCENE_110:
925 {
927 c->AI()->Talk(SAY_STAGE_1_08);
928
929 events.RescheduleEvent(EVENT_SCENE_111, 18000);
930 break;
931 }
932 case EVENT_SCENE_111:
933 {
935 c->AI()->Talk(SAY_STAGE_1_09);
936
937 events.RescheduleEvent(EVENT_SCENE_112, 9000);
938 break;
939 }
940 case EVENT_SCENE_112:
941 {
943 c->AI()->Talk(SAY_STAGE_1_10);
944
945 events.RescheduleEvent(EVENT_SCENE_113, 5000);
946 break;
947 }
948 case EVENT_SCENE_113:
949 {
951 c->AI()->Talk(SAY_STAGE_1_11);
953 c->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
954 break;
955 }
956 case EVENT_SCENE_201:
957 {
958 // move Jaraxxus to side, can't remove corpse because of loot!
960 {
961 jaraxxus->UpdatePosition(613.83f, 139.5f, 395.22f, 3 * M_PI / 2, true);
962 jaraxxus->StopMovingOnCurrentPos();
963 jaraxxus->DestroyForNearbyPlayers();
964 }
965
967 c->AI()->Talk(SAY_STAGE_2_01);
968
969 events.RescheduleEvent(EVENT_SCENE_202, 9000);
970 break;
971 }
972 case EVENT_SCENE_202:
973 {
974 Map::PlayerList const& pl = instance->GetPlayers();
975 for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
976 if (Player* plr = itr->GetSource())
977 if (!plr->IsGameMaster())
978 {
979 TeamIdInInstance = plr->GetTeamId();
980 break;
981 }
982
984 {
986 c->AI()->Talk(SAY_STAGE_2_02h);
987 events.RescheduleEvent(EVENT_SCENE_203, 15000);
988 }
989 else
990 {
992 c->AI()->Talk(SAY_STAGE_2_02a);
993 events.RescheduleEvent(EVENT_SCENE_203, 18000);
994 }
995 break;
996 }
997 case EVENT_SCENE_203:
998 {
1000 c->AI()->Talk(SAY_STAGE_2_03);
1001
1002 events.RescheduleEvent(EVENT_SCENE_204, 5000);
1003 break;
1004 }
1005 case EVENT_SCENE_204:
1006 {
1008 {
1010 c->AI()->Talk(SAY_STAGE_2_04h);
1011 events.RescheduleEvent(EVENT_SCENE_205, 6000);
1012 }
1013 else
1014 {
1016 c->AI()->Talk(SAY_STAGE_2_04a);
1017 events.RescheduleEvent(EVENT_SCENE_205, 5000);
1018 }
1019
1020 events.RescheduleEvent(EVENT_SUMMON_CHAMPIONS, 2500);
1021 break;
1022 }
1023 case EVENT_SCENE_205:
1024 {
1027
1028 break;
1029 }
1031 {
1032 std::vector<uint32> vHealerEntries;
1037
1038 std::vector<uint32> vOtherEntries;
1041 vOtherEntries.push_back(TeamIdInInstance == TEAM_ALLIANCE ? NPC_HORDE_MAGE : NPC_ALLIANCE_MAGE);
1042 vOtherEntries.push_back(TeamIdInInstance == TEAM_ALLIANCE ? NPC_HORDE_ROGUE : NPC_ALLIANCE_ROGUE);
1045
1046 uint8 healersSubtracted = 2;
1048 healersSubtracted = 1;
1049 for( uint8 i = 0; i < healersSubtracted; ++i )
1050 {
1051 uint8 pos = urand(0, vHealerEntries.size() - 1);
1052 switch (vHealerEntries[pos])
1053 {
1055 vOtherEntries.push_back(NPC_ALLIANCE_DRUID_BALANCE);
1056 break;
1058 vOtherEntries.push_back(NPC_HORDE_DRUID_BALANCE);
1059 break;
1061 vOtherEntries.push_back(NPC_ALLIANCE_PALADIN_RETRIBUTION);
1062 break;
1064 vOtherEntries.push_back(NPC_HORDE_PALADIN_RETRIBUTION);
1065 break;
1067 vOtherEntries.push_back(NPC_ALLIANCE_PRIEST_SHADOW);
1068 break;
1070 vOtherEntries.push_back(NPC_HORDE_PRIEST_SHADOW);
1071 break;
1073 vOtherEntries.push_back(NPC_ALLIANCE_SHAMAN_ENHANCEMENT);
1074 break;
1076 vOtherEntries.push_back(NPC_HORDE_SHAMAN_ENHANCEMENT);
1077 break;
1078 }
1079 vHealerEntries.erase(vHealerEntries.begin() + pos);
1080 }
1081
1083 for( uint8 i = 0; i < 4; ++i )
1084 vOtherEntries.erase(vOtherEntries.begin() + urand(0, vOtherEntries.size() - 1));
1085
1086 for( std::vector<uint32>::iterator itr = vHealerEntries.begin(); itr != vHealerEntries.end(); ++itr )
1087 vOtherEntries.push_back(*itr);
1088
1089 uint8 pos2 = 10;
1090 for( std::vector<uint32>::iterator itr = vOtherEntries.begin(); itr != vOtherEntries.end(); ++itr )
1091 {
1092 if (Creature* pTemp = instance->SummonCreature(*itr, FactionChampionLoc[urand(0, 4) + (TeamIdInInstance == TEAM_ALLIANCE ? 0 : 5)]))
1093 {
1094 NPC_ChampionGUIDs.push_back(pTemp->GetGUID());
1095 pTemp->SetHomePosition((TeamIdInInstance == TEAM_ALLIANCE ? FactionChampionLoc[pos2].GetPositionX() : (Locs[LOC_CENTER].GetPositionX() * 2 - FactionChampionLoc[pos2].GetPositionX())), FactionChampionLoc[pos2].GetPositionY(), FactionChampionLoc[pos2].GetPositionZ(), 0.0f);
1096 pTemp->GetMotionMaster()->MoveJump((TeamIdInInstance == TEAM_ALLIANCE ? FactionChampionLoc[pos2].GetPositionX() : (Locs[LOC_CENTER].GetPositionX() * 2 - FactionChampionLoc[pos2].GetPositionX())), FactionChampionLoc[pos2].GetPositionY(), FactionChampionLoc[pos2].GetPositionZ(), 20.0f, 20.0f);
1097 }
1098 ++pos2;
1099 }
1100
1102 events.RescheduleEvent(EVENT_CHAMPIONS_ATTACK, 4000);
1103 break;
1104 }
1106 {
1107 for (ObjectGuid const& guid : NPC_ChampionGUIDs)
1108 if (Creature* c = instance->GetCreature(guid))
1109 {
1110 c->SetReactState(REACT_AGGRESSIVE);
1111 c->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
1112 c->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
1113 //if (Unit* target = c->SelectNearestTarget(200.0f))
1114 // c->AI()->AttackStart(target);
1115 }
1116 Map::PlayerList const& pl = instance->GetPlayers();
1117 for (Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr)
1118 itr->GetSource()->AddToNotify(NOTIFY_AI_RELOCATION);
1120 break;
1121 }
1123 {
1125 c->AI()->Talk(SAY_STAGE_2_06);
1127 c->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
1128 break;
1129 }
1130 case EVENT_SCENE_301:
1131 {
1133 c->AI()->Talk(SAY_STAGE_3_01);
1134
1135 events.RescheduleEvent(EVENT_SCENE_302, 13000);
1136 break;
1137 }
1138 case EVENT_SCENE_302:
1139 {
1141 c->AI()->Talk(SAY_STAGE_3_02);
1142
1143 events.RescheduleEvent(EVENT_SCENE_303, 3000);
1144 break;
1145 }
1146 case EVENT_SCENE_303:
1147 {
1150 {
1153 t->GetMotionMaster()->MovePoint(0, Locs[LOC_VALKYR_DEST_RIGHT].GetPositionX(), Locs[LOC_VALKYR_DEST_RIGHT].GetPositionY(), Locs[LOC_VALKYR_DEST_RIGHT].GetPositionZ());
1155 t->GetMotionMaster()->MovePoint(0, Locs[LOC_VALKYR_DEST_LEFT].GetPositionX(), Locs[LOC_VALKYR_DEST_LEFT].GetPositionY(), Locs[LOC_VALKYR_DEST_LEFT].GetPositionZ());
1156 }
1157
1158 events.RescheduleEvent(EVENT_SCENE_304, 6250);
1159 break;
1160 }
1161 case EVENT_SCENE_304:
1162 {
1166 c->GetMotionMaster()->MovePoint(0, Locs[LOC_VALKYR_DEST_2_RIGHT].GetPositionX(), Locs[LOC_VALKYR_DEST_2_RIGHT].GetPositionY(), Locs[LOC_VALKYR_DEST_2_RIGHT].GetPositionZ());
1168 c->GetMotionMaster()->MovePoint(0, Locs[LOC_VALKYR_DEST_2_LEFT].GetPositionX(), Locs[LOC_VALKYR_DEST_2_LEFT].GetPositionY(), Locs[LOC_VALKYR_DEST_2_LEFT].GetPositionZ());
1169
1170 events.RescheduleEvent(EVENT_VALKYRIES_ATTACK, 3250);
1171 break;
1172 }
1174 {
1176 {
1177 c->SetReactState(REACT_AGGRESSIVE);
1178 c->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
1179 /*if (Unit* target = c->SelectNearestTarget(200.0f))
1180 {
1181 c->AI()->AttackStart(target);
1182 c->AI()->DoZoneInCombat();
1183 }*/
1184 }
1186 {
1187 c->SetReactState(REACT_AGGRESSIVE);
1188 c->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
1189 /*if (Unit* target = c->SelectNearestTarget(200.0f))
1190 {
1191 c->AI()->AttackStart(target);
1192 c->AI()->DoZoneInCombat();
1193 }*/
1194 }
1195 break;
1196 }
1198 {
1200 {
1201 Map::PlayerList const& pl = instance->GetPlayers();
1202 for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
1203 if (Player* plr = itr->GetSource())
1204 if (!plr->IsGameMaster())
1205 {
1206 TeamIdInInstance = plr->GetTeamId();
1207 break;
1208 }
1209 }
1212
1213 events.RescheduleEvent(EVENT_SCENE_401, 60000);
1214 break;
1215 }
1216 case EVENT_SCENE_401:
1217 {
1219 c->AI()->Talk(SAY_STAGE_4_01);
1220
1221 events.RescheduleEvent(EVENT_SCENE_402, 20000);
1222 break;
1223 }
1224 case EVENT_SCENE_402:
1225 {
1230 {
1231 t->SetReactState(REACT_PASSIVE);
1232 t->AddUnitMovementFlag(MOVEMENTFLAG_WALKING);
1233 t->SetDisplayId(11686);
1234 t->AI()->Talk(SAY_STAGE_4_02);
1235 t->SetVisible(false);
1236 }
1237
1238 events.RescheduleEvent(EVENT_SCENE_403, 2000);
1239 break;
1240 }
1241 case EVENT_SCENE_403:
1242 {
1245 {
1246 t->SetReactState(REACT_PASSIVE);
1247 t->CastSpell(t, 51807, true);
1248 }
1249
1250 events.RescheduleEvent(EVENT_SCENE_404, 2000);
1251 break;
1252 }
1253 case EVENT_SCENE_404:
1254 {
1256 {
1257 c->SetDisplayId(c->GetNativeDisplayId());
1258 c->SetVisible(true);
1259 c->GetMotionMaster()->MovePoint(0, Locs[LOC_ARTHAS]);
1260 }
1261
1262 events.RescheduleEvent(EVENT_SCENE_405, 3000);
1263 break;
1264 }
1265 case EVENT_SCENE_405:
1266 {
1268 c->AI()->Talk(SAY_STAGE_4_03);
1269
1270 events.RescheduleEvent(EVENT_SCENE_406, 7000);
1271 break;
1272 }
1273 case EVENT_SCENE_406:
1274 {
1276 {
1277 c->AI()->Talk(SAY_STAGE_4_04);
1278 c->HandleEmoteCommand(EMOTE_ONESHOT_LAUGH);
1279 }
1280
1281 events.RescheduleEvent(EVENT_SCENE_406_2, 2500);
1282 events.RescheduleEvent(EVENT_SCENE_407, 12000);
1283 break;
1284 }
1285 case EVENT_SCENE_406_2:
1286 {
1288 {
1289 c->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_TALK);
1290 }
1291
1292 break;
1293 }
1294
1295 case EVENT_SCENE_407:
1296 {
1298 c->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION);
1299
1300 events.RescheduleEvent(EVENT_SCENE_408, 4000);
1301 break;
1302 }
1303 case EVENT_SCENE_408:
1304 {
1306 {
1307 c->HandleEmoteCommand(EMOTE_ONESHOT_KNEEL);
1308 }
1309
1310 events.RescheduleEvent(EVENT_SCENE_409, 1500);
1311 break;
1312 }
1313 case EVENT_SCENE_409:
1314 {
1316 {
1318 floor->SetDestructibleState(GO_DESTRUCTIBLE_DAMAGED);//floor->ModifyHealth(-10000000, c);
1319 c->CastSpell((Unit*)nullptr, 68193, true);
1320 c->SetVisible(false);
1321 c->SetDisplayId(11686);
1322 if (Creature* t = c->FindNearestCreature(NPC_WORLD_TRIGGER, 500.0f, true))
1323 t->DespawnOrUnsummon();
1324
1326 SpawnAnubArak();
1327 }
1328
1329 events.RescheduleEvent(EVENT_SCENE_410, 2000);
1330 break;
1331 }
1332 case EVENT_SCENE_410:
1333 {
1335 {
1336 c->SetVisible(true);
1337 c->AI()->Talk(SAY_STAGE_4_05);
1338 c->DespawnOrUnsummon(0);
1339 }
1340
1341 break;
1342 }
1343 case EVENT_SCENE_501:
1344 {
1346 {
1347 c->AI()->Talk(SAY_STAGE_4_06);
1348 c->SummonCreature(NPC_ARGENT_MAGE, Locs[LOC_MAGE].GetPositionX(), Locs[LOC_MAGE].GetPositionY(), Locs[LOC_MAGE].GetPositionZ(), Locs[LOC_MAGE].GetOrientation());
1349 c->SummonGameObject(195682, 668.15f, 134.57f, 142.12f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 630000000);
1350 }
1351
1352 events.RescheduleEvent(EVENT_SCENE_502, 20000);
1353 break;
1354 }
1355 case EVENT_SCENE_502:
1356 {
1357 if (instance->IsHeroic())
1358 {
1359 uint32 tributeChest = 0;
1361 {
1362 if (AttemptsLeft >= 50)
1363 tributeChest = GO_TRIBUTE_CHEST_10H_99;
1364 else if (AttemptsLeft >= 45)
1365 tributeChest = GO_TRIBUTE_CHEST_10H_50;
1366 else if (AttemptsLeft >= 25)
1367 tributeChest = GO_TRIBUTE_CHEST_10H_45;
1368 else
1369 tributeChest = GO_TRIBUTE_CHEST_10H_25;
1370 }
1372 {
1373 if (AttemptsLeft >= 50)
1374 tributeChest = GO_TRIBUTE_CHEST_25H_99;
1375 else if (AttemptsLeft >= 45)
1376 tributeChest = GO_TRIBUTE_CHEST_25H_50;
1377 else if (AttemptsLeft >= 25)
1378 tributeChest = GO_TRIBUTE_CHEST_25H_45;
1379 else
1380 tributeChest = GO_TRIBUTE_CHEST_25H_25;
1381 }
1382 if (tributeChest)
1384 {
1385 c->AI()->Talk(SAY_STAGE_4_07);
1386 if (GameObject* chest = c->SummonGameObject(tributeChest, 665.12f, 143.78f, 142.12f, 0.0f, 0, 0, 0, 0, 90000000))
1387 {
1388 chest->SetRespawnTime(chest->GetRespawnDelay());
1389 chest->SetLootRecipient(instance);
1390 }
1391 }
1392 }
1393 break;
1394 }
1395 }
1396 }
@ EVENT_CLOSE_GATE
Definition: trial_of_the_champion.h:68
@ GO_TRIBUTE_CHEST_10H_99
Definition: trial_of_the_crusader.h:208
@ GO_TRIBUTE_CHEST_25H_25
Definition: trial_of_the_crusader.h:209
@ GO_TRIBUTE_CHEST_25H_99
Definition: trial_of_the_crusader.h:212
@ GO_TRIBUTE_CHEST_25H_45
Definition: trial_of_the_crusader.h:210
@ GO_TRIBUTE_CHEST_10H_45
Definition: trial_of_the_crusader.h:206
@ GO_TRIBUTE_CHEST_25H_50
Definition: trial_of_the_crusader.h:211
@ GO_TRIBUTE_CHEST_10H_25
Definition: trial_of_the_crusader.h:205
@ GO_TRIBUTE_CHEST_10H_50
Definition: trial_of_the_crusader.h:207
@ LOC_VALKYR_DEST_2_LEFT
Definition: trial_of_the_crusader.h:310
@ LOC_VALKYR_RIGHT
Definition: trial_of_the_crusader.h:305
@ LOC_BEHIND_GATE
Definition: trial_of_the_crusader.h:300
@ LOC_VALKYR_LEFT
Definition: trial_of_the_crusader.h:306
@ LOC_GATE_FRONT
Definition: trial_of_the_crusader.h:301
@ LOC_DREADSCALE
Definition: trial_of_the_crusader.h:302
@ LOC_MAGE
Definition: trial_of_the_crusader.h:319
@ LOC_ARTHAS_PORTAL
Definition: trial_of_the_crusader.h:311
@ LOC_ARTHAS
Definition: trial_of_the_crusader.h:312
@ LOC_VALKYR_DEST_LEFT
Definition: trial_of_the_crusader.h:308
@ LOC_ACIDMAW
Definition: trial_of_the_crusader.h:303
@ LOC_VALKYR_DEST_2_RIGHT
Definition: trial_of_the_crusader.h:309
@ LOC_VALKYR_DEST_RIGHT
Definition: trial_of_the_crusader.h:307
@ NPC_ALLIANCE_SHAMAN_RESTORATION
Definition: trial_of_the_crusader.h:165
@ NPC_ALLIANCE_MAGE
Definition: trial_of_the_crusader.h:158
@ NPC_ALLIANCE_PALADIN_HOLY
Definition: trial_of_the_crusader.h:159
@ NPC_HORDE_SHAMAN_RESTORATION
Definition: trial_of_the_crusader.h:180
@ NPC_ALLIANCE_DRUID_RESTORATION
Definition: trial_of_the_crusader.h:156
@ NPC_ALLIANCE_DRUID_BALANCE
Definition: trial_of_the_crusader.h:155
@ NPC_ALLIANCE_HUNTER
Definition: trial_of_the_crusader.h:157
@ NPC_HORDE_ROGUE
Definition: trial_of_the_crusader.h:178
@ NPC_HORDE_HUNTER
Definition: trial_of_the_crusader.h:172
@ NPC_PURPLE_GROUND
Definition: trial_of_the_crusader.h:151
@ NPC_ARGENT_MAGE
Definition: trial_of_the_crusader.h:140
@ NPC_HORDE_PRIEST_SHADOW
Definition: trial_of_the_crusader.h:177
@ NPC_HORDE_WARLOCK
Definition: trial_of_the_crusader.h:181
@ NPC_ALLIANCE_ROGUE
Definition: trial_of_the_crusader.h:163
@ NPC_HORDE_PALADIN_RETRIBUTION
Definition: trial_of_the_crusader.h:175
@ NPC_ALLIANCE_WARRIOR
Definition: trial_of_the_crusader.h:167
@ NPC_HORDE_DRUID_RESTORATION
Definition: trial_of_the_crusader.h:171
@ NPC_HORDE_DEATH_KNIGHT
Definition: trial_of_the_crusader.h:169
@ NPC_ALLIANCE_PALADIN_RETRIBUTION
Definition: trial_of_the_crusader.h:160
@ NPC_HORDE_DRUID_BALANCE
Definition: trial_of_the_crusader.h:170
@ NPC_HORDE_WARRIOR
Definition: trial_of_the_crusader.h:182
@ NPC_HORDE_MAGE
Definition: trial_of_the_crusader.h:173
@ NPC_HORDE_SHAMAN_ENHANCEMENT
Definition: trial_of_the_crusader.h:179
@ NPC_ALLIANCE_PRIEST_DISCIPLINE
Definition: trial_of_the_crusader.h:161
@ NPC_HORDE_PRIEST_DISCIPLINE
Definition: trial_of_the_crusader.h:176
@ NPC_ALLIANCE_DEATH_KNIGHT
Definition: trial_of_the_crusader.h:154
@ NPC_ALLIANCE_SHAMAN_ENHANCEMENT
Definition: trial_of_the_crusader.h:164
@ NPC_ALLIANCE_WARLOCK
Definition: trial_of_the_crusader.h:166
@ NPC_HORDE_PALADIN_HOLY
Definition: trial_of_the_crusader.h:174
@ NPC_ALLIANCE_PRIEST_SHADOW
Definition: trial_of_the_crusader.h:162
@ SAY_STAGE_4_07
Definition: trial_of_the_crusader.h:271
@ SAY_STAGE_1_03
Definition: trial_of_the_crusader.h:256
@ SAY_STAGE_1_08
Definition: trial_of_the_crusader.h:226
@ SAY_STAGE_0_06
Definition: trial_of_the_crusader.h:222
@ SAY_STAGE_2_02h
Definition: trial_of_the_crusader.h:248
@ SAY_STAGE_0_02
Definition: trial_of_the_crusader.h:219
@ SAY_STAGE_0_01
Definition: trial_of_the_crusader.h:218
@ SAY_STAGE_4_01
Definition: trial_of_the_crusader.h:233
@ SAY_STAGE_1_10
Definition: trial_of_the_crusader.h:238
@ SAY_STAGE_4_02
Definition: trial_of_the_crusader.h:265
@ SAY_STAGE_4_06
Definition: trial_of_the_crusader.h:270
@ SAY_STAGE_4_04
Definition: trial_of_the_crusader.h:267
@ SAY_STAGE_0_03a
Definition: trial_of_the_crusader.h:237
@ SAY_STAGE_4_05
Definition: trial_of_the_crusader.h:266
@ SAY_STAGE_4_03
Definition: trial_of_the_crusader.h:234
@ SAY_STAGE_0_03h
Definition: trial_of_the_crusader.h:246
@ SAY_STAGE_1_07
Definition: trial_of_the_crusader.h:225
@ SAY_STAGE_1_11
Definition: trial_of_the_crusader.h:227
@ SAY_STAGE_2_04a
Definition: trial_of_the_crusader.h:240
@ SAY_STAGE_1_06_1
Definition: trial_of_the_crusader.h:262
@ SAY_STAGE_2_02a
Definition: trial_of_the_crusader.h:239
@ SAY_STAGE_1_05
Definition: trial_of_the_crusader.h:261
@ SAY_STAGE_1_01
Definition: trial_of_the_crusader.h:224
@ SAY_STAGE_2_01
Definition: trial_of_the_crusader.h:228
@ SAY_STAGE_0_05
Definition: trial_of_the_crusader.h:221
@ SAY_STAGE_3_03a
Definition: trial_of_the_crusader.h:242
@ SAY_STAGE_1_06
Definition: trial_of_the_crusader.h:258
@ SAY_STAGE_1_04
Definition: trial_of_the_crusader.h:257
@ SAY_STAGE_0_04
Definition: trial_of_the_crusader.h:220
@ SAY_STAGE_1_02
Definition: trial_of_the_crusader.h:255
@ SAY_STAGE_3_01
Definition: trial_of_the_crusader.h:231
@ SAY_STAGE_2_06
Definition: trial_of_the_crusader.h:230
@ SAY_STAGE_2_05h
Definition: trial_of_the_crusader.h:250
@ SAY_STAGE_3_03h
Definition: trial_of_the_crusader.h:251
@ SAY_STAGE_3_02
Definition: trial_of_the_crusader.h:232
@ SAY_STAGE_2_04h
Definition: trial_of_the_crusader.h:249
@ SAY_STAGE_2_05a
Definition: trial_of_the_crusader.h:241
@ SAY_STAGE_1_09
Definition: trial_of_the_crusader.h:247
@ SAY_STAGE_2_03
Definition: trial_of_the_crusader.h:229
@ SPELL_WILFRED_PORTAL
Definition: trial_of_the_crusader.h:350
const Position FactionChampionLoc[]
Definition: trial_of_the_crusader.h:322
@ EVENT_SUMMON_CHAMPIONS
Definition: trial_of_the_crusader.h:106
@ EVENT_SCENE_409
Definition: trial_of_the_crusader.h:126
@ EVENT_SCENE_404
Definition: trial_of_the_crusader.h:120
@ EVENT_SCENE_402
Definition: trial_of_the_crusader.h:118
@ EVENT_SCENE_002
Definition: trial_of_the_crusader.h:70
@ EVENT_SCENE_410
Definition: trial_of_the_crusader.h:127
@ EVENT_SCENE_104
Definition: trial_of_the_crusader.h:88
@ EVENT_SCENE_406_2
Definition: trial_of_the_crusader.h:123
@ EVENT_SCENE_407
Definition: trial_of_the_crusader.h:124
@ EVENT_CHAMPIONS_ATTACK
Definition: trial_of_the_crusader.h:107
@ EVENT_ACIDMAW_AND_DREADSCALE_ATTACK
Definition: trial_of_the_crusader.h:78
@ EVENT_GORMOK_ATTACK
Definition: trial_of_the_crusader.h:74
@ EVENT_SCENE_113
Definition: trial_of_the_crusader.h:99
@ EVENT_SUMMON_ICEHOWL
Definition: trial_of_the_crusader.h:80
@ EVENT_SCENE_204
Definition: trial_of_the_crusader.h:104
@ EVENT_SCENE_005_2
Definition: trial_of_the_crusader.h:76
@ EVENT_SCENE_502
Definition: trial_of_the_crusader.h:129
@ EVENT_SCENE_103
Definition: trial_of_the_crusader.h:87
@ EVENT_SCENE_202
Definition: trial_of_the_crusader.h:102
@ EVENT_SCENE_405
Definition: trial_of_the_crusader.h:121
@ EVENT_SCENE_106
Definition: trial_of_the_crusader.h:91
@ EVENT_OPEN_GATE
Definition: trial_of_the_crusader.h:66
@ EVENT_ICEHOWL_ATTACK
Definition: trial_of_the_crusader.h:81
@ EVENT_SCENE_303
Definition: trial_of_the_crusader.h:112
@ EVENT_SCENE_205
Definition: trial_of_the_crusader.h:105
@ EVENT_SUMMON_GORMOK
Definition: trial_of_the_crusader.h:73
@ EVENT_SCENE_403
Definition: trial_of_the_crusader.h:119
@ EVENT_JARAXXUS_ATTACK
Definition: trial_of_the_crusader.h:95
@ EVENT_SCENE_302
Definition: trial_of_the_crusader.h:111
@ EVENT_SCENE_406
Definition: trial_of_the_crusader.h:122
@ EVENT_SCENE_108
Definition: trial_of_the_crusader.h:93
@ EVENT_SCENE_408
Definition: trial_of_the_crusader.h:125
@ EVENT_SCENE_203
Definition: trial_of_the_crusader.h:103
@ EVENT_SCENE_003
Definition: trial_of_the_crusader.h:71
@ EVENT_SCENE_107
Definition: trial_of_the_crusader.h:92
@ EVENT_SUMMON_ACIDMAW_AND_DREADSCALE
Definition: trial_of_the_crusader.h:77
@ EVENT_SCENE_304
Definition: trial_of_the_crusader.h:113
@ EVENT_SCENE_111
Definition: trial_of_the_crusader.h:97
@ EVENT_SUMMON_JARAXXUS
Definition: trial_of_the_crusader.h:89
@ EVENT_VALKYRIES_ATTACK
Definition: trial_of_the_crusader.h:114
@ EVENT_SCENE_109
Definition: trial_of_the_crusader.h:94
@ EVENT_SCENE_105
Definition: trial_of_the_crusader.h:90
@ EVENT_SCENE_112
Definition: trial_of_the_crusader.h:98
@ EVENT_SCENE_102
Definition: trial_of_the_crusader.h:86
@ EMOTE_STATE_SPELL_PRECAST
Definition: SharedDefines.h:1954
@ EMOTE_ONESHOT_KNEEL
Definition: SharedDefines.h:1908
@ EMOTE_ONESHOT_EXCLAMATION
Definition: SharedDefines.h:1899
@ EMOTE_STATE_TALK
Definition: SharedDefines.h:1973
@ EMOTE_ONESHOT_LAUGH
Definition: SharedDefines.h:1903
@ EMOTE_STATE_NONE
Definition: SharedDefines.h:1922
@ TEAM_ALLIANCE
Definition: SharedDefines.h:760
@ TEMPSUMMON_MANUAL_DESPAWN
Definition: Object.h:53
@ TEMPSUMMON_TIMED_DESPAWN
Definition: Object.h:48
@ NOTIFY_AI_RELOCATION
Definition: Object.h:67
@ UNIT_NPC_EMOTESTATE
Definition: UpdateFields.h:140
@ REACT_PASSIVE
Definition: Unit.h:548
static void Kill(Unit *killer, Unit *victim, bool durabilityLoss=true, WeaponAttackType attackType=BASE_ATTACK, SpellInfo const *spellProto=nullptr, Spell const *spell=nullptr)
Definition: Unit.cpp:17702
uint8 GetSpawnMode() const
Definition: Map.h:418
void DoCheckDedicatedInsanity()
Definition: instance_trial_of_the_crusader.cpp:129

References AttemptsLeft, MapRefMgr::begin(), bSwitcher, ObjectGuid::Clear(), DoCheckDedicatedInsanity(), DoNeedCleanup(), EMOTE_ONESHOT_EXCLAMATION, EMOTE_ONESHOT_KNEEL, EMOTE_ONESHOT_LAUGH, EMOTE_STATE_NONE, EMOTE_STATE_SPELL_PRECAST, EMOTE_STATE_TALK, EncounterStatus, MapRefMgr::end(), EVENT_ACIDMAW_AND_DREADSCALE_ATTACK, EVENT_CHAMPIONS_ATTACK, EVENT_CHECK_PLAYERS, EVENT_CLOSE_GATE, EVENT_GORMOK_ATTACK, EVENT_ICEHOWL_ATTACK, EVENT_JARAXXUS_ATTACK, EVENT_NORTHREND_BEASTS_ENRAGE, EVENT_OPEN_GATE, EVENT_SCENE_001, EVENT_SCENE_002, EVENT_SCENE_003, EVENT_SCENE_004, EVENT_SCENE_005, EVENT_SCENE_005_2, EVENT_SCENE_006, EVENT_SCENE_101, EVENT_SCENE_102, EVENT_SCENE_103, EVENT_SCENE_104, EVENT_SCENE_105, EVENT_SCENE_106, EVENT_SCENE_107, EVENT_SCENE_108, EVENT_SCENE_109, EVENT_SCENE_110, EVENT_SCENE_111, EVENT_SCENE_112, EVENT_SCENE_113, EVENT_SCENE_201, EVENT_SCENE_202, EVENT_SCENE_203, EVENT_SCENE_204, EVENT_SCENE_205, EVENT_SCENE_301, EVENT_SCENE_302, EVENT_SCENE_303, EVENT_SCENE_304, EVENT_SCENE_401, EVENT_SCENE_402, EVENT_SCENE_403, EVENT_SCENE_404, EVENT_SCENE_405, EVENT_SCENE_406, EVENT_SCENE_406_2, EVENT_SCENE_407, EVENT_SCENE_408, EVENT_SCENE_409, EVENT_SCENE_410, EVENT_SCENE_501, EVENT_SCENE_502, EVENT_SCENE_BEASTS_DONE, EVENT_SCENE_FACTION_CHAMPIONS_DEAD, EVENT_SCENE_VALKYR_DEAD, EVENT_SUMMON_ACIDMAW_AND_DREADSCALE, EVENT_SUMMON_CHAMPIONS, EVENT_SUMMON_GORMOK, EVENT_SUMMON_ICEHOWL, EVENT_SUMMON_JARAXXUS, EVENT_VALKYRIES_ATTACK, FactionChampionLoc, WorldObject::FindNearestCreature(), Map::GetCreature(), Map::GetGameObject(), Position::GetOrientation(), Map::GetPlayers(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), Map::GetSpawnMode(), GO_DESTRUCTIBLE_DAMAGED, GO_EnterGateGUID, GO_FloorGUID, GO_MainGateGUID, GO_TRIBUTE_CHEST_10H_25, GO_TRIBUTE_CHEST_10H_45, GO_TRIBUTE_CHEST_10H_50, GO_TRIBUTE_CHEST_10H_99, GO_TRIBUTE_CHEST_25H_25, GO_TRIBUTE_CHEST_25H_45, GO_TRIBUTE_CHEST_25H_50, GO_TRIBUTE_CHEST_25H_99, InstanceScript::HandleGameObject(), IN_PROGRESS, InstanceScript::instance, INSTANCE_PROGRESS_ANUB_ARAK, INSTANCE_PROGRESS_INTRO_DONE, INSTANCE_PROGRESS_JARAXXUS_INTRO_DONE, InstanceCleanup(), InstanceProgress, Map::IsHeroic(), Unit::Kill(), LOC_ACIDMAW, LOC_ARTHAS, LOC_ARTHAS_PORTAL, LOC_BEHIND_GATE, LOC_CENTER, LOC_DREADSCALE, LOC_GATE_FRONT, LOC_MAGE, LOC_VALKYR_DEST_2_LEFT, LOC_VALKYR_DEST_2_RIGHT, LOC_VALKYR_DEST_LEFT, LOC_VALKYR_DEST_RIGHT, LOC_VALKYR_LEFT, LOC_VALKYR_RIGHT, Locs, MOVEMENTFLAG_WALKING, northrendBeastsMask, NOTIFY_AI_RELOCATION, NPC_ACIDMAW, NPC_AcidmawGUID, NPC_ALLIANCE_DEATH_KNIGHT, NPC_ALLIANCE_DRUID_BALANCE, NPC_ALLIANCE_DRUID_RESTORATION, NPC_ALLIANCE_HUNTER, NPC_ALLIANCE_MAGE, NPC_ALLIANCE_PALADIN_HOLY, NPC_ALLIANCE_PALADIN_RETRIBUTION, NPC_ALLIANCE_PRIEST_DISCIPLINE, NPC_ALLIANCE_PRIEST_SHADOW, NPC_ALLIANCE_ROGUE, NPC_ALLIANCE_SHAMAN_ENHANCEMENT, NPC_ALLIANCE_SHAMAN_RESTORATION, NPC_ALLIANCE_WARLOCK, NPC_ALLIANCE_WARRIOR, NPC_ARGENT_MAGE, NPC_BarrettGUID, NPC_ChampionGUIDs, NPC_DARKBANE, NPC_DarkbaneGUID, NPC_DREADSCALE, NPC_DreadscaleGUID, NPC_FIZZLEBANG, NPC_FizzlebangGUID, NPC_GarroshGUID, NPC_GORMOK, NPC_GormokGUID, NPC_HORDE_DEATH_KNIGHT, NPC_HORDE_DRUID_BALANCE, NPC_HORDE_DRUID_RESTORATION, NPC_HORDE_HUNTER, NPC_HORDE_MAGE, NPC_HORDE_PALADIN_HOLY, NPC_HORDE_PALADIN_RETRIBUTION, NPC_HORDE_PRIEST_DISCIPLINE, NPC_HORDE_PRIEST_SHADOW, NPC_HORDE_ROGUE, NPC_HORDE_SHAMAN_ENHANCEMENT, NPC_HORDE_SHAMAN_RESTORATION, NPC_HORDE_WARLOCK, NPC_HORDE_WARRIOR, NPC_ICEHOWL, NPC_IcehowlGUID, NPC_JARAXXUS, NPC_JaraxxusGUID, NPC_LICH_KING, NPC_LichKingGUID, NPC_LIGHTBANE, NPC_LightbaneGUID, NPC_PortalGUID, NPC_PURPLE_GROUND, NPC_PurpleGroundGUID, NPC_TirionGUID, NPC_VarianGUID, NPC_WORLD_TRIGGER, RAID_DIFFICULTY_10MAN_HEROIC, RAID_DIFFICULTY_10MAN_NORMAL, RAID_DIFFICULTY_25MAN_HEROIC, RAID_DIFFICULTY_25MAN_NORMAL, REACT_AGGRESSIVE, REACT_PASSIVE, SAY_STAGE_0_01, SAY_STAGE_0_02, SAY_STAGE_0_03a, SAY_STAGE_0_03h, SAY_STAGE_0_04, SAY_STAGE_0_05, SAY_STAGE_0_06, SAY_STAGE_1_01, SAY_STAGE_1_02, SAY_STAGE_1_03, SAY_STAGE_1_04, SAY_STAGE_1_05, SAY_STAGE_1_06, SAY_STAGE_1_06_1, SAY_STAGE_1_07, SAY_STAGE_1_08, SAY_STAGE_1_09, SAY_STAGE_1_10, SAY_STAGE_1_11, SAY_STAGE_2_01, SAY_STAGE_2_02a, SAY_STAGE_2_02h, SAY_STAGE_2_03, SAY_STAGE_2_04a, SAY_STAGE_2_04h, SAY_STAGE_2_05a, SAY_STAGE_2_05h, SAY_STAGE_2_06, SAY_STAGE_3_01, SAY_STAGE_3_02, SAY_STAGE_3_03a, SAY_STAGE_3_03h, SAY_STAGE_4_01, SAY_STAGE_4_02, SAY_STAGE_4_03, SAY_STAGE_4_04, SAY_STAGE_4_05, SAY_STAGE_4_06, SAY_STAGE_4_07, SpawnAnubArak(), SPELL_WILFRED_PORTAL, Map::SummonCreature(), WorldObject::SummonCreature(), WorldObject::SummonGameObject(), TEAM_ALLIANCE, TEAM_NEUTRAL, TeamIdInInstance, TEMPSUMMON_CORPSE_TIMED_DESPAWN, TEMPSUMMON_MANUAL_DESPAWN, TEMPSUMMON_TIMED_DESPAWN, UNIT_FLAG_NON_ATTACKABLE, UNIT_NPC_EMOTESTATE, UNIT_NPC_FLAG_GOSSIP, and urand().

◆ WriteSaveDataMore()

void instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::WriteSaveDataMore ( std::ostringstream &  data)
inlineoverridevirtual

Reimplemented from InstanceScript.

1610 {
1611 data << InstanceProgress;
1612
1613 if (instance->IsHeroic())
1614 {
1615 data << ' '
1616 << AttemptsLeft << ' '
1617 << (bDedicatedInsanity ? 1 : 0) << ' '
1618 << (bNooneDied ? 1 : 0);
1619 }
1620 }

References AttemptsLeft, bDedicatedInsanity, bNooneDied, InstanceScript::instance, InstanceProgress, and Map::IsHeroic().

Member Data Documentation

◆ AchievementTimer

uint32 instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::AchievementTimer

Referenced by Initialize(), and SetData().

◆ AttemptsLeft

uint32 instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::AttemptsLeft

◆ bDedicatedInsanity

bool instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::bDedicatedInsanity

◆ bNooneDied

bool instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::bNooneDied

◆ bSwitcher

bool instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::bSwitcher

Referenced by Initialize(), and Update().

◆ CLEANED

bool instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::CLEANED

◆ Counter

uint8 instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::Counter

◆ EncounterStatus

uint32 instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::EncounterStatus

◆ events

EventMap instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::events

◆ GO_EnterGateGUID

ObjectGuid instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::GO_EnterGateGUID

◆ GO_FloorGUID

ObjectGuid instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::GO_FloorGUID

◆ GO_MainGateGUID

ObjectGuid instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::GO_MainGateGUID

◆ GO_WebDoorGUID

ObjectGuid instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::GO_WebDoorGUID

◆ InstanceProgress

uint32 instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::InstanceProgress

◆ northrendBeastsMask

uint8 instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::northrendBeastsMask

◆ NPC_AcidmawGUID

ObjectGuid instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::NPC_AcidmawGUID

◆ NPC_AnubarakGUID

ObjectGuid instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::NPC_AnubarakGUID

◆ NPC_BarrettGUID

ObjectGuid instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::NPC_BarrettGUID

◆ NPC_ChampionGUIDs

GuidVector instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::NPC_ChampionGUIDs

◆ NPC_DarkbaneGUID

ObjectGuid instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::NPC_DarkbaneGUID

◆ NPC_DreadscaleGUID

ObjectGuid instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::NPC_DreadscaleGUID

◆ NPC_FizzlebangGUID

ObjectGuid instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::NPC_FizzlebangGUID

◆ NPC_GarroshGUID

ObjectGuid instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::NPC_GarroshGUID

Referenced by OnCreatureCreate(), SetData(), and Update().

◆ NPC_GormokGUID

ObjectGuid instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::NPC_GormokGUID

◆ NPC_IcehowlGUID

ObjectGuid instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::NPC_IcehowlGUID

◆ NPC_JaraxxusGUID

ObjectGuid instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::NPC_JaraxxusGUID

◆ NPC_LichKingGUID

ObjectGuid instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::NPC_LichKingGUID

◆ NPC_LightbaneGUID

ObjectGuid instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::NPC_LightbaneGUID

◆ NPC_PortalGUID

ObjectGuid instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::NPC_PortalGUID

Referenced by InstanceCleanup(), and Update().

◆ NPC_PurpleGroundGUID

ObjectGuid instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::NPC_PurpleGroundGUID

Referenced by InstanceCleanup(), and Update().

◆ NPC_TirionGUID

ObjectGuid instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::NPC_TirionGUID

Referenced by OnCreatureCreate(), SetData(), and Update().

◆ NPC_VarianGUID

ObjectGuid instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::NPC_VarianGUID

Referenced by OnCreatureCreate(), SetData(), and Update().

◆ str_data

std::string instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::str_data

◆ TeamIdInInstance

TeamId instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::TeamIdInInstance

Referenced by Initialize(), SetData(), and Update().