aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--COPYING40
-rw-r--r--sql/updates/world/2013_01_20_09_world_spell_dbc.sql18
-rw-r--r--sql/updates/world/2013_01_21_00_world_misc.sql2
-rw-r--r--sql/updates/world/2013_01_21_01_world_creature_template.sql1
-rw-r--r--src/server/collision/BoundingIntervalHierarchyWrapper.h18
-rw-r--r--src/server/game/Miscellaneous/Language.h4
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp403
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp1
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp1
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp77
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h22
11 files changed, 439 insertions, 148 deletions
diff --git a/COPYING b/COPYING
index cdfdede6e8c..d159169d105 100644
--- a/COPYING
+++ b/COPYING
@@ -1,12 +1,12 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
- Preamble
+ Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
@@ -15,7 +15,7 @@ software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
+the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
@@ -55,8 +55,8 @@ patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
-
- GNU GENERAL PUBLIC LICENSE
+
+ GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
@@ -110,7 +110,7 @@ above, provided that you also meet all of these conditions:
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
-
+
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
@@ -168,7 +168,7 @@ access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
-
+
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
@@ -225,7 +225,7 @@ impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
-
+
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
@@ -255,7 +255,7 @@ make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
- NO WARRANTY
+ NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
@@ -277,9 +277,9 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
@@ -303,16 +303,16 @@ the "copyright" line and a pointer to where the full notice is found.
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
+ 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.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
- Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
@@ -335,5 +335,5 @@ necessary. Here is a sample; alter the names:
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General
+library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
diff --git a/sql/updates/world/2013_01_20_09_world_spell_dbc.sql b/sql/updates/world/2013_01_20_09_world_spell_dbc.sql
new file mode 100644
index 00000000000..d8f466173f3
--- /dev/null
+++ b/sql/updates/world/2013_01_20_09_world_spell_dbc.sql
@@ -0,0 +1,18 @@
+-- Add missing spells to spell_dbc
+DELETE FROM `spell_dbc` WHERE `Id` IN (24211,24246,24235,7939);
+INSERT INTO `spell_dbc` (`Id`,`SchoolMask`,`Dispel`,`Mechanic`,`Attributes`,`AttributesEx`,`AttributesEx2`,`AttributesEx3`,`AttributesEx4`,`Stances`,`StancesNot`,`Targets`,`CastingTimeIndex`,`AuraInterruptFlags`,`ProcFlags`,`ProcChance`,`ProcCharges`,`MaxLevel`,`BaseLevel`,`SpellLevel`,`DurationIndex`,`RangeIndex`,`StackAmount`,`EquippedItemClass`,`EquippedItemSubClassMask`,`EquippedItemInventoryTypeMask`,`Effect1`,`Effect2`,`Effect3`,`EffectDieSides1`,`EffectDieSides2`,`EffectDieSides3`,`EffectRealPointsPerLevel1`,`EffectRealPointsPerLevel2`,`EffectRealPointsPerLevel3`,`EffectBasePoints1`,`EffectBasePoints2`,`EffectBasePoints3`,`EffectMechanic1`,`EffectMechanic2`,`EffectMechanic3`,`EffectImplicitTargetA1`,`EffectImplicitTargetA2`,`EffectImplicitTargetA3`,`EffectImplicitTargetB1`,`EffectImplicitTargetB2`,`EffectImplicitTargetB3`,`EffectRadiusIndex1`,`EffectRadiusIndex2`,`EffectRadiusIndex3`,`EffectApplyAuraName1`,`EffectApplyAuraName2`,`EffectApplyAuraName3`,`EffectAmplitude1`,`EffectAmplitude2`,`EffectAmplitude3`,`EffectMultipleValue1`,`EffectMultipleValue2`,`EffectMultipleValue3`,`EffectMiscValue1`,`EffectMiscValue2`,`EffectMiscValue3`,`EffectTriggerSpell1`,`EffectTriggerSpell2`,`EffectTriggerSpell3`,`Comment`,`MaxTargetLevel`,`SpellFamilyName`,`SpellFamilyFlags1`,`SpellFamilyFlags2`,`MaxAffectedTargets`,`DmgClass`,`PreventionType`,`DmgMultiplier1`,`DmgMultiplier2`,`DmgMultiplier3`,`EffectMiscValueB1`) VALUES
+(24211,0,0,0,256,0,4,0,0,0,0,0,1,0,0,101,0,0,0,0,0,0,0,-1,0,0,63,0,0,1,0,0,0,0,0,4999,0,0,0,0,0,22,0,0,0,0,0,7,0,0,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'Mark of Arlokk',0,0,0,0,0,0,0,1,0,0,0),
+(24246,0,0,0,256,0,0,0,0,0,0,0,1,0,0,101,0,0,0,0,6,0,0,-1,0,0,28,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,15101,0,0,0,0,0,'Summon Zulian Prowler',0,0,0,0,0,0,0,1,0,0,64),
+(24235,0,0,0,272,268435456,0,0,0,0,0,0,1,0,0,101,0,0,0,0,1,0,0,-1,0,0,6,0,0,0,0,0,0,0,0,9999,0,0,0,0,0,1,0,0,0,0,0,0,0,0,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'Super Invis',0,0,0,0,0,0,0,1,1,1,0),
+(7939,0,5,0,402915728,268435456,0,0,0,0,0,0,1,6147,0,101,0,0,1,1,21,1,0,-1,-1,0,6,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 'Sneak Rank 1',0,0,0,0,0,0,0,-1,1,1,0);
+
+-- Add script name to Zulian Prowler
+UPDATE `creature_template` SET `AIName` = '', `ScriptName`='npc_zulian_prowler' WHERE `entry`=15101;
+
+-- Remove SmartAI
+DELETE FROM `smart_scripts` WHERE `entryorguid`=15101;
+
+-- Add condition for Mark of Arlokk
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=24211;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(13,1,24211,0,0,0,31,3,15101,0,0,0,0, '', 'Mark of Arlokk - Targets Zulian Prowler');
diff --git a/sql/updates/world/2013_01_21_00_world_misc.sql b/sql/updates/world/2013_01_21_00_world_misc.sql
new file mode 100644
index 00000000000..c023003783e
--- /dev/null
+++ b/sql/updates/world/2013_01_21_00_world_misc.sql
@@ -0,0 +1,2 @@
+UPDATE `spell_dbc` SET `EffectImplicitTargetB1`=7,`EffectRadiusIndex1`=18 WHERE `Id`=24211;
+UPDATE `conditions` SET `ConditionTypeOrReference`=31,`ConditionTarget`=0 WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=24211;
diff --git a/sql/updates/world/2013_01_21_01_world_creature_template.sql b/sql/updates/world/2013_01_21_01_world_creature_template.sql
new file mode 100644
index 00000000000..d5bf4525ff6
--- /dev/null
+++ b/sql/updates/world/2013_01_21_01_world_creature_template.sql
@@ -0,0 +1 @@
+UPDATE `creature_template` SET `faction_A`=14,`faction_H`=14 WHERE `entry`=22920;
diff --git a/src/server/collision/BoundingIntervalHierarchyWrapper.h b/src/server/collision/BoundingIntervalHierarchyWrapper.h
index 8a99078caab..315f3004306 100644
--- a/src/server/collision/BoundingIntervalHierarchyWrapper.h
+++ b/src/server/collision/BoundingIntervalHierarchyWrapper.h
@@ -33,11 +33,14 @@ class BIHWrap
{
const T* const* objects;
RayCallback& _callback;
+ uint32 objects_size;
- MDLCallback(RayCallback& callback, const T* const* objects_array ) : objects(objects_array), _callback(callback) {}
+ MDLCallback(RayCallback& callback, const T* const* objects_array, uint32 objects_size ) : objects(objects_array), _callback(callback), objects_size(objects_size) {}
bool operator() (const Ray& ray, uint32 Idx, float& MaxDist, bool /*stopAtFirst*/)
{
+ if (Idx >= objects_size)
+ return false;
if (const T* obj = objects[Idx])
return _callback(ray, *obj, MaxDist/*, stopAtFirst*/);
return false;
@@ -45,6 +48,8 @@ class BIHWrap
void operator() (const Vector3& p, uint32 Idx)
{
+ if (Idx >= objects_size)
+ return false;
if (const T* obj = objects[Idx])
_callback(p, *obj);
}
@@ -87,21 +92,24 @@ public:
m_objects.fastClear();
m_obj2Idx.getKeys(m_objects);
m_objects_to_push.getMembers(m_objects);
+ //assert that m_obj2Idx has all the keys
m_tree.build(m_objects, BoundsFunc::getBounds2);
}
template<typename RayCallback>
- void intersectRay(const Ray& ray, RayCallback& intersectCallback, float& maxDist) const
+ void intersectRay(const Ray& ray, RayCallback& intersectCallback, float& maxDist)
{
- MDLCallback<RayCallback> temp_cb(intersectCallback, m_objects.getCArray());
+ balance();
+ MDLCallback<RayCallback> temp_cb(intersectCallback, m_objects.getCArray(), m_objects.size());
m_tree.intersectRay(ray, temp_cb, maxDist, true);
}
template<typename IsectCallback>
- void intersectPoint(const Vector3& point, IsectCallback& intersectCallback) const
+ void intersectPoint(const Vector3& point, IsectCallback& intersectCallback)
{
- MDLCallback<IsectCallback> callback(intersectCallback, m_objects.getCArray());
+ balance();
+ MDLCallback<IsectCallback> callback(intersectCallback, m_objects.getCArray(), m_objects.size());
m_tree.intersectPoint(point, callback);
}
};
diff --git a/src/server/game/Miscellaneous/Language.h b/src/server/game/Miscellaneous/Language.h
index 35b0a6f8569..039e8b816b3 100644
--- a/src/server/game/Miscellaneous/Language.h
+++ b/src/server/game/Miscellaneous/Language.h
@@ -742,7 +742,7 @@ enum TrinityStrings
LANG_COMMAND_CREATURESTORAGE_NOTFOUND = 818,
LANG_CHANNEL_CITY = 819,
-
+
LANG_NPCINFO_GOSSIP = 820,
LANG_NPCINFO_QUESTGIVER = 821,
LANG_NPCINFO_TRAINER_CLASS = 822,
@@ -766,7 +766,7 @@ enum TrinityStrings
LANG_NPCINFO_SPELLCLICK = 840,
LANG_NPCINFO_MAILBOX = 841,
LANG_NPCINFO_PLAYER_VEHICLE = 842,
-
+
// Room for in-game strings 843-999 not used
// Level 4 (CLI only commands)
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp
index 51aab7c20d0..c2806c395f4 100644
--- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp
@@ -1,6 +1,5 @@
/*
* Copyright (C) 2008-2013 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
@@ -17,60 +16,74 @@
*/
/* ScriptData
-SDName: Boss_Arlokk
-SD%Complete: 95
-SDComment: Wrong cleave and red aura is missing.
-SDCategory: Zul'Gurub
+TCName: Boss_Arlokk
+TC%Complete: 95
+TCComment: Wrong cleave and red aura is missing not yet added.
+TCComment: Prowlers moving through wall hopefully mmaps will fix.
+TCComment: Can't test LOS until mmaps.
+TCCategory: Zul'Gurub
EndScriptData */
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
+#include "SpellInfo.h"
#include "zulgurub.h"
enum Says
{
SAY_AGGRO = 0,
- SAY_FEAST_PANTHER = 1,
+ SAY_FEAST_PROWLER = 1,
SAY_DEATH = 2
};
enum Spells
{
- SPELL_SHADOW_WORD_PAIN = 23952,
- SPELL_GOUGE = 24698,
- SPELL_MARK = 24210,
- SPELL_CLEAVE = 26350, // Perhaps not right. Not a red aura...
- SPELL_PANTHER_TRANSFORM = 24190
+ SPELL_SHADOW_WORD_PAIN = 24212, // Corrected
+ SPELL_GOUGE = 12540, // Corrected
+ SPELL_MARK_OF_ARLOKK = 24210, // triggered spell 24211 Added to spell_dbc
+ SPELL_RAVAGE = 24213, // Corrected
+ SPELL_CLEAVE = 25174, // Searching for right spell
+ SPELL_PANTHER_TRANSFORM = 24190, // Transform to panther now used
+ SPELL_SUMMON_PROWLER = 24246, // Added to Spell_dbc
+ SPELL_VANISH_VISUAL = 24222, // Added
+ SPELL_VANISH = 24223, // Added
+ SPELL_SUPER_INVIS = 24235 // Added to Spell_dbc
};
enum Events
{
- EVENT_SHADOW_WORD_PAIN = 0,
- EVENT_GOUGE = 1,
- EVENT_MARK = 2,
- EVENT_CLEAVE = 3,
- EVENT_VANISH = 4,
- EVENT_VISIBLE = 5,
- EVENT_SUMMON = 6
+ EVENT_SHADOW_WORD_PAIN = 1,
+ EVENT_GOUGE = 2,
+ EVENT_MARK_OF_ARLOKK = 3,
+ EVENT_RAVAGE = 4,
+ EVENT_TRANSFORM = 5,
+ EVENT_VANISH = 6,
+ EVENT_VANISH_2 = 7,
+ EVENT_TRANSFORM_BACK = 8,
+ EVENT_VISIBLE = 9,
+ EVENT_SUMMON_PROWLERS = 10
};
enum Phases
{
- PHASE_ONE = 1,
- PHASE_TWO = 2
+ PHASE_ALL = 0,
+ PHASE_ONE = 1,
+ PHASE_TWO = 2
};
-enum ModelIds
+enum Weapon
{
- MODEL_ID_NORMAL = 15218,
- MODEL_ID_PANTHER = 15215,
- MODEL_ID_BLANK = 11686
+ WEAPON_DAGGER = 10616
};
-Position const PosSummonProwlers[2] =
+enum Misc
{
- { -11532.7998f, -1649.6734f, 41.4800f, 0.0f },
- { -11532.9970f, -1606.4840f, 41.2979f, 0.0f }
+ MAX_PROWLERS_PER_SIDE = 15
+};
+
+Position const PosMoveOnSpawn[1] =
+{
+ { -11561.9f, -1627.868f, 41.29941f, 0.0f }
};
class boss_arlokk : public CreatureScript
@@ -83,52 +96,88 @@ class boss_arlokk : public CreatureScript
void Reset()
{
- summonCount = 0;
- markedTargetGUID = 0;
- me->SetDisplayId(MODEL_ID_NORMAL);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ _summonCountA = 0;
+ _summonCountB = 0;
+ me->RemoveAllAuras();
+ me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(WEAPON_DAGGER));
+ me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, uint32(WEAPON_DAGGER));
+ if (instance)
+ {
+ if (GameObject* gate = me->GetMap()->GetGameObject(instance->GetData64(GO_FORCEFIELD)))
+ gate->SetGoState(GO_STATE_READY);
+ me->SetWalk(false);
+ me->GetMotionMaster()->MovePoint(0, PosMoveOnSpawn[0]);
+ }
}
void JustDied(Unit* /*killer*/)
{
- _JustDied();
Talk(SAY_DEATH);
- me->SetDisplayId(MODEL_ID_NORMAL);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ me->RemoveAllAuras();
+ if (instance)
+ {
+ if (GameObject* gate = me->GetMap()->GetGameObject(instance->GetData64(GO_FORCEFIELD)))
+ gate->SetGoState(GO_STATE_ACTIVE);
+ instance->SetBossState(DATA_ARLOKK, DONE);
+ }
}
void EnterCombat(Unit* /*who*/)
{
_EnterCombat();
- events.ScheduleEvent(EVENT_SHADOW_WORD_PAIN, 8000, 0, PHASE_ONE);
- events.ScheduleEvent(EVENT_MARK, 35000, 0, PHASE_ONE);
- events.ScheduleEvent(EVENT_SUMMON, 5000);
- events.ScheduleEvent(EVENT_VANISH, 60000);
+ events.ScheduleEvent(EVENT_SHADOW_WORD_PAIN, urand(7000, 9000), 0, PHASE_ONE);
+ events.ScheduleEvent(EVENT_GOUGE, urand(12000, 15000), 0, PHASE_ONE);
+ if (instance)
+ events.ScheduleEvent(EVENT_SUMMON_PROWLERS, 6000, 0, PHASE_ALL);
+ events.ScheduleEvent(EVENT_MARK_OF_ARLOKK, urand(9000, 11000), 0, PHASE_ALL);
+ events.ScheduleEvent(EVENT_TRANSFORM, urand(15000, 20000), 0, PHASE_ONE);
Talk(SAY_AGGRO);
- }
- void JustReachedHome()
- {
- instance->SetBossState(DATA_ARLOKK, NOT_STARTED);
- me->DespawnOrUnsummon();
+ // Sets up list of Panther spawners to cast on
+ std::list<Creature*> triggerList;
+ GetCreatureListWithEntryInGrid(triggerList, me, NPC_PANTHER_TRIGGER, 100.0f);
+ if (!triggerList.empty())
+ {
+ uint8 sideA = 0;
+ uint8 sideB = 0;
+ for (std::list<Creature*>::const_iterator itr = triggerList.begin(); itr != triggerList.end(); ++itr)
+ {
+ if (Creature* trigger = *itr)
+ {
+ if (trigger->GetPositionY() < -1625.0f)
+ {
+ _triggersSideAGUID[sideA] = trigger->GetGUID();
+ ++sideA;
+ }
+ else
+ {
+ _triggersSideBGUID[sideB] = trigger->GetGUID();
+ ++sideB;
+ }
+ }
+ }
+ }
}
- void DoSummonPhanters()
+ void EnterEvadeMode()
{
- if (summonCount > 30)
- return;
-
- if (markedTargetGUID)
- Talk(SAY_FEAST_PANTHER, markedTargetGUID);
- me->SummonCreature(NPC_ZULIAN_PROWLER, PosSummonProwlers[0], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
- me->SummonCreature(NPC_ZULIAN_PROWLER, PosSummonProwlers[1], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
+ if (instance)
+ {
+ if (GameObject* object = me->GetMap()->GetGameObject(instance->GetData64(GO_FORCEFIELD)))
+ object->SetGoState(GO_STATE_ACTIVE);
+ if (GameObject* object = me->GetMap()->GetGameObject(instance->GetData64(GO_GONG_OF_BETHEKK)))
+ object->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
+ instance->SetBossState(DATA_ARLOKK, NOT_STARTED);
+ }
+ me->DespawnOrUnsummon(4000);
}
- void JustSummoned(Creature* summoned)
+ void SetData(uint32 id, uint32 /*value*/)
{
- if (Unit* markedTarget = Unit::GetUnit(*me, markedTargetGUID))
- summoned->AI()->AttackStart(markedTarget);
- ++summonCount;
+ if (id == 1)
+ --_summonCountA;
+ else if (id == 2)
+ --_summonCountB;
}
void UpdateAI(uint32 const diff)
@@ -147,47 +196,103 @@ class boss_arlokk : public CreatureScript
{
case EVENT_SHADOW_WORD_PAIN:
DoCastVictim(SPELL_SHADOW_WORD_PAIN, true);
- events.ScheduleEvent(EVENT_SHADOW_WORD_PAIN, 15000, 0, PHASE_ONE);
- break;
- case EVENT_MARK:
- if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
- DoCast(target, SPELL_MARK);
- events.ScheduleEvent(EVENT_MARK, 15000, 0, PHASE_ONE);
- break;
- case EVENT_CLEAVE:
- DoCastVictim(SPELL_SHADOW_WORD_PAIN, true);
- events.ScheduleEvent(EVENT_CLEAVE, 16000, 0, PHASE_TWO);
+ events.ScheduleEvent(EVENT_SHADOW_WORD_PAIN, urand(5000, 7000), 0, PHASE_ONE);
break;
case EVENT_GOUGE:
- DoCastVictim(SPELL_SHADOW_WORD_PAIN, true);
- events.ScheduleEvent(EVENT_GOUGE, urand(17000, 27000), 0, PHASE_TWO);
+ DoCastVictim(SPELL_GOUGE, true);
break;
- case EVENT_SUMMON:
- DoSummonPhanters();
- events.ScheduleEvent(EVENT_SUMMON, 5000);
+ case EVENT_SUMMON_PROWLERS:
+ if (_summonCountA < MAX_PROWLERS_PER_SIDE)
+ {
+ if (Unit* trigger = me->GetUnit(*me, _triggersSideAGUID[urand(0, 4)]))
+ {
+ trigger->CastSpell(trigger, SPELL_SUMMON_PROWLER);
+ ++_summonCountA;
+ }
+ }
+ if (_summonCountB < MAX_PROWLERS_PER_SIDE)
+ {
+ if (Unit* trigger = me->GetUnit(*me, _triggersSideBGUID[urand(0, 4)]))
+ {
+ trigger->CastSpell(trigger, SPELL_SUMMON_PROWLER);
+ ++_summonCountB;
+ }
+ }
+ events.ScheduleEvent(EVENT_SUMMON_PROWLERS, 6000, 0, PHASE_ALL);
break;
- case EVENT_VANISH:
- me->SetDisplayId(MODEL_ID_BLANK);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- me->AttackStop();
- DoResetThreat();
- events.ScheduleEvent(EVENT_VISIBLE, 6000);
+ case EVENT_MARK_OF_ARLOKK:
+ {
+ Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, urand(1,3), 0.0f, false, -SPELL_MARK_OF_ARLOKK);
+ if (!target)
+ target = me->getVictim();
+ if (target)
+ {
+ DoCast(target, SPELL_MARK_OF_ARLOKK, true);
+ Talk(SAY_FEAST_PROWLER, target->GetGUID());
+ }
+ events.ScheduleEvent(EVENT_MARK_OF_ARLOKK, urand(120000, 130000));
break;
- case EVENT_VISIBLE:
+ }
+ case EVENT_TRANSFORM:
{
- me->SetDisplayId(MODEL_ID_PANTHER);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ DoCast(me, SPELL_PANTHER_TRANSFORM);
+ me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(EQUIP_UNEQUIP));
+ me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, uint32(EQUIP_UNEQUIP));
const CreatureTemplate* cinfo = me->GetCreatureTemplate();
me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 35)));
me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 35)));
me->UpdateDamagePhysical(BASE_ATTACK);
+ me->AttackStop();
+ DoResetThreat();
+ me->SetReactState(REACT_PASSIVE);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE);
+ DoCast(me, SPELL_VANISH_VISUAL);
+ DoCast(me, SPELL_VANISH);
+ events.ScheduleEvent(EVENT_VANISH, 1000, 0, PHASE_ONE);
+ break;
+ }
+ case EVENT_VANISH:
+ DoCast(me, SPELL_SUPER_INVIS);
+ me->SetWalk(false);
+ if (instance)
+ me->GetMotionMaster()->MovePoint(0, frand(-11551.0f, -11508.0f), frand(-1638.0f, -1617.0f), me->GetPositionZ());
+ events.ScheduleEvent(EVENT_VANISH_2, 9000, 0, PHASE_ONE);
+ break;
+ case EVENT_VANISH_2:
+ DoCast(me, SPELL_VANISH);
+ DoCast(me, SPELL_SUPER_INVIS);
+ events.ScheduleEvent(EVENT_VISIBLE, urand(7000, 10000), 0, PHASE_ONE);
+ break;
+ case EVENT_VISIBLE:
+ me->SetReactState(REACT_AGGRESSIVE);
+ me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
AttackStart(target);
- events.ScheduleEvent(EVENT_VANISH, 39000);
- events.ScheduleEvent(EVENT_CLEAVE, 0, PHASE_TWO);
- events.ScheduleEvent(EVENT_GOUGE, 14000, 0, PHASE_TWO);
+ me->RemoveAura(SPELL_SUPER_INVIS);
+ me->RemoveAura(SPELL_VANISH);
+ events.ScheduleEvent(EVENT_RAVAGE, urand(10000, 14000), 0, PHASE_TWO);
+ events.ScheduleEvent(EVENT_TRANSFORM_BACK, urand(15000, 18000), 0, PHASE_TWO);
events.SetPhase(PHASE_TWO);
break;
+ case EVENT_RAVAGE:
+ DoCastVictim(SPELL_RAVAGE, true);
+ events.ScheduleEvent(EVENT_RAVAGE, urand(10000, 14000), 0, PHASE_TWO);
+ break;
+ case EVENT_TRANSFORM_BACK:
+ {
+ me->RemoveAura(SPELL_PANTHER_TRANSFORM);
+ DoCast(me, SPELL_VANISH_VISUAL);
+ me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(WEAPON_DAGGER));
+ me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, uint32(WEAPON_DAGGER));
+ const CreatureTemplate* cinfo = me->GetCreatureTemplate();
+ me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg));
+ me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg));
+ me->UpdateDamagePhysical(BASE_ATTACK);
+ events.ScheduleEvent(EVENT_SHADOW_WORD_PAIN, urand(4000, 7000), 0, PHASE_ONE);
+ events.ScheduleEvent(EVENT_GOUGE, urand(12000, 15000), 0, PHASE_ONE);
+ events.ScheduleEvent(EVENT_TRANSFORM, urand(16000, 20000), 0, PHASE_ONE);
+ events.SetPhase(PHASE_ONE);
+ break;
}
default:
break;
@@ -198,8 +303,10 @@ class boss_arlokk : public CreatureScript
}
private:
- uint32 summonCount;
- uint64 markedTargetGUID;
+ uint8 _summonCountA;
+ uint8 _summonCountB;
+ uint64 _triggersSideAGUID[5];
+ uint64 _triggersSideBGUID[5];
};
CreatureAI* GetAI(Creature* creature) const
@@ -208,20 +315,134 @@ class boss_arlokk : public CreatureScript
}
};
+/*######
+## npc_zulian_prowler
+######*/
+
+enum ZulianProwlerSpells
+{
+ SPELL_SNEAK_RANK_1_1 = 22766,
+ SPELL_SNEAK_RANK_1_2 = 7939, // Added to Spell_dbc
+ SPELL_MARK_OF_ARLOKK_TRIGGER = 24211 // Added to Spell_dbc
+};
+
+enum ZulianProwlerEvents
+{
+ EVENT_ATTACK = 1
+};
+
+Position const PosProwlerCenter[1] =
+{
+ { -11556.7f, -1631.344f, 41.2994f, 0.0f }
+};
+
+class npc_zulian_prowler : public CreatureScript
+{
+ public: npc_zulian_prowler() : CreatureScript("npc_zulian_prowler") {}
+
+ struct npc_zulian_prowlerAI : public ScriptedAI
+ {
+ npc_zulian_prowlerAI(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()) { }
+
+ void Reset()
+ {
+ if (me->GetPositionY() < -1625.0f)
+ _sideData = 1;
+ else
+ _sideData = 2;
+
+ DoCast(me, SPELL_SNEAK_RANK_1_1);
+ DoCast(me, SPELL_SNEAK_RANK_1_2);
+
+ if (_instance)
+ if (Unit* arlokk = me->GetUnit(*me, _instance->GetData64(NPC_ARLOKK)))
+ me->GetMotionMaster()->MovePoint(0, arlokk->GetPositionX(), arlokk->GetPositionY(), arlokk->GetPositionZ());
+ _events.ScheduleEvent(EVENT_ATTACK, 6000);
+ }
+
+ void EnterCombat(Unit* /*who*/)
+ {
+ me->GetMotionMaster()->Clear(false);
+ me->RemoveAura(SPELL_SNEAK_RANK_1_1);
+ me->RemoveAura(SPELL_SNEAK_RANK_1_2);
+ }
+
+ void SpellHit(Unit* caster, SpellInfo const* spell)
+ {
+ if (spell->Id == SPELL_MARK_OF_ARLOKK_TRIGGER) // Should only hit if line of sight
+ me->Attack(caster, true);
+ }
+
+ void JustDied(Unit* /*killer*/)
+ {
+ if (_instance)
+ {
+ if (Unit* arlokk = me->GetUnit(*me, _instance->GetData64(NPC_ARLOKK)))
+ {
+ if (arlokk->isAlive())
+ arlokk->GetAI()->SetData(_sideData, 0);
+ }
+ }
+ me->DespawnOrUnsummon(4000);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (UpdateVictim())
+ {
+ DoMeleeAttackIfReady();
+ return;
+ }
+
+ _events.Update(diff);
+
+ while (uint32 eventId = _events.ExecuteEvent())
+ {
+ switch (eventId)
+ {
+ case EVENT_ATTACK:
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0.0f, 100, false))
+ me->Attack(target, true);
+ break;
+ default:
+ break;
+ }
+ }
+ }
+
+ private:
+ int32 _sideData;
+ EventMap _events;
+ InstanceScript* _instance;
+ };
+
+ CreatureAI* GetAI(Creature* creature) const
+ {
+ return GetZulGurubAI<npc_zulian_prowlerAI>(creature);
+ }
+};
+
+/*######
+## go_gong_of_bethekk
+######*/
+
+Position const PosSummonArlokk[1] =
+{
+ { -11507.22f, -1628.062f, 41.38264f, 3.159046f }
+};
+
class go_gong_of_bethekk : public GameObjectScript
{
public: go_gong_of_bethekk() : GameObjectScript("go_gong_of_bethekk") {}
bool OnGossipHello(Player* /*player*/, GameObject* go)
{
- if (InstanceScript* instance = go->GetInstanceScript())
+ if (go->GetInstanceScript())
{
- if (instance->GetBossState(DATA_ARLOKK) == DONE || instance->GetBossState(DATA_ARLOKK) == IN_PROGRESS)
- return true;
- instance->SetBossState(DATA_ARLOKK, IN_PROGRESS);
- return true;
+ go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
+ go->SendCustomAnim(0);
+ go->SummonCreature(NPC_ARLOKK, PosSummonArlokk[0], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 600000);
}
-
return true;
}
};
@@ -229,6 +450,6 @@ class go_gong_of_bethekk : public GameObjectScript
void AddSC_boss_arlokk()
{
new boss_arlokk();
+ new npc_zulian_prowler();
new go_gong_of_bethekk();
}
-
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp
index 70399b6934c..f3f12bc35c5 100644
--- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp
@@ -112,4 +112,3 @@ void AddSC_boss_gahzranka()
{
new boss_gahzranka();
}
-
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp
index 15228815d69..809403bb325 100644
--- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp
@@ -121,4 +121,3 @@ void AddSC_boss_hazzarah()
{
new boss_hazzarah();
}
-
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp
index 19a2ba39578..01c5ef998f5 100644
--- a/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp
@@ -40,11 +40,14 @@ class instance_zulgurub : public InstanceMapScript
void Initialize()
{
- ZealotLorkhanGUID = 0;
- ZealotZathGUID = 0;
- HighPriestTekalGUID = 0;
- JindoTheHexxerGUID = 0;
- VilebranchSpeakerGUID = 0;
+ _zealotLorkhanGUID = 0;
+ _zealotZathGUID = 0;
+ _highPriestTekalGUID = 0;
+ _jindoTheHexxerGUID = 0;
+ _vilebranchSpeakerGUID = 0;
+ _arlokkGUID = 0;
+ _goForcefieldGUID = 0;
+ _goGongOfBethekkGUID = 0;
}
bool IsEncounterInProgress() const
@@ -58,23 +61,41 @@ class instance_zulgurub : public InstanceMapScript
switch (creature->GetEntry())
{
case NPC_ZEALOT_LORKHAN:
- ZealotLorkhanGUID = creature->GetGUID();
+ _zealotLorkhanGUID = creature->GetGUID();
break;
case NPC_ZEALOT_ZATH:
- ZealotZathGUID = creature->GetGUID();
+ _zealotZathGUID = creature->GetGUID();
break;
case NPC_HIGH_PRIEST_THEKAL:
- HighPriestTekalGUID = creature->GetGUID();
+ _highPriestTekalGUID = creature->GetGUID();
break;
case NPC_JINDO_THE_HEXXER:
- JindoTheHexxerGUID = creature->GetGUID();
+ _jindoTheHexxerGUID = creature->GetGUID();
break;
case NPC_VILEBRANCH_SPEAKER:
- VilebranchSpeakerGUID = creature->GetGUID();
+ _vilebranchSpeakerGUID = creature->GetGUID();
break;
- case NPC_MANDOKIR:
- if (GetBossState(DATA_MANDOKIR) == DONE)
- creature->DespawnOrUnsummon();
+ case NPC_ARLOKK:
+ _arlokkGUID = creature->GetGUID();
+ break;
+ }
+ }
+
+ void OnGameObjectCreate(GameObject* go)
+ {
+ switch (go->GetEntry())
+ {
+ case GO_FORCEFIELD:
+ _goForcefieldGUID = go->GetGUID();
+ break;
+ case GO_GONG_OF_BETHEKK:
+ _goGongOfBethekkGUID = go->GetGUID();
+ if (GetBossState(DATA_ARLOKK) == DONE)
+ go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
+ else
+ go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
+ break;
+ default:
break;
}
}
@@ -84,16 +105,25 @@ class instance_zulgurub : public InstanceMapScript
switch (uiData)
{
case DATA_LORKHAN:
- return ZealotLorkhanGUID;
+ return _zealotLorkhanGUID;
break;
case DATA_ZATH:
- return ZealotZathGUID;
+ return _zealotZathGUID;
break;
case DATA_THEKAL:
- return HighPriestTekalGUID;
+ return _highPriestTekalGUID;
break;
case DATA_JINDO:
- return JindoTheHexxerGUID;
+ return _jindoTheHexxerGUID;
+ break;
+ case NPC_ARLOKK:
+ return _arlokkGUID;
+ break;
+ case GO_FORCEFIELD:
+ return _goForcefieldGUID;
+ break;
+ case GO_GONG_OF_BETHEKK:
+ return _goGongOfBethekkGUID;
break;
}
return 0;
@@ -145,11 +175,14 @@ class instance_zulgurub : public InstanceMapScript
//If all High Priest bosses were killed. Lorkhan, Zath and Ohgan are added too.
//Storing Lorkhan, Zath and Thekal because we need to cast on them later. Jindo is needed for healfunction too.
- uint64 ZealotLorkhanGUID;
- uint64 ZealotZathGUID;
- uint64 HighPriestTekalGUID;
- uint64 JindoTheHexxerGUID;
- uint64 VilebranchSpeakerGUID;
+ uint64 _zealotLorkhanGUID;
+ uint64 _zealotZathGUID;
+ uint64 _highPriestTekalGUID;
+ uint64 _jindoTheHexxerGUID;
+ uint64 _vilebranchSpeakerGUID;
+ uint64 _arlokkGUID;
+ uint64 _goForcefieldGUID;
+ uint64 _goGongOfBethekkGUID;
};
InstanceScript* GetInstanceScript(InstanceMap* map) const
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h b/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h
index 34680447cd7..77767153a96 100644
--- a/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h
+++ b/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h
@@ -36,23 +36,33 @@ enum DataTypes
DATA_EDGE_OF_MADNESS = 9, // Optional Event Edge of Madness - one of: Gri'lek, Renataki, Hazza'rah, or Wushoolay
DATA_LORKHAN = 10, // Zealot Lor'Khan add to High priest Thekal!
DATA_ZATH = 11, // Zealot Zath add to High priest Thekal!
- DATA_OHGAN = 12 // Bloodlord Mandokir's raptor mount
+ DATA_OHGAN = 12, // Bloodlord Mandokir's raptor mount
+ TYPE_EDGE_OF_MADNESS = 13 // Boss storage
};
enum CreatureIds
{
+ NPC_ARLOKK = 14515, // Arlokk Event
+ NPC_PANTHER_TRIGGER = 15091, // Arlokk Event
+ NPC_ZULIAN_PROWLER = 15101, // Arlokk Event
NPC_ZEALOT_LORKHAN = 11347,
NPC_ZEALOT_ZATH = 11348,
NPC_HIGH_PRIEST_THEKAL = 14509,
NPC_JINDO_THE_HEXXER = 11380,
NPC_NIGHTMARE_ILLUSION = 15163,
- NPC_ZULIAN_PROWLER = 15101,
- NPC_VILEBRANCH_SPEAKER = 11391,
NPC_SHADE_OF_JINDO = 14986,
NPC_SACRIFICED_TROLL = 14826,
- NPC_OHGAN = 14988,
- NPC_CHAINED_SPIRT = 15117,
- NPC_MANDOKIR = 11382
+ NPC_MANDOKIR = 11382, // Mandokir Event
+ NPC_OHGAN = 14988, // Mandokir Event
+ NPC_VILEBRANCH_SPEAKER = 11391, // Mandokir Event
+ NPC_CHAINED_SPIRT = 15117 // Mandokir Event
+
+};
+
+enum GameobjectIds
+{
+ GO_FORCEFIELD = 180497, // Arlokk Event
+ GO_GONG_OF_BETHEKK = 180526 // Arlokk Event
};
template<class AI>