Scripts/ZulGurub: general instance related refactoring/updating

plus couple event-spells-ai related corrections
plus codestyle cleanup
This commit is contained in:
ccrs
2019-06-05 21:43:55 +02:00
parent 91028d98a3
commit 7b2defe5a0
16 changed files with 434 additions and 564 deletions

View File

@@ -449,7 +449,7 @@ void WorldSession::HandleLootMethodOpcode(WorldPacket& recvData)
if (group->isLFGGroup())
return;
if (lootMethod > NEED_BEFORE_GREED)
return;

View File

@@ -15,24 +15,15 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* ScriptData
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 "zulgurub.h"
#include "GameObject.h"
#include "GameObjectAI.h"
#include "InstanceScript.h"
#include "ObjectAccessor.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "ScriptedCreature.h"
#include "ScriptMgr.h"
#include "SpellInfo.h"
#include "zulgurub.h"
enum Says
{
@@ -172,7 +163,7 @@ class boss_arlokk : public CreatureScript
void EnterEvadeMode(EvadeReason why) override
{
BossAI::EnterEvadeMode(why);
if (GameObject* object = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(GO_GONG_OF_BETHEKK)))
if (GameObject* object = instance->GetGameObject(DATA_GONG_BETHEKK))
object->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
me->DespawnOrUnsummon(4000);
}
@@ -370,8 +361,10 @@ class npc_zulian_prowler : public CreatureScript
DoCast(me, SPELL_SNEAK_RANK_1_1);
DoCast(me, SPELL_SNEAK_RANK_1_2);
if (Unit* arlokk = ObjectAccessor::GetUnit(*me, _instance->GetGuidData(NPC_ARLOKK)))
me->GetMotionMaster()->MovePoint(0, arlokk->GetPositionX(), arlokk->GetPositionY(), arlokk->GetPositionZ());
if (Creature* arlokk = _instance->GetCreature(DATA_ARLOKK))
if (arlokk->IsAlive())
me->GetMotionMaster()->MovePoint(0, arlokk->GetPosition());
_events.ScheduleEvent(EVENT_ATTACK, 6s);
}
@@ -390,7 +383,7 @@ class npc_zulian_prowler : public CreatureScript
void JustDied(Unit* /*killer*/) override
{
if (Unit* arlokk = ObjectAccessor::GetUnit(*me, _instance->GetGuidData(NPC_ARLOKK)))
if (Creature* arlokk = _instance->GetCreature(DATA_ARLOKK))
{
if (arlokk->IsAlive())
arlokk->GetAI()->SetData(_sideData, 0);

View File

@@ -16,29 +16,22 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* ScriptData
SDName: Boss_Gahz'ranka
SD%Complete: 85
SDComment: Massive Geyser with knockback not working. Spell buggy.
SDCategory: Zul'Gurub
EndScriptData */
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "zulgurub.h"
#include "ScriptedCreature.h"
#include "ScriptMgr.h"
enum Spells
{
SPELL_FROSTBREATH = 16099,
SPELL_MASSIVEGEYSER = 22421, // Not working. (summon)
SPELL_SLAM = 24326
SPELL_FROSTBREATH = 16099,
SPELL_MASSIVEGEYSER = 22421, // Not working. (summon)
SPELL_SLAM = 24326
};
enum Events
{
EVENT_FROSTBREATH = 1,
EVENT_MASSIVEGEYSER = 2,
EVENT_SLAM = 3
EVENT_FROSTBREATH = 1,
EVENT_MASSIVEGEYSER = 2,
EVENT_SLAM = 3
};
class boss_gahzranka : public CreatureScript // gahzranka

View File

@@ -16,27 +16,20 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* ScriptData
SDName: Boss_Grilek
SD%Complete: 100
SDComment:
SDCategory: Zul'Gurub
EndScriptData */
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "zulgurub.h"
#include "ScriptedCreature.h"
#include "ScriptMgr.h"
enum Spells
{
SPELL_AVATAR = 24646, // Enrage Spell
SPELL_GROUND_TREMOR = 6524
SPELL_AVATAR = 24646, // Enrage Spell
SPELL_GROUND_TREMOR = 6524
};
enum Events
{
EVENT_AVATAR = 1,
EVENT_GROUND_TREMOR = 2
EVENT_AVATAR = 1,
EVENT_GROUND_TREMOR = 2
};
class boss_grilek : public CreatureScript // grilek

View File

@@ -15,17 +15,10 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
Name: Boss_Hakkar
%Complete: 95
Comment: Blood siphon spell buggy cause of Core Issue.
Category: Zul'Gurub
*/
#include "ScriptMgr.h"
#include "zulgurub.h"
#include "InstanceScript.h"
#include "ScriptedCreature.h"
#include "zulgurub.h"
#include "ScriptMgr.h"
enum Says
{
@@ -42,6 +35,7 @@ enum Spells
SPELL_CAUSE_INSANITY = 24327, // Spell needs scripting.
SPELL_WILL_OF_HAKKAR = 24178,
SPELL_ENRAGE = 24318,
// The Aspects of all High Priests spells
SPELL_ASPECT_OF_JEKLIK = 24687,
SPELL_ASPECT_OF_VENOXIS = 24688,
@@ -57,6 +51,7 @@ enum Events
EVENT_CAUSE_INSANITY = 3, // Spell needs scripting. Event disabled
EVENT_WILL_OF_HAKKAR = 4,
EVENT_ENRAGE = 5,
// The Aspects of all High Priests events
EVENT_ASPECT_OF_JEKLIK = 6,
EVENT_ASPECT_OF_VENOXIS = 7,

View File

@@ -16,29 +16,22 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* ScriptData
SDName: Boss_Hazzarah
SD%Complete: 100
SDComment:
SDCategory: Zul'Gurub
EndScriptData */
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "TemporarySummon.h"
#include "zulgurub.h"
#include "ScriptedCreature.h"
#include "ScriptMgr.h"
#include "TemporarySummon.h"
enum Spells
{
SPELL_MANABURN = 26046,
SPELL_SLEEP = 24664
SPELL_MANABURN = 26046,
SPELL_SLEEP = 24664
};
enum Events
{
EVENT_MANABURN = 1,
EVENT_SLEEP = 2,
EVENT_ILLUSIONS = 3
EVENT_MANABURN = 1,
EVENT_SLEEP = 2,
EVENT_ILLUSIONS = 3
};
class boss_hazzarah : public CreatureScript
@@ -95,9 +88,9 @@ class boss_hazzarah : public CreatureScript
// We will just use one model for the beginning
for (uint8 i = 0; i < 3; ++i)
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Creature* Illusion = me->SummonCreature(NPC_NIGHTMARE_ILLUSION, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000))
Illusion->AI()->AttackStart(target);
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.f, true))
if (TempSummon* illusion = me->SummonCreature(NPC_NIGHTMARE_ILLUSION, target->GetPosition(), TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000))
illusion->AI()->AttackStart(target);
}
events.ScheduleEvent(EVENT_ILLUSIONS, 15s, 25s);
break;

View File

