*Integrate Script system to Core

-added ScriptMgr for loading scripts
-removed bindings
-moved script system to src/game
-moved scripts to src/scripts
-VC project files updated
-cmakes updated (not 100% done yet)

NOTE to Devs:
-file locations changed
-precompiled renamed to ScriptedPch
-ecsort_ai renamed to ScriptedEscortAI
-follower_ai renamed to ScriptedFollowerAI
-guard_ai renamed to ScriptedGuardAI
-simple_ai renamed to ScriptedSimpleAI
-sc_creature renamed to ScriptedCreature
-sc_gossip renamed to ScriptedGossip
-sc_instance  renamed to ScriptedInstance

*use the new headers in scripts, thank you

NOTE to ALL:
cmake not fully tested, please report any errors with it
could make creashes, incompability
USE AT YOUR OWN RISK before further tests!!

--HG--
branch : trunk
This commit is contained in:
Rat
2010-01-19 11:36:05 +01:00
parent f5dea61b66
commit 0cc053ea4d
601 changed files with 3908 additions and 7245 deletions
@@ -0,0 +1,156 @@
/* 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
struct TRINITY_DLL_DECL boss_malygosAI : public ScriptedAI
{
boss_malygosAI(Creature *c) : ScriptedAI(c) {}
uint32 phase,
enrage;
void Reset()
{
//Source Deadly Boss Mod
enrage = 615000; //10 min
}
void EnterCombat(Unit* who)
{
if (phase == 1)
DoScriptText(SAY_PHASE1_AGGRO, m_creature);
if (phase == 2)
DoScriptText(SAY_PHASE1_AGGRO, m_creature);
if (phase == 3)
DoScriptText(SAY_PHASE1_AGGRO, m_creature);
}
void AttackStart(Unit* who) {}
void MoveInLineOfSight(Unit* who) {}
void UpdateAI(const uint32 diff)
{
phase =1;
//Return since we have no target
if (!UpdateVictim())
return;
if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) <= 50){
phase = 2;
//spawn adds
//set malygos unatackable untill all adds spawned dead
//start phase3
}
DoMeleeAttackIfReady();
}
void JustDied(Unit* killer)
{
DoScriptText(SAY_DEATH, m_creature);
}
void KilledUnit(Unit *victim)
{
if (victim == m_creature)
return;
if (phase ==1)
DoScriptText(RAND(SAY_PHASE1_SLAY_1,SAY_PHASE1_SLAY_2,SAY_PHASE1_SLAY_3), m_creature);
if (phase ==2)
DoScriptText(RAND(SAY_PHASE2_SLAY_1,SAY_PHASE2_SLAY_2,SAY_PHASE2_SLAY_3), m_creature);
if (phase ==3)
DoScriptText(RAND(SAY_PHASE3_SLAY_1,SAY_PHASE3_SLAY_2,SAY_PHASE3_SLAY_3), m_creature);
}
};
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 TRINITY_DLL_DECL 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,307 @@
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_Anomalus
SD%Complete:
SDComment:
SDCategory: The Nexus, The Nexus
EndScriptData */
#include "ScriptedPch.h"
#include "nexus.h"
bool DeadChaoticRift; // needed for achievement: Chaos Theory(2037)
enum eEnums
{
ACHIEVEMENT_CHAOS_THEORY = 2037,
//Spells
SPELL_SPARK_N = 47751,
SPELL_SPARK_H = 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
MOB_CRAZED_MANA_WRAITH = 26746,
MOB_CHAOTIC_RIFT = 26918,
SPELL_CHAOTIC_ENERGY_BURST = 47688,
SPELL_CHARGED_CHAOTIC_ENERGY_BURST = 47737,
SPELL_ARCANEFORM = 48019, //Chaotic Rift visual
//Yell
SAY_AGGRO = -1576010,
SAY_DEATH = -1576011,
SAY_RIFT = -1576012,
SAY_SHIELD = -1576013
};
float RiftLocation[6][3]=
{
{652.64, -273.70, -8.75},
{634.45, -265.94, -8.44},
{620.73, -281.17, -9.02},
{626.10, -304.67, -9.44},
{639.87, -314.11, -9.49},
{651.72, -297.44, -9.37}
};
struct TRINITY_DLL_DECL boss_anomalusAI : public ScriptedAI
{
boss_anomalusAI(Creature *c) : ScriptedAI(c)
{
pInstance = c->GetInstanceData();
}
ScriptedInstance* pInstance;
uint8 Phase;
uint32 SPELL_SPARK_Timer;
uint32 SPELL_CREATE_RIFT_Timer;
uint64 ChaoticRiftGUID;
void Reset()
{
Phase = 0;
SPELL_SPARK_Timer = 5000;
SPELL_CREATE_RIFT_Timer = 25000;
ChaoticRiftGUID = 0;
DeadChaoticRift = false;
if (pInstance)
pInstance->SetData(DATA_ANOMALUS_EVENT, NOT_STARTED);
}
void EnterCombat(Unit* who)
{
DoScriptText(SAY_AGGRO, m_creature);
if (pInstance)
pInstance->SetData(DATA_ANOMALUS_EVENT, IN_PROGRESS);
}
void JustDied(Unit* killer)
{
DoScriptText(SAY_DEATH, m_creature);
if (IsHeroic() && !DeadChaoticRift)
{
AchievementEntry const *AchievChaosTheory = GetAchievementStore()->LookupEntry(ACHIEVEMENT_CHAOS_THEORY);
if (AchievChaosTheory)
{
Map* pMap = m_creature->GetMap();
if (pMap && pMap->IsDungeon())
{
Map::PlayerList const &players = pMap->GetPlayers();
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
itr->getSource()->CompletedAchievement(AchievChaosTheory);
}
}
}
if (pInstance)
pInstance->SetData(DATA_ANOMALUS_EVENT, DONE);
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if (m_creature->GetDistance(m_creature->GetHomePosition()) > 60.0f)
{
//Not blizzlike, hack to avoid an exploit
EnterEvadeMode();
return;
}
if (m_creature->HasAura(SPELL_RIFT_SHIELD))
{
if (ChaoticRiftGUID)
{
Unit* Rift = Unit::GetUnit((*m_creature), ChaoticRiftGUID);
if (Rift && Rift->isDead())
{
m_creature->RemoveAurasDueToSpell(SPELL_RIFT_SHIELD);
ChaoticRiftGUID = 0;
}
return;
}
} else
ChaoticRiftGUID = 0;
if ((Phase == 0) && (m_creature->GetHealth() < m_creature->GetMaxHealth() * 0.75))
{
Phase = 1;
DoScriptText(SAY_SHIELD, m_creature);
DoCast(m_creature, SPELL_RIFT_SHIELD);
int tmp = rand()%(2);
Creature* Rift = m_creature->SummonCreature(MOB_CHAOTIC_RIFT, RiftLocation[tmp][0], RiftLocation[tmp][1], RiftLocation[tmp][2], 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000);
if (Rift)
{
//DoCast(Rift, SPELL_CHARGE_RIFT);
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
Rift->AI()->AttackStart(pTarget);
ChaoticRiftGUID = Rift->GetGUID();
DoScriptText(SAY_RIFT , m_creature);
}
}
if ((Phase == 1) && (m_creature->GetHealth() < m_creature->GetMaxHealth() * 0.50))
{
Phase = 2;
DoScriptText(SAY_SHIELD , m_creature);
DoCast(m_creature, SPELL_RIFT_SHIELD);
int tmp = rand()%(2);
Creature* Rift = m_creature->SummonCreature(MOB_CHAOTIC_RIFT, RiftLocation[tmp][0], RiftLocation[tmp][1], RiftLocation[tmp][2], 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000);
if (Rift)
{
//DoCast(Rift, SPELL_CHARGE_RIFT);
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
Rift->AI()->AttackStart(pTarget);
ChaoticRiftGUID = Rift->GetGUID();
DoScriptText(SAY_RIFT , m_creature);
}
}
if ((Phase == 2) && (m_creature->GetHealth() < m_creature->GetMaxHealth() * 0.25))
{
Phase = 3;
DoScriptText(SAY_SHIELD , m_creature);
DoCast(m_creature, SPELL_RIFT_SHIELD);
int tmp = rand()%(2);
Creature* Rift = m_creature->SummonCreature(MOB_CHAOTIC_RIFT, RiftLocation[tmp][0], RiftLocation[tmp][1], RiftLocation[tmp][2], 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000);
if (Rift)
{
//DoCast(Rift, SPELL_CHARGE_RIFT);
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
Rift->AI()->AttackStart(pTarget);
ChaoticRiftGUID = Rift->GetGUID();
DoScriptText(SAY_RIFT , m_creature);
}
}
if (SPELL_SPARK_Timer <= diff)
{
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
DoCast(pTarget, DUNGEON_MODE(SPELL_SPARK_N, SPELL_SPARK_H));
SPELL_SPARK_Timer = 5000;
} else SPELL_SPARK_Timer -=diff;
if (SPELL_CREATE_RIFT_Timer <= diff)
{
DoScriptText(SAY_RIFT , m_creature);
int tmp = rand()%(2);
Creature* Rift = m_creature->SummonCreature(MOB_CHAOTIC_RIFT, RiftLocation[tmp][0], RiftLocation[tmp][1], RiftLocation[tmp][2], 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000);
if (Rift)
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
Rift->AI()->AttackStart(pTarget);
SPELL_CREATE_RIFT_Timer = 25000;
} else SPELL_CREATE_RIFT_Timer -=diff;
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI_boss_anomalus(Creature* pCreature)
{
return new boss_anomalusAI (pCreature);
}
struct TRINITY_DLL_DECL mob_chaotic_riftAI : public Scripted_NoMovementAI
{
mob_chaotic_riftAI(Creature *c) : Scripted_NoMovementAI(c)
{
pInstance = c->GetInstanceData();
}
ScriptedInstance* pInstance;
uint32 SPELL_CHAOTIC_ENERGY_BURST_Timer;
uint32 SUMMON_CRAZED_MANA_WRAITH_Timer;
void Reset()
{
SPELL_CHAOTIC_ENERGY_BURST_Timer = 1000;
SUMMON_CRAZED_MANA_WRAITH_Timer = 5000;
m_creature->SetDisplayId(25206); //For some reason in DB models for ally and horde are different.
//Model for ally (1126) does not show auras. Horde model works perfect.
//Set model to horde number
DoCast(m_creature, SPELL_ARCANEFORM, false);
}
void JustDied(Unit *killer)
{
DeadChaoticRift = true;
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if (SPELL_CHAOTIC_ENERGY_BURST_Timer <= diff)
{
Unit* Anomalus = Unit::GetUnit(*m_creature, pInstance ? pInstance->GetData64(DATA_ANOMALUS) : 0);
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
if (Anomalus && Anomalus->HasAura(SPELL_RIFT_SHIELD))
DoCast(pTarget, SPELL_CHARGED_CHAOTIC_ENERGY_BURST);
else
DoCast(pTarget, SPELL_CHAOTIC_ENERGY_BURST);
SPELL_CHAOTIC_ENERGY_BURST_Timer = 1000;
} else SPELL_CHAOTIC_ENERGY_BURST_Timer -=diff;
if (SUMMON_CRAZED_MANA_WRAITH_Timer <= diff)
{
Creature* Wraith = m_creature->SummonCreature(MOB_CRAZED_MANA_WRAITH, m_creature->GetPositionX()+1, m_creature->GetPositionY()+1, m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000);
if (Wraith)
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
Wraith->AI()->AttackStart(pTarget);
Unit* Anomalus = Unit::GetUnit(*m_creature, pInstance ? pInstance->GetData64(DATA_ANOMALUS) : 0);
if (Anomalus && Anomalus->HasAura(SPELL_RIFT_SHIELD))
SUMMON_CRAZED_MANA_WRAITH_Timer = 5000;
else
SUMMON_CRAZED_MANA_WRAITH_Timer = 10000;
} else SUMMON_CRAZED_MANA_WRAITH_Timer -=diff;
}
};
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,258 @@
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_Keristrasza
SD%Complete:
SDComment:
SDCategory: The Nexus, The Nexus
EndScriptData */
#include "ScriptedPch.h"
#include "nexus.h"
enum eEnums
{
CONTAINMENT_SPHERES = 3,
ACHIEVEMENT_INTENSE_COLD = 2036,
//Spells
SPELL_FROZEN_PRISON = 47854,
SPELL_TAIL_SWEEP = 50155,
SPELL_CRYSTAL_CHAINS = 50997,
SPELL_ENRAGE = 8599,
SPELL_CRYSTALFIRE_BREATH_N = 48096,
SPELL_CRYSTALFIRE_BREATH_H = 57091,
SPELL_CRYSTALIZE = 48179,
SPELL_INTENSE_COLD = 48094,
SPELL_INTENSE_COLD_TRIGGERED = 48095,
//Yell
SAY_AGGRO = -1576040,
SAY_SLAY = -1576041,
SAY_ENRAGE = -1576042,
SAY_DEATH = -1576043,
SAY_CRYSTAL_NOVA = -1576044
};
struct TRINITY_DLL_DECL boss_keristraszaAI : public ScriptedAI
{
boss_keristraszaAI(Creature *c) : ScriptedAI(c)
{
pInstance = c->GetInstanceData();
}
ScriptedInstance* pInstance;
uint32 CRYSTALFIRE_BREATH_Timer;
uint32 CRYSTAL_CHAINS_CRYSTALIZE_Timer;
uint32 TAIL_SWEEP_Timer;
bool Enrage;
uint64 ContainmentSphereGUIDs[CONTAINMENT_SPHERES];
uint32 CheckIntenseColdTimer;
bool MoreThanTwoIntenseCold; // needed for achievement: Intense Cold(2036)
void Reset()
{
CRYSTALFIRE_BREATH_Timer = 14000;
CRYSTAL_CHAINS_CRYSTALIZE_Timer = DUNGEON_MODE(30000,11000);
TAIL_SWEEP_Timer = 5000;
Enrage = false;
CheckIntenseColdTimer = 2000;
MoreThanTwoIntenseCold = false;
m_creature->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, m_creature);
DoCastAOE(SPELL_INTENSE_COLD);
if (pInstance)
pInstance->SetData(DATA_KERISTRASZA_EVENT, IN_PROGRESS);
}
void JustDied(Unit* killer)
{
DoScriptText(SAY_DEATH, m_creature);
if (IsHeroic() && !MoreThanTwoIntenseCold)
{
AchievementEntry const *AchievIntenseCold = GetAchievementStore()->LookupEntry(ACHIEVEMENT_INTENSE_COLD);
if (AchievIntenseCold)
{
Map* pMap = m_creature->GetMap();
if (pMap && pMap->IsDungeon())
{
Map::PlayerList const &players = pMap->GetPlayers();
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
itr->getSource()->CompletedAchievement(AchievIntenseCold);
}
}
}
if (pInstance)
pInstance->SetData(DATA_KERISTRASZA_EVENT, DONE);
}
void KilledUnit(Unit *victim)
{
DoScriptText(SAY_SLAY, m_creature);
}
bool CheckContainmentSpheres(bool remove_prison = false)
{
if(!pInstance)
return false;
ContainmentSphereGUIDs[0] = pInstance->GetData64(ANOMALUS_CONTAINMET_SPHERE);
ContainmentSphereGUIDs[1] = pInstance->GetData64(ORMOROKS_CONTAINMET_SPHERE);
ContainmentSphereGUIDs[2] = pInstance->GetData64(TELESTRAS_CONTAINMET_SPHERE);
GameObject *ContainmentSpheres[CONTAINMENT_SPHERES];
for (uint8 i = 0; i < CONTAINMENT_SPHERES; ++i)
{
ContainmentSpheres[i] = pInstance->instance->GetGameObject(ContainmentSphereGUIDs[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)
{
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
if (m_creature->HasAura(SPELL_FROZEN_PRISON))
m_creature->RemoveAurasDueToSpell(SPELL_FROZEN_PRISON);
}
else
{
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
DoCast(m_creature, SPELL_FROZEN_PRISON, false);
}
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if (CheckIntenseColdTimer < diff && !MoreThanTwoIntenseCold)
{
std::list<HostilReference*> ThreatList = m_creature->getThreatManager().getThreatList();
for (std::list<HostilReference*>::const_iterator itr = ThreatList.begin(); itr != ThreatList.end(); itr++)
{
Unit *pTarget = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
if (!pTarget || pTarget->GetTypeId() != TYPEID_PLAYER)
continue;
Aura *AuraIntenseCold = pTarget->GetAura(SPELL_INTENSE_COLD_TRIGGERED);
if (AuraIntenseCold && AuraIntenseCold->GetStackAmount() > 2)
{
MoreThanTwoIntenseCold = true;
break;
}
}
CheckIntenseColdTimer = 2000;
} else CheckIntenseColdTimer -= diff;
if (!Enrage && (m_creature->GetHealth() < m_creature->GetMaxHealth() * 0.25))
{
DoScriptText(SAY_ENRAGE, m_creature);
DoCast(m_creature, SPELL_ENRAGE);
Enrage = true;
}
if (CRYSTALFIRE_BREATH_Timer <= diff)
{
DoCast(m_creature->getVictim(), DUNGEON_MODE(SPELL_CRYSTALFIRE_BREATH_N, SPELL_CRYSTALFIRE_BREATH_H));
CRYSTALFIRE_BREATH_Timer = 14000;
} else CRYSTALFIRE_BREATH_Timer -=diff;
if (TAIL_SWEEP_Timer <= diff)
{
DoCast(m_creature, SPELL_TAIL_SWEEP);
TAIL_SWEEP_Timer = 5000;
} else TAIL_SWEEP_Timer -=diff;
if (CRYSTAL_CHAINS_CRYSTALIZE_Timer <= diff)
{
DoScriptText(SAY_CRYSTAL_NOVA, m_creature);
if (IsHeroic())
DoCast(m_creature, SPELL_CRYSTALIZE);
else if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_CRYSTAL_CHAINS);
CRYSTAL_CHAINS_CRYSTALIZE_Timer = DUNGEON_MODE(30000,11000);
} else CRYSTAL_CHAINS_CRYSTALIZE_Timer -= 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 *Keristrasza = Unit::GetCreature(*pGO, pInstance ? pInstance->GetData64(DATA_KERISTRASZA) : 0);
if (Keristrasza && Keristrasza->isAlive())
{
// maybe these are hacks :(
pGO->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1);
pGO->SetGoState(GO_STATE_ACTIVE);
CAST_AI(boss_keristraszaAI, Keristrasza->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,353 @@
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_Magus_Telestra
SD%Complete:
SDComment:
SDCategory: The Nexus, The Nexus
EndScriptData */
#include "ScriptedPch.h"
#include "nexus.h"
enum eEnums
{
//Spells
SPELL_ICE_NOVA_N = 47772,
SPELL_ICE_NOVA_H = 56935,
SPELL_FIREBOMB_N = 47773,
SPELL_FIREBOMB_H = 56934,
SPELL_GRAVITY_WELL = 47756,
SPELL_TELESTRA_BACK = 47714,
//At 50% HP - 3 clones, Frost, Fire, Arcane (and in 10% HP in Heroic)
MOB_FIRE_MAGUS = 26928,
MOB_FROST_MAGUS = 26930,
MOB_ARCANE_MAGUS = 26929,
SPELL_FIRE_MAGUS_VISUAL = 47705,
SPELL_FROST_MAGUS_VISUAL = 47706,
SPELL_ARCANE_MAGUS_VISUAL = 47704,
//Yell
SAY_AGGRO = -1576000,
SAY_KILL = -1576001,
SAY_DEATH = -1576002,
SAY_MERGE = -1576003,
SAY_SPLIT_1 = -1576004,
SAY_SPLIT_2 = -1576005,
//Achievement
ACHIEV_SPLIT_PERSONALITY = 2150,
ACHIEV_TIMER = 5 * 1000
};
float CenterOfRoom[1][4] =
{
{504.80, 89.07, -16.12, 6.27}
};
struct TRINITY_DLL_DECL boss_magus_telestraAI : public ScriptedAI
{
boss_magus_telestraAI(Creature* c) : ScriptedAI(c)
{
pInstance = c->GetInstanceData();
}
ScriptedInstance* pInstance;
uint64 FireMagusGUID;
uint64 FrostMagusGUID;
uint64 ArcaneMagusGUID;
bool FireMagusDead;
bool FrostMagusDead;
bool ArcaneMagusDead;
uint32 AppearDelay_Timer;
bool AppearDelay;
uint8 Phase;
uint32 SPELL_ICE_NOVA_Timer;
uint32 SPELL_FIREBOMB_Timer;
uint32 SPELL_GRAVITY_WELL_Timer;
uint32 Cooldown;
bool AchievementTimerRunning;
uint8 AchievementProgress;
uint32 AchievementTimer;
void Reset()
{
Phase = 0;
//These times are probably wrong
SPELL_ICE_NOVA_Timer = 7000;
SPELL_FIREBOMB_Timer = 0;
SPELL_GRAVITY_WELL_Timer = 15000;
Cooldown = 0;
FireMagusGUID = 0;
FrostMagusGUID = 0;
ArcaneMagusGUID = 0;
AchievementProgress = 0;
AchievementTimer = 0;
AchievementTimerRunning = false;
AppearDelay = false;
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_creature->SetVisibility(VISIBILITY_ON);
if (pInstance)
pInstance->SetData(DATA_MAGUS_TELESTRA_EVENT, NOT_STARTED);
}
void EnterCombat(Unit* who)
{
DoScriptText(SAY_AGGRO, m_creature);
if (pInstance)
pInstance->SetData(DATA_MAGUS_TELESTRA_EVENT, IN_PROGRESS);
}
void JustDied(Unit* killer)
{
DoScriptText(SAY_DEATH, m_creature);
if (IsHeroic() && AchievementProgress == 2)
{
AchievementEntry const *AchievSplitPersonality = GetAchievementStore()->LookupEntry(ACHIEV_SPLIT_PERSONALITY);
if (AchievSplitPersonality)
{
Map* pMap = m_creature->GetMap();
if (pMap && pMap->IsDungeon())
{
Map::PlayerList const &players = pMap->GetPlayers();
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
itr->getSource()->CompletedAchievement(AchievSplitPersonality);
}
}
}
if (pInstance)
pInstance->SetData(DATA_MAGUS_TELESTRA_EVENT, DONE);
}
void KilledUnit(Unit *victim)
{
DoScriptText(SAY_KILL, m_creature);
}
uint64 SplitPersonality(uint32 entry)
{
Creature* Summoned = m_creature->SummonCreature(entry, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), m_creature->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000);
if (Summoned)
{
switch (entry)
{
case MOB_FIRE_MAGUS:
{
Summoned->CastSpell(Summoned, SPELL_FIRE_MAGUS_VISUAL, false);
break;
}
case MOB_FROST_MAGUS:
{
Summoned->CastSpell(Summoned, SPELL_FROST_MAGUS_VISUAL, false);
break;
}
case MOB_ARCANE_MAGUS:
{
Summoned->CastSpell(Summoned, SPELL_ARCANE_MAGUS_VISUAL, false);
break;
}
}
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
Summoned->AI()->AttackStart(pTarget);
return Summoned->GetGUID();
}
return 0;
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
{
return;
}
if (AppearDelay)
{
m_creature->StopMoving();
m_creature->AttackStop();
if (AppearDelay_Timer <= diff)
{
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
AppearDelay = false;
} else AppearDelay_Timer -= diff;
return;
}
if ((Phase == 1)||(Phase == 3))
{
Unit* FireMagus;
Unit* FrostMagus;
Unit* ArcaneMagus;
if (FireMagusGUID)
FireMagus = Unit::GetUnit((*m_creature), FireMagusGUID);
if (FrostMagusGUID)
FrostMagus = Unit::GetUnit((*m_creature), FrostMagusGUID);
if (ArcaneMagusGUID)
ArcaneMagus = Unit::GetUnit((*m_creature), ArcaneMagusGUID);
if (FireMagus && FireMagus->isDead())
{
FireMagusDead = true;
if (!AchievementTimerRunning)
AchievementTimerRunning = true;
}
if (FrostMagus && FrostMagus->isDead())
{
FrostMagusDead = true;
if (!AchievementTimerRunning)
AchievementTimerRunning = true;
}
if (ArcaneMagus && ArcaneMagus->isDead())
{
ArcaneMagusDead = true;
if (!AchievementTimerRunning)
AchievementTimerRunning = true;
}
if (AchievementTimerRunning)
AchievementTimer += diff;
if (FireMagusDead && FrostMagusDead && ArcaneMagusDead)
{
if (AchievementTimer <= ACHIEV_TIMER)
AchievementProgress +=1;
m_creature->GetMotionMaster()->Clear();
m_creature->GetMap()->CreatureRelocation(m_creature, CenterOfRoom[0][0], CenterOfRoom[0][1], CenterOfRoom[0][2], CenterOfRoom[0][3]);
DoCast(m_creature, SPELL_TELESTRA_BACK);
m_creature->SetVisibility(VISIBILITY_ON);
if (Phase == 1)
Phase = 2;
if (Phase == 3)
Phase = 4;
FireMagusGUID = 0;
FrostMagusGUID = 0;
ArcaneMagusGUID = 0;
AppearDelay = true;
AppearDelay_Timer = 4000;
DoScriptText(SAY_MERGE, m_creature);
AchievementTimerRunning = false;
AchievementTimer = 0;
}else
return;
}
if ((Phase == 0) && (m_creature->GetHealth() <= (m_creature->GetMaxHealth() * 0.5)))
{
Phase = 1;
m_creature->CastStop();
m_creature->RemoveAllAuras();
m_creature->SetVisibility(VISIBILITY_OFF);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
FireMagusGUID = SplitPersonality(MOB_FIRE_MAGUS);
FrostMagusGUID = SplitPersonality(MOB_FROST_MAGUS);
ArcaneMagusGUID = SplitPersonality(MOB_ARCANE_MAGUS);
FireMagusDead = false;
FrostMagusDead = false;
ArcaneMagusDead = false;
DoScriptText(RAND(SAY_SPLIT_1,SAY_SPLIT_2), m_creature);
return;
}
if (IsHeroic() && (Phase == 2) && (m_creature->GetHealth() <= (m_creature->GetMaxHealth() * 0.1)))
{
Phase = 3;
m_creature->CastStop();
m_creature->RemoveAllAuras();
m_creature->SetVisibility(VISIBILITY_OFF);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
FireMagusGUID = SplitPersonality(MOB_FIRE_MAGUS);
FrostMagusGUID = SplitPersonality(MOB_FROST_MAGUS);
ArcaneMagusGUID = SplitPersonality(MOB_ARCANE_MAGUS);
FireMagusDead = false;
FrostMagusDead = false;
ArcaneMagusDead = false;
DoScriptText(RAND(SAY_SPLIT_1,SAY_SPLIT_2), m_creature);
return;
}
if (Cooldown)
{
if (Cooldown <= diff)
Cooldown = 0;
else
{
Cooldown -= diff;
return;
}
}
if (SPELL_ICE_NOVA_Timer <= diff)
{
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
{
DoCast(pTarget, DUNGEON_MODE(SPELL_ICE_NOVA_N, SPELL_ICE_NOVA_H));
Cooldown = 1500;
}
SPELL_ICE_NOVA_Timer = 15000;
} else SPELL_ICE_NOVA_Timer -=diff;
if (SPELL_GRAVITY_WELL_Timer <= diff)
{
if (Unit *pTarget = m_creature->getVictim())
{
DoCast(pTarget, SPELL_GRAVITY_WELL);
Cooldown = 6000;
}
SPELL_GRAVITY_WELL_Timer = 15000;
} else SPELL_GRAVITY_WELL_Timer -=diff;
if (SPELL_FIREBOMB_Timer <= diff)
{
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
{
DoCast(pTarget, DUNGEON_MODE(SPELL_FIREBOMB_N, SPELL_FIREBOMB_H));
Cooldown = 2000;
}
SPELL_FIREBOMB_Timer = 2000;
} else SPELL_FIREBOMB_Timer -=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,307 @@
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Boss_Ormorok
SD%Complete:
SDComment:
SDCategory: The Nexus, The Nexus
EndScriptData */
#include "ScriptedPch.h"
#include "nexus.h"
enum eEnums
{
//Spells
SPELL_CRYSTAL_SPIKES_N = 47958, //Don't work, using walkaround
SPELL_CRYSTAL_SPIKES_H = 57082, //Don't work, using walkaround
//Walkaround for spells Crystal Spikes -----------------
SPELL_CRYSTALL_SPIKE_DAMAGE_N = 47944,
SPELL_CRYSTALL_SPIKE_DAMAGE_H = 57067,
SPELL_CRYSTAL_SPIKE_PREVISUAL = 50442,
MOB_CRYSTAL_SPIKE = 27099,
//------------------------------------------------------
SPELL_SPELL_REFLECTION = 47981,
SPELL_TRAMPLE_N = 48016,
SPELL_TRAMPLE_H = 57066,
SPELL_FRENZY = 48017,
SPELL_SUMMON_CRYSTALLINE_TANGLER = 61564, //summons npc 32665
MOB_CRYSTALLINE_TANGLER = 32665,
SPELL_ROOTS = 28858, //proper spell id is unknown
//Yell
SAY_AGGRO = -1576020,
SAY_DEATH = -1576021,
SAY_REFLECT = -1576022,
SAY_CRYSTAL_SPIKES = -1576023,
SAY_KILL = -1576024
};
#define SPIKE_DISTANCE 5.0f
struct TRINITY_DLL_DECL boss_ormorokAI : public ScriptedAI
{
boss_ormorokAI(Creature *c) : ScriptedAI(c)
{
pInstance = c->GetInstanceData();
}
ScriptedInstance* pInstance;
bool Frenzy;
bool CrystalSpikes;
uint8 CrystalSpikes_Count;
float BaseX;
float BaseY;
float BaseZ;
float BaseO;
float SpikeXY[4][2];
uint32 SPELL_CRYSTAL_SPIKES_Timer;
uint32 CRYSTAL_SPIKES_Timer;
uint32 SPELL_TRAMPLE_Timer;
uint32 SPELL_FRENZY_Timer;
uint32 SPELL_SPELL_REFLECTION_Timer;
uint32 SPELL_SUMMON_CRYSTALLINE_TANGLER_Timer;
void Reset()
{
SPELL_CRYSTAL_SPIKES_Timer = 12000;
SPELL_TRAMPLE_Timer = 10000;
SPELL_SPELL_REFLECTION_Timer = 30000;
SPELL_SUMMON_CRYSTALLINE_TANGLER_Timer = 17000;
Frenzy = false;
CrystalSpikes = false;
if (pInstance)
pInstance->SetData(DATA_ORMOROK_EVENT, NOT_STARTED);
}
void EnterCombat(Unit* who)
{
DoScriptText(SAY_AGGRO, m_creature);
if (pInstance)
pInstance->SetData(DATA_ORMOROK_EVENT, IN_PROGRESS);
}
void JustDied(Unit* killer)
{
DoScriptText(SAY_DEATH, m_creature);
if (pInstance)
pInstance->SetData(DATA_ORMOROK_EVENT, DONE);
}
void KilledUnit(Unit *victim)
{
DoScriptText(SAY_KILL, m_creature);
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
{
return;
}
if (CrystalSpikes)
if (CRYSTAL_SPIKES_Timer <= diff)
{
SpikeXY[0][0] = BaseX+(SPIKE_DISTANCE*CrystalSpikes_Count*cos(BaseO));
SpikeXY[0][1] = BaseY+(SPIKE_DISTANCE*CrystalSpikes_Count*sin(BaseO));
SpikeXY[1][0] = BaseX-(SPIKE_DISTANCE*CrystalSpikes_Count*cos(BaseO));
SpikeXY[1][1] = BaseY-(SPIKE_DISTANCE*CrystalSpikes_Count*sin(BaseO));
SpikeXY[2][0] = BaseX+(SPIKE_DISTANCE*CrystalSpikes_Count*cos(BaseO-(M_PI/2)));
SpikeXY[2][1] = BaseY+(SPIKE_DISTANCE*CrystalSpikes_Count*sin(BaseO-(M_PI/2)));
SpikeXY[3][0] = BaseX-(SPIKE_DISTANCE*CrystalSpikes_Count*cos(BaseO-(M_PI/2)));
SpikeXY[3][1] = BaseY-(SPIKE_DISTANCE*CrystalSpikes_Count*sin(BaseO-(M_PI/2)));
for (uint8 i = 0; i < 4; ++i)
Creature* Spike = m_creature->SummonCreature(MOB_CRYSTAL_SPIKE, SpikeXY[i][0], SpikeXY[i][1], BaseZ, 0, TEMPSUMMON_TIMED_DESPAWN, 7000);
if (++CrystalSpikes_Count >= 13)
CrystalSpikes = false;
CRYSTAL_SPIKES_Timer = 200;
} else CRYSTAL_SPIKES_Timer -= diff;
if (!Frenzy && (m_creature->GetHealth() < m_creature->GetMaxHealth() * 0.25))
{
DoCast(m_creature, SPELL_FRENZY);
Frenzy = true;
}
if (SPELL_TRAMPLE_Timer <= diff)
{
DoCast(m_creature, DUNGEON_MODE(SPELL_TRAMPLE_N, SPELL_TRAMPLE_H));
SPELL_TRAMPLE_Timer = 10000;
} else SPELL_TRAMPLE_Timer -= diff;
if (SPELL_SPELL_REFLECTION_Timer <= diff)
{
DoScriptText(SAY_REFLECT, m_creature);
DoCast(m_creature, SPELL_SPELL_REFLECTION);
SPELL_SPELL_REFLECTION_Timer = 30000;
} else SPELL_SPELL_REFLECTION_Timer -= diff;
if (SPELL_CRYSTAL_SPIKES_Timer <= diff)
{
DoScriptText(SAY_CRYSTAL_SPIKES, m_creature);
CrystalSpikes = true;
CrystalSpikes_Count = 1;
CRYSTAL_SPIKES_Timer = 0;
BaseX = m_creature->GetPositionX();
BaseY = m_creature->GetPositionY();
BaseZ = m_creature->GetPositionZ();
BaseO = m_creature->GetOrientation();
SPELL_CRYSTAL_SPIKES_Timer = 20000;
} else SPELL_CRYSTAL_SPIKES_Timer -=diff;
if (IsHeroic() && (SPELL_SUMMON_CRYSTALLINE_TANGLER_Timer <= diff))
{
Creature* Crystalline_Tangler = m_creature->SummonCreature(MOB_CRYSTALLINE_TANGLER, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), m_creature->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000);
if (Crystalline_Tangler)
{
Unit *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<HostilReference*>::iterator i = m_creature->getThreatManager().getThreatList().begin();
for (; i != m_creature->getThreatManager().getThreatList().end(); ++i)
{
Unit* pTemp = Unit::GetUnit((*m_creature),(*i)->getUnitGuid());
if (pTemp && pTemp->GetTypeId() == TYPEID_PLAYER && pTemp->getClass() == Healer)
{
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);
}
}
SPELL_SUMMON_CRYSTALLINE_TANGLER_Timer = 17000;
} else SPELL_SUMMON_CRYSTALLINE_TANGLER_Timer -=diff;
DoMeleeAttackIfReady();
}
};
struct TRINITY_DLL_DECL mob_crystal_spikeAI : public Scripted_NoMovementAI
{
mob_crystal_spikeAI(Creature *c) : Scripted_NoMovementAI(c)
{
}
uint32 SPELL_CRYSTALL_SPIKE_DAMAGE_Timer;
uint32 SPELL_CRYSTAL_SPIKE_PREVISUAL_Timer;
void Reset()
{
SPELL_CRYSTALL_SPIKE_DAMAGE_Timer = 3700;
SPELL_CRYSTAL_SPIKE_PREVISUAL_Timer = 1000;
m_creature->SetLevel(80); //
m_creature->setFaction(16); //Walkaround to be independent from data in DB
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); //
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); //
}
void UpdateAI(const uint32 diff)
{
if (SPELL_CRYSTAL_SPIKE_PREVISUAL_Timer <= diff)
{
DoCast(m_creature, SPELL_CRYSTAL_SPIKE_PREVISUAL);
SPELL_CRYSTAL_SPIKE_PREVISUAL_Timer = 10000;
} else SPELL_CRYSTAL_SPIKE_PREVISUAL_Timer -=diff;
if (SPELL_CRYSTALL_SPIKE_DAMAGE_Timer <= diff)
{
DoCast(m_creature, DUNGEON_MODE(SPELL_CRYSTALL_SPIKE_DAMAGE_N, SPELL_CRYSTALL_SPIKE_DAMAGE_H));
SPELL_CRYSTALL_SPIKE_DAMAGE_Timer = 10000;
} else SPELL_CRYSTALL_SPIKE_DAMAGE_Timer -=diff;
}
};
struct TRINITY_DLL_DECL mob_crystalline_tanglerAI : public ScriptedAI
{
mob_crystalline_tanglerAI(Creature *c) : ScriptedAI(c) {}
uint32 SPELL_ROOTS_Timer;
void Reset()
{
SPELL_ROOTS_Timer = 1000;
}
void UpdateAI(const uint32 diff)
{
if (SPELL_ROOTS_Timer <= diff)
{
if (m_creature->IsWithinDist(m_creature->getVictim(), 5.0f, false))
{
DoCast(m_creature->getVictim(), SPELL_ROOTS);
SPELL_ROOTS_Timer = 15000;
}
} else SPELL_ROOTS_Timer -=diff;
}
};
CreatureAI* GetAI_mob_crystal_spike(Creature* 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 TRINITY_DLL_DECL 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 TRINITY_DLL_DECL boss_commander_stoutbeardAI : public ScriptedAI
{
boss_commander_stoutbeardAI(Creature *c) : ScriptedAI(c) {}
void Reset() {}
void EnterCombat(Unit* who)
{
DoScriptText(SAY_AGGRO, m_creature);
}
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, m_creature);
}
};
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,254 @@
/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Instance_Nexus
SD%Complete:
SDComment:
SDCategory: The Nexus, The Nexus
EndScriptData */
#include "ScriptedPch.h"
#include "nexus.h"
#define NUMBER_OF_ENCOUNTERS 4
struct TRINITY_DLL_DECL 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;
}
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:
{
pCreature->setFaction(16);
if (TeamInInstance == ALLIANCE)
pCreature->UpdateEntry(26799, HORDE);
break;
}
case 26802:
{
pCreature->setFaction(16);
if (TeamInInstance == ALLIANCE)
pCreature->UpdateEntry(26801, HORDE);
break;
}
case 26805:
{
pCreature->setFaction(16);
if (TeamInInstance == ALLIANCE)
pCreature->UpdateEntry(26803, HORDE);
break;
}
case 27949:
{
pCreature->setFaction(16);
if (TeamInInstance == ALLIANCE)
pCreature->UpdateEntry(27947, HORDE);
break;
}
case 26796:
{
pCreature->setFaction(16);
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();
}
+19
View File
@@ -0,0 +1,19 @@
#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,98 @@
/* Script Data Start
SDName: Boss drakos
SDAuthor: LordVanMartin
SD%Complete:
SDComment:
SDCategory:
Script Data End */
/*** SQL START ***
update creature_template set scriptname = '' where entry = '';
*** SQL END ***/
#include "ScriptedPch.h"
#include "oculus.h"
enum Spells
{
SPELL_MAGIC_PULL = 51336,
SPELL_THUNDERING_STOMP = 50774,
SPELL_THUNDERING_STOMP_2 = 59370
};
//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
};
struct TRINITY_DLL_DECL boss_drakosAI : public ScriptedAI
{
boss_drakosAI(Creature *c) : ScriptedAI(c)
{
pInstance = c->GetInstanceData();
}
ScriptedInstance* pInstance;
void Reset()
{
if (pInstance)
pInstance->SetData(DATA_DRAKOS_EVENT, NOT_STARTED);
}
void EnterCombat(Unit* who)
{
DoScriptText(SAY_AGGRO, m_creature);
if (pInstance)
pInstance->SetData(DATA_DRAKOS_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, m_creature);
if (pInstance)
pInstance->SetData(DATA_DRAKOS_EVENT, DONE);
}
void KilledUnit(Unit *victim)
{
if (victim == m_creature)
return;
DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2,SAY_KILL_3), m_creature);
}
};
CreatureAI* GetAI_boss_drakos(Creature* pCreature)
{
return new boss_drakosAI (pCreature);
}
void AddSC_boss_drakos()
{
Script *newscript;
newscript = new Script;
newscript->Name = "boss_drakos";
newscript->GetAI = &GetAI_boss_drakos;
newscript->RegisterSelf();
}
@@ -0,0 +1,125 @@
/* Script Data Start
SDName: Boss eregos
SDAuthor: LordVanMartin
SD%Complete:
SDComment: Encounter is done entirely on drake vehicles
SDCategory:
Script Data End */
/*** SQL START ***
update creature_template set scriptname = '' where entry = '';
*** SQL END ***/
#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,
SPELL_ARCANE_VOLLEY = 51153,
SPELL_ENRAGED_ASSAULT = 51170,
SPELL_PLANAR_ANOMALIES = 57959,
SPELL_PLANAR_SHIFT = 51162,
//Heroic
H_SPELL_ARCANE_BARRAGE = 59381,
H_SPELL_ARCANE_VOLLEY = 59382
};
/*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 TRINITY_DLL_DECL 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,103 @@
/* Script Data Start
SDName: Boss urom
SDAuthor: LordVanMartin
SD%Complete: 1%
SDComment:
SDCategory:
Script Data End */
/*** SQL START ***
update creature_template set scriptname = '' where entry = '';
*** SQL END ***/
#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
};
//not in db
enum Yells
{
SAY_AGGRO = -1578012,
SAY_KILL_1 = -1578013,
SAY_KILL_2 = -1578014,
SAY_KILL_3 = -1578015,
SAY_DEATH = -1578016,
SAY_EXPLOSION_1 = -1578017,
SAY_EXPLOSION_2 = -1578018,
SAY_SUMMON_1 = -1578019,
SAY_SUMMON_2 = -1578020,
SAY_SUMMON_3 = -1578021
};
struct TRINITY_DLL_DECL boss_uromAI : public ScriptedAI
{
boss_uromAI(Creature *c) : ScriptedAI(c)
{
pInstance = c->GetInstanceData();
}
ScriptedInstance* pInstance;
void Reset()
{
if (pInstance)
pInstance->SetData(DATA_UROM_EVENT, NOT_STARTED);
}
void EnterCombat(Unit* who)
{
DoScriptText(SAY_AGGRO, m_creature);
if (pInstance)
pInstance->SetData(DATA_UROM_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, m_creature);
if (pInstance)
pInstance->SetData(DATA_UROM_EVENT, DONE);
}
void KilledUnit(Unit *victim)
{
if (victim == m_creature)
return;
DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2,SAY_KILL_3), m_creature);
}
};
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,100 @@
/* Script Data Start
SDName: Boss varos
SDAuthor: LordVanMartin
SD%Complete:
SDComment:
SDCategory:
Script Data End */
/*** SQL START ***
update creature_template set scriptname = '' where entry = '';
*** SQL END ***/
#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 TRINITY_DLL_DECL 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, m_creature);
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, m_creature);
if (pInstance)
pInstance->SetData(DATA_VAROS_EVENT, DONE);
}
void KilledUnit(Unit *victim)
{
if (victim == m_creature)
return;
DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2), m_creature);
}
};
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,150 @@
#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 TRINITY_DLL_DECL instance_oculus : public ScriptedInstance
{
instance_oculus(Map* pMap) : ScriptedInstance(pMap) {Initialize();};
uint64 uiDrakos;
uint64 uiVaros;
uint64 uiUrom;
uint64 uiEregos;
uint8 m_auiEncounter[MAX_ENCOUNTER];
std::string str_data;
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 SetData(uint32 type, uint32 data)
{
switch(type)
{
case DATA_DRAKOS_EVENT:
m_auiEncounter[0] = data;
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;
}
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];
}
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;
}
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,28 @@
#ifndef DEF_OCULUS_H
#define DEF_OCULUS_H
enum Data
{
DATA_DRAKOS_EVENT,
DATA_VAROS_EVENT,
DATA_UROM_EVENT,
DATA_EREGOS_EVENT
};
enum Data64
{
DATA_DRAKOS,
DATA_VAROS,
DATA_UROM,
DATA_EREGOS
};
enum Bosses
{
CREATURE_DRAKOS = 27654,
CREATURE_VAROS = 27447,
CREATURE_UROM = 27655,
CREATURE_EREGOS = 27656
};
#endif