Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

R.I.P SimpleAI

- Convert SimpleAI to (DB) SmartAI
- Spell ids corrected (and completed some of the scripts)
- Random cleanup (code style) in some scripts
  • Loading branch information...
commit 2b2d054f64f1fa137364d2f840c7005e7936bdc2 1 parent 036dae5
@DDuarte DDuarte authored
View
59 sql/updates/world/2012_03_11_00_world_sai.sql
@@ -0,0 +1,59 @@
+-- Coilfang Guardian
+
+DELETE FROM `smart_scripts` WHERE (`entryorguid`=21873 AND `source_type`=0);
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(21873, 0, 0, 0, 0, 0, 0, 0, 5000, 5000, 15000, 15000, 11, 28168, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Coilfang Guardian - IC - Cast Arcing Smash'),
+(21873, 0, 1, 0, 0, 0, 0, 0, 2000, 2000, 10000, 10000, 11, 9080, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Coilfang Guardian - IC - Cast Harmstring'),
+(21873, 0, 2, 0, 0, 0, 50, 0, 3000, 4000, 10000, 20000, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Coilfang Guardian - IC - Say 0'); -- randomly guessed timers
+
+DELETE FROM `creature_text` WHERE `entry`=21873;
+INSERT INTO `world`.`creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`) VALUES
+(21873, 0, 0, 'By Nazjatar''s Depths!', 12, 0, 0, 0, 0, 0, 'Coilfang Guardian'),
+(21873, 0, 1, 'Die, warmblood!', 12, 0, 0, 0, 0, 0, 'Coilfang Guardian'),
+(21873, 0, 2, 'For the Master!', 12, 0, 0, 0, 0, 0, 'Coilfang Guardian'),
+(21873, 0, 3, 'Illidan reigns!', 12, 0, 0, 0, 0, 0, 'Coilfang Guardian'),
+(21873, 0, 4, 'My blood is like venom!', 12, 0, 0, 0, 0, 0, 'Coilfang Guardian');
+
+UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry`=21873;
+
+-- Coilfang Strider
+
+DELETE FROM `smart_scripts` WHERE (`entryorguid`=22056 AND `source_type`=0);
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(22056, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 11, 38257, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Coilfang Strider - On Reset - Cast Panic Periodic'),
+(22056, 0, 1, 0, 0, 0, 0, 0, 8000, 8000, 30000, 40000, 11, 38259, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Coilfang Strider - IC - Cast Mind Blast');
+
+UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry`=22056;
+
+-- Coilfang Elite
+
+DELETE FROM `smart_scripts` WHERE (`entryorguid`=22055 AND `source_type`=0);
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(22055, 0, 0, 0, 0, 0, 0, 0, 5000, 5000, 15000, 20000, 11, 38260, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 'Coilfang Elite - IC - Cast Cleave'),
+(22055, 0, 1, 0, 0, 0, 0, 0, 2000, 2000, 10000, 10000, 11, 38262, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Coilfang Elite - IC - Cast Harmstring');
+
+UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry`=22055;
+
+-- Core Hound
+
+DELETE FROM `smart_scripts` WHERE (`entryorguid`=11673 AND `source_type`=0);
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(11673, 0, 0, 0, 0, 0, 0, 0, 10000, 10000, 7000, 7000, 11, 19272, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Core Hound - IC - Cast Lava Breath'),
+(11673, 0, 1, 0, 0, 0, 0, 0, 4000, 4000, 6000, 6000, 11, 19319, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Core Hound - IC - Cast Vicious Bite'),
+(11673, 0, 2, 0, 0, 0, 0, 0, 15000, 15000, 24000, 24000, 88, 11673*100+0, 11673*100+5, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Core Hound - IC - Call random script'),
+(11673*100+0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 19364, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Core Hound - Random 0 - Cast Ground Stomp'),
+(11673*100+1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 19366, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Core Hound - Random 1 - Cast Cauterizing Flames'),
+(11673*100+2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 19367, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Core Hound - Random 2 - Cast Withering Heat'),
+(11673*100+3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 19369, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Core Hound - Random 3 - Cast Ancient Despair'),
+(11673*100+4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 19372, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Core Hound - Random 4 - Cast Ancient Hysteria'),
+(11673*100+5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 19365, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Core Hound - Random 5 - Cast Ancient Dread');
+
+UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry`=11673;
+
+-- Shadow of Aran
+
+DELETE FROM `smart_scripts` WHERE (`entryorguid`=18254 AND `source_type`=0);
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(18254, 0, 0, 0, 0, 0, 0, 0, 1000, 1000, 5000, 5000, 11, 29978, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Shadow of Aran - IC - Cast Pyro Blast');
+
+UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry`=18254;
View
280 src/server/game/AI/ScriptedAI/ScriptedSimpleAI.cpp
@@ -1,280 +0,0 @@
-/*
- * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
- * 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, see <http://www.gnu.org/licenses/>.
- */
-
-/* ScriptData
-SDName: SimpleAI
-SD%Complete: 100
-SDComment: Base Class for SimpleAI creatures
-SDCategory: Creatures
-EndScriptData */
-
-#include "ScriptPCH.h"
-#include "ScriptedSimpleAI.h"
-
-SimpleAI::SimpleAI(Creature* c) : ScriptedAI(c)
-{
- //Clear all data
- Aggro_TextId[0] = 0;
- Aggro_TextId[1] = 0;
- Aggro_TextId[2] = 0;
- Aggro_Sound[0] = 0;
- Aggro_Sound[1] = 0;
- Aggro_Sound[2] = 0;
-
- Death_TextId[0] = 0;
- Death_TextId[1] = 0;
- Death_TextId[2] = 0;
- Death_Sound[0] = 0;
- Death_Sound[1] = 0;
- Death_Sound[2] = 0;
- Death_Spell = 0;
- Death_Target_Type = 0;
-
- Kill_TextId[0] = 0;
- Kill_TextId[1] = 0;
- Kill_TextId[2] = 0;
- Kill_Sound[0] = 0;
- Kill_Sound[1] = 0;
- Kill_Sound[2] = 0;
- Kill_Spell = 0;
- Kill_Target_Type = 0;
-
- memset(Spell, 0, sizeof(Spell));
-
- EnterEvadeMode();
-}
-
-void SimpleAI::Reset()
-{
-}
-
-void SimpleAI::EnterCombat(Unit* who)
-{
- //Reset cast timers
- if (Spell[0].First_Cast >= 0)
- Spell_Timer[0] = Spell[0].First_Cast;
- else Spell_Timer[0] = 1000;
- if (Spell[1].First_Cast >= 0)
- Spell_Timer[1] = Spell[1].First_Cast;
- else Spell_Timer[1] = 1000;
- if (Spell[2].First_Cast >= 0)
- Spell_Timer[2] = Spell[2].First_Cast;
- else Spell_Timer[2] = 1000;
- if (Spell[3].First_Cast >= 0)
- Spell_Timer[3] = Spell[3].First_Cast;
- else Spell_Timer[3] = 1000;
- if (Spell[4].First_Cast >= 0)
- Spell_Timer[4] = Spell[4].First_Cast;
- else Spell_Timer[4] = 1000;
- if (Spell[5].First_Cast >= 0)
- Spell_Timer[5] = Spell[5].First_Cast;
- else Spell_Timer[5] = 1000;
- if (Spell[6].First_Cast >= 0)
- Spell_Timer[6] = Spell[6].First_Cast;
- else Spell_Timer[6] = 1000;
- if (Spell[7].First_Cast >= 0)
- Spell_Timer[7] = Spell[7].First_Cast;
- else Spell_Timer[7] = 1000;
- if (Spell[8].First_Cast >= 0)
- Spell_Timer[8] = Spell[8].First_Cast;
- else Spell_Timer[8] = 1000;
- if (Spell[9].First_Cast >= 0)
- Spell_Timer[9] = Spell[9].First_Cast;
- else Spell_Timer[9] = 1000;
-
- uint8 random_text = urand(0, 2);
-
- //Random text
- if (Aggro_TextId[random_text])
- DoScriptText(Aggro_TextId[random_text], me, who);
-
- //Random sound
- if (Aggro_Sound[random_text])
- DoPlaySoundToSet(me, Aggro_Sound[random_text]);
-}
-
-void SimpleAI::KilledUnit(Unit* victim)
-{
- uint8 random_text = urand(0, 2);
-
- //Random yell
- if (Kill_TextId[random_text])
- DoScriptText(Kill_TextId[random_text], me, victim);
-
- //Random sound
- if (Kill_Sound[random_text])
- DoPlaySoundToSet(me, Kill_Sound[random_text]);
-
- if (!Kill_Spell)
- return;
-
- Unit* target = NULL;
-
- switch (Kill_Target_Type)
- {
- case CAST_SELF:
- target = me;
- break;
- case CAST_HOSTILE_TARGET:
- target = me->getVictim();
- break;
- case CAST_HOSTILE_SECOND_AGGRO:
- target = SelectTarget(SELECT_TARGET_TOPAGGRO, 1);
- break;
- case CAST_HOSTILE_LAST_AGGRO:
- target = SelectTarget(SELECT_TARGET_BOTTOMAGGRO, 0);
- break;
- case CAST_HOSTILE_RANDOM:
- target = SelectTarget(SELECT_TARGET_RANDOM, 0);
- break;
- case CAST_KILLEDUNIT_VICTIM:
- target = victim;
- break;
- }
-
- //Target is ok, cast a spell on it
- if (target)
- DoCast(target, Kill_Spell);
-}
-
-void SimpleAI::DamageTaken(Unit* killer, uint32& damage)
-{
- //Return if damage taken won't kill us
- if (me->GetHealth() > damage)
- return;
-
- uint8 random_text = urand(0, 2);
-
- //Random yell
- if (Death_TextId[random_text])
- DoScriptText(Death_TextId[random_text], me, killer);
-
- //Random sound
- if (Death_Sound[random_text])
- DoPlaySoundToSet(me, Death_Sound[random_text]);
-
- if (!Death_Spell)
- return;
-
- Unit* target = NULL;
-
- switch (Death_Target_Type)
- {
- case CAST_SELF:
- target = me;
- break;
- case CAST_HOSTILE_TARGET:
- target = me->getVictim();
- break;
- case CAST_HOSTILE_SECOND_AGGRO:
- target = SelectTarget(SELECT_TARGET_TOPAGGRO, 1);
- break;
- case CAST_HOSTILE_LAST_AGGRO:
- target = SelectTarget(SELECT_TARGET_BOTTOMAGGRO, 0);
- break;
- case CAST_HOSTILE_RANDOM:
- target = SelectTarget(SELECT_TARGET_RANDOM, 0);
- break;
- case CAST_JUSTDIED_KILLER:
- target = killer;
- break;
- }
-
- //Target is ok, cast a spell on it
- if (target)
- DoCast(target, Death_Spell);
-}
-
-void SimpleAI::UpdateAI(const uint32 diff)
-{
- //Return since we have no target
- if (!UpdateVictim())
- return;
-
- //Spells
- for (uint32 i = 0; i < MAX_SIMPLEAI_SPELLS; ++i)
- {
- //Spell not valid
- if (!Spell[i].Enabled || !Spell[i].Spell_Id)
- continue;
-
- if (Spell_Timer[i] <= diff)
- {
- //Check if this is a percentage based
- if (Spell[i].First_Cast < 0 && Spell[i].First_Cast > -100 && HealthAbovePct(uint32(-Spell[i].First_Cast)))
- continue;
-
- //Check Current spell
- if (!(Spell[i].InterruptPreviousCast && me->IsNonMeleeSpellCasted(false)))
- {
- Unit* target = NULL;
-
- switch (Spell[i].Cast_Target_Type)
- {
- case CAST_SELF:
- target = me;
- break;
- case CAST_HOSTILE_TARGET:
- target = me->getVictim();
- break;
- case CAST_HOSTILE_SECOND_AGGRO:
- target = SelectTarget(SELECT_TARGET_TOPAGGRO, 1);
- break;
- case CAST_HOSTILE_LAST_AGGRO:
- target = SelectTarget(SELECT_TARGET_BOTTOMAGGRO, 0);
- break;
- case CAST_HOSTILE_RANDOM:
- target = SelectTarget(SELECT_TARGET_RANDOM, 0);
- break;
- }
-
- //Target is ok, cast a spell on it and then do our random yell
- if (target)
- {
- if (me->IsNonMeleeSpellCasted(false))
- me->InterruptNonMeleeSpells(false);
-
- DoCast(target, Spell[i].Spell_Id);
-
- //Yell and sound use the same number so that you can make
- //the Creature yell with the correct sound effect attached
- uint8 random_text = urand(0, 2);
-
- //Random yell
- if (Spell[i].TextId[random_text])
- DoScriptText(Spell[i].TextId[random_text], me, target);
-
- //Random sound
- if (Spell[i].Text_Sound[random_text])
- DoPlaySoundToSet(me, Spell[i].Text_Sound[random_text]);
- }
-
- }
-
- //Spell will cast agian when the cooldown is up
- if (Spell[i].CooldownRandomAddition)
- Spell_Timer[i] = Spell[i].Cooldown + (rand() % Spell[i].CooldownRandomAddition);
- else Spell_Timer[i] = Spell[i].Cooldown;
-
- } else Spell_Timer[i] -= diff;
-
- }
-
- DoMeleeAttackIfReady();
-}
-
View
73 src/server/game/AI/ScriptedAI/ScriptedSimpleAI.h
@@ -1,73 +0,0 @@
-/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
-* This program is free software licensed under GPL version 2
-* Please see the included DOCS/LICENSE.TXT for more information */
-
-#ifndef SC_SIMPLEAI_H
-#define SC_SIMPLEAI_H
-
-enum CastTarget
-{
- CAST_SELF = 0, //Self cast
- CAST_HOSTILE_TARGET, //Our current target (ie: highest aggro)
- CAST_HOSTILE_SECOND_AGGRO, //Second highest aggro (generaly used for cleaves and some special attacks)
- CAST_HOSTILE_LAST_AGGRO, //Dead last on aggro (no idea what this could be used for)
- CAST_HOSTILE_RANDOM, //Just any random target on our threat list
- CAST_FRIENDLY_RANDOM, //NOT YET IMPLEMENTED
-
- //Special cases
- CAST_KILLEDUNIT_VICTIM, //Only works within KilledUnit function
- CAST_JUSTDIED_KILLER, //Only works within JustDied function
-};
-
-#define MAX_SIMPLEAI_SPELLS 10
-
-struct SimpleAI : public ScriptedAI
-{
- SimpleAI(Creature* c);// : ScriptedAI(c);
-
- void Reset();
-
- void EnterCombat(Unit* /*who*/);
-
- void KilledUnit(Unit* /*victim*/);
-
- void DamageTaken(Unit* killer, uint32& damage);
-
- void UpdateAI(const uint32 diff);
-
-public:
-
- int32 Aggro_TextId[3];
- uint32 Aggro_Sound[3];
-
- int32 Death_TextId[3];
- uint32 Death_Sound[3];
- uint32 Death_Spell;
- uint32 Death_Target_Type;
-
- int32 Kill_TextId[3];
- uint32 Kill_Sound[3];
- uint32 Kill_Spell;
- uint32 Kill_Target_Type;
-
- struct SimpleAI_Spell
- {
- uint32 Spell_Id; //Spell ID to cast
- int32 First_Cast; //Delay for first cast
- uint32 Cooldown; //Cooldown between casts
- uint32 CooldownRandomAddition; //Random addition to cooldown (in range from 0 - CooldownRandomAddition)
- uint32 Cast_Target_Type; //Target type (note that certain spells may ignore this)
- bool InterruptPreviousCast; //Interrupt a previous cast if this spell needs to be cast
- bool Enabled; //Spell enabled or disabled (default: false)
-
- //3 texts to many?
- int32 TextId[3];
- uint32 Text_Sound[3];
- }Spell[MAX_SIMPLEAI_SPELLS];
-
-protected:
- uint32 Spell_Timer[MAX_SIMPLEAI_SPELLS];
-};
-
-#endif
-
View
2  src/server/game/Scripting/ScriptLoader.cpp
@@ -151,7 +151,6 @@ void AddSC_boss_sulfuron();
void AddSC_boss_majordomo();
void AddSC_boss_ragnaros();
void AddSC_instance_molten_core();
-void AddSC_molten_core();
void AddSC_the_scarlet_enclave(); //Scarlet Enclave
void AddSC_the_scarlet_enclave_c1();
void AddSC_the_scarlet_enclave_c2();
@@ -761,7 +760,6 @@ void AddEasternKingdomsScripts()
AddSC_boss_majordomo();
AddSC_boss_ragnaros();
AddSC_instance_molten_core();
- AddSC_molten_core();
AddSC_the_scarlet_enclave(); //Scarlet Enclave
AddSC_the_scarlet_enclave_c1();
AddSC_the_scarlet_enclave_c2();
View
1  src/server/scripts/CMakeLists.txt
@@ -34,7 +34,6 @@ set(scripts_STAT_SRCS
../game/AI/ScriptedAI/ScriptedEscortAI.cpp
../game/AI/ScriptedAI/ScriptedCreature.cpp
../game/AI/ScriptedAI/ScriptedFollowerAI.cpp
- ../game/AI/ScriptedAI/ScriptedSimpleAI.cpp
)
if(SCRIPTS)
View
1  src/server/scripts/EasternKingdoms/CMakeLists.txt
@@ -84,7 +84,6 @@ set(scripts_STAT_SRCS
EasternKingdoms/MoltenCore/instance_molten_core.cpp
EasternKingdoms/MoltenCore/boss_sulfuron_harbinger.cpp
EasternKingdoms/MoltenCore/boss_magmadar.cpp
- EasternKingdoms/MoltenCore/molten_core.cpp
EasternKingdoms/MoltenCore/boss_shazzrah.cpp
EasternKingdoms/Stratholme/boss_baroness_anastari.cpp
EasternKingdoms/Stratholme/boss_nerubenkan.cpp
View
26 src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp
@@ -24,7 +24,6 @@ SDCategory: Karazhan
EndScriptData */
#include "ScriptPCH.h"
-#include "ScriptedSimpleAI.h"
#include "karazhan.h"
#include "GameObject.h"
@@ -549,33 +548,8 @@ class mob_aran_elemental : public CreatureScript
};
-// CONVERT TO ACID
-class mob_shadow_of_aran : public CreatureScript
-{
-public:
- mob_shadow_of_aran() : CreatureScript("mob_shadow_of_aran") { }
-
- CreatureAI* GetAI(Creature* creature) const
- {
- sLog->outString("TSCR: Convert simpleAI script for Creature Entry %u to ACID", creature->GetEntry());
- SimpleAI* ai = new SimpleAI (creature);
-
- ai->Spell[0].Enabled = true;
- ai->Spell[0].Spell_Id = SPELL_SHADOW_PYRO;
- ai->Spell[0].Cooldown = 5000;
- ai->Spell[0].First_Cast = 1000;
- ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_TARGET;
-
- ai->EnterEvadeMode();
-
- return ai;
- }
-
-};
-
void AddSC_boss_shade_of_aran()
{
new boss_shade_of_aran();
- new mob_shadow_of_aran();
new mob_aran_elemental();
}
View
86 src/server/scripts/EasternKingdoms/MoltenCore/molten_core.cpp
@@ -1,86 +0,0 @@
-/*
- * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
- * 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, see <http://www.gnu.org/licenses/>.
- */
-
-/* ScriptData
-SDName: Molten_Core
-SD%Complete: 100
-SDComment:
-SDCategory: Molten Core
-EndScriptData */
-
-/* ContentData
-mob_ancient_core_hound
-EndContentData */
-
-#include "ScriptPCH.h"
-#include "ScriptedSimpleAI.h"
-
-enum Spells
-{
- SPELL_CONE_OF_FIRE = 19630,
- SPELL_BITE = 19771,
-
- //Random Debuff (each hound has only one of these)
- SPELL_GROUND_STOMP = 19364,
- SPELL_ANCIENT_DREAD = 19365,
- SPELL_CAUTERIZING_FLAMES = 19366,
- SPELL_WITHERING_HEAT = 19367,
- SPELL_ANCIENT_DESPAIR = 19369,
- SPELL_ANCIENT_HYSTERIA = 19372
-};
-
-class mob_ancient_core_hound : public CreatureScript
-{
-public:
- mob_ancient_core_hound() : CreatureScript("mob_ancient_core_hound") { }
-
- CreatureAI* GetAI(Creature* creature) const
- {
- SimpleAI* ai = new SimpleAI(creature);
-
- ai->Spell[0].Enabled = true;
- ai->Spell[0].Spell_Id = SPELL_CONE_OF_FIRE;
- ai->Spell[0].Cooldown = 7000;
- ai->Spell[0].First_Cast = 10000;
- ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_TARGET;
-
- uint32 RandDebuff = RAND(SPELL_GROUND_STOMP, SPELL_ANCIENT_DREAD, SPELL_CAUTERIZING_FLAMES,
- SPELL_WITHERING_HEAT, SPELL_ANCIENT_DESPAIR, SPELL_ANCIENT_HYSTERIA);
-
- ai->Spell[1].Enabled = true;
- ai->Spell[1].Spell_Id = RandDebuff;
- ai->Spell[1].Cooldown = 24000;
- ai->Spell[1].First_Cast = 15000;
- ai->Spell[1].Cast_Target_Type = CAST_HOSTILE_TARGET;
-
- ai->Spell[2].Enabled = true;
- ai->Spell[2].Spell_Id = SPELL_BITE;
- ai->Spell[2].Cooldown = 6000;
- ai->Spell[2].First_Cast = 4000;
- ai->Spell[2].Cast_Target_Type = CAST_HOSTILE_TARGET;
-
- ai->EnterEvadeMode();
-
- return ai;
- }
-};
-
-void AddSC_molten_core()
-{
- new mob_ancient_core_hound();
-}
View
635 src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp
@@ -25,7 +25,6 @@ EndScriptData */
#include "ScriptPCH.h"
#include "serpent_shrine.h"
-#include "ScriptedSimpleAI.h"
#include "Spell.h"
#define SAY_INTRO -1548042
@@ -132,7 +131,6 @@ float ShieldGeneratorChannelPos[4][4] =
{49.3126f, -943.398f, 42.5501f, 2.40174f}
};
-//Lady Vashj AI
class boss_lady_vashj : public CreatureScript
{
public:
@@ -147,29 +145,29 @@ class boss_lady_vashj : public CreatureScript
{
boss_lady_vashjAI (Creature* c) : ScriptedAI(c)
{
- instance = c->GetInstanceScript();
+ Instance = c->GetInstanceScript();
Intro = false;
JustCreated = true;
- c->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); //set it only once on Creature create (no need do intro if wiped)
+ c->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); // set it only once on Creature create (no need do intro if wiped)
}
- InstanceScript* instance;
+ InstanceScript* Instance;
uint64 ShieldGeneratorChannel[4];
uint32 AggroTimer;
- uint32 ShockBlast_Timer;
- uint32 Entangle_Timer;
- uint32 StaticCharge_Timer;
- uint32 ForkedLightning_Timer;
- uint32 Check_Timer;
- uint32 EnchantedElemental_Timer;
- uint32 TaintedElemental_Timer;
- uint32 CoilfangElite_Timer;
- uint32 CoilfangStrider_Timer;
- uint32 SummonSporebat_Timer;
- uint32 SummonSporebat_StaticTimer;
- uint8 EnchantedElemental_Pos;
+ uint32 ShockBlastTimer;
+ uint32 EntangleTimer;
+ uint32 StaticChargeTimer;
+ uint32 ForkedLightningTimer;
+ uint32 CheckTimer;
+ uint32 EnchantedElementalTimer;
+ uint32 TaintedElementalTimer;
+ uint32 CoilfangEliteTimer;
+ uint32 CoilfangStriderTimer;
+ uint32 SummonSporebatTimer;
+ uint32 SummonSporebatStaticTimer;
+ uint8 EnchantedElementalPos;
uint8 Phase;
bool Entangle;
@@ -180,18 +178,18 @@ class boss_lady_vashj : public CreatureScript
void Reset()
{
AggroTimer = 19000;
- ShockBlast_Timer = 1+rand()%60000;
- Entangle_Timer = 30000;
- StaticCharge_Timer = 10000+rand()%15000;
- ForkedLightning_Timer = 2000;
- Check_Timer = 15000;
- EnchantedElemental_Timer = 5000;
- TaintedElemental_Timer = 50000;
- CoilfangElite_Timer = 45000+rand()%5000;
- CoilfangStrider_Timer = 60000+rand()%10000;
- SummonSporebat_Timer = 10000;
- SummonSporebat_StaticTimer = 30000;
- EnchantedElemental_Pos = 0;
+ ShockBlastTimer = 1+rand()%60000;
+ EntangleTimer = 30000;
+ StaticChargeTimer = 10000+rand()%15000;
+ ForkedLightningTimer = 2000;
+ CheckTimer = 15000;
+ EnchantedElementalTimer = 5000;
+ TaintedElementalTimer = 50000;
+ CoilfangEliteTimer = 45000+rand()%5000;
+ CoilfangStriderTimer = 60000+rand()%10000;
+ SummonSporebatTimer = 10000;
+ SummonSporebatStaticTimer = 30000;
+ EnchantedElementalPos = 0;
Phase = 0;
Entangle = false;
@@ -201,16 +199,13 @@ class boss_lady_vashj : public CreatureScript
JustCreated = false;
} else CanAttack = true;
- Unit* remo;
+
for (uint8 i = 0; i < 4; ++i)
- {
- remo = Unit::GetUnit(*me, ShieldGeneratorChannel[i]);
- if (remo)
+ if (Unit* remo = Unit::GetUnit(*me, ShieldGeneratorChannel[i]))
remo->setDeathState(JUST_DIED);
- }
- if (instance)
- instance->SetData(DATA_LADYVASHJEVENT, NOT_STARTED);
+ if (Instance)
+ Instance->SetData(DATA_LADYVASHJEVENT, NOT_STARTED);
ShieldGeneratorChannel[0] = 0;
ShieldGeneratorChannel[1] = 0;
ShieldGeneratorChannel[2] = 0;
@@ -219,12 +214,12 @@ class boss_lady_vashj : public CreatureScript
me->SetCorpseDelay(1000*60*60);
}
- //Called when a tainted elemental dies
+ // Called when a tainted elemental dies
void EventTaintedElementalDeath()
{
- //the next will spawn 50 seconds after the previous one's death
- if (TaintedElemental_Timer > 50000)
- TaintedElemental_Timer = 50000;
+ // the next will spawn 50 seconds after the previous one's death
+ if (TaintedElementalTimer > 50000)
+ TaintedElementalTimer = 50000;
}
void KilledUnit(Unit* /*victim*/)
{
@@ -235,8 +230,8 @@ class boss_lady_vashj : public CreatureScript
{
DoScriptText(SAY_DEATH, me);
- if (instance)
- instance->SetData(DATA_LADYVASHJEVENT, DONE);
+ if (Instance)
+ Instance->SetData(DATA_LADYVASHJEVENT, DONE);
}
void StartEvent()
@@ -245,26 +240,22 @@ class boss_lady_vashj : public CreatureScript
Phase = 1;
- if (instance)
- instance->SetData(DATA_LADYVASHJEVENT, IN_PROGRESS);
+ if (Instance)
+ Instance->SetData(DATA_LADYVASHJEVENT, IN_PROGRESS);
}
void EnterCombat(Unit* who)
{
- if (instance)
+ if (Instance)
{
- //remove old tainted cores to prevent cheating in phase 2
+ // remove old tainted cores to prevent cheating in phase 2
Map* map = me->GetMap();
Map::PlayerList const &PlayerList = map->GetPlayers();
- for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
- {
- if (Player* i_pl = i->getSource())
- {
- i_pl->DestroyItemCount(31088, 1, true);
- }
- }
+ for (Map::PlayerList::const_iterator itr = PlayerList.begin(); itr != PlayerList.end(); ++itr)
+ if (Player* player = itr->getSource())
+ player->DestroyItemCount(31088, 1, true);
}
- StartEvent();//this is EnterCombat(), so were are 100% in combat, start the event
+ StartEvent(); // this is EnterCombat(), so were are 100% in combat, start the event
if (Phase != 2)
AttackStart(who);
@@ -287,10 +278,7 @@ class boss_lady_vashj : public CreatureScript
float attackRadius = me->GetAttackDistance(who);
if (me->IsWithinDistInMap(who, attackRadius) && me->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && me->IsWithinLOSInMap(who))
{
- //if (who->HasStealthAura())
- // who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
-
- if (!me->isInCombat())//AttackStart() sets UNIT_FLAG_IN_COMBAT, so this msut be before attacking
+ if (!me->isInCombat()) // AttackStart() sets UNIT_FLAG_IN_COMBAT, so this msut be before attacking
StartEvent();
if (Phase != 2)
@@ -304,13 +292,13 @@ class boss_lady_vashj : public CreatureScript
switch (urand(0, 1))
{
case 0:
- //Shoot
- //Used in Phases 1 and 3 after Entangle or while having nobody in melee range. A shot that hits her target for 4097-5543 Physical damage.
+ // Shoot
+ // Used in Phases 1 and 3 after Entangle or while having nobody in melee range. A shot that hits her target for 4097-5543 Physical damage.
DoCast(me->getVictim(), SPELL_SHOOT);
break;
case 1:
- //Multishot
- //Used in Phases 1 and 3 after Entangle or while having nobody in melee range. A shot that hits 1 person and 4 people around him for 6475-7525 physical damage.
+ // Multishot
+ // Used in Phases 1 and 3 after Entangle or while having nobody in melee range. A shot that hits 1 person and 4 people around him for 6475-7525 physical damage.
DoCast(me->getVictim(), SPELL_MULTI_SHOT);
break;
}
@@ -329,231 +317,209 @@ class boss_lady_vashj : public CreatureScript
CanAttack = true;
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
AggroTimer=19000;
- }else
+ }
+ else
{
AggroTimer-=diff;
return;
}
}
- //to prevent abuses during phase 2
+ // to prevent abuses during phase 2
if (Phase == 2 && !me->getVictim() && me->isInCombat())
{
EnterEvadeMode();
return;
}
- //Return since we have no target
+ // Return since we have no target
if (!UpdateVictim())
return;
if (Phase == 1 || Phase == 3)
{
- //ShockBlast_Timer
- if (ShockBlast_Timer <= diff)
+ // ShockBlastTimer
+ if (ShockBlastTimer <= diff)
{
- //Shock Burst
- //Randomly used in Phases 1 and 3 on Vashj's target, it's a Shock spell doing 8325-9675 nature damage and stunning the target for 5 seconds, during which she will not attack her target but switch to the next person on the aggro list.
+ // Shock Burst
+ // Randomly used in Phases 1 and 3 on Vashj's target, it's a Shock spell doing 8325-9675 nature damage and stunning the target for 5 seconds, during which she will not attack her target but switch to the next person on the aggro list.
DoCast(me->getVictim(), SPELL_SHOCK_BLAST);
me->TauntApply(me->getVictim());
- ShockBlast_Timer = 1000+rand()%14000; //random cooldown
- } else ShockBlast_Timer -= diff;
+ ShockBlastTimer = 1000+rand()%14000; // random cooldown
+ } else ShockBlastTimer -= diff;
- //StaticCharge_Timer
- if (StaticCharge_Timer <= diff)
+ // StaticChargeTimer
+ if (StaticChargeTimer <= diff)
{
- //Static Charge
- //Used on random people (only 1 person at any given time) in Phases 1 and 3, it's a debuff doing 2775 to 3225 Nature damage to the target and everybody in about 5 yards around it, every 1 seconds for 30 seconds. It can be removed by Cloak of Shadows, Iceblock, Divine Shield, etc, but not by Cleanse or Dispel Magic.
- Unit* target = NULL;
- target = SelectTarget(SELECT_TARGET_RANDOM, 0, 200, true);
-
- if (target && !target->HasAura(SPELL_STATIC_CHARGE_TRIGGER))
- //cast Static Charge every 2 seconds for 20 seconds
- DoCast(target, SPELL_STATIC_CHARGE_TRIGGER);
+ // Static Charge
+ // Used on random people (only 1 person at any given time) in Phases 1 and 3, it's a debuff doing 2775 to 3225 Nature damage to the target and everybody in about 5 yards around it, every 1 seconds for 30 seconds. It can be removed by Cloak of Shadows, Iceblock, Divine Shield, etc, but not by Cleanse or Dispel Magic.
+ Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 200, true);
+ if (target && !target->HasAura(SPELL_STATIC_CHARGE_TRIGGER))
+ DoCast(target, SPELL_STATIC_CHARGE_TRIGGER); // cast Static Charge every 2 seconds for 20 seconds
- StaticCharge_Timer = 10000+rand()%20000; //blizzlike
- } else StaticCharge_Timer -= diff;
+ StaticChargeTimer = 10000+rand()%20000;
+ } else StaticChargeTimer -= diff;
- //Entangle_Timer
- if (Entangle_Timer <= diff)
+ // EntangleTimer
+ if (EntangleTimer <= diff)
{
if (!Entangle)
{
- //Entangle
- //Used in Phases 1 and 3, it casts Entangling Roots on everybody in a 15 yard radius of Vashj, immobilzing them for 10 seconds and dealing 500 damage every 2 seconds. It's not a magic effect so it cannot be dispelled, but is removed by various buffs such as Cloak of Shadows or Blessing of Freedom.
+ // Entangle
+ // Used in Phases 1 and 3, it casts Entangling Roots on everybody in a 15 yard radius of Vashj, immobilzing them for 10 seconds and dealing 500 damage every 2 seconds. It's not a magic effect so it cannot be dispelled, but is removed by various buffs such as Cloak of Shadows or Blessing of Freedom.
DoCast(me->getVictim(), SPELL_ENTANGLE);
Entangle = true;
- Entangle_Timer = 10000;
+ EntangleTimer = 10000;
}
else
{
CastShootOrMultishot();
Entangle = false;
- Entangle_Timer = 20000+rand()%5000;
+ EntangleTimer = 20000+rand()%5000;
}
- } else Entangle_Timer -= diff;
+ } else EntangleTimer -= diff;
- //Phase 1
+ // Phase 1
if (Phase == 1)
{
- //Start phase 2
+ // Start phase 2
if (HealthBelowPct(70))
{
- //Phase 2 begins when Vashj hits 70%. She will run to the middle of her platform and surround herself in a shield making her invulerable.
+ // Phase 2 begins when Vashj hits 70%. She will run to the middle of her platform and surround herself in a shield making her invulerable.
Phase = 2;
me->GetMotionMaster()->Clear();
DoTeleportTo(MIDDLE_X, MIDDLE_Y, MIDDLE_Z);
- Creature* creature;
for (uint8 i = 0; i < 4; ++i)
- {
- creature = me->SummonCreature(SHIED_GENERATOR_CHANNEL, ShieldGeneratorChannelPos[i][0], ShieldGeneratorChannelPos[i][1], ShieldGeneratorChannelPos[i][2], ShieldGeneratorChannelPos[i][3], TEMPSUMMON_CORPSE_DESPAWN, 0);
- if (creature)
+ if (Creature* creature = me->SummonCreature(SHIED_GENERATOR_CHANNEL, ShieldGeneratorChannelPos[i][0], ShieldGeneratorChannelPos[i][1], ShieldGeneratorChannelPos[i][2], ShieldGeneratorChannelPos[i][3], TEMPSUMMON_CORPSE_DESPAWN, 0))
ShieldGeneratorChannel[i] = creature->GetGUID();
- }
+
DoScriptText(SAY_PHASE2, me);
}
}
- //Phase 3
+ // Phase 3
else
{
- //SummonSporebat_Timer
- if (SummonSporebat_Timer <= diff)
+ // SummonSporebatTimer
+ if (SummonSporebatTimer <= diff)
{
- Creature* Sporebat = NULL;
- Sporebat = me->SummonCreature(TOXIC_SPOREBAT, SPOREBAT_X, SPOREBAT_Y, SPOREBAT_Z, SPOREBAT_O, TEMPSUMMON_CORPSE_DESPAWN, 0);
+ if (Creature* sporebat = me->SummonCreature(TOXIC_SPOREBAT, SPOREBAT_X, SPOREBAT_Y, SPOREBAT_Z, SPOREBAT_O, TEMPSUMMON_CORPSE_DESPAWN, 0))
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
+ sporebat->AI()->AttackStart(target);
- if (Sporebat)
- {
- Unit* target = NULL;
- target = SelectTarget(SELECT_TARGET_RANDOM, 0);
- if (target)
- Sporebat->AI()->AttackStart(target);
- }
+ // summon sporebats faster and faster
+ if (SummonSporebatStaticTimer > 1000)
+ SummonSporebatStaticTimer -= 1000;
- //summon sporebats faster and faster
- if (SummonSporebat_StaticTimer > 1000)
- SummonSporebat_StaticTimer -= 1000;
+ SummonSporebatTimer = SummonSporebatStaticTimer;
- SummonSporebat_Timer = SummonSporebat_StaticTimer;
+ if (SummonSporebatTimer < 5000)
+ SummonSporebatTimer = 5000;
- if (SummonSporebat_Timer < 5000)
- SummonSporebat_Timer = 5000;
-
- } else SummonSporebat_Timer -= diff;
+ } else SummonSporebatTimer -= diff;
}
- //Melee attack
+ // Melee attack
DoMeleeAttackIfReady();
- //Check_Timer - used to check if somebody is in melee range
- if (Check_Timer <= diff)
+ // CheckTimer - used to check if somebody is in melee range
+ if (CheckTimer <= diff)
{
- bool InMeleeRange = false;
- Unit* target;
+ bool inMeleeRange = false;
std::list<HostileReference*> t_list = me->getThreatManager().getThreatList();
for (std::list<HostileReference*>::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
{
- target = Unit::GetUnit(*me, (*itr)->getUnitGuid());
- //if in melee range
- if (target && target->IsWithinDistInMap(me, 5))
+ Unit* target = Unit::GetUnit(*me, (*itr)->getUnitGuid());
+ if (target && target->IsWithinDistInMap(me, 5)) // if in melee range
{
- InMeleeRange = true;
+ inMeleeRange = true;
break;
}
}
- //if nobody is in melee range
- if (!InMeleeRange)
+ // if nobody is in melee range
+ if (!inMeleeRange)
CastShootOrMultishot();
- Check_Timer = 5000;
- } else Check_Timer -= diff;
+ CheckTimer = 5000;
+ } else CheckTimer -= diff;
}
- //Phase 2
+ // Phase 2
else
{
- //ForkedLightning_Timer
- if (ForkedLightning_Timer <= diff)
+ // ForkedLightningTimer
+ if (ForkedLightningTimer <= diff)
{
- //Forked Lightning
- //Used constantly in Phase 2, it shoots out completely randomly targeted bolts of lightning which hit everybody in a roughtly 60 degree cone in front of Vashj for 2313-2687 nature damage.
- Unit* target = NULL;
- target = SelectTarget(SELECT_TARGET_RANDOM, 0);
+ // Forked Lightning
+ // Used constantly in Phase 2, it shoots out completely randomly targeted bolts of lightning which hit everybody in a roughtly 60 degree cone in front of Vashj for 2313-2687 nature damage.
+ Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (!target)
target = me->getVictim();
DoCast(target, SPELL_FORKED_LIGHTNING);
- ForkedLightning_Timer = 2000+rand()%6000; //blizzlike
- } else ForkedLightning_Timer -= diff;
+ ForkedLightningTimer = 2000+rand()%6000;
+ } else ForkedLightningTimer -= diff;
- //EnchantedElemental_Timer
- if (EnchantedElemental_Timer <= diff)
+ // EnchantedElementalTimer
+ if (EnchantedElementalTimer <= diff)
{
- me->SummonCreature(ENCHANTED_ELEMENTAL, ElementPos[EnchantedElemental_Pos][0], ElementPos[EnchantedElemental_Pos][1], ElementPos[EnchantedElemental_Pos][2], ElementPos[EnchantedElemental_Pos][3], TEMPSUMMON_CORPSE_DESPAWN, 0);
+ me->SummonCreature(ENCHANTED_ELEMENTAL, ElementPos[EnchantedElementalPos][0], ElementPos[EnchantedElementalPos][1], ElementPos[EnchantedElementalPos][2], ElementPos[EnchantedElementalPos][3], TEMPSUMMON_CORPSE_DESPAWN, 0);
- if (EnchantedElemental_Pos == 7)
- EnchantedElemental_Pos = 0;
+ if (EnchantedElementalPos == 7)
+ EnchantedElementalPos = 0;
else
- ++EnchantedElemental_Pos;
+ ++EnchantedElementalPos;
- EnchantedElemental_Timer = 10000+rand()%5000;
- } else EnchantedElemental_Timer -= diff;
+ EnchantedElementalTimer = 10000+rand()%5000;
+ } else EnchantedElementalTimer -= diff;
- //TaintedElemental_Timer
- if (TaintedElemental_Timer <= diff)
+ // TaintedElementalTimer
+ if (TaintedElementalTimer <= diff)
{
uint32 pos = rand()%8;
me->SummonCreature(TAINTED_ELEMENTAL, ElementPos[pos][0], ElementPos[pos][1], ElementPos[pos][2], ElementPos[pos][3], TEMPSUMMON_DEAD_DESPAWN, 0);
- TaintedElemental_Timer = 120000;
- } else TaintedElemental_Timer -= diff;
+ TaintedElementalTimer = 120000;
+ } else TaintedElementalTimer -= diff;
- //CoilfangElite_Timer
- if (CoilfangElite_Timer <= diff)
+ // CoilfangEliteTimer
+ if (CoilfangEliteTimer <= diff)
{
uint32 pos = rand()%3;
- Creature* CoilfangElite = NULL;
- CoilfangElite = me->SummonCreature(COILFANG_ELITE, CoilfangElitePos[pos][0], CoilfangElitePos[pos][1], CoilfangElitePos[pos][2], CoilfangElitePos[pos][3], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
- if (CoilfangElite)
+ Creature* coilfangElite = me->SummonCreature(COILFANG_ELITE, CoilfangElitePos[pos][0], CoilfangElitePos[pos][1], CoilfangElitePos[pos][2], CoilfangElitePos[pos][3], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
+ if (coilfangElite)
{
- Unit* target = NULL;
- target = SelectTarget(SELECT_TARGET_RANDOM, 0);
- if (target)
- CoilfangElite->AI()->AttackStart(target);
+ if (Unit* target = target = SelectTarget(SELECT_TARGET_RANDOM, 0))
+ coilfangElite->AI()->AttackStart(target);
else if (me->getVictim())
- CoilfangElite->AI()->AttackStart(me->getVictim());
+ coilfangElite->AI()->AttackStart(me->getVictim());
}
- CoilfangElite_Timer = 45000+rand()%5000;
- } else CoilfangElite_Timer -= diff;
+ CoilfangEliteTimer = 45000+rand()%5000;
+ } else CoilfangEliteTimer -= diff;
- //CoilfangStrider_Timer
- if (CoilfangStrider_Timer <= diff)
+ // CoilfangStriderTimer
+ if (CoilfangStriderTimer <= diff)
{
uint32 pos = rand()%3;
- Creature* CoilfangStrider = NULL;
- CoilfangStrider = me->SummonCreature(COILFANG_STRIDER, CoilfangStriderPos[pos][0], CoilfangStriderPos[pos][1], CoilfangStriderPos[pos][2], CoilfangStriderPos[pos][3], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
- if (CoilfangStrider)
+ if (Creature* CoilfangStrider = me->SummonCreature(COILFANG_STRIDER, CoilfangStriderPos[pos][0], CoilfangStriderPos[pos][1], CoilfangStriderPos[pos][2], CoilfangStriderPos[pos][3], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000))
{
- Unit* target = NULL;
- target = SelectTarget(SELECT_TARGET_RANDOM, 0);
- if (target)
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
CoilfangStrider->AI()->AttackStart(target);
else if (me->getVictim())
CoilfangStrider->AI()->AttackStart(me->getVictim());
}
- CoilfangStrider_Timer = 60000+rand()%10000;
- } else CoilfangStrider_Timer -= diff;
+ CoilfangStriderTimer = 60000+rand()%10000;
+ } else CoilfangStriderTimer -= diff;
- //Check_Timer
- if (Check_Timer <= diff)
+ // CheckTimer
+ if (CheckTimer <= diff)
{
- //Start Phase 3
- if (instance && instance->GetData(DATA_CANSTARTPHASE3))
+ // Start Phase 3
+ if (Instance && Instance->GetData(DATA_CANSTARTPHASE3))
{
- //set life 50%
+ // set life 50%
me->SetHealth(me->CountPctFromMaxHealth(50));
me->RemoveAurasDueToSpell(SPELL_MAGIC_BARRIER);
@@ -562,19 +528,19 @@ class boss_lady_vashj : public CreatureScript
Phase = 3;
- //return to the tank
+ // return to the tank
me->GetMotionMaster()->MoveChase(me->getVictim());
}
- Check_Timer = 1000;
- } else Check_Timer -= diff;
+ CheckTimer = 1000;
+ } else CheckTimer -= diff;
}
}
};
};
-//Enchanted Elemental
-//If one of them reaches Vashj he will increase her damage done by 5%.
+// Enchanted Elemental
+// If one of them reaches Vashj he will increase her damage done by 5%.
class mob_enchanted_elemental : public CreatureScript
{
public:
@@ -589,42 +555,42 @@ class mob_enchanted_elemental : public CreatureScript
{
mob_enchanted_elementalAI(Creature* c) : ScriptedAI(c)
{
- instance = c->GetInstanceScript();
+ Instance = c->GetInstanceScript();
}
- InstanceScript* instance;
- uint32 move;
- uint32 phase;
- float x, y, z;
+ InstanceScript* Instance;
+ uint32 Move;
+ uint32 Phase;
+ float X, Y, Z;
uint64 VashjGUID;
void Reset()
{
- me->SetSpeed(MOVE_WALK, 0.6f);//walk
- me->SetSpeed(MOVE_RUN, 0.6f);//run
- move = 0;
- phase = 1;
+ me->SetSpeed(MOVE_WALK, 0.6f); // walk
+ me->SetSpeed(MOVE_RUN, 0.6f); // run
+ Move = 0;
+ Phase = 1;
VashjGUID = 0;
- x = ElementWPPos[0][0];
- y = ElementWPPos[0][1];
- z = ElementWPPos[0][2];
+ X = ElementWPPos[0][0];
+ Y = ElementWPPos[0][1];
+ Z = ElementWPPos[0][2];
//search for nearest waypoint (up on stairs)
for (uint32 i = 1; i < 8; ++i)
{
- if (me->GetDistance(ElementWPPos[i][0], ElementWPPos[i][1], ElementWPPos[i][2]) < me->GetDistance(x, y, z))
+ if (me->GetDistance(ElementWPPos[i][0], ElementWPPos[i][1], ElementWPPos[i][2]) < me->GetDistance(X, Y, Z))
{
- x = ElementWPPos[i][0];
- y = ElementWPPos[i][1];
- z = ElementWPPos[i][2];
+ X = ElementWPPos[i][0];
+ Y = ElementWPPos[i][1];
+ Z = ElementWPPos[i][2];
}
}
- if (instance)
- VashjGUID = instance->GetData64(DATA_LADYVASHJ);
+ if (Instance)
+ VashjGUID = Instance->GetData64(DATA_LADYVASHJ);
}
void EnterCombat(Unit* /*who*/) {}
@@ -633,47 +599,42 @@ class mob_enchanted_elemental : public CreatureScript
void UpdateAI(const uint32 diff)
{
- if (!instance)
+ if (!Instance)
return;
if (!VashjGUID)
return;
- if (move <= diff)
+ if (Move <= diff)
{
me->SetWalk(true);
- if (phase == 1)
- me->GetMotionMaster()->MovePoint(0, x, y, z);
- if (phase == 1 && me->IsWithinDist3d(x, y, z, 0.1f))
- phase = 2;
- if (phase == 2)
+ if (Phase == 1)
+ me->GetMotionMaster()->MovePoint(0, X, Y, Z);
+ if (Phase == 1 && me->IsWithinDist3d(X, Y, Z, 0.1f))
+ Phase = 2;
+ if (Phase == 2)
{
me->GetMotionMaster()->MovePoint(0, MIDDLE_X, MIDDLE_Y, MIDDLE_Z);
- phase = 3;
+ Phase = 3;
}
- if (phase == 3)
+ if (Phase == 3)
{
me->GetMotionMaster()->MovePoint(0, MIDDLE_X, MIDDLE_Y, MIDDLE_Z);
if (me->IsWithinDist3d(MIDDLE_X, MIDDLE_Y, MIDDLE_Z, 3))
DoCast(me, SPELL_SURGE);
}
- if (Creature* Vashj = Unit::GetCreature(*me, VashjGUID))
- {
- if (!Vashj->isInCombat() || CAST_AI(boss_lady_vashj::boss_lady_vashjAI, Vashj->AI())->Phase != 2 || Vashj->isDead())
- {
- //call Unsummon()
+ if (Creature* vashj = Unit::GetCreature(*me, VashjGUID))
+ if (!vashj->isInCombat() || CAST_AI(boss_lady_vashj::boss_lady_vashjAI, vashj->AI())->Phase != 2 || vashj->isDead())
me->Kill(me);
- }
- }
- move = 1000;
- } else move -= diff;
+ Move = 1000;
+ } else Move -= diff;
}
};
};
-//Tainted Elemental
-//This mob has 7, 900 life, doesn't move, and shoots Poison Bolts at one person anywhere in the area, doing 3, 000 nature damage and placing a posion doing 2, 000 damage every 2 seconds. He will switch targets often, or sometimes just hang on a single player, but there is nothing you can do about it except heal the damage and kill the Tainted Elemental
+// Tainted Elemental
+// This mob has 7, 900 life, doesn't move, and shoots Poison Bolts at one person anywhere in the area, doing 3, 000 nature damage and placing a posion doing 2, 000 damage every 2 seconds. He will switch targets often, or sometimes just hang on a single player, but there is nothing you can do about it except heal the damage and kill the Tainted Elemental
class mob_tainted_elemental : public CreatureScript
{
public:
@@ -688,30 +649,25 @@ class mob_tainted_elemental : public CreatureScript
{
mob_tainted_elementalAI(Creature* c) : ScriptedAI(c)
{
- instance = c->GetInstanceScript();
+ Instance = c->GetInstanceScript();
}
- InstanceScript* instance;
+ InstanceScript* Instance;
- uint32 PoisonBolt_Timer;
- uint32 Despawn_Timer;
+ uint32 PoisonBoltTimer;
+ uint32 DespawnTimer;
void Reset()
{
- PoisonBolt_Timer = 5000+rand()%5000;
- Despawn_Timer = 30000;
+ PoisonBoltTimer = 5000+rand()%5000;
+ DespawnTimer = 30000;
}
void JustDied(Unit* /*killer*/)
{
- if (instance)
- {
- Creature* Vashj = NULL;
- Vashj = (Unit::GetCreature((*me), instance->GetData64(DATA_LADYVASHJ)));
-
- if (Vashj)
- CAST_AI(boss_lady_vashj::boss_lady_vashjAI, Vashj->AI())->EventTaintedElementalDeath();
- }
+ if (Instance)
+ if (Creature* vashj = Unit::GetCreature((*me), Instance->GetData64(DATA_LADYVASHJ)))
+ CAST_AI(boss_lady_vashj::boss_lady_vashjAI, vashj->AI())->EventTaintedElementalDeath();
}
void EnterCombat(Unit* who)
@@ -721,27 +677,26 @@ class mob_tainted_elemental : public CreatureScript
void UpdateAI(const uint32 diff)
{
- //PoisonBolt_Timer
- if (PoisonBolt_Timer <= diff)
+ // PoisonBoltTimer
+ if (PoisonBoltTimer <= diff)
{
- Unit* target = NULL;
- target = SelectTarget(SELECT_TARGET_RANDOM, 0);
+ Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (target && target->IsWithinDistInMap(me, 30))
DoCast(target, SPELL_POISON_BOLT);
- PoisonBolt_Timer = 5000+rand()%5000;
- } else PoisonBolt_Timer -= diff;
+ PoisonBoltTimer = 5000+rand()%5000;
+ } else PoisonBoltTimer -= diff;
- //Despawn_Timer
- if (Despawn_Timer <= diff)
+ // DespawnTimer
+ if (DespawnTimer <= diff)
{
- //call Unsummon()
+ // call Unsummon()
me->setDeathState(DEAD);
- //to prevent crashes
- Despawn_Timer = 1000;
- } else Despawn_Timer -= diff;
+ // to prevent crashes
+ DespawnTimer = 1000;
+ } else DespawnTimer -= diff;
}
};
@@ -763,35 +718,29 @@ class mob_toxic_sporebat : public CreatureScript
{
mob_toxic_sporebatAI(Creature* c) : ScriptedAI(c)
{
- instance = c->GetInstanceScript();
+ Instance = c->GetInstanceScript();
EnterEvadeMode();
}
- InstanceScript* instance;
+ InstanceScript* Instance;
- uint32 movement_timer;
- uint32 ToxicSpore_Timer;
- uint32 bolt_timer;
- uint32 Check_Timer;
+ uint32 MovementTimer;
+ uint32 ToxicSporeTimer;
+ uint32 BoltTimer;
+ uint32 CheckTimer;
void Reset()
{
me->SetLevitate(true);
me->setFaction(14);
- movement_timer = 0;
- ToxicSpore_Timer = 5000;
- bolt_timer = 5500;
- Check_Timer = 1000;
- }
-
- void EnterCombat(Unit* /*who*/)
- {
-
+ MovementTimer = 0;
+ ToxicSporeTimer = 5000;
+ BoltTimer = 5500;
+ CheckTimer = 1000;
}
void MoveInLineOfSight(Unit* /*who*/)
{
-
}
void MovementInform(uint32 type, uint32 id)
@@ -800,113 +749,57 @@ class mob_toxic_sporebat : public CreatureScript
return;
if (id == 1)
- movement_timer = 0;
+ MovementTimer = 0;
}
void UpdateAI (const uint32 diff)
{
- //Random movement
- if (movement_timer <= diff)
+ // Random movement
+ if (MovementTimer <= diff)
{
uint32 rndpos = rand()%8;
me->GetMotionMaster()->MovePoint(1, SporebatWPPos[rndpos][0], SporebatWPPos[rndpos][1], SporebatWPPos[rndpos][2]);
- movement_timer = 6000;
- } else movement_timer -= diff;
+ MovementTimer = 6000;
+ } else MovementTimer -= diff;
- //toxic spores
- if (bolt_timer <= diff)
+ // toxic spores
+ if (BoltTimer <= diff)
{
- Unit* target = NULL;
- target = SelectTarget(SELECT_TARGET_RANDOM, 0);
- if (target)
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
{
- Creature* trig = me->SummonCreature(TOXIC_SPORES_TRIGGER, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 30000);
- if (trig)
+ if (Creature* trig = me->SummonCreature(TOXIC_SPORES_TRIGGER, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 30000))
{
trig->setFaction(14);
trig->CastSpell(trig, SPELL_TOXIC_SPORES, true);
}
}
- bolt_timer = 10000+rand()%5000;
+ BoltTimer = 10000+rand()%5000;
}
- else bolt_timer -= diff;
+ else BoltTimer -= diff;
- //Check_Timer
- if (Check_Timer <= diff)
+ // CheckTimer
+ if (CheckTimer <= diff)
{
- if (instance)
+ if (Instance)
{
- //check if vashj is death
- Unit* Vashj = NULL;
- Vashj = Unit::GetUnit((*me), instance->GetData64(DATA_LADYVASHJ));
+ // check if vashj is death
+ Unit* Vashj = Unit::GetUnit((*me), Instance->GetData64(DATA_LADYVASHJ));
if (!Vashj || (Vashj && !Vashj->isAlive()) || (Vashj && CAST_AI(boss_lady_vashj::boss_lady_vashjAI, CAST_CRE(Vashj)->AI())->Phase != 3))
{
- //remove
+ // remove
me->setDeathState(DEAD);
me->RemoveCorpse();
me->setFaction(35);
}
}
- Check_Timer = 1000;
- } else Check_Timer -= diff;
+ CheckTimer = 1000;
+ } else CheckTimer -= diff;
}
};
};
-//Coilfang Elite
-//It's an elite Naga mob with 170, 000 HP. It does about 5000 damage on plate, and has a nasty cleave hitting for about 7500 damage
-class mob_coilfang_elite : public CreatureScript
-{
-public:
- mob_coilfang_elite() : CreatureScript("mob_coilfang_elite") { }
-
- CreatureAI* GetAI(Creature* creature) const
- {
- SimpleAI* ai = new SimpleAI (creature);
-
- ai->Spell[0].Enabled = true;
- ai->Spell[0].Spell_Id = 31345; //Cleave
- ai->Spell[0].Cooldown = 15000;
- ai->Spell[0].CooldownRandomAddition = 5000;
- ai->Spell[0].First_Cast = 5000;
- ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_RANDOM;
-
- ai->EnterEvadeMode();
-
- return ai;
- }
-
-};
-
-//Coilfang Strider
-//It hits plate for about 8000 damage, has a Mind Blast spell doing about 3000 shadow damage, and a Psychic Scream Aura, which fears everybody in a 8 yard range of it every 2-3 seconds, for 5 seconds and increasing their movement speed by 150% during the fear.
-class mob_coilfang_strider : public CreatureScript
-{
-public:
- mob_coilfang_strider() : CreatureScript("mob_coilfang_strider") { }
-
- CreatureAI* GetAI(Creature* creature) const
- {
- SimpleAI* ai = new SimpleAI (creature);
-
- ai->Spell[0].Enabled = true;
- ai->Spell[0].Spell_Id = 41374; //Mind Blast
- ai->Spell[0].Cooldown = 30000;
- ai->Spell[0].CooldownRandomAddition = 10000;
- ai->Spell[0].First_Cast = 8000;
- ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_TARGET;
-
- //Scream aura not implemented
-
- ai->EnterEvadeMode();
-
- return ai;
- }
-
-};
-
class mob_shield_generator_channel : public CreatureScript
{
public:
@@ -921,46 +814,44 @@ class mob_shield_generator_channel : public CreatureScript
{
mob_shield_generator_channelAI(Creature* c) : ScriptedAI(c)
{
- instance = c->GetInstanceScript();
+ Instance = c->GetInstanceScript();
}
- InstanceScript* instance;
- uint32 Check_Timer;
+ InstanceScript* Instance;
+ uint32 CheckTimer;
bool Casted;
+
void Reset()
{
- Check_Timer = 0;
+ CheckTimer = 0;
Casted = false;
- me->SetDisplayId(11686); //invisible
+ me->SetDisplayId(11686); // invisible
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
- void EnterCombat(Unit* /*who*/) {}
-
void MoveInLineOfSight(Unit* /*who*/) {}
void UpdateAI (const uint32 diff)
{
- if (!instance)
+ if (!Instance)
return;
- if (Check_Timer <= diff)
+ if (CheckTimer <= diff)
{
- Unit* Vashj = NULL;
- Vashj = Unit::GetUnit((*me), instance->GetData64(DATA_LADYVASHJ));
+ Unit* vashj = Unit::GetUnit((*me), Instance->GetData64(DATA_LADYVASHJ));
- if (Vashj && Vashj->isAlive())
+ if (vashj && vashj->isAlive())
{
- //start visual channel
- if (!Casted || !Vashj->HasAura(SPELL_MAGIC_BARRIER))
+ // start visual channel
+ if (!Casted || !vashj->HasAura(SPELL_MAGIC_BARRIER))
{
- DoCast(Vashj, SPELL_MAGIC_BARRIER, true);
+ DoCast(vashj, SPELL_MAGIC_BARRIER, true);
Casted = true;
}
}
- Check_Timer = 1000;
- } else Check_Timer -= diff;
+ CheckTimer = 1000;
+ } else CheckTimer -= diff;
}
};
@@ -971,7 +862,7 @@ class item_tainted_core : public ItemScript
public:
item_tainted_core() : ItemScript("item_tainted_core") { }
- bool OnUse(Player* player, Item* /*_Item*/, SpellCastTargets const& targets)
+ bool OnUse(Player* player, Item* /*item*/, SpellCastTargets const& targets)
{
InstanceScript* instance = player->GetInstanceScript();
@@ -981,31 +872,30 @@ class item_tainted_core : public ItemScript
return true;
}
- Creature* Vashj = NULL;
- Vashj = (Unit::GetCreature((*player), instance->GetData64(DATA_LADYVASHJ)));
- if (Vashj && (CAST_AI(boss_lady_vashj::boss_lady_vashjAI, Vashj->AI())->Phase == 2))
+ Creature* vashj = Unit::GetCreature((*player), instance->GetData64(DATA_LADYVASHJ));
+ if (vashj && (CAST_AI(boss_lady_vashj::boss_lady_vashjAI, vashj->AI())->Phase == 2))
{
if (GameObject* gObj = targets.GetGOTarget())
{
uint32 identifier;
- uint8 channel_identifier;
+ uint8 channelIdentifier;
switch (gObj->GetEntry())
{
case 185052:
identifier = DATA_SHIELDGENERATOR1;
- channel_identifier = 0;
+ channelIdentifier = 0;
break;
case 185053:
identifier = DATA_SHIELDGENERATOR2;
- channel_identifier = 1;
+ channelIdentifier = 1;
break;
case 185051:
identifier = DATA_SHIELDGENERATOR3;
- channel_identifier = 2;
+ channelIdentifier = 2;
break;
case 185054:
identifier = DATA_SHIELDGENERATOR4;
- channel_identifier = 3;
+ channelIdentifier = 3;
break;
default:
return true;
@@ -1017,18 +907,17 @@ class item_tainted_core : public ItemScript
return true;
}
- //get and remove channel
- Unit* Channel = NULL;
- Channel = Unit::GetCreature(*Vashj, CAST_AI(boss_lady_vashj::boss_lady_vashjAI, Vashj->AI())->ShieldGeneratorChannel[channel_identifier]);
- if (Channel)
+ // get and remove channel
+
+ if (Unit* channel = Unit::GetCreature(*vashj, CAST_AI(boss_lady_vashj::boss_lady_vashjAI, vashj->AI())->ShieldGeneratorChannel[channelIdentifier]))
{
- //call Unsummon()
- Channel->setDeathState(JUST_DIED);
+ // call Unsummon()
+ channel->setDeathState(JUST_DIED);
}
instance->SetData(identifier, 1);
- //remove this item
+ // remove this item
player->DestroyItemCount(31088, 1, true);
return true;
}
@@ -1052,8 +941,6 @@ void AddSC_boss_lady_vashj()
new mob_enchanted_elemental();
new mob_tainted_elemental();
new mob_toxic_sporebat();
- new mob_coilfang_elite();
- new mob_coilfang_strider();
new mob_shield_generator_channel();
new item_tainted_core();
}
View
148 src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp
@@ -25,7 +25,6 @@ EndScriptData */
#include "ScriptPCH.h"
#include "serpent_shrine.h"
-#include "ScriptedSimpleAI.h"
#include "Spell.h"
#define SPELL_SPOUT 37433
@@ -55,15 +54,16 @@ EndScriptData */
float AddPos[9][3] =
{
- {2.8553810f, -459.823914f, -19.182686f}, //MOVE_AMBUSHER_1 X, Y, Z
- {12.400000f, -466.042267f, -19.182686f}, //MOVE_AMBUSHER_2 X, Y, Z
- {51.366653f, -460.836060f, -19.182686f}, //MOVE_AMBUSHER_3 X, Y, Z
- {62.597980f, -457.433044f, -19.182686f}, //MOVE_AMBUSHER_4 X, Y, Z
- {77.607452f, -384.302765f, -19.182686f}, //MOVE_AMBUSHER_5 X, Y, Z
- {63.897900f, -378.984924f, -19.182686f}, //MOVE_AMBUSHER_6 X, Y, Z
- {34.447250f, -387.333618f, -19.182686f}, //MOVE_GUARDIAN_1 X, Y, Z
- {14.388216f, -423.468018f, -19.625271f}, //MOVE_GUARDIAN_2 X, Y, Z
- {42.471519f, -445.115295f, -19.769423f} //MOVE_GUARDIAN_3 X, Y, Z
+ // MOVE_AMBUSHER_1 X, Y, Z
+ {2.8553810f, -459.823914f, -19.182686f},
+ {12.400000f, -466.042267f, -19.182686f},
+ {51.366653f, -460.836060f, -19.182686f},
+ {62.597980f, -457.433044f, -19.182686f},
+ {77.607452f, -384.302765f, -19.182686f},
+ {63.897900f, -378.984924f, -19.182686f},
+ {34.447250f, -387.333618f, -19.182686f},
+ {14.388216f, -423.468018f, -19.625271f},
+ {42.471519f, -445.115295f, -19.769423f}
};
class boss_the_lurker_below : public CreatureScript
@@ -80,10 +80,10 @@ class boss_the_lurker_below : public CreatureScript
{
boss_the_lurker_belowAI(Creature* c) : Scripted_NoMovementAI(c), Summons(me)
{
- instance = c->GetInstanceScript();
+ Instance = c->GetInstanceScript();
}
- InstanceScript* instance;
+ InstanceScript* Instance;
SummonList Summons;
bool Spawned;
@@ -103,7 +103,7 @@ class boss_the_lurker_below : public CreatureScript
bool CheckCanStart()//check if players fished
{
- if (instance && instance->GetData(DATA_STRANGE_POOL) == NOT_STARTED)
+ if (Instance && Instance->GetData(DATA_STRANGE_POOL) == NOT_STARTED)
return false;
return true;
}
@@ -112,39 +112,39 @@ class boss_the_lurker_below : public CreatureScript
me->AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_LEVITATING);
SpoutAnimTimer = 1000;
RotTimer = 0;
- WaterboltTimer = 15000;//give time to get in range when fight starts
+ WaterboltTimer = 15000; // give time to get in range when fight starts
SpoutTimer = 45000;
- WhirlTimer = 18000;//after avery spout
+ WhirlTimer = 18000; // after avery spout
PhaseTimer = 120000;
GeyserTimer = rand()%5000 + 15000;
- CheckTimer = 15000;//give time to get in range when fight starts
- WaitTimer = 60000;//never reached
- WaitTimer2 = 60000;//never reached
+ CheckTimer = 15000; // give time to get in range when fight starts
+ WaitTimer = 60000; // never reached
+ WaitTimer2 = 60000; // never reached
- Submerged = true;//will be false at combat start
+ Submerged = true; // will be false at combat start
Spawned = false;
InRange = false;
CanStartEvent = false;
Summons.DespawnAll();
- if (instance)
+ if (Instance)
{
- instance->SetData(DATA_THELURKERBELOWEVENT, NOT_STARTED);
- instance->SetData(DATA_STRANGE_POOL, NOT_STARTED);
+ Instance->SetData(DATA_THELURKERBELOWEVENT, NOT_STARTED);
+ Instance->SetData(DATA_STRANGE_POOL, NOT_STARTED);
}
- DoCast(me, SPELL_SUBMERGE);//submerge anim
- me->SetVisible(false);//we start invis under water, submerged
+ DoCast(me, SPELL_SUBMERGE); // submerge anim
+ me->SetVisible(false); // we start invis under water, submerged
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
}
- void JustDied(Unit* /*Killer*/)
+ void JustDied(Unit* /*killer*/)
{
- if (instance)
+ if (Instance)
{
- instance->SetData(DATA_THELURKERBELOWEVENT, DONE);
- instance->SetData(DATA_STRANGE_POOL, IN_PROGRESS);
+ Instance->SetData(DATA_THELURKERBELOWEVENT, DONE);
+ Instance->SetData(DATA_STRANGE_POOL, IN_PROGRESS);
}
Summons.DespawnAll();
@@ -152,22 +152,20 @@ class boss_the_lurker_below : public CreatureScript
void EnterCombat(Unit* who)
{
- if (instance)
- instance->SetData(DATA_THELURKERBELOWEVENT, IN_PROGRESS);
+ if (Instance)
+ Instance->SetData(DATA_THELURKERBELOWEVENT, IN_PROGRESS);
Scripted_NoMovementAI::EnterCombat(who);
}
void MoveInLineOfSight(Unit* who)
{
- if (!CanStartEvent)//boss is invisible, don't attack
+ if (!CanStartEvent) // boss is invisible, don't attack
return;
if (!me->getVictim() && who->IsValidAttackTarget(me))
{
float attackRadius = me->GetAttackDistance(who);
if (me->IsWithinDistInMap(who, attackRadius))
- {
AttackStart(who);
- }
}
}
@@ -179,7 +177,7 @@ class boss_the_lurker_below : public CreatureScript
void UpdateAI(const uint32 diff)
{
- if (!CanStartEvent)//boss is invisible, don't attack
+ if (!CanStartEvent) // boss is invisible, don't attack
{
if (CheckCanStart())
{
@@ -190,21 +188,21 @@ class boss_the_lurker_below : public CreatureScript
WaitTimer2 = 500;
}
- if (!Submerged && WaitTimer2 <= diff)//wait 500ms before emerge anim
+ if (!Submerged && WaitTimer2 <= diff) // wait 500ms before emerge anim
{
me->RemoveAllAuras();
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0);
DoCast(me, SPELL_EMERGE, false);
- WaitTimer2 = 60000;//never reached
+ WaitTimer2 = 60000; // never reached
WaitTimer = 3000;
}
else
WaitTimer2 -= diff;
- if (WaitTimer <= diff)//wait 3secs for emerge anim, then attack
+ if (WaitTimer <= diff) // wait 3secs for emerge anim, then attack
{
WaitTimer = 3000;
- CanStartEvent = true;//fresh fished from pool
+ CanStartEvent = true; // fresh fished from pool
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
@@ -214,7 +212,7 @@ class boss_the_lurker_below : public CreatureScript
return;
}
- if (me->getThreatManager().getThreatList().empty())//check if should evade
+ if (me->getThreatManager().getThreatList().empty()) // check if should evade
{
if (me->isInCombat())
EnterEvadeMode();
@@ -226,7 +224,7 @@ class boss_the_lurker_below : public CreatureScript
{
me->InterruptNonMeleeSpells(false);
DoCast(me, SPELL_SUBMERGE);
- PhaseTimer = 60000;//60secs submerged
+ PhaseTimer = 60000; // 60secs submerged
Submerged = true;
} else PhaseTimer-=diff;
@@ -236,12 +234,12 @@ class boss_the_lurker_below : public CreatureScript
me->SetReactState(REACT_PASSIVE);
me->GetMotionMaster()->MoveRotate(20000, urand(0, 1) ? ROTATE_DIRECTION_LEFT : ROTATE_DIRECTION_RIGHT);
SpoutTimer = 45000;
- WhirlTimer = 20000;//whirl directly after spout
+ WhirlTimer = 20000; // whirl directly after spout
RotTimer = 20000;
return;
} else SpoutTimer -= diff;
- //Whirl directly after a Spout and at random times
+ // Whirl directly after a Spout and at random times
if (WhirlTimer <= diff)
{
WhirlTimer = 18000;
@@ -273,7 +271,7 @@ class boss_the_lurker_below : public CreatureScript
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
{
if (i->getSource() && i->getSource()->isAlive() && me->HasInArc(float(diff/20000*M_PI*2), i->getSource()) && me->IsWithinDist(i->getSource(), SPOUT_DIST) && !i->getSource()->IsInWater())
- DoCast(i->getSource(), SPELL_SPOUT, true);//only knock back palyers in arc, in 100yards, not in water
+ DoCast(i->getSource(), SPELL_SPOUT, true); // only knock back players in arc, in 100yards, not in water
}
}
@@ -300,7 +298,7 @@ class boss_the_lurker_below : public CreatureScript
GeyserTimer = rand()%5000 + 15000;
} else GeyserTimer -= diff;
- if (!InRange)//if on players in melee range cast Waterbolt
+ if (!InRange) // if on players in melee range cast Waterbolt
{
if (WaterboltTimer <= diff)
{
@@ -318,12 +316,13 @@ class boss_the_lurker_below : public CreatureScript
DoMeleeAttackIfReady();
- }else//submerged
+ }
+ else // submerged
{
if (PhaseTimer <= diff)
{
Submerged = false;
- me->InterruptNonMeleeSpells(false);//shouldn't be any
+ me->InterruptNonMeleeSpells(false); // shouldn't be any
me->RemoveAllAuras();
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
me->RemoveFlag(UNIT_NPC_EMOTESTATE, EMOTE_STATE_SUBMERGED);
@@ -334,28 +333,22 @@ class boss_the_lurker_below : public CreatureScript
return;
} else PhaseTimer-=diff;
- if (me->getThreatManager().getThreatList().empty())//check if should evade
+ if (me->getThreatManager().getThreatList().empty()) // check if should evade
{
EnterEvadeMode();
return;
}
+
if (!me->isInCombat())
DoZoneInCombat();
if (!Spawned)
{
me->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
- //spawn adds
+ // spawn adds
for (uint8 i = 0; i < 9; ++i)
- {
- Creature* Summoned;
- if (i < 6)
- Summoned = me->SummonCreature(MOB_COILFANG_AMBUSHER, AddPos[i][0], AddPos[i][1], AddPos[i][2], 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
- else Summoned = me->SummonCreature(MOB_COILFANG_GUARDIAN, AddPos[i][0], AddPos[i][1], AddPos[i][2], 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
-
- if (Summoned)
- Summons.Summon(Summoned);
- }
+ if (Creature* summoned = me->SummonCreature(i < 6 ? MOB_COILFANG_AMBUSHER : MOB_COILFANG_GUARDIAN, AddPos[i][0], AddPos[i][1], AddPos[i][2], 0, TEMPSUMMON_CORPSE_DESPAWN, 0))
+ Summons.Summon(summoned);
Spawned = true;
}
}
@@ -363,32 +356,6 @@ class boss_the_lurker_below : public CreatureScript
};
};
-class mob_coilfang_guardian : public CreatureScript
-{
-public:
- mob_coilfang_guardian() : CreatureScript("mob_coilfang_guardian") { }
-
- CreatureAI* GetAI(Creature* creature) const
- {
- SimpleAI* ai = new SimpleAI (creature);
-
- ai->Spell[0].Enabled = true;
- ai->Spell[0].Spell_Id = SPELL_ARCINGSMASH;
- ai->Spell[0].Cooldown = 15000;
- ai->Spell[0].First_Cast = 5000;
- ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_TARGET;
-
- ai->Spell[1].Enabled = true;
- ai->Spell[1].Spell_Id = SPELL_HAMSTRING;
- ai->Spell[1].Cooldown = 10000;
- ai->Spell[1].First_Cast = 2000;
- ai->Spell[1].Cast_Target_Type = CAST_HOSTILE_TARGET;
-
- return ai;
- }
-
-};
-
class mob_coilfang_ambusher : public CreatureScript
{
public:
@@ -412,12 +379,6 @@ class mob_coilfang_ambusher : public CreatureScript
{
MultiShotTimer = 10000;
ShootBowTimer = 4000;
-
- }
-
- void EnterCombat(Unit* /*who*/)
- {
-
}
void MoveInLineOfSight(Unit* who)
@@ -438,18 +399,16 @@ class mob_coilfang_ambusher : public CreatureScript
DoCast(me->getVictim(), SPELL_SPREAD_SHOT, true);
MultiShotTimer = 10000+rand()%10000;
- ShootBowTimer += 1500;//add global cooldown
+ ShootBowTimer += 1500; // add global cooldown
} else MultiShotTimer -= diff;
if (ShootBowTimer <= diff)
{
- Unit* target = NULL;
- target = SelectTarget(SELECT_TARGET_RANDOM, 0);
int bp0 = 1100;
- if (target)
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
me->CastCustomSpell(target, SPELL_SHOOT, &bp0, NULL, NULL, true);
ShootBowTimer = 4000+rand()%5000;
- MultiShotTimer += 1500;//add global cooldown
+ MultiShotTimer += 1500; // add global cooldown
} else ShootBowTimer -= diff;
}
};
@@ -482,7 +441,6 @@ class go_strange_pool : public GameObjectScript
void AddSC_boss_the_lurker_below()
{
new boss_the_lurker_below();
- new mob_coilfang_guardian();
new mob_coilfang_ambusher();
new go_strange_pool();
}
Please sign in to comment.
Something went wrong with that request. Please try again.