@@ -15,42 +15,42 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "TemporarySummon.h"
#include "zulgurub.h"
#include "ScriptedCreature.h"
#include "ScriptMgr.h"
#include "TemporarySummon.h"
enum Says
{
SAY_AGGRO = 0,
SAY_RAIN_FIRE = 1,
SAY_DEATH = 2
SAY_AGGRO = 0,
SAY_RAIN_FIRE = 1,
SAY_DEATH = 2
};
enum Spells
{
SPELL_CHARGE = 22911,
SPELL_SONICBURST = 23918,
SPELL_SCREECH = 6605,
SPELL_SHADOW_WORD_PAIN = 23952,
SPELL_MIND_FLAY = 23953,
SPELL_CHAIN_MIND_FLAY = 26044, // Right ID unknown. So disabled
SPELL_GREATERHEAL = 23954,
SPELL_BAT_FORM = 23966,
SPELL_CHARGE = 22911,
SPELL_SONICBURST = 23918,
SPELL_SCREECH = 6605,
SPELL_SHADOW_WORD_PAIN = 23952,
SPELL_MIND_FLAY = 23953,
SPELL_CHAIN_MIND_FLAY = 26044, // Right ID unknown. So disabled
SPELL_GREATERHEAL = 23954,
SPELL_BAT_FORM = 23966,
// Batriders Spell
SPELL_BOMB = 40332 // Wrong ID but Magmadars bomb is not working...
SPELL_BOMB = 40332 // Wrong ID but Magmadars bomb is not working...
};
enum BatIds
{
NPC_BLOODSEEKER_BAT = 11368,
NPC_FRENZIED_BAT = 14965
NPC_BLOODSEEKER_BAT = 11368,
NPC_FRENZIED_BAT = 14965
};
enum Events
{
EVENT_CHARGE_JEKLIK = 1,
EVENT_CHARGE_JEKLIK = 1,
EVENT_SONIC_BURST,
EVENT_SCREECH,
EVENT_SPAWN_BATS,
@@ -63,8 +63,8 @@ enum Events
enum Phase
{
PHASE_ONE = 1,
PHASE_TWO = 2
PHASE_ONE = 1,
PHASE_TWO = 2
};
Position const SpawnBat[6] =
@@ -124,7 +124,6 @@ class boss_jeklik : public CreatureScript
events.ScheduleEvent(EVENT_CHAIN_MIND_FLAY, 26s, 0, PHASE_TWO);
events.ScheduleEvent(EVENT_GREATER_HEAL, 50s, 0, PHASE_TWO);
events.ScheduleEvent(EVENT_SPAWN_FLYING_BATS, 10s, 0, PHASE_TWO);
return;
}
}
@@ -143,7 +142,7 @@ class boss_jeklik : public CreatureScript
switch (eventId)
{
case EVENT_CHARGE_JEKLIK:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.f, true))
{
DoCast(target, SPELL_CHARGE);
AttackStart(target);
@@ -159,14 +158,14 @@ class boss_jeklik : public CreatureScript
events.ScheduleEvent(EVENT_SCREECH, urand(18000, 26000), 0, PHASE_ONE);
break;
case EVENT_SPAWN_BATS:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.f, true))
for (uint8 i = 0; i < 6; ++i)
if (Creature* bat = me->SummonCreature(NPC_BLOODSEEKER_BAT, SpawnBat[i], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000))
if (TempSummon* bat = me->SummonCreature(NPC_BLOODSEEKER_BAT, SpawnBat[i], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000))
bat->AI()->AttackStart(target);
events.ScheduleEvent(EVENT_SPAWN_BATS, 1min, 0, PHASE_ONE);
break;
case EVENT_SHADOW_WORD_PAIN:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.f, true))
DoCast(target, SPELL_SHADOW_WORD_PAIN);
events.ScheduleEvent(EVENT_SHADOW_WORD_PAIN, urand(12000, 18000), 0, PHASE_TWO);
break;
@@ -185,8 +184,8 @@ class boss_jeklik : public CreatureScript
events.ScheduleEvent(EVENT_GREATER_HEAL, urand(25000, 35000), 0, PHASE_TWO);
break;
case EVENT_SPAWN_FLYING_BATS:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Creature* flyingBat = me->SummonCreature(NPC_FRENZIED_BAT, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ() + 15.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000))
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.f, true))
if (TempSummon* flyingBat = me->SummonCreature(NPC_FRENZIED_BAT, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ() + 15.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000))
flyingBat->AI()->AttackStart(target);
events.ScheduleEvent(EVENT_SPAWN_FLYING_BATS, urand(10000, 15000), 0, PHASE_TWO);
break;
@@ -223,11 +222,9 @@ class npc_batrider : public CreatureScript
void Initialize()
{
Bomb_Timer = 2000;
_bombTimer = 2000;
}
uint32 Bomb_Timer;
void Reset() override
{
Initialize();
@@ -241,19 +238,22 @@ class npc_batrider : public CreatureScript
if (!UpdateVictim())
return;
if (Bomb_Timer <= diff)
if (_bombTimer <= diff)
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.f, true))
{
DoCast(target, SPELL_BOMB);
Bomb_Timer = 5000;
_bombTimer = 5000;
}
}
else
Bomb_Timer -= diff;
_bombTimer -= diff;
DoMeleeAttackIfReady();
}
private:
uint32 _bombTimer;
};
CreatureAI* GetAI(Creature* creature) const override

View File

@@ -16,12 +16,12 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "ScriptMgr.h"
#include "zulgurub.h"
#include "InstanceScript.h"
#include "ObjectAccessor.h"
#include "ScriptedCreature.h"
#include "ScriptMgr.h"
#include "TemporarySummon.h"
#include "zulgurub.h"
enum Say
{
@@ -148,8 +148,8 @@ class boss_jindo : public CreatureScript
// Summon a formation of trolls
for (uint8 i = 0; i < 10; ++i)
if (Creature* SacrificedTroll = me->SummonCreature(NPC_SACRIFICED_TROLL, Formation[i].GetPositionX(), Formation[i].GetPositionY(), Formation[i].GetPositionZ(), Formation[i].GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000))
SacrificedTroll->AI()->AttackStart(target);
if (TempSummon* sacrificedTroll = me->SummonCreature(NPC_SACRIFICED_TROLL, Formation[i], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000))
sacrificedTroll->AI()->AttackStart(target);
}
events.ScheduleEvent(EVENT_TELEPORT, 15s, 23s);
break;
@@ -179,39 +179,40 @@ class npc_healing_ward : public CreatureScript
struct npc_healing_wardAI : public ScriptedAI
{
npc_healing_wardAI(Creature* creature) : ScriptedAI(creature)
npc_healing_wardAI(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript())
{
Initialize();
instance = creature->GetInstanceScript();
creature->SetReactState(REACT_PASSIVE);
}
void Initialize()
{
Heal_Timer = 2000;
_healTimer = 2000;
}
uint32 Heal_Timer;
InstanceScript* instance;
void Reset() override
{
Initialize();
}
void JustEngagedWith(Unit* /*who*/) override { }
void AttackStart(Unit* /*victim*/) override { }
void UpdateAI(uint32 diff) override
{
// Heal_Timer
if (Heal_Timer <= diff)
if (_healTimer <= diff)
{
if (Unit* jindo = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_JINDO)))
if (Creature* jindo = _instance->GetCreature(DATA_JINDO))
DoCast(jindo, SPELL_HEAL);
Heal_Timer = 3000;
} else Heal_Timer -= diff;
DoMeleeAttackIfReady();
_healTimer = 3000;
}
else
_healTimer -= diff;
}
private:
uint32 _healTimer;
InstanceScript* _instance;
};
CreatureAI* GetAI(Creature* creature) const override
@@ -220,7 +221,7 @@ class npc_healing_ward : public CreatureScript
}
};
//Shade of Jindo
// Shade of Jindo
class npc_shade_of_jindo : public CreatureScript
{
public:
@@ -235,30 +236,34 @@ class npc_shade_of_jindo : public CreatureScript
void Initialize()
{
ShadowShock_Timer = 1000;
_shadowShockTimer = 1000;
}
uint32 ShadowShock_Timer;
void Reset() override
{
Initialize();
DoCast(me, SPELL_INVISIBLE, true);
}
void JustEngagedWith(Unit* /*who*/) override { }
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())
return;
// ShadowShock_Timer
if (ShadowShock_Timer <= diff)
if (_shadowShockTimer <= diff)
{
DoCastVictim(SPELL_SHADOWSHOCK);
ShadowShock_Timer = 2000;
} else ShadowShock_Timer -= diff;
_shadowShockTimer = 2000;
}
else
_shadowShockTimer -= diff;
DoMeleeAttackIfReady();
}
private:
uint32 _shadowShockTimer;
};
CreatureAI* GetAI(Creature* creature) const override

