Skip to content

Commit 4559b63

Browse files
committed
[3101] Implement spawn support for the Black Knight - ToC5
1 parent a29e48d commit 4559b63

9 files changed

+204
-11
lines changed

scripts/northrend/crusaders_coliseum/trial_of_the_champion/boss_argent_challenge.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ enum
211211
SPELL_RENEW = 66537,
212212

213213
SPELL_MEMORY_SPAWN_EFFECT = 66675,
214+
SPELL_SHADOWFORM = 41408,
214215
};
215216

216217
/*######
@@ -262,6 +263,7 @@ struct boss_paletressAI : public argent_champion_commonAI
262263

263264
void JustSummoned(Creature* pSummoned) override
264265
{
266+
pSummoned->CastSpell(pSummoned, SPELL_SHADOWFORM, true);
265267
pSummoned->CastSpell(pSummoned, SPELL_MEMORY_SPAWN_EFFECT, true);
266268
}
267269

scripts/northrend/crusaders_coliseum/trial_of_the_champion/boss_black_knight.cpp

+101-2
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,113 @@
1616

1717
/* ScriptData
1818
SDName: boss_black_knight
19-
SD%Complete: 0
20-
SDComment: Placeholder
19+
SD%Complete: 20
20+
SDComment: Basic script only
2121
SDCategory: Crusader Coliseum, Trial of the Champion
2222
EndScriptData */
2323

2424
#include "precompiled.h"
2525
#include "trial_of_the_champion.h"
2626

27+
enum
28+
{
29+
SPELL_KILL_CREDIT = 68663,
30+
};
31+
32+
/*######
33+
## boss_black_knight
34+
######*/
35+
36+
struct boss_black_knightAI : public ScriptedAI
37+
{
38+
boss_black_knightAI(Creature* pCreature) : ScriptedAI(pCreature)
39+
{
40+
m_pInstance = (instance_trial_of_the_champion*)pCreature->GetInstanceData();
41+
m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty();
42+
Reset();
43+
}
44+
45+
instance_trial_of_the_champion* m_pInstance;
46+
bool m_bIsRegularMode;
47+
48+
void Reset() override
49+
{
50+
}
51+
52+
void Aggro(Unit* /*pWho*/) override
53+
{
54+
if (m_pInstance)
55+
m_pInstance->SetData(TYPE_BLACK_KNIGHT, IN_PROGRESS);
56+
}
57+
58+
void JustReachedHome() override
59+
{
60+
if (m_pInstance)
61+
m_pInstance->SetData(TYPE_BLACK_KNIGHT, FAIL);
62+
}
63+
64+
void JustDied(Unit* /*pKiller*/) override
65+
{
66+
if (m_pInstance)
67+
m_pInstance->SetData(TYPE_BLACK_KNIGHT, DONE);
68+
69+
DoCastSpellIfCan(m_creature, SPELL_KILL_CREDIT, CAST_TRIGGERED);
70+
}
71+
72+
void MoveInLineOfSight(Unit* pWho) override
73+
{
74+
// no aggro during the intro
75+
if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE))
76+
return;
77+
78+
ScriptedAI::MoveInLineOfSight(pWho);
79+
}
80+
81+
void UpdateAI(const uint32 uiDiff) override
82+
{
83+
if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
84+
return;
85+
86+
DoMeleeAttackIfReady();
87+
}
88+
};
89+
90+
CreatureAI* GetAI_boss_black_knight(Creature* pCreature)
91+
{
92+
return new boss_black_knightAI(pCreature);
93+
}
94+
95+
/*######
96+
## npc_black_knight_gryphon
97+
######*/
98+
99+
// TODO Remove this 'script' when combat can be proper prevented from core-side
100+
struct npc_black_knight_gryphonAI : public ScriptedAI
101+
{
102+
npc_black_knight_gryphonAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); }
103+
104+
void Reset() override { }
105+
void AttackStart(Unit* /*pWho*/) override { }
106+
void MoveInLineOfSight(Unit* /*pWho*/) override { }
107+
void UpdateAI(const uint32 /*uiDiff*/) override { }
108+
};
109+
110+
CreatureAI* GetAI_npc_black_knight_gryphon(Creature* pCreature)
111+
{
112+
return new npc_black_knight_gryphonAI(pCreature);
113+
}
114+
27115
void AddSC_boss_black_knight()
28116
{
117+
Script* pNewScript;
118+
119+
pNewScript = new Script;
120+
pNewScript->Name = "boss_black_knight";
121+
pNewScript->GetAI = &GetAI_boss_black_knight;
122+
pNewScript->RegisterSelf();
123+
124+
pNewScript = new Script;
125+
pNewScript->Name = "npc_black_knight_gryphon";
126+
pNewScript->GetAI = &GetAI_npc_black_knight_gryphon;
127+
pNewScript->RegisterSelf();
29128
}

