mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-30 13:47:23 +01:00
*Update script of The Nexus 5er. By PSZ
*Thanks to onkelz28 for preparing the patch --HG-- branch : trunk
This commit is contained in:
@@ -270,6 +270,12 @@ scripts/zone/naxxramas/boss_sapphiron.cpp \
|
||||
scripts/zone/naxxramas/boss_thaddius.cpp \
|
||||
scripts/zone/naxxramas/instance_naxxramas.cpp \
|
||||
scripts/zone/netherstorm/netherstorm.cpp \
|
||||
scripts/zone/nexus/nexus/boss_magus_telestra.cpp \
|
||||
scripts/zone/nexus/nexus/boss_anomalus.cpp \
|
||||
scripts/zone/nexus/nexus/boss_ormorok.cpp \
|
||||
scripts/zone/nexus/nexus/boss_keristrasza.cpp \
|
||||
scripts/zone/nexus/nexus/def_nexus.h \
|
||||
scripts/zone/nexus/nexus/instance_nexus.cpp \
|
||||
scripts/zone/onyxias_lair/boss_onyxia.cpp \
|
||||
scripts/zone/orgrimmar/orgrimmar.cpp \
|
||||
scripts/zone/razorfen_downs/boss_amnennar_the_coldbringer.cpp \
|
||||
|
||||
@@ -401,6 +401,13 @@ extern void AddSC_instance_naxxramas();
|
||||
//Netherstorm
|
||||
extern void AddSC_netherstorm();
|
||||
|
||||
//The Nexus
|
||||
extern void AddSC_boss_magus_telestra();
|
||||
extern void AddSC_boss_anomalus();
|
||||
extern void AddSC_boss_ormorok();
|
||||
extern void AddSC_boss_keristrasza();
|
||||
extern void AddSC_instance_nexus();
|
||||
|
||||
//Onyxia's Lair
|
||||
extern void AddSC_boss_onyxia();
|
||||
|
||||
@@ -1286,6 +1293,13 @@ void ScriptsInit(char const* cfg_file = "trinitycore.conf")
|
||||
//Netherstorm
|
||||
AddSC_netherstorm();
|
||||
|
||||
//The Nexus
|
||||
AddSC_boss_magus_telestra();
|
||||
AddSC_boss_anomalus();
|
||||
AddSC_boss_ormorok();
|
||||
AddSC_boss_keristrasza();
|
||||
AddSC_instance_nexus();
|
||||
|
||||
//Onyxia's Lair
|
||||
AddSC_boss_onyxia();
|
||||
|
||||
|
||||
@@ -2514,22 +2514,30 @@
|
||||
<Filter
|
||||
Name="Nexus"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\scripts\zone\nexus\nexus\boss_anomalus.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\scripts\zone\nexus\nexus\boss_keristrasza.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\scripts\zone\nexus\nexus\boss_magus_telestra.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\scripts\zone\nexus\nexus\boss_ormorok.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\scripts\zone\nexus\nexus\boss_magus_telestra.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\scripts\zone\nexus\nexus\boss_anomalus.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\scripts\zone\nexus\nexus\boss_ormorok.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\scripts\zone\nexus\nexus\boss_keristrasza.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\scripts\zone\nexus\nexus\def_nexus.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\scripts\zone\nexus\nexus\instance_nexus.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\scripts\zone\nexus\nexus\commander_kolurg.cpp"
|
||||
>
|
||||
@@ -2538,10 +2546,6 @@
|
||||
RelativePath="..\scripts\zone\nexus\nexus\commander_stoutbeard.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\scripts\zone\nexus\nexus\def_nexus.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\scripts\zone\nexus\nexus\instance_nexus.cpp"
|
||||
>
|
||||
|
||||
@@ -2513,22 +2513,30 @@
|
||||
<Filter
|
||||
Name="Nexus"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\scripts\zone\nexus\nexus\boss_anomalus.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\scripts\zone\nexus\nexus\boss_keristrasza.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\scripts\zone\nexus\nexus\boss_magus_telestra.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\scripts\zone\nexus\nexus\boss_ormorok.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\scripts\zone\nexus\nexus\boss_magus_telestra.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\scripts\zone\nexus\nexus\boss_anomalus.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\scripts\zone\nexus\nexus\boss_ormorok.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\scripts\zone\nexus\nexus\boss_keristrasza.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\scripts\zone\nexus\nexus\def_nexus.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\scripts\zone\nexus\nexus\instance_nexus.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\scripts\zone\nexus\nexus\commander_kolurg.cpp"
|
||||
>
|
||||
@@ -2537,14 +2545,6 @@
|
||||
RelativePath="..\scripts\zone\nexus\nexus\commander_stoutbeard.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\scripts\zone\nexus\nexus\def_nexus.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\scripts\zone\nexus\nexus\instance_nexus.cpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Oculus"
|
||||
|
||||
@@ -1,121 +1,256 @@
|
||||
/* Script Data Start
|
||||
SDName: Boss anomalus
|
||||
SDAuthor: LordVanMartin
|
||||
SD%Complete:
|
||||
SDComment:
|
||||
SDCategory:
|
||||
Script Data End */
|
||||
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
|
||||
* 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
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/* ScriptData
|
||||
SDName: Boss_Anomalus
|
||||
SD%Complete:
|
||||
SDComment:
|
||||
SDCategory: The Nexus, The Nexus
|
||||
EndScriptData */
|
||||
|
||||
/*** SQL START ***
|
||||
update creature_template set scriptname = '' where entry = '';
|
||||
*** SQL END ***/
|
||||
#include "precompiled.h"
|
||||
#include "def_nexus.h"
|
||||
|
||||
//Spells
|
||||
#define SPELL_SPARK_1 47751
|
||||
#define SPELL_SPARK_2 57062
|
||||
#define SPELL_SPARK_N 47751
|
||||
#define SPELL_SPARK_H 57062
|
||||
#define SPELL_RIFT_SHIELD 47748
|
||||
#define SPELL_CHARGE_RIFT 47747
|
||||
#define SPELL_ARCANE_ATTRACTION 57063
|
||||
#define SPELL_CREATE_RIFT 47743 //Dummy ---> summons (npc 26918) "Chaotic Rift", which spawns "Crazed Mana Wraith"s (npc 26746)
|
||||
#define SPELL_CHARGE_RIFT 47747 //Works wrong (affect players, not rifts)
|
||||
#define SPELL_CREATE_RIFT 47743 //Don't work, using WA
|
||||
#define SPELL_ARCANE_ATTRACTION 57063 //No idea, when it's used
|
||||
|
||||
#define MOB_CRAZED_MANA_WRAITH 26746
|
||||
#define NPC_CHAOTIC_RIFT 26918
|
||||
#define MOB_CRAZED_MANA_WRAITH 26746
|
||||
#define MOB_CHAOTIC_RIFT 26918
|
||||
#define SPELL_CHAOTIC_ENERGY_BURST 47688
|
||||
#define SPELL_CHARGED_CHAOTIC_ENERGY_BURST 47737
|
||||
#define SPELL_ARCANEFORM 48019 //Chaotic Rift visual
|
||||
|
||||
//Yell
|
||||
#define SAY_AGGRO -1576000
|
||||
#define SAY_KILL -1576001
|
||||
#define SAY_DEATH -1576002
|
||||
#define SAY_RIFT -1576003
|
||||
#define SAY_SHIELD -1576004
|
||||
#define SAY_AGGRO -1576010
|
||||
#define SAY_DEATH -1576011
|
||||
#define SAY_RIFT -1576012
|
||||
#define SAY_SHIELD -1576013
|
||||
|
||||
float RiftLocation[6][3]=
|
||||
{
|
||||
{652.64, -273.70, -8.75},
|
||||
{634.45, -265.94, -8.44},
|
||||
{620.73, -281.17, -9.02},
|
||||
{626.10, -304.67, -9.44},
|
||||
{639.87, -314.11, -9.49},
|
||||
{651.72, -297.44, -9.37}
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL boss_anomalusAI : public ScriptedAI
|
||||
{
|
||||
boss_anomalusAI(Creature *c) : ScriptedAI(c) {}
|
||||
boss_anomalusAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = ((ScriptedInstance*)c->GetInstanceData());
|
||||
Reset();
|
||||
HeroicMode = c->GetMap()->IsHeroic();
|
||||
}
|
||||
|
||||
void Reset() {}
|
||||
void EnterCombat(Unit* who)
|
||||
ScriptedInstance* pInstance;
|
||||
bool HeroicMode;
|
||||
|
||||
uint8 Phase;
|
||||
uint32 SPELL_SPARK_Timer;
|
||||
uint32 SPELL_CREATE_RIFT_Timer;
|
||||
uint64 ChaoticRiftGUID;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
Phase = 0;
|
||||
SPELL_SPARK_Timer = 5000;
|
||||
SPELL_CREATE_RIFT_Timer = 25000;
|
||||
ChaoticRiftGUID = 0;
|
||||
|
||||
if(pInstance)
|
||||
pInstance->SetData(DATA_ANOMALUS_EVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void Aggro(Unit* who)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, m_creature);
|
||||
}
|
||||
void AttackStart(Unit* who) {}
|
||||
void MoveInLineOfSight(Unit* who) {}
|
||||
void UpdateAI(const uint32 diff)
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if(!UpdateVictim())
|
||||
return;
|
||||
|
||||
//Source DBM
|
||||
if((((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 80) && ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) > 77))
|
||||
|| (((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 55) && ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) > 52))
|
||||
|| (((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 30) && ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) > 27)))
|
||||
if (!UpdateVictim())
|
||||
{
|
||||
//Summon rift at a random location
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_creature->HasAura(SPELL_RIFT_SHIELD))
|
||||
{
|
||||
Unit* Rift;
|
||||
if (ChaoticRiftGUID)
|
||||
Rift = Unit::GetUnit((*m_creature), ChaoticRiftGUID);
|
||||
if (Rift && Rift->isDead())
|
||||
{
|
||||
m_creature->RemoveAurasDueToSpell(SPELL_RIFT_SHIELD);
|
||||
ChaoticRiftGUID = 0;
|
||||
}
|
||||
return;
|
||||
} else
|
||||
ChaoticRiftGUID = 0;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
if ((Phase == 0) && (m_creature->GetHealth() < m_creature->GetMaxHealth() * 0.75))
|
||||
{
|
||||
Phase = 1;
|
||||
DoScriptText(SAY_SHIELD, m_creature);
|
||||
DoCast(m_creature, SPELL_RIFT_SHIELD);
|
||||
|
||||
int tmp = rand()%(2);
|
||||
Creature* Rift = m_creature->SummonCreature(MOB_CHAOTIC_RIFT, RiftLocation[tmp][0], RiftLocation[tmp][1], RiftLocation[tmp][2], 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000);
|
||||
if (Rift)
|
||||
{
|
||||
//DoCast(Rift, SPELL_CHARGE_RIFT);
|
||||
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
Rift->AI()->AttackStart(target);
|
||||
ChaoticRiftGUID = Rift->GetGUID();
|
||||
DoScriptText(SAY_RIFT , m_creature);
|
||||
}
|
||||
}
|
||||
|
||||
if ((Phase == 1) && (m_creature->GetHealth() < m_creature->GetMaxHealth() * 0.50))
|
||||
{
|
||||
Phase = 2;
|
||||
DoScriptText(SAY_SHIELD , m_creature);
|
||||
DoCast(m_creature,SPELL_RIFT_SHIELD);
|
||||
|
||||
int tmp = rand()%(2);
|
||||
Creature* Rift = m_creature->SummonCreature(MOB_CHAOTIC_RIFT, RiftLocation[tmp][0], RiftLocation[tmp][1], RiftLocation[tmp][2], 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000);
|
||||
if (Rift)
|
||||
{
|
||||
//DoCast(Rift, SPELL_CHARGE_RIFT);
|
||||
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
Rift->AI()->AttackStart(target);
|
||||
ChaoticRiftGUID = Rift->GetGUID();
|
||||
DoScriptText(SAY_RIFT , m_creature);
|
||||
}
|
||||
}
|
||||
|
||||
if ((Phase == 2) && (m_creature->GetHealth() < m_creature->GetMaxHealth() * 0.25))
|
||||
{
|
||||
Phase = 3;
|
||||
DoScriptText(SAY_SHIELD , m_creature);
|
||||
DoCast(m_creature,SPELL_RIFT_SHIELD);
|
||||
|
||||
int tmp = rand()%(2);
|
||||
Creature* Rift = m_creature->SummonCreature(MOB_CHAOTIC_RIFT, RiftLocation[tmp][0], RiftLocation[tmp][1], RiftLocation[tmp][2], 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000);
|
||||
if (Rift)
|
||||
{
|
||||
//DoCast(Rift, SPELL_CHARGE_RIFT);
|
||||
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
Rift->AI()->AttackStart(target);
|
||||
ChaoticRiftGUID = Rift->GetGUID();
|
||||
DoScriptText(SAY_RIFT , m_creature);
|
||||
}
|
||||
}
|
||||
|
||||
if (SPELL_SPARK_Timer < diff)
|
||||
{
|
||||
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, HeroicMode ? SPELL_SPARK_H : SPELL_SPARK_N);
|
||||
SPELL_SPARK_Timer = 5000;
|
||||
}else SPELL_SPARK_Timer -=diff;
|
||||
|
||||
if (SPELL_CREATE_RIFT_Timer < diff)
|
||||
{
|
||||
DoScriptText(SAY_RIFT , m_creature);
|
||||
|
||||
int tmp = rand()%(2);
|
||||
Creature* Rift = m_creature->SummonCreature(MOB_CHAOTIC_RIFT, RiftLocation[tmp][0], RiftLocation[tmp][1], RiftLocation[tmp][2], 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000);
|
||||
if (Rift)
|
||||
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
Rift->AI()->AttackStart(target);
|
||||
SPELL_CREATE_RIFT_Timer = 25000;
|
||||
}else SPELL_CREATE_RIFT_Timer -=diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
void JustDied(Unit* killer)
|
||||
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, m_creature);
|
||||
}
|
||||
void KilledUnit(Unit *victim)
|
||||
{
|
||||
if(victim == m_creature)
|
||||
return;
|
||||
DoScriptText(SAY_KILL, m_creature);
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_ANOMALUS_EVENT, DONE);
|
||||
}
|
||||
};
|
||||
|
||||
/*######
|
||||
## Crazed Mana Wraiths
|
||||
######*/
|
||||
#define SPELL_ARCANE_MISSILES 33833
|
||||
|
||||
struct TRINITY_DLL_DECL mob_crazed_mana_wraithAI : public ScriptedAI
|
||||
struct TRINITY_DLL_DECL mob_chaotic_riftAI : public Scripted_NoMovementAI
|
||||
{
|
||||
mob_crazed_mana_wraithAI(Creature *c) : ScriptedAI(c) {}
|
||||
mob_chaotic_riftAI(Creature *c) : Scripted_NoMovementAI(c)
|
||||
{
|
||||
pInstance = ((ScriptedInstance*)c->GetInstanceData());
|
||||
Reset();
|
||||
}
|
||||
|
||||
void Reset() {}
|
||||
void EnterCombat(Unit* who) {}
|
||||
void UpdateAI(const uint32 diff)
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
uint32 SPELL_CHAOTIC_ENERGY_BURST_Timer;
|
||||
uint32 SUMMON_CRAZED_MANA_WRAITH_Timer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
SPELL_CHAOTIC_ENERGY_BURST_Timer = 1000;
|
||||
SUMMON_CRAZED_MANA_WRAITH_Timer = 5000;
|
||||
m_creature->SetDisplayId(25206); //For some reason in DB models for ally and horde are different.
|
||||
//Model for ally (1126) does not show auras. Horde model works perfect.
|
||||
//Set model to horde number
|
||||
DoCast(m_creature, SPELL_ARCANEFORM, false);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if(!UpdateVictim())
|
||||
if (!UpdateVictim())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
void JustDied(Unit* killer) {}
|
||||
if (SPELL_CHAOTIC_ENERGY_BURST_Timer < diff)
|
||||
{
|
||||
Unit* Anomalus = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_ANOMALUS));
|
||||
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
if (Anomalus && Anomalus->HasAura(SPELL_RIFT_SHIELD))
|
||||
DoCast(target, SPELL_CHARGED_CHAOTIC_ENERGY_BURST);
|
||||
else
|
||||
DoCast(target, SPELL_CHAOTIC_ENERGY_BURST);
|
||||
SPELL_CHAOTIC_ENERGY_BURST_Timer = 1000;
|
||||
}else SPELL_CHAOTIC_ENERGY_BURST_Timer -=diff;
|
||||
|
||||
if (SUMMON_CRAZED_MANA_WRAITH_Timer < diff)
|
||||
{
|
||||
Creature* Wraith = m_creature->SummonCreature(MOB_CRAZED_MANA_WRAITH, m_creature->GetPositionX()+1, m_creature->GetPositionY()+1, m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000);
|
||||
if (Wraith)
|
||||
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
Wraith->AI()->AttackStart(target);
|
||||
Unit* Anomalus = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_ANOMALUS));
|
||||
if (Anomalus && Anomalus->HasAura(SPELL_RIFT_SHIELD))
|
||||
SUMMON_CRAZED_MANA_WRAITH_Timer = 5000;
|
||||
else
|
||||
SUMMON_CRAZED_MANA_WRAITH_Timer = 10000;
|
||||
}else SUMMON_CRAZED_MANA_WRAITH_Timer -=diff;
|
||||
}
|
||||
};
|
||||
|
||||
/*######
|
||||
## Chaotic Rift
|
||||
######*/
|
||||
#define SPELL_CHAOTIC_ENERGY_BURST 47688
|
||||
#define SPELL_CHARGED_CHAOTIC_ENERGY_BURST 47737
|
||||
|
||||
struct TRINITY_DLL_DECL npc_chaotic_riftAI : public ScriptedAI
|
||||
CreatureAI* GetAI_mob_chaotic_rift(Creature *_Creature)
|
||||
{
|
||||
npc_chaotic_riftAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
void Reset() {}
|
||||
void EnterCombat(Unit* who) {}
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if(!UpdateVictim())
|
||||
return;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
void JustDied(Unit* killer) {}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_npc_chaotic_rift(Creature *_Creature)
|
||||
{
|
||||
return new npc_chaotic_riftAI (_Creature);
|
||||
return new mob_chaotic_riftAI (_Creature);
|
||||
}
|
||||
|
||||
CreatureAI* GetAI_boss_anomalus(Creature *_Creature)
|
||||
@@ -123,11 +258,6 @@ CreatureAI* GetAI_boss_anomalus(Creature *_Creature)
|
||||
return new boss_anomalusAI (_Creature);
|
||||
}
|
||||
|
||||
CreatureAI* GetAI_mob_crazed_mana_wraith(Creature *_Creature)
|
||||
{
|
||||
return new boss_anomalusAI (_Creature);
|
||||
}
|
||||
|
||||
void AddSC_boss_anomalus()
|
||||
{
|
||||
Script *newscript;
|
||||
@@ -136,14 +266,9 @@ void AddSC_boss_anomalus()
|
||||
newscript->Name="boss_anomalus";
|
||||
newscript->GetAI = &GetAI_boss_anomalus;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name="mob_crazed_mana_wraith";
|
||||
newscript->GetAI = &GetAI_mob_crazed_mana_wraith;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name="npc_chaotic_rift";
|
||||
newscript->GetAI = &GetAI_npc_chaotic_rift;
|
||||
newscript->Name="mob_chaotic_rift";
|
||||
newscript->GetAI = &GetAI_mob_chaotic_rift;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
|
||||
@@ -1,74 +1,152 @@
|
||||
/* Script Data Start
|
||||
SDName: Boss keristrasza
|
||||
SDAuthor: LordVanMartin
|
||||
SD%Complete:
|
||||
SDComment:
|
||||
SDCategory:
|
||||
Script Data End */
|
||||
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
|
||||
* 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
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/* ScriptData
|
||||
SDName: Boss_Keristrasza
|
||||
SD%Complete:
|
||||
SDComment:
|
||||
SDCategory: The Nexus, The Nexus
|
||||
EndScriptData */
|
||||
|
||||
/*** SQL START ***
|
||||
update creature_template set scriptname = 'boss_maiden_of_grief' where entry = '';
|
||||
*** SQL END ***/
|
||||
#include "precompiled.h"
|
||||
#include "def_nexus.h"
|
||||
|
||||
//Spells
|
||||
#define SPELL_FROZEN_PRISON 47854
|
||||
#define SPELL_TAIL_SWEEP 50155
|
||||
#define SPELL_CRYSTAL_CHAINS 50997
|
||||
#define SPELL_CRYSTAL_CHAINS 50997
|
||||
#define SPELL_ENRAGE 8599
|
||||
#define SPELL_CRYSTALFIRE_BREATH_1 48096
|
||||
#define SPELL_CRYSTALFIRE_BREATH_2 57091
|
||||
#define SPELL_CRYSTALIZE 48179
|
||||
#define SPELL_INTENSE_COLD 48095 //stackable debuff
|
||||
#define SPELL_CRYSTALFIRE_BREATH_N 48096
|
||||
#define SPELL_CRYSTALFIRE_BREATH_H 57091
|
||||
#define SPELL_CRYSTALIZE 48179
|
||||
#define SPELL_INTENSE_COLD 48094
|
||||
|
||||
//Yell
|
||||
#define SAY_AGGRO -1576005
|
||||
#define SAY_SLAY -1576006
|
||||
#define SAY_ENRAGE -1576007
|
||||
#define SAY_DEATH -1576008
|
||||
#define SAY_CRYSTAL_NOVA -1576009
|
||||
#define SAY_AGGRO -1576040
|
||||
#define SAY_SLAY -1576041
|
||||
#define SAY_ENRAGE -1576042
|
||||
#define SAY_DEATH -1576043
|
||||
#define SAY_CRYSTAL_NOVA -1576044
|
||||
|
||||
struct TRINITY_DLL_DECL boss_keristraszaAI : public ScriptedAI
|
||||
{
|
||||
boss_keristraszaAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
bool enraged;
|
||||
|
||||
void Reset()
|
||||
boss_keristraszaAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
enraged = false;
|
||||
pInstance = ((ScriptedInstance*)c->GetInstanceData());
|
||||
HeroicMode = m_creature->GetMap()->IsHeroic();
|
||||
Reset();
|
||||
}
|
||||
void EnterCombat(Unit* who)
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
bool HeroicMode;
|
||||
|
||||
uint32 CRYSTALFIRE_BREATH_Timer;
|
||||
uint32 CRYSTAL_CHAINS_CRYSTALIZE_Timer;
|
||||
uint32 TAIL_SWEEP_Timer;
|
||||
bool Enrage;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
CRYSTALFIRE_BREATH_Timer = 14000;
|
||||
CRYSTAL_CHAINS_CRYSTALIZE_Timer = HeroicMode ? 30000 : 11000;
|
||||
TAIL_SWEEP_Timer = 5000;
|
||||
Enrage = false;
|
||||
m_creature->RemoveAurasDueToSpell(SPELL_INTENSE_COLD);
|
||||
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);
|
||||
if (pInstance && pInstance->GetData(DATA_KERISTRASZA_FREED) == DONE)
|
||||
{
|
||||
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2);
|
||||
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
}else{
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2);
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
m_creature->CastSpell(m_creature, SPELL_FROZEN_PRISON, false);
|
||||
}
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit *who)
|
||||
{
|
||||
if (pInstance && pInstance->GetData(DATA_KERISTRASZA_FREED) != DONE && pInstance->GetData(DATA_MAGUS_TELESTRA_EVENT) == DONE &&
|
||||
pInstance->GetData(DATA_ANOMALUS_EVENT) == DONE && pInstance->GetData(DATA_ORMOROK_EVENT) == DONE &&
|
||||
m_creature->IsHostileTo(who) && m_creature->IsWithinDist(who, 15.0f, false))
|
||||
{
|
||||
pInstance->SetData(DATA_KERISTRASZA_FREED, DONE);
|
||||
}
|
||||
if (pInstance->GetData(DATA_KERISTRASZA_FREED) == DONE)
|
||||
{
|
||||
m_creature->RemoveAurasDueToSpell(SPELL_FROZEN_PRISON);
|
||||
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2);
|
||||
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
ScriptedAI::MoveInLineOfSight(who);
|
||||
}
|
||||
}
|
||||
|
||||
void Aggro(Unit* who)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, m_creature);
|
||||
DoCast(m_creature, SPELL_INTENSE_COLD);
|
||||
}
|
||||
void AttackStart(Unit* who) {}
|
||||
void MoveInLineOfSight(Unit* who) {}
|
||||
void UpdateAI(const uint32 diff)
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if(!UpdateVictim())
|
||||
return;
|
||||
|
||||
if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) == 10)
|
||||
if (!UpdateVictim())
|
||||
{
|
||||
if(!enraged)
|
||||
{
|
||||
DoScriptText(SAY_ENRAGE, m_creature);
|
||||
DoCast(m_creature, SPELL_ENRAGE);
|
||||
enraged = true;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Enrage && (m_creature->GetHealth() < m_creature->GetMaxHealth() * 0.25))
|
||||
{
|
||||
DoScriptText(SAY_ENRAGE , m_creature);
|
||||
DoCast(m_creature, SPELL_ENRAGE);
|
||||
Enrage = true;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
if (CRYSTALFIRE_BREATH_Timer < diff)
|
||||
{
|
||||
DoCast(m_creature->getVictim(), HeroicMode ? SPELL_CRYSTALFIRE_BREATH_H : SPELL_CRYSTALFIRE_BREATH_N);
|
||||
CRYSTALFIRE_BREATH_Timer = 14000;
|
||||
}else CRYSTALFIRE_BREATH_Timer -=diff;
|
||||
|
||||
if (TAIL_SWEEP_Timer < diff)
|
||||
{
|
||||
DoCast(m_creature, SPELL_TAIL_SWEEP);
|
||||
TAIL_SWEEP_Timer = 5000;
|
||||
}else TAIL_SWEEP_Timer -=diff;
|
||||
|
||||
if (CRYSTAL_CHAINS_CRYSTALIZE_Timer < diff)
|
||||
{
|
||||
DoScriptText(SAY_CRYSTAL_NOVA , m_creature);
|
||||
if (HeroicMode)
|
||||
DoCast(m_creature, SPELL_CRYSTALIZE);
|
||||
else
|
||||
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_CRYSTAL_CHAINS);
|
||||
CRYSTAL_CHAINS_CRYSTALIZE_Timer = HeroicMode ? 30000 : 11000;
|
||||
}else CRYSTAL_CHAINS_CRYSTALIZE_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
void JustDied(Unit* killer)
|
||||
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, m_creature);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit *victim)
|
||||
{
|
||||
if(victim == m_creature)
|
||||
return;
|
||||
DoScriptText(SAY_SLAY, m_creature);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,103 +1,278 @@
|
||||
/* Script Data Start
|
||||
SDName: Boss magus_telestra
|
||||
SDAuthor: LordVanMartin
|
||||
SD%Complete:
|
||||
SDComment:
|
||||
SDCategory:
|
||||
Script Data End */
|
||||
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
|
||||
* 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
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/* ScriptData
|
||||
SDName: Boss_Magus_Telestra
|
||||
SD%Complete:
|
||||
SDComment:
|
||||
SDCategory: The Nexus, The Nexus
|
||||
EndScriptData */
|
||||
|
||||
/*** SQL START ***
|
||||
update creature_template set scriptname = '' where entry = '';
|
||||
*** SQL END ***/
|
||||
#include "precompiled.h"
|
||||
#include "def_nexus.h"
|
||||
|
||||
|
||||
//Spells
|
||||
|
||||
//phase 1
|
||||
#define SPELL_ICE_NOVA 47772
|
||||
#define SPELL_ICE_NOVA 56935
|
||||
#define SPELL_FIREBOMB 47773
|
||||
#define SPELL_FIREBOMB 56934
|
||||
#define SPELL_GAVITY_WELL 47756
|
||||
#define SPELL_ICE_NOVA_N 47772
|
||||
#define SPELL_ICE_NOVA_H 56935
|
||||
#define SPELL_FIREBOMB_N 47773
|
||||
#define SPELL_FIREBOMB_H 56934
|
||||
#define SPELL_GRAVITY_WELL 47756
|
||||
#define SPELL_TELESTRA_BACK 47714
|
||||
|
||||
//Phase 2 -->50% HP (3 clones, Frost, Fire, Arcane)
|
||||
//Frost Magus (npc 26930)
|
||||
#define FROST_MAGUS_VISUAL 47706 //Dummy
|
||||
#define SPELL_BLIZZARD_N 47727
|
||||
#define SPELL_ICE_BARB_N 47729
|
||||
//heroic
|
||||
#define SPELL_BLIZZARD_H 56936
|
||||
#define SPELL_ICE_BARB_H 56937
|
||||
float CenterOfRoom[1][4] =
|
||||
{
|
||||
{504.80, 89.07, -16.12, 6.27}
|
||||
};
|
||||
|
||||
//Fire Magus (npc 26928)
|
||||
#define FIRE_MAGUS_VISUAL 47705 //Dummy
|
||||
#define SPELL_FIRE_BLAST 47721
|
||||
#define SPELL_SCORCH 47723
|
||||
//heroic
|
||||
#define SPELL_FIRE_BLAST_H 56939
|
||||
#define SPELL_SCORCH_H 56938
|
||||
//At 50% HP - 3 clones, Frost, Fire, Arcane (and in 10% HP in Heroic)
|
||||
#define MOB_FIRE_MAGUS 26928
|
||||
#define MOB_FROST_MAGUS 26930
|
||||
#define MOB_ARCANE_MAGUS 26929
|
||||
|
||||
//Arcane Magus (npc 26929)
|
||||
#define ARCANE_MAGUS_VISUAL 47704 //Dummy
|
||||
#define SPELL_CRITTER 47731
|
||||
#define SPELL_TIME_STOP 47736
|
||||
#define SPELL_FIRE_MAGUS_VISUAL 47705
|
||||
#define SPELL_FROST_MAGUS_VISUAL 47706
|
||||
#define SPELL_ARCANE_MAGUS_VISUAL 47704
|
||||
|
||||
//Yell
|
||||
#define SAY_AGGRO -1576010
|
||||
#define SAY_KILL -1576011
|
||||
#define SAY_DEATH -1576012
|
||||
#define SAY_MERGE -1576013
|
||||
#define SAY_SPLIT_1 -1576014
|
||||
#define SAY_SPLIT_2 -1576015
|
||||
#define SAY_AGGRO -1576000
|
||||
#define SAY_KILL -1576001
|
||||
#define SAY_DEATH -1576002
|
||||
#define SAY_MERGE -1576003
|
||||
#define SAY_SPLIT_1 -1576004
|
||||
#define SAY_SPLIT_2 -1576005
|
||||
|
||||
|
||||
struct TRINITY_DLL_DECL boss_magus_telestraAI : public ScriptedAI
|
||||
{
|
||||
boss_magus_telestraAI(Creature *c) : ScriptedAI(c) {}
|
||||
boss_magus_telestraAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = ((ScriptedInstance*)c->GetInstanceData());
|
||||
Reset();
|
||||
HeroicMode = c->GetMap()->IsHeroic();
|
||||
}
|
||||
|
||||
bool splited;
|
||||
uint64 Magus_frost,
|
||||
Magus_fire,
|
||||
Magus_arcane;
|
||||
ScriptedInstance* pInstance;
|
||||
bool HeroicMode;
|
||||
|
||||
uint64 FireMagusGUID;
|
||||
uint64 FrostMagusGUID;
|
||||
uint64 ArcaneMagusGUID;
|
||||
bool FireMagusDead;
|
||||
bool FrostMagusDead;
|
||||
bool ArcaneMagusDead;
|
||||
|
||||
uint32 AppearDelay_Timer;
|
||||
bool AppearDelay;
|
||||
|
||||
uint8 Phase;
|
||||
|
||||
uint32 SPELL_ICE_NOVA_Timer;
|
||||
uint32 SPELL_FIREBOMB_Timer;
|
||||
uint32 SPELL_GRAVITY_WELL_Timer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
splited = false;
|
||||
Phase = 0;
|
||||
//These times are probably wrong
|
||||
SPELL_ICE_NOVA_Timer = 7000;
|
||||
SPELL_FIREBOMB_Timer = 0;
|
||||
SPELL_GRAVITY_WELL_Timer = 15000;
|
||||
|
||||
FireMagusGUID = 0;
|
||||
FrostMagusGUID = 0;
|
||||
ArcaneMagusGUID = 0;
|
||||
|
||||
AppearDelay = false;
|
||||
|
||||
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
m_creature->SetVisibility(VISIBILITY_ON);
|
||||
|
||||
if(pInstance)
|
||||
pInstance->SetData(DATA_MAGUS_TELESTRA_EVENT, NOT_STARTED);
|
||||
}
|
||||
void EnterCombat(Unit* who)
|
||||
|
||||
void Aggro(Unit* who)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, m_creature);
|
||||
}
|
||||
void AttackStart(Unit* who) {}
|
||||
void MoveInLineOfSight(Unit* who) {}
|
||||
void UpdateAI(const uint32 diff)
|
||||
|
||||
uint64 SplitPersonality(uint32 entry)
|
||||
{
|
||||
Creature* Summoned = m_creature->SummonCreature(entry, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), m_creature->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000);
|
||||
if (Summoned)
|
||||
{
|
||||
switch (entry)
|
||||
{
|
||||
case MOB_FIRE_MAGUS:
|
||||
{
|
||||
Summoned->CastSpell(Summoned, SPELL_FIRE_MAGUS_VISUAL, false);
|
||||
break;
|
||||
}
|
||||
case MOB_FROST_MAGUS:
|
||||
{
|
||||
Summoned->CastSpell(Summoned, SPELL_FROST_MAGUS_VISUAL, false);
|
||||
break;
|
||||
}
|
||||
case MOB_ARCANE_MAGUS:
|
||||
{
|
||||
Summoned->CastSpell(Summoned, SPELL_ARCANE_MAGUS_VISUAL, false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
Summoned->AI()->AttackStart(target);
|
||||
return Summoned->GetGUID();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if(!UpdateVictim())
|
||||
return;
|
||||
|
||||
if(!splited)
|
||||
if (!UpdateVictim())
|
||||
{
|
||||
if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) <= 50)
|
||||
{
|
||||
DoScriptText(SAY_SPLIT_1, m_creature);
|
||||
//HandleSplit
|
||||
splited = true;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
if (AppearDelay)
|
||||
{
|
||||
m_creature->StopMoving();
|
||||
m_creature->AttackStop();
|
||||
if (AppearDelay_Timer < diff)
|
||||
{
|
||||
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
AppearDelay = false;
|
||||
}else AppearDelay_Timer -= diff;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if ((Phase == 1)||(Phase == 3))
|
||||
{
|
||||
Unit* FireMagus;
|
||||
Unit* FrostMagus;
|
||||
Unit* ArcaneMagus;
|
||||
if (FireMagusGUID)
|
||||
FireMagus = Unit::GetUnit((*m_creature), FireMagusGUID);
|
||||
if (FrostMagusGUID)
|
||||
FrostMagus = Unit::GetUnit((*m_creature), FrostMagusGUID);
|
||||
if (ArcaneMagusGUID)
|
||||
ArcaneMagus = Unit::GetUnit((*m_creature), ArcaneMagusGUID);
|
||||
if (FireMagus && FireMagus->isDead())
|
||||
FireMagusDead = true;
|
||||
if (FrostMagus && FrostMagus->isDead())
|
||||
FrostMagusDead = true;
|
||||
if (ArcaneMagus && ArcaneMagus->isDead())
|
||||
ArcaneMagusDead = true;
|
||||
if (FireMagusDead && FrostMagusDead && ArcaneMagusDead)
|
||||
{
|
||||
m_creature->GetMotionMaster()->Clear();
|
||||
m_creature->Relocate(CenterOfRoom[0][0], CenterOfRoom[0][1], CenterOfRoom[0][2], CenterOfRoom[0][3]);
|
||||
DoCast(m_creature, SPELL_TELESTRA_BACK);
|
||||
m_creature->SetVisibility(VISIBILITY_ON);
|
||||
if (Phase == 1)
|
||||
Phase = 2;
|
||||
if (Phase == 3)
|
||||
Phase = 4;
|
||||
FireMagusGUID = 0;
|
||||
FrostMagusGUID = 0;
|
||||
ArcaneMagusGUID = 0;
|
||||
AppearDelay = true;
|
||||
AppearDelay_Timer = 4000;
|
||||
DoScriptText(SAY_MERGE, m_creature);
|
||||
}else
|
||||
return;
|
||||
}
|
||||
|
||||
if ((Phase == 0) && (m_creature->GetHealth() <= (m_creature->GetMaxHealth() * 0.5)))
|
||||
{
|
||||
Phase = 1;
|
||||
m_creature->CastStop();
|
||||
m_creature->SetVisibility(VISIBILITY_OFF);
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
FireMagusGUID = SplitPersonality(MOB_FIRE_MAGUS);
|
||||
FrostMagusGUID = SplitPersonality(MOB_FROST_MAGUS);
|
||||
ArcaneMagusGUID = SplitPersonality(MOB_ARCANE_MAGUS);
|
||||
FireMagusDead = false;
|
||||
FrostMagusDead = false;
|
||||
ArcaneMagusDead = false;
|
||||
switch(rand()%2)
|
||||
{
|
||||
case 0: DoScriptText(SAY_SPLIT_1, m_creature); break;
|
||||
case 1: DoScriptText(SAY_SPLIT_2, m_creature); break;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (HeroicMode && (Phase == 2) && (m_creature->GetHealth() <= (m_creature->GetMaxHealth() * 0.1)))
|
||||
{
|
||||
Phase = 3;
|
||||
m_creature->CastStop();
|
||||
m_creature->SetVisibility(VISIBILITY_OFF);
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
FireMagusGUID = SplitPersonality(MOB_FIRE_MAGUS);
|
||||
FrostMagusGUID = SplitPersonality(MOB_FROST_MAGUS);
|
||||
ArcaneMagusGUID = SplitPersonality(MOB_ARCANE_MAGUS);
|
||||
FireMagusDead = false;
|
||||
FrostMagusDead = false;
|
||||
ArcaneMagusDead = false;
|
||||
switch(rand()%2)
|
||||
{
|
||||
case 0: DoScriptText(SAY_SPLIT_1, m_creature); break;
|
||||
case 1: DoScriptText(SAY_SPLIT_2, m_creature); break;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (SPELL_ICE_NOVA_Timer < diff)
|
||||
{
|
||||
m_creature->CastStop();
|
||||
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, HeroicMode ? SPELL_ICE_NOVA_H : SPELL_ICE_NOVA_N);
|
||||
SPELL_ICE_NOVA_Timer = 15000;
|
||||
}else SPELL_ICE_NOVA_Timer -=diff;
|
||||
|
||||
if (SPELL_GRAVITY_WELL_Timer < diff)
|
||||
{
|
||||
m_creature->CastStop();
|
||||
if (Unit* target = m_creature->getVictim())
|
||||
DoCast(target, SPELL_GRAVITY_WELL);
|
||||
SPELL_GRAVITY_WELL_Timer = 15000;
|
||||
}else SPELL_GRAVITY_WELL_Timer -=diff;
|
||||
|
||||
if (SPELL_FIREBOMB_Timer < diff)
|
||||
{
|
||||
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, HeroicMode ? SPELL_FIREBOMB_H : SPELL_FIREBOMB_N);
|
||||
SPELL_FIREBOMB_Timer = 2000;
|
||||
}else SPELL_FIREBOMB_Timer -=diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
{
|
||||
DoScriptText(SAY_DEATH, m_creature);
|
||||
}
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_MAGUS_TELESTRA_EVENT, DONE);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit *victim)
|
||||
{
|
||||
if(victim == m_creature)
|
||||
return;
|
||||
DoScriptText(SAY_KILL, m_creature);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,79 +1,288 @@
|
||||
/* Script Data Start
|
||||
SDName: Boss ormorok
|
||||
SDAuthor: LordVanMartin
|
||||
SD%Complete:
|
||||
SDComment:
|
||||
SDCategory:
|
||||
Script Data End */
|
||||
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
|
||||
* 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
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/* ScriptData
|
||||
SDName: Boss_Ormorok
|
||||
SD%Complete:
|
||||
SDComment:
|
||||
SDCategory: The Nexus, The Nexus
|
||||
EndScriptData */
|
||||
|
||||
/*** SQL START ***
|
||||
update creature_template set scriptname = '' where entry = '';
|
||||
*** SQL END ***/
|
||||
#include "precompiled.h"
|
||||
#include "def_nexus.h"
|
||||
|
||||
//Spells
|
||||
#define SPELL_CRYSTAL_SPIKES_1 47958
|
||||
#define SPELL_CRYSTAL_SPIKES_2 57082
|
||||
#define SPELL_CRYSTAL_SPIKES_3 57083
|
||||
#define SPELL_CRYSTAL_SPIKES_N 47958 //Don't work, using walkaround
|
||||
#define SPELL_CRYSTAL_SPIKES_H 57082 //Don't work, using walkaround
|
||||
//Walkaround for spells Crystal Spikes -----------------
|
||||
#define SPELL_CRYSTALL_SPIKE_DAMAGE_N 47944
|
||||
#define SPELL_CRYSTALL_SPIKE_DAMAGE_H 57067
|
||||
#define SPELL_CRYSTAL_SPIKE_PREVISUAL 50442
|
||||
#define MOB_CRYSTAL_SPIKE 27099
|
||||
//------------------------------------------------------
|
||||
#define SPELL_SPELL_REFLECTION 47981
|
||||
#define SPELL_TRAMPLE_N 48016
|
||||
#define SPELL_TRAMPLE_H 57066
|
||||
#define SPELL_FRENZY_N 48017
|
||||
#define SPELL_FRENZY_H 57086
|
||||
#define SPELL_FRENZY 48017
|
||||
#define SPELL_SUMMON_CRYSTALLINE_TANGLER 61564 //summons npc 32665
|
||||
#define MOB_CRYSTALLINE_TANGLER 32665
|
||||
#define SPELL_ROOTS 28858 //proper spell id is unknown
|
||||
|
||||
//Yell
|
||||
#define SAY_AGGRO -1576016
|
||||
#define SAY_KILL -1576017
|
||||
#define SAY_DEATH -1576018
|
||||
#define SAY_REFLECT -1576019
|
||||
#define SAY_ICE_SPIKES -1576020
|
||||
#define SAY_AGGRO -1576020
|
||||
#define SAY_DEATH -1576021
|
||||
#define SAY_REFLECT -1576022
|
||||
#define SAY_CRYSTAL_SPIKES -1576023
|
||||
#define SAY_KILL -1576024
|
||||
|
||||
#define SPIKE_DISTANCE 5.0f
|
||||
|
||||
struct TRINITY_DLL_DECL boss_ormorokAI : public ScriptedAI
|
||||
{
|
||||
boss_ormorokAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
bool frenzy;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
frenzy = false;
|
||||
boss_ormorokAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = ((ScriptedInstance*)c->GetInstanceData());
|
||||
Reset();
|
||||
HeroicMode = c->GetMap()->IsHeroic();
|
||||
}
|
||||
void EnterCombat(Unit* who)
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
bool HeroicMode;
|
||||
bool Frenzy;
|
||||
bool CrystalSpikes;
|
||||
uint8 CrystalSpikes_Count;
|
||||
float BaseX;
|
||||
float BaseY;
|
||||
float BaseZ;
|
||||
float BaseO;
|
||||
float SpikeXY[4][2];
|
||||
|
||||
uint32 SPELL_CRYSTAL_SPIKES_Timer;
|
||||
uint32 CRYSTAL_SPIKES_Timer;
|
||||
uint32 SPELL_TRAMPLE_Timer;
|
||||
uint32 SPELL_FRENZY_Timer;
|
||||
uint32 SPELL_SPELL_REFLECTION_Timer;
|
||||
uint32 SPELL_SUMMON_CRYSTALLINE_TANGLER_Timer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
SPELL_CRYSTAL_SPIKES_Timer = 12000;
|
||||
SPELL_TRAMPLE_Timer = 10000;
|
||||
SPELL_SPELL_REFLECTION_Timer = 30000;
|
||||
SPELL_SUMMON_CRYSTALLINE_TANGLER_Timer = 17000;
|
||||
Frenzy = false;
|
||||
CrystalSpikes = false;
|
||||
if(pInstance)
|
||||
pInstance->SetData(DATA_ORMOROK_EVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void Aggro(Unit* who)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, m_creature);
|
||||
}
|
||||
void AttackStart(Unit* who) {}
|
||||
void MoveInLineOfSight(Unit* who) {}
|
||||
void UpdateAI(const uint32 diff)
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if(!UpdateVictim())
|
||||
return;
|
||||
|
||||
if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) == 25)
|
||||
if (!UpdateVictim())
|
||||
{
|
||||
if(!frenzy)
|
||||
{
|
||||
DoCast(m_creature, SPELL_FRENZY_N);
|
||||
frenzy = true;
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (CrystalSpikes)
|
||||
if (CRYSTAL_SPIKES_Timer < diff)
|
||||
{
|
||||
SpikeXY[0][0] = BaseX+(SPIKE_DISTANCE*CrystalSpikes_Count*cos(BaseO));
|
||||
SpikeXY[0][1] = BaseY+(SPIKE_DISTANCE*CrystalSpikes_Count*sin(BaseO));
|
||||
SpikeXY[1][0] = BaseX-(SPIKE_DISTANCE*CrystalSpikes_Count*cos(BaseO));
|
||||
SpikeXY[1][1] = BaseY-(SPIKE_DISTANCE*CrystalSpikes_Count*sin(BaseO));
|
||||
SpikeXY[2][0] = BaseX+(SPIKE_DISTANCE*CrystalSpikes_Count*cos(BaseO-(M_PI/2)));
|
||||
SpikeXY[2][1] = BaseY+(SPIKE_DISTANCE*CrystalSpikes_Count*sin(BaseO-(M_PI/2)));
|
||||
SpikeXY[3][0] = BaseX-(SPIKE_DISTANCE*CrystalSpikes_Count*cos(BaseO-(M_PI/2)));
|
||||
SpikeXY[3][1] = BaseY-(SPIKE_DISTANCE*CrystalSpikes_Count*sin(BaseO-(M_PI/2)));
|
||||
for (uint8 i = 0; i < 4; i++)
|
||||
Creature* Spike = m_creature->SummonCreature(MOB_CRYSTAL_SPIKE, SpikeXY[i][0], SpikeXY[i][1], BaseZ, 0, TEMPSUMMON_TIMED_DESPAWN, 7000);
|
||||
if (++CrystalSpikes_Count >= 13)
|
||||
CrystalSpikes = false;
|
||||
CRYSTAL_SPIKES_Timer = 200;
|
||||
}else CRYSTAL_SPIKES_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
if (!Frenzy && (m_creature->GetHealth() < m_creature->GetMaxHealth() * 0.25))
|
||||
{
|
||||
DoCast(m_creature, SPELL_FRENZY);
|
||||
Frenzy = true;
|
||||
}
|
||||
|
||||
if (SPELL_TRAMPLE_Timer < diff)
|
||||
{
|
||||
DoCast(m_creature, HeroicMode ? SPELL_TRAMPLE_H : SPELL_TRAMPLE_N);
|
||||
SPELL_TRAMPLE_Timer = 10000;
|
||||
}else SPELL_TRAMPLE_Timer -= diff;
|
||||
|
||||
if (SPELL_SPELL_REFLECTION_Timer < diff)
|
||||
{
|
||||
DoScriptText(SAY_REFLECT, m_creature);
|
||||
DoCast(m_creature, SPELL_SPELL_REFLECTION);
|
||||
SPELL_SPELL_REFLECTION_Timer = 30000;
|
||||
}else SPELL_SPELL_REFLECTION_Timer -= diff;
|
||||
|
||||
if (SPELL_CRYSTAL_SPIKES_Timer < diff)
|
||||
{
|
||||
DoScriptText(SAY_CRYSTAL_SPIKES, m_creature);
|
||||
CrystalSpikes = true;
|
||||
CrystalSpikes_Count = 1;
|
||||
CRYSTAL_SPIKES_Timer = 0;
|
||||
BaseX = m_creature->GetPositionX();
|
||||
BaseY = m_creature->GetPositionY();
|
||||
BaseZ = m_creature->GetPositionZ();
|
||||
BaseO = m_creature->GetOrientation();
|
||||
SPELL_CRYSTAL_SPIKES_Timer = 20000;
|
||||
}else SPELL_CRYSTAL_SPIKES_Timer -=diff;
|
||||
|
||||
if (HeroicMode && (SPELL_SUMMON_CRYSTALLINE_TANGLER_Timer < diff))
|
||||
{
|
||||
Creature* Crystalline_Tangler = m_creature->SummonCreature(MOB_CRYSTALLINE_TANGLER, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), m_creature->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000);
|
||||
if (Crystalline_Tangler)
|
||||
{
|
||||
Unit* target = NULL;
|
||||
uint8 Healer = 0;
|
||||
for (uint8 j = 1; j<=4; j++)
|
||||
{
|
||||
switch (j)
|
||||
{
|
||||
case 1: Healer = CLASS_PRIEST; break;
|
||||
case 2: Healer = CLASS_PALADIN; break;
|
||||
case 3: Healer = CLASS_DRUID; break;
|
||||
case 4: Healer = CLASS_SHAMAN; break;
|
||||
}
|
||||
std::list<HostilReference*>::iterator i = m_creature->getThreatManager().getThreatList().begin();
|
||||
for (; i != m_creature->getThreatManager().getThreatList().end(); ++i)
|
||||
{
|
||||
Unit* pTemp = Unit::GetUnit((*m_creature),(*i)->getUnitGuid());
|
||||
if (pTemp && pTemp->GetTypeId() == TYPEID_PLAYER && pTemp->getClass() == Healer)
|
||||
{
|
||||
target = pTemp;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (target)
|
||||
break;
|
||||
}
|
||||
if (!target)
|
||||
target = SelectUnit(SELECT_TARGET_RANDOM, 0);
|
||||
if (target)
|
||||
{
|
||||
Crystalline_Tangler->AI()->AttackStart(target);
|
||||
Crystalline_Tangler->getThreatManager().addThreat(target, 1000000000.0f);
|
||||
}
|
||||
}
|
||||
SPELL_SUMMON_CRYSTALLINE_TANGLER_Timer = 17000;
|
||||
}else SPELL_SUMMON_CRYSTALLINE_TANGLER_Timer -=diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
void JustDied(Unit* killer)
|
||||
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, m_creature);
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_ORMOROK_EVENT, DONE);
|
||||
}
|
||||
void KilledUnit(Unit *victim)
|
||||
|
||||
void KilledUnit(Unit *victim)
|
||||
{
|
||||
if(victim == m_creature)
|
||||
return;
|
||||
DoScriptText(SAY_KILL, m_creature);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL mob_crystal_spikeAI : public Scripted_NoMovementAI
|
||||
{
|
||||
mob_crystal_spikeAI(Creature *c) : Scripted_NoMovementAI(c)
|
||||
{
|
||||
Reset();
|
||||
HeroicMode = c->GetMap()->IsHeroic();
|
||||
}
|
||||
|
||||
bool HeroicMode;
|
||||
|
||||
uint32 SPELL_CRYSTALL_SPIKE_DAMAGE_Timer;
|
||||
uint32 SPELL_CRYSTAL_SPIKE_PREVISUAL_Timer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
SPELL_CRYSTALL_SPIKE_DAMAGE_Timer = 3700;
|
||||
SPELL_CRYSTAL_SPIKE_PREVISUAL_Timer = 1000;
|
||||
m_creature->SetLevel(80); //
|
||||
m_creature->setFaction(16); //Walkaround to be independent from data in DB
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); //
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); //
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (SPELL_CRYSTAL_SPIKE_PREVISUAL_Timer < diff)
|
||||
{
|
||||
DoCast(m_creature, SPELL_CRYSTAL_SPIKE_PREVISUAL);
|
||||
SPELL_CRYSTAL_SPIKE_PREVISUAL_Timer = 10000;
|
||||
}else SPELL_CRYSTAL_SPIKE_PREVISUAL_Timer -=diff;
|
||||
|
||||
if (SPELL_CRYSTALL_SPIKE_DAMAGE_Timer < diff)
|
||||
{
|
||||
DoCast(m_creature, HeroicMode ? SPELL_CRYSTALL_SPIKE_DAMAGE_H : SPELL_CRYSTALL_SPIKE_DAMAGE_N);
|
||||
SPELL_CRYSTALL_SPIKE_DAMAGE_Timer = 10000;
|
||||
}else SPELL_CRYSTALL_SPIKE_DAMAGE_Timer -=diff;
|
||||
}
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL mob_crystalline_tanglerAI : public ScriptedAI
|
||||
{
|
||||
mob_crystalline_tanglerAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
Reset();
|
||||
}
|
||||
|
||||
uint32 SPELL_ROOTS_Timer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
SPELL_ROOTS_Timer = 1000;
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (SPELL_ROOTS_Timer < diff)
|
||||
{
|
||||
if (m_creature->IsWithinDist(m_creature->getVictim(), 5.0f, false))
|
||||
{
|
||||
DoCast(m_creature->getVictim(), SPELL_ROOTS);
|
||||
SPELL_ROOTS_Timer = 15000;
|
||||
}
|
||||
}else SPELL_ROOTS_Timer -=diff;
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_mob_crystal_spike(Creature *_Creature)
|
||||
{
|
||||
return new mob_crystal_spikeAI (_Creature);
|
||||
}
|
||||
|
||||
CreatureAI* GetAI_mob_crystalline_tangler(Creature *_Creature)
|
||||
{
|
||||
return new mob_crystalline_tanglerAI (_Creature);
|
||||
}
|
||||
|
||||
CreatureAI* GetAI_boss_ormorok(Creature *_Creature)
|
||||
{
|
||||
return new boss_ormorokAI (_Creature);
|
||||
@@ -85,6 +294,16 @@ void AddSC_boss_ormorok()
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name="boss_ormorok";
|
||||
newscript->GetAI = &GetAI_boss_ormorok;
|
||||
newscript->GetAI = GetAI_boss_ormorok;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name="mob_crystal_spike";
|
||||
newscript->GetAI = &GetAI_mob_crystal_spike;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name="mob_crystalline_tangler";
|
||||
newscript->GetAI = &GetAI_mob_crystalline_tangler;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
|
||||
@@ -1,35 +1,11 @@
|
||||
#ifndef DEF_NEXUS_H
|
||||
#define DEF_NEXUS_H
|
||||
|
||||
#define DATA_ANOMALUSDEAD 1
|
||||
#define DATA_ANOMALUS_DEATH 2
|
||||
#define DATA_ORMOROKDDEAD 3
|
||||
#define DATA_ORMOROK_DEATH 4
|
||||
#define DATA_MAGUS_TELESTRA_EVENT 1
|
||||
#define DATA_ANOMALUS_EVENT 2
|
||||
#define DATA_ORMOROK_EVENT 3
|
||||
#define DATA_KERISTRASZA_FREED 4
|
||||
|
||||
#define DATA_MAGUSTELESTRADEAD 5
|
||||
#define DATA_MAGUSTELESTRA_DEATH 6
|
||||
#define DATA_MAGUSTELESTRA_A_DEAD 7
|
||||
#define DATA_MAGUSTELESTRA_A_DEATH 8
|
||||
#define DATA_MAGUSTELESTRA_F_DEAD 9
|
||||
#define DATA_MAGUSTELESTRA_F_DEATH 10
|
||||
#define DATA_MAGUSTELESTRA_FI_DEAD 11
|
||||
#define DATA_MAGUSTELESTRA_FI_DEATH 12
|
||||
#define DATA_ANOMALUS 5
|
||||
|
||||
#define DATA_KERISTRASZADEAD 13
|
||||
#define DATA_KERISTRASZA_DEATH 14
|
||||
#define DATA_COMMANDER_KOLURGDEAD 15
|
||||
#define DATA_COMMANDER_KOLURG_DEATH 16
|
||||
#define DATA_COMMANDER_STOUTBEARDDEAD 17
|
||||
#define DATA_COMMANDER_STOUTBEARD_DEATH 18
|
||||
#define DATA_ANOMALUS 19
|
||||
#define DATA_ORMOROK 20
|
||||
|
||||
#define DATA_MAGUSTELESTRA 21
|
||||
#define DATA_MAGUSTELESTRA_A 22
|
||||
#define DATA_MAGUSTELESTRA_F 23
|
||||
#define DATA_MAGUSTELESTRA_FI 24
|
||||
|
||||
#define DATA_KERISTRASZA 25
|
||||
#define DATA_COMMANDER_KOLURG 26
|
||||
#define DATA_COMMANDER_STOUTBEARD 27
|
||||
#endif
|
||||
|
||||
@@ -1,145 +1,176 @@
|
||||
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
|
||||
* 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
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/* ScriptData
|
||||
SDName: Instance_Nexus
|
||||
SD%Complete:
|
||||
SDComment:
|
||||
SDCategory: The Nexus, The Nexus
|
||||
EndScriptData */
|
||||
|
||||
#include "precompiled.h"
|
||||
#include "def_nexus.h"
|
||||
|
||||
#define NUMBER_OF_ENCOUNTERS 4
|
||||
|
||||
struct TRINITY_DLL_DECL instance_nexus : public ScriptedInstance
|
||||
{
|
||||
instance_nexus(Map *Map) : ScriptedInstance(Map) {Initialize();};
|
||||
|
||||
uint64 Anomalus,
|
||||
Ormorok,
|
||||
Magus_telestra,
|
||||
Magus_frost,
|
||||
Magus_fire,
|
||||
Magus_arcane,
|
||||
keristrasza,
|
||||
Commander_kolurg,
|
||||
Commander_stoutbeard;
|
||||
bool IsBossDied[9];
|
||||
std::string strInstData;
|
||||
uint64 Anomalus;
|
||||
uint32 Encounters[NUMBER_OF_ENCOUNTERS];
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
Anomalus = 0;
|
||||
Ormorok = 0;
|
||||
Magus_telestra =0;
|
||||
Magus_frost =0;
|
||||
Magus_fire =0;
|
||||
Magus_arcane =0;
|
||||
keristrasza =0;
|
||||
Commander_kolurg = 0;
|
||||
Commander_stoutbeard = 0;
|
||||
IsBossDied[0] = false;
|
||||
IsBossDied[1] = false;
|
||||
IsBossDied[2] = false;
|
||||
IsBossDied[3] = false;
|
||||
IsBossDied[4] = false;
|
||||
IsBossDied[5] = false;
|
||||
IsBossDied[6] = false;
|
||||
IsBossDied[7] = false;
|
||||
IsBossDied[8] = false;
|
||||
Anomalus = 0;
|
||||
for(uint8 i = 0; i < NUMBER_OF_ENCOUNTERS; i++)
|
||||
Encounters[i] = NOT_STARTED;
|
||||
}
|
||||
|
||||
bool IsEncounterInProgress() const
|
||||
void OnCreatureCreate(Creature* pCreature)
|
||||
{
|
||||
//not active
|
||||
return false;
|
||||
}
|
||||
void OnCreatureCreate(Creature *creature, uint32 creature_entry)
|
||||
{
|
||||
switch(creature->GetEntry())
|
||||
{
|
||||
case 26763: Anomalus = creature->GetGUID(); break;
|
||||
case 26794: Ormorok = creature->GetGUID(); break;
|
||||
case 26731: Magus_telestra = creature->GetGUID(); break;
|
||||
case 26930: Magus_frost = creature->GetGUID(); break;
|
||||
case 26928: Magus_fire = creature->GetGUID(); break;
|
||||
case 26926: Magus_arcane = creature->GetGUID(); break;
|
||||
case 26723: keristrasza = creature->GetGUID(); break;
|
||||
case 26798: Commander_kolurg = creature->GetGUID(); break;
|
||||
case 26796: Commander_stoutbeard = creature->GetGUID(); break;
|
||||
}
|
||||
}
|
||||
uint32 GetData(uint32 type)
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
case DATA_ANOMALUSDEAD:
|
||||
if(IsBossDied[0])
|
||||
return 1;
|
||||
break;
|
||||
case DATA_ORMOROKDDEAD:
|
||||
if(IsBossDied[1])
|
||||
return 1;
|
||||
break;
|
||||
case DATA_MAGUSTELESTRADEAD:
|
||||
if(IsBossDied[2])
|
||||
return 1;
|
||||
break;
|
||||
case DATA_MAGUSTELESTRA_A_DEAD:
|
||||
if(IsBossDied[3])
|
||||
return 1;
|
||||
break;
|
||||
case DATA_MAGUSTELESTRA_F_DEAD:
|
||||
if(IsBossDied[4])
|
||||
return 1;
|
||||
break;
|
||||
case DATA_MAGUSTELESTRA_FI_DEAD:
|
||||
if(IsBossDied[5])
|
||||
return 1;
|
||||
break;
|
||||
case DATA_KERISTRASZADEAD:
|
||||
if(IsBossDied[6])
|
||||
return 1;
|
||||
break;
|
||||
case DATA_COMMANDER_KOLURGDEAD:
|
||||
if(IsBossDied[7])
|
||||
return 1;
|
||||
break;
|
||||
case DATA_COMMANDER_STOUTBEARDDEAD:
|
||||
if(IsBossDied[8])
|
||||
return 1;
|
||||
break;
|
||||
}
|
||||
Map::PlayerList const& players = instance->GetPlayers();
|
||||
uint32 TeamInInstance;
|
||||
|
||||
if (!players.isEmpty())
|
||||
{
|
||||
if (Player* pPlayer = players.begin()->getSource())
|
||||
{
|
||||
TeamInInstance = pPlayer->GetTeam();
|
||||
}
|
||||
}
|
||||
switch(pCreature->GetEntry())
|
||||
{
|
||||
case 26763: Anomalus = pCreature->GetGUID(); break;
|
||||
case 26800:
|
||||
{
|
||||
//26799
|
||||
pCreature->setFaction(16);
|
||||
if (TeamInInstance == ALLIANCE)
|
||||
pCreature->SetDisplayId(24358);
|
||||
break;
|
||||
}
|
||||
case 26802:
|
||||
{
|
||||
//26801
|
||||
pCreature->setFaction(16);
|
||||
if (TeamInInstance == ALLIANCE)
|
||||
pCreature->SetDisplayId(24354);
|
||||
break;
|
||||
}
|
||||
case 26805:
|
||||
{
|
||||
//26803
|
||||
pCreature->setFaction(16);
|
||||
if (TeamInInstance == ALLIANCE)
|
||||
pCreature->SetDisplayId(24357);
|
||||
break;
|
||||
}
|
||||
case 27949:
|
||||
{
|
||||
//27947
|
||||
pCreature->setFaction(16);
|
||||
if (TeamInInstance == ALLIANCE)
|
||||
pCreature->SetDisplayId(24352);
|
||||
break;
|
||||
}
|
||||
case 26796:
|
||||
{
|
||||
//26798
|
||||
pCreature->setFaction(16);
|
||||
if (TeamInInstance == ALLIANCE)
|
||||
pCreature->SetDisplayId(24352);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
uint64 GetData64(uint32 uiIdentifier)
|
||||
{
|
||||
switch(uiIdentifier)
|
||||
{
|
||||
case DATA_ANOMALUS:
|
||||
return Anomalus;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint64 GetData64 (uint32 identifier)
|
||||
uint32 GetData(uint32 identifier)
|
||||
{
|
||||
switch(identifier)
|
||||
{
|
||||
case DATA_MAGUS_TELESTRA_EVENT: return Encounters[0];
|
||||
case DATA_ANOMALUS_EVENT: return Encounters[1];
|
||||
case DATA_ORMOROK_EVENT: return Encounters[2];
|
||||
case DATA_KERISTRASZA_FREED: return Encounters[3];
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 data)
|
||||
void SetData(uint32 identifier, uint32 data)
|
||||
{
|
||||
switch(type)
|
||||
switch(identifier)
|
||||
{
|
||||
case DATA_ANOMALUS_DEATH:
|
||||
IsBossDied[0] = true;
|
||||
break;
|
||||
case DATA_ORMOROK_DEATH:
|
||||
IsBossDied[1] = true;
|
||||
break;
|
||||
case DATA_MAGUSTELESTRA_DEATH:
|
||||
IsBossDied[2] = true;
|
||||
break;
|
||||
case DATA_MAGUSTELESTRA_A_DEATH:
|
||||
IsBossDied[3] = true;
|
||||
break;
|
||||
case DATA_MAGUSTELESTRA_F_DEATH:
|
||||
IsBossDied[4] = true;
|
||||
break;
|
||||
case DATA_MAGUSTELESTRA_FI_DEAD:
|
||||
IsBossDied[5] = true;
|
||||
break;
|
||||
case DATA_KERISTRASZA_DEATH:
|
||||
IsBossDied[6] = true;
|
||||
break;
|
||||
case DATA_COMMANDER_KOLURG_DEATH:
|
||||
IsBossDied[7] = true;
|
||||
break;
|
||||
case DATA_COMMANDER_STOUTBEARD_DEATH:
|
||||
IsBossDied[8] = true;
|
||||
break;
|
||||
case DATA_MAGUS_TELESTRA_EVENT: Encounters[0] = data; break;
|
||||
case DATA_ANOMALUS_EVENT: Encounters[1] = data; break;
|
||||
case DATA_ORMOROK_EVENT: Encounters[2] = data; break;
|
||||
case DATA_KERISTRASZA_FREED: Encounters[3] = data; break;
|
||||
}
|
||||
|
||||
if (data == DONE)
|
||||
{
|
||||
OUT_SAVE_INST_DATA;
|
||||
|
||||
std::ostringstream saveStream;
|
||||
saveStream << Encounters[0] << " " << Encounters[1] << " " << Encounters[2] << " "
|
||||
<< Encounters[3];
|
||||
|
||||
strInstData = saveStream.str();
|
||||
|
||||
SaveToDB();
|
||||
OUT_SAVE_INST_DATA_COMPLETE;
|
||||
}
|
||||
}
|
||||
|
||||
const char* Save()
|
||||
{
|
||||
return strInstData.c_str();
|
||||
}
|
||||
|
||||
void Load(const char* chrIn)
|
||||
{
|
||||
if (!chrIn)
|
||||
{
|
||||
OUT_LOAD_INST_DATA_FAIL;
|
||||
return;
|
||||
}
|
||||
|
||||
OUT_LOAD_INST_DATA(chrIn);
|
||||
|
||||
std::istringstream loadStream(chrIn);
|
||||
loadStream >> Encounters[0] >> Encounters[1] >> Encounters[2] >> Encounters[3];
|
||||
|
||||
for(uint8 i = 1; i < NUMBER_OF_ENCOUNTERS; ++i)
|
||||
{
|
||||
if (Encounters[i] == IN_PROGRESS)
|
||||
Encounters[i] = NOT_STARTED;
|
||||
}
|
||||
|
||||
OUT_LOAD_INST_DATA_COMPLETE;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user