View File

@@ -16,22 +16,15 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* ScriptData
SDName: Boss_Mandokir
SD%Complete: 90
SDComment: Ohgan function needs improvements.
SDCategory: Zul'Gurub
EndScriptData */
#include "ScriptMgr.h"
#include "zulgurub.h"
#include "InstanceScript.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "ScriptedCreature.h"
#include "ScriptMgr.h"
#include "SpellAuras.h"
#include "SpellScript.h"
#include "TemporarySummon.h"
#include "zulgurub.h"
enum Says
{
@@ -59,7 +52,7 @@ enum Spells
enum Events
{
EVENT_CHECK_SPEAKER = 1,
EVENT_CHECK_SPEAKER = 1,
EVENT_CHECK_START,
EVENT_STARTED,
EVENT_OVERPOWER,
@@ -121,7 +114,7 @@ class boss_mandokir : public CreatureScript
void Initialize()
{
killCount = 0;
_killCount = 0;
}
void Reset() override
@@ -132,7 +125,7 @@ class boss_mandokir : public CreatureScript
Initialize();
me->SetImmuneToAll(true);
events.ScheduleEvent(EVENT_CHECK_START, 1s);
if (Creature* speaker = ObjectAccessor::GetCreature(*me, instance->GetGuidData(NPC_VILEBRANCH_SPEAKER)))
if (Creature* speaker = instance->GetCreature(DATA_VILEBRANCH_SPEAKER))
if (!speaker->IsAlive())
speaker->Respawn(true);
}
@@ -142,10 +135,7 @@ class boss_mandokir : public CreatureScript
void JustDied(Unit* /*killer*/) override
{
// Do not want to unsummon Ohgan
for (int i = 0; i < CHAINED_SPIRT_COUNT; ++i)
if (Creature* unsummon = ObjectAccessor::GetCreature(*me, chainedSpirtGUIDs[i]))
unsummon->DespawnOrUnsummon();
summons.DespawnEntry(NPC_CHAINED_SPIRT);
instance->SetBossState(DATA_MANDOKIR, DONE);
instance->SaveToDB();
}
@@ -166,14 +156,13 @@ class boss_mandokir : public CreatureScript
me->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation());
Talk(SAY_AGGRO);
me->Dismount();
// Summon Ohgan (Spell missing) TEMP HACK
me->SummonCreature(NPC_OHGAN, me->GetPositionX()-3, me->GetPositionY(), me->GetPositionZ(), me->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 35000);
me->SummonCreature(NPC_OHGAN, me->GetPositionX() - 3, me->GetPositionY(), me->GetPositionZ(), me->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 35000);
// Summon Chained Spirits
for (int i = 0; i < CHAINED_SPIRT_COUNT; ++i)
{
Creature* chainedSpirt = me->SummonCreature(NPC_CHAINED_SPIRT, PosSummonChainedSpirits[i], TEMPSUMMON_CORPSE_DESPAWN);
chainedSpirtGUIDs[i] = chainedSpirt->GetGUID();
}
me->SummonCreature(NPC_CHAINED_SPIRT, PosSummonChainedSpirits[i], TEMPSUMMON_CORPSE_DESPAWN);
DoZoneInCombat();
}
@@ -182,14 +171,14 @@ class boss_mandokir : public CreatureScript
if (victim->GetTypeId() != TYPEID_PLAYER)
return;
if (++killCount == 3)
if (++_killCount == 3)
{
Talk(SAY_DING_KILL);
if (Creature* jindo = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_JINDO)))
if (Creature* jindo = instance->GetCreature(DATA_JINDO))
if (jindo->IsAlive())
jindo->AI()->Talk(SAY_GRATS_JINDO);
DoCast(me, SPELL_LEVEL_UP, true);
killCount = 0;
_killCount = 0;
}
}
@@ -231,7 +220,7 @@ class boss_mandokir : public CreatureScript
case EVENT_CHECK_START:
if (instance->GetBossState(DATA_MANDOKIR) == SPECIAL)
{
me->GetMotionMaster()->MovePoint(0, PosMandokir[1].m_positionX, PosMandokir[1].m_positionY, PosMandokir[1].m_positionZ);
me->GetMotionMaster()->MovePoint(0, PosMandokir[1]);
events.ScheduleEvent(EVENT_STARTED, 6s);
}
else
@@ -293,8 +282,7 @@ class boss_mandokir : public CreatureScript
}
private:
uint8 killCount;
ObjectGuid chainedSpirtGUIDs[CHAINED_SPIRT_COUNT];
uint8 _killCount;
};
CreatureAI* GetAI(Creature* creature) const override
@@ -317,14 +305,14 @@ class npc_ohgan : public CreatureScript
struct npc_ohganAI : public ScriptedAI
{
npc_ohganAI(Creature* creature) : ScriptedAI(creature), instance(creature->GetInstanceScript())
npc_ohganAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
}
void Initialize()
{
SunderArmor_Timer = 5000;
_sunderArmorTimer = 5000;
}
void Reset() override
@@ -332,26 +320,24 @@ class npc_ohgan : public CreatureScript
Initialize();
}
void JustEngagedWith(Unit* /*who*/) override { }
void UpdateAI(uint32 diff) override
{
// Return since we have no target
if (!UpdateVictim())
return;
if (SunderArmor_Timer <= diff)
if (_sunderArmorTimer <= diff)
{
DoCastVictim(SPELL_SUNDERARMOR, true);
SunderArmor_Timer = urand(10000, 15000);
} else SunderArmor_Timer -= diff;
_sunderArmorTimer = urand(10000, 15000);
}
else
_sunderArmorTimer -= diff;
DoMeleeAttackIfReady();
}
private:
uint32 SunderArmor_Timer;
InstanceScript* instance;
uint32 _sunderArmorTimer;
};
CreatureAI* GetAI(Creature* creature) const override
@@ -373,15 +359,15 @@ class npc_vilebranch_speaker : public CreatureScript
struct npc_vilebranch_speakerAI : public ScriptedAI
{
npc_vilebranch_speakerAI(Creature* creature) : ScriptedAI(creature), instance(creature->GetInstanceScript())
npc_vilebranch_speakerAI(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript())
{
Initialize();
}
void Initialize()
{
demoralizing_Shout_Timer = urand(2000, 4000);
cleave_Timer = urand(5000, 8000);
_demoralizingShoutTimer = urand(2000, 4000);
_cleaveTimer = urand(5000, 8000);
}
void Reset() override
@@ -389,11 +375,9 @@ class npc_vilebranch_speaker : public CreatureScript
Initialize();
}
void JustEngagedWith(Unit* /*who*/) override { }
void JustDied(Unit* /*killer*/) override
{
instance->SetBossState(DATA_MANDOKIR, SPECIAL);
_instance->SetBossState(DATA_MANDOKIR, SPECIAL);
}
void UpdateAI(uint32 diff) override
@@ -402,25 +386,29 @@ class npc_vilebranch_speaker : public CreatureScript
if (!UpdateVictim())
return;
if (demoralizing_Shout_Timer <= diff)
if (_demoralizingShoutTimer <= diff)
{
DoCast(me, SPELL_DEMORALIZING_SHOUT);
demoralizing_Shout_Timer = urand(22000, 30000);
} else demoralizing_Shout_Timer -= diff;
_demoralizingShoutTimer = urand(22000, 30000);
}
else
_demoralizingShoutTimer -= diff;
if (cleave_Timer <= diff)
if (_cleaveTimer <= diff)
{
DoCastVictim(SPELL_CLEAVE, true);
cleave_Timer = urand(6000, 9000);
} else cleave_Timer -= diff;
_cleaveTimer = urand(6000, 9000);
}
else
_cleaveTimer -= diff;
DoMeleeAttackIfReady();
}
private:
uint32 demoralizing_Shout_Timer;
uint32 cleave_Timer;
InstanceScript* instance;
uint32 _demoralizingShoutTimer;
uint32 _cleaveTimer;
InstanceScript* _instance;
};
CreatureAI* GetAI(Creature* creature) const override