scripts/northrend/crusaders_coliseum/trial_of_the_champion/instance_trial_of_the_champion.cpp

+83-4
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717
/* ScriptData
1818
SDName: instance_trial_of_the_champion
19-
SD%Complete: 30
20-
SDComment: First encounter only
19+
SD%Complete: 90
20+
SDComment: Fireworks and various other fine details are not yet implemented.
2121
SDCategory: Crusader Coliseum, Trial of the Champion
2222
EndScriptData */
2323

@@ -86,8 +86,7 @@ enum
8686
SPELL_ARGENT_SUMMON_BOSS_4 = 67396,
8787

8888
SPELL_HERALD_FACE_DARK_KNIGHT = 67482,
89-
SPELL_DEATHS_RESPITE = 66798,
90-
SPELL_DEATHS_PUSH = 66797,
89+
SPELL_DEATHS_RESPITE = 66798, // triggers 66797
9190
SPELL_ARGENT_HERALD_FEIGN_DEATH = 66804,
9291

9392
// Arena event spells - not used for the moment
@@ -123,6 +122,23 @@ static const DialogueEntryTwoSide aTocDialogues[] =
123122
// Argetn challenge complete
124123
{POINT_ID_MOUNT, 0, 0, 0, 5000},
125124
{POINT_ID_EXIT, 0, 0, 0, 0},
125+
// Black knight intro
126+
{TYPE_BLACK_KNIGHT, 0, 0, 0, 4000},
127+
{SAY_TIRION_ARGENT_CHAMPION_COMPLETE, NPC_TIRION_FORDRING, 0, 0, 4000},
128+
{SAY_HERALD_BLACK_KNIGHT_SPAWN, NPC_ARELAS_BRIGHTSTAR, SAY_HERALD_BLACK_KNIGHT_SPAWN, NPC_JAEREN_SUNSWORN, 21000},
129+
{NPC_BLACK_KNIGHT, 0, 0, 0, 1000},
130+
{SAY_BLACK_KNIGHT_INTRO_1, NPC_BLACK_KNIGHT, 0, 0, 4000},
131+
{SPELL_DEATHS_RESPITE, 0, 0, 0, 3000},
132+
{SAY_TIRION_BLACK_KNIGHT_INTRO_2, NPC_TIRION_FORDRING, 0, 0, 1000},
133+
{NPC_BLACK_KNIGHT_GRYPHON, 0, 0, 0, 2000},
134+
{SAY_BLACK_KNIGHT_INTRO_3, NPC_BLACK_KNIGHT, 0, 0, 15000},
135+
{SAY_BLACK_KNIGHT_INTRO_4, NPC_BLACK_KNIGHT, 0, 0, 4000},
136+
{SPELL_ARGENT_HERALD_FEIGN_DEATH, 0, 0, 0, 0},
137+
// Black knight epilog
138+
{SPELL_SPECTATOR_FORCE_CHEER, 0, 0, 0, 5000},
139+
{SAY_TIRION_EPILOG_1, NPC_TIRION_FORDRING, 0, 0, 7000},
140+
{SAY_TIRION_EPILOG_2, NPC_TIRION_FORDRING, 0, 0, 6000},
141+
{SAY_VARIAN_ALLIANCE_EPILOG_3, NPC_VARIAN_WRYNN, SAY_THRALL_HORDE_EPILOG_3, NPC_THRALL, 0},
126142
{0, 0, 0, 0, 0}
127143
};
128144

