Permalink
Browse files

[3101] Implement spawn support for the Black Knight - ToC5

  • Loading branch information...
xfurry committed Feb 7, 2015
1 parent a29e48d commit 4559b638316321f79eba399e62622b264b6d1f14
@@ -211,6 +211,7 @@ enum
SPELL_RENEW = 66537,
SPELL_MEMORY_SPAWN_EFFECT = 66675,
SPELL_SHADOWFORM = 41408,
};
/*######
@@ -262,6 +263,7 @@ struct boss_paletressAI : public argent_champion_commonAI
void JustSummoned(Creature* pSummoned) override
{
pSummoned->CastSpell(pSummoned, SPELL_SHADOWFORM, true);
pSummoned->CastSpell(pSummoned, SPELL_MEMORY_SPAWN_EFFECT, true);
}
@@ -16,14 +16,113 @@
/* ScriptData
SDName: boss_black_knight
SD%Complete: 0
SDComment: Placeholder
SD%Complete: 20
SDComment: Basic script only
SDCategory: Crusader Coliseum, Trial of the Champion
EndScriptData */
#include "precompiled.h"
#include "trial_of_the_champion.h"
enum
{
SPELL_KILL_CREDIT = 68663,
};
/*######
## boss_black_knight
######*/
struct boss_black_knightAI : public ScriptedAI
{
boss_black_knightAI(Creature* pCreature) : ScriptedAI(pCreature)
{
m_pInstance = (instance_trial_of_the_champion*)pCreature->GetInstanceData();
m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty();
Reset();
}
instance_trial_of_the_champion* m_pInstance;
bool m_bIsRegularMode;
void Reset() override
{
}
void Aggro(Unit* /*pWho*/) override
{
if (m_pInstance)
m_pInstance->SetData(TYPE_BLACK_KNIGHT, IN_PROGRESS);
}
void JustReachedHome() override
{
if (m_pInstance)
m_pInstance->SetData(TYPE_BLACK_KNIGHT, FAIL);
}
void JustDied(Unit* /*pKiller*/) override
{
if (m_pInstance)
m_pInstance->SetData(TYPE_BLACK_KNIGHT, DONE);
DoCastSpellIfCan(m_creature, SPELL_KILL_CREDIT, CAST_TRIGGERED);
}
void MoveInLineOfSight(Unit* pWho) override
{
// no aggro during the intro
if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE))
return;
ScriptedAI::MoveInLineOfSight(pWho);
}
void UpdateAI(const uint32 uiDiff) override
{
if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
return;
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI_boss_black_knight(Creature* pCreature)
{
return new boss_black_knightAI(pCreature);
}
/*######
## npc_black_knight_gryphon
######*/
// TODO Remove this 'script' when combat can be proper prevented from core-side
struct npc_black_knight_gryphonAI : public ScriptedAI
{
npc_black_knight_gryphonAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); }
void Reset() override { }
void AttackStart(Unit* /*pWho*/) override { }
void MoveInLineOfSight(Unit* /*pWho*/) override { }
void UpdateAI(const uint32 /*uiDiff*/) override { }
};
CreatureAI* GetAI_npc_black_knight_gryphon(Creature* pCreature)
{
return new npc_black_knight_gryphonAI(pCreature);
}
void AddSC_boss_black_knight()
{
Script* pNewScript;
pNewScript = new Script;
pNewScript->Name = "boss_black_knight";
pNewScript->GetAI = &GetAI_boss_black_knight;
pNewScript->RegisterSelf();
pNewScript = new Script;
pNewScript->Name = "npc_black_knight_gryphon";
pNewScript->GetAI = &GetAI_npc_black_knight_gryphon;
pNewScript->RegisterSelf();
}
@@ -16,8 +16,8 @@
/* ScriptData
SDName: instance_trial_of_the_champion
SD%Complete: 30
SDComment: First encounter only
SD%Complete: 90
SDComment: Fireworks and various other fine details are not yet implemented.
SDCategory: Crusader Coliseum, Trial of the Champion
EndScriptData */
@@ -86,8 +86,7 @@ enum
SPELL_ARGENT_SUMMON_BOSS_4 = 67396,
SPELL_HERALD_FACE_DARK_KNIGHT = 67482,
SPELL_DEATHS_RESPITE = 66798,
SPELL_DEATHS_PUSH = 66797,
SPELL_DEATHS_RESPITE = 66798, // triggers 66797
SPELL_ARGENT_HERALD_FEIGN_DEATH = 66804,
// Arena event spells - not used for the moment
@@ -123,6 +122,23 @@ static const DialogueEntryTwoSide aTocDialogues[] =
// Argetn challenge complete
{POINT_ID_MOUNT, 0, 0, 0, 5000},
{POINT_ID_EXIT, 0, 0, 0, 0},
// Black knight intro
{TYPE_BLACK_KNIGHT, 0, 0, 0, 4000},
{SAY_TIRION_ARGENT_CHAMPION_COMPLETE, NPC_TIRION_FORDRING, 0, 0, 4000},
{SAY_HERALD_BLACK_KNIGHT_SPAWN, NPC_ARELAS_BRIGHTSTAR, SAY_HERALD_BLACK_KNIGHT_SPAWN, NPC_JAEREN_SUNSWORN, 21000},
{NPC_BLACK_KNIGHT, 0, 0, 0, 1000},
{SAY_BLACK_KNIGHT_INTRO_1, NPC_BLACK_KNIGHT, 0, 0, 4000},
{SPELL_DEATHS_RESPITE, 0, 0, 0, 3000},
{SAY_TIRION_BLACK_KNIGHT_INTRO_2, NPC_TIRION_FORDRING, 0, 0, 1000},
{NPC_BLACK_KNIGHT_GRYPHON, 0, 0, 0, 2000},
{SAY_BLACK_KNIGHT_INTRO_3, NPC_BLACK_KNIGHT, 0, 0, 15000},
{SAY_BLACK_KNIGHT_INTRO_4, NPC_BLACK_KNIGHT, 0, 0, 4000},
{SPELL_ARGENT_HERALD_FEIGN_DEATH, 0, 0, 0, 0},
// Black knight epilog
{SPELL_SPECTATOR_FORCE_CHEER, 0, 0, 0, 5000},
{SAY_TIRION_EPILOG_1, NPC_TIRION_FORDRING, 0, 0, 7000},
{SAY_TIRION_EPILOG_2, NPC_TIRION_FORDRING, 0, 0, 6000},
{SAY_VARIAN_ALLIANCE_EPILOG_3, NPC_VARIAN_WRYNN, SAY_THRALL_HORDE_EPILOG_3, NPC_THRALL, 0},
{0, 0, 0, 0, 0}
};
@@ -213,6 +229,8 @@ void instance_trial_of_the_champion::OnCreatureCreate(Creature* pCreature)
case NPC_SPECTATOR_GNOME:
case NPC_SPECTATOR_HORDE:
case NPC_SPECTATOR_ALLIANCE:
case NPC_BLACK_KNIGHT:
case NPC_BLACK_KNIGHT_GRYPHON:
break;
case NPC_SPECTATOR_GENERIC:
// alliance side
@@ -344,6 +362,9 @@ void instance_trial_of_the_champion::SetData(uint32 uiType, uint32 uiData)
}
break;
case TYPE_BLACK_KNIGHT:
DoUseDoorOrButton(GO_NORTH_GATE);
if (uiData == DONE)
StartNextDialogueText(SPELL_SPECTATOR_FORCE_CHEER);
m_auiEncounter[uiType] = uiData;
break;
case TYPE_ARENA_CHALLENGE:
@@ -866,6 +887,64 @@ void instance_trial_of_the_champion::JustDidDialogueStep(int32 iEntry)
pChampion->ForcedDespawn(8000);
}
break;
// start black knight intro
case TYPE_BLACK_KNIGHT:
if (Creature* pHerald = GetSingleCreatureFromStorage(m_uiHeraldEntry))
pHerald->GetMotionMaster()->MovePoint(0, aHeraldPositions[3][0], aHeraldPositions[3][1], aHeraldPositions[3][2]);
break;
case SAY_TIRION_ARGENT_CHAMPION_COMPLETE:
if (Creature* pHerald = GetSingleCreatureFromStorage(m_uiHeraldEntry))
{
if (Creature* pKnight = pHerald->SummonCreature(NPC_BLACK_KNIGHT, aKnightPositions[0][0], aKnightPositions[0][1], aKnightPositions[0][2], aKnightPositions[0][3], TEMPSUMMON_DEAD_DESPAWN, 0))
{
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))
{
pKnight->CastSpell(pGryphon, SPELL_RIDE_VEHICLE_HARDCODED, true);
pGryphon->SetWalk(false);
pGryphon->SetLevitate(true);
}
}
if (Creature* pTirion = GetSingleCreatureFromStorage(NPC_TIRION_FORDRING))
pHerald->SetFacingToObject(pTirion);
}
break;
case SAY_HERALD_BLACK_KNIGHT_SPAWN:
if (Creature* pHerald = GetSingleCreatureFromStorage(m_uiHeraldEntry))
pHerald->CastSpell(pHerald, SPELL_HERALD_FACE_DARK_KNIGHT, false);
if (Creature* pGryphon = GetSingleCreatureFromStorage(NPC_BLACK_KNIGHT_GRYPHON))
pGryphon->GetMotionMaster()->MoveWaypoint();
break;
case NPC_BLACK_KNIGHT:
if (Creature* pGryphon = GetSingleCreatureFromStorage(NPC_BLACK_KNIGHT_GRYPHON))
pGryphon->RemoveAurasDueToSpell(SPELL_RIDE_VEHICLE_HARDCODED);
break;
case SAY_BLACK_KNIGHT_INTRO_1:
if (Creature* pKnight = GetSingleCreatureFromStorage(NPC_BLACK_KNIGHT))
{
if (Creature* pHerald = GetSingleCreatureFromStorage(m_uiHeraldEntry))
{
pHerald->SetFacingToObject(pKnight);
pKnight->SetFacingToObject(pHerald);
}
}
break;
case SPELL_DEATHS_RESPITE:
if (Creature* pKnight = GetSingleCreatureFromStorage(NPC_BLACK_KNIGHT))
pKnight->CastSpell(pKnight, SPELL_DEATHS_RESPITE, false);
break;
case NPC_BLACK_KNIGHT_GRYPHON:
if (Creature* pHerald = GetSingleCreatureFromStorage(m_uiHeraldEntry))
pHerald->CastSpell(pHerald, SPELL_ARGENT_HERALD_FEIGN_DEATH, true);
break;
case SPELL_ARGENT_HERALD_FEIGN_DEATH:
if (Creature* pKnight = GetSingleCreatureFromStorage(NPC_BLACK_KNIGHT))
{
pKnight->SetRespawnCoord(aKnightPositions[2][0], aKnightPositions[2][1], aKnightPositions[2][2], aKnightPositions[2][3]);
pKnight->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
}
break;
}
}
@@ -83,7 +83,7 @@ bool GossipSelect_npc_toc_herald(Player* pPlayer, Creature* pCreature, uint32 /*
pInstance->DoPrepareArgentChallenge();
break;
case GOSSIP_ACTION_INFO_DEF+4:
pInstance->SetData(TYPE_BLACK_KNIGHT, SPECIAL);
pInstance->DoPrepareBlackKnight();
break;
}
@@ -163,11 +163,12 @@ enum
ACHIEV_CRIT_HAD_WORSE = 11789, // Black Knight achiev 3804
};
static const float aHeraldPositions[3][4] =
static const float aHeraldPositions[4][4] =
{
{745.606f, 619.705f, 411.172f, 4.66003f}, // Spawn position
{732.524f, 663.007f, 412.393f, 0.0f}, // Gate movement position
{743.377f, 630.240f, 411.073f, 0.0f}, // Near center position
{744.764f, 628.512f, 411.172f, 0.0f}, // Black knight intro position
};
static const float aIntroPositions[4][4] =
@@ -185,6 +186,13 @@ static const float aChampsPositions[3][4] = // Champ
{755.232f, 660.352f, 412.477f, 4.729f},
};
static const float aKnightPositions[3][4] =
{
{774.283f, 665.505f, 463.484f, 4.310f}, // Black Knight spawn position
{780.694f, 669.611f, 463.662f, 3.769f}, // Gryphon spawn position
{747.788f, 632.487f, 411.414f, 4.744f}, // Center position
};
// data that provides grand champion entry, vehicle mount, trash champions with the spawn locations as well as crowd stalker and emote entry
struct ChampionsData
{
@@ -295,6 +303,7 @@ class instance_trial_of_the_champion : public ScriptedInstance, private Dialogue
void DoSetChamptionsInCombat(Unit* pTarget);
void DoPrepareArgentChallenge() { StartNextDialogueText(NPC_ARGENT_MONK); }
void DoPrepareBlackKnight() { StartNextDialogueText(TYPE_BLACK_KNIGHT); }
uint32 GetMountEntryForChampion() { return m_uiTeam == ALLIANCE ? NPC_BATTLEWORG_ALLIANCE : NPC_WARHORSE_HORDE; }
bool IsArenaChallengeComplete(uint32 uiType);
View
@@ -1,4 +1,4 @@
#ifndef __SD2_REVISION_NR_H__
#define __SD2_REVISION_NR_H__
#define SD2_REVISION_NR "3100"
#define SD2_REVISION_NR "3101"
#endif // __SD2_REVISION_NR_H__
View
@@ -1,5 +1,5 @@
#ifndef __SD2_REVISION_SQL_H__
#define __SD2_REVISION_SQL_H__
#define REVISION_DB_SCRIPTDEV2 "required__scriptdev2"
#define REVISION_DB_SD2_MANGOS "required__mangos"
#define REVISION_DB_SCRIPTDEV2 "required__scriptdev2"
#define REVISION_DB_SD2_MANGOS "required__mangos"
#endif // __SD2_REVISION_SQL_H__
@@ -494,6 +494,8 @@ UPDATE creature_template SET ScriptName='npc_champion_mount' WHERE entry IN (356
UPDATE creature_template SET ScriptName='npc_trial_grand_champion' WHERE entry IN (35328,35331,35330,35332,35329,35314,35326,35325,35323,35327);
UPDATE creature_template SET ScriptName='boss_eadric' WHERE entry=35119;
UPDATE creature_template SET ScriptName='boss_paletress' WHERE entry=34928;
UPDATE creature_template SET ScriptName='boss_black_knight' WHERE entry=35451;
UPDATE creature_template SET ScriptName='npc_black_knight_gryphon' WHERE entry=35491;
/* TRIAL OF THE CRUSADER */
UPDATE instance_template SET ScriptName='instance_trial_of_the_crusader' WHERE map=649;
@@ -0,0 +1,2 @@
UPDATE creature_template SET ScriptName='boss_black_knight' WHERE entry=35451;
UPDATE creature_template SET ScriptName='npc_black_knight_gryphon' WHERE entry=35491;

0 comments on commit 4559b63

Please sign in to comment.