View File

@@ -16,23 +16,16 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* ScriptData
SDName: Boss_Marli
SD%Complete: 80
SDComment: Charging healers and casters not working. Perhaps wrong Spell Timers.
SDCategory: Zul'Gurub
EndScriptData */
#include "SpellScript.h"
#include "SpellInfo.h"
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "TemporarySummon.h"
#include "zulgurub.h"
#include "InstanceScript.h"
#include "GameObjectAI.h"
#include "GameObject.h"
#include "GameObjectAI.h"
#include "InstanceScript.h"
#include "Object.h"
#include "ScriptedCreature.h"
#include "ScriptMgr.h"
#include "SpellInfo.h"
#include "SpellScript.h"
#include "TemporarySummon.h"
enum Says
{
@@ -101,8 +94,7 @@ class boss_marli : public CreatureScript
std::list<GameObject*> eggs;
me->GetGameObjectListWithEntryInGrid(eggs, GOB_SPIDER_EGG);
for(GameObject* egg : eggs)
for (GameObject* egg : eggs)
{
egg->Respawn();
egg->UpdateObjectVisibility(true);
@@ -127,7 +119,7 @@ class boss_marli : public CreatureScript
void JustSummoned(Creature* creature) override
{
creature->AI()->AttackStart(SelectTarget(SELECT_TARGET_RANDOM));
creature->AI()->AttackStart(SelectTarget(SELECT_TARGET_RANDOM, 0, 0.f, true));
summons.Summon(creature);
}
@@ -146,10 +138,8 @@ class boss_marli : public CreatureScript
switch (eventId)
{
case EVENT_SPAWN_START_SPIDERS:
{
Talk(SAY_SPIDER_SPAWN);
DoCastAOE(SPELL_HATCH_EGGS);
events.ScheduleEvent(EVENT_ASPECT_OF_MARLI, 12s, 0, PHASE_TWO);
events.ScheduleEvent(EVENT_TRANSFORM, 45s, 0, PHASE_TWO);
events.ScheduleEvent(EVENT_POISON_VOLLEY, 15s);
@@ -157,14 +147,13 @@ class boss_marli : public CreatureScript
events.ScheduleEvent(EVENT_TRANSFORM, 45s, 0, PHASE_TWO);
events.SetPhase(PHASE_TWO);
break;
}
case EVENT_POISON_VOLLEY:
DoCastVictim(SPELL_POISON_VOLLEY, true);
events.ScheduleEvent(EVENT_POISON_VOLLEY, 10s, 20s);
break;
case EVENT_ASPECT_OF_MARLI:
DoCastVictim(SPELL_ASPECT_OF_MARLI, true);
events.ScheduleEvent(EVENT_ASPECT_OF_MARLI, urand(13000, 18000), 0, PHASE_TWO);
events.ScheduleEvent(EVENT_ASPECT_OF_MARLI, 13s, 18s, 0, PHASE_TWO);
break;
case EVENT_HATCH_SPIDER_EGG:
me->CastSpell(me, SPELL_HATCH_SPIDER_EGG);
@@ -283,33 +272,32 @@ class npc_spawn_of_marli : public CreatureScript
void Initialize()
{
LevelUp_Timer = 3000;
_levelUpTimer = 3000;
}
uint32 LevelUp_Timer;
void Reset() override
{
Initialize();
}
void JustEngagedWith(Unit* /*who*/) override { }
void UpdateAI(uint32 diff) override
{
//Return since we have no target
if (!UpdateVictim())
return;
//LevelUp_Timer
if (LevelUp_Timer <= diff)
if (_levelUpTimer <= diff)
{
DoCast(me, SPELL_LEVELUP);
LevelUp_Timer = 3000;
} else LevelUp_Timer -= diff;
_levelUpTimer = 3000;
}
else
_levelUpTimer -= diff;
DoMeleeAttackIfReady();
}
private:
uint32 _levelUpTimer;
};
CreatureAI* GetAI(Creature* creature) const override

View File

@@ -16,26 +16,19 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* ScriptData
SDName: Boss_Renataki
SD%Complete: 100
SDComment:
SDCategory: Zul'Gurub
EndScriptData */
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "zulgurub.h"
#include "ScriptedCreature.h"
#include "ScriptMgr.h"
enum Spells
{
SPELL_AMBUSH = 34794,
SPELL_THOUSANDBLADES = 34799
SPELL_AMBUSH = 34794,
SPELL_THOUSANDBLADES = 34799
};
enum Misc
{
EQUIP_ID_MAIN_HAND = 0 //was item display id 31818, but this id does not exist
EQUIP_ID_MAIN_HAND = 0 // was item display id 31818, but this id does not exist
};
class boss_renataki : public CreatureScript
@@ -52,25 +45,15 @@ class boss_renataki : public CreatureScript
void Initialize()
{
Invisible_Timer = urand(8000, 18000);
Ambush_Timer = 3000;
Visible_Timer = 4000;
Aggro_Timer = urand(15000, 25000);
ThousandBlades_Timer = urand(4000, 8000);
Invisible = false;
Ambushed = false;
_invisibleTimer = urand(8000, 18000);
_ambushTimer = 3000;
_visibleTimer = 4000;
_aggroTimer = urand(15000, 25000);
_thousandBladesTimer = urand(4000, 8000);
_invisible = false;
_ambushed = false;
}
uint32 Invisible_Timer;
uint32 Ambush_Timer;
uint32 Visible_Timer;
uint32 Aggro_Timer;
uint32 ThousandBlades_Timer;
bool Invisible;
bool Ambushed;
void Reset() override
{
_Reset();
@@ -92,23 +75,21 @@ class boss_renataki : public CreatureScript
if (!UpdateVictim())
return;
//Invisible_Timer
if (Invisible_Timer <= diff)
if (_invisibleTimer <= diff)
{
me->InterruptSpell(CURRENT_GENERIC_SPELL);
SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE);
me->SetDisplayId(11686);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
Invisible = true;
_invisible = true;
_invisibleTimer = urand(15000, 30000);
}
else
_invisibleTimer -= diff;
Invisible_Timer = urand(15000, 30000);
} else Invisible_Timer -= diff;
if (Invisible)
if (_invisible)
{
if (Ambush_Timer <= diff)
if (_ambushTimer <= diff)
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true))
{
@@ -116,31 +97,32 @@ class boss_renataki : public CreatureScript
DoCast(target, SPELL_AMBUSH);
}
Ambushed = true;
Ambush_Timer = 3000;
} else Ambush_Timer -= diff;
_ambushed = true;
_ambushTimer = 3000;
}
else
_ambushTimer -= diff;
}
if (Ambushed)
if (_ambushed)
{
if (Visible_Timer <= diff)
if (_visibleTimer <= diff)
{
me->InterruptSpell(CURRENT_GENERIC_SPELL);
me->SetDisplayId(15268);
SetEquipmentSlots(false, EQUIP_ID_MAIN_HAND, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
Invisible = false;
Visible_Timer = 4000;
} else Visible_Timer -= diff;
_invisible = false;
_visibleTimer = 4000;
}
else
_visibleTimer -= diff;
}
//Resetting some aggro so he attacks other gamers
if (!Invisible)
// Resetting some aggro so he attacks other gamers
if (!_invisible)
{
if (Aggro_Timer <= diff)
if (_aggroTimer <= diff)
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true))
{
@@ -149,18 +131,31 @@ class boss_renataki : public CreatureScript
AttackStart(target);
}
Aggro_Timer = urand(7000, 20000);
} else Aggro_Timer -= diff;
_aggroTimer = urand(7000, 20000);
}
else
_aggroTimer -= diff;
if (ThousandBlades_Timer <= diff)
if (_thousandBladesTimer <= diff)
{
DoCastVictim(SPELL_THOUSANDBLADES);
ThousandBlades_Timer = urand(7000, 12000);
} else ThousandBlades_Timer -= diff;
_thousandBladesTimer = urand(7000, 12000);
}
else
_thousandBladesTimer -= diff;
}
DoMeleeAttackIfReady();
}
private:
uint32 _invisibleTimer;
uint32 _ambushTimer;
uint32 _visibleTimer;
uint32 _aggroTimer;
uint32 _thousandBladesTimer;
bool _invisible;
bool _ambushed;
};
CreatureAI* GetAI(Creature* creature) const override

