* Last round of script directory renames.
--HG-- branch : trunk
This commit is contained in:
1 parent
dc510c9a14
commit
f151ffbd32
159 files changed
No files matched your search
@@ -0,0 +1,175 @@
|
||||
/* Script Data Start
|
||||
SDName: Boss malygos
|
||||
SDAuthor: LordVanMartin
|
||||
SD%Complete:
|
||||
SDComment:
|
||||
SDCategory:
|
||||
Script Data End */
|
||||
|
||||
/*** SQL START ***
|
||||
update creature_template set scriptname = '' where entry = '';
|
||||
*** SQL END ***/
|
||||
#include "ScriptedPch.h"
|
||||
|
||||
//Spells
|
||||
#define SPELL_ARCANE_BREATH_N 56272
|
||||
#define SPELL_ARCANE_BREATH_H 60072
|
||||
#define SPELL_ARCANE_PULSE 57432
|
||||
#define SPELL_ARCANE_STORM_1 57459
|
||||
#define SPELL_ARCANE_STORM_2 61693
|
||||
#define SPELL_ARCANE_STORM_3 61694
|
||||
#define SPELL_STATIC_FIELD 57430
|
||||
#define SPELL_SURGE_OF_POWER_1 56505
|
||||
#define SPELL_SURGE_OF_POWER_2 57407
|
||||
#define SPELL_SURGE_OF_POWER_3 60936
|
||||
#define SPELL_VORTEX 56105
|
||||
|
||||
//Dragon "mounts" spells in Phase3
|
||||
//they use Rugelike energy
|
||||
#define SPELL_DMOUNT_FLAME_SPIKE 56091 //maybe not accurate
|
||||
#define SPELL_DMOUNT_ENGULF_IN_FLAMES 61621
|
||||
#define SPELL_DMOUNT_REVIVIFY 57090
|
||||
#define SPELL_DMOUNT_LIFE_BURST 57143
|
||||
#define SPELL_DMOUNT_FLAME_SHIELD 57108
|
||||
//#define SPELL_DMOUNT_UNKNOWN XYZ //Increases your drake's flight speed by 500%.
|
||||
|
||||
//not in db
|
||||
//Yell
|
||||
//-->Other
|
||||
#define SAY_ANTI_MAGIC_SHELL -1616000
|
||||
#define SAY_BREATH_ATTACK -1616001
|
||||
#define SAY_HIGH_DAMAGE_MODE -1616002
|
||||
#define SAY_MAGIC_BLAST -1616003
|
||||
//--> Generic Spells
|
||||
#define SAY_GENERIC_SPELL_1 -1616004
|
||||
#define SAY_GENERIC_SPELL_2 -1616005
|
||||
#define SAY_GENERIC_SPELL_3 -1616006
|
||||
#define SAY_DEATH -1616007
|
||||
//--> Prefight
|
||||
#define SAY_PREFIGHT_1 -1616008
|
||||
#define SAY_PREFIGHT_2 -1616009
|
||||
#define SAY_PREFIGHT_3 -1616010
|
||||
#define SAY_PREFIGHT_4 -1616011
|
||||
#define SAY_PREFIGHT_5 -1616012
|
||||
//--> Phase1
|
||||
#define SAY_PHASE1_AGGRO -1616013
|
||||
#define SAY_PHASE1_END -1616014
|
||||
#define SAY_PHASE1_SLAY_1 -1616015
|
||||
#define SAY_PHASE1_SLAY_2 -1616016
|
||||
#define SAY_PHASE1_SLAY_3 -1616017
|
||||
|
||||
//--> Phase2 at 50% HP,
|
||||
|
||||
/*Malygos himself is not targetable during this phase, it will end when the adds he spawns are all killed. However, he does continue to play a part in the encounter.
|
||||
During this phase he drops anti-magic zones onto the ground the raid MUST stand inside of, it reduces magical damage taken by 50%. They shrink over time, so it's important that your raid moves to each new one he drops.
|
||||
Throughout the phase, he will deep breath doing ~4k damage per second, unless you are standing inside of the anti-magic zone.
|
||||
The way the fight works during this phase is there are NPCs riding around on disks in the room. There are two types of mobs, Lords and Scions.
|
||||
The Lords will move down onto the group, and need to be tanked (They will one-shot a non-tank). After they die, they drop a disk that a raid member can mount onto, which allows them to fly, to attack the Scions that do not come down to the ground.
|
||||
It is recommended to let melee take the first disks, then ranged. As those mobs die, they also drop disks, which allows the rest of your dps to get onto them.
|
||||
The Scions will continually cast Arcane Blast on random targets on the floor, which is mitigated by the anti-magic zones. While mounted on a disk, you will not take damage.
|
||||
After all of the NPCs riding on the disks die, the players on the disks need to dismount as Phase 3 is about to begin.*/
|
||||
|
||||
//not in db
|
||||
#define SAY_PHASE2_AGGRO -1616018
|
||||
#define SAY_PHASE2_END -1616019
|
||||
#define SAY_PHASE2_SLAY_1 -1616020
|
||||
#define SAY_PHASE2_SLAY_2 -1616021
|
||||
#define SAY_PHASE2_SLAY_3 -1616022
|
||||
//--> Phase3 Malygos destroys the floor, encounter continues on dragon "mounts"
|
||||
#define SAY_PHASE3_INTRO -1616023
|
||||
#define SAY_PHASE3_AGGRO -1616024
|
||||
#define SAY_PHASE3_SLAY_1 -1616025
|
||||
#define SAY_PHASE3_SLAY_2 -1616026
|
||||
#define SAY_PHASE3_SLAY_3 -1616027
|
||||
#define SAY_PHASE3_BIG_ATTACK -1616028
|
||||
|
||||
enum
|
||||
{
|
||||
ACHIEV_TIMED_START_EVENT = 20387,
|
||||
};
|
||||
|
||||
struct boss_malygosAI : public ScriptedAI
|
||||
{
|
||||
boss_malygosAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
instance = me->GetInstanceData();
|
||||
}
|
||||
|
||||
InstanceData *instance;
|
||||
|
||||
uint32 phase;
|
||||
uint32 enrage;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
phase = 1;
|
||||
enrage = 615000; //Source Deadly Boss Mod
|
||||
|
||||
if (instance)
|
||||
instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
if (phase == 1)
|
||||
{
|
||||
DoScriptText(SAY_PHASE1_AGGRO, me);
|
||||
if (instance)
|
||||
instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT);
|
||||
}
|
||||
|
||||
if (phase == 2)
|
||||
DoScriptText(SAY_PHASE1_AGGRO, me);
|
||||
if (phase == 3)
|
||||
DoScriptText(SAY_PHASE1_AGGRO, me);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 /*diff*/)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (phase == 1 && HealthBelowPct(50)) {
|
||||
phase = 2;
|
||||
//spawn adds
|
||||
//set malygos unatackable untill all adds spawned dead
|
||||
//start phase3
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit * victim)
|
||||
{
|
||||
if (victim == me)
|
||||
return;
|
||||
|
||||
if (phase == 1)
|
||||
DoScriptText(RAND(SAY_PHASE1_SLAY_1,SAY_PHASE1_SLAY_2,SAY_PHASE1_SLAY_3), me);
|
||||
if (phase == 2)
|
||||
DoScriptText(RAND(SAY_PHASE2_SLAY_1,SAY_PHASE2_SLAY_2,SAY_PHASE2_SLAY_3), me);
|
||||
if (phase == 3)
|
||||
DoScriptText(RAND(SAY_PHASE3_SLAY_1,SAY_PHASE3_SLAY_2,SAY_PHASE3_SLAY_3), me);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_malygos(Creature* pCreature)
|
||||
{
|
||||
return new boss_malygosAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_malygos()
|
||||
{
|
||||
Script *newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_malygos";
|
||||
newscript->GetAI = &GetAI_boss_malygos;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
#ifndef DEF_EYE_OF_ETERNITY_H
|
||||
#define DEF_EYE_OF_ETERNITY_H
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,21 @@
|
||||
#include "ScriptedPch.h"
|
||||
#include "eye_of_eternity.h"
|
||||
|
||||
struct instance_eye_of_eternity : public ScriptedInstance
|
||||
{
|
||||
instance_eye_of_eternity(Map* pMap) : ScriptedInstance(pMap) {Initialize();};
|
||||
};
|
||||
|
||||
InstanceData* GetInstanceData_instance_eye_of_eternity(Map* pMap)
|
||||
{
|
||||
return new instance_eye_of_eternity(pMap);
|
||||
}
|
||||
|
||||
void AddSC_instance_eye_of_eternity()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "instance_eye_of_eternity";
|
||||
newscript->GetInstanceData = &GetInstanceData_instance_eye_of_eternity;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
@@ -0,0 +1,253 @@
|
||||
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
|
||||
* Copyright (C) 2008 - 2010 TrinityCore <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
|
||||
* (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
|
||||
*/
|
||||
|
||||
#include "ScriptedPch.h"
|
||||
#include "nexus.h"
|
||||
|
||||
enum Spells
|
||||
{
|
||||
//Spells
|
||||
SPELL_SPARK = 47751,
|
||||
H_SPELL_SPARK = 57062,
|
||||
SPELL_RIFT_SHIELD = 47748,
|
||||
SPELL_CHARGE_RIFT = 47747, //Works wrong (affect players, not rifts)
|
||||
SPELL_CREATE_RIFT = 47743, //Don't work, using WA
|
||||
SPELL_ARCANE_ATTRACTION = 57063, //No idea, when it's used
|
||||
};
|
||||
|
||||
enum Adds
|
||||
{
|
||||
MOB_CRAZED_MANA_WRAITH = 26746,
|
||||
MOB_CHAOTIC_RIFT = 26918
|
||||
};
|
||||
enum Yells
|
||||
{
|
||||
//Yell
|
||||
SAY_AGGRO = -1576010,
|
||||
SAY_DEATH = -1576011,
|
||||
SAY_RIFT = -1576012,
|
||||
SAY_SHIELD = -1576013
|
||||
};
|
||||
|
||||
enum Achievs
|
||||
{
|
||||
ACHIEV_CHAOS_THEORY = 2037
|
||||
};
|
||||
|
||||
const Position RiftLocation[6] =
|
||||
{
|
||||
{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 boss_anomalusAI : public ScriptedAI
|
||||
{
|
||||
boss_anomalusAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
}
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
uint8 Phase;
|
||||
uint32 uiSparkTimer;
|
||||
uint32 uiCreateRiftTimer;
|
||||
uint64 uiChaoticRiftGUID;
|
||||
|
||||
bool bDeadChaoticRift; // needed for achievement: Chaos Theory(2037)
|
||||
|
||||
void Reset()
|
||||
{
|
||||
Phase = 0;
|
||||
uiSparkTimer = 5*IN_MILISECONDS;
|
||||
uiChaoticRiftGUID = 0;
|
||||
|
||||
bDeadChaoticRift = false;
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_ANOMALUS_EVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, me);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_ANOMALUS_EVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
|
||||
if (pInstance)
|
||||
{
|
||||
if (IsHeroic() && !bDeadChaoticRift)
|
||||
pInstance->DoCompleteAchievement(ACHIEV_CHAOS_THEORY);
|
||||
pInstance->SetData(DATA_ANOMALUS_EVENT, DONE);
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (me->GetDistance(me->GetHomePosition()) > 60.0f)
|
||||
{
|
||||
//Not blizzlike, hack to avoid an exploit
|
||||
EnterEvadeMode();
|
||||
return;
|
||||
}
|
||||
|
||||
if (me->HasAura(SPELL_RIFT_SHIELD))
|
||||
{
|
||||
if (uiChaoticRiftGUID)
|
||||
{
|
||||
Unit* Rift = Unit::GetUnit((*me), uiChaoticRiftGUID);
|
||||
if (Rift && Rift->isDead())
|
||||
{
|
||||
me->RemoveAurasDueToSpell(SPELL_RIFT_SHIELD);
|
||||
uiChaoticRiftGUID = 0;
|
||||
}
|
||||
return;
|
||||
}
|
||||
} else
|
||||
uiChaoticRiftGUID = 0;
|
||||
|
||||
if ((Phase == 0) && HealthBelowPct(50))
|
||||
{
|
||||
Phase = 1;
|
||||
DoScriptText(SAY_SHIELD, me);
|
||||
DoCast(me, SPELL_RIFT_SHIELD);
|
||||
Creature* Rift = me->SummonCreature(MOB_CHAOTIC_RIFT, RiftLocation[urand(0,5)], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1*IN_MILISECONDS);
|
||||
if (Rift)
|
||||
{
|
||||
//DoCast(Rift, SPELL_CHARGE_RIFT);
|
||||
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
Rift->AI()->AttackStart(pTarget);
|
||||
uiChaoticRiftGUID = Rift->GetGUID();
|
||||
DoScriptText(SAY_RIFT , me);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (uiSparkTimer <= diff)
|
||||
{
|
||||
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(pTarget, SPELL_SPARK);
|
||||
uiSparkTimer = 5*IN_MILISECONDS;
|
||||
} else uiSparkTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_anomalus(Creature* pCreature)
|
||||
{
|
||||
return new boss_anomalusAI (pCreature);
|
||||
}
|
||||
|
||||
enum RiftSpells
|
||||
{
|
||||
SPELL_CHAOTIC_ENERGY_BURST = 47688,
|
||||
SPELL_CHARGED_CHAOTIC_ENERGY_BURST = 47737,
|
||||
SPELL_ARCANEFORM = 48019 //Chaotic Rift visual
|
||||
};
|
||||
|
||||
struct mob_chaotic_riftAI : public Scripted_NoMovementAI
|
||||
{
|
||||
mob_chaotic_riftAI(Creature *c) : Scripted_NoMovementAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
}
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
uint32 uiChaoticEnergyBurstTimer;
|
||||
uint32 uiSummonCrazedManaWraithTimer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
uiChaoticEnergyBurstTimer = 1*IN_MILISECONDS;
|
||||
uiSummonCrazedManaWraithTimer = 5*IN_MILISECONDS;
|
||||
//me->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(me, SPELL_ARCANEFORM, false);
|
||||
}
|
||||
|
||||
void JustDied(Unit * /*killer*/)
|
||||
{
|
||||
if (Creature* pAnomalus = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_ANOMALUS) : 0))
|
||||
CAST_AI(boss_anomalusAI,pAnomalus->AI())->bDeadChaoticRift = true;
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (uiChaoticEnergyBurstTimer <= diff)
|
||||
{
|
||||
Unit* pAnomalus = Unit::GetUnit(*me, pInstance ? pInstance->GetData64(DATA_ANOMALUS) : 0);
|
||||
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
if (pAnomalus && pAnomalus->HasAura(SPELL_RIFT_SHIELD))
|
||||
DoCast(pTarget, SPELL_CHARGED_CHAOTIC_ENERGY_BURST);
|
||||
else
|
||||
DoCast(pTarget, SPELL_CHAOTIC_ENERGY_BURST);
|
||||
uiChaoticEnergyBurstTimer = 1*IN_MILISECONDS;
|
||||
} else uiChaoticEnergyBurstTimer -= diff;
|
||||
|
||||
if (uiSummonCrazedManaWraithTimer <= diff)
|
||||
{
|
||||
Creature* Wraith = me->SummonCreature(MOB_CRAZED_MANA_WRAITH, me->GetPositionX()+1, me->GetPositionY()+1, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1*IN_MILISECONDS);
|
||||
if (Wraith)
|
||||
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
Wraith->AI()->AttackStart(pTarget);
|
||||
Unit* Anomalus = Unit::GetUnit(*me, pInstance ? pInstance->GetData64(DATA_ANOMALUS) : 0);
|
||||
if (Anomalus && Anomalus->HasAura(SPELL_RIFT_SHIELD))
|
||||
uiSummonCrazedManaWraithTimer = 5*IN_MILISECONDS;
|
||||
else
|
||||
uiSummonCrazedManaWraithTimer = 10*IN_MILISECONDS;
|
||||
} else uiSummonCrazedManaWraithTimer -= diff;
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_mob_chaotic_rift(Creature* pCreature)
|
||||
{
|
||||
return new mob_chaotic_riftAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_anomalus()
|
||||
{
|
||||
Script *newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_anomalus";
|
||||
newscript->GetAI = &GetAI_boss_anomalus;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "mob_chaotic_rift";
|
||||
newscript->GetAI = &GetAI_mob_chaotic_rift;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
@@ -0,0 +1,247 @@
|
||||
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
|
||||
* Copyright (C) 2008 - 2010 TrinityCore <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
|
||||
* (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
|
||||
*/
|
||||
|
||||
#include "ScriptedPch.h"
|
||||
#include "nexus.h"
|
||||
|
||||
enum Spells
|
||||
{
|
||||
//Spells
|
||||
SPELL_FROZEN_PRISON = 47854,
|
||||
SPELL_TAIL_SWEEP = 50155,
|
||||
SPELL_CRYSTAL_CHAINS = 50997,
|
||||
SPELL_ENRAGE = 8599,
|
||||
SPELL_CRYSTALFIRE_BREATH = 48096,
|
||||
H_SPELL_CRYSTALFIRE_BREATH = 57091,
|
||||
SPELL_CRYSTALIZE = 48179,
|
||||
SPELL_INTENSE_COLD = 48094,
|
||||
SPELL_INTENSE_COLD_TRIGGERED = 48095
|
||||
};
|
||||
enum Yells
|
||||
{
|
||||
//Yell
|
||||
SAY_AGGRO = -1576040,
|
||||
SAY_SLAY = -1576041,
|
||||
SAY_ENRAGE = -1576042,
|
||||
SAY_DEATH = -1576043,
|
||||
SAY_CRYSTAL_NOVA = -1576044
|
||||
};
|
||||
enum Achievements
|
||||
{
|
||||
ACHIEV_INTENSE_COLD = 2036
|
||||
};
|
||||
enum Misc
|
||||
{
|
||||
DATA_CONTAINMENT_SPHERES = 3
|
||||
};
|
||||
|
||||
struct boss_keristraszaAI : public ScriptedAI
|
||||
{
|
||||
boss_keristraszaAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
}
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
uint32 uiCrystalfireBreathTimer;
|
||||
uint32 uiCrystalChainsCrystalizeTimer;
|
||||
uint32 uiTailSweepTimer;
|
||||
bool bEnrage;
|
||||
|
||||
uint64 auiContainmentSphereGUIDs[DATA_CONTAINMENT_SPHERES];
|
||||
|
||||
uint32 uiCheckIntenseColdTimer;
|
||||
bool bMoreThanTwoIntenseCold; // needed for achievement: Intense Cold(2036)
|
||||
|
||||
void Reset()
|
||||
{
|
||||
uiCrystalfireBreathTimer = 14*IN_MILISECONDS;
|
||||
uiCrystalChainsCrystalizeTimer = DUNGEON_MODE(30*IN_MILISECONDS,11*IN_MILISECONDS);
|
||||
uiTailSweepTimer = 5*IN_MILISECONDS;
|
||||
bEnrage = false;
|
||||
|
||||
uiCheckIntenseColdTimer = 2*IN_MILISECONDS;
|
||||
bMoreThanTwoIntenseCold = false;
|
||||
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);
|
||||
|
||||
RemovePrison(CheckContainmentSpheres());
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_KERISTRASZA_EVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, me);
|
||||
DoCastAOE(SPELL_INTENSE_COLD);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_KERISTRASZA_EVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
|
||||
if (pInstance)
|
||||
{
|
||||
if (IsHeroic() && !bMoreThanTwoIntenseCold)
|
||||
pInstance->DoCompleteAchievement(ACHIEV_INTENSE_COLD);
|
||||
pInstance->SetData(DATA_KERISTRASZA_EVENT, DONE);
|
||||
}
|
||||
}
|
||||
|
||||
void KilledUnit(Unit * /*victim*/)
|
||||
{
|
||||
DoScriptText(SAY_SLAY, me);
|
||||
}
|
||||
|
||||
bool CheckContainmentSpheres(bool remove_prison = false)
|
||||
{
|
||||
if (!pInstance)
|
||||
return false;
|
||||
|
||||
auiContainmentSphereGUIDs[0] = pInstance->GetData64(ANOMALUS_CONTAINMET_SPHERE);
|
||||
auiContainmentSphereGUIDs[1] = pInstance->GetData64(ORMOROKS_CONTAINMET_SPHERE);
|
||||
auiContainmentSphereGUIDs[2] = pInstance->GetData64(TELESTRAS_CONTAINMET_SPHERE);
|
||||
|
||||
GameObject *ContainmentSpheres[DATA_CONTAINMENT_SPHERES];
|
||||
|
||||
for (uint8 i = 0; i < DATA_CONTAINMENT_SPHERES; ++i)
|
||||
{
|
||||
ContainmentSpheres[i] = pInstance->instance->GetGameObject(auiContainmentSphereGUIDs[i]);
|
||||
if (!ContainmentSpheres[i])
|
||||
return false;
|
||||
if (ContainmentSpheres[i]->GetGoState() != GO_STATE_ACTIVE)
|
||||
return false;
|
||||
}
|
||||
if (remove_prison)
|
||||
RemovePrison(true);
|
||||
return true;
|
||||
}
|
||||
|
||||
void RemovePrison(bool remove)
|
||||
{
|
||||
if (remove)
|
||||
{
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
if (me->HasAura(SPELL_FROZEN_PRISON))
|
||||
me->RemoveAurasDueToSpell(SPELL_FROZEN_PRISON);
|
||||
}
|
||||
else
|
||||
{
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
DoCast(me, SPELL_FROZEN_PRISON, false);
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (uiCheckIntenseColdTimer < diff && !bMoreThanTwoIntenseCold)
|
||||
{
|
||||
std::list<HostileReference*> ThreatList = me->getThreatManager().getThreatList();
|
||||
for (std::list<HostileReference*>::const_iterator itr = ThreatList.begin(); itr != ThreatList.end(); ++itr)
|
||||
{
|
||||
Unit *pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid());
|
||||
if (!pTarget || pTarget->GetTypeId() != TYPEID_PLAYER)
|
||||
continue;
|
||||
|
||||
Aura *AuraIntenseCold = pTarget->GetAura(SPELL_INTENSE_COLD_TRIGGERED);
|
||||
if (AuraIntenseCold && AuraIntenseCold->GetStackAmount() > 2)
|
||||
{
|
||||
bMoreThanTwoIntenseCold = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
uiCheckIntenseColdTimer = 2*IN_MILISECONDS;
|
||||
} else uiCheckIntenseColdTimer -= diff;
|
||||
|
||||
if (!bEnrage && HealthBelowPct(25))
|
||||
{
|
||||
DoScriptText(SAY_ENRAGE, me);
|
||||
DoCast(me, SPELL_ENRAGE);
|
||||
bEnrage = true;
|
||||
}
|
||||
|
||||
if (uiCrystalfireBreathTimer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_CRYSTALFIRE_BREATH);
|
||||
uiCrystalfireBreathTimer = 14*IN_MILISECONDS;
|
||||
} else uiCrystalfireBreathTimer -= diff;
|
||||
|
||||
if (uiTailSweepTimer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_TAIL_SWEEP);
|
||||
uiTailSweepTimer = 5*IN_MILISECONDS;
|
||||
} else uiTailSweepTimer -= diff;
|
||||
|
||||
if (uiCrystalChainsCrystalizeTimer <= diff)
|
||||
{
|
||||
DoScriptText(SAY_CRYSTAL_NOVA, me);
|
||||
if (IsHeroic())
|
||||
DoCast(me, SPELL_CRYSTALIZE);
|
||||
else if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, SPELL_CRYSTAL_CHAINS);
|
||||
uiCrystalChainsCrystalizeTimer = DUNGEON_MODE(30*IN_MILISECONDS,11*IN_MILISECONDS);
|
||||
} else uiCrystalChainsCrystalizeTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_keristrasza(Creature* pCreature)
|
||||
{
|
||||
return new boss_keristraszaAI (pCreature);
|
||||
}
|
||||
|
||||
bool GOHello_containment_sphere(Player * /*pPlayer*/, GameObject *pGO)
|
||||
{
|
||||
ScriptedInstance *pInstance = pGO->GetInstanceData();
|
||||
|
||||
Creature *pKeristrasza = Unit::GetCreature(*pGO, pInstance ? pInstance->GetData64(DATA_KERISTRASZA) : 0);
|
||||
if (pKeristrasza && pKeristrasza->isAlive())
|
||||
{
|
||||
// maybe these are hacks :(
|
||||
pGO->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1);
|
||||
pGO->SetGoState(GO_STATE_ACTIVE);
|
||||
|
||||
CAST_AI(boss_keristraszaAI, pKeristrasza->AI())->CheckContainmentSpheres(true);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void AddSC_boss_keristrasza()
|
||||
{
|
||||
Script *newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_keristrasza";
|
||||
newscript->GetAI = &GetAI_boss_keristrasza;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "containment_sphere";
|
||||
newscript->pGOHello = &GOHello_containment_sphere;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
@@ -0,0 +1,327 @@
|
||||
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
|
||||
* Copyright (C) 2008 - 2010 TrinityCore <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
|
||||
* (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
|
||||
*/
|
||||
|
||||
#include "ScriptedPch.h"
|
||||
#include "nexus.h"
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_ICE_NOVA = 47772,
|
||||
H_SPELL_ICE_NOVA = 56935,
|
||||
SPELL_FIREBOMB = 47773,
|
||||
H_SPELL_FIREBOMB = 56934,
|
||||
SPELL_GRAVITY_WELL = 47756,
|
||||
SPELL_TELESTRA_BACK = 47714,
|
||||
|
||||
SPELL_FIRE_MAGUS_VISUAL = 47705,
|
||||
SPELL_FROST_MAGUS_VISUAL = 47706,
|
||||
SPELL_ARCANE_MAGUS_VISUAL = 47704
|
||||
};
|
||||
enum Creatures
|
||||
{
|
||||
MOB_FIRE_MAGUS = 26928,
|
||||
MOB_FROST_MAGUS = 26930,
|
||||
MOB_ARCANE_MAGUS = 26929
|
||||
};
|
||||
enum Yells
|
||||
{
|
||||
SAY_AGGRO = -1576000,
|
||||
SAY_KILL = -1576001,
|
||||
SAY_DEATH = -1576002,
|
||||
SAY_MERGE = -1576003,
|
||||
SAY_SPLIT_1 = -1576004,
|
||||
SAY_SPLIT_2 = -1576005,
|
||||
};
|
||||
enum Achievements
|
||||
{
|
||||
ACHIEV_SPLIT_PERSONALITY = 2150,
|
||||
ACHIEV_TIMER = 5*IN_MILISECONDS
|
||||
};
|
||||
|
||||
const Position CenterOfRoom = {504.80, 89.07, -16.12, 6.27};
|
||||
|
||||
struct boss_magus_telestraAI : public ScriptedAI
|
||||
{
|
||||
boss_magus_telestraAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
}
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
uint64 uiFireMagusGUID;
|
||||
uint64 uiFrostMagusGUID;
|
||||
uint64 uiArcaneMagusGUID;
|
||||
|
||||
bool bFireMagusDead;
|
||||
bool bFrostMagusDead;
|
||||
bool bArcaneMagusDead;
|
||||
bool bIsWaitingToAppear;
|
||||
bool bIsAchievementTimerRunning;
|
||||
|
||||
uint32 uiIsWaitingToAppearTimer;
|
||||
uint32 uiIceNovaTimer;
|
||||
uint32 uiFireBombTimer;
|
||||
uint32 uiGravityWellTimer;
|
||||
uint32 uiCooldown;
|
||||
uint32 uiAchievementTimer;
|
||||
|
||||
uint8 Phase;
|
||||
uint8 uiAchievementProgress;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
Phase = 0;
|
||||
//These times are probably wrong
|
||||
uiIceNovaTimer = 7*IN_MILISECONDS;
|
||||
uiFireBombTimer = 0;
|
||||
uiGravityWellTimer = 15*IN_MILISECONDS;
|
||||
uiCooldown = 0;
|
||||
|
||||
uiFireMagusGUID = 0;
|
||||
uiFrostMagusGUID = 0;
|
||||
uiArcaneMagusGUID = 0;
|
||||
|
||||
uiAchievementProgress = 0;
|
||||
uiAchievementTimer = 0;
|
||||
|
||||
bIsAchievementTimerRunning = false;
|
||||
bIsWaitingToAppear = false;
|
||||
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->SetVisibility(VISIBILITY_ON);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_MAGUS_TELESTRA_EVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, me);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_MAGUS_TELESTRA_EVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
|
||||
if (pInstance)
|
||||
{
|
||||
if (IsHeroic() && uiAchievementProgress == 2)
|
||||
pInstance->DoCompleteAchievement(ACHIEV_SPLIT_PERSONALITY);
|
||||
pInstance->SetData(DATA_MAGUS_TELESTRA_EVENT, DONE);
|
||||
}
|
||||
}
|
||||
|
||||
void KilledUnit(Unit * /*victim*/)
|
||||
{
|
||||
DoScriptText(SAY_KILL, me);
|
||||
}
|
||||
|
||||
uint64 SplitPersonality(uint32 entry)
|
||||
{
|
||||
if (Creature* Summoned = me->SummonCreature(entry, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1*IN_MILISECONDS))
|
||||
{
|
||||
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 *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
Summoned->AI()->AttackStart(pTarget);
|
||||
return Summoned->GetGUID();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void SummonedCreatureDespawn(Creature *summon)
|
||||
{
|
||||
if (summon->isAlive())
|
||||
return;
|
||||
|
||||
if (summon->GetGUID() == uiFireMagusGUID)
|
||||
{
|
||||
bFireMagusDead = true;
|
||||
bIsAchievementTimerRunning = true;
|
||||
}
|
||||
else if (summon->GetGUID() == uiFrostMagusGUID)
|
||||
{
|
||||
bFrostMagusDead = true;
|
||||
bIsAchievementTimerRunning = true;
|
||||
}
|
||||
else if (summon->GetGUID() == uiArcaneMagusGUID)
|
||||
{
|
||||
bArcaneMagusDead = true;
|
||||
bIsAchievementTimerRunning = true;
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (bIsWaitingToAppear)
|
||||
{
|
||||
me->StopMoving();
|
||||
me->AttackStop();
|
||||
if (uiIsWaitingToAppearTimer <= diff)
|
||||
{
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
bIsWaitingToAppear = false;
|
||||
} else uiIsWaitingToAppearTimer -= diff;
|
||||
return;
|
||||
}
|
||||
|
||||
if ((Phase == 1) ||(Phase == 3))
|
||||
{
|
||||
if (bIsAchievementTimerRunning)
|
||||
uiAchievementTimer += diff;
|
||||
if (bFireMagusDead && bFrostMagusDead && bArcaneMagusDead)
|
||||
{
|
||||
if (uiAchievementTimer <= ACHIEV_TIMER)
|
||||
uiAchievementProgress +=1;
|
||||
me->GetMotionMaster()->Clear();
|
||||
me->GetMap()->CreatureRelocation(me, CenterOfRoom.GetPositionX(), CenterOfRoom.GetPositionY(), CenterOfRoom.GetPositionZ(), CenterOfRoom.GetOrientation());
|
||||
DoCast(me, SPELL_TELESTRA_BACK);
|
||||
me->SetVisibility(VISIBILITY_ON);
|
||||
if (Phase == 1)
|
||||
Phase = 2;
|
||||
if (Phase == 3)
|
||||
Phase = 4;
|
||||
uiFireMagusGUID = 0;
|
||||
uiFrostMagusGUID = 0;
|
||||
uiArcaneMagusGUID = 0;
|
||||
bIsWaitingToAppear = true;
|
||||
uiIsWaitingToAppearTimer = 4*IN_MILISECONDS;
|
||||
DoScriptText(SAY_MERGE, me);
|
||||
bIsAchievementTimerRunning = false;
|
||||
uiAchievementTimer = 0;
|
||||
}
|
||||
else
|
||||
return;
|
||||
}
|
||||
|
||||
if ((Phase == 0) && HealthBelowPct(50))
|
||||
{
|
||||
Phase = 1;
|
||||
me->CastStop();
|
||||
me->RemoveAllAuras();
|
||||
me->SetVisibility(VISIBILITY_OFF);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
uiFireMagusGUID = SplitPersonality(MOB_FIRE_MAGUS);
|
||||
uiFrostMagusGUID = SplitPersonality(MOB_FROST_MAGUS);
|
||||
uiArcaneMagusGUID = SplitPersonality(MOB_ARCANE_MAGUS);
|
||||
bFireMagusDead = false;
|
||||
bFrostMagusDead = false;
|
||||
bArcaneMagusDead = false;
|
||||
DoScriptText(RAND(SAY_SPLIT_1,SAY_SPLIT_2), me);
|
||||
return;
|
||||
}
|
||||
|
||||
if (IsHeroic() && (Phase == 2) && HealthBelowPct(10))
|
||||
{
|
||||
Phase = 3;
|
||||
me->CastStop();
|
||||
me->RemoveAllAuras();
|
||||
me->SetVisibility(VISIBILITY_OFF);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
uiFireMagusGUID = SplitPersonality(MOB_FIRE_MAGUS);
|
||||
uiFrostMagusGUID = SplitPersonality(MOB_FROST_MAGUS);
|
||||
uiArcaneMagusGUID = SplitPersonality(MOB_ARCANE_MAGUS);
|
||||
bFireMagusDead = false;
|
||||
bFrostMagusDead = false;
|
||||
bArcaneMagusDead = false;
|
||||
DoScriptText(RAND(SAY_SPLIT_1,SAY_SPLIT_2), me);
|
||||
return;
|
||||
}
|
||||
|
||||
if (uiCooldown)
|
||||
{
|
||||
if (uiCooldown <= diff)
|
||||
uiCooldown = 0;
|
||||
else
|
||||
{
|
||||
uiCooldown -= diff;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (uiIceNovaTimer <= diff)
|
||||
{
|
||||
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
{
|
||||
DoCast(pTarget, SPELL_ICE_NOVA, false);
|
||||
uiCooldown = 1.5*IN_MILISECONDS;
|
||||
}
|
||||
uiIceNovaTimer = 15*IN_MILISECONDS;
|
||||
} else uiIceNovaTimer -= diff;
|
||||
|
||||
if (uiGravityWellTimer <= diff)
|
||||
{
|
||||
if (Unit *pTarget = me->getVictim())
|
||||
{
|
||||
DoCast(pTarget, SPELL_GRAVITY_WELL);
|
||||
uiCooldown = 6*IN_MILISECONDS;
|
||||
}
|
||||
uiGravityWellTimer = 15*IN_MILISECONDS;
|
||||
} else uiGravityWellTimer -= diff;
|
||||
|
||||
if (uiFireBombTimer <= diff)
|
||||
{
|
||||
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
|
||||
{
|
||||
DoCast(pTarget, SPELL_FIREBOMB, false);
|
||||
uiCooldown = 2*IN_MILISECONDS;
|
||||
}
|
||||
uiFireBombTimer = 2*IN_MILISECONDS;
|
||||
} else uiFireBombTimer -=diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_magus_telestra(Creature* pCreature)
|
||||
{
|
||||
return new boss_magus_telestraAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_magus_telestra()
|
||||
{
|
||||
Script *newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_magus_telestra";
|
||||
newscript->GetAI = &GetAI_boss_magus_telestra;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
@@ -0,0 +1,298 @@
|
||||
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
|
||||
* Copyright (C) 2008 - 2010 TrinityCore <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
|
||||
* (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
|
||||
*/
|
||||
|
||||
#include "ScriptedPch.h"
|
||||
#include "nexus.h"
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_CRYSTAL_SPIKES = 47958, //Don't work, using walkaround
|
||||
H_SPELL_CRYSTAL_SPIKES = 57082, //Don't work, using walkaround
|
||||
SPELL_CRYSTALL_SPIKE_DAMAGE = 47944,
|
||||
H_SPELL_CRYSTALL_SPIKE_DAMAGE = 57067,
|
||||
SPELL_CRYSTAL_SPIKE_PREVISUAL = 50442,
|
||||
MOB_CRYSTAL_SPIKE = 27099,
|
||||
SPELL_SPELL_REFLECTION = 47981,
|
||||
SPELL_TRAMPLE = 48016,
|
||||
H_SPELL_TRAMPLE = 57066,
|
||||
SPELL_FRENZY = 48017,
|
||||
SPELL_SUMMON_CRYSTALLINE_TANGLER = 61564, //summons npc 32665
|
||||
SPELL_ROOTS = 28858 //proper spell id is unknown
|
||||
};
|
||||
enum Yells
|
||||
{
|
||||
SAY_AGGRO = -1576020,
|
||||
SAY_DEATH = -1576021,
|
||||
SAY_REFLECT = -1576022,
|
||||
SAY_CRYSTAL_SPIKES = -1576023,
|
||||
SAY_KILL = -1576024
|
||||
};
|
||||
enum Creatures
|
||||
{
|
||||
MOB_CRYSTALLINE_TANGLER = 32665
|
||||
};
|
||||
|
||||
#define SPIKE_DISTANCE 5.0f
|
||||
|
||||
struct boss_ormorokAI : public ScriptedAI
|
||||
{
|
||||
boss_ormorokAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
}
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
bool bFrenzy;
|
||||
bool bCrystalSpikes;
|
||||
uint8 uiCrystalSpikesCount;
|
||||
float fBaseX;
|
||||
float fBaseY;
|
||||
float fBaseZ;
|
||||
float fBaseO;
|
||||
float fSpikeXY[4][2];
|
||||
|
||||
uint32 uiCrystalSpikesTimer;
|
||||
uint32 uiCrystalSpikesTimer2;
|
||||
uint32 uiTrampleTimer;
|
||||
uint32 uiFrenzyTimer;
|
||||
uint32 uiSpellReflectionTimer;
|
||||
uint32 uiSummonCrystallineTanglerTimer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
uiCrystalSpikesTimer = 12*IN_MILISECONDS;
|
||||
uiTrampleTimer = 10*IN_MILISECONDS;
|
||||
uiSpellReflectionTimer = 30*IN_MILISECONDS;
|
||||
uiSummonCrystallineTanglerTimer = 17*IN_MILISECONDS;
|
||||
bFrenzy = false;
|
||||
bCrystalSpikes = false;
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_ORMOROK_EVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, me);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_ORMOROK_EVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_ORMOROK_EVENT, DONE);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit * /*victim*/)
|
||||
{
|
||||
DoScriptText(SAY_KILL, me);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (bCrystalSpikes)
|
||||
if (uiCrystalSpikesTimer2 <= diff)
|
||||
{
|
||||
fSpikeXY[0][0] = fBaseX+(SPIKE_DISTANCE*uiCrystalSpikesCount*cos(fBaseO));
|
||||
fSpikeXY[0][1] = fBaseY+(SPIKE_DISTANCE*uiCrystalSpikesCount*sin(fBaseO));
|
||||
fSpikeXY[1][0] = fBaseX-(SPIKE_DISTANCE*uiCrystalSpikesCount*cos(fBaseO));
|
||||
fSpikeXY[1][1] = fBaseY-(SPIKE_DISTANCE*uiCrystalSpikesCount*sin(fBaseO));
|
||||
fSpikeXY[2][0] = fBaseX+(SPIKE_DISTANCE*uiCrystalSpikesCount*cos(fBaseO-(M_PI/2)));
|
||||
fSpikeXY[2][1] = fBaseY+(SPIKE_DISTANCE*uiCrystalSpikesCount*sin(fBaseO-(M_PI/2)));
|
||||
fSpikeXY[3][0] = fBaseX-(SPIKE_DISTANCE*uiCrystalSpikesCount*cos(fBaseO-(M_PI/2)));
|
||||
fSpikeXY[3][1] = fBaseY-(SPIKE_DISTANCE*uiCrystalSpikesCount*sin(fBaseO-(M_PI/2)));
|
||||
for (uint8 i = 0; i < 4; ++i)
|
||||
me->SummonCreature(MOB_CRYSTAL_SPIKE, fSpikeXY[i][0], fSpikeXY[i][1], fBaseZ, 0, TEMPSUMMON_TIMED_DESPAWN, 7*IN_MILISECONDS);
|
||||
if (++uiCrystalSpikesCount >= 13)
|
||||
bCrystalSpikes = false;
|
||||
uiCrystalSpikesTimer2 = 200;
|
||||
} else uiCrystalSpikesTimer2 -= diff;
|
||||
|
||||
if (!bFrenzy && (me->GetHealth() < me->GetMaxHealth() * 0.25))
|
||||
{
|
||||
DoCast(me, SPELL_FRENZY);
|
||||
bFrenzy = true;
|
||||
}
|
||||
|
||||
if (uiTrampleTimer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_TRAMPLE);
|
||||
uiTrampleTimer = 10*IN_MILISECONDS;
|
||||
} else uiTrampleTimer -= diff;
|
||||
|
||||
if (uiSpellReflectionTimer <= diff)
|
||||
{
|
||||
DoScriptText(SAY_REFLECT, me);
|
||||
DoCast(me, SPELL_SPELL_REFLECTION);
|
||||
uiSpellReflectionTimer = 30*IN_MILISECONDS;
|
||||
} else uiSpellReflectionTimer -= diff;
|
||||
|
||||
if (uiCrystalSpikesTimer <= diff)
|
||||
{
|
||||
DoScriptText(SAY_CRYSTAL_SPIKES, me);
|
||||
bCrystalSpikes = true;
|
||||
uiCrystalSpikesCount = 1;
|
||||
uiCrystalSpikesTimer2 = 0;
|
||||
fBaseX = me->GetPositionX();
|
||||
fBaseY = me->GetPositionY();
|
||||
fBaseZ = me->GetPositionZ();
|
||||
fBaseO = me->GetOrientation();
|
||||
uiCrystalSpikesTimer = 20*IN_MILISECONDS;
|
||||
} else uiCrystalSpikesTimer -= diff;
|
||||
|
||||
if (IsHeroic() && (uiSummonCrystallineTanglerTimer <= diff))
|
||||
{
|
||||
Creature* Crystalline_Tangler = me->SummonCreature(MOB_CRYSTALLINE_TANGLER, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000);
|
||||
if (Crystalline_Tangler)
|
||||
{
|
||||
Unit *pTarget = 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<HostileReference*>::const_iterator i = me->getThreatManager().getThreatList().begin();
|
||||
for (; i != me->getThreatManager().getThreatList().end(); ++i)
|
||||
{
|
||||
Unit* pTemp = Unit::GetUnit((*me),(*i)->getUnitGuid());
|
||||
if (pTemp && pTemp->GetTypeId() == TYPEID_PLAYER && pTemp->getClass() == Healer)
|
||||
{
|
||||
pTarget = pTemp;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (pTarget)
|
||||
break;
|
||||
}
|
||||
if (!pTarget)
|
||||
pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
|
||||
if (pTarget)
|
||||
{
|
||||
Crystalline_Tangler->AI()->AttackStart(pTarget);
|
||||
Crystalline_Tangler->getThreatManager().addThreat(pTarget, 1000000000.0f);
|
||||
}
|
||||
}
|
||||
uiSummonCrystallineTanglerTimer = 17*IN_MILISECONDS;
|
||||
} else uiSummonCrystallineTanglerTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
struct mob_crystal_spikeAI : public Scripted_NoMovementAI
|
||||
{
|
||||
mob_crystal_spikeAI(Creature *c) : Scripted_NoMovementAI(c)
|
||||
{
|
||||
}
|
||||
|
||||
uint32 SpellCrystalSpikeDamageTimer;
|
||||
uint32 SpellCrystalSpikePrevisualTimer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
SpellCrystalSpikeDamageTimer = 3.7*IN_MILISECONDS;
|
||||
SpellCrystalSpikePrevisualTimer = 1*IN_MILISECONDS;
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (SpellCrystalSpikePrevisualTimer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_CRYSTAL_SPIKE_PREVISUAL);
|
||||
SpellCrystalSpikePrevisualTimer = 10*IN_MILISECONDS;
|
||||
} else SpellCrystalSpikePrevisualTimer -= diff;
|
||||
|
||||
if (SpellCrystalSpikeDamageTimer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_CRYSTALL_SPIKE_DAMAGE);
|
||||
SpellCrystalSpikeDamageTimer = 10*IN_MILISECONDS;
|
||||
} else SpellCrystalSpikeDamageTimer -= diff;
|
||||
}
|
||||
};
|
||||
|
||||
struct mob_crystalline_tanglerAI : public ScriptedAI
|
||||
{
|
||||
mob_crystalline_tanglerAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
uint32 uiRootsTimer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
uiRootsTimer = 1*IN_MILISECONDS;
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (uiRootsTimer <= diff)
|
||||
{
|
||||
if (me->IsWithinDist(me->getVictim(), 5.0f, false))
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_ROOTS);
|
||||
uiRootsTimer = 15*IN_MILISECONDS;
|
||||
}
|
||||
} else uiRootsTimer -= diff;
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_mob_crystal_spike(Creature* pCreature)
|
||||
{
|
||||
return new mob_crystal_spikeAI (pCreature);
|
||||
}
|
||||
|
||||
CreatureAI* GetAI_mob_crystalline_tangler(Creature* pCreature)
|
||||
{
|
||||
return new mob_crystalline_tanglerAI (pCreature);
|
||||
}
|
||||
|
||||
CreatureAI* GetAI_boss_ormorok(Creature* pCreature)
|
||||
{
|
||||
return new boss_ormorokAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_ormorok()
|
||||
{
|
||||
Script *newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "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();
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
/* Script Data Start
|
||||
SDName: Boss Commander Kolurg
|
||||
SDAuthor: LordVanMartin
|
||||
SD%Complete:
|
||||
SDComment: Only Alliance Heroic
|
||||
SDCategory:
|
||||
Script Data End */
|
||||
|
||||
/*** SQL START ***
|
||||
update creature_template set scriptname = 'boss_commander_kolurg' where entry = '';
|
||||
*** SQL END ***/
|
||||
#include "ScriptedPch.h"
|
||||
|
||||
#define SPELL_BATTLE_SHOUT 31403
|
||||
#define SPELL_CHARGE 60067
|
||||
#define SPELL_FRIGHTENING_SHOUT 19134
|
||||
#define SPELL_WHIRLWIND_1 38619
|
||||
#define SPELL_WHIRLWIND_2 38618
|
||||
|
||||
//not used
|
||||
//Yell
|
||||
#define SAY_AGGRO -1576024
|
||||
#define SAY_KILL -1576025
|
||||
#define SAY_DEATH -1576026
|
||||
|
||||
struct boss_commander_kolurgAI : public ScriptedAI
|
||||
{
|
||||
boss_commander_kolurgAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
void Reset() {}
|
||||
void EnterCombat(Unit* /*who*/) {}
|
||||
void AttackStart(Unit* /*who*/) {}
|
||||
void MoveInLineOfSight(Unit* /*who*/) {}
|
||||
void UpdateAI(const uint32 /*diff*/)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
void JustDied(Unit* /*killer*/) {}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_commander_kolurg(Creature* pCreature)
|
||||
{
|
||||
return new boss_commander_kolurgAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_commander_kolurg()
|
||||
{
|
||||
Script *newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_commander_kolurg";
|
||||
newscript->GetAI = &GetAI_boss_commander_kolurg;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
/* Script Data Start
|
||||
SDName: Boss Commander Stoutbeard
|
||||
SDAuthor: LordVanMartin
|
||||
SD%Complete:
|
||||
SDComment: Only Horde Heroic
|
||||
SDCategory:
|
||||
Script Data End */
|
||||
|
||||
/*** SQL START ***
|
||||
update creature_template set scriptname = 'boss_commander_stoutbeard' where entry = '';
|
||||
*** SQL END ***/
|
||||
#include "ScriptedPch.h"
|
||||
|
||||
#define SPELL_BATTLE_SHOUT 31403
|
||||
#define SPELL_CHARGE 60067
|
||||
#define SPELL_FRIGHTENING_SHOUT 19134
|
||||
#define SPELL_WHIRLWIND_1 38619
|
||||
#define SPELL_WHIRLWIND_2 38618
|
||||
|
||||
//not used
|
||||
//Yell
|
||||
#define SAY_AGGRO -1576021
|
||||
#define SAY_KILL -1576022
|
||||
#define SAY_DEATH -1576023
|
||||
|
||||
struct boss_commander_stoutbeardAI : public ScriptedAI
|
||||
{
|
||||
boss_commander_stoutbeardAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
void Reset() {}
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, me);
|
||||
}
|
||||
void AttackStart(Unit* /*who*/) {}
|
||||
void MoveInLineOfSight(Unit* /*who*/) {}
|
||||
void UpdateAI(const uint32 /*diff*/)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_commander_stoutbeard(Creature* pCreature)
|
||||
{
|
||||
return new boss_commander_stoutbeardAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_commander_stoutbeard()
|
||||
{
|
||||
Script *newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_commander_stoutbeard";
|
||||
newscript->GetAI = &GetAI_boss_commander_stoutbeard;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
@@ -0,0 +1,259 @@
|
||||
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
|
||||
* Copyright (C) 2008 - 2010 TrinityCore <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
|
||||
* (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
|
||||
*/
|
||||
|
||||
#include "ScriptedPch.h"
|
||||
#include "nexus.h"
|
||||
|
||||
#define NUMBER_OF_ENCOUNTERS 4
|
||||
|
||||
enum Factions
|
||||
{
|
||||
FACTION_HOSTILE_FOR_ALL = 16
|
||||
};
|
||||
|
||||
struct instance_nexus : public ScriptedInstance
|
||||
{
|
||||
instance_nexus(Map *pMap) : ScriptedInstance(pMap) { Initialize(); }
|
||||
|
||||
uint32 m_auiEncounter[NUMBER_OF_ENCOUNTERS];
|
||||
|
||||
uint64 Anomalus;
|
||||
uint64 Keristrasza;
|
||||
|
||||
uint64 AnomalusContainmentSphere;
|
||||
uint64 OrmoroksContainmentSphere;
|
||||
uint64 TelestrasContainmentSphere;
|
||||
|
||||
std::string strInstData;
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
|
||||
|
||||
Anomalus = 0;
|
||||
Keristrasza = 0;
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature *pCreature, bool /*bAdd*/)
|
||||
{
|
||||
Map::PlayerList const &players = instance->GetPlayers();
|
||||
uint32 TeamInInstance = 0;
|
||||
|
||||
if (!players.isEmpty())
|
||||
{
|
||||
if (Player* pPlayer = players.begin()->getSource())
|
||||
TeamInInstance = pPlayer->GetTeam();
|
||||
}
|
||||
switch (pCreature->GetEntry())
|
||||
{
|
||||
case 26763:
|
||||
Anomalus = pCreature->GetGUID();
|
||||
break;
|
||||
case 26723:
|
||||
Keristrasza = pCreature->GetGUID();
|
||||
break;
|
||||
// Alliance npcs are spawned by default, if you are alliance, you will fight against horde npcs.
|
||||
case 26800:
|
||||
{
|
||||
if (ServerAllowsTwoSideGroups())
|
||||
pCreature->setFaction(FACTION_HOSTILE_FOR_ALL);
|
||||
if (TeamInInstance == ALLIANCE)
|
||||
pCreature->UpdateEntry(26799, HORDE);
|
||||
break;
|
||||
}
|
||||
case 26802:
|
||||
{
|
||||
if (ServerAllowsTwoSideGroups())
|
||||
pCreature->setFaction(FACTION_HOSTILE_FOR_ALL);
|
||||
if (TeamInInstance == ALLIANCE)
|
||||
pCreature->UpdateEntry(26801, HORDE);
|
||||
break;
|
||||
}
|
||||
case 26805:
|
||||
{
|
||||
if (ServerAllowsTwoSideGroups())
|
||||
pCreature->setFaction(FACTION_HOSTILE_FOR_ALL);
|
||||
if (TeamInInstance == ALLIANCE)
|
||||
pCreature->UpdateEntry(26803, HORDE);
|
||||
break;
|
||||
}
|
||||
case 27949:
|
||||
{
|
||||
if (ServerAllowsTwoSideGroups())
|
||||
pCreature->setFaction(FACTION_HOSTILE_FOR_ALL);
|
||||
if (TeamInInstance == ALLIANCE)
|
||||
pCreature->UpdateEntry(27947, HORDE);
|
||||
break;
|
||||
}
|
||||
case 26796:
|
||||
{
|
||||
if (ServerAllowsTwoSideGroups())
|
||||
pCreature->setFaction(FACTION_HOSTILE_FOR_ALL);
|
||||
if (TeamInInstance == ALLIANCE)
|
||||
pCreature->UpdateEntry(26798, HORDE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void OnGameObjectCreate(GameObject *pGo, bool /*bAdd*/)
|
||||
{
|
||||
switch (pGo->GetEntry())
|
||||
{
|
||||
case 188527:
|
||||
{
|
||||
AnomalusContainmentSphere = pGo->GetGUID();
|
||||
if (m_auiEncounter[1] == DONE)
|
||||
pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1);
|
||||
break;
|
||||
}
|
||||
case 188528:
|
||||
{
|
||||
OrmoroksContainmentSphere = pGo->GetGUID();
|
||||
if (m_auiEncounter[2] == DONE)
|
||||
pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1);
|
||||
break;
|
||||
}
|
||||
case 188526:
|
||||
{
|
||||
TelestrasContainmentSphere = pGo->GetGUID();
|
||||
if (m_auiEncounter[0] == DONE)
|
||||
pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 identifier)
|
||||
{
|
||||
switch(identifier)
|
||||
{
|
||||
case DATA_MAGUS_TELESTRA_EVENT: return m_auiEncounter[0];
|
||||
case DATA_ANOMALUS_EVENT: return m_auiEncounter[1];
|
||||
case DATA_ORMOROK_EVENT: return m_auiEncounter[2];
|
||||
case DATA_KERISTRASZA_EVENT: return m_auiEncounter[3];
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void SetData(uint32 identifier, uint32 data)
|
||||
{
|
||||
switch (identifier)
|
||||
{
|
||||
case DATA_MAGUS_TELESTRA_EVENT:
|
||||
{
|
||||
if (data == DONE)
|
||||
{
|
||||
GameObject *Sphere = instance->GetGameObject(TelestrasContainmentSphere);
|
||||
if (Sphere)
|
||||
Sphere->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1);
|
||||
}
|
||||
m_auiEncounter[0] = data;
|
||||
break;
|
||||
}
|
||||
case DATA_ANOMALUS_EVENT:
|
||||
{
|
||||
if (data == DONE)
|
||||
{
|
||||
if (GameObject *Sphere = instance->GetGameObject(AnomalusContainmentSphere))
|
||||
Sphere->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1);
|
||||
}
|
||||
m_auiEncounter[1] = data;
|
||||
break;
|
||||
}
|
||||
case DATA_ORMOROK_EVENT:
|
||||
{
|
||||
if (data == DONE)
|
||||
{
|
||||
if (GameObject *Sphere = instance->GetGameObject(OrmoroksContainmentSphere))
|
||||
Sphere->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1);
|
||||
}
|
||||
m_auiEncounter[2] = data;
|
||||
break;
|
||||
}
|
||||
case DATA_KERISTRASZA_EVENT:
|
||||
m_auiEncounter[3] = data;
|
||||
break;
|
||||
}
|
||||
|
||||
if (data == DONE)
|
||||
{
|
||||
OUT_SAVE_INST_DATA;
|
||||
|
||||
std::ostringstream saveStream;
|
||||
saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " "
|
||||
<< m_auiEncounter[3];
|
||||
|
||||
strInstData = saveStream.str();
|
||||
|
||||
SaveToDB();
|
||||
OUT_SAVE_INST_DATA_COMPLETE;
|
||||
}
|
||||
}
|
||||
|
||||
uint64 GetData64(uint32 uiIdentifier)
|
||||
{
|
||||
switch(uiIdentifier)
|
||||
{
|
||||
case DATA_ANOMALUS: return Anomalus;
|
||||
case DATA_KERISTRASZA: return Keristrasza;
|
||||
case ANOMALUS_CONTAINMET_SPHERE: return AnomalusContainmentSphere;
|
||||
case ORMOROKS_CONTAINMET_SPHERE: return OrmoroksContainmentSphere;
|
||||
case TELESTRAS_CONTAINMET_SPHERE: return TelestrasContainmentSphere;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::string GetSaveData()
|
||||
{
|
||||
return strInstData;
|
||||
}
|
||||
|
||||
void Load(const char *chrIn)
|
||||
{
|
||||
if (!chrIn)
|
||||
{
|
||||
OUT_LOAD_INST_DATA_FAIL;
|
||||
return;
|
||||
}
|
||||
|
||||
OUT_LOAD_INST_DATA(chrIn);
|
||||
|
||||
std::istringstream loadStream(chrIn);
|
||||
loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3];
|
||||
|
||||
for (uint8 i = 0; i < NUMBER_OF_ENCOUNTERS; ++i)
|
||||
if (m_auiEncounter[i] == IN_PROGRESS)
|
||||
m_auiEncounter[i] = NOT_STARTED;
|
||||
|
||||
OUT_LOAD_INST_DATA_COMPLETE;
|
||||
}
|
||||
};
|
||||
|
||||
InstanceData *GetInstanceData_instance_nexus(Map *pMap)
|
||||
{
|
||||
return new instance_nexus(pMap);
|
||||
}
|
||||
|
||||
void AddSC_instance_nexus()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "instance_nexus";
|
||||
newscript->GetInstanceData = &GetInstanceData_instance_nexus;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
/* Copyright (C) 2008 - 2010 TrinityCore <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
|
||||
* (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
|
||||
*/
|
||||
|
||||
#ifndef DEF_NEXUS_H
|
||||
#define DEF_NEXUS_H
|
||||
|
||||
enum eTypes
|
||||
{
|
||||
DATA_MAGUS_TELESTRA_EVENT,
|
||||
DATA_ANOMALUS_EVENT,
|
||||
DATA_ORMOROK_EVENT,
|
||||
DATA_KERISTRASZA_EVENT,
|
||||
|
||||
DATA_ANOMALUS,
|
||||
DATA_KERISTRASZA,
|
||||
|
||||
ANOMALUS_CONTAINMET_SPHERE,
|
||||
ORMOROKS_CONTAINMET_SPHERE,
|
||||
TELESTRAS_CONTAINMET_SPHERE
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,218 @@
|
||||
/* Copyright (C) 2008 - 2010 TrinityCore <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
|
||||
* (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
|
||||
*/
|
||||
|
||||
#include "ScriptedPch.h"
|
||||
#include "oculus.h"
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_MAGIC_PULL = 51336,
|
||||
SPELL_MAGIC_PULL_EFFECT = 50770,
|
||||
SPELL_THUNDERING_STOMP = 50774,
|
||||
SPELL_THUNDERING_STOMP_H = 59370,
|
||||
SPELL_UNSTABLE_SPHERE_PASSIVE = 50756,
|
||||
SPELL_UNSTABLE_SPHERE_PULSE = 50757,
|
||||
SPELL_UNSTABLE_SPHERE_TIMER = 50758,
|
||||
NPC_UNSTABLE_SPHERE = 28166,
|
||||
};
|
||||
|
||||
//not in db
|
||||
enum Yells
|
||||
{
|
||||
SAY_AGGRO = -1578000,
|
||||
SAY_KILL_1 = -1578001,
|
||||
SAY_KILL_2 = -1578002,
|
||||
SAY_KILL_3 = -1578003,
|
||||
SAY_DEATH = -1578004,
|
||||
SAY_PULL_1 = -1578005,
|
||||
SAY_PULL_2 = -1578006,
|
||||
SAY_PULL_3 = -1578007,
|
||||
SAY_PULL_4 = -1578008,
|
||||
SAY_STOMP_1 = -1578009,
|
||||
SAY_STOMP_2 = -1578010,
|
||||
SAY_STOMP_3 = -1578011
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
ACHIEV_TIMED_START_EVENT = 18153,
|
||||
};
|
||||
|
||||
struct boss_drakosAI : public ScriptedAI
|
||||
{
|
||||
boss_drakosAI(Creature* pCreature) : ScriptedAI(pCreature), lSummons(me)
|
||||
{
|
||||
pInstance = pCreature->GetInstanceData();
|
||||
}
|
||||
|
||||
uint32 uiMagicPullTimer;
|
||||
uint32 uiStompTimer;
|
||||
uint32 uiBombSummonTimer;
|
||||
|
||||
bool bPostPull;
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
SummonList lSummons;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
lSummons.DespawnAll();
|
||||
uiMagicPullTimer = 15000;
|
||||
uiStompTimer = 17000;
|
||||
uiBombSummonTimer = 2000;
|
||||
|
||||
bPostPull = false;
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_DRAKOS_EVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, me);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_DRAKOS_EVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* pSummon)
|
||||
{
|
||||
lSummons.Summon(pSummon);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 uiDiff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (uiBombSummonTimer <= uiDiff)
|
||||
{
|
||||
Position pPosition;
|
||||
me->GetPosition(&pPosition);
|
||||
|
||||
if (bPostPull)
|
||||
{
|
||||
for (uint8 uiI = 0; uiI >= 3; uiI++)
|
||||
{
|
||||
me->GetRandomNearPosition(pPosition, float(urand(0,10)));
|
||||
me->SummonCreature(NPC_UNSTABLE_SPHERE, pPosition);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
me->GetRandomNearPosition(pPosition, float(urand(0,10)));
|
||||
me->SummonCreature(NPC_UNSTABLE_SPHERE, pPosition);
|
||||
}
|
||||
|
||||
uiBombSummonTimer = 2000;
|
||||
} else uiBombSummonTimer -= uiDiff;
|
||||
|
||||
if (uiMagicPullTimer <= uiDiff)
|
||||
{
|
||||
DoCast(SPELL_MAGIC_PULL);
|
||||
|
||||
bPostPull = true;
|
||||
|
||||
uiMagicPullTimer = 15000;
|
||||
} else uiMagicPullTimer -= uiDiff;
|
||||
|
||||
if (uiStompTimer <= uiDiff)
|
||||
{
|
||||
DoScriptText(RAND(SAY_STOMP_1,SAY_STOMP_2,SAY_STOMP_3), me);
|
||||
DoCast(SPELL_THUNDERING_STOMP);
|
||||
uiStompTimer = 17000;
|
||||
} else uiStompTimer -= uiDiff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
|
||||
if (pInstance)
|
||||
{
|
||||
pInstance->SetData(DATA_DRAKOS_EVENT, DONE);
|
||||
// start achievement timer (kill Eregos within 20 min)
|
||||
pInstance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT);
|
||||
}
|
||||
|
||||
lSummons.DespawnAll();
|
||||
}
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
{
|
||||
DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2,SAY_KILL_3), me);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_drakos(Creature* pCreature)
|
||||
{
|
||||
return new boss_drakosAI (pCreature);
|
||||
}
|
||||
|
||||
struct npc_unstable_sphereAI : public ScriptedAI
|
||||
{
|
||||
npc_unstable_sphereAI(Creature* pCreature) : ScriptedAI(pCreature) {}
|
||||
|
||||
uint32 uiPulseTimer;
|
||||
uint32 uiDeathTimer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
me->GetMotionMaster()->MoveRandom(40.0f);
|
||||
|
||||
me->AddAura(SPELL_UNSTABLE_SPHERE_PASSIVE, me);
|
||||
me->AddAura(SPELL_UNSTABLE_SPHERE_TIMER, me);
|
||||
|
||||
uiPulseTimer = 3000;
|
||||
uiDeathTimer = 19000;
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 uiDiff)
|
||||
{
|
||||
if (uiPulseTimer <= uiDiff)
|
||||
{
|
||||
DoCast(SPELL_UNSTABLE_SPHERE_PULSE);
|
||||
uiPulseTimer = 3*IN_MILISECONDS;
|
||||
} else uiPulseTimer -= uiDiff;
|
||||
|
||||
if (uiDeathTimer <= uiDiff)
|
||||
me->DisappearAndDie();
|
||||
else uiDeathTimer -= uiDiff;
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_npc_unstable_sphere(Creature* pCreature)
|
||||
{
|
||||
return new npc_unstable_sphereAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_drakos()
|
||||
{
|
||||
Script* newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_drakos";
|
||||
newscript->GetAI = &GetAI_boss_drakos;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "npc_unstable_sphere";
|
||||
newscript->GetAI = &GetAI_npc_unstable_sphere;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
@@ -0,0 +1,129 @@
|
||||
/* Copyright (C) 2008 - 2010 TrinityCore <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
|
||||
* (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
|
||||
*/
|
||||
|
||||
#include "ScriptedPch.h"
|
||||
#include "oculus.h"
|
||||
|
||||
//Types of drake mounts: Ruby(Tank), Amber(DPS), Emerald(Healer)
|
||||
//Two Repeating phases
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_ARCANE_BARRAGE = 50804,
|
||||
H_SPELL_ARCANE_BARRAGE = 59381,
|
||||
SPELL_ARCANE_VOLLEY = 51153,
|
||||
H_SPELL_ARCANE_VOLLEY = 59382,
|
||||
SPELL_ENRAGED_ASSAULT = 51170,
|
||||
SPELL_PLANAR_ANOMALIES = 57959,
|
||||
SPELL_PLANAR_SHIFT = 51162,
|
||||
};
|
||||
/*Ruby Drake ,
|
||||
(npc 27756) (item 37860)
|
||||
(summoned by spell Ruby Essence = 37860 ---> Call Amber Drake == 49462 ---> Summon 27756)
|
||||
*/
|
||||
enum RubyDrake
|
||||
{
|
||||
NPC_RUBY_DRAKE_VEHICLE = 27756,
|
||||
SPELL_RIDE_RUBY_DRAKE_QUE = 49463, //Apply Aura: Periodic Trigger, Interval: 3 seconds ---> 49464
|
||||
SPELL_RUBY_DRAKE_SADDLE = 49464, //Allows you to ride on the back of an Amber Drake. ---> Dummy
|
||||
SPELL_RUBY_SEARING_WRATH = 50232, //(60 yds) - Instant - Breathes a stream of fire at an enemy dragon, dealing 6800 to 9200 Fire damage and then jumping to additional dragons within 30 yards. Each jump increases the damage by 50%. Affects up to 5 total targets
|
||||
SPELL_RUBY_EVASIVE_AURA = 50248, //Instant - Allows the Ruby Drake to generate Evasive Charges when hit by hostile attacks and spells.
|
||||
SPELL_RUBY_EVASIVE_MANEUVERS = 50240, //Instant - 5 sec. cooldown - Allows your drake to dodge all incoming attacks and spells. Requires Evasive Charges to use. Each attack or spell dodged while this ability is active burns one Evasive Charge. Lasts 30 sec. or until all charges are exhausted.
|
||||
//you do not have acces to until you kill Mage-Lord Urom
|
||||
SPELL_RUBY_MARTYR = 50253 //Instant - 10 sec. cooldown - Redirect all harmful spells cast at friendly drakes to yourself for 10 sec.
|
||||
};
|
||||
/*Amber Drake,
|
||||
(npc 27755) (item 37859)
|
||||
(summoned by spell Amber Essence = 37859 ---> Call Amber Drake == 49461 ---> Summon 27755)
|
||||
*/
|
||||
enum AmberDrake
|
||||
{
|
||||
NPC_AMBER_DRAKE_VEHICLE = 27755,
|
||||
SPELL_RIDE_AMBER_DRAKE_QUE = 49459, //Apply Aura: Periodic Trigger, Interval: 3 seconds ---> 49460
|
||||
SPELL_AMBER_DRAKE_SADDLE = 49460, //Allows you to ride on the back of an Amber Drake. ---> Dummy
|
||||
SPELL_AMBER_SHOCK_LANCE = 49840, //(60 yds) - Instant - Deals 4822 to 5602 Arcane damage and detonates all Shock Charges on an enemy dragon. Damage is increased by 6525 for each detonated.
|
||||
// SPELL_AMBER_STOP_TIME //Instant - 1 min cooldown - Halts the passage of time, freezing all enemy dragons in place for 10 sec. This attack applies 5 Shock Charges to each affected target.
|
||||
//you do not have access to until you kill the Mage-Lord Urom.
|
||||
SPELL_AMBER_TEMPORAL_RIFT = 49592 //(60 yds) - Channeled - Channels a temporal rift on an enemy dragon for 10 sec. While trapped in the rift, all damage done to the target is increased by 100%. In addition, for every 15,000 damage done to a target affected by Temporal Rift, 1 Shock Charge is generated.
|
||||
};
|
||||
/*Emerald Drake,
|
||||
(npc 27692) (item 37815),
|
||||
(summoned by spell Emerald Essence = 37815 ---> Call Emerald Drake == 49345 ---> Summon 27692)
|
||||
*/
|
||||
enum EmeraldDrake
|
||||
{
|
||||
NPC_EMERALD_DRAKE_VEHICLE = 27692,
|
||||
SPELL_RIDE_EMERALD_DRAKE_QUE = 49427, //Apply Aura: Periodic Trigger, Interval: 3 seconds ---> 49346
|
||||
SPELL_EMERALD_DRAKE_SADDLE = 49346, //Allows you to ride on the back of an Amber Drake. ---> Dummy
|
||||
SPELL_EMERALD_LEECHING_POISON = 50328, //(60 yds) - Instant - Poisons the enemy dragon, leeching 1300 to the caster every 2 sec. for 12 sec. Stacks up to 3 times.
|
||||
SPELL_EMERALD_TOUCH_THE_NIGHTMARE = 50341, //(60 yds) - Instant - Consumes 30% of the caster's max health to inflict 25,000 nature damage to an enemy dragon and reduce the damage it deals by 25% for 30 sec.
|
||||
// you do not have access to until you kill the Mage-Lord Urom
|
||||
SPELL_EMERALD_DREAM_FUNNEL = 50344 //(60 yds) - Channeled - Transfers 5% of the caster's max health to a friendly drake every second for 10 seconds as long as the caster channels.
|
||||
};
|
||||
|
||||
struct boss_eregosAI : public ScriptedAI
|
||||
{
|
||||
boss_eregosAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
}
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_EREGOS_EVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_EREGOS_EVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void AttackStart(Unit* /*who*/) {}
|
||||
void MoveInLineOfSight(Unit* /*who*/) {}
|
||||
void UpdateAI(const uint32 /*diff*/)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_EREGOS_EVENT, DONE);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_eregos(Creature* pCreature)
|
||||
{
|
||||
return new boss_eregosAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_eregos()
|
||||
{
|
||||
Script *newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_eregos";
|
||||
newscript->GetAI = &GetAI_boss_eregos;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
@@ -0,0 +1,356 @@
|
||||
/* Copyright (C) 2008 - 2010 TrinityCore <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
|
||||
* (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: Urom
|
||||
SD%Complete: 80
|
||||
SDComment: Is not working SPELL_ARCANE_SHIELD. SPELL_FROSTBOMB has some issues, the damage aura should not stack.
|
||||
SDCategory: Instance Script
|
||||
EndScriptData */
|
||||
|
||||
#include "ScriptedPch.h"
|
||||
#include "oculus.h"
|
||||
|
||||
enum Spells
|
||||
{
|
||||
|
||||
SPELL_ARCANE_SHIELD = 53813, //Dummy --> Channeled, shields the caster from damage.
|
||||
SPELL_EMPOWERED_ARCANE_EXPLOSION = 51110,
|
||||
SPELL_EMPOWERED_ARCANE_EXPLOSION_2 = 59377,
|
||||
SPELL_FROSTBOMB = 51103, //Urom throws a bomb, hitting its target with the highest aggro which inflict directly 650 frost damage and drops a frost zone on the ground. This zone deals 650 frost damage per second and reduce the movement speed by 35%. Lasts 1 minute.
|
||||
SPELL_SUMMON_MENAGERIE = 50476, //Summons an assortment of creatures and teleports the caster to safety.
|
||||
SPELL_SUMMON_MENAGERIE_2 = 50495,
|
||||
SPELL_SUMMON_MENAGERIE_3 = 50496,
|
||||
SPELL_TELEPORT = 51112, //Teleports to the center of Oculus
|
||||
SPELL_TIME_BOMB = 51121, //Deals arcane damage to a random player, and after 6 seconds, deals zone damage to nearby equal to the health missing of the target afflicted by the debuff.
|
||||
SPELL_TIME_BOMB_2 = 59376
|
||||
};
|
||||
|
||||
enum Yells
|
||||
{
|
||||
SAY_AGGRO_1 = -1578000,
|
||||
SAY_AGGRO_2 = -1578001,
|
||||
SAY_AGGRO_3 = -1578002,
|
||||
SAY_AGGRO_4 = -1578003,
|
||||
SAY_TELEPORT = -1578004,
|
||||
};
|
||||
|
||||
enum eCreature
|
||||
{
|
||||
NPC_PHANTASMAL_CLOUDSCRAPER = 27645,
|
||||
NPC_PHANTASMAL_MAMMOTH = 27642,
|
||||
NPC_PHANTASMAL_WOLF = 27644,
|
||||
|
||||
NPC_PHANTASMAL_AIR = 27650,
|
||||
NPC_PHANTASMAL_FIRE = 27651,
|
||||
NPC_PHANTASMAL_WATER = 27653,
|
||||
|
||||
NPC_PHANTASMAL_MURLOC = 27649,
|
||||
NPC_PHANTASMAL_NAGAL = 27648,
|
||||
NPC_PHANTASMAL_OGRE = 27647
|
||||
};
|
||||
|
||||
struct Summons
|
||||
{
|
||||
uint32 uiEntry[4];
|
||||
};
|
||||
|
||||
static Summons Group[]=
|
||||
{
|
||||
{NPC_PHANTASMAL_CLOUDSCRAPER,NPC_PHANTASMAL_CLOUDSCRAPER,NPC_PHANTASMAL_MAMMOTH,NPC_PHANTASMAL_WOLF},
|
||||
{NPC_PHANTASMAL_AIR,NPC_PHANTASMAL_AIR,NPC_PHANTASMAL_WATER,NPC_PHANTASMAL_FIRE},
|
||||
{NPC_PHANTASMAL_OGRE,NPC_PHANTASMAL_OGRE,NPC_PHANTASMAL_NAGAL,NPC_PHANTASMAL_MURLOC}
|
||||
};
|
||||
|
||||
static uint32 TeleportSpells[]=
|
||||
{
|
||||
SPELL_SUMMON_MENAGERIE,SPELL_SUMMON_MENAGERIE_2,SPELL_SUMMON_MENAGERIE_3
|
||||
};
|
||||
|
||||
static int32 SayAggro[]=
|
||||
{
|
||||
SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3,SAY_AGGRO_4
|
||||
};
|
||||
|
||||
struct boss_uromAI : public ScriptedAI
|
||||
{
|
||||
boss_uromAI(Creature* pCreature) : ScriptedAI(pCreature)
|
||||
{
|
||||
pInstance = pCreature->GetInstanceData();
|
||||
}
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
float x,y;
|
||||
|
||||
bool bCanCast;
|
||||
bool bCanGoBack;
|
||||
|
||||
uint8 uiGroup[3];
|
||||
|
||||
uint32 uiTeleportTimer;
|
||||
uint32 uiArcaneExplosionTimer;
|
||||
uint32 uiCastArcaneExplosionTimer;
|
||||
uint32 uiFrostBombTimer;
|
||||
uint32 uiTimeBombTimer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
if (pInstance && pInstance->GetData(DATA_VAROS_EVENT) != DONE)
|
||||
DoCast(SPELL_ARCANE_SHIELD);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_UROM_EVENT, NOT_STARTED);
|
||||
|
||||
if (pInstance && pInstance->GetData(DATA_UROM_PLATAFORM) == 0)
|
||||
{
|
||||
uiGroup[0] = 0;
|
||||
uiGroup[1] = 0;
|
||||
uiGroup[2] = 0;
|
||||
}
|
||||
|
||||
x,y = 0.0f;
|
||||
bCanCast = false;
|
||||
bCanGoBack = false;
|
||||
|
||||
me->GetMotionMaster()->MoveIdle();
|
||||
|
||||
uiTeleportTimer = urand(30000,35000);
|
||||
uiArcaneExplosionTimer = 9000;
|
||||
uiCastArcaneExplosionTimer = 2000;
|
||||
uiFrostBombTimer = urand(5000,8000);
|
||||
uiTimeBombTimer = urand(20000,25000);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* pWho)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_UROM_EVENT, IN_PROGRESS);
|
||||
|
||||
SetGroups();
|
||||
SummonGroups();
|
||||
CastTeleport();
|
||||
|
||||
if (pInstance && pInstance->GetData(DATA_UROM_PLATAFORM) != 3)
|
||||
pInstance->SetData(DATA_UROM_PLATAFORM,pInstance->GetData(DATA_UROM_PLATAFORM)+1);
|
||||
}
|
||||
|
||||
void AttackStart(Unit* pWho)
|
||||
{
|
||||
if (!pWho)
|
||||
return;
|
||||
|
||||
if (me->GetPositionZ() > 518.63)
|
||||
DoStartNoMovement(pWho);
|
||||
|
||||
if (me->GetPositionZ() < 518.63)
|
||||
{
|
||||
if (me->Attack(pWho, true))
|
||||
{
|
||||
DoScriptText(SayAggro[3],me);
|
||||
|
||||
me->SetInCombatWith(pWho);
|
||||
pWho->SetInCombatWith(me);
|
||||
|
||||
me->GetMotionMaster()->MoveChase(pWho, 0,0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SetGroups()
|
||||
{
|
||||
if (!pInstance || pInstance->GetData(DATA_UROM_PLATAFORM) != 0)
|
||||
return;
|
||||
|
||||
while (uiGroup[0] == uiGroup[1] || uiGroup[0] == uiGroup[2] || uiGroup[1] == uiGroup[2])
|
||||
{
|
||||
uiGroup[0] = urand(0,2);
|
||||
uiGroup[1] = urand(0,2);
|
||||
uiGroup[2] = urand(0,2);
|
||||
}
|
||||
}
|
||||
|
||||
void SetPosition(uint8 uiI)
|
||||
{
|
||||
switch(uiI)
|
||||
{
|
||||
case 0:
|
||||
x = me->GetPositionX() + 4;
|
||||
y = me->GetPositionY() - 4;
|
||||
break;
|
||||
case 1:
|
||||
x = me->GetPositionX() + 4;
|
||||
y = me->GetPositionY() + 4;
|
||||
break;
|
||||
case 2:
|
||||
x = me->GetPositionX() - 4;
|
||||
y = me->GetPositionY() + 4;
|
||||
break;
|
||||
case 3:
|
||||
x = me->GetPositionX() - 4;
|
||||
y = me->GetPositionY() - 4;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void SummonGroups()
|
||||
{
|
||||
if (!pInstance || pInstance->GetData(DATA_UROM_PLATAFORM) > 2)
|
||||
return;
|
||||
|
||||
for (uint8 uiI = 0; uiI < 4 ; uiI++)
|
||||
{
|
||||
SetPosition(uiI);
|
||||
me->SummonCreature(Group[uiGroup[pInstance->GetData(DATA_UROM_PLATAFORM)]].uiEntry[uiI],x,y,me->GetPositionZ(),me->GetOrientation());
|
||||
}
|
||||
}
|
||||
|
||||
void CastTeleport()
|
||||
{
|
||||
if (!pInstance || pInstance->GetData(DATA_UROM_PLATAFORM) > 2)
|
||||
return;
|
||||
|
||||
DoScriptText(SayAggro[pInstance->GetData(DATA_UROM_PLATAFORM)],me);
|
||||
DoCast(TeleportSpells[pInstance->GetData(DATA_UROM_PLATAFORM)]);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 uiDiff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (!pInstance || pInstance->GetData(DATA_UROM_PLATAFORM) < 2)
|
||||
return;
|
||||
|
||||
if (uiTeleportTimer <= uiDiff)
|
||||
{
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
DoScriptText(SAY_TELEPORT,me);
|
||||
me->GetMotionMaster()->MoveIdle();
|
||||
DoCast(SPELL_TELEPORT);
|
||||
uiTeleportTimer = urand(30000,35000);
|
||||
|
||||
} else uiTeleportTimer -= uiDiff;
|
||||
|
||||
if (bCanCast && !me->FindCurrentSpellBySpellId(SPELL_EMPOWERED_ARCANE_EXPLOSION))
|
||||
{
|
||||
if (uiCastArcaneExplosionTimer <= uiDiff)
|
||||
{
|
||||
bCanCast = false;
|
||||
bCanGoBack = true;
|
||||
DoCastAOE(SPELL_EMPOWERED_ARCANE_EXPLOSION);
|
||||
uiCastArcaneExplosionTimer = 2000;
|
||||
}else uiCastArcaneExplosionTimer -= uiDiff;
|
||||
}
|
||||
|
||||
if (bCanGoBack)
|
||||
{
|
||||
if (uiArcaneExplosionTimer <= uiDiff)
|
||||
{
|
||||
Position pPos;
|
||||
me->getVictim()->GetPosition(&pPos);
|
||||
|
||||
me->NearTeleportTo(pPos.GetPositionX(),pPos.GetPositionY(),pPos.GetPositionZ(),pPos.GetOrientation());
|
||||
me->GetMotionMaster()->MoveChase(me->getVictim(),0,0);
|
||||
me->SetUnitMovementFlags(MOVEMENTFLAG_WALK_MODE);
|
||||
|
||||
bCanCast = false;
|
||||
bCanGoBack = false;
|
||||
uiArcaneExplosionTimer = 9000;
|
||||
} else uiArcaneExplosionTimer -= uiDiff;
|
||||
}
|
||||
|
||||
if (!me->IsNonMeleeSpellCasted(false, true, true))
|
||||
{
|
||||
if (uiFrostBombTimer <= uiDiff)
|
||||
{
|
||||
DoCastVictim(SPELL_FROSTBOMB);
|
||||
uiFrostBombTimer = urand(5000,8000);
|
||||
} else uiFrostBombTimer -= uiDiff;
|
||||
|
||||
if (uiTimeBombTimer <= uiDiff)
|
||||
{
|
||||
if (Unit* pUnit = SelectTarget(SELECT_TARGET_RANDOM))
|
||||
DoCast(pUnit,SPELL_TIME_BOMB);
|
||||
|
||||
uiTimeBombTimer = urand(20000,25000);
|
||||
} else uiTimeBombTimer -= uiDiff;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_UROM_EVENT, DONE);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* pSummon)
|
||||
{
|
||||
pSummon->SetInCombatWithZone();
|
||||
}
|
||||
|
||||
void LeaveCombat()
|
||||
{
|
||||
me->RemoveAllAuras();
|
||||
me->CombatStop(false);
|
||||
me->DeleteThreatList();
|
||||
}
|
||||
|
||||
void SpellHit(Unit* pCaster, const SpellEntry* pSpell)
|
||||
{
|
||||
switch(pSpell->Id)
|
||||
{
|
||||
case SPELL_SUMMON_MENAGERIE:
|
||||
me->SetHomePosition(968.66,1042.53,527.32,0.077);
|
||||
LeaveCombat();
|
||||
break;
|
||||
case SPELL_SUMMON_MENAGERIE_2:
|
||||
me->SetHomePosition(1164.02,1170.85,527.321,3.66);
|
||||
LeaveCombat();
|
||||
break;
|
||||
case SPELL_SUMMON_MENAGERIE_3:
|
||||
me->SetHomePosition(1118.31,1080.377,508.361,4.25);
|
||||
LeaveCombat();
|
||||
break;
|
||||
case SPELL_TELEPORT:
|
||||
me->AddUnitMovementFlag(MOVEMENTFLAG_FLY_MODE); // with out it the npc will fall down while is casting
|
||||
bCanCast = true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_urom(Creature* pCreature)
|
||||
{
|
||||
return new boss_uromAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_urom()
|
||||
{
|
||||
Script* newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_urom";
|
||||
newscript->GetAI = &GetAI_boss_urom;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
/* Copyright (C) 2008 - 2010 TrinityCore <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
|
||||
* (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
|
||||
*/
|
||||
|
||||
#include "ScriptedPch.h"
|
||||
#include "oculus.h"
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_ENERGIZE_CORES = 50785, //Damage 5938 to 6562, effec2 Triggers 54069, effect3 Triggers 56251
|
||||
SPELL_ENERGIZE_CORES_TRIGGER_1 = 54069,
|
||||
SPELL_ENERGIZE_CORES_TRIGGER_2 = 56251,
|
||||
SPELL_ENERGIZE_CORES_2 = 59372, //Damage 9025 to 9975, effect2 Triggers 54069, effect 56251
|
||||
SPELL_CALL_AZURE_RING_CAPTAIN = 51002, //Effect Send Event (12229)
|
||||
SPELL_CALL_AZURE_RING_CAPTAIN_2 = 51006, //Effect Send Event (10665)
|
||||
SPELL_CALL_AZURE_RING_CAPTAIN_3 = 51007, //Effect Send Event (18454)
|
||||
SPELL_CALL_AZURE_RING_CAPTAIN_4 = 51008, //Effect Send Event (18455)
|
||||
SPELL_CALL_AMPLIFY_MAGIC = 51054,
|
||||
SPELL_CALL_AMPLIFY_MAGIC_2 = 59371
|
||||
};
|
||||
//not in db
|
||||
enum Yells
|
||||
{
|
||||
SAY_AGGRO = -1578022,
|
||||
SAY_KILL_1 = -1578023,
|
||||
SAY_KILL_2 = -1578024,
|
||||
SAY_DEATH = -1578025,
|
||||
SAY_STRIKE_1 = -1578026,
|
||||
SAY_STRIKE_2 = -1578027,
|
||||
SAY_STRIKE_3 = -1578028,
|
||||
SAY_SPAWN = -1578029
|
||||
};
|
||||
|
||||
struct boss_varosAI : public ScriptedAI
|
||||
{
|
||||
boss_varosAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
}
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_VAROS_EVENT, NOT_STARTED);
|
||||
}
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, me);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_VAROS_EVENT, IN_PROGRESS);
|
||||
}
|
||||
void AttackStart(Unit* /*who*/) {}
|
||||
void MoveInLineOfSight(Unit* /*who*/) {}
|
||||
void UpdateAI(const uint32 /*diff*/)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_VAROS_EVENT, DONE);
|
||||
}
|
||||
void KilledUnit(Unit * victim)
|
||||
{
|
||||
if (victim == me)
|
||||
return;
|
||||
DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2), me);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_varos(Creature* pCreature)
|
||||
{
|
||||
return new boss_varosAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_varos()
|
||||
{
|
||||
Script *newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_varos";
|
||||
newscript->GetAI = &GetAI_boss_varos;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
@@ -0,0 +1,205 @@
|
||||
/* Copyright (C) 2008 - 2010 TrinityCore <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
|
||||
* (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
|
||||
*/
|
||||
|
||||
#include "ScriptedPch.h"
|
||||
#include "oculus.h"
|
||||
|
||||
#define MAX_ENCOUNTER 4
|
||||
|
||||
/* The Occulus encounters:
|
||||
0 - Drakos the Interrogator
|
||||
1 - Varos Cloudstrider
|
||||
2 - Mage-Lord Urom
|
||||
3 - Ley-Guardian Eregos */
|
||||
|
||||
struct instance_oculus : public ScriptedInstance
|
||||
{
|
||||
instance_oculus(Map* pMap) : ScriptedInstance(pMap) {Initialize();};
|
||||
|
||||
uint64 uiDrakos;
|
||||
uint64 uiVaros;
|
||||
uint64 uiUrom;
|
||||
uint64 uiEregos;
|
||||
|
||||
uint8 uiPlataformUrom;
|
||||
|
||||
uint8 m_auiEncounter[MAX_ENCOUNTER];
|
||||
std::string str_data;
|
||||
|
||||
std::list<uint64> GameObjectList;
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
uiPlataformUrom = 0;
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature* pCreature, bool /*add*/)
|
||||
{
|
||||
switch(pCreature->GetEntry())
|
||||
{
|
||||
case CREATURE_DRAKOS:
|
||||
uiDrakos = pCreature->GetGUID();
|
||||
break;
|
||||
case CREATURE_VAROS:
|
||||
uiVaros = pCreature->GetGUID();
|
||||
break;
|
||||
case CREATURE_UROM:
|
||||
uiUrom = pCreature->GetGUID();
|
||||
break;
|
||||
case CREATURE_EREGOS:
|
||||
uiEregos = pCreature->GetGUID();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void OnGameObjectCreate(GameObject* pGO, bool bAdd)
|
||||
{
|
||||
if (pGO->GetEntry() == GO_DRAGON_CAGE_DOOR)
|
||||
{
|
||||
if (DATA_DRAKOS_EVENT == DONE)
|
||||
pGO->SetGoState(GO_STATE_ACTIVE);
|
||||
else
|
||||
pGO->SetGoState(GO_STATE_READY);
|
||||
|
||||
GameObjectList.push_back(pGO->GetGUID());
|
||||
}
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 data)
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
case DATA_DRAKOS_EVENT:
|
||||
m_auiEncounter[0] = data;
|
||||
if (data == DONE)
|
||||
OpenCageDoors();
|
||||
break;
|
||||
case DATA_VAROS_EVENT:
|
||||
m_auiEncounter[1] = data;
|
||||
break;
|
||||
case DATA_UROM_EVENT:
|
||||
m_auiEncounter[2] = data;
|
||||
break;
|
||||
case DATA_EREGOS_EVENT:
|
||||
m_auiEncounter[3] = data;
|
||||
break;
|
||||
case DATA_UROM_PLATAFORM:
|
||||
uiPlataformUrom = data;
|
||||
break;
|
||||
}
|
||||
|
||||
if (data == DONE)
|
||||
SaveToDB();
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 type)
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
case DATA_DRAKOS_EVENT: return m_auiEncounter[0];
|
||||
case DATA_VAROS_EVENT: return m_auiEncounter[1];
|
||||
case DATA_UROM_EVENT: return m_auiEncounter[2];
|
||||
case DATA_EREGOS_EVENT: return m_auiEncounter[3];
|
||||
case DATA_UROM_PLATAFORM: return uiPlataformUrom;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint64 GetData64(uint32 identifier)
|
||||
{
|
||||
switch(identifier)
|
||||
{
|
||||
case DATA_DRAKOS: return uiDrakos;
|
||||
case DATA_VAROS: return uiVaros;
|
||||
case DATA_UROM: return uiUrom;
|
||||
case DATA_EREGOS: return uiEregos;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void OpenCageDoors()
|
||||
{
|
||||
if (GameObjectList.empty())
|
||||
return;
|
||||
|
||||
for (std::list<uint64>::const_iterator itr = GameObjectList.begin(); itr != GameObjectList.end(); ++itr)
|
||||
{
|
||||
if (GameObject* pGO = instance->GetGameObject(*itr))
|
||||
pGO->SetGoState(GO_STATE_ACTIVE);
|
||||
}
|
||||
}
|
||||
|
||||
std::string GetSaveData()
|
||||
{
|
||||
OUT_SAVE_INST_DATA;
|
||||
|
||||
std::ostringstream saveStream;
|
||||
saveStream << "T O " << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " << m_auiEncounter[3];
|
||||
|
||||
str_data = saveStream.str();
|
||||
|
||||
OUT_SAVE_INST_DATA_COMPLETE;
|
||||
return str_data;
|
||||
}
|
||||
|
||||
void Load(const char* in)
|
||||
{
|
||||
if (!in)
|
||||
{
|
||||
OUT_LOAD_INST_DATA_FAIL;
|
||||
return;
|
||||
}
|
||||
|
||||
OUT_LOAD_INST_DATA(in);
|
||||
|
||||
char dataHead1, dataHead2;
|
||||
uint16 data0, data1, data2, data3;
|
||||
|
||||
std::istringstream loadStream(in);
|
||||
loadStream >> dataHead1 >> dataHead2 >> data0 >> data1 >> data2 >> data3;
|
||||
|
||||
if (dataHead1 == 'T' && dataHead2 == 'O')
|
||||
{
|
||||
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;
|
||||
|
||||
} else OUT_LOAD_INST_DATA_FAIL;
|
||||
|
||||
OUT_LOAD_INST_DATA_COMPLETE;
|
||||
}
|
||||
};
|
||||
|
||||
InstanceData* GetInstanceData_instance_oculus(Map* pMap)
|
||||
{
|
||||
return new instance_oculus(pMap);
|
||||
}
|
||||
|
||||
void AddSC_instance_oculus()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "instance_oculus";
|
||||
newscript->GetInstanceData = &GetInstanceData_instance_oculus;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
@@ -0,0 +1,174 @@
|
||||
/* Copyright (C) 2006 - 2010 TrinityCore <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
|
||||
* (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
|
||||
*/
|
||||
|
||||
#include "ScriptedPch.h"
|
||||
#include "oculus.h"
|
||||
|
||||
#define GOSSIP_ITEM_DRAKES "So where do we go from here?"
|
||||
#define GOSSIP_ITEM_BELGARISTRASZ1 "I want to fly on the wings of the Red Flight"
|
||||
#define GOSSIP_ITEM_BELGARISTRASZ2 "What abilities do Ruby Drakes have?"
|
||||
#define GOSSIP_ITEM_VERDISA1 "I want to fly on the wings of the Green Flight"
|
||||
#define GOSSIP_ITEM_VERDISA2 "What abilities do Emerald Drakes have?"
|
||||
#define GOSSIP_ITEM_ETERNOS1 "I want to fly on the wings of the Bronze Flight"
|
||||
#define GOSSIP_ITEM_ETERNOS2 "What abilities do Amber Drakes have?"
|
||||
|
||||
#define HAS_ESSENCE(a) ((a)->HasItemCount(ITEM_EMERALD_ESSENCE,1) || (a)->HasItemCount(ITEM_AMBER_ESSENCE,1) || (a)->HasItemCount(ITEM_RUBY_ESSENCE,1))
|
||||
|
||||
enum Drakes
|
||||
{
|
||||
GOSSIP_TEXTID_DRAKES = 13267,
|
||||
GOSSIP_TEXTID_BELGARISTRASZ1 = 12916,
|
||||
GOSSIP_TEXTID_BELGARISTRASZ2 = 13466,
|
||||
GOSSIP_TEXTID_BELGARISTRASZ3 = 13254,
|
||||
GOSSIP_TEXTID_VERDISA1 = 1,
|
||||
GOSSIP_TEXTID_VERDISA2 = 1,
|
||||
GOSSIP_TEXTID_VERDISA3 = 1,
|
||||
GOSSIP_TEXTID_ETERNOS1 = 1,
|
||||
GOSSIP_TEXTID_ETERNOS2 = 1,
|
||||
GOSSIP_TEXTID_ETERNOS3 = 13256,
|
||||
|
||||
ITEM_EMERALD_ESSENCE = 37815,
|
||||
ITEM_AMBER_ESSENCE = 37859,
|
||||
ITEM_RUBY_ESSENCE = 37860,
|
||||
|
||||
NPC_VERDISA = 27657,
|
||||
NPC_BELGARISTRASZ = 27658,
|
||||
NPC_ETERNOS = 27659
|
||||
};
|
||||
|
||||
bool GossipHello_npc_oculus_drake(Player* pPlayer, Creature* pCreature)
|
||||
{
|
||||
if (pCreature->isQuestGiver())
|
||||
pPlayer->PrepareQuestMenu(pCreature->GetGUID());
|
||||
|
||||
if (pCreature->GetInstanceData()->GetData(DATA_DRAKOS_EVENT) == DONE)
|
||||
{
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_DRAKES, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_DRAKES, pCreature->GetGUID());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GossipSelect_npc_oculus_drake(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
|
||||
{
|
||||
switch(pCreature->GetEntry())
|
||||
{
|
||||
case NPC_VERDISA: //Verdisa
|
||||
switch(uiAction)
|
||||
{
|
||||
case GOSSIP_ACTION_INFO_DEF + 1:
|
||||
if (!HAS_ESSENCE(pPlayer))
|
||||
{
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_VERDISA1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_VERDISA2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
|
||||
pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_VERDISA1, pCreature->GetGUID());
|
||||
}
|
||||
else
|
||||
{
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_VERDISA2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
|
||||
pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_VERDISA2, pCreature->GetGUID());
|
||||
}
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 2:
|
||||
{
|
||||
ItemPosCountVec dest;
|
||||
uint8 msg = pPlayer->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, ITEM_EMERALD_ESSENCE, 1);
|
||||
if (msg == EQUIP_ERR_OK)
|
||||
pPlayer->StoreNewItem(dest, ITEM_EMERALD_ESSENCE, true);
|
||||
pPlayer->CLOSE_GOSSIP_MENU();
|
||||
break;
|
||||
}
|
||||
case GOSSIP_ACTION_INFO_DEF + 3:
|
||||
pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_VERDISA3, pCreature->GetGUID());
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case NPC_BELGARISTRASZ: //Belgaristrasz
|
||||
switch(uiAction)
|
||||
{
|
||||
case GOSSIP_ACTION_INFO_DEF + 1:
|
||||
if (!HAS_ESSENCE(pPlayer))
|
||||
{
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BELGARISTRASZ1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BELGARISTRASZ2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
|
||||
pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_BELGARISTRASZ1, pCreature->GetGUID());
|
||||
}
|
||||
else
|
||||
{
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BELGARISTRASZ2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
|
||||
pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_BELGARISTRASZ2, pCreature->GetGUID());
|
||||
}
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 2:
|
||||
{
|
||||
ItemPosCountVec dest;
|
||||
uint8 msg = pPlayer->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, ITEM_RUBY_ESSENCE, 1);
|
||||
if (msg == EQUIP_ERR_OK)
|
||||
pPlayer->StoreNewItem(dest, ITEM_RUBY_ESSENCE, true);
|
||||
pPlayer->CLOSE_GOSSIP_MENU();
|
||||
break;
|
||||
}
|
||||
case GOSSIP_ACTION_INFO_DEF + 3:
|
||||
pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_BELGARISTRASZ3, pCreature->GetGUID());
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case NPC_ETERNOS: //Eternos
|
||||
switch(uiAction)
|
||||
{
|
||||
case GOSSIP_ACTION_INFO_DEF + 1:
|
||||
if (!HAS_ESSENCE(pPlayer))
|
||||
{
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ETERNOS1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ETERNOS2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
|
||||
pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ETERNOS1, pCreature->GetGUID());
|
||||
}
|
||||
else
|
||||
{
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ETERNOS2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
|
||||
pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ETERNOS2, pCreature->GetGUID());
|
||||
}
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 2:
|
||||
{
|
||||
ItemPosCountVec dest;
|
||||
uint8 msg = pPlayer->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, ITEM_AMBER_ESSENCE, 1);
|
||||
if (msg == EQUIP_ERR_OK)
|
||||
pPlayer->StoreNewItem(dest, ITEM_AMBER_ESSENCE, true);
|
||||
pPlayer->CLOSE_GOSSIP_MENU();
|
||||
break;
|
||||
}
|
||||
case GOSSIP_ACTION_INFO_DEF + 3:
|
||||
pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ETERNOS3, pCreature->GetGUID());
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void AddSC_oculus()
|
||||
{
|
||||
Script *newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "npc_oculus_drake";
|
||||
newscript->pGossipHello = &GossipHello_npc_oculus_drake;
|
||||
newscript->pGossipSelect = &GossipSelect_npc_oculus_drake;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
#ifndef DEF_OCULUS_H
|
||||
#define DEF_OCULUS_H
|
||||
|
||||
enum Data
|
||||
{
|
||||
DATA_DRAKOS_EVENT,
|
||||
DATA_VAROS_EVENT,
|
||||
DATA_UROM_EVENT,
|
||||
DATA_EREGOS_EVENT,
|
||||
DATA_UROM_PLATAFORM
|
||||
};
|
||||
|
||||
enum Data64
|
||||
{
|
||||
DATA_DRAKOS,
|
||||
DATA_VAROS,
|
||||
DATA_UROM,
|
||||
DATA_EREGOS
|
||||
};
|
||||
|
||||
enum Bosses
|
||||
{
|
||||
CREATURE_DRAKOS = 27654,
|
||||
CREATURE_VAROS = 27447,
|
||||
CREATURE_UROM = 27655,
|
||||
CREATURE_EREGOS = 27656
|
||||
};
|
||||
|
||||
enum GameObjects
|
||||
{
|
||||
GO_DRAGON_CAGE_DOOR = 193995
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in new issue
Block a user