aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/FULL/world_scripts_full.sql17
-rw-r--r--sql/updates/5990_world_scripts.sql1
-rw-r--r--src/bindings/scripts/scripts/northrend/azjol_nerub/azjol_nerub/boss_anubarak.cpp262
-rw-r--r--src/bindings/scripts/system/ScriptLoader.cpp2
4 files changed, 246 insertions, 36 deletions
diff --git a/sql/FULL/world_scripts_full.sql b/sql/FULL/world_scripts_full.sql
index 732d5c017ee..984be4b5871 100644
--- a/sql/FULL/world_scripts_full.sql
+++ b/sql/FULL/world_scripts_full.sql
@@ -175,15 +175,16 @@ UPDATE `creature_template` SET `ScriptName`='mob_voidtraveler' WHERE `entry`=192
/* AZJOL-NERUB */
UPDATE `instance_template` SET `script`='instance_azjol_nerub' WHERE `map`=601;
-UPDATE creature_template SET `ScriptName`='npc_watcher_narjil' WHERE `entry`=28729;
-UPDATE creature_template SET `ScriptName`='npc_watcher_silthik' WHERE `entry`=28731;
-UPDATE creature_template SET `ScriptName`='npc_anub_ar_warrior' WHERE `entry`=28732;
-UPDATE creature_template SET `ScriptName`='npc_watcher_gashra' WHERE `entry`=28730;
-UPDATE creature_template SET `ScriptName`='boss_krik_thir' WHERE `entry`=28684;
-UPDATE creature_template SET `ScriptName`='npc_skittering_infector' WHERE `entry`=28736;
-UPDATE creature_template SET `ScriptName`='npc_anub_ar_skirmisher' WHERE `entry`=28734;
-UPDATE creature_template SET `ScriptName`='npc_anub_ar_shadowcaster' WHERE `entry`=28733;
+UPDATE `creature_template` SET `ScriptName`='npc_watcher_narjil' WHERE `entry`=28729;
+UPDATE `creature_template` SET `ScriptName`='npc_watcher_silthik' WHERE `entry`=28731;
+UPDATE `creature_template` SET `ScriptName`='npc_anub_ar_warrior' WHERE `entry`=28732;
+UPDATE `creature_template` SET `ScriptName`='npc_watcher_gashra' WHERE `entry`=28730;
+UPDATE `creature_template` SET `ScriptName`='boss_krik_thir' WHERE `entry`=28684;
+UPDATE `creature_template` SET `ScriptName`='npc_skittering_infector' WHERE `entry`=28736;
+UPDATE `creature_template` SET `ScriptName`='npc_anub_ar_skirmisher' WHERE `entry`=28734;
+UPDATE `creature_template` SET `ScriptName`='npc_anub_ar_shadowcaster' WHERE `entry`=28733;
UPDATE `creature_template` SET `ScriptName`='boss_hadronox' WHERE `entry`=28921;
+UPDATE `creature_template` SET `ScriptName`='boss_anub_arak' WHERE `entry`=29120;
/* AHN'KAHET: THE OLD KINGDOM */
UPDATE `instance_template` SET `script`='instance_ahnkahet' WHERE `map`=619;
diff --git a/sql/updates/5990_world_scripts.sql b/sql/updates/5990_world_scripts.sql
new file mode 100644
index 00000000000..f19953090ed
--- /dev/null
+++ b/sql/updates/5990_world_scripts.sql
@@ -0,0 +1 @@
+UPDATE `creature_template` SET `ScriptName`='boss_anub_arak' WHERE `entry`=29120;
diff --git a/src/bindings/scripts/scripts/northrend/azjol_nerub/azjol_nerub/boss_anubarak.cpp b/src/bindings/scripts/scripts/northrend/azjol_nerub/azjol_nerub/boss_anubarak.cpp
index 8172c9a3f66..57ebaa43ebe 100644
--- a/src/bindings/scripts/scripts/northrend/azjol_nerub/azjol_nerub/boss_anubarak.cpp
+++ b/src/bindings/scripts/scripts/northrend/azjol_nerub/azjol_nerub/boss_anubarak.cpp
@@ -18,24 +18,35 @@
/* ScriptData
SDName: boss_anubarak
-SDAuthor: LordVanMartin
-SD%Complete: 0
-SDComment:
+SD%Complete: 90 %
+SDComment: Says are not implemented.
SDCategory: Azjol Nerub
EndScriptData */
-/*** SQL START ***
-update creature_template set scriptname = 'boss_anub_arak' where entry = '';
-*** SQL END ***/
#include "precompiled.h"
#include "def_azjol_nerub.h"
-//Spells
-#define SPELL_CARRION_BEETLES 53520
-#define SPELL_LOCUST_SWARM 53467
-#define SPELL_IMPALE 53454
-#define SPELL_POUND 53472
+enum
+{
+
+ SPELL_CARRION_BEETLES = 53520,
+ SPELL_SUMMON_CARRION_BEETLES = 53521,
+ SPELL_LEECHING_SWARM = 53467,
+
+ SPELL_IMPALE = 53454,
+ H_SPELL_IMPALE = 59446,
+
+ SPELL_POUND = 53472,
+ H_SPELL_POUND = 59433,
+
+ SPELL_SUBMERGE = 53421,
+
+ CREATURE_GUARDIAN = 29216,
+ CREATURE_VENOMANCER = 29217,
+ CREATURE_DATTER = 29213
+
+};
// not in db
//Yell
@@ -51,44 +62,239 @@ update creature_template set scriptname = 'boss_anub_arak' where entry = '';
#define SAY_SUBMERGE_2 -1601009
#define SAY_DEATH -1601004
+#define SPAWNPOINT_Z 224.3
+
+float SpawnPoint[2][2] =
+{
+ {550.7, 282.8},
+ {551.1, 229.4},
+};
+
struct TRINITY_DLL_DECL boss_anub_arakAI : public ScriptedAI
{
- boss_anub_arakAI(Creature *c) : ScriptedAI(c) {}
+ boss_anub_arakAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = c->GetInstanceData();
+ HeroicMode = c->GetMap()->IsHeroic();
+ }
+
+ ScriptedInstance* pInstance;
- uint32 phase;
+ bool Channeling;
+ bool HeroicMode;
+ bool Summoned_Guardian;
+ bool Summoned_Venomancer;
+ bool Summoned_Datter;
+ uint32 Phase;
+ uint32 Phase_Time;
- void Reset() {}
- void EnterCombat(Unit* who)
+ uint32 SPELL_CARRION_BEETLES_Timer;
+ uint32 SPELL_LEECHING_SWARM_Timer;
+ uint32 SPELL_IMPALE_Timer;
+ uint32 SPELL_POUND_Timer;
+ uint32 SPELL_SUBMERGE_Timer;
+ uint32 UNDERGROUND_Timer;
+ uint32 VENOMANCER_Timer;
+ uint32 DATTER_Timer;
+
+ void Reset()
{
- DoScriptText(SAY_AGGRO, m_creature);
+
+ SPELL_CARRION_BEETLES_Timer = 8000;
+ SPELL_LEECHING_SWARM_Timer = 20000;
+ SPELL_IMPALE_Timer = 9000;
+ SPELL_POUND_Timer = 15000;
+
+ Phase = 0;
+ Phase_Time = 0;
+ Channeling = false;
+
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ m_creature->RemoveAura(SPELL_SUBMERGE);
+
}
- void AttackStart(Unit* who) {}
- void MoveInLineOfSight(Unit* who) {}
+
+
+ /* void EnterCombat(Unit* who)
+ {
+ DoScriptText(SAY_AGGRO, m_creature);
+ }*/
+
+
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
- phase =1;
+ if (Channeling == true)
+ {
+ for(int ind = 0 ; ind < 4; ind++) m_creature->CastSpell(m_creature->getVictim(),SPELL_SUMMON_CARRION_BEETLES,true);
+ Channeling = false;
+
+ }
+
+ if (Phase == 1)
+ {
+
+ if (SPELL_IMPALE_Timer < diff)
+ {
- if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) <= 33)
- phase = 2;
- if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) == 15)
- phase = 3;
+ Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0);
+ if (m_creature->GetMap()->IsHeroic())
+ {
+ m_creature->CastSpell(target,H_SPELL_IMPALE,true);
- DoMeleeAttackIfReady();
+ }else{
+ m_creature->CastSpell(target,SPELL_IMPALE,true);
+ }
+
+
+ SPELL_IMPALE_Timer = 9000;
+ }else SPELL_IMPALE_Timer -= diff;
+
+ if(!Summoned_Guardian)
+ {
+ Creature* Guardian;
+ for(uint8 i=0; i < 2; ++i)
+ {
+ Guardian = m_creature->SummonCreature(CREATURE_GUARDIAN,SpawnPoint[i][0],SpawnPoint[i][1],SPAWNPOINT_Z,0,TEMPSUMMON_CORPSE_DESPAWN,0);
+ if(Guardian)
+ {
+ Guardian->AddThreat(m_creature->getVictim(), 0.0f);
+ DoZoneInCombat(Guardian);
+ }
+ }
+ Summoned_Guardian = true;
+ }
+
+ if(!Summoned_Venomancer)
+ {
+ if(VENOMANCER_Timer < diff)
+ {
+ if(Phase_Time > 1)
+ {
+
+ Creature* Venomancer;
+ for(uint8 i=0; i < 2; ++i)
+ {
+ Venomancer = m_creature->SummonCreature(CREATURE_VENOMANCER,SpawnPoint[i][0],SpawnPoint[i][1],SPAWNPOINT_Z,0,TEMPSUMMON_CORPSE_DESPAWN,0);
+ if(Venomancer)
+ {
+ Venomancer->AddThreat(m_creature->getVictim(), 0.0f);
+ DoZoneInCombat(Venomancer);
+ }
+ }
+ Summoned_Venomancer = true;
+ }
+
+ }else VENOMANCER_Timer -= diff;
+ }
+
+ if(!Summoned_Datter)
+ {
+ if(DATTER_Timer < diff)
+ {
+ if(Phase_Time > 2)
+ {
+ Creature* Datter;
+ for(uint8 i=0; i < 2; ++i)
+ {
+ Datter = m_creature->SummonCreature(CREATURE_DATTER,SpawnPoint[i][0],SpawnPoint[i][1],SPAWNPOINT_Z,0,TEMPSUMMON_CORPSE_DESPAWN,0);
+ if(Datter)
+ {
+ Datter->AddThreat(m_creature->getVictim(), 0.0f);
+ DoZoneInCombat(Datter);
+ }
+ }
+ Summoned_Datter = true;
+ }
+ }else DATTER_Timer -= diff;
+ }
+
+ if (UNDERGROUND_Timer < diff)
+ {
+ m_creature->RemoveAura(SPELL_SUBMERGE);
+
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+
+ Phase = 0;
+ }else UNDERGROUND_Timer -= diff;
+
+ }
+
+ if (Phase == 0)
+ {
+ if (SPELL_LEECHING_SWARM_Timer < diff)
+ {
+ m_creature->CastSpell(m_creature,SPELL_LEECHING_SWARM,true);
+
+ SPELL_LEECHING_SWARM_Timer = 19000;
+ }else SPELL_LEECHING_SWARM_Timer -= diff;
+
+ if (SPELL_CARRION_BEETLES_Timer < diff)
+ {
+ Channeling = true;
+ m_creature->CastSpell(m_creature->getVictim(),SPELL_CARRION_BEETLES,false);
+
+ SPELL_CARRION_BEETLES_Timer = 25000;
+ }else SPELL_CARRION_BEETLES_Timer -= diff;
+
+ if (SPELL_POUND_Timer < diff)
+ {
+
+ DoCast(m_creature->getVictim(), HeroicMode ? H_SPELL_POUND : SPELL_POUND);
+
+ SPELL_POUND_Timer = 16500;
+ }else SPELL_POUND_Timer -= diff;
+
+ }
+
+ if ((Phase_Time == 0 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) <= 75)
+ || (Phase_Time == 1 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) <= 50)
+ || (Phase_Time == 2 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) <= 25))
+ {
+ ++Phase_Time;
+
+ Summoned_Guardian = false;
+ Summoned_Venomancer = false;
+ Summoned_Datter = false;
+
+ UNDERGROUND_Timer = 40000;
+ VENOMANCER_Timer = 25000;
+ DATTER_Timer = 32000;
+
+ m_creature->CastSpell(m_creature,SPELL_SUBMERGE,false);
+
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+
+ Phase = 1;
+
+ }
+
+ if (!Phase == 1)
+ {
+ DoMeleeAttackIfReady();
+ }
}
- void JustDied(Unit* killer)
+ /*void JustDied(Unit* killer)
{
DoScriptText(SAY_DEATH, m_creature);
- }
+ }*/
+
void KilledUnit(Unit *victim)
{
if (victim == m_creature)
return;
- DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), m_creature);
+/* switch(rand()%3)
+ {
+ case 0: DoScriptText(SAY_SLAY_1, m_creature);break;
+ case 1: DoScriptText(SAY_SLAY_2, m_creature);break;
+ case 2: DoScriptText(SAY_SLAY_3, m_creature);break;
+ }*/
}
};
@@ -102,7 +308,7 @@ void AddSC_boss_anub_arak()
Script *newscript;
newscript = new Script;
- newscript->Name = "boss_anub_arak";
+ newscript->Name="boss_anub_arak";
newscript->GetAI = &GetAI_boss_anub_arak;
newscript->RegisterSelf();
}
diff --git a/src/bindings/scripts/system/ScriptLoader.cpp b/src/bindings/scripts/system/ScriptLoader.cpp
index bb981e40bae..5d026318a9b 100644
--- a/src/bindings/scripts/system/ScriptLoader.cpp
+++ b/src/bindings/scripts/system/ScriptLoader.cpp
@@ -269,6 +269,7 @@ extern void AddSC_boss_eck();
extern void AddSC_instance_gundrak();
extern void AddSC_boss_krik_thir(); //Azjol-Nerub
extern void AddSC_boss_hadronox();
+extern void AddSC_boss_anub_arak();
extern void AddSC_instance_azjol_nerub();
extern void AddSC_instance_ahnkahet(); //Azjol-Nerub Ahn'kahet
extern void AddSC_boss_amanitar();
@@ -707,6 +708,7 @@ void AddScripts()
AddSC_instance_ahnkahet();
AddSC_boss_krik_thir(); //Azjol-Nerub Azjol-Nerub
AddSC_boss_hadronox();
+ AddSC_boss_anub_arak();
AddSC_instance_azjol_nerub();
AddSC_boss_anubrekhan(); //Naxxramas
AddSC_boss_maexxna();