View File

@@ -16,18 +16,11 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* ScriptData
SDName: Boss_Thekal
SD%Complete: 95
SDComment: Almost finished.
SDCategory: Zul'Gurub
EndScriptData */
#include "ScriptMgr.h"
#include "zulgurub.h"
#include "InstanceScript.h"
#include "ObjectAccessor.h"
#include "ScriptedCreature.h"
#include "zulgurub.h"
#include "ScriptMgr.h"
enum Says
{
@@ -99,13 +92,10 @@ class boss_thekal : public CreatureScript
void Initialize()
{
Enraged = false;
WasDead = false;
_enraged = false;
_wasDead = false;
}
bool Enraged;
bool WasDead;
void Reset() override
{
if (events.IsInPhase(PHASE_TWO))
@@ -151,15 +141,15 @@ class boss_thekal : public CreatureScript
{
case EVENT_MORTALCLEAVE:
DoCastVictim(SPELL_MORTALCLEAVE, true);
events.ScheduleEvent(EVENT_MORTALCLEAVE, urand(15000, 20000), 0, PHASE_ONE);
events.ScheduleEvent(EVENT_MORTALCLEAVE, 15s, 20s, 0, PHASE_ONE);
break;
case EVENT_SILENCE:
DoCastVictim(SPELL_SILENCE, true);
events.ScheduleEvent(EVENT_SILENCE, urand(20000, 25000), 0, PHASE_ONE);
events.ScheduleEvent(EVENT_SILENCE, 20s, 25s, 0, PHASE_ONE);
break;
case EVENT_RESURRECT_TIMER:
//Thekal will transform to Tiger if he died and was not resurrected after 10 seconds.
if (WasDead)
// Thekal will transform to Tiger if he died and was not resurrected after 10 seconds.
if (_wasDead)
{
DoCast(me, SPELL_TIGER_FORM); // SPELL_AURA_TRANSFORM
me->SetObjectScale(2.00f);
@@ -183,31 +173,31 @@ class boss_thekal : public CreatureScript
events.ScheduleEvent(EVENT_RESURRECT_TIMER, 10s, 0, PHASE_ONE);
break;
case EVENT_CHECK_TIMER:
//Check_Timer for the death of LorKhan and Zath.
if (!WasDead)
// Check_Timer for the death of LorKhan and Zath.
if (!_wasDead)
{
if (instance->GetBossState(DATA_LORKHAN) == SPECIAL)
{
//Resurrect LorKhan
if (Unit* pLorKhan = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_LORKHAN)))
// Resurrect LorKhan
if (Creature* lorKhan = instance->GetCreature(DATA_LORKHAN))
{
pLorKhan->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
pLorKhan->SetFaction(FACTION_MONSTER);
pLorKhan->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
pLorKhan->SetFullHealth();
lorKhan->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
lorKhan->SetFaction(FACTION_MONSTER);
lorKhan->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
lorKhan->SetFullHealth();
instance->SetData(DATA_LORKHAN, DONE);
}
}
if (instance->GetBossState(DATA_ZATH) == SPECIAL)
{
//Resurrect Zath
if (Unit* pZath = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_ZATH)))
// Resurrect Zath
if (Creature* zath = instance->GetCreature(DATA_ZATH))
{
pZath->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
pZath->SetFaction(FACTION_MONSTER);
pZath->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
pZath->SetFullHealth();
zath->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
zath->SetFaction(FACTION_MONSTER);
zath->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
zath->SetFullHealth();
instance->SetBossState(DATA_ZATH, DONE);
}
}
@@ -220,37 +210,37 @@ class boss_thekal : public CreatureScript
break;
case EVENT_FORCEPUNCH:
DoCastVictim(SPELL_FORCEPUNCH, true);
events.ScheduleEvent(EVENT_FORCEPUNCH, urand(16000, 21000), 0, PHASE_TWO);
events.ScheduleEvent(EVENT_FORCEPUNCH, 16s, 21s, 0, PHASE_TWO);
break;
case EVENT_CHARGE:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.f, true))
{
DoCast(target, SPELL_CHARGE);
ResetThreatList();
AttackStart(target);
DoCast(target, SPELL_CHARGE);
}
events.ScheduleEvent(EVENT_CHARGE, urand(15000, 22000), 0, PHASE_TWO);
events.ScheduleEvent(EVENT_CHARGE, 15s, 22s, 0, PHASE_TWO);
break;
case EVENT_ENRAGE:
if (HealthBelowPct(11) && !Enraged)
if (HealthBelowPct(11) && !_enraged)
{
DoCast(me, SPELL_ENRAGE);
Enraged = true;
_enraged = true;
}
events.ScheduleEvent(EVENT_ENRAGE, 30s);
break;
case EVENT_SUMMONTIGERS:
DoCastVictim(SPELL_SUMMONTIGERS, true);
events.ScheduleEvent(EVENT_SUMMONTIGERS, urand(10000, 14000), 0, PHASE_TWO);
events.ScheduleEvent(EVENT_SUMMONTIGERS, 10s, 14s, 0, PHASE_TWO);
break;
default:
break;
}
if (me->IsFullHealth() && WasDead)
WasDead = false;
if (me->IsFullHealth() && _wasDead)
_wasDead = false;
if ((events.IsInPhase(PHASE_ONE)) && !WasDead && !HealthAbovePct(5))
if ((events.IsInPhase(PHASE_ONE)) && !_wasDead && !HealthAbovePct(5))
{
me->RemoveAurasByType(SPELL_AURA_PERIODIC_DAMAGE_PERCENT);
me->RemoveAurasByType(SPELL_AURA_PERIODIC_DAMAGE);
@@ -259,14 +249,19 @@ class boss_thekal : public CreatureScript
me->SetStandState(UNIT_STAND_STATE_SLEEP);
me->AttackStop();
instance->SetBossState(DATA_THEKAL, SPECIAL);
WasDead = true;
_wasDead = true;
}
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
}
DoMeleeAttackIfReady();
}
private:
bool _enraged;
bool _wasDead;
};
CreatureAI* GetAI(Creature* creature) const override
@@ -275,133 +270,121 @@ class boss_thekal : public CreatureScript
}
};
//Zealot Lor'Khan
// Zealot Lor'Khan
class npc_zealot_lorkhan : public CreatureScript
{
public: npc_zealot_lorkhan() : CreatureScript("npc_zealot_lorkhan") { }
struct npc_zealot_lorkhanAI : public ScriptedAI
{
npc_zealot_lorkhanAI(Creature* creature) : ScriptedAI(creature)
npc_zealot_lorkhanAI(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript())
{
Initialize();
instance = creature->GetInstanceScript();
}
void Initialize()
{
Shield_Timer = 1000;
BloodLust_Timer = 16000;
GreaterHeal_Timer = 32000;
Disarm_Timer = 6000;
Check_Timer = 10000;
FakeDeath = false;
_shieldTimer = 1000;
_bloodLustTimer = 16000;
_greaterHealTimer = 32000;
_disarmTimer = 6000;
_checkTimer = 10000;
_fakeDeath = false;
}
uint32 Shield_Timer;
uint32 BloodLust_Timer;
uint32 GreaterHeal_Timer;
uint32 Disarm_Timer;
uint32 Check_Timer;
bool FakeDeath;
InstanceScript* instance;
void Reset() override
{
Initialize();
instance->SetBossState(DATA_LORKHAN, NOT_STARTED);
_instance->SetBossState(DATA_LORKHAN, NOT_STARTED);
me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
void JustEngagedWith(Unit* /*who*/) override
{
}
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())
return;
//Shield_Timer
if (Shield_Timer <= diff)
if (_shieldTimer <= diff)
{
DoCast(me, SPELL_SHIELD);
Shield_Timer = 61000;
} else Shield_Timer -= diff;
_shieldTimer = 61000;
}
else
_shieldTimer -= diff;
//BloodLust_Timer
if (BloodLust_Timer <= diff)
if (_bloodLustTimer <= diff)
{
DoCast(me, SPELL_BLOODLUST);
BloodLust_Timer = 20000 + rand32() % 8000;
} else BloodLust_Timer -= diff;
_bloodLustTimer = 20000 + rand32() % 8000;
}
else
_bloodLustTimer -= diff;
//Casting Greaterheal to Thekal or Zath if they are in meele range.
if (GreaterHeal_Timer <= diff)
// Casting Greaterheal to Thekal or Zath if they are in meele range.
if (_greaterHealTimer <= diff)
{
Unit* pThekal = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_THEKAL));
Unit* pZath = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_ZATH));
if (!pThekal || !pZath)
Creature* thekal = _instance->GetCreature(DATA_THEKAL);
Creature* zath = _instance->GetCreature(DATA_ZATH);
if (!thekal && !zath)
return;
switch (urand(0, 1))
{
case 0:
if (me->IsWithinMeleeRange(pThekal))
DoCast(pThekal, SPELL_GREATERHEAL);
break;
case 1:
if (me->IsWithinMeleeRange(pZath))
DoCast(pZath, SPELL_GREATERHEAL);
break;
}
bool roll = roll_chance_i(50);
Creature* target = roll ? (thekal ? thekal : zath) : (zath ? zath : thekal);
if (!target)
return;
GreaterHeal_Timer = 15000 + rand32() % 5000;
} else GreaterHeal_Timer -= diff;
if (!me->IsWithinMeleeRange(target))
target = roll ? zath : thekal;
//Disarm_Timer
if (Disarm_Timer <= diff)
if (me->IsWithinMeleeRange(target))
DoCast(target, SPELL_GREATERHEAL);
_greaterHealTimer = 15000 + rand32() % 5000;
}
else
_greaterHealTimer -= diff;
if (_disarmTimer <= diff)
{
DoCastVictim(SPELL_DISARM);
Disarm_Timer = 15000 + rand32() % 10000;
} else Disarm_Timer -= diff;
_disarmTimer = 15000 + rand32() % 10000;
}
else
_disarmTimer -= diff;
//Check_Timer for the death of LorKhan and Zath.
if (!FakeDeath && Check_Timer <= diff)
// Check for the death of LorKhan and Zath.
if (!_fakeDeath && _checkTimer <= diff)
{
if (instance->GetBossState(DATA_THEKAL) == SPECIAL)
if (_instance->GetBossState(DATA_THEKAL) == SPECIAL)
{
//Resurrect Thekal
if (Unit* pThekal = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_THEKAL)))
// Resurrect Thekal
if (Creature* thekal = _instance->GetCreature(DATA_THEKAL))
{
pThekal->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
pThekal->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
pThekal->SetFaction(FACTION_MONSTER);
pThekal->SetFullHealth();
thekal->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
thekal->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
thekal->SetFaction(FACTION_MONSTER);
thekal->SetFullHealth();
}
}
if (instance->GetBossState(DATA_ZATH) == SPECIAL)
if (_instance->GetBossState(DATA_ZATH) == SPECIAL)
{
//Resurrect Zath
if (Unit* pZath = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_ZATH)))
// Resurrect Zath
if (Creature* zath = _instance->GetCreature(DATA_ZATH))
{
pZath->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
pZath->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
pZath->SetFaction(FACTION_MONSTER);
pZath->SetFullHealth();
zath->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
zath->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
zath->SetFaction(FACTION_MONSTER);
zath->SetFullHealth();
}
}
Check_Timer = 5000;
} else Check_Timer -= diff;
_checkTimer = 5000;
}
else
_checkTimer -= diff;
if (!HealthAbovePct(5))
{
@@ -413,13 +396,22 @@ class npc_zealot_lorkhan : public CreatureScript
me->SetFaction(FACTION_FRIENDLY);
me->AttackStop();
instance->SetBossState(DATA_LORKHAN, SPECIAL);
_instance->SetBossState(DATA_LORKHAN, SPECIAL);
FakeDeath = true;
_fakeDeath = true;
}
DoMeleeAttackIfReady();
}
private:
uint32 _shieldTimer;
uint32 _bloodLustTimer;
uint32 _greaterHealTimer;
uint32 _disarmTimer;
uint32 _checkTimer;
bool _fakeDeath;
InstanceScript* _instance;
};
CreatureAI* GetAI(Creature* creature) const override
@@ -428,7 +420,7 @@ class npc_zealot_lorkhan : public CreatureScript
}
};
//Zealot Zath
// Zealot Zath
class npc_zealot_zath : public CreatureScript
{
public:
@@ -436,122 +428,112 @@ class npc_zealot_zath : public CreatureScript
struct npc_zealot_zathAI : public ScriptedAI
{
npc_zealot_zathAI(Creature* creature) : ScriptedAI(creature)
npc_zealot_zathAI(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript())
{
Initialize();
instance = creature->GetInstanceScript();
}
void Initialize()
{
SweepingStrikes_Timer = 13000;
SinisterStrike_Timer = 8000;
Gouge_Timer = 25000;
Kick_Timer = 18000;
Blind_Timer = 5000;
Check_Timer = 10000;
FakeDeath = false;
_sweepingStrikesTimer = 13000;
_sinisterStrikeTimer = 8000;
_gougeTimer = 25000;
_kickTimer = 18000;
_blindTimer = 5000;
_checkTimer = 10000;
_fakeDeath = false;
}
uint32 SweepingStrikes_Timer;
uint32 SinisterStrike_Timer;
uint32 Gouge_Timer;
uint32 Kick_Timer;
uint32 Blind_Timer;
uint32 Check_Timer;
bool FakeDeath;
InstanceScript* instance;
void Reset() override
{
Initialize();
instance->SetBossState(DATA_ZATH, NOT_STARTED);
_instance->SetBossState(DATA_ZATH, NOT_STARTED);
me->SetStandState(UNIT_STAND_STATE_STAND);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
void JustEngagedWith(Unit* /*who*/) override
{
}
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())
return;
//SweepingStrikes_Timer
if (SweepingStrikes_Timer <= diff)
if (_sweepingStrikesTimer <= diff)
{
DoCastVictim(SPELL_SWEEPINGSTRIKES);
SweepingStrikes_Timer = 22000 + rand32() % 4000;
} else SweepingStrikes_Timer -= diff;
_sweepingStrikesTimer = 22000 + rand32() % 4000;
}
else
_sweepingStrikesTimer -= diff;
//SinisterStrike_Timer
if (SinisterStrike_Timer <= diff)
if (_sinisterStrikeTimer <= diff)
{
DoCastVictim(SPELL_SINISTERSTRIKE);
SinisterStrike_Timer = 8000 + rand32() % 8000;
} else SinisterStrike_Timer -= diff;
_sinisterStrikeTimer = 8000 + rand32() % 8000;
}
else
_sinisterStrikeTimer -= diff;
//Gouge_Timer
if (Gouge_Timer <= diff)
if (_gougeTimer <= diff)
{
DoCastVictim(SPELL_GOUGE);
if (GetThreat(me->GetVictim()))
ModifyThreatByPercent(me->GetVictim(), -100);
Gouge_Timer = 17000 + rand32() % 10000;
} else Gouge_Timer -= diff;
_gougeTimer = 17000 + rand32() % 10000;
}
else
_gougeTimer -= diff;
//Kick_Timer
if (Kick_Timer <= diff)
if (_kickTimer <= diff)
{
DoCastVictim(SPELL_KICK);
Kick_Timer = 15000 + rand32() % 10000;
} else Kick_Timer -= diff;
_kickTimer = 15000 + rand32() % 10000;
}
else
_kickTimer -= diff;
//Blind_Timer
if (Blind_Timer <= diff)
if (_blindTimer <= diff)
{
DoCastVictim(SPELL_BLIND);
Blind_Timer = 10000 + rand32() % 10000;
} else Blind_Timer -= diff;
_blindTimer = 10000 + rand32() % 10000;
}
else
_blindTimer -= diff;
//Check_Timer for the death of LorKhan and Zath.
if (!FakeDeath && Check_Timer <= diff)
// Check for the death of LorKhan and Thekal.
if (!_fakeDeath && _checkTimer <= diff)
{
if (instance->GetBossState(DATA_LORKHAN) == SPECIAL)
if (_instance->GetBossState(DATA_LORKHAN) == SPECIAL)
{
//Resurrect LorKhan
if (Unit* pLorKhan = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_LORKHAN)))
// Resurrect LorKhan
if (Creature* lorkhan = _instance->GetCreature(DATA_LORKHAN))
{
pLorKhan->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
pLorKhan->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
pLorKhan->SetFaction(14);
pLorKhan->SetFullHealth();
lorkhan->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
lorkhan->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
lorkhan->SetFaction(14);
lorkhan->SetFullHealth();
}
}
if (instance->GetBossState(DATA_THEKAL) == SPECIAL)
if (_instance->GetBossState(DATA_THEKAL) == SPECIAL)
{
//Resurrect Thekal
if (Unit* pThekal = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_THEKAL)))
// Resurrect Thekal
if (Creature* thekal = _instance->GetCreature(DATA_THEKAL))
{
pThekal->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
pThekal->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
pThekal->SetFaction(14);
pThekal->SetFullHealth();
thekal->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
thekal->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
thekal->SetFaction(FACTION_MONSTER);
thekal->SetFullHealth();
}
}
Check_Timer = 5000;
} else Check_Timer -= diff;
_checkTimer = 5000;
}
else
_checkTimer -= diff;
if (!HealthAbovePct(5))
{
@@ -563,13 +545,23 @@ class npc_zealot_zath : public CreatureScript
me->SetFaction(35);
me->AttackStop();
instance->SetBossState(DATA_ZATH, SPECIAL);
_instance->SetBossState(DATA_ZATH, SPECIAL);
FakeDeath = true;
_fakeDeath = true;
}
DoMeleeAttackIfReady();
}
private:
uint32 _sweepingStrikesTimer;
uint32 _sinisterStrikeTimer;
uint32 _gougeTimer;
uint32 _kickTimer;
uint32 _blindTimer;
uint32 _checkTimer;
bool _fakeDeath;
InstanceScript* _instance;
};
CreatureAI* GetAI(Creature* creature) const override

