AzeorthCore 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)
 
std::string GetSaveData () override
 
void Load (const char *in) 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)
 
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)
 
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
 
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)
 
- 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
 

Additional Inherited Members

- Static Public Member Functions inherited from InstanceScript
static std::string GetBossStateName (uint8 state)
 
- Protected Member Functions inherited from InstanceScript
void SetBossNumber (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 AddObject (Creature *obj, bool add)
 
void AddObject (GameObject *obj, bool add)
 
void AddObject (WorldObject *obj, uint32 type, bool add)
 
void AddDoor (GameObject *door, bool add)
 
void AddMinion (Creature *minion, bool add)
 
void UpdateDoorState (GameObject *door)
 
void UpdateMinionState (Creature *minion, EncounterState state)
 
std::string LoadBossState (char const *data)
 
std::string GetBossSaveData ()
 

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
35: InstanceScript(pMap) { Initialize(); }
Definition: InstanceScript.h:140
void Initialize() override
Definition: instance_trial_of_the_crusader.cpp:162

References Initialize().

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.

1643 {
1644 switch(criteria_id)
1645 {
1649 {
1650 std::list<Creature*> L;
1651 uint8 count = 0;
1652 c->GetCreaturesWithEntryInRange(L, 200.0f, 34800); // find all snobolds
1653 for( std::list<Creature*>::const_iterator itr = L.begin(); itr != L.end(); ++itr )
1654 if( (*itr)->GetVehicle() )
1655 ++count;
1656 return (count >= 2);
1657 }
1658 break;
1662 {
1663 std::list<Creature*> L;
1664 uint8 count = 0;
1665 c->GetCreaturesWithEntryInRange(L, 200.0f, 34800); // find all snobolds
1666 for( std::list<Creature*>::const_iterator itr = L.begin(); itr != L.end(); ++itr )
1667 if( (*itr)->GetVehicle() )
1668 ++count;
1669 return (count >= 4);
1670 }
1671 break;
1677 {
1678 std::list<Creature*> L;
1679 uint8 count = 0;
1680 c->GetCreaturesWithEntryInRange(L, 200.0f, 34826); // find all mistress of pain
1681 for( std::list<Creature*>::const_iterator itr = L.begin(); itr != L.end(); ++itr )
1682 if( (*itr)->IsAlive() )
1683 ++count;
1684 return (count >= 2);
1685 }
1686 break;
1689 return AttemptsLeft >= 25;
1692 return AttemptsLeft >= 45;
1696 return AttemptsLeft == 50;
1699 return AttemptsLeft == 50 && bNooneDied;
1701 return AttemptsLeft == 50 && bDedicatedInsanity;
1702 }
1703 return false;
1704 }
std::uint8_t uint8
Definition: Define.h:110
@ ACHIEV_CRITERIA_THREE_SIXTY_PAIN_SPIKE_25_H
Definition: trial_of_the_crusader.h:366
@ ACHIEV_CRITERIA_A_TRIBUTE_TO_SKILL_10_PLAYER
Definition: trial_of_the_crusader.h:368
@ ACHIEV_CRITERIA_UPPER_BACK_PAIN_25_H
Definition: trial_of_the_crusader.h:362
@ ACHIEV_CRITERIA_A_TRIBUTE_TO_INSANITY_10_PLAYER
Definition: trial_of_the_crusader.h:372
@ ACHIEV_CRITERIA_A_TRIBUTE_TO_INSANITY_25_PLAYER
Definition: trial_of_the_crusader.h:373
@ ACHIEV_CRITERIA_A_TRIBUTE_TO_DEDICATED_INSANITY
Definition: trial_of_the_crusader.h:376
@ ACHIEV_CRITERIA_A_TRIBUTE_TO_IMMORTALITY_ALLIANCE
Definition: trial_of_the_crusader.h:375
@ ACHIEV_CRITERIA_REALM_FIRST_GRAND_CRUSADER
Definition: trial_of_the_crusader.h:377
@ ACHIEV_CRITERIA_A_TRIBUTE_TO_SKILL_25_PLAYER
Definition: trial_of_the_crusader.h:369
@ ACHIEV_CRITERIA_A_TRIBUTE_TO_MAD_SKILL_25_PLAYER
Definition: trial_of_the_crusader.h:371
@ ACHIEV_CRITERIA_A_TRIBUTE_TO_MAD_SKILL_10_PLAYER
Definition: trial_of_the_crusader.h:370
@ ACHIEV_CRITERIA_THREE_SIXTY_PAIN_SPIKE_25_N
Definition: trial_of_the_crusader.h:365
@ ACHIEV_CRITERIA_UPPER_BACK_PAIN_10_N
Definition: trial_of_the_crusader.h:359
@ ACHIEV_CRITERIA_THREE_SIXTY_PAIN_SPIKE_10_H
Definition: trial_of_the_crusader.h:364
@ ACHIEV_CRITERIA_THREE_SIXTY_PAIN_SPIKE_10_N
Definition: trial_of_the_crusader.h:363
@ ACHIEV_CRITERIA_UPPER_BACK_PAIN_25_N
Definition: trial_of_the_crusader.h:361
@ ACHIEV_CRITERIA_UPPER_BACK_PAIN_10_H
Definition: trial_of_the_crusader.h:360
@ ACHIEV_CRITERIA_A_TRIBUTE_TO_IMMORTALITY_HORDE
Definition: trial_of_the_crusader.h:374
Definition: Creature.h:46
Map * instance
Definition: InstanceScript.h:146
Creature * GetCreature(ObjectGuid const guid)
Definition: Map.cpp:3290
bool bNooneDied
Definition: instance_trial_of_the_crusader.cpp:47
ObjectGuid NPC_BarrettGUID
Definition: instance_trial_of_the_crusader.cpp:51
uint32 AttemptsLeft
Definition: instance_trial_of_the_crusader.cpp:40
bool bDedicatedInsanity
Definition: instance_trial_of_the_crusader.cpp:45

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
127 {
128 if (!bDedicatedInsanity || AttemptsLeft < 50 || instance->GetDifficulty() != RAID_DIFFICULTY_10MAN_HEROIC)
129 return;
130
131 if (validDedicatedInsanityItems.empty())
132 {
133 for (uint32 i = 0; i < dIIc; ++i)
135 }
136
137 Map::PlayerList const& pl = instance->GetPlayers();
138 for (Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr)
139 if (Player* plr = itr->GetSource())
140 if (!plr->IsGameMaster() && plr->IsInCombat() /*performance*/)
141 {
142 for (uint8 i = EQUIPMENT_SLOT_START; i < EQUIPMENT_SLOT_END; ++i) // loop through equipped items
143 if (Item* item = plr->GetItemByPos(INVENTORY_SLOT_BAG_0, i))
144 if (!IsValidDedicatedInsanityItem(item->GetTemplate()))
145 {
146 bDedicatedInsanity = false;
147 SaveToDB();
148 return;
149 }
150 }
151 }
std::uint32_t uint32
Definition: Define.h:108
@ EQUIPMENT_SLOT_END
Definition: Player.h:695
@ EQUIPMENT_SLOT_START
Definition: Player.h:675
#define INVENTORY_SLOT_BAG_0
Definition: Player.h:671
std::map< uint32, bool > validDedicatedInsanityItems
Definition: instance_trial_of_the_crusader.cpp:26
const uint32 dIIc
Definition: trial_of_the_crusader.h:386
const uint32 dedicatedInsanityItems[405]
Definition: trial_of_the_crusader.h:387
@ RAID_DIFFICULTY_10MAN_HEROIC
Definition: DBCEnums.h:280
Definition: LinkedList.h:139
Definition: Item.h:214
Definition: Player.h:1046
void SaveToDB()
Definition: InstanceScript.cpp:40
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:110

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
1418 {
1419 uint8 aliveCount = 0;
1420 for (auto const& itr: instance->GetPlayers())
1421 {
1422 if (Player* plr = itr.GetSource())
1423 {
1424 if (plr != ignoredPlayer && plr->IsAlive() && !plr->IsGameMaster())
1425 {
1426 ++aliveCount;
1427 }
1428 }
1429 }
1430
1431 bool need = aliveCount == 0;
1432 if (!need && CLEANED)
1433 {
1434 CLEANED = false;
1435 }
1436
1437 return need;
1438 }
bool CLEANED
Definition: instance_trial_of_the_crusader.cpp:37

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.

527 {
528 switch( type )
529 {
531 return InstanceProgress;
532 }
533 return 0;
534 }
@ TYPE_INSTANCE_PROGRESS
Definition: trial_of_the_crusader.h:30
uint32 InstanceProgress
Definition: instance_trial_of_the_crusader.cpp:39

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.

537 {
538 switch( type )
539 {
540 case TYPE_GORMOK:
541 return NPC_GormokGUID;
542 case TYPE_DREADSCALE:
543 return NPC_DreadscaleGUID;
544 case TYPE_ACIDMAW:
545 return NPC_AcidmawGUID;
546 case NPC_DARKBANE:
547 return NPC_DarkbaneGUID;
548 case NPC_LIGHTBANE:
549 return NPC_LightbaneGUID;
550 case TYPE_ANUBARAK:
551 return NPC_AnubarakGUID;
552 }
553
554 return ObjectGuid::Empty;
555 }
@ NPC_LIGHTBANE
Definition: trial_of_the_crusader.h:183
@ NPC_DARKBANE
Definition: trial_of_the_crusader.h:184
@ TYPE_DREADSCALE
Definition: trial_of_the_crusader.h:36
@ TYPE_ACIDMAW
Definition: trial_of_the_crusader.h:37
@ TYPE_ANUBARAK
Definition: trial_of_the_crusader.h:43
@ TYPE_GORMOK
Definition: trial_of_the_crusader.h:34
static ObjectGuid const Empty
Definition: ObjectGuid.h:122
ObjectGuid NPC_DreadscaleGUID
Definition: instance_trial_of_the_crusader.cpp:58
ObjectGuid NPC_LightbaneGUID
Definition: instance_trial_of_the_crusader.cpp:63
ObjectGuid NPC_AnubarakGUID
Definition: instance_trial_of_the_crusader.cpp:66
ObjectGuid NPC_AcidmawGUID
Definition: instance_trial_of_the_crusader.cpp:59
ObjectGuid NPC_GormokGUID
Definition: instance_trial_of_the_crusader.cpp:57
ObjectGuid NPC_DarkbaneGUID
Definition: instance_trial_of_the_crusader.cpp:64

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.

◆ GetSaveData()

std::string instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::GetSaveData ( )
inlineoverridevirtual

Reimplemented from InstanceScript.

1593 {
1595 std::ostringstream saveStream;
1596 saveStream << "T C " << InstanceProgress;
1597 if( instance->IsHeroic() )
1598 saveStream << ' ' << AttemptsLeft << ' ' << (bDedicatedInsanity ? (uint32)1 : (uint32)0) << ' ' << (bNooneDied ? (uint32)1 : (uint32)0);
1599 str_data = saveStream.str();
1601 return str_data;
1602 }
#define OUT_SAVE_INST_DATA_COMPLETE
Definition: InstanceScript.h:28
#define OUT_SAVE_INST_DATA
Definition: InstanceScript.h:27
bool IsHeroic() const
Definition: Map.h:451
std::string str_data
Definition: instance_trial_of_the_crusader.cpp:48

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

◆ Initialize()

void instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::Initialize ( )
inlineoverridevirtual

Reimplemented from InstanceScript.

163 {
164 CLEANED = false;
167 AttemptsLeft = 50;
169 Counter = 0;
172 bDedicatedInsanity = true;
173 bSwitcher = false;
174 bNooneDied = true;
175 events.Reset();
176 events.RescheduleEvent(EVENT_CHECK_PLAYERS, 0);
177
178 NPC_ChampionGUIDs.clear();
179 }
@ NOT_STARTED
Definition: InstanceScript.h:56
@ EVENT_CHECK_PLAYERS
Definition: boss_kiljaeden.cpp:117
events
Definition: boss_sartura.cpp:43
@ INSTANCE_PROGRESS_INITIAL
Definition: trial_of_the_champion.h:51
@ TEAM_NEUTRAL
Definition: SharedDefines.h:734
bool bSwitcher
Definition: instance_trial_of_the_crusader.cpp:46
TeamId TeamIdInInstance
Definition: instance_trial_of_the_crusader.cpp:41
uint8 northrendBeastsMask
Definition: instance_trial_of_the_crusader.cpp:43
uint32 AchievementTimer
Definition: instance_trial_of_the_crusader.cpp:44
GuidVector NPC_ChampionGUIDs
Definition: instance_trial_of_the_crusader.cpp:62
uint8 Counter
Definition: instance_trial_of_the_crusader.cpp:42
uint32 EncounterStatus
Definition: instance_trial_of_the_crusader.cpp:38

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
1441 {
1442 if( CLEANED )
1443 return;
1444 CLEANED = true;
1445
1446 switch( InstanceProgress )
1447 {
1450 c->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
1451 break;
1454 c->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
1456 {
1457 c->AI()->DoAction(-1); // despawn summons
1458 c->DespawnOrUnsummon();
1459 }
1462 c->DespawnOrUnsummon();
1465 c->DespawnOrUnsummon();
1468 c->DespawnOrUnsummon();
1471 break;
1474 c->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
1476 c->DespawnOrUnsummon();
1479 c->DespawnOrUnsummon();
1482 c->DespawnOrUnsummon();
1485 c->DespawnOrUnsummon();
1487 break;
1490 c->DespawnOrUnsummon();
1492 {
1493 c->RemoveNpcFlag(UNIT_NPC_FLAG_GOSSIP);
1495 {
1496 jaraxxus->CastSpell(jaraxxus, 67924, true);
1497 jaraxxus->SetReactState(REACT_AGGRESSIVE);
1498 jaraxxus->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
1499 jaraxxus->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
1500 }
1501 }
1502 break;
1505 c->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
1506 for (ObjectGuid const& guid : NPC_ChampionGUIDs)
1507 if (Creature* c = instance->GetCreature(guid))
1508 c->DespawnOrUnsummon();
1509 NPC_ChampionGUIDs.clear();
1510 break;
1513 c->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
1515 {
1516 c->AI()->DoAction(-1);
1517 c->DespawnOrUnsummon();
1518 }
1521 {
1522 c->AI()->DoAction(-1);
1523 c->DespawnOrUnsummon();
1524 }
1526 break;
1529 /*if( GameObject* floor = instance->GetGameObject(GO_FloorGUID) )
1530 floor->SetDestructibleState(GO_DESTRUCTIBLE_REBUILDING, nullptr, true);*/
1532 {
1534 {
1535 c->SetVisible(false);
1536 c->RemoveNpcFlag(UNIT_NPC_FLAG_GOSSIP);
1537 }
1538 else
1539 {
1540 c->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
1541 c->SetVisible(true);
1542 c->SetFacingTo(c->GetOrientation());
1543 }
1544 if (Creature* t = c->FindNearestCreature(NPC_WORLD_TRIGGER, 500.0f, true))
1545 t->DespawnOrUnsummon();
1546 }
1548 c->DespawnOrUnsummon();
1550
1552 {
1553 c->AI()->DoAction(-1);
1554 c->DespawnOrUnsummon();
1555 }
1557
1558 break;
1561 floor->SetDestructibleState(GO_DESTRUCTIBLE_REBUILDING, nullptr, true);
1563 {
1564 c->SetVisible(false);
1565 c->RemoveNpcFlag(UNIT_NPC_FLAG_GOSSIP);
1566 }
1567 break;
1568 }
1569
1570 if (instance->IsHeroic() && AttemptsLeft > 0 && !fromFailed && EncounterStatus == IN_PROGRESS)
1571 {
1572 --AttemptsLeft;
1573 Map::PlayerList const& pl = instance->GetPlayers();
1574 for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
1575 if( Player* plr = itr->GetSource() )
1576 plr->SendUpdateWorldState(UPDATE_STATE_UI_COUNT, AttemptsLeft);
1577 }
1578
1579 if( instance->IsHeroic() && AttemptsLeft == 0 )
1581 c->RemoveNpcFlag(UNIT_NPC_FLAG_GOSSIP);
1582
1586 Counter = 0;
1588 events.Reset();
1590 }
@ TEMPSUMMON_CORPSE_TIMED_DESPAWN
Definition: Object.h:47
@ MOVEMENTFLAG_WALKING
Definition: Unit.h:560
@ REACT_AGGRESSIVE
Definition: Unit.h:1025
@ UNIT_NPC_FLAG_GOSSIP
Definition: Unit.h:516
@ UNIT_FLAG_NON_ATTACKABLE
Definition: Unit.h:449
@ IN_PROGRESS
Definition: InstanceScript.h:57
#define CLEANUP_CHECK_INTERVAL
Definition: instance_trial_of_the_crusader.cpp:25
const Position Locs[]
Definition: trial_of_the_crusader.h:272
@ LOC_CENTER
Definition: trial_of_the_crusader.h:302
@ UPDATE_STATE_UI_COUNT
Definition: trial_of_the_crusader.h:383
@ NPC_WORLD_TRIGGER
Definition: trial_of_the_crusader.h:151
@ NPC_JARAXXUS
Definition: trial_of_the_crusader.h:148
@ INSTANCE_PROGRESS_INTRO_DONE
Definition: trial_of_the_crusader.h:52
@ INSTANCE_PROGRESS_BEASTS_DEAD
Definition: trial_of_the_crusader.h:53
@ INSTANCE_PROGRESS_DONE
Definition: trial_of_the_crusader.h:59
@ INSTANCE_PROGRESS_VALKYR_DEAD
Definition: trial_of_the_crusader.h:57
@ INSTANCE_PROGRESS_ANUB_ARAK
Definition: trial_of_the_crusader.h:58
@ INSTANCE_PROGRESS_JARAXXUS_DEAD
Definition: trial_of_the_crusader.h:55
@ INSTANCE_PROGRESS_FACTION_CHAMPIONS_DEAD
Definition: trial_of_the_crusader.h:56
@ INSTANCE_PROGRESS_JARAXXUS_INTRO_DONE
Definition: trial_of_the_crusader.h:54
@ GO_DESTRUCTIBLE_REBUILDING
Definition: SharedDefines.h:1602
Definition: GameObject.h:813
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition: Object.cpp:2395
TempSummon * SummonCreature(uint32 id, const Position &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0, SummonPropertiesEntry const *properties=nullptr) const
Definition: Object.cpp:2304
Definition: ObjectGuid.h:120
void Clear()
Definition: ObjectGuid.h:140
float GetPositionZ() const
Definition: Position.h:119
float GetOrientation() const
Definition: Position.h:120
float GetPositionX() const
Definition: Position.h:117
float GetPositionY() const
Definition: Position.h:118
void HandleGameObject(ObjectGuid guid, bool open, GameObject *go=nullptr)
Definition: InstanceScript.cpp:108
GameObject * GetGameObject(ObjectGuid const guid)
Definition: Map.cpp:3295
ObjectGuid GO_WebDoorGUID
Definition: instance_trial_of_the_crusader.cpp:73
ObjectGuid NPC_PurpleGroundGUID
Definition: instance_trial_of_the_crusader.cpp:68
ObjectGuid GO_EnterGateGUID
Definition: instance_trial_of_the_crusader.cpp:72
ObjectGuid NPC_JaraxxusGUID
Definition: instance_trial_of_the_crusader.cpp:61
ObjectGuid NPC_FizzlebangGUID
Definition: instance_trial_of_the_crusader.cpp:53
ObjectGuid NPC_IcehowlGUID
Definition: instance_trial_of_the_crusader.cpp:60
ObjectGuid NPC_PortalGUID
Definition: instance_trial_of_the_crusader.cpp:69
ObjectGuid GO_MainGateGUID
Definition: instance_trial_of_the_crusader.cpp:71
ObjectGuid GO_FloorGUID
Definition: instance_trial_of_the_crusader.cpp:74
ObjectGuid NPC_LichKingGUID
Definition: instance_trial_of_the_crusader.cpp:65

References AttemptsLeft, MapRefMgr::begin(), CLEANED, CLEANUP_CHECK_INTERVAL, 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.

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

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
111 {
112 if (!item) // should not happen, but checked in GetAverageItemLevel()
113 return true;
114 if (item->ItemLevel < 245)
115 return true;
116 if (item->ItemId == 46017) // Val'anyr, Hammer of Ancient Kings - exception, too powerful
117 return false;
118 if (item->ItemLevel == 245 && item->Bonding == BIND_WHEN_EQUIPED) // this also includes items crafted from patterns obtained in ToC 10 norm/hc
119 return true;
120 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
121 return true;
122
123 return false;
124 }
@ BIND_WHEN_EQUIPED
Definition: ItemTemplate.h:98

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

Referenced by DoCheckDedicatedInsanity().

◆ Load()

void instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::Load ( const char *  in)
inlineoverridevirtual

Reimplemented from InstanceScript.

1605 {
1607 CLEANED = false;
1608 events.Reset();
1609 events.RescheduleEvent(EVENT_CHECK_PLAYERS, 0);
1610
1611 if( !in )
1612 {
1614 return;
1615 }
1616
1618
1619 char dataHead1, dataHead2;
1620 uint16 data0;
1621 std::istringstream loadStream(in);
1622 loadStream >> dataHead1 >> dataHead2 >> data0;
1623
1624 if( dataHead1 == 'T' && dataHead2 == 'C' )
1625 {
1626 InstanceProgress = data0;
1627 if( instance->IsHeroic() )
1628 {
1629 uint32 data1 = 0, data2 = 0, data3 = 0;
1630 loadStream >> data1 >> data2 >> data3;
1631 AttemptsLeft = data1;
1632 bDedicatedInsanity = !!data2;
1633 bNooneDied = !!data3;
1634 }
1635 }
1636 else
1638
1640 }
std::uint16_t uint16
Definition: Define.h:109
#define OUT_LOAD_INST_DATA_FAIL
Definition: InstanceScript.h:31
#define OUT_LOAD_INST_DATA_COMPLETE
Definition: InstanceScript.h:30
#define OUT_LOAD_INST_DATA(a)
Definition: InstanceScript.h:29

References AttemptsLeft, bDedicatedInsanity, bNooneDied, CLEANED, EncounterStatus, EVENT_CHECK_PLAYERS, InstanceScript::instance, InstanceProgress, Map::IsHeroic(), NOT_STARTED, OUT_LOAD_INST_DATA, OUT_LOAD_INST_DATA_COMPLETE, and OUT_LOAD_INST_DATA_FAIL.

◆ OnCreatureCreate()

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

Reimplemented from InstanceScript.

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

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.

245 {
246 switch( go->GetEntry() )
247 {
249 GO_MainGateGUID = go->GetGUID();
251 break;
252 case GO_WEB_DOOR:
253 GO_WebDoorGUID = go->GetGUID();
255 break;
257 GO_FloorGUID = go->GetGUID();
260 break;
263 HandleGameObject(go->GetGUID(), false, go);
264 break;
266 HandleGameObject(go->GetGUID(), true, go);
268 break;
269 }
270 }
@ GO_SOUTH_PORTCULLIS
Definition: trial_of_the_champion.h:152
@ GO_EAST_PORTCULLIS
Definition: trial_of_the_champion.h:153
@ GO_NORTH_PORTCULLIS
Definition: trial_of_the_champion.h:154
@ GO_ARGENT_COLISEUM_FLOOR
Definition: trial_of_the_crusader.h:191
@ GO_MAIN_GATE_DOOR
Definition: trial_of_the_crusader.h:192
@ GO_WEB_DOOR
Definition: trial_of_the_crusader.h:193
@ GO_DESTRUCTIBLE_DAMAGED
Definition: SharedDefines.h:1600
void SetDestructibleState(GameObjectDestructibleState state, Player *eventInvoker=nullptr, bool setHealth=false)
Definition: GameObject.cpp:2338

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.

1397 {
1398 if( instance->IsHeroic() )
1399 {
1402 }
1403 else
1405
1406 if (DoNeedCleanup(plr))
1407 {
1409 }
1410
1411 // if missing spawn anub'arak
1412 SpawnAnubArak();
1413
1415 }
@ UPDATE_STATE_UI_SHOW
Definition: trial_of_the_crusader.h:382
void SendUpdateWorldState(uint32 variable, uint32 value) const
Definition: PlayerUpdates.cpp:2194
void InstanceCleanup(bool fromFailed=false)
Definition: instance_trial_of_the_crusader.cpp:1440
bool DoNeedCleanup(Player *ignoredPlayer=nullptr)
Definition: instance_trial_of_the_crusader.cpp:1417
void SpawnAnubArak()
Definition: instance_trial_of_the_crusader.cpp:76

References AttemptsLeft, CLEANUP_CHECK_INTERVAL, 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.

154 {
155 if (bNooneDied && u->GetTypeId() == TYPEID_PLAYER)
156 {
157 bNooneDied = false;
158 SaveToDB();
159 }
160 }
@ TYPEID_PLAYER
Definition: ObjectGuid.h:38
TypeID GetTypeId() const
Definition: Object.h:121

References bNooneDied, Object::GetTypeId(), InstanceScript::SaveToDB(), and TYPEID_PLAYER.

◆ SetData()

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

Reimplemented from ZoneScript.

273 {
274 switch( type )
275 {
276 case TYPE_FAILED:
277 // - some scene here?
278 if( instance->IsHeroic() && !CLEANED )
279 {
280 if( AttemptsLeft > 0 )
281 --AttemptsLeft;
282 Map::PlayerList const& pl = instance->GetPlayers();
283 for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
284 if( Player* plr = itr->GetSource() )
285 plr->SendUpdateWorldState(UPDATE_STATE_UI_COUNT, AttemptsLeft);
286 }
287 InstanceCleanup(true);
288 SaveToDB();
289 break;
291 if( instance->IsHeroic() && AttemptsLeft == 0 )
292 break;
293 switch( InstanceProgress )
294 {
296 events.RescheduleEvent(EVENT_SCENE_001, 0);
297 break;
299 events.RescheduleEvent(EVENT_SCENE_004, 0);
300 break;
302 events.RescheduleEvent(EVENT_SCENE_101, 0);
303 break;
305 events.RescheduleEvent(EVENT_SCENE_201, 0);
306 break;
308 events.RescheduleEvent(EVENT_SCENE_301, 0);
309 break;
311 events.RescheduleEvent(EVENT_SCENE_401, 0);
312 break;
313 }
314 break;
315 case TYPE_GORMOK:
316 if( data == DONE )
317 {
318 if (Creature* trigger = instance->SummonCreature(WORLD_TRIGGER, Locs[LOC_CENTER], nullptr, 25000))
319 {
320 trigger->SetDisplayId(11686);
321 trigger->ReplaceAllUnitFlags(UNIT_FLAG_NOT_SELECTABLE);
322 trigger->SetFaction(FACTION_MONSTER);
323 trigger->SetInCombatWithZone();
324 }
325
327
329 if ((northrendBeastsMask & 7) == 7)
331 else if ((northrendBeastsMask & 16) == 0)
332 events.RescheduleEvent(EVENT_SCENE_005, 2500);
333 }
334 break;
335 case TYPE_JORMUNGAR:
336 if( data == DONE )
337 {
338 if( ++Counter == 2 )
339 {
340 if (Creature* trigger = instance->SummonCreature(WORLD_TRIGGER, Locs[LOC_CENTER], nullptr, 25000))
341 {
342 trigger->SetDisplayId(11686);
343 trigger->ReplaceAllUnitFlags(UNIT_FLAG_NOT_SELECTABLE);
344 trigger->SetFaction(FACTION_MONSTER);
345 trigger->SetInCombatWithZone();
346 }
347
349 c->DespawnOrUnsummon(10000);
351 c->DespawnOrUnsummon(10000);
352 if( AchievementTimer + 10 >= GameTime::GetGameTime().count() )
355
357
359 if ((northrendBeastsMask & 7) == 7)
361 else if ((northrendBeastsMask & 32) == 0)
362 {
363 Counter = 0;
364 events.RescheduleEvent(EVENT_SCENE_006, 2500);
365 }
366 }
367 else // first one died, start timer for achievement
368 {
370 }
371 }
372 else
374 break;
375 case TYPE_ICEHOWL:
376 if( data == DONE )
377 {
379 if ((northrendBeastsMask & 7) == 7)
381 }
382 break;
384 if (data == DONE)
385 {
391 events.RescheduleEvent(EVENT_SCENE_BEASTS_DONE, 2500);
392 SaveToDB();
393 }
394 break;
395 case TYPE_JARAXXUS:
397 if( data == IN_PROGRESS )
399 else if( data == DONE )
400 {
403 events.RescheduleEvent(EVENT_SCENE_110, 2500);
404 SaveToDB();
405 }
406 break;
408 if( data == DONE )
409 {
410 if( ++Counter >= NPC_ChampionGUIDs.size() )
411 {
413 c->CastSpell(c, SPELL_FACTION_CHAMPIONS_KILL_CREDIT, true);
414 Counter = 0;
417 events.RescheduleEvent(EVENT_SCENE_FACTION_CHAMPIONS_DEAD, 2500);
418
419 for (ObjectGuid const& guid : NPC_ChampionGUIDs)
420 if (Creature* c = instance->GetCreature(guid))
421 c->DespawnOrUnsummon(15000);
422 NPC_ChampionGUIDs.clear();
423
425 {
426 uint32 cacheEntry = 0;
427 switch( instance->GetDifficulty() )
428 {
430 cacheEntry = GO_CRUSADERS_CACHE_10;
431 break;
433 cacheEntry = GO_CRUSADERS_CACHE_25;
434 break;
436 cacheEntry = GO_CRUSADERS_CACHE_10_H;
437 break;
439 cacheEntry = GO_CRUSADERS_CACHE_25_H;
440 break;
441 }
442
443 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))
444 {
445 go->SetLootRecipient(instance);
446 }
447 }
448
450
451 if( AchievementTimer + 60 >= GameTime::GetGameTime().count() )
454
455 SaveToDB();
456 }
457 else if( Counter == 1 )
459 }
460 break;
462 {
465 for (ObjectGuid const& guid : NPC_ChampionGUIDs)
466 if (Creature* c = instance->GetCreature(guid))
467 if (!c->IsInCombat())
468 if (Unit* target = c->SelectNearestTarget(200.0f))
469 c->AI()->AttackStart(target);
470 }
471 break;
473 if( urand(0, 2) == 0 )
474 {
476 {
478 pTemp->AI()->Talk(SAY_VARIAN_KILL_HORDE_PLAYER_1);
479 }
480 else if( Creature* pTemp = instance->GetCreature(NPC_GarroshGUID) )
481 pTemp->AI()->Talk(SAY_GARROSH_KILL_ALLIANCE_PLAYER_1);
482 }
483 break;
484 case TYPE_VALKYR:
485 if( data == DONE && ++Counter >= 2 )
486 {
487 Counter = 0;
492 events.RescheduleEvent(EVENT_SCENE_VALKYR_DEAD, 2500);
494 SaveToDB();
495 }
496 break;
497 case TYPE_ANUBARAK:
498 if( data == IN_PROGRESS )
499 {
502 }
503 else if( data == DONE )
504 {
505 Counter = 0;
510 SaveToDB();
511
513 {
514 c->UpdatePosition(Locs[LOC_TIRION_FINAL], true);
515 c->StopMovingOnCurrentPos();
516 c->SetFacingTo(Locs[LOC_TIRION_FINAL].GetOrientation());
517 events.RescheduleEvent(EVENT_SCENE_501, 20000);
518 }
520 floor->SetDestructibleState(GO_DESTRUCTIBLE_REBUILDING, nullptr, true);
521 }
522 break;
523 }
524 }
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:44
#define WORLD_TRIGGER
Definition: Unit.h:36
@ UNIT_FLAG_NOT_SELECTABLE
Definition: Unit.h:473
@ DONE
Definition: InstanceScript.h:59
@ GO_CRUSADERS_CACHE_10_H
Definition: trial_of_the_crusader.h:200
@ GO_CRUSADERS_CACHE_10
Definition: trial_of_the_crusader.h:198
@ GO_CRUSADERS_CACHE_25_H
Definition: trial_of_the_crusader.h:201
@ GO_CRUSADERS_CACHE_25
Definition: trial_of_the_crusader.h:199
@ LOC_TIRION_FINAL
Definition: trial_of_the_crusader.h:316
@ SAY_GARROSH_KILL_ALLIANCE_PLAYER_1
Definition: trial_of_the_crusader.h:251
@ SAY_VARIAN_KILL_HORDE_PLAYER_1
Definition: trial_of_the_crusader.h:242
@ SPELL_FACTION_CHAMPIONS_KILL_CREDIT
Definition: trial_of_the_crusader.h:350
@ SPELL_RESILIENCE_WILL_FIX_IT_CREDIT
Definition: trial_of_the_crusader.h:351
@ SPELL_JORMUNGAR_ACHIEV
Definition: trial_of_the_crusader.h:349
@ EVENT_SCENE_005
Definition: trial_of_the_crusader.h:74
@ EVENT_SCENE_501
Definition: trial_of_the_crusader.h:127
@ EVENT_SCENE_101
Definition: trial_of_the_crusader.h:84
@ EVENT_SCENE_201
Definition: trial_of_the_crusader.h:100
@ EVENT_SCENE_BEASTS_DONE
Definition: trial_of_the_crusader.h:81
@ EVENT_SCENE_VALKYR_DEAD
Definition: trial_of_the_crusader.h:114
@ EVENT_SCENE_401
Definition: trial_of_the_crusader.h:116
@ EVENT_SCENE_301
Definition: trial_of_the_crusader.h:109
@ EVENT_SCENE_001
Definition: trial_of_the_crusader.h:68
@ EVENT_NORTHREND_BEASTS_ENRAGE
Definition: trial_of_the_crusader.h:82
@ EVENT_SCENE_110
Definition: trial_of_the_crusader.h:95
@ EVENT_SCENE_004
Definition: trial_of_the_crusader.h:71
@ EVENT_SCENE_006
Definition: trial_of_the_crusader.h:78
@ EVENT_SCENE_FACTION_CHAMPIONS_DEAD
Definition: trial_of_the_crusader.h:107
@ TYPE_ANNOUNCER_GOSSIP_SELECT
Definition: trial_of_the_crusader.h:31
@ TYPE_ICEHOWL
Definition: trial_of_the_crusader.h:38
@ TYPE_JARAXXUS
Definition: trial_of_the_crusader.h:39
@ TYPE_NORTHREND_BEASTS_ALL
Definition: trial_of_the_crusader.h:46
@ TYPE_VALKYR
Definition: trial_of_the_crusader.h:42
@ TYPE_FAILED
Definition: trial_of_the_crusader.h:32
@ TYPE_FACTION_CHAMPIONS
Definition: trial_of_the_crusader.h:40
@ TYPE_FACTION_CHAMPIONS_PLAYER_DIED
Definition: trial_of_the_crusader.h:41
@ TYPE_FACTION_CHAMPIONS_START
Definition: trial_of_the_crusader.h:45
@ TYPE_JORMUNGAR
Definition: trial_of_the_crusader.h:35
@ RAID_DIFFICULTY_25MAN_HEROIC
Definition: DBCEnums.h:281
@ RAID_DIFFICULTY_10MAN_NORMAL
Definition: DBCEnums.h:278
@ RAID_DIFFICULTY_25MAN_NORMAL
Definition: DBCEnums.h:279
@ ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET
Definition: DBCEnums.h:148
@ ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE
Definition: DBCEnums.h:128
@ TEAM_HORDE
Definition: SharedDefines.h:733
@ FACTION_MONSTER
Definition: SharedDefines.h:167
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:2318
Definition: Unit.h:1290
void DoUpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1=0, uint32 miscValue2=0, Unit *unit=nullptr)
Definition: InstanceScript.cpp:453
TempSummon * SummonCreature(uint32 entry, Position const &pos, SummonPropertiesEntry const *properties=nullptr, uint32 duration=0, WorldObject *summoner=nullptr, uint32 spellId=0, uint32 vehId=0)
Definition: Object.cpp:2118
Difficulty GetDifficulty() const
Definition: Map.h:442
void SetData(uint32 type, uint32 data) override
Definition: instance_trial_of_the_crusader.cpp:272

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
77 {
79 {
81 {
82 barrett->SetVisible(false);
83 if (AttemptsLeft)
85 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);
86 }
87
88 // move corpses
90 for (ObjectGuid const& i : npcs)
91 {
92 if (Creature* c = instance->GetCreature(i))
93 {
94 if (c->GetGUID() == NPC_IcehowlGUID)
95 c->UpdatePosition(626.57f, 162.8f, 140.25f, 4.44f, true);
96 else if (c->GetGUID() == NPC_JaraxxusGUID)
97 c->UpdatePosition(603.92f, 102.61f, 141.85f, 1.4f, true);
98 else if (c->GetGUID() == NPC_LightbaneGUID)
99 c->UpdatePosition(634.58f, 147.16f, 140.5f, 3.02f, true);
100 else if (c->GetGUID() == NPC_DarkbaneGUID)
101 c->UpdatePosition(630.88f, 131.39f, 140.8f, 3.02f, true);
102
103 c->StopMovingOnCurrentPos();
104 c->DestroyForNearbyPlayers();
105 }
106 }
107 }
108 }
@ LOC_ANUB
Definition: trial_of_the_crusader.h:315
npcs
Definition: halls_of_stone.h:56
Creature * GetCreature(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:215

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.

558 {
559 events.Update(diff);
560 switch( events.ExecuteEvent() )
561 {
562 case 0:
563 break;
565 {
566 if (bSwitcher) // used to double the check interval
569
570 if (DoNeedCleanup())
571 {
573 }
574 events.RepeatEvent(CLEANUP_CHECK_INTERVAL);
575 }
576 break;
577 case EVENT_OPEN_GATE:
578 {
580 break;
581 }
582 case EVENT_CLOSE_GATE:
583 {
585 }
586 break;
587 case EVENT_SCENE_001:
588 {
590 c->AI()->Talk(SAY_STAGE_0_01);
591
592 events.RescheduleEvent(EVENT_SCENE_002, 22000);
593 }
594 break;
595 case EVENT_SCENE_002:
596 {
598 c->AI()->Talk(SAY_STAGE_0_03a);
599
600 events.RescheduleEvent(EVENT_SCENE_003, 5000);
601 }
602 break;
603 case EVENT_SCENE_003:
604 {
606 c->AI()->Talk(SAY_STAGE_0_03h);
607
608 events.RescheduleEvent(EVENT_SCENE_004, 8000);
609 }
610 break;
611 case EVENT_SCENE_004:
612 {
615
617 c->AI()->Talk(SAY_STAGE_0_02);
620
621 events.RescheduleEvent(EVENT_SUMMON_GORMOK, 1000);
622 if (instance->IsHeroic())
623 {
624 events.RescheduleEvent(EVENT_SCENE_005, 150000);
625 events.RescheduleEvent(EVENT_SCENE_006, 340000);
626 events.RescheduleEvent(EVENT_NORTHREND_BEASTS_ENRAGE, 520000);
627 }
628 }
629 break;
632 if (c->IsAlive())
633 c->CastSpell(c, 26662, true);
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);
643
644 break;
646 {
649 gormok->GetMotionMaster()->MovePoint(0, Locs[LOC_GATE_FRONT].GetPositionX(), Locs[LOC_GATE_FRONT].GetPositionY(), Locs[LOC_GATE_FRONT].GetPositionZ());
650
651 events.RescheduleEvent(EVENT_GORMOK_ATTACK, 10000);
652 events.RescheduleEvent(EVENT_CLOSE_GATE, 6000);
653 }
654 break;
656 {
659 {
660 c->SetReactState(REACT_AGGRESSIVE);
661 c->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
662 c->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
663 if( Unit* target = c->SelectNearestTarget(200.0f) )
664 {
665 c->AI()->AttackStart(target);
666 c->AI()->DoZoneInCombat();
667 }
668 }
669 break;
670 }
671 case EVENT_SCENE_005:
672 {
675 c->AI()->Talk(SAY_STAGE_0_04);
676
677 events.RescheduleEvent(EVENT_OPEN_GATE, 3000);
678 events.RescheduleEvent(EVENT_SUMMON_ACIDMAW_AND_DREADSCALE, 4000);
679 break;
680 }
682 {
684 {
686 dreadscale->GetMotionMaster()->MovePoint(0, Locs[LOC_BEHIND_GATE].GetPositionX(), Locs[LOC_BEHIND_GATE].GetPositionY() - 25.0f, Locs[LOC_BEHIND_GATE].GetPositionZ());
688 acidmaw->AddAura(53421, acidmaw);
689 }
690
691 events.RescheduleEvent(EVENT_SCENE_005_2, 4000);
692 break;
693 }
694
696 {
697 if( Creature* dreadscale = instance->GetCreature(NPC_DreadscaleGUID) )
698 dreadscale->GetMotionMaster()->MovePoint(0, Locs[LOC_DREADSCALE].GetPositionX(), Locs[LOC_DREADSCALE].GetPositionY(), Locs[LOC_DREADSCALE].GetPositionZ());
699
700 events.RescheduleEvent(EVENT_ACIDMAW_AND_DREADSCALE_ATTACK, 7000);
701 break;
702 }
704 {
707 {
708 c->SetReactState(REACT_AGGRESSIVE);
709 c->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
710 c->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
711 if( Unit* target = c->SelectNearestTarget(200.0f) )
712 {
713 c->AI()->AttackStart(target);
714 c->AI()->DoZoneInCombat();
715 }
716 }
718 {
719 c->SetReactState(REACT_AGGRESSIVE);
720 c->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
721 c->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
722 if( Unit* target = c->SelectNearestTarget(200.0f) )
723 {
724 c->RemoveAura(53421);
725 c->CastSpell(c, 66947, false);
726 c->AI()->AttackStart(target);
727 c->AI()->DoZoneInCombat();
728 }
729 }
730 break;
731 }
732 case EVENT_SCENE_006:
733 {
736 c->AI()->Talk(SAY_STAGE_0_05);
737
738 events.RescheduleEvent(EVENT_OPEN_GATE, 2000);
739 events.RescheduleEvent(EVENT_SUMMON_ICEHOWL, 3000);
740 break;
741 }
743 {
746 icehowl->GetMotionMaster()->MovePoint(0, Locs[LOC_GATE_FRONT].GetPositionX(), Locs[LOC_GATE_FRONT].GetPositionY(), Locs[LOC_GATE_FRONT].GetPositionZ());
747
748 events.RescheduleEvent(EVENT_ICEHOWL_ATTACK, 10000);
749 events.RescheduleEvent(EVENT_CLOSE_GATE, 6000);
750 break;
751 }
753 {
755 {
756 c->SetReactState(REACT_AGGRESSIVE);
757 c->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
758 c->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
759 if( Unit* target = c->SelectNearestTarget(200.0f) )
760 {
761 c->AI()->AttackStart(target);
762 c->AI()->DoZoneInCombat();
763 }
764 }
765 break;
766 }
768 {
770 c->AI()->Talk(SAY_STAGE_0_06);
772 c->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
773 break;
774 }
775 case EVENT_SCENE_101:
776 {
778 {
780 c->AI()->Talk(SAY_STAGE_1_01);
782 {
783 fizzlebang->AddUnitMovementFlag(MOVEMENTFLAG_WALKING);
784 fizzlebang->GetMotionMaster()->MovePoint(0, Locs[LOC_BEHIND_GATE].GetPositionX(), Locs[LOC_BEHIND_GATE].GetPositionY() - 65.0f, Locs[LOC_BEHIND_GATE].GetPositionZ() - 1.0f);
785 }
786 events.RescheduleEvent(EVENT_SCENE_102, 20000);
787
788 // move Icehowl to side, can't remove corpse because of loot!
790 {
791 icehowl->UpdatePosition(513.19f, 139.48f, 395.22f, 3 * M_PI / 2, true);
792 icehowl->StopMovingOnCurrentPos();
793 icehowl->DestroyForNearbyPlayers();
794 }
795 }
796 break;
797 }
798 case EVENT_SCENE_102:
799 {
802 c->AI()->Talk(SAY_STAGE_1_02);
803
804 events.RescheduleEvent(EVENT_SCENE_103, 11000);
805 break;
806 }
807 case EVENT_SCENE_103:
808 {
810 {
811 c->AI()->Talk(SAY_STAGE_1_03);
812 c->HandleEmoteCommand(EMOTE_STATE_SPELL_PRECAST);
814 NPC_PurpleGroundGUID = trigger->GetGUID();
815 }
816
817 events.RescheduleEvent(EVENT_SCENE_104, 5000);
818 break;
819 }
820 case EVENT_SCENE_104:
821 {
823 {
825 {
826 NPC_PortalGUID = portal->GetGUID();
827 portal->SetObjectScale(3.0f);
828 portal->SetReactState(REACT_PASSIVE);
829 portal->CastSpell(portal, SPELL_WILFRED_PORTAL, true);
830 }
831 c->HandleEmoteCommand(EMOTE_STATE_SPELL_PRECAST);
832 }
833
834 events.RescheduleEvent(EVENT_SUMMON_JARAXXUS, 5000);
835 break;
836 }
838 {
840 {
842 jaraxxus->GetMotionMaster()->MovePoint(0, Locs[LOC_CENTER].GetPositionX(), Locs[LOC_CENTER].GetPositionY() - 10.0f, Locs[LOC_CENTER].GetPositionZ());
843 c->HandleEmoteCommand(EMOTE_STATE_NONE);
844 c->AI()->Talk(SAY_STAGE_1_04);
845 }
846
847 events.RescheduleEvent(EVENT_SCENE_105, 3000);
848 break;
849 }
850 case EVENT_SCENE_105:
851 {
853 c->SetFacingTo(M_PI / 2);
855 c->DespawnOrUnsummon();
858 c->DespawnOrUnsummon();
860
861 events.RescheduleEvent(EVENT_SCENE_106, 10000);
862 break;
863 }
864 case EVENT_SCENE_106:
865 {
867 c->AI()->Talk(SAY_STAGE_1_05);
868
869 events.RescheduleEvent(EVENT_SCENE_107, 5000);
870 break;
871 }
872 case EVENT_SCENE_107:
873 {
875 c->AI()->Talk(SAY_STAGE_1_06);
876
877 events.RescheduleEvent(EVENT_SCENE_108, 800);
878 break;
879 }
880 case EVENT_SCENE_108:
881 {
883 {
884 c->Yell("Banished to the Nether!", LANG_UNIVERSAL);
885 c->PlayDirectSound(16146, 0);
887 {
888 c->CastSpell(f, 67888, true);
889 Unit::Kill(f, f);
890 }
891 }
892
893 events.RescheduleEvent(EVENT_SCENE_109, 5000);
894 break;
895 }
896 case EVENT_SCENE_109:
897 {
899 c->SetFacingTo(3 * M_PI / 2);
901 c->AI()->Talk(SAY_STAGE_1_07);
902
903 events.RescheduleEvent(EVENT_JARAXXUS_ATTACK, 6000);
904 break;
905 }
907 {
910 {
911 c->SetReactState(REACT_AGGRESSIVE);
912 c->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
913 c->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
914 if( Unit* target = c->SelectNearestTarget(200.0f) )
915 {
916 c->AI()->AttackStart(target);
917 c->AI()->DoZoneInCombat();
918 }
919 }
920 break;
921 }
922 case EVENT_SCENE_110:
923 {
925 c->AI()->Talk(SAY_STAGE_1_08);
926
927 events.RescheduleEvent(EVENT_SCENE_111, 18000);
928 break;
929 }
930 case EVENT_SCENE_111:
931 {
933 c->AI()->Talk(SAY_STAGE_1_09);
934
935 events.RescheduleEvent(EVENT_SCENE_112, 9000);
936 break;
937 }
938 case EVENT_SCENE_112:
939 {
941 c->AI()->Talk(SAY_STAGE_1_10);
942
943 events.RescheduleEvent(EVENT_SCENE_113, 5000);
944 break;
945 }
946 case EVENT_SCENE_113:
947 {
949 c->AI()->Talk(SAY_STAGE_1_11);
951 c->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
952 break;
953 }
954 case EVENT_SCENE_201:
955 {
956 // move Jaraxxus to side, can't remove corpse because of loot!
958 {
959 jaraxxus->UpdatePosition(613.83f, 139.5f, 395.22f, 3 * M_PI / 2, true);
960 jaraxxus->StopMovingOnCurrentPos();
961 jaraxxus->DestroyForNearbyPlayers();
962 }
963
965 c->AI()->Talk(SAY_STAGE_2_01);
966
967 events.RescheduleEvent(EVENT_SCENE_202, 9000);
968 break;
969 }
970 case EVENT_SCENE_202:
971 {
972 Map::PlayerList const& pl = instance->GetPlayers();
973 for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
974 if( Player* plr = itr->GetSource() )
975 if( !plr->IsGameMaster() )
976 {
977 TeamIdInInstance = plr->GetTeamId();
978 break;
979 }
980
982 {
984 c->AI()->Talk(SAY_STAGE_2_02h);
985 events.RescheduleEvent(EVENT_SCENE_203, 15000);
986 }
987 else
988 {
990 c->AI()->Talk(SAY_STAGE_2_02a);
991 events.RescheduleEvent(EVENT_SCENE_203, 18000);
992 }
993 break;
994 }
995 case EVENT_SCENE_203:
996 {
998 c->AI()->Talk(SAY_STAGE_2_03);
999
1000 events.RescheduleEvent(EVENT_SCENE_204, 5000);
1001 break;
1002 }
1003 case EVENT_SCENE_204:
1004 {
1006 {
1008 c->AI()->Talk(SAY_STAGE_2_04h);
1009 events.RescheduleEvent(EVENT_SCENE_205, 6000);
1010 }
1011 else
1012 {
1014 c->AI()->Talk(SAY_STAGE_2_04a);
1015 events.RescheduleEvent(EVENT_SCENE_205, 5000);
1016 }
1017
1018 events.RescheduleEvent(EVENT_SUMMON_CHAMPIONS, 2500);
1019 break;
1020 }
1021 case EVENT_SCENE_205:
1022 {
1025
1026 break;
1027 }
1029 {
1030 std::vector<uint32> vHealerEntries;
1035
1036 std::vector<uint32> vOtherEntries;
1039 vOtherEntries.push_back(TeamIdInInstance == TEAM_ALLIANCE ? NPC_HORDE_MAGE : NPC_ALLIANCE_MAGE);
1040 vOtherEntries.push_back(TeamIdInInstance == TEAM_ALLIANCE ? NPC_HORDE_ROGUE : NPC_ALLIANCE_ROGUE);
1043
1044 uint8 healersSubtracted = 2;
1046 healersSubtracted = 1;
1047 for( uint8 i = 0; i < healersSubtracted; ++i )
1048 {
1049 uint8 pos = urand(0, vHealerEntries.size() - 1);
1050 switch( vHealerEntries[pos] )
1051 {
1053 vOtherEntries.push_back(NPC_ALLIANCE_DRUID_BALANCE);
1054 break;
1056 vOtherEntries.push_back(NPC_HORDE_DRUID_BALANCE);
1057 break;
1059 vOtherEntries.push_back(NPC_ALLIANCE_PALADIN_RETRIBUTION);
1060 break;
1062 vOtherEntries.push_back(NPC_HORDE_PALADIN_RETRIBUTION);
1063 break;
1065 vOtherEntries.push_back(NPC_ALLIANCE_PRIEST_SHADOW);
1066 break;
1068 vOtherEntries.push_back(NPC_HORDE_PRIEST_SHADOW);
1069 break;
1071 vOtherEntries.push_back(NPC_ALLIANCE_SHAMAN_ENHANCEMENT);
1072 break;
1074 vOtherEntries.push_back(NPC_HORDE_SHAMAN_ENHANCEMENT);
1075 break;
1076 }
1077 vHealerEntries.erase(vHealerEntries.begin() + pos);
1078 }
1079
1081 for( uint8 i = 0; i < 4; ++i )
1082 vOtherEntries.erase(vOtherEntries.begin() + urand(0, vOtherEntries.size() - 1));
1083
1084 for( std::vector<uint32>::iterator itr = vHealerEntries.begin(); itr != vHealerEntries.end(); ++itr )
1085 vOtherEntries.push_back(*itr);
1086
1087 uint8 pos2 = 10;
1088 for( std::vector<uint32>::iterator itr = vOtherEntries.begin(); itr != vOtherEntries.end(); ++itr )
1089 {
1090 if( Creature* pTemp = instance->SummonCreature(*itr, FactionChampionLoc[urand(0, 4) + (TeamIdInInstance == TEAM_ALLIANCE ? 0 : 5)]) )
1091 {
1092 NPC_ChampionGUIDs.push_back(pTemp->GetGUID());
1093 pTemp->SetHomePosition((TeamIdInInstance == TEAM_ALLIANCE ? FactionChampionLoc[pos2].GetPositionX() : (Locs[LOC_CENTER].GetPositionX() * 2 - FactionChampionLoc[pos2].GetPositionX())), FactionChampionLoc[pos2].GetPositionY(), FactionChampionLoc[pos2].GetPositionZ(), 0.0f);
1094 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);
1095 }
1096 ++pos2;
1097 }
1098
1100 events.RescheduleEvent(EVENT_CHAMPIONS_ATTACK, 4000);
1101 break;
1102 }
1104 {
1105 for (ObjectGuid const& guid : NPC_ChampionGUIDs)
1106 if (Creature* c = instance->GetCreature(guid))
1107 {
1108 c->SetReactState(REACT_AGGRESSIVE);
1109 c->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
1110 c->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
1111 //if( Unit* target = c->SelectNearestTarget(200.0f) )
1112 // c->AI()->AttackStart(target);
1113 }
1114 Map::PlayerList const& pl = instance->GetPlayers();
1115 for (Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr)
1116 itr->GetSource()->AddToNotify(NOTIFY_AI_RELOCATION);
1118 break;
1119 }
1121 {
1123 c->AI()->Talk(SAY_STAGE_2_06);
1125 c->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
1126 break;
1127 }
1128 case EVENT_SCENE_301:
1129 {
1131 c->AI()->Talk(SAY_STAGE_3_01);
1132
1133 events.RescheduleEvent(EVENT_SCENE_302, 13000);
1134 break;
1135 }
1136 case EVENT_SCENE_302:
1137 {
1139 c->AI()->Talk(SAY_STAGE_3_02);
1140
1141 events.RescheduleEvent(EVENT_SCENE_303, 3000);
1142 break;
1143 }
1144 case EVENT_SCENE_303:
1145 {
1148 {
1151 t->GetMotionMaster()->MovePoint(0, Locs[LOC_VALKYR_DEST_RIGHT].GetPositionX(), Locs[LOC_VALKYR_DEST_RIGHT].GetPositionY(), Locs[LOC_VALKYR_DEST_RIGHT].GetPositionZ());
1153 t->GetMotionMaster()->MovePoint(0, Locs[LOC_VALKYR_DEST_LEFT].GetPositionX(), Locs[LOC_VALKYR_DEST_LEFT].GetPositionY(), Locs[LOC_VALKYR_DEST_LEFT].GetPositionZ());
1154 }
1155
1156 events.RescheduleEvent(EVENT_SCENE_304, 6250);
1157 break;
1158 }
1159 case EVENT_SCENE_304:
1160 {
1164 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());
1166 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());
1167
1168 events.RescheduleEvent(EVENT_VALKYRIES_ATTACK, 3250);
1169 break;
1170 }
1172 {
1174 {
1175 c->SetReactState(REACT_AGGRESSIVE);
1176 c->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
1177 /*if( Unit* target = c->SelectNearestTarget(200.0f) )
1178 {
1179 c->AI()->AttackStart(target);
1180 c->AI()->DoZoneInCombat();
1181 }*/
1182 }
1184 {
1185 c->SetReactState(REACT_AGGRESSIVE);
1186 c->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
1187 /*if( Unit* target = c->SelectNearestTarget(200.0f) )
1188 {
1189 c->AI()->AttackStart(target);
1190 c->AI()->DoZoneInCombat();
1191 }*/
1192 }
1193 break;
1194 }
1196 {
1198 {
1199 Map::PlayerList const& pl = instance->GetPlayers();
1200 for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
1201 if( Player* plr = itr->GetSource() )
1202 if( !plr->IsGameMaster() )
1203 {
1204 TeamIdInInstance = plr->GetTeamId();
1205 break;
1206 }
1207 }
1210
1211 events.RescheduleEvent(EVENT_SCENE_401, 60000);
1212 break;
1213 }
1214 case EVENT_SCENE_401:
1215 {
1217 c->AI()->Talk(SAY_STAGE_4_01);
1218
1219 events.RescheduleEvent(EVENT_SCENE_402, 20000);
1220 break;
1221 }
1222 case EVENT_SCENE_402:
1223 {
1228 {
1229 t->SetReactState(REACT_PASSIVE);
1230 t->AddUnitMovementFlag(MOVEMENTFLAG_WALKING);
1231 t->SetDisplayId(11686);
1232 t->AI()->Talk(SAY_STAGE_4_02);
1233 t->SetVisible(false);
1234 }
1235
1236 events.RescheduleEvent(EVENT_SCENE_403, 2000);
1237 break;
1238 }
1239 case EVENT_SCENE_403:
1240 {
1243 {
1244 t->SetReactState(REACT_PASSIVE);
1245 t->CastSpell(t, 51807, true);
1246 }
1247
1248 events.RescheduleEvent(EVENT_SCENE_404, 2000);
1249 break;
1250 }
1251 case EVENT_SCENE_404:
1252 {
1254 {
1255 c->SetDisplayId(c->GetNativeDisplayId());
1256 c->SetVisible(true);
1257 c->GetMotionMaster()->MovePoint(0, Locs[LOC_ARTHAS]);
1258 }
1259
1260 events.RescheduleEvent(EVENT_SCENE_405, 3000);
1261 break;
1262 }
1263 case EVENT_SCENE_405:
1264 {
1266 c->AI()->Talk(SAY_STAGE_4_03);
1267
1268 events.RescheduleEvent(EVENT_SCENE_406, 7000);
1269 break;
1270 }
1271 case EVENT_SCENE_406:
1272 {
1274 {
1275 c->AI()->Talk(SAY_STAGE_4_04);
1276 c->HandleEmoteCommand(EMOTE_ONESHOT_LAUGH);
1277 }
1278
1279 events.RescheduleEvent(EVENT_SCENE_406_2, 2500);
1280 events.RescheduleEvent(EVENT_SCENE_407, 12000);
1281 break;
1282 }
1283 case EVENT_SCENE_406_2:
1284 {
1286 {
1287 c->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_TALK);
1288 }
1289
1290 break;
1291 }
1292
1293 case EVENT_SCENE_407:
1294 {
1296 c->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION);
1297
1298 events.RescheduleEvent(EVENT_SCENE_408, 4000);
1299 break;
1300 }
1301 case EVENT_SCENE_408:
1302 {
1304 {
1305 c->HandleEmoteCommand(EMOTE_ONESHOT_KNEEL);
1306 }
1307
1308 events.RescheduleEvent(EVENT_SCENE_409, 1500);
1309 break;
1310 }
1311 case EVENT_SCENE_409:
1312 {
1314 {
1316 floor->SetDestructibleState(GO_DESTRUCTIBLE_DAMAGED);//floor->ModifyHealth(-10000000, c);
1317 c->CastSpell((Unit*)nullptr, 68193, true);
1318 c->SetVisible(false);
1319 c->SetDisplayId(11686);
1320 if( Creature* t = c->FindNearestCreature(NPC_WORLD_TRIGGER, 500.0f, true) )
1321 t->DespawnOrUnsummon();
1322
1324 SpawnAnubArak();
1325 }
1326
1327 events.RescheduleEvent(EVENT_SCENE_410, 2000);
1328 break;
1329 }
1330 case EVENT_SCENE_410:
1331 {
1333 {
1334 c->SetVisible(true);
1335 c->AI()->Talk(SAY_STAGE_4_05);
1336 c->DespawnOrUnsummon(0);
1337 }
1338
1339 break;
1340 }
1341 case EVENT_SCENE_501:
1342 {
1344 {
1345 c->AI()->Talk(SAY_STAGE_4_06);
1346 c->SummonCreature(NPC_ARGENT_MAGE, Locs[LOC_MAGE].GetPositionX(), Locs[LOC_MAGE].GetPositionY(), Locs[LOC_MAGE].GetPositionZ(), Locs[LOC_MAGE].GetOrientation());
1347 c->SummonGameObject(195682, 668.15f, 134.57f, 142.12f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 630000000);
1348 }
1349
1350 events.RescheduleEvent(EVENT_SCENE_502, 20000);
1351 break;
1352 }
1353 case EVENT_SCENE_502:
1354 {
1355 if( instance->IsHeroic() )
1356 {
1357 uint32 tributeChest = 0;
1359 {
1360 if (AttemptsLeft >= 50)
1361 tributeChest = GO_TRIBUTE_CHEST_10H_99;
1362 else if (AttemptsLeft >= 45)
1363 tributeChest = GO_TRIBUTE_CHEST_10H_50;
1364 else if (AttemptsLeft >= 25)
1365 tributeChest = GO_TRIBUTE_CHEST_10H_45;
1366 else
1367 tributeChest = GO_TRIBUTE_CHEST_10H_25;
1368 }
1370 {
1371 if (AttemptsLeft >= 50)
1372 tributeChest = GO_TRIBUTE_CHEST_25H_99;
1373 else if (AttemptsLeft >= 45)
1374 tributeChest = GO_TRIBUTE_CHEST_25H_50;
1375 else if (AttemptsLeft >= 25)
1376 tributeChest = GO_TRIBUTE_CHEST_25H_45;
1377 else
1378 tributeChest = GO_TRIBUTE_CHEST_25H_25;
1379 }
1380 if (tributeChest)
1382 {
1383 c->AI()->Talk(SAY_STAGE_4_07);
1384 if (GameObject* chest = c->SummonGameObject(tributeChest, 665.12f, 143.78f, 142.12f, 0.0f, 0, 0, 0, 0, 90000000))
1385 {
1386 chest->SetRespawnTime(chest->GetRespawnDelay());
1387 chest->SetLootRecipient(instance);
1388 }
1389 }
1390 }
1391 break;
1392 }
1393 }
1394 }
@ TEMPSUMMON_MANUAL_DESPAWN
Definition: Object.h:49
@ TEMPSUMMON_TIMED_DESPAWN
Definition: Object.h:44
@ NOTIFY_AI_RELOCATION
Definition: Object.h:63
@ UNIT_NPC_EMOTESTATE
Definition: UpdateFields.h:140
@ REACT_PASSIVE
Definition: Unit.h:1023
@ EVENT_CLOSE_GATE
Definition: trial_of_the_champion.h:67
@ GO_TRIBUTE_CHEST_10H_99
Definition: trial_of_the_crusader.h:207
@ GO_TRIBUTE_CHEST_25H_25
Definition: trial_of_the_crusader.h:208
@ GO_TRIBUTE_CHEST_25H_99
Definition: trial_of_the_crusader.h:211
@ GO_TRIBUTE_CHEST_25H_45
Definition: trial_of_the_crusader.h:209
@ GO_TRIBUTE_CHEST_10H_45
Definition: trial_of_the_crusader.h:205
@ GO_TRIBUTE_CHEST_25H_50
Definition: trial_of_the_crusader.h:210
@ GO_TRIBUTE_CHEST_10H_25
Definition: trial_of_the_crusader.h:204
@ GO_TRIBUTE_CHEST_10H_50
Definition: trial_of_the_crusader.h:206
@ LOC_VALKYR_DEST_2_LEFT
Definition: trial_of_the_crusader.h:308
@ LOC_VALKYR_RIGHT
Definition: trial_of_the_crusader.h:303
@ LOC_BEHIND_GATE
Definition: trial_of_the_crusader.h:298
@ LOC_VALKYR_LEFT
Definition: trial_of_the_crusader.h:304
@ LOC_GATE_FRONT
Definition: trial_of_the_crusader.h:299
@ LOC_DREADSCALE
Definition: trial_of_the_crusader.h:300
@ LOC_MAGE
Definition: trial_of_the_crusader.h:317
@ LOC_ARTHAS_PORTAL
Definition: trial_of_the_crusader.h:309
@ LOC_ARTHAS
Definition: trial_of_the_crusader.h:310
@ LOC_VALKYR_DEST_LEFT
Definition: trial_of_the_crusader.h:306
@ LOC_ACIDMAW
Definition: trial_of_the_crusader.h:301
@ LOC_VALKYR_DEST_2_RIGHT
Definition: trial_of_the_crusader.h:307
@ LOC_VALKYR_DEST_RIGHT
Definition: trial_of_the_crusader.h:305
@ NPC_ALLIANCE_SHAMAN_RESTORATION
Definition: trial_of_the_crusader.h:164
@ NPC_ALLIANCE_MAGE
Definition: trial_of_the_crusader.h:157
@ NPC_ALLIANCE_PALADIN_HOLY
Definition: trial_of_the_crusader.h:158
@ NPC_HORDE_SHAMAN_RESTORATION
Definition: trial_of_the_crusader.h:179
@ NPC_ALLIANCE_DRUID_RESTORATION
Definition: trial_of_the_crusader.h:155
@ NPC_ALLIANCE_DRUID_BALANCE
Definition: trial_of_the_crusader.h:154
@ NPC_ALLIANCE_HUNTER
Definition: trial_of_the_crusader.h:156
@ NPC_HORDE_ROGUE
Definition: trial_of_the_crusader.h:177
@ NPC_HORDE_HUNTER
Definition: trial_of_the_crusader.h:171
@ NPC_PURPLE_GROUND
Definition: trial_of_the_crusader.h:150
@ NPC_ARGENT_MAGE
Definition: trial_of_the_crusader.h:139
@ NPC_HORDE_PRIEST_SHADOW
Definition: trial_of_the_crusader.h:176
@ NPC_HORDE_WARLOCK
Definition: trial_of_the_crusader.h:180
@ NPC_ALLIANCE_ROGUE
Definition: trial_of_the_crusader.h:162
@ NPC_HORDE_PALADIN_RETRIBUTION
Definition: trial_of_the_crusader.h:174
@ NPC_ALLIANCE_WARRIOR
Definition: trial_of_the_crusader.h:166
@ NPC_HORDE_DRUID_RESTORATION
Definition: trial_of_the_crusader.h:170
@ NPC_HORDE_DEATH_KNIGHT
Definition: trial_of_the_crusader.h:168
@ NPC_ALLIANCE_PALADIN_RETRIBUTION
Definition: trial_of_the_crusader.h:159
@ NPC_HORDE_DRUID_BALANCE
Definition: trial_of_the_crusader.h:169
@ NPC_HORDE_WARRIOR
Definition: trial_of_the_crusader.h:181
@ NPC_HORDE_MAGE
Definition: trial_of_the_crusader.h:172
@ NPC_HORDE_SHAMAN_ENHANCEMENT
Definition: trial_of_the_crusader.h:178
@ NPC_ALLIANCE_PRIEST_DISCIPLINE
Definition: trial_of_the_crusader.h:160
@ NPC_HORDE_PRIEST_DISCIPLINE
Definition: trial_of_the_crusader.h:175
@ NPC_ALLIANCE_DEATH_KNIGHT
Definition: trial_of_the_crusader.h:153
@ NPC_ALLIANCE_SHAMAN_ENHANCEMENT
Definition: trial_of_the_crusader.h:163
@ NPC_ALLIANCE_WARLOCK
Definition: trial_of_the_crusader.h:165
@ NPC_HORDE_PALADIN_HOLY
Definition: trial_of_the_crusader.h:173
@ NPC_ALLIANCE_PRIEST_SHADOW
Definition: trial_of_the_crusader.h:161
@ SAY_STAGE_4_07
Definition: trial_of_the_crusader.h:269
@ SAY_STAGE_1_03
Definition: trial_of_the_crusader.h:255
@ SAY_STAGE_1_08
Definition: trial_of_the_crusader.h:225
@ SAY_STAGE_0_06
Definition: trial_of_the_crusader.h:221
@ SAY_STAGE_2_02h
Definition: trial_of_the_crusader.h:247
@ SAY_STAGE_0_02
Definition: trial_of_the_crusader.h:218
@ SAY_STAGE_0_01
Definition: trial_of_the_crusader.h:217
@ SAY_STAGE_4_01
Definition: trial_of_the_crusader.h:232
@ SAY_STAGE_1_10
Definition: trial_of_the_crusader.h:237
@ SAY_STAGE_4_02
Definition: trial_of_the_crusader.h:263
@ SAY_STAGE_4_06
Definition: trial_of_the_crusader.h:268
@ SAY_STAGE_4_04
Definition: trial_of_the_crusader.h:265
@ SAY_STAGE_0_03a
Definition: trial_of_the_crusader.h:236
@ SAY_STAGE_4_05
Definition: trial_of_the_crusader.h:264
@ SAY_STAGE_4_03
Definition: trial_of_the_crusader.h:233
@ SAY_STAGE_0_03h
Definition: trial_of_the_crusader.h:245
@ SAY_STAGE_1_07
Definition: trial_of_the_crusader.h:224
@ SAY_STAGE_1_11
Definition: trial_of_the_crusader.h:226
@ SAY_STAGE_2_04a
Definition: trial_of_the_crusader.h:239
@ SAY_STAGE_2_02a
Definition: trial_of_the_crusader.h:238
@ SAY_STAGE_1_05
Definition: trial_of_the_crusader.h:260
@ SAY_STAGE_1_01
Definition: trial_of_the_crusader.h:223
@ SAY_STAGE_2_01
Definition: trial_of_the_crusader.h:227
@ SAY_STAGE_0_05
Definition: trial_of_the_crusader.h:220
@ SAY_STAGE_3_03a
Definition: trial_of_the_crusader.h:241
@ SAY_STAGE_1_06
Definition: trial_of_the_crusader.h:257
@ SAY_STAGE_1_04
Definition: trial_of_the_crusader.h:256
@ SAY_STAGE_0_04
Definition: trial_of_the_crusader.h:219
@ SAY_STAGE_1_02
Definition: trial_of_the_crusader.h:254
@ SAY_STAGE_3_01
Definition: trial_of_the_crusader.h:230
@ SAY_STAGE_2_06
Definition: trial_of_the_crusader.h:229
@ SAY_STAGE_2_05h
Definition: trial_of_the_crusader.h:249
@ SAY_STAGE_3_03h
Definition: trial_of_the_crusader.h:250
@ SAY_STAGE_3_02
Definition: trial_of_the_crusader.h:231
@ SAY_STAGE_2_04h
Definition: trial_of_the_crusader.h:248
@ SAY_STAGE_2_05a
Definition: trial_of_the_crusader.h:240
@ SAY_STAGE_1_09
Definition: trial_of_the_crusader.h:246
@ SAY_STAGE_2_03
Definition: trial_of_the_crusader.h:228
@ SPELL_WILFRED_PORTAL
Definition: trial_of_the_crusader.h:348
const Position FactionChampionLoc[]
Definition: trial_of_the_crusader.h:320
@ EVENT_SUMMON_CHAMPIONS
Definition: trial_of_the_crusader.h:105
@ EVENT_SCENE_409
Definition: trial_of_the_crusader.h:125
@ EVENT_SCENE_404
Definition: trial_of_the_crusader.h:119
@ EVENT_SCENE_402
Definition: trial_of_the_crusader.h:117
@ EVENT_SCENE_002
Definition: trial_of_the_crusader.h:69
@ EVENT_SCENE_410
Definition: trial_of_the_crusader.h:126
@ EVENT_SCENE_104
Definition: trial_of_the_crusader.h:87
@ EVENT_SCENE_406_2
Definition: trial_of_the_crusader.h:122
@ EVENT_SCENE_407
Definition: trial_of_the_crusader.h:123
@ EVENT_CHAMPIONS_ATTACK
Definition: trial_of_the_crusader.h:106
@ EVENT_ACIDMAW_AND_DREADSCALE_ATTACK
Definition: trial_of_the_crusader.h:77
@ EVENT_GORMOK_ATTACK
Definition: trial_of_the_crusader.h:73
@ EVENT_SCENE_113
Definition: trial_of_the_crusader.h:98
@ EVENT_SUMMON_ICEHOWL
Definition: trial_of_the_crusader.h:79
@ EVENT_SCENE_204
Definition: trial_of_the_crusader.h:103
@ EVENT_SCENE_005_2
Definition: trial_of_the_crusader.h:75
@ EVENT_SCENE_502
Definition: trial_of_the_crusader.h:128
@ EVENT_SCENE_103
Definition: trial_of_the_crusader.h:86
@ EVENT_SCENE_202
Definition: trial_of_the_crusader.h:101
@ EVENT_SCENE_405
Definition: trial_of_the_crusader.h:120
@ EVENT_SCENE_106
Definition: trial_of_the_crusader.h:90
@ EVENT_OPEN_GATE
Definition: trial_of_the_crusader.h:65
@ EVENT_ICEHOWL_ATTACK
Definition: trial_of_the_crusader.h:80
@ EVENT_SCENE_303
Definition: trial_of_the_crusader.h:111
@ EVENT_SCENE_205
Definition: trial_of_the_crusader.h:104
@ EVENT_SUMMON_GORMOK
Definition: trial_of_the_crusader.h:72
@ EVENT_SCENE_403
Definition: trial_of_the_crusader.h:118
@ EVENT_JARAXXUS_ATTACK
Definition: trial_of_the_crusader.h:94
@ EVENT_SCENE_302
Definition: trial_of_the_crusader.h:110
@ EVENT_SCENE_406
Definition: trial_of_the_crusader.h:121
@ EVENT_SCENE_108
Definition: trial_of_the_crusader.h:92
@ EVENT_SCENE_408
Definition: trial_of_the_crusader.h:124
@ EVENT_SCENE_203
Definition: trial_of_the_crusader.h:102
@ EVENT_SCENE_003
Definition: trial_of_the_crusader.h:70
@ EVENT_SCENE_107
Definition: trial_of_the_crusader.h:91
@ EVENT_SUMMON_ACIDMAW_AND_DREADSCALE
Definition: trial_of_the_crusader.h:76
@ EVENT_SCENE_304
Definition: trial_of_the_crusader.h:112
@ EVENT_SCENE_111
Definition: trial_of_the_crusader.h:96
@ EVENT_SUMMON_JARAXXUS
Definition: trial_of_the_crusader.h:88
@ EVENT_VALKYRIES_ATTACK
Definition: trial_of_the_crusader.h:113
@ EVENT_SCENE_109
Definition: trial_of_the_crusader.h:93
@ EVENT_SCENE_105
Definition: trial_of_the_crusader.h:89
@ EVENT_SCENE_112
Definition: trial_of_the_crusader.h:97
@ EVENT_SCENE_102
Definition: trial_of_the_crusader.h:85
@ EMOTE_STATE_SPELL_PRECAST
Definition: SharedDefines.h:1926
@ EMOTE_ONESHOT_KNEEL
Definition: SharedDefines.h:1880
@ EMOTE_ONESHOT_EXCLAMATION
Definition: SharedDefines.h:1871
@ EMOTE_STATE_TALK
Definition: SharedDefines.h:1945
@ EMOTE_ONESHOT_LAUGH
Definition: SharedDefines.h:1875
@ EMOTE_STATE_NONE
Definition: SharedDefines.h:1894
@ LANG_UNIVERSAL
Definition: SharedDefines.h:707
@ TEAM_ALLIANCE
Definition: SharedDefines.h:732
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:17770
uint8 GetSpawnMode() const
Definition: Map.h:419
void DoCheckDedicatedInsanity()
Definition: instance_trial_of_the_crusader.cpp:126

References AttemptsLeft, MapRefMgr::begin(), bSwitcher, CLEANUP_CHECK_INTERVAL, 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(), LANG_UNIVERSAL, 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_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().

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

Referenced by GetSaveData().

◆ TeamIdInInstance

TeamId instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::TeamIdInInstance

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