@@ -213,6 +229,8 @@ void instance_trial_of_the_champion::OnCreatureCreate(Creature* pCreature)
213229
case NPC_SPECTATOR_GNOME:
214230
case NPC_SPECTATOR_HORDE:
215231
case NPC_SPECTATOR_ALLIANCE:
232+
case NPC_BLACK_KNIGHT:
233+
case NPC_BLACK_KNIGHT_GRYPHON:
216234
break;
217235
case NPC_SPECTATOR_GENERIC:
218236
// alliance side
@@ -344,6 +362,9 @@ void instance_trial_of_the_champion::SetData(uint32 uiType, uint32 uiData)
344362
}
345363
break;
346364
case TYPE_BLACK_KNIGHT:
365+
DoUseDoorOrButton(GO_NORTH_GATE);
366+
if (uiData == DONE)
367+
StartNextDialogueText(SPELL_SPECTATOR_FORCE_CHEER);
347368
m_auiEncounter[uiType] = uiData;
348369
break;
349370
case TYPE_ARENA_CHALLENGE:
@@ -866,6 +887,64 @@ void instance_trial_of_the_champion::JustDidDialogueStep(int32 iEntry)
866887
pChampion->ForcedDespawn(8000);
867888
}
868889
break;
890+
891+
// start black knight intro
892+
case TYPE_BLACK_KNIGHT:
893+
if (Creature* pHerald = GetSingleCreatureFromStorage(m_uiHeraldEntry))
894+
pHerald->GetMotionMaster()->MovePoint(0, aHeraldPositions[3][0], aHeraldPositions[3][1], aHeraldPositions[3][2]);
895+
break;
896+
case SAY_TIRION_ARGENT_CHAMPION_COMPLETE:
897+
if (Creature* pHerald = GetSingleCreatureFromStorage(m_uiHeraldEntry))
898+
{
899+
if (Creature* pKnight = pHerald->SummonCreature(NPC_BLACK_KNIGHT, aKnightPositions[0][0], aKnightPositions[0][1], aKnightPositions[0][2], aKnightPositions[0][3], TEMPSUMMON_DEAD_DESPAWN, 0))
900+
{
901+
if (Creature* pGryphon = pHerald->SummonCreature(NPC_BLACK_KNIGHT_GRYPHON, aKnightPositions[1][0], aKnightPositions[1][1], aKnightPositions[1][2], aKnightPositions[1][3], TEMPSUMMON_TIMED_DESPAWN, 75000))
902+
{
903+
pKnight->CastSpell(pGryphon, SPELL_RIDE_VEHICLE_HARDCODED, true);
904+
pGryphon->SetWalk(false);
905+
pGryphon->SetLevitate(true);
906+
}
907+
}
908+
909+
if (Creature* pTirion = GetSingleCreatureFromStorage(NPC_TIRION_FORDRING))
910+
pHerald->SetFacingToObject(pTirion);
911+
}
912+
break;
913+
case SAY_HERALD_BLACK_KNIGHT_SPAWN:
914+
if (Creature* pHerald = GetSingleCreatureFromStorage(m_uiHeraldEntry))
915+
pHerald->CastSpell(pHerald, SPELL_HERALD_FACE_DARK_KNIGHT, false);
916+
if (Creature* pGryphon = GetSingleCreatureFromStorage(NPC_BLACK_KNIGHT_GRYPHON))
917+
pGryphon->GetMotionMaster()->MoveWaypoint();
918+
break;
919+
case NPC_BLACK_KNIGHT:
920+
if (Creature* pGryphon = GetSingleCreatureFromStorage(NPC_BLACK_KNIGHT_GRYPHON))
921+
pGryphon->RemoveAurasDueToSpell(SPELL_RIDE_VEHICLE_HARDCODED);
922+
break;
923+
case SAY_BLACK_KNIGHT_INTRO_1:
924+
if (Creature* pKnight = GetSingleCreatureFromStorage(NPC_BLACK_KNIGHT))
925+
{
926+
if (Creature* pHerald = GetSingleCreatureFromStorage(m_uiHeraldEntry))
927+
{
928+
pHerald->SetFacingToObject(pKnight);
929+
pKnight->SetFacingToObject(pHerald);
930+
}
931+
}
932+
break;
933+
case SPELL_DEATHS_RESPITE:
934+
if (Creature* pKnight = GetSingleCreatureFromStorage(NPC_BLACK_KNIGHT))
935+
pKnight->CastSpell(pKnight, SPELL_DEATHS_RESPITE, false);
936+
break;
937+
case NPC_BLACK_KNIGHT_GRYPHON:
938+
if (Creature* pHerald = GetSingleCreatureFromStorage(m_uiHeraldEntry))
939+
pHerald->CastSpell(pHerald, SPELL_ARGENT_HERALD_FEIGN_DEATH, true);
940+
break;
941+
case SPELL_ARGENT_HERALD_FEIGN_DEATH:
942+
if (Creature* pKnight = GetSingleCreatureFromStorage(NPC_BLACK_KNIGHT))
943+
{
944+
pKnight->SetRespawnCoord(aKnightPositions[2][0], aKnightPositions[2][1], aKnightPositions[2][2], aKnightPositions[2][3]);
945+
pKnight->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
946+
}
947+
break;
869948
}
870949
}
871950