View File

@@ -16,11 +16,11 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "ObjectMgr.h"
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "Spell.h"
#include "zulgurub.h"
#include "ObjectMgr.h"
#include "ScriptedCreature.h"
#include "ScriptMgr.h"
#include "Spell.h"
/*
* @todo
@@ -42,13 +42,14 @@ enum Spells
SPELL_HOLY_NOVA = 23858,
SPELL_HOLY_FIRE = 23860,
SPELL_HOLY_WRATH = 23979,
// snake form
SPELL_POISON_CLOUD = 23861,
SPELL_VENOM_SPIT = 23862,
SPELL_PARASITIC_SERPENT = 23865,
SPELL_SUMMON_PARASITIC_SERPENT = 23866,
SPELL_PARASITIC_SERPENT_TRIGGER = 23867,
// used when swapping event-stages
SPELL_VENOXIS_TRANSFORM = 23849, // 50% health - shapechange to cobra
SPELL_FRENZY = 8269 // 20% health - frenzy
@@ -63,8 +64,10 @@ enum Events
EVENT_HOLY_NOVA = 4,
EVENT_HOLY_FIRE = 5,
EVENT_HOLY_WRATH = 6,
// phase-changing
EVENT_TRANSFORM = 7,
// snake form events
EVENT_POISON_CLOUD = 8,
EVENT_VENOM_SPIT = 9,
@@ -179,11 +182,11 @@ class boss_venoxis : public CreatureScript
// troll form spells and Actions (first part)
case EVENT_DISPEL_MAGIC:
DoCast(me, SPELL_DISPEL_MAGIC);
events.ScheduleEvent(EVENT_DISPEL_MAGIC, urand(15000, 20000), 0, PHASE_ONE);
events.ScheduleEvent(EVENT_DISPEL_MAGIC, 15s, 20s, 0, PHASE_ONE);
break;
case EVENT_RENEW:
DoCast(me, SPELL_RENEW);
events.ScheduleEvent(EVENT_RENEW, urand(25000, 30000), 0, PHASE_ONE);
events.ScheduleEvent(EVENT_RENEW, 25s, 30s, 0, PHASE_ONE);
break;
case EVENT_HOLY_NOVA:
_inMeleeRange = 0;
@@ -200,17 +203,17 @@ class boss_venoxis : public CreatureScript
if (_inMeleeRange >= 3)
DoCastVictim(SPELL_HOLY_NOVA);
events.ScheduleEvent(EVENT_HOLY_NOVA, urand(45000, 75000), 0, PHASE_ONE);
events.ScheduleEvent(EVENT_HOLY_NOVA, 45s, 75s, 0, PHASE_ONE);
break;
case EVENT_HOLY_FIRE:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM))
DoCast(target, SPELL_HOLY_FIRE);
events.ScheduleEvent(EVENT_HOLY_FIRE, urand(45000, 60000), 0, PHASE_ONE);
events.ScheduleEvent(EVENT_HOLY_FIRE, 45s, 60s, 0, PHASE_ONE);
break;
case EVENT_HOLY_WRATH:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM))
DoCast(target, SPELL_HOLY_WRATH);
events.ScheduleEvent(EVENT_HOLY_WRATH, urand(45000, 60000), 0, PHASE_ONE);
events.ScheduleEvent(EVENT_HOLY_WRATH, 45s, 60s, 0, PHASE_ONE);
break;
//
@@ -220,12 +223,12 @@ class boss_venoxis : public CreatureScript
case EVENT_VENOM_SPIT:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM))
DoCast(target, SPELL_VENOM_SPIT);
events.ScheduleEvent(EVENT_VENOM_SPIT, urand(5000, 15000), 0, PHASE_TWO);
events.ScheduleEvent(EVENT_VENOM_SPIT, 5s, 15s, 0, PHASE_TWO);
break;
case EVENT_POISON_CLOUD:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM))
DoCast(target, SPELL_POISON_CLOUD);
events.ScheduleEvent(EVENT_POISON_CLOUD, urand(15000, 20000), 0, PHASE_TWO);
events.ScheduleEvent(EVENT_POISON_CLOUD, 15s, 20s, 0, PHASE_TWO);
break;
case EVENT_PARASITIC_SERPENT:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM))

View File

@@ -16,27 +16,20 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* ScriptData
SDName: Boss_Wushoolay
SD%Complete: 100
SDComment:
SDCategory: Zul'Gurub
EndScriptData */
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "zulgurub.h"
#include "ScriptedCreature.h"
#include "ScriptMgr.h"
enum Spells
{
SPELL_LIGHTNINGCLOUD = 25033,
SPELL_LIGHTNINGWAVE = 24819
SPELL_LIGHTNINGCLOUD = 25033,
SPELL_LIGHTNINGWAVE = 24819
};
enum Events
{
EVENT_LIGHTNINGCLOUD = 1,
EVENT_LIGHTNINGWAVE = 2
EVENT_LIGHTNINGCLOUD = 1,
EVENT_LIGHTNINGWAVE = 2
};
class boss_wushoolay : public CreatureScript

