Changes in Trial of the Champion:
-Implemented new scripts for Grand Champions, it includes vehicle fight (it is not 100 % done) -Implemented more Vehicles Accessories. (related with the instance) -Implemented basic support for event at spawn or dead from Boss Eadric/Paletress. -Implemented basic support for event at spawn from Boss Black Knight. For a complete fix see TDB forum > New Fix Submissions > Core related DB content. --HG-- branch : trunk
This commit is contained in:
@@ -1990,3 +1990,16 @@ INSERT INTO `script_waypoint` VALUES
|
||||
(7998,14,-520.928,-117.679,-156.119,0,''),
|
||||
(7998,15,-521.717,-119.564,-156.114,0,'');
|
||||
|
||||
DELETE FROM `script_waypoint` WHERE `entry`=35491;
|
||||
INSERT INTO `script_waypoint` VALUES
|
||||
(35491,1,754.709,646.999,442.961,0,''),
|
||||
(35491,2,738.85,637.289,439.134,0,''),
|
||||
(35491,3,727.272,619.164,438.186,0,''),
|
||||
(35491,4,733.524,608.939,433.711,0,''),
|
||||
(35491,5,745.537,605.399,428.795,0,''),
|
||||
(35491,6,754.46,607.124,426.542,0,''),
|
||||
(35491,7,763.48,616.796,422.603,0,''),
|
||||
(35491,8,761.823,625.299,418.482,0,''),
|
||||
(35491,9,755.923,631.506,413.966,0,''),
|
||||
(35491,10,744.841,634.505,411.575,0,'');
|
||||
|
||||
|
||||
@@ -1221,17 +1221,21 @@ UPDATE `creature_template` SET `ScriptName`='npc_cairne_bloodhoof' WHERE `entry`
|
||||
|
||||
/* TRIAL OF THE CHAMPION */
|
||||
UPDATE `instance_template` SET `script`='instance_trial_of_the_champion' WHERE `map`=650;
|
||||
UPDATE `creature_template` SET `Scriptname`='npc_toc5_announcer',`npcflag`=1 WHERE entry IN (35004, 35005);
|
||||
UPDATE `creature_template` SET `ScriptName`='mob_toc5_warrior' WHERE entry IN (34705, 35572);
|
||||
UPDATE `creature_template` SET `ScriptName`='mob_toc5_mage' WHERE entry IN (34702, 35569);
|
||||
UPDATE `creature_template` SET `ScriptName`='mob_toc5_shaman' WHERE entry IN (34701, 35571);
|
||||
UPDATE `creature_template` SET `ScriptName`='mob_toc5_hunter' WHERE entry IN (34657, 35570);
|
||||
UPDATE `creature_template` SET `ScriptName`='mob_toc5_rogue' WHERE entry IN (34703, 35617);
|
||||
UPDATE `creature_template` SET `ScriptName`='generic_vehicleAI_toc5' WHERE `entry` IN (35637,35633,35768,34658,35636,35638,35635,35640,35641,35634,33298,33416,33297,33414,33301,33408,33300,33409,33418);
|
||||
UPDATE `creature_template` SET `ScriptName`='boss_warrior_toc5' WHERE `entry` IN (34705,35572);
|
||||
UPDATE `creature_template` SET `ScriptName`='boss_mage_toc5' WHERE `entry` IN (34702,35569);
|
||||
UPDATE `creature_template` SET `ScriptName`='boss_shaman_toc5' WHERE `entry` IN (35571,34701);
|
||||
UPDATE `creature_template` SET `ScriptName`='boss_hunter_toc5' WHERE `entry` IN (35570,34657);
|
||||
UPDATE `creature_template` SET `ScriptName`='boss_rouge_toc5' WHERE `entry` IN (35617,34703);
|
||||
UPDATE `creature_template` SET `ScriptName`='npc_announcer_toc5' WHERE `entry`IN (35004,35005);
|
||||
UPDATE `creature_template` SET `ScriptName`='npc_risen_ghoul' WHERE `entry` IN (35545,35564);
|
||||
UPDATE `creature_template` SET `ScriptName`='boss_black_knight' WHERE `entry`=35451;
|
||||
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`='npc_memory' WHERE `entry` IN (35052,35041,35033,35046,35043,35047,35044,35039, 35034, 35049, 35030, 34942, 35050, 35042, 35045, 35037, 35031, 35038, 35029,35048,35032,35028,35040,35036,35051);
|
||||
UPDATE `creature_template` SET `ScriptName`='npc_argent_soldier' WHERE `entry` IN (35309,35305,35307);
|
||||
UPDATE `creature_template` SET `ScriptName`='npc_black_knight_skeletal_gryphon' WHERE `entry`=35491;
|
||||
UPDATE `creature_template` SET `AIName`='PassiveAI' WHERE `entry` IN (35332,35330,35328,35327,35331,35329,35325,35314,35326,35323);
|
||||
|
||||
/* TIRISFAL GLADES */
|
||||
UPDATE `creature_template` SET `ScriptName`='npc_calvin_montague' WHERE `entry`=6784;
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
DELETE FROM `script_waypoint` WHERE `entry`=35491;
|
||||
INSERT INTO `script_waypoint` VALUES
|
||||
(35491,1,754.709,646.999,442.961,0,''),
|
||||
(35491,2,738.85,637.289,439.134,0,''),
|
||||
(35491,3,727.272,619.164,438.186,0,''),
|
||||
(35491,4,733.524,608.939,433.711,0,''),
|
||||
(35491,5,745.537,605.399,428.795,0,''),
|
||||
(35491,6,754.46,607.124,426.542,0,''),
|
||||
(35491,7,763.48,616.796,422.603,0,''),
|
||||
(35491,8,761.823,625.299,418.482,0,''),
|
||||
(35491,9,755.923,631.506,413.966,0,''),
|
||||
(35491,10,744.841,634.505,411.575,0,'');
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
UPDATE `creature_template` SET `ScriptName`='generic_vehicleAI_toc5' WHERE `entry` IN (35637,35633,35768,34658,35636,35638,35635,35640,35641,35634,33298,33416,33297,33414,33301,33408,33300,33409,33418);
|
||||
UPDATE `creature_template` SET `ScriptName`='boss_warrior_toc5' WHERE `entry` IN (34705,35572);
|
||||
UPDATE `creature_template` SET `ScriptName`='boss_mage_toc5' WHERE `entry` IN (34702,35569);
|
||||
UPDATE `creature_template` SET `ScriptName`='boss_shaman_toc5' WHERE `entry` IN (35571,34701);
|
||||
UPDATE `creature_template` SET `ScriptName`='boss_hunter_toc5' WHERE `entry` IN (35570,34657);
|
||||
UPDATE `creature_template` SET `ScriptName`='boss_rouge_toc5' WHERE `entry` IN (35617,34703);
|
||||
UPDATE `creature_template` SET `ScriptName`='npc_announcer_toc5' WHERE `entry`IN (35004,35005);
|
||||
UPDATE `instance_template` SET `script`='instance_trial_of_the_champion' WHERE `map`=650;
|
||||
UPDATE `creature_template` SET `ScriptName`='npc_argent_soldier' WHERE `entry` IN (35309,35305,35307);
|
||||
UPDATE `creature_template` SET `ScriptName`='npc_black_knight_skeletal_gryphon' WHERE `entry`=35491;
|
||||
UPDATE `creature_template` SET `AIName`='PassiveAI' WHERE `entry` IN (35332,35330,35328,35327,35331,35329,35325,35314,35326,35323);
|
||||
|
||||
@@ -125,6 +125,17 @@ void Vehicle::InstallAllAccessories()
|
||||
case 35640:InstallAccessory(35571,0,false);break;
|
||||
case 35641:InstallAccessory(35570,0,false);break;
|
||||
case 35634:InstallAccessory(35617,0,false);break;
|
||||
case 33298:InstallAccessory(35332,0);break; //Darnassian Nightsaber
|
||||
case 33416:InstallAccessory(35330,0);break; //Exodar Elekk
|
||||
case 33297:InstallAccessory(35328,0);break; //Stormwind Steed
|
||||
case 33414:InstallAccessory(35327,0);break; //Forsaken Warhorse
|
||||
case 33301:InstallAccessory(35331,0);break; //Gnomeregan Mechanostrider
|
||||
case 33408:InstallAccessory(35329,0);break; //Ironforge Ram
|
||||
case 33300:InstallAccessory(35325,0);break; //Thunder Bluff Kodo
|
||||
case 33409:InstallAccessory(35314,0);break; //Orgrimmar Wolf
|
||||
case 33418:InstallAccessory(35326,0);break; //Silvermoon Hawkstrider
|
||||
case 33299:InstallAccessory(35323,0);break; //Darkspear Raptor
|
||||
case 35491:InstallAccessory(35451,0,false);break; //Black Knight
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+200
-7
@@ -18,13 +18,14 @@
|
||||
|
||||
/* ScriptData
|
||||
SDName: Argent Challenge Encounter.
|
||||
SD%Complete: 90 %
|
||||
SDComment: Texts are not implemented.
|
||||
SD%Complete: 50 %
|
||||
SDComment: AI for Argent Soldiers are not implemented. AI from bosses need more improvements.
|
||||
SDCategory: Trial of the Champion
|
||||
EndScriptData */
|
||||
|
||||
#include "ScriptedPch.h"
|
||||
#include "trial_of_the_champion.h"
|
||||
#include "ScriptedEscortAI.h"
|
||||
|
||||
enum eSpells
|
||||
{
|
||||
@@ -58,21 +59,62 @@ enum eSpells
|
||||
|
||||
struct TRINITY_DLL_DECL boss_eadricAI : public ScriptedAI
|
||||
{
|
||||
boss_eadricAI(Creature* pCreature) : ScriptedAI(pCreature) {}
|
||||
boss_eadricAI(Creature* pCreature) : ScriptedAI(pCreature)
|
||||
{
|
||||
pInstance = pCreature->GetInstanceData();
|
||||
pCreature->SetReactState(REACT_PASSIVE);
|
||||
pCreature->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE);
|
||||
}
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
uint32 uiVenganceTimer;
|
||||
uint32 uiRadianceTimer;
|
||||
uint32 uiHammerJusticeTimer;
|
||||
uint32 uiResetTimer;
|
||||
|
||||
bool bDone;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
uiVenganceTimer = 10000;
|
||||
uiRadianceTimer = 16000;
|
||||
uiHammerJusticeTimer = 25000;
|
||||
uiResetTimer = 5000;
|
||||
|
||||
bDone = false;
|
||||
}
|
||||
|
||||
void DamageTaken(Unit *done_by, uint32 &damage)
|
||||
{
|
||||
if (damage >= m_creature->GetHealth())
|
||||
{
|
||||
damage = 0;
|
||||
EnterEvadeMode();
|
||||
m_creature->setFaction(35);
|
||||
bDone = true;
|
||||
}
|
||||
}
|
||||
|
||||
void MovementInform(uint32 MovementType, uint32 Data)
|
||||
{
|
||||
if (MovementType != POINT_MOTION_TYPE)
|
||||
return;
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(BOSS_ARGENT_CHALLENGE_E, DONE);
|
||||
|
||||
m_creature->DisappearAndDie();
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 uiDiff)
|
||||
{
|
||||
if (bDone && uiResetTimer <= uiDiff)
|
||||
{
|
||||
m_creature->GetMotionMaster()->MovePoint(0,746.87,665.87,411.75);
|
||||
bDone = false;
|
||||
} else uiResetTimer -= uiDiff;
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
@@ -118,7 +160,12 @@ struct TRINITY_DLL_DECL boss_paletressAI : public ScriptedAI
|
||||
{
|
||||
boss_paletressAI(Creature* pCreature) : ScriptedAI(pCreature)
|
||||
{
|
||||
pInstance = pCreature->GetInstanceData();
|
||||
|
||||
pMemory = NULL;
|
||||
pCreature->SetReactState(REACT_PASSIVE);
|
||||
pCreature->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE);
|
||||
pCreature->RestoreFaction();
|
||||
}
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
@@ -126,12 +173,12 @@ struct TRINITY_DLL_DECL boss_paletressAI : public ScriptedAI
|
||||
Creature* pMemory;
|
||||
|
||||
bool bHealth;
|
||||
bool bDone;
|
||||
|
||||
uint32 uiHolyFireTimer;
|
||||
uint32 uiHolySmiteTimer;
|
||||
uint32 uiRenewTimer;
|
||||
|
||||
uint32 uiRandomSpell;
|
||||
uint32 uiResetTimer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
@@ -140,9 +187,11 @@ struct TRINITY_DLL_DECL boss_paletressAI : public ScriptedAI
|
||||
uiHolyFireTimer = urand(9000,12000);
|
||||
uiHolySmiteTimer = urand(5000,7000);
|
||||
uiRenewTimer = urand(2000,5000);
|
||||
uiRandomSpell = 0;
|
||||
|
||||
uiResetTimer = 7000;
|
||||
|
||||
bHealth = false;
|
||||
bDone = false;
|
||||
|
||||
if (pMemory && pMemory->isAlive())
|
||||
pMemory->RemoveFromWorld();
|
||||
@@ -154,8 +203,36 @@ struct TRINITY_DLL_DECL boss_paletressAI : public ScriptedAI
|
||||
m_creature->RemoveAura(SPELL_SHIELD);
|
||||
}
|
||||
|
||||
void DamageTaken(Unit *done_by, uint32 &damage)
|
||||
{
|
||||
if (damage >= m_creature->GetHealth())
|
||||
{
|
||||
damage = 0;
|
||||
EnterEvadeMode();
|
||||
m_creature->setFaction(35);
|
||||
bDone = true;
|
||||
}
|
||||
}
|
||||
|
||||
void MovementInform(uint32 MovementType, uint32 Data)
|
||||
{
|
||||
if (MovementType != POINT_MOTION_TYPE)
|
||||
return;
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(BOSS_ARGENT_CHALLENGE_P, DONE);
|
||||
|
||||
m_creature->DisappearAndDie();
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 uiDiff)
|
||||
{
|
||||
if (bDone && uiResetTimer <= uiDiff)
|
||||
{
|
||||
m_creature->GetMotionMaster()->MovePoint(0,746.87,665.87,411.75);
|
||||
bDone = false;
|
||||
} else uiResetTimer -= uiDiff;
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
@@ -207,7 +284,6 @@ struct TRINITY_DLL_DECL boss_paletressAI : public ScriptedAI
|
||||
if (!bHealth && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 25)
|
||||
{
|
||||
m_creature->InterruptNonMeleeSpells(true);
|
||||
uiRandomSpell = urand(1,26);
|
||||
DoCastAOE(SPELL_HOLY_NOVA,false);
|
||||
DoCast(m_creature, SPELL_SHIELD);
|
||||
DoCastAOE(SPELL_SUMMON_MEMORY,false);
|
||||
@@ -282,12 +358,14 @@ struct TRINITY_DLL_DECL npc_memoryAI : public ScriptedAI
|
||||
void JustDied(Unit* pKiller)
|
||||
{
|
||||
if (m_creature->isSummon())
|
||||
{
|
||||
if (Unit* pSummoner = CAST_SUM(m_creature)->GetSummoner())
|
||||
{
|
||||
if (pSummoner && pSummoner->isAlive())
|
||||
CAST_CRE(pSummoner)->AI()->SetData(1,0);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_npc_memory(Creature* pCreature)
|
||||
@@ -295,6 +373,116 @@ CreatureAI* GetAI_npc_memory(Creature* pCreature)
|
||||
return new npc_memoryAI(pCreature);
|
||||
}
|
||||
|
||||
// THIS AI NEEDS MORE IMPROVEMENTS
|
||||
struct TRINITY_DLL_DECL npc_argent_soldierAI : public npc_escortAI
|
||||
{
|
||||
npc_argent_soldierAI(Creature* pCreature) : npc_escortAI(pCreature)
|
||||
{
|
||||
pInstance = pCreature->GetInstanceData();
|
||||
m_creature->SetReactState(REACT_DEFENSIVE);
|
||||
SetDespawnAtEnd(false);
|
||||
uiWaypoint = 0;
|
||||
}
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
uint8 uiWaypoint;
|
||||
|
||||
void WaypointReached(uint32 uiPoint)
|
||||
{
|
||||
if (uiPoint == 0)
|
||||
{
|
||||
switch(uiWaypoint)
|
||||
{
|
||||
case 0:
|
||||
m_creature->SetOrientation(5.81);
|
||||
break;
|
||||
case 1:
|
||||
m_creature->SetOrientation(4.60);
|
||||
break;
|
||||
case 2:
|
||||
m_creature->SetOrientation(2.79);
|
||||
break;
|
||||
}
|
||||
|
||||
m_creature->SendMovementFlagUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
void SetData(uint32 uiType, uint32 uiData)
|
||||
{
|
||||
switch(m_creature->GetEntry())
|
||||
{
|
||||
case NPC_ARGENT_LIGHWIELDER:
|
||||
switch(uiType)
|
||||
{
|
||||
case 0:
|
||||
AddWaypoint(0,712.14,628.42,411.88);
|
||||
break;
|
||||
case 1:
|
||||
AddWaypoint(0,742.44,650.29,411.79);
|
||||
break;
|
||||
case 2:
|
||||
AddWaypoint(0,783.33,615.29,411.84);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case NPC_ARGENT_MONK:
|
||||
switch(uiType)
|
||||
{
|
||||
case 0:
|
||||
AddWaypoint(0,713.12,632.97,411.90);
|
||||
break;
|
||||
case 1:
|
||||
AddWaypoint(0,746.73,650.24,411.56);
|
||||
break;
|
||||
case 2:
|
||||
AddWaypoint(0,781.32,610.54,411.82);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case NPC_PRIESTESS:
|
||||
switch(uiType)
|
||||
{
|
||||
case 0:
|
||||
AddWaypoint(0,715.06,637.07,411.91);
|
||||
break;
|
||||
case 1:
|
||||
AddWaypoint(0,750.72,650.20,411.77);
|
||||
break;
|
||||
case 2:
|
||||
AddWaypoint(0,779.77,607.03,411.81);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
Start(false,true,0);
|
||||
uiWaypoint = uiType;
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 uiDiff)
|
||||
{
|
||||
npc_escortAI::UpdateAI(uiDiff);
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void JustDied(Unit* pKiller)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_ARGENT_SOLDIER_DEFEATED,pInstance->GetData(DATA_ARGENT_SOLDIER_DEFEATED) + 1);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_npc_argent_soldier(Creature* pCreature)
|
||||
{
|
||||
return new npc_argent_soldierAI(pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_argent_challenge()
|
||||
{
|
||||
Script* NewScript;
|
||||
@@ -313,4 +501,9 @@ void AddSC_boss_argent_challenge()
|
||||
NewScript->Name = "npc_memory";
|
||||
NewScript->GetAI = &GetAI_npc_memory;
|
||||
NewScript->RegisterSelf();
|
||||
|
||||
NewScript = new Script;
|
||||
NewScript->Name = "npc_argent_soldier";
|
||||
NewScript->GetAI = &GetAI_npc_argent_soldier;
|
||||
NewScript->RegisterSelf();
|
||||
}
|
||||
|
||||
+41
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2009 Trinity <http://www.trinitycore.org/>
|
||||
* Copyright (C) 2010 Trinity <http://www.trinitycore.org/>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -24,6 +24,7 @@ SDCategory: Trial of the Champion
|
||||
EndScriptData */
|
||||
|
||||
#include "ScriptedPch.h"
|
||||
#include "ScriptedEscortAI.h"
|
||||
#include "trial_of_the_champion.h"
|
||||
|
||||
enum eSpells
|
||||
@@ -132,7 +133,7 @@ struct TRINITY_DLL_DECL boss_black_knightAI : public ScriptedAI
|
||||
|
||||
for(std::list<uint64>::iterator itr = SummonList.begin(); itr != SummonList.end(); ++itr)
|
||||
{
|
||||
if (Creature* pTemp = (Creature*)Unit::GetUnit(*m_creature, *itr))
|
||||
if (Creature* pTemp = Unit::GetCreature(*m_creature, *itr))
|
||||
if (pTemp)
|
||||
pTemp->DisappearAndDie();
|
||||
}
|
||||
@@ -276,6 +277,12 @@ struct TRINITY_DLL_DECL boss_black_knightAI : public ScriptedAI
|
||||
bEventInProgress = true;
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* pKiller)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(BOSS_BLACK_KNIGHT,DONE);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_black_knight(Creature *pCreature)
|
||||
@@ -318,6 +325,33 @@ CreatureAI* GetAI_npc_risen_ghoul(Creature* pCreature)
|
||||
return new npc_risen_ghoulAI(pCreature);
|
||||
}
|
||||
|
||||
struct TRINITY_DLL_DECL npc_black_knight_skeletal_gryphonAI : public npc_escortAI
|
||||
{
|
||||
npc_black_knight_skeletal_gryphonAI(Creature* pCreature) : npc_escortAI(pCreature)
|
||||
{
|
||||
Start(false,true,0,NULL);
|
||||
}
|
||||
|
||||
void WaypointReached(uint32 i)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 uiDiff)
|
||||
{
|
||||
npc_escortAI::UpdateAI(uiDiff);
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_npc_black_knight_skeletal_gryphon(Creature* pCreature)
|
||||
{
|
||||
return new npc_black_knight_skeletal_gryphonAI(pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_black_knight()
|
||||
{
|
||||
Script* NewScript;
|
||||
@@ -331,4 +365,9 @@ void AddSC_boss_black_knight()
|
||||
NewScript->Name = "npc_risen_ghoul";
|
||||
NewScript->GetAI = &GetAI_npc_risen_ghoul;
|
||||
NewScript->RegisterSelf();
|
||||
|
||||
NewScript = new Script;
|
||||
NewScript->Name = "npc_black_knight_skeletal_gryphon";
|
||||
NewScript->GetAI = &GetAI_npc_black_knight_skeletal_gryphon;
|
||||
NewScript->RegisterSelf();
|
||||
}
|
||||
|
||||
+790
-379
File diff suppressed because it is too large
Load Diff
+204
-213
@@ -1,4 +1,6 @@
|
||||
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
|
||||
/*
|
||||
* Copyright (C) 2010 Trinity <http://www.trinitycore.org/>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
@@ -14,9 +16,9 @@
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
|
||||
/* ScriptData
|
||||
SDName: Instance_Trial_Of_the_Champion
|
||||
SD%Complete: 100
|
||||
SDName: Instance Trial of the Champion
|
||||
SDComment:
|
||||
SDCategory: Trial Of the Champion
|
||||
EndScriptData */
|
||||
@@ -24,41 +26,55 @@ EndScriptData */
|
||||
#include "ScriptedPch.h"
|
||||
#include "trial_of_the_champion.h"
|
||||
|
||||
#define MAX_ENCOUNTER 4
|
||||
|
||||
struct TRINITY_DLL_DECL instance_trial_of_the_champion : public ScriptedInstance
|
||||
{
|
||||
instance_trial_of_the_champion(Map* pMap) : ScriptedInstance(pMap), m_uiChampionsLootGUID(NULL), m_uiPaletressLootGUID(NULL), m_uiEadricLootGUID(NULL) { Initialize(); }
|
||||
instance_trial_of_the_champion(Map* pMap) : ScriptedInstance(pMap) {Initialize();}
|
||||
|
||||
uint32 m_auiEncounter[MAX_ENCOUNTER];
|
||||
std::string strInstData;
|
||||
|
||||
uint64 m_uiEadricGUID;
|
||||
uint64 m_uiPaletressGUID;
|
||||
uint64 m_uiBlackKnightGUID;
|
||||
uint64 m_uiJaerenGUID;
|
||||
uint64 m_uiArelasGUID;
|
||||
uint64 m_uiAnnouncerGUID;
|
||||
uint64 m_uiBlackKnightMinionGUID;
|
||||
uint64 m_uiArgentChallenger;
|
||||
uint64 m_uiMemoryGUID;
|
||||
uint8 uiMovementDone;
|
||||
uint8 uiGrandChampionsDeaths;
|
||||
uint8 uiArgentSoldierDeaths;
|
||||
|
||||
GameObject* m_uiChampionsLootGUID;
|
||||
GameObject* m_uiPaletressLootGUID;
|
||||
GameObject* m_uiEadricLootGUID;
|
||||
uint64 uiAnnouncerGUID;
|
||||
uint64 uiMainGateGUID;
|
||||
uint64 uiGrandChampionVehicle1GUID;
|
||||
uint64 uiGrandChampionVehicle2GUID;
|
||||
uint64 uiGrandChampionVehicle3GUID;
|
||||
uint64 uiGrandChampion1GUID;
|
||||
uint64 uiGrandChampion2GUID;
|
||||
uint64 uiGrandChampion3GUID;
|
||||
uint64 uiChampionLootGUID;
|
||||
uint64 uiArgentChampionGUID;
|
||||
|
||||
std::list<uint64> VehicleList;
|
||||
|
||||
std::string str_data;
|
||||
|
||||
bool bDone;
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
m_uiChampionsLootGUID = 0;
|
||||
m_uiEadricGUID = 0;
|
||||
m_uiEadricLootGUID = 0;
|
||||
m_uiPaletressGUID = 0;
|
||||
m_uiPaletressLootGUID = 0;
|
||||
m_uiBlackKnightGUID = 0;
|
||||
m_uiJaerenGUID = 0;
|
||||
m_uiArelasGUID = 0;
|
||||
m_uiAnnouncerGUID = 0;
|
||||
m_uiBlackKnightMinionGUID = 0;
|
||||
m_uiArgentChallenger = 0;
|
||||
m_uiMemoryGUID = 0;
|
||||
uiMovementDone = 0;
|
||||
uiGrandChampionsDeaths = 0;
|
||||
uiArgentSoldierDeaths = 0;
|
||||
|
||||
uiAnnouncerGUID = 0;
|
||||
uiMainGateGUID = 0;
|
||||
uiGrandChampionVehicle1GUID = 0;
|
||||
uiGrandChampionVehicle2GUID = 0;
|
||||
uiGrandChampionVehicle3GUID = 0;
|
||||
uiGrandChampion1GUID = 0;
|
||||
uiGrandChampion2GUID = 0;
|
||||
uiGrandChampion3GUID = 0;
|
||||
uiChampionLootGUID = 0;
|
||||
uiArgentChampionGUID = 0;
|
||||
|
||||
bDone = false;
|
||||
|
||||
VehicleList.clear();
|
||||
|
||||
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
|
||||
}
|
||||
@@ -84,252 +100,227 @@ struct TRINITY_DLL_DECL instance_trial_of_the_champion : public ScriptedInstance
|
||||
if (Player* pPlayer = players.begin()->getSource())
|
||||
TeamInInstance = pPlayer->GetTeam();
|
||||
}
|
||||
|
||||
switch(pCreature->GetEntry())
|
||||
{
|
||||
|
||||
// Champions
|
||||
case NPC_MOKRA:
|
||||
case VEHICLE_MOKRA_SKILLCRUSHER_MOUNT:
|
||||
if (TeamInInstance == HORDE)
|
||||
pCreature->UpdateEntry(NPC_JACOB, ALLIANCE);
|
||||
pCreature->UpdateEntry(VEHICLE_MARSHAL_JACOB_ALERIUS_MOUNT, ALLIANCE);
|
||||
break;
|
||||
case NPC_ERESSEA:
|
||||
case VEHICLE_ERESSEA_DAWNSINGER_MOUNT:
|
||||
if (TeamInInstance == HORDE)
|
||||
pCreature->UpdateEntry(NPC_AMBROSE, ALLIANCE);
|
||||
pCreature->UpdateEntry(VEHICLE_AMBROSE_BOLTSPARK_MOUNT, ALLIANCE);
|
||||
break;
|
||||
case NPC_RUNOK:
|
||||
case VEHICLE_RUNOK_WILDMANE_MOUNT:
|
||||
if (TeamInInstance == HORDE)
|
||||
pCreature->UpdateEntry(NPC_COLOSOS, ALLIANCE);
|
||||
pCreature->UpdateEntry(VEHICLE_COLOSOS_MOUNT, ALLIANCE);
|
||||
break;
|
||||
case NPC_ZULTORE:
|
||||
case VEHICLE_ZUL_TORE_MOUNT:
|
||||
if (TeamInInstance == HORDE)
|
||||
pCreature->UpdateEntry(NPC_JAELYNE, ALLIANCE);
|
||||
pCreature->UpdateEntry(VEHICLE_EVENSONG_MOUNT, ALLIANCE);
|
||||
break;
|
||||
case NPC_VISCERI:
|
||||
case VEHICLE_DEATHSTALKER_VESCERI_MOUNT:
|
||||
if (TeamInInstance == HORDE)
|
||||
pCreature->UpdateEntry(NPC_LANA, ALLIANCE);
|
||||
pCreature->UpdateEntry(VEHICLE_LANA_STOUTHAMMER_MOUNT, ALLIANCE);
|
||||
break;
|
||||
|
||||
// Argent Challenge
|
||||
case NPC_EADRIC:
|
||||
m_uiEadricGUID = pCreature->GetGUID();
|
||||
m_uiArgentChallenger = pCreature->GetGUID();
|
||||
break;
|
||||
case NPC_PALETRESS:
|
||||
m_uiPaletressGUID = pCreature->GetGUID();
|
||||
m_uiArgentChallenger = pCreature->GetGUID();
|
||||
break;
|
||||
|
||||
// Black Knight
|
||||
case NPC_BLACK_KNIGHT:
|
||||
m_uiBlackKnightGUID = pCreature->GetGUID();
|
||||
break;
|
||||
case NPC_RISEN_JAEREN:
|
||||
m_uiBlackKnightMinionGUID = pCreature->GetGUID();
|
||||
break;
|
||||
case NPC_RISEN_ARELAS:
|
||||
m_uiBlackKnightMinionGUID = pCreature->GetGUID();
|
||||
break;
|
||||
|
||||
// Coliseum Announcers
|
||||
// Coliseum Announcer || Just NPC_JAEREN must be spawned.
|
||||
case NPC_JAEREN:
|
||||
m_uiJaerenGUID = pCreature->GetGUID();
|
||||
uiAnnouncerGUID = pCreature->GetGUID();
|
||||
if (TeamInInstance == ALLIANCE)
|
||||
pCreature->UpdateEntry(NPC_ARELAS,ALLIANCE);
|
||||
break;
|
||||
case NPC_ARELAS:
|
||||
m_uiArelasGUID = pCreature->GetGUID();
|
||||
case VEHICLE_ARGENT_WARHORSE:
|
||||
case VEHICLE_ARGENT_BATTLEWORG:
|
||||
VehicleList.push_back(pCreature->GetGUID());
|
||||
break;
|
||||
|
||||
// memories
|
||||
case MEMORY_ALGALON:
|
||||
m_uiMemoryGUID = pCreature->GetGUID();
|
||||
break;
|
||||
case MEMORY_ARCHIMONDE:
|
||||
m_uiMemoryGUID = pCreature->GetGUID();
|
||||
break;
|
||||
case MEMORY_CHROMAGGUS:
|
||||
m_uiMemoryGUID = pCreature->GetGUID();
|
||||
break;
|
||||
case MEMORY_CYANIGOSA:
|
||||
m_uiMemoryGUID = pCreature->GetGUID();
|
||||
break;
|
||||
case MEMORY_DELRISSA:
|
||||
m_uiMemoryGUID = pCreature->GetGUID();
|
||||
break;
|
||||
case MEMORY_ECK:
|
||||
m_uiMemoryGUID = pCreature->GetGUID();
|
||||
break;
|
||||
case MEMORY_ENTROPIUS:
|
||||
m_uiMemoryGUID = pCreature->GetGUID();
|
||||
break;
|
||||
case MEMORY_GRUUL:
|
||||
m_uiMemoryGUID = pCreature->GetGUID();
|
||||
break;
|
||||
case MEMORY_HAKKAR:
|
||||
m_uiMemoryGUID = pCreature->GetGUID();
|
||||
break;
|
||||
case MEMORY_HEIGAN:
|
||||
m_uiMemoryGUID = pCreature->GetGUID();
|
||||
break;
|
||||
case MEMORY_HEROD:
|
||||
m_uiMemoryGUID = pCreature->GetGUID();
|
||||
break;
|
||||
case MEMORY_HOGGER:
|
||||
m_uiMemoryGUID = pCreature->GetGUID();
|
||||
break;
|
||||
case MEMORY_IGNIS:
|
||||
m_uiMemoryGUID = pCreature->GetGUID();
|
||||
break;
|
||||
case MEMORY_ILLIDAN:
|
||||
m_uiMemoryGUID = pCreature->GetGUID();
|
||||
break;
|
||||
case MEMORY_INGVAR:
|
||||
m_uiMemoryGUID = pCreature->GetGUID();
|
||||
break;
|
||||
case MEMORY_KALITHRESH:
|
||||
m_uiMemoryGUID = pCreature->GetGUID();
|
||||
break;
|
||||
case MEMORY_LUCIFRON:
|
||||
m_uiMemoryGUID = pCreature->GetGUID();
|
||||
break;
|
||||
case MEMORY_MALCHEZAAR:
|
||||
m_uiMemoryGUID = pCreature->GetGUID();
|
||||
break;
|
||||
case MEMORY_MUTANUS:
|
||||
m_uiMemoryGUID = pCreature->GetGUID();
|
||||
break;
|
||||
case MEMORY_ONYXIA:
|
||||
m_uiMemoryGUID = pCreature->GetGUID();
|
||||
break;
|
||||
case MEMORY_THUNDERAAN:
|
||||
m_uiMemoryGUID = pCreature->GetGUID();
|
||||
break;
|
||||
case MEMORY_VANCLEEF:
|
||||
m_uiMemoryGUID = pCreature->GetGUID();
|
||||
break;
|
||||
case MEMORY_VASHJ:
|
||||
m_uiMemoryGUID = pCreature->GetGUID();
|
||||
break;
|
||||
case MEMORY_VEKNILASH:
|
||||
m_uiMemoryGUID = pCreature->GetGUID();
|
||||
break;
|
||||
case MEMORY_VEZAX:
|
||||
m_uiMemoryGUID = pCreature->GetGUID();
|
||||
case NPC_EADRIC:
|
||||
case NPC_PALETRESS:
|
||||
uiArgentChampionGUID = pCreature->GetGUID();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void OnGameObjectCreate(GameObject* pGo, bool add)
|
||||
void OnGameObjectCreate(GameObject* pGO, bool bAdd)
|
||||
{
|
||||
switch(pGo->GetEntry())
|
||||
switch(pGO->GetEntry())
|
||||
{
|
||||
case GO_CHAMPIONS_LOOT: m_uiChampionsLootGUID = add ? pGo : NULL; break;
|
||||
case GO_EADRIC_LOOT: m_uiEadricLootGUID = add ? pGo : NULL; break;
|
||||
case GO_PALETRESS_LOOT: m_uiPaletressLootGUID = add ? pGo : NULL; break;
|
||||
case GO_CHAMPIONS_LOOT_H: m_uiChampionsLootGUID = add ? pGo : NULL; break;
|
||||
case GO_EADRIC_LOOT_H: m_uiEadricLootGUID = add ? pGo : NULL; break;
|
||||
case GO_PALETRESS_LOOT_H: m_uiPaletressLootGUID = add ? pGo : NULL; break;
|
||||
case GO_MAIN_GATE:
|
||||
uiMainGateGUID = pGO->GetGUID();
|
||||
break;
|
||||
case GO_CHAMPIONS_LOOT:
|
||||
case GO_CHAMPIONS_LOOT_H:
|
||||
uiChampionLootGUID = pGO->GetGUID();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void SetData(uint32 Type, uint32 Data)
|
||||
void SetData(uint32 uiType, uint32 uiData)
|
||||
{
|
||||
switch(Type)
|
||||
switch(uiType)
|
||||
{
|
||||
case DATA_TOC5_ANNOUNCER:
|
||||
m_uiAnnouncerGUID = Data;
|
||||
break;
|
||||
case DATA_BLACK_KNIGHT_MINION:
|
||||
m_uiBlackKnightMinionGUID = Data;
|
||||
break;
|
||||
case TYPE_GRAND_CHAMPIONS:
|
||||
if (Data == DONE)
|
||||
m_uiChampionsLootGUID->SetRespawnTime(m_uiChampionsLootGUID->GetRespawnDelay());
|
||||
m_auiEncounter[0] = Data;
|
||||
break;
|
||||
case TYPE_ARGENT_CHALLENGE:
|
||||
if (Data == DONE)
|
||||
case DATA_MOVEMENT_DONE:
|
||||
uiMovementDone = uiData;
|
||||
if (uiMovementDone == 3)
|
||||
{
|
||||
if(m_uiEadricGUID == m_uiArgentChallenger)
|
||||
m_uiEadricLootGUID->SetRespawnTime(m_uiEadricLootGUID->GetRespawnDelay());
|
||||
if(m_uiPaletressGUID == m_uiArgentChallenger)
|
||||
m_uiPaletressLootGUID->SetRespawnTime(m_uiPaletressLootGUID->GetRespawnDelay());
|
||||
if (Creature* pAnnouncer = instance->GetCreature(uiAnnouncerGUID))
|
||||
pAnnouncer->AI()->SetData(DATA_IN_POSITION,0);
|
||||
}
|
||||
m_auiEncounter[1] = Data;
|
||||
break;
|
||||
case TYPE_BLACK_KNIGHT:
|
||||
m_auiEncounter[2] = Data;
|
||||
case BOSS_GRAND_CHAMPIONS:
|
||||
m_auiEncounter[0] = uiData;
|
||||
if (uiData == IN_PROGRESS)
|
||||
{
|
||||
for(std::list<uint64>::iterator itr = VehicleList.begin(); itr != VehicleList.end(); ++itr)
|
||||
if (Creature* pSummon = instance->GetCreature(*itr))
|
||||
pSummon->RemoveFromWorld();
|
||||
}else if (uiData == DONE)
|
||||
{
|
||||
++uiGrandChampionsDeaths;
|
||||
if (uiGrandChampionsDeaths == 3)
|
||||
{
|
||||
if (Creature* pAnnouncer = instance->GetCreature(uiAnnouncerGUID))
|
||||
{
|
||||
pAnnouncer->GetMotionMaster()->MovePoint(0,748.309,619.487,411.171);
|
||||
pAnnouncer->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
pAnnouncer->SummonGameObject(instance->IsHeroic()? GO_CHAMPIONS_LOOT_H : GO_CHAMPIONS_LOOT,746.59,618.49,411.09,1.42,0, 0, 0, 0,90000000);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case DATA_ARGENT_SOLDIER_DEFEATED:
|
||||
uiArgentSoldierDeaths = uiData;
|
||||
if (uiArgentSoldierDeaths == 9)
|
||||
{
|
||||
if (Creature* pBoss = instance->GetCreature(uiArgentChampionGUID))
|
||||
{
|
||||
pBoss->GetMotionMaster()->MovePoint(0,746.88,618.74,411.06);
|
||||
pBoss->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE);
|
||||
pBoss->SetReactState(REACT_AGGRESSIVE);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case BOSS_ARGENT_CHALLENGE_E:
|
||||
m_auiEncounter[1] = uiData;
|
||||
if (Creature* pAnnouncer = instance->GetCreature(uiAnnouncerGUID))
|
||||
{
|
||||
pAnnouncer->GetMotionMaster()->MovePoint(0,748.309,619.487,411.171);
|
||||
pAnnouncer->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
pAnnouncer->SummonGameObject(instance->IsHeroic()? GO_EADRIC_LOOT_H : GO_EADRIC_LOOT,746.59,618.49,411.09,1.42,0, 0, 0, 0,90000000);
|
||||
}
|
||||
break;
|
||||
case BOSS_ARGENT_CHALLENGE_P:
|
||||
m_auiEncounter[2] = uiData;
|
||||
if (Creature* pAnnouncer = instance->GetCreature(uiAnnouncerGUID))
|
||||
{
|
||||
pAnnouncer->GetMotionMaster()->MovePoint(0,748.309,619.487,411.171);
|
||||
pAnnouncer->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
pAnnouncer->SummonGameObject(instance->IsHeroic()? GO_PALETRESS_LOOT_H : GO_PALETRESS_LOOT,746.59,618.49,411.09,1.42,0, 0, 0, 0,90000000);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (Data == DONE)
|
||||
{
|
||||
OUT_SAVE_INST_DATA;
|
||||
|
||||
std::ostringstream saveStream;
|
||||
saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2];
|
||||
|
||||
strInstData = saveStream.str();
|
||||
|
||||
if (uiData == DONE)
|
||||
SaveToDB();
|
||||
OUT_SAVE_INST_DATA_COMPLETE;
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 uiData)
|
||||
{
|
||||
switch(uiData)
|
||||
{
|
||||
case BOSS_GRAND_CHAMPIONS: return m_auiEncounter[0];
|
||||
case BOSS_ARGENT_CHALLENGE_E: return m_auiEncounter[1];
|
||||
case BOSS_ARGENT_CHALLENGE_P: return m_auiEncounter[2];
|
||||
case BOSS_BLACK_KNIGHT: return m_auiEncounter[3];
|
||||
|
||||
case DATA_MOVEMENT_DONE: return uiMovementDone;
|
||||
case DATA_ARGENT_SOLDIER_DEFEATED: return uiArgentSoldierDeaths;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint64 GetData64(uint32 uiData)
|
||||
{
|
||||
switch(uiData)
|
||||
{
|
||||
case DATA_MEMORY:
|
||||
return m_uiMemoryGUID;
|
||||
case DATA_BLACK_KNIGHT:
|
||||
return m_uiBlackKnightGUID;
|
||||
case DATA_ANNOUNCER: return uiAnnouncerGUID;
|
||||
case DATA_MAIN_GATE: return uiMainGateGUID;
|
||||
|
||||
case DATA_GRAND_CHAMPION_1: return uiGrandChampion1GUID;
|
||||
case DATA_GRAND_CHAMPION_2: return uiGrandChampion2GUID;
|
||||
case DATA_GRAND_CHAMPION_3: return uiGrandChampion3GUID;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void SetData64(uint32 uiType, uint64 uiData)
|
||||
{
|
||||
switch(uiType)
|
||||
{
|
||||
case DATA_GRAND_CHAMPION_1:
|
||||
uiGrandChampion1GUID = uiData;
|
||||
break;
|
||||
case DATA_GRAND_CHAMPION_2:
|
||||
uiGrandChampion2GUID = uiData;
|
||||
break;
|
||||
case DATA_GRAND_CHAMPION_3:
|
||||
uiGrandChampion3GUID = uiData;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
std::string GetSaveData()
|
||||
{
|
||||
return strInstData;
|
||||
OUT_SAVE_INST_DATA;
|
||||
|
||||
std::ostringstream saveStream;
|
||||
|
||||
saveStream << "T C " << m_auiEncounter[0]
|
||||
<< " " << m_auiEncounter[1]
|
||||
<< " " << m_auiEncounter[2]
|
||||
<< " " << m_auiEncounter[3]
|
||||
<< " " << uiGrandChampionsDeaths
|
||||
<< " " << uiMovementDone;
|
||||
|
||||
str_data = saveStream.str();
|
||||
|
||||
OUT_SAVE_INST_DATA_COMPLETE;
|
||||
return str_data;
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 uiType)
|
||||
void Load(const char* in)
|
||||
{
|
||||
switch(uiType)
|
||||
{
|
||||
case DATA_BLACK_KNIGHT_MINION:
|
||||
return m_uiBlackKnightMinionGUID;
|
||||
case DATA_TOC5_ANNOUNCER:
|
||||
return m_uiAnnouncerGUID;
|
||||
case DATA_JAEREN:
|
||||
return m_uiJaerenGUID;
|
||||
case DATA_ARELAS:
|
||||
return m_uiArelasGUID;
|
||||
case TYPE_GRAND_CHAMPIONS:
|
||||
case TYPE_ARGENT_CHALLENGE:
|
||||
case TYPE_BLACK_KNIGHT:
|
||||
return m_auiEncounter[uiType];
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Load(const char *chrIn)
|
||||
{
|
||||
if (!chrIn)
|
||||
if (!in)
|
||||
{
|
||||
OUT_LOAD_INST_DATA_FAIL;
|
||||
return;
|
||||
}
|
||||
|
||||
OUT_LOAD_INST_DATA(chrIn);
|
||||
OUT_LOAD_INST_DATA(in);
|
||||
|
||||
std::istringstream loadStream(chrIn);
|
||||
loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2];
|
||||
char dataHead1, dataHead2;
|
||||
uint16 data0, data1, data2, data3, data4, data5;
|
||||
|
||||
std::istringstream loadStream(in);
|
||||
loadStream >> dataHead1 >> dataHead2 >> data0 >> data1 >> data2 >> data3 >> data4 >> data5;
|
||||
|
||||
if (dataHead1 == 'T' && dataHead2 == 'C')
|
||||
{
|
||||
m_auiEncounter[0] = data0;
|
||||
m_auiEncounter[1] = data1;
|
||||
m_auiEncounter[2] = data2;
|
||||
m_auiEncounter[3] = data3;
|
||||
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
|
||||
if (m_auiEncounter[i] == IN_PROGRESS)
|
||||
m_auiEncounter[i] = NOT_STARTED;
|
||||
|
||||
uiGrandChampionsDeaths = data4;
|
||||
uiMovementDone = data5;
|
||||
} else OUT_LOAD_INST_DATA_FAIL;
|
||||
|
||||
OUT_LOAD_INST_DATA_COMPLETE;
|
||||
}
|
||||
};
|
||||
|
||||
+425
-48
@@ -1,4 +1,6 @@
|
||||
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
|
||||
/*
|
||||
* Copyright (C) 2010 Trinity <http://www.trinitycore.org/>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
@@ -16,107 +18,482 @@
|
||||
|
||||
/* ScriptData
|
||||
SDName: Trial Of the Champion
|
||||
SD%Complete: 80%
|
||||
SDComment: event script
|
||||
SD%Complete:
|
||||
SDComment:
|
||||
SDCategory: trial_of_the_champion
|
||||
EndScriptData */
|
||||
|
||||
/* ContentData
|
||||
npc_toc5_announcer
|
||||
npc_announcer_toc5
|
||||
EndContentData */
|
||||
|
||||
#include "ScriptedPch.h"
|
||||
#include "trial_of_the_champion.h"
|
||||
#include "Vehicle.h"
|
||||
|
||||
#define GOSSIP_START_EVENT1 "I'm ready to start challenge."
|
||||
#define GOSSIP_START_EVENT2 "I'm ready for the next challenge."
|
||||
|
||||
#define ORIENTATION 4.714
|
||||
|
||||
/*######
|
||||
## npc_toc5_announcer
|
||||
## npc_announcer_toc5
|
||||
######*/
|
||||
|
||||
struct TRINITY_DLL_DECL npc_toc5_announcerAI : public ScriptedAI
|
||||
const Position SpawnPosition = {746.261,657.401,411.681,4.65};
|
||||
|
||||
struct TRINITY_DLL_DECL npc_announcer_toc5AI : public ScriptedAI
|
||||
{
|
||||
npc_toc5_announcerAI(Creature* pCreature) : ScriptedAI(pCreature)
|
||||
npc_announcer_toc5AI(Creature* pCreature) : ScriptedAI(pCreature)
|
||||
{
|
||||
pInstance = (ScriptedInstance*)pCreature->GetInstanceData();
|
||||
Reset();
|
||||
pInstance = pCreature->GetInstanceData();
|
||||
|
||||
uiSummonTimes = 0;
|
||||
uiPosition = 0;
|
||||
uiLesserChampions = 0;
|
||||
|
||||
uiFirstBoss = 0;
|
||||
uiSecondBoss = 0;
|
||||
uiThirdBoss = 0;
|
||||
|
||||
uiArgentChampion = 0;
|
||||
|
||||
uiPhase = 0;
|
||||
uiTimer = 0;
|
||||
|
||||
uiVehicle1GUID = 0;
|
||||
uiVehicle2GUID = 0;
|
||||
uiVehicle3GUID = 0;
|
||||
|
||||
Champion1List.clear();
|
||||
Champion2List.clear();
|
||||
Champion3List.clear();
|
||||
|
||||
m_creature->SetReactState(REACT_PASSIVE);
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE);
|
||||
m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
|
||||
SetGrandChampionsForEncounter();
|
||||
SetArgentChampion();
|
||||
}
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
uint32 chmp1, chmp2, chmp3, argent;
|
||||
uint8 uiSummonTimes;
|
||||
uint8 uiPosition;
|
||||
uint8 uiLesserChampions;
|
||||
|
||||
void Reset()
|
||||
uint32 uiArgentChampion;
|
||||
|
||||
uint32 uiFirstBoss;
|
||||
uint32 uiSecondBoss;
|
||||
uint32 uiThirdBoss;
|
||||
|
||||
uint32 uiPhase;
|
||||
uint32 uiTimer;
|
||||
|
||||
uint64 uiVehicle1GUID;
|
||||
uint64 uiVehicle2GUID;
|
||||
uint64 uiVehicle3GUID;
|
||||
|
||||
uint64 uiGrandChampionBoss1;
|
||||
|
||||
std::list<uint64> Champion1List;
|
||||
std::list<uint64> Champion2List;
|
||||
std::list<uint64> Champion3List;
|
||||
|
||||
void NextStep(uint32 uiTimerStep,bool bNextStep = true,uint8 uiPhaseStep = 0)
|
||||
{
|
||||
uiTimer = uiTimerStep;
|
||||
if (bNextStep)
|
||||
++uiPhase;
|
||||
else
|
||||
uiPhase = uiPhaseStep;
|
||||
}
|
||||
|
||||
void StartEvent(Player* pPlayer)
|
||||
void SetData(uint32 uiType, uint32 uiData)
|
||||
{
|
||||
switch (uiType)
|
||||
{
|
||||
case DATA_START:
|
||||
DoSummonGrandChampion(uiFirstBoss);
|
||||
NextStep(10000,false,1);
|
||||
break;
|
||||
case DATA_IN_POSITION: //movement done.
|
||||
m_creature->GetMotionMaster()->MovePoint(1,735.81,661.92,412.39);
|
||||
if (GameObject* pGO = GameObject::GetGameObject(*m_creature, pInstance->GetData64(DATA_MAIN_GATE)))
|
||||
pInstance->HandleGameObject(pGO->GetGUID(),false);
|
||||
NextStep(10000,false,3);
|
||||
break;
|
||||
case DATA_LESSER_CHAMPIONS_DEFEATED:
|
||||
{
|
||||
++uiLesserChampions;
|
||||
std::list<uint64> TempList;
|
||||
if (uiLesserChampions == 3 || uiLesserChampions == 6)
|
||||
{
|
||||
switch(uiLesserChampions)
|
||||
{
|
||||
case 3:
|
||||
TempList = Champion2List;
|
||||
break;
|
||||
case 6:
|
||||
TempList = Champion3List;
|
||||
break;
|
||||
}
|
||||
|
||||
for(std::list<uint64>::iterator itr = TempList.begin(); itr != TempList.end(); ++itr)
|
||||
if (Creature* pSummon = Unit::GetCreature(*m_creature, *itr))
|
||||
AggroAllPlayers(pSummon);
|
||||
}else if (uiLesserChampions == 9)
|
||||
StartGrandChampionsAttack();
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void StartGrandChampionsAttack()
|
||||
{
|
||||
Creature* pGrandChampion1 = Unit::GetCreature(*m_creature, uiVehicle1GUID);
|
||||
Creature* pGrandChampion2 = Unit::GetCreature(*m_creature, uiVehicle2GUID);
|
||||
Creature* pGrandChampion3 = Unit::GetCreature(*m_creature, uiVehicle3GUID);
|
||||
|
||||
if (pGrandChampion1 && pGrandChampion2 && pGrandChampion3)
|
||||
{
|
||||
AggroAllPlayers(pGrandChampion1);
|
||||
AggroAllPlayers(pGrandChampion2);
|
||||
AggroAllPlayers(pGrandChampion3);
|
||||
}
|
||||
}
|
||||
|
||||
void MovementInform(uint32 uiType, uint32 uiPointId)
|
||||
{
|
||||
if (uiType != POINT_MOTION_TYPE)
|
||||
return;
|
||||
|
||||
if (uiPointId == 1)
|
||||
{
|
||||
m_creature->SetOrientation(ORIENTATION);
|
||||
m_creature->SendMovementFlagUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
void DoSummonGrandChampion(uint32 uiBoss)
|
||||
{
|
||||
++uiSummonTimes;
|
||||
uint32 VEHICLE_TO_SUMMON1 = 0;
|
||||
uint32 VEHICLE_TO_SUMMON2 = 0;
|
||||
switch(uiBoss)
|
||||
{
|
||||
case 0:
|
||||
VEHICLE_TO_SUMMON1 = VEHICLE_MOKRA_SKILLCRUSHER_MOUNT;
|
||||
VEHICLE_TO_SUMMON2 = VEHICLE_ORGRIMMAR_WOLF;
|
||||
break;
|
||||
case 1:
|
||||
VEHICLE_TO_SUMMON1 = VEHICLE_ERESSEA_DAWNSINGER_MOUNT;
|
||||
VEHICLE_TO_SUMMON2 = VEHICLE_SILVERMOON_HAWKSTRIDER;
|
||||
break;
|
||||
case 2:
|
||||
VEHICLE_TO_SUMMON1 = VEHICLE_RUNOK_WILDMANE_MOUNT;
|
||||
VEHICLE_TO_SUMMON2 = VEHICLE_THUNDER_BLUFF_KODO;
|
||||
break;
|
||||
case 3:
|
||||
VEHICLE_TO_SUMMON1 = VEHICLE_ZUL_TORE_MOUNT;
|
||||
VEHICLE_TO_SUMMON2 = VEHICLE_DARKSPEAR_RAPTOR;
|
||||
break;
|
||||
case 4:
|
||||
VEHICLE_TO_SUMMON1 = VEHICLE_DEATHSTALKER_VESCERI_MOUNT;
|
||||
VEHICLE_TO_SUMMON2 = VEHICLE_FORSAKE_WARHORSE;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
if (Creature* pBoss = m_creature->SummonCreature(VEHICLE_TO_SUMMON1,SpawnPosition))
|
||||
{
|
||||
switch(uiSummonTimes)
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
uiVehicle1GUID = pBoss->GetGUID();
|
||||
uint64 uiGrandChampionBoss1 = 0;
|
||||
if (Creature* pBoss = Unit::GetCreature(*m_creature, uiVehicle1GUID))
|
||||
if (Vehicle* pVehicle = pBoss->GetVehicleKit())
|
||||
if (Unit* pUnit = pVehicle->GetPassenger(0))
|
||||
uiGrandChampionBoss1 = pUnit->GetGUID();
|
||||
if (pInstance)
|
||||
{
|
||||
pInstance->SetData64(DATA_GRAND_CHAMPION_VEHICLE_1,uiVehicle1GUID);
|
||||
pInstance->SetData64(DATA_GRAND_CHAMPION_1,uiGrandChampionBoss1);
|
||||
}
|
||||
pBoss->AI()->SetData(1,0);
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
uiVehicle2GUID = pBoss->GetGUID();
|
||||
uint64 uiGrandChampionBoss2 = 0;
|
||||
if (Creature* pBoss = Unit::GetCreature(*m_creature, uiVehicle2GUID))
|
||||
if (Vehicle* pVehicle = pBoss->GetVehicleKit())
|
||||
if (Unit* pUnit = pVehicle->GetPassenger(0))
|
||||
uiGrandChampionBoss2 = pUnit->GetGUID();
|
||||
if (pInstance)
|
||||
{
|
||||
pInstance->SetData64(DATA_GRAND_CHAMPION_VEHICLE_2,uiVehicle2GUID);
|
||||
pInstance->SetData64(DATA_GRAND_CHAMPION_2,uiGrandChampionBoss2);
|
||||
}
|
||||
pBoss->AI()->SetData(2,0);
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
uiVehicle3GUID = pBoss->GetGUID();
|
||||
uint64 uiGrandChampionBoss3 = 0;
|
||||
if (Creature* pBoss = Unit::GetCreature(*m_creature, uiVehicle3GUID))
|
||||
if (Vehicle* pVehicle = pBoss->GetVehicleKit())
|
||||
if (Unit* pUnit = pVehicle->GetPassenger(0))
|
||||
uiGrandChampionBoss3 = pUnit->GetGUID();
|
||||
if (pInstance)
|
||||
{
|
||||
pInstance->SetData64(DATA_GRAND_CHAMPION_VEHICLE_3,uiVehicle3GUID);
|
||||
pInstance->SetData64(DATA_GRAND_CHAMPION_3,uiGrandChampionBoss3);
|
||||
}
|
||||
pBoss->AI()->SetData(3,0);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
{
|
||||
if (Creature* pAdd = m_creature->SummonCreature(VEHICLE_TO_SUMMON2,SpawnPosition,TEMPSUMMON_CORPSE_DESPAWN))
|
||||
{
|
||||
switch(uiSummonTimes)
|
||||
{
|
||||
case 1:
|
||||
Champion1List.push_back(pAdd->GetGUID());
|
||||
break;
|
||||
case 2:
|
||||
Champion2List.push_back(pAdd->GetGUID());
|
||||
break;
|
||||
case 3:
|
||||
Champion3List.push_back(pAdd->GetGUID());
|
||||
break;
|
||||
}
|
||||
|
||||
switch(i)
|
||||
{
|
||||
case 0:
|
||||
pAdd->GetMotionMaster()->MoveFollow(pBoss,2.0f,M_PI);
|
||||
break;
|
||||
case 1:
|
||||
pAdd->GetMotionMaster()->MoveFollow(pBoss,2.0f,M_PI / 2);
|
||||
break;
|
||||
case 2:
|
||||
pAdd->GetMotionMaster()->MoveFollow(pBoss,2.0f,M_PI / 2 + M_PI);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DoStartArgentChampionEncounter()
|
||||
{
|
||||
m_creature->GetMotionMaster()->MovePoint(1,735.81,661.92,412.39);
|
||||
|
||||
if (Creature* pBoss = m_creature->SummonCreature(uiArgentChampion,SpawnPosition))
|
||||
{
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
{
|
||||
if (Creature* pTrash = m_creature->SummonCreature(NPC_ARGENT_LIGHWIELDER,SpawnPosition))
|
||||
pTrash->AI()->SetData(i,0);
|
||||
if (Creature* pTrash = m_creature->SummonCreature(NPC_ARGENT_MONK,SpawnPosition))
|
||||
pTrash->AI()->SetData(i,0);
|
||||
if (Creature* pTrash = m_creature->SummonCreature(NPC_PRIESTESS,SpawnPosition))
|
||||
pTrash->AI()->SetData(i,0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SetGrandChampionsForEncounter()
|
||||
{
|
||||
uiFirstBoss = urand(0,4);
|
||||
|
||||
while(uiSecondBoss == uiFirstBoss || uiThirdBoss == uiFirstBoss || uiThirdBoss == uiSecondBoss)
|
||||
{
|
||||
uiSecondBoss = urand(0,4);
|
||||
uiThirdBoss = urand(0,4);
|
||||
}
|
||||
}
|
||||
|
||||
void SetArgentChampion()
|
||||
{
|
||||
uint8 uiTempBoss = urand(0,1);
|
||||
|
||||
switch(uiTempBoss)
|
||||
{
|
||||
case 0:
|
||||
uiArgentChampion = NPC_EADRIC;
|
||||
break;
|
||||
case 1:
|
||||
uiArgentChampion = NPC_PALETRESS;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void StartEncounter()
|
||||
{
|
||||
if (!pInstance)
|
||||
return;
|
||||
if(pInstance->GetData(TYPE_GRAND_CHAMPIONS) == NOT_STARTED && pInstance->GetData(TYPE_ARGENT_CHALLENGE) == NOT_STARTED && pInstance->GetData(TYPE_BLACK_KNIGHT) == NOT_STARTED)
|
||||
|
||||
m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
|
||||
if (pInstance->GetData(BOSS_BLACK_KNIGHT) == NOT_STARTED)
|
||||
{
|
||||
chmp1 = RAND(35572,35569,35571,35570,35617);
|
||||
chmp2 = RAND(35572,35569,35571,35570,35617);
|
||||
chmp3 = RAND(35572,35569,35571,35570,35617);
|
||||
if(chmp1 != chmp2 && chmp2 != chmp3 && chmp1 != chmp3)
|
||||
if (pInstance->GetData(BOSS_ARGENT_CHALLENGE_E) == NOT_STARTED && pInstance->GetData(BOSS_ARGENT_CHALLENGE_P) == NOT_STARTED)
|
||||
{
|
||||
m_creature->SummonCreature(chmp1, 738.665771, 661.031433, 412.394623, 4.698702, TEMPSUMMON_MANUAL_DESPAWN, 0);
|
||||
m_creature->SummonCreature(chmp2, 746.864441, 660.918762, 411.695465, 4.698700, TEMPSUMMON_MANUAL_DESPAWN, 0);
|
||||
m_creature->SummonCreature(chmp3, 754.360779, 660.816162, 412.395996, 4.698700, TEMPSUMMON_MANUAL_DESPAWN, 0);
|
||||
pInstance->SetData(TYPE_GRAND_CHAMPIONS, IN_PROGRESS);
|
||||
} else return;
|
||||
if (pInstance->GetData(BOSS_GRAND_CHAMPIONS) == NOT_STARTED)
|
||||
m_creature->AI()->SetData(DATA_START,0);
|
||||
|
||||
if (pInstance->GetData(BOSS_GRAND_CHAMPIONS) == DONE)
|
||||
DoStartArgentChampionEncounter();
|
||||
}
|
||||
|
||||
if(pInstance->GetData(TYPE_GRAND_CHAMPIONS) == DONE && pInstance->GetData(TYPE_ARGENT_CHALLENGE) == NOT_STARTED && pInstance->GetData(TYPE_BLACK_KNIGHT) == NOT_STARTED)
|
||||
{
|
||||
argent = RAND(35119,34928);
|
||||
m_creature->SummonCreature(argent, 746.864441, 660.918762, 411.695465, 4.698700, TEMPSUMMON_MANUAL_DESPAWN, 0);
|
||||
pInstance->SetData(TYPE_ARGENT_CHALLENGE, IN_PROGRESS);
|
||||
}
|
||||
|
||||
if(pInstance->GetData(TYPE_GRAND_CHAMPIONS) == DONE && pInstance->GetData(TYPE_ARGENT_CHALLENGE) == DONE && pInstance->GetData(TYPE_BLACK_KNIGHT) == NOT_STARTED)
|
||||
{
|
||||
m_creature->SummonCreature(NPC_BLACK_KNIGHT, 746.864441, 660.918762, 411.695465, 4.698700, TEMPSUMMON_MANUAL_DESPAWN, 0);
|
||||
pInstance->SetData(TYPE_BLACK_KNIGHT, IN_PROGRESS);
|
||||
m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||
if (pInstance->GetData(BOSS_GRAND_CHAMPIONS) == DONE &&
|
||||
pInstance->GetData(BOSS_ARGENT_CHALLENGE_E) == DONE ||
|
||||
pInstance->GetData(BOSS_ARGENT_CHALLENGE_P) == DONE)
|
||||
m_creature->SummonCreature(VEHICLE_BLACK_KNIGHT,769.834,651.915,447.035,0);
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
void AggroAllPlayers(Creature* pTemp)
|
||||
{
|
||||
Map::PlayerList const &PlList = m_creature->GetMap()->GetPlayers();
|
||||
|
||||
if(PlList.isEmpty())
|
||||
return;
|
||||
|
||||
for (Map::PlayerList::const_iterator i = PlList.begin(); i != PlList.end(); ++i)
|
||||
{
|
||||
if(Player* pPlayer = i->getSource())
|
||||
{
|
||||
if(pPlayer->isGameMaster())
|
||||
continue;
|
||||
|
||||
if(pPlayer->isAlive())
|
||||
{
|
||||
pTemp->SetHomePosition(m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),m_creature->GetOrientation());
|
||||
pTemp->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE);
|
||||
pTemp->SetReactState(REACT_AGGRESSIVE);
|
||||
pTemp->SetInCombatWith(pPlayer);
|
||||
pPlayer->SetInCombatWith(pTemp);
|
||||
pTemp->AddThreat(pPlayer, 0.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void UpdateAI(const uint32 uiDiff)
|
||||
{
|
||||
ScriptedAI::UpdateAI(uiDiff);
|
||||
|
||||
if (uiTimer <= uiDiff)
|
||||
{
|
||||
switch(uiPhase)
|
||||
{
|
||||
case 1:
|
||||
DoSummonGrandChampion(uiSecondBoss);
|
||||
NextStep(10000,true);
|
||||
break;
|
||||
case 2:
|
||||
DoSummonGrandChampion(uiThirdBoss);
|
||||
NextStep(0,false);
|
||||
break;
|
||||
case 3:
|
||||
if (!Champion1List.empty())
|
||||
{
|
||||
for(std::list<uint64>::iterator itr = Champion1List.begin(); itr != Champion1List.end(); ++itr)
|
||||
if (Creature* pSummon = Unit::GetCreature(*m_creature, *itr))
|
||||
AggroAllPlayers(pSummon);
|
||||
NextStep(0,false);
|
||||
}
|
||||
break;
|
||||
}
|
||||
} else uiTimer -= uiDiff;
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* pSummon)
|
||||
{
|
||||
if (pInstance && pInstance->GetData(BOSS_GRAND_CHAMPIONS) == NOT_STARTED)
|
||||
{
|
||||
pSummon->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE);
|
||||
pSummon->SetReactState(REACT_PASSIVE);
|
||||
}
|
||||
}
|
||||
|
||||
void SummonedCreatureDespawn(Creature* pSummon)
|
||||
{
|
||||
switch(pSummon->GetEntry())
|
||||
{
|
||||
case VEHICLE_DARNASSIA_NIGHTSABER:
|
||||
case VEHICLE_EXODAR_ELEKK:
|
||||
case VEHICLE_STORMWIND_STEED:
|
||||
case VEHICLE_GNOMEREGAN_MECHANOSTRIDER:
|
||||
case VEHICLE_IRONFORGE_RAM:
|
||||
case VEHICLE_FORSAKE_WARHORSE:
|
||||
case VEHICLE_THUNDER_BLUFF_KODO:
|
||||
case VEHICLE_ORGRIMMAR_WOLF:
|
||||
case VEHICLE_SILVERMOON_HAWKSTRIDER:
|
||||
case VEHICLE_DARKSPEAR_RAPTOR:
|
||||
m_creature->AI()->SetData(DATA_LESSER_CHAMPIONS_DEFEATED,0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_npc_toc5_announcer(Creature* pCreature)
|
||||
CreatureAI* GetAI_npc_announcer_toc5(Creature* pCreature)
|
||||
{
|
||||
return new npc_toc5_announcerAI(pCreature);
|
||||
return new npc_announcer_toc5AI(pCreature);
|
||||
}
|
||||
|
||||
bool GossipHello_npc_toc5_announcer(Player* pPlayer, Creature* pCreature)
|
||||
bool GossipHello_npc_announcer_toc5(Player* pPlayer, Creature* pCreature)
|
||||
{
|
||||
ScriptedInstance* pInstance = pCreature->GetInstanceData();
|
||||
|
||||
if(!pInstance)
|
||||
if (pInstance &&
|
||||
pInstance->GetData(BOSS_GRAND_CHAMPIONS) == DONE &&
|
||||
pInstance->GetData(BOSS_BLACK_KNIGHT) == DONE &&
|
||||
pInstance->GetData(BOSS_ARGENT_CHALLENGE_E) == DONE ||
|
||||
pInstance->GetData(BOSS_ARGENT_CHALLENGE_P) == DONE)
|
||||
return false;
|
||||
|
||||
if(pInstance->GetData(TYPE_GRAND_CHAMPIONS) == NOT_STARTED && pInstance->GetData(TYPE_ARGENT_CHALLENGE) == NOT_STARTED && pInstance->GetData(TYPE_BLACK_KNIGHT) == NOT_STARTED)
|
||||
if (pInstance &&
|
||||
pInstance->GetData(BOSS_GRAND_CHAMPIONS) == NOT_STARTED &&
|
||||
pInstance->GetData(BOSS_ARGENT_CHALLENGE_E) == NOT_STARTED &&
|
||||
pInstance->GetData(BOSS_ARGENT_CHALLENGE_P) == NOT_STARTED &&
|
||||
pInstance->GetData(BOSS_BLACK_KNIGHT) == NOT_STARTED)
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_START_EVENT1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
else
|
||||
else if (pInstance)
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_START_EVENT2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
|
||||
pPlayer->SEND_GOSSIP_MENU(pCreature->GetEntry(), pCreature->GetGUID());
|
||||
pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GossipSelect_npc_toc5_announcer(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
|
||||
bool GossipSelect_npc_announcer_toc5(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
|
||||
{
|
||||
if (uiAction == GOSSIP_ACTION_INFO_DEF+1)
|
||||
{
|
||||
pPlayer->CLOSE_GOSSIP_MENU();
|
||||
CAST_AI(npc_toc5_announcerAI, pCreature->AI())->StartEvent(pPlayer);
|
||||
CAST_AI(npc_announcer_toc5AI, pCreature->AI())->StartEncounter();
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -127,9 +504,9 @@ void AddSC_trial_of_the_champion()
|
||||
Script* NewScript;
|
||||
|
||||
NewScript = new Script;
|
||||
NewScript->Name = "npc_toc5_announcer";
|
||||
NewScript->GetAI = &GetAI_npc_toc5_announcer;
|
||||
NewScript->pGossipHello = &GossipHello_npc_toc5_announcer;
|
||||
NewScript->pGossipSelect = &GossipSelect_npc_toc5_announcer;
|
||||
NewScript->Name = "npc_announcer_toc5";
|
||||
NewScript->GetAI = &GetAI_npc_announcer_toc5;
|
||||
NewScript->pGossipHello = &GossipHello_npc_announcer_toc5;
|
||||
NewScript->pGossipSelect = &GossipSelect_npc_announcer_toc5;
|
||||
NewScript->RegisterSelf();
|
||||
}
|
||||
|
||||
+83
-46
@@ -5,74 +5,111 @@
|
||||
#ifndef DEF_TOC_H
|
||||
#define DEF_TOC_H
|
||||
|
||||
enum
|
||||
|
||||
enum eData
|
||||
{
|
||||
MAX_ENCOUNTER = 3,
|
||||
BOSS_GRAND_CHAMPIONS,
|
||||
BOSS_ARGENT_CHALLENGE_E,
|
||||
BOSS_ARGENT_CHALLENGE_P,
|
||||
BOSS_BLACK_KNIGHT,
|
||||
DATA_MOVEMENT_DONE,
|
||||
DATA_LESSER_CHAMPIONS_DEFEATED,
|
||||
DATA_START,
|
||||
DATA_IN_POSITION,
|
||||
DATA_ARGENT_SOLDIER_DEFEATED
|
||||
};
|
||||
|
||||
TYPE_GRAND_CHAMPIONS = 0,
|
||||
TYPE_ARGENT_CHALLENGE = 1,
|
||||
TYPE_BLACK_KNIGHT = 2,
|
||||
enum Data64
|
||||
{
|
||||
DATA_ANNOUNCER,
|
||||
DATA_MAIN_GATE,
|
||||
|
||||
DATA_BLACK_KNIGHT = 6,
|
||||
DATA_BLACK_KNIGHT_MINION = 7,
|
||||
DATA_TOC5_ANNOUNCER = 8,
|
||||
DATA_JAEREN = 9,
|
||||
DATA_ARELAS = 10,
|
||||
DATA_CHAMPIONID_1 = 11,
|
||||
DATA_CHAMPIONID_2 = 12,
|
||||
DATA_CHAMPIONID_3 = 13,
|
||||
DATA_MEMORY = 14,
|
||||
DATA_ARGENT_CHALLENGER = 15,
|
||||
DATA_GRAND_CHAMPION_VEHICLE_1,
|
||||
DATA_GRAND_CHAMPION_VEHICLE_2,
|
||||
DATA_GRAND_CHAMPION_VEHICLE_3,
|
||||
|
||||
NPC_JACOB = 34705,
|
||||
NPC_AMBROSE = 34702,
|
||||
NPC_COLOSOS = 34701,
|
||||
NPC_JAELYNE = 34657,
|
||||
NPC_LANA = 34703,
|
||||
DATA_GRAND_CHAMPION_1,
|
||||
DATA_GRAND_CHAMPION_2,
|
||||
DATA_GRAND_CHAMPION_3
|
||||
};
|
||||
|
||||
enum eNpcs
|
||||
{
|
||||
// Horde Champions
|
||||
NPC_MOKRA = 35572,
|
||||
NPC_ERESSEA = 35569,
|
||||
NPC_RUNOK = 35571,
|
||||
NPC_ZULTORE = 35570,
|
||||
NPC_VISCERI = 35617,
|
||||
|
||||
// Alliance Champions
|
||||
NPC_JACOB = 34705,
|
||||
NPC_AMBROSE = 34702,
|
||||
NPC_COLOSOS = 34701,
|
||||
NPC_JAELYNE = 34657,
|
||||
NPC_LANA = 34703,
|
||||
|
||||
NPC_EADRIC = 35119,
|
||||
NPC_PALETRESS = 34928,
|
||||
|
||||
NPC_ARGENT_LIGHWIELDER = 35309,
|
||||
NPC_ARGENT_MONK = 35305,
|
||||
NPC_PRIESTESS = 35307,
|
||||
|
||||
NPC_BLACK_KNIGHT = 35451,
|
||||
|
||||
NPC_RISEN_JAEREN = 35545,
|
||||
NPC_RISEN_ARELAS = 35564,
|
||||
|
||||
NPC_JAEREN = 35004,
|
||||
NPC_ARELAS = 35005,
|
||||
MEMORY_ALGALON = 35052,
|
||||
MEMORY_ARCHIMONDE = 35041,
|
||||
MEMORY_CHROMAGGUS = 35033,
|
||||
MEMORY_CYANIGOSA = 35046,
|
||||
MEMORY_DELRISSA = 35043,
|
||||
MEMORY_ECK = 35047,
|
||||
MEMORY_ENTROPIUS = 35044,
|
||||
MEMORY_GRUUL = 35039,
|
||||
MEMORY_HAKKAR = 35034,
|
||||
MEMORY_HEIGAN = 35049,
|
||||
MEMORY_HEROD = 35030,
|
||||
MEMORY_HOGGER = 34942,
|
||||
MEMORY_IGNIS = 35050,
|
||||
MEMORY_ILLIDAN = 35042,
|
||||
MEMORY_INGVAR = 35045,
|
||||
MEMORY_KALITHRESH = 35037,
|
||||
MEMORY_LUCIFRON = 35031,
|
||||
MEMORY_MALCHEZAAR = 35038,
|
||||
MEMORY_MUTANUS = 35029,
|
||||
MEMORY_ONYXIA = 35048,
|
||||
MEMORY_THUNDERAAN = 35032,
|
||||
MEMORY_VANCLEEF = 35028,
|
||||
MEMORY_VASHJ = 35040,
|
||||
MEMORY_VEKNILASH = 35036,
|
||||
MEMORY_VEZAX = 35051,
|
||||
NPC_ARELAS = 35005
|
||||
};
|
||||
|
||||
enum eGameObjects
|
||||
{
|
||||
GO_MAIN_GATE = 195647,
|
||||
|
||||
GO_CHAMPIONS_LOOT = 195709,
|
||||
GO_CHAMPIONS_LOOT_H = 195710,
|
||||
|
||||
GO_EADRIC_LOOT = 195374,
|
||||
GO_EADRIC_LOOT_H = 195375,
|
||||
|
||||
GO_PALETRESS_LOOT = 195323,
|
||||
GO_PALETRESS_LOOT_H = 195324
|
||||
};
|
||||
|
||||
enum eVehicles
|
||||
{
|
||||
//Grand Champions Alliance Vehicles
|
||||
VEHICLE_MARSHAL_JACOB_ALERIUS_MOUNT = 35637,
|
||||
VEHICLE_AMBROSE_BOLTSPARK_MOUNT = 35633,
|
||||
VEHICLE_COLOSOS_MOUNT = 35768,
|
||||
VEHICLE_EVENSONG_MOUNT = 34658,
|
||||
VEHICLE_LANA_STOUTHAMMER_MOUNT = 35636,
|
||||
//Faction Champions (ALLIANCE)
|
||||
VEHICLE_DARNASSIA_NIGHTSABER = 33298,
|
||||
VEHICLE_EXODAR_ELEKK = 33416,
|
||||
VEHICLE_STORMWIND_STEED = 33297,
|
||||
VEHICLE_GNOMEREGAN_MECHANOSTRIDER = 33301,
|
||||
VEHICLE_IRONFORGE_RAM = 33408,
|
||||
//Grand Champions Horde Vehicles
|
||||
VEHICLE_MOKRA_SKILLCRUSHER_MOUNT = 35638,
|
||||
VEHICLE_ERESSEA_DAWNSINGER_MOUNT = 35635,
|
||||
VEHICLE_RUNOK_WILDMANE_MOUNT = 35640,
|
||||
VEHICLE_ZUL_TORE_MOUNT = 35641,
|
||||
VEHICLE_DEATHSTALKER_VESCERI_MOUNT = 35634,
|
||||
//Faction Champions (HORDE)
|
||||
VEHICLE_FORSAKE_WARHORSE = 33414,
|
||||
VEHICLE_THUNDER_BLUFF_KODO = 33300,
|
||||
VEHICLE_ORGRIMMAR_WOLF = 33409,
|
||||
VEHICLE_SILVERMOON_HAWKSTRIDER = 33418,
|
||||
VEHICLE_DARKSPEAR_RAPTOR = 33299,
|
||||
|
||||
VEHICLE_ARGENT_WARHORSE = 35644,
|
||||
VEHICLE_ARGENT_BATTLEWORG = 36558,
|
||||
|
||||
VEHICLE_BLACK_KNIGHT = 35491
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user