scripts/northrend/crusaders_coliseum/trial_of_the_champion/trial_of_the_champion.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ bool GossipSelect_npc_toc_herald(Player* pPlayer, Creature* pCreature, uint32 /*
8383
pInstance->DoPrepareArgentChallenge();
8484
break;
8585
case GOSSIP_ACTION_INFO_DEF+4:
86-
pInstance->SetData(TYPE_BLACK_KNIGHT, SPECIAL);
86+
pInstance->DoPrepareBlackKnight();
8787
break;
8888
}
8989

scripts/northrend/crusaders_coliseum/trial_of_the_champion/trial_of_the_champion.h

+10-1
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,12 @@ enum
163163
ACHIEV_CRIT_HAD_WORSE = 11789, // Black Knight achiev 3804
164164
};
165165

166-
static const float aHeraldPositions[3][4] =
166+
static const float aHeraldPositions[4][4] =
167167
{
168168
{745.606f, 619.705f, 411.172f, 4.66003f}, // Spawn position
169169
{732.524f, 663.007f, 412.393f, 0.0f}, // Gate movement position
170170
{743.377f, 630.240f, 411.073f, 0.0f}, // Near center position
171+
{744.764f, 628.512f, 411.172f, 0.0f}, // Black knight intro position
171172
};
172173

173174
static const float aIntroPositions[4][4] =
@@ -185,6 +186,13 @@ static const float aChampsPositions[3][4] = // Champ
185186
{755.232f, 660.352f, 412.477f, 4.729f},
186187
};
187188

189+
static const float aKnightPositions[3][4] =
190+
{
191+
{774.283f, 665.505f, 463.484f, 4.310f}, // Black Knight spawn position
192+
{780.694f, 669.611f, 463.662f, 3.769f}, // Gryphon spawn position
193+
{747.788f, 632.487f, 411.414f, 4.744f}, // Center position
194+
};
195+
188196
// data that provides grand champion entry, vehicle mount, trash champions with the spawn locations as well as crowd stalker and emote entry
189197
struct ChampionsData
190198
{
@@ -295,6 +303,7 @@ class instance_trial_of_the_champion : public ScriptedInstance, private Dialogue
295303
void DoSetChamptionsInCombat(Unit* pTarget);
296304

297305
void DoPrepareArgentChallenge() { StartNextDialogueText(NPC_ARGENT_MONK); }
306+
void DoPrepareBlackKnight() { StartNextDialogueText(TYPE_BLACK_KNIGHT); }
298307

299308
uint32 GetMountEntryForChampion() { return m_uiTeam == ALLIANCE ? NPC_BATTLEWORG_ALLIANCE : NPC_WARHORSE_HORDE; }
300309
bool IsArenaChallengeComplete(uint32 uiType);

sd2_revision_nr.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#ifndef __SD2_REVISION_NR_H__
22
#define __SD2_REVISION_NR_H__
3-
#define SD2_REVISION_NR "3100"
3+
#define SD2_REVISION_NR "3101"
44
#endif // __SD2_REVISION_NR_H__

sd2_revision_sql.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#ifndef __SD2_REVISION_SQL_H__
22
#define __SD2_REVISION_SQL_H__
3-
#define REVISION_DB_SCRIPTDEV2 "required__scriptdev2"
4-
#define REVISION_DB_SD2_MANGOS "required__mangos"
3+
#define REVISION_DB_SCRIPTDEV2 "required__scriptdev2"
4+
#define REVISION_DB_SD2_MANGOS "required__mangos"
55
#endif // __SD2_REVISION_SQL_H__

sql/mangos_scriptname_full.sql

+2
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,8 @@ UPDATE creature_template SET ScriptName='npc_champion_mount' WHERE entry IN (356
494494
UPDATE creature_template SET ScriptName='npc_trial_grand_champion' WHERE entry IN (35328,35331,35330,35332,35329,35314,35326,35325,35323,35327);
495495
UPDATE creature_template SET ScriptName='boss_eadric' WHERE entry=35119;
496496
UPDATE creature_template SET ScriptName='boss_paletress' WHERE entry=34928;
497+
UPDATE creature_template SET ScriptName='boss_black_knight' WHERE entry=35451;
498+
UPDATE creature_template SET ScriptName='npc_black_knight_gryphon' WHERE entry=35491;
497499

498500
/* TRIAL OF THE CRUSADER */
499501
UPDATE instance_template SET ScriptName='instance_trial_of_the_crusader' WHERE map=649;

sql/updates/r3101_mangos.sql

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
UPDATE creature_template SET ScriptName='boss_black_knight' WHERE entry=35451;
2+
UPDATE creature_template SET ScriptName='npc_black_knight_gryphon' WHERE entry=35491;

0 commit comments

Comments
 (0)