View File

@@ -16,19 +16,11 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* ScriptData
SDName: Instance_ZulGurub
SD%Complete: 80
SDComment: Missing reset function after killing a boss for Ohgan, Thekal.
SDCategory: Zul'Gurub
EndScriptData */
#include "ScriptMgr.h"
#include "Creature.h"
#include "zulgurub.h"
#include "GameObject.h"
#include "InstanceScript.h"
#include "Map.h"
#include "zulgurub.h"
#include "ScriptMgr.h"
DoorData const doorData[] =
{
@@ -38,7 +30,18 @@ DoorData const doorData[] =
ObjectData const creatureData[] =
{
{ NPC_PRIESTESS_MARLI, DATA_MARLI }
{ NPC_ZEALOT_LORKHAN, DATA_LORKHAN },
{ NPC_ZEALOT_ZATH, DATA_ZATH },
{ NPC_HIGH_PRIEST_THEKAL, DATA_THEKAL },
{ NPC_JINDO_THE_HEXXER, DATA_JINDO },
{ NPC_ARLOKK, DATA_ARLOKK },
{ NPC_PRIESTESS_MARLI, DATA_MARLI },
{ NPC_VILEBRANCH_SPEAKER, DATA_VILEBRANCH_SPEAKER }
};
ObjectData const gameobjectData[] =
{
{ GO_GONG_OF_BETHEKK, DATA_GONG_BETHEKK }
};
class instance_zulgurub : public InstanceMapScript
@@ -51,7 +54,7 @@ class instance_zulgurub : public InstanceMapScript
{
SetHeaders(DataHeader);
SetBossNumber(EncounterCount);
LoadObjectData(creatureData, nullptr);
LoadObjectData(creatureData, gameobjectData);
LoadDoorData(doorData);
}
@@ -61,33 +64,6 @@ class instance_zulgurub : public InstanceMapScript
return false;
}
void OnCreatureCreate(Creature* creature) override
{
InstanceScript::OnCreatureCreate(creature);
switch (creature->GetEntry())
{
case NPC_ZEALOT_LORKHAN:
_zealotLorkhanGUID = creature->GetGUID();
break;
case NPC_ZEALOT_ZATH:
_zealotZathGUID = creature->GetGUID();
break;
case NPC_HIGH_PRIEST_THEKAL:
_highPriestTekalGUID = creature->GetGUID();
break;
case NPC_JINDO_THE_HEXXER:
_jindoTheHexxerGUID = creature->GetGUID();
break;
case NPC_VILEBRANCH_SPEAKER:
_vilebranchSpeakerGUID = creature->GetGUID();
break;
case NPC_ARLOKK:
_arlokkGUID = creature->GetGUID();
break;
}
}
void OnGameObjectCreate(GameObject* go) override
{
InstanceScript::OnGameObjectCreate(go);
@@ -95,7 +71,6 @@ class instance_zulgurub : public InstanceMapScript
switch (go->GetEntry())
{
case GO_GONG_OF_BETHEKK:
_goGongOfBethekkGUID = go->GetGUID();
if (GetBossState(DATA_ARLOKK) == DONE)
go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
else
@@ -105,44 +80,6 @@ class instance_zulgurub : public InstanceMapScript
break;
}
}
ObjectGuid GetGuidData(uint32 uiData) const override
{
switch (uiData)
{
case DATA_LORKHAN:
return _zealotLorkhanGUID;
break;
case DATA_ZATH:
return _zealotZathGUID;
break;
case DATA_THEKAL:
return _highPriestTekalGUID;
break;
case DATA_JINDO:
return _jindoTheHexxerGUID;
break;
case NPC_ARLOKK:
return _arlokkGUID;
break;
case GO_GONG_OF_BETHEKK:
return _goGongOfBethekkGUID;
break;
}
return ObjectGuid::Empty;
}
private:
//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.
ObjectGuid _zealotLorkhanGUID;
ObjectGuid _zealotZathGUID;
ObjectGuid _highPriestTekalGUID;
ObjectGuid _jindoTheHexxerGUID;
ObjectGuid _vilebranchSpeakerGUID;
ObjectGuid _arlokkGUID;
ObjectGuid _goGongOfBethekkGUID;
};
InstanceScript* GetInstanceScript(InstanceMap* map) const override

View File

@@ -39,7 +39,9 @@ enum ZGDataTypes
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!
TYPE_EDGE_OF_MADNESS = 12 // Boss storage
DATA_GONG_BETHEKK = 12,
DATA_VILEBRANCH_SPEAKER = 13
};
enum ZGCreatureIds