aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bindings/scripts/include/sc_creature.cpp48
-rw-r--r--src/bindings/scripts/include/sc_creature.h5
-rw-r--r--src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/blackwing_lair/boss_broodlord_lashlayer.cpp19
-rw-r--r--src/bindings/scripts/scripts/zone/eastern_plaguelands/the_scarlet_enclave.cpp182
-rw-r--r--src/bindings/scripts/scripts/zone/gruuls_lair/boss_high_king_maulgar.cpp17
-rw-r--r--src/bindings/scripts/scripts/zone/obsidian_sanctum/boss_sartharion.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/orgrimmar/orgrimmar.cpp6
-rw-r--r--src/bindings/scripts/scripts/zone/stratholme/stratholme.cpp13
-rw-r--r--src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_astromancer.cpp146
-rw-r--r--src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_void_reaver.cpp29
-rw-r--r--src/bindings/scripts/scripts/zone/zulaman/boss_janalai.cpp14
12 files changed, 279 insertions, 204 deletions
diff --git a/src/bindings/scripts/include/sc_creature.cpp b/src/bindings/scripts/include/sc_creature.cpp
index 0ed59db42bf..5edc67f7120 100644
--- a/src/bindings/scripts/include/sc_creature.cpp
+++ b/src/bindings/scripts/include/sc_creature.cpp
@@ -79,7 +79,7 @@ void SummonList::DespawnAll()
}
}
-ScriptedAI::ScriptedAI(Creature* creature) : CreatureAI(creature), m_creature(creature), IsFleeing(false), CombatMovement(true)
+ScriptedAI::ScriptedAI(Creature* creature) : CreatureAI(creature), m_creature(creature), IsFleeing(false), CombatMovement(true), m_uiEvadeCheckCooldown(2500)
{
HeroicMode = m_creature->GetMap()->IsHeroic();
}
@@ -577,6 +577,52 @@ void ScriptedAI::SetCombatMovement(bool CombatMove)
CombatMovement = CombatMove;
}
+// Hacklike storage used for misc creatures that are expected to evade of outside of a certain area.
+// It is assumed the information is found elswehere and can be handled by mangos. So far no luck finding such information/way to extract it.
+bool ScriptedAI::EnterEvadeIfOutOfCombatArea(const uint32 uiDiff)
+{
+ if (m_uiEvadeCheckCooldown < uiDiff)
+ m_uiEvadeCheckCooldown = 2500;
+ else
+ {
+ m_uiEvadeCheckCooldown -= uiDiff;
+ return false;
+ }
+
+ if (m_creature->IsInEvadeMode() || !m_creature->getVictim())
+ return false;
+
+ float fX = m_creature->GetPositionX();
+ float fY = m_creature->GetPositionY();
+ float fZ = m_creature->GetPositionZ();
+
+ switch(m_creature->GetEntry())
+ {
+ case 12017: // broodlord (not move down stairs)
+ if (fZ > 448.60f)
+ return false;
+ break;
+ case 19516: // void reaver (calculate from center of room)
+ if (m_creature->GetDistance2d(432.59f, 371.93f) < 105.0f)
+ return false;
+ break;
+ case 23578: // jan'alai (calculate by Z)
+ if (fZ > 12.0f)
+ return false;
+ break;
+ case 28860: // sartharion (calculate box)
+ if (fX > 3218.86f && fX < 3275.69f && fY > 572.40f && fY < 484.68f)
+ return false;
+ break;
+ default:
+ error_log("TSCR: EnterEvadeIfOutOfCombatArea used for creature entry %u, but does not have any definition.", m_creature->GetEntry());
+ return false;
+ }
+
+ EnterEvadeMode();
+ return true;
+}
+
/*void Scripted_NoMovementAI::MoveInLineOfSight(Unit *who)
{
if( !m_creature->getVictim() && m_creature->canAttack(who) && ( m_creature->IsHostileTo( who )) && who->isInAccessiblePlaceFor(m_creature) )
diff --git a/src/bindings/scripts/include/sc_creature.h b/src/bindings/scripts/include/sc_creature.h
index e4142780443..b4328f2fd66 100644
--- a/src/bindings/scripts/include/sc_creature.h
+++ b/src/bindings/scripts/include/sc_creature.h
@@ -191,9 +191,14 @@ struct TRINITY_DLL_DECL ScriptedAI : public CreatureAI
void SetEquipmentSlots(bool bLoadDefault, int32 uiMainHand = EQUIP_NO_CHANGE, int32 uiOffHand = EQUIP_NO_CHANGE, int32 uiRanged = EQUIP_NO_CHANGE);
void SetCombatMovement(bool CombatMove);
+
+ bool EnterEvadeIfOutOfCombatArea(const uint32 uiDiff);
protected:
bool CombatMovement;
+
+ private:
+ uint32 m_uiEvadeCheckCooldown;
};
struct TRINITY_DLL_DECL Scripted_NoMovementAI : public ScriptedAI
diff --git a/src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp b/src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp
index 986f4a78f21..dcf9263ad07 100644
--- a/src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp
+++ b/src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp
@@ -159,7 +159,7 @@ struct TRINITY_DLL_DECL npc_taskmaster_fizzuleAI : public ScriptedAI
DoMeleeAttackIfReady();
}
- void ReciveEmote(Player* pPlayer, uint32 emote)
+ void ReceiveEmote(Player* pPlayer, uint32 emote)
{
if (emote == TEXTEMOTE_SALUTE)
{
diff --git a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_broodlord_lashlayer.cpp b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_broodlord_lashlayer.cpp
index 9207f5d03a4..a4654ee575b 100644
--- a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_broodlord_lashlayer.cpp
+++ b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_broodlord_lashlayer.cpp
@@ -39,7 +39,6 @@ struct TRINITY_DLL_DECL boss_broodlordAI : public ScriptedAI
uint32 BlastWave_Timer;
uint32 MortalStrike_Timer;
uint32 KnockBack_Timer;
- uint32 LeashCheck_Timer;
void Reset()
{
@@ -47,7 +46,6 @@ struct TRINITY_DLL_DECL boss_broodlordAI : public ScriptedAI
BlastWave_Timer = 12000;
MortalStrike_Timer = 20000;
KnockBack_Timer = 30000;
- LeashCheck_Timer = 2000;
}
void EnterCombat(Unit *who)
@@ -61,20 +59,6 @@ struct TRINITY_DLL_DECL boss_broodlordAI : public ScriptedAI
if (!UpdateVictim())
return;
- //LeashCheck_Timer
- if (LeashCheck_Timer < diff)
- {
- float rx,ry,rz;
- m_creature->GetRespawnCoord(rx, ry, rz);
- if(!m_creature->IsWithinDist3d(rx,ry,rz,250.0f))
- {
- DoScriptText(SAY_LEASH, m_creature);
- EnterEvadeMode();
- return;
- }
- LeashCheck_Timer = 2000;
- }else LeashCheck_Timer -= diff;
-
//Cleave_Timer
if (Cleave_Timer < diff)
{
@@ -106,6 +90,9 @@ struct TRINITY_DLL_DECL boss_broodlordAI : public ScriptedAI
KnockBack_Timer = 15000 + rand()%15000;
}else KnockBack_Timer -= diff;
+ if (EnterEvadeIfOutOfCombatArea(diff))
+ DoScriptText(SAY_LEASH, m_creature);
+
DoMeleeAttackIfReady();
}
};
diff --git a/src/bindings/scripts/scripts/zone/eastern_plaguelands/the_scarlet_enclave.cpp b/src/bindings/scripts/scripts/zone/eastern_plaguelands/the_scarlet_enclave.cpp
index d8360d2c5b8..cce758fe9e2 100644
--- a/src/bindings/scripts/scripts/zone/eastern_plaguelands/the_scarlet_enclave.cpp
+++ b/src/bindings/scripts/scripts/zone/eastern_plaguelands/the_scarlet_enclave.cpp
@@ -482,14 +482,17 @@ CreatureAI* GetAI_npc_a_special_surprise(Creature* pCreature)
##Quest 12848
######*/
-#define SPELL_SOUL_PRISON_CHAIN_SELF 54612
-#define SPELL_SOUL_PRISON_CHAIN 54613
-#define SPELL_DK_INITIATE_VISUAL 51519
-
-#define SPELL_ICY_TOUCH 52372
-#define SPELL_PLAGUE_STRIKE 52373
-#define SPELL_BLOOD_STRIKE 52374
-#define SPELL_DEATH_COIL 52375
+enum
+{
+ SPELL_SOUL_PRISON_CHAIN_SELF = 54612,
+ SPELL_SOUL_PRISON_CHAIN = 54613,
+ SPELL_DK_INITIATE_VISUAL = 51519,
+
+ SPELL_ICY_TOUCH = 52372,
+ SPELL_PLAGUE_STRIKE = 52373,
+ SPELL_BLOOD_STRIKE = 52374,
+ SPELL_DEATH_COIL = 52375
+};
#define EVENT_ICY_TOUCH 1
#define EVENT_PLAGUE_STRIKE 2
@@ -788,109 +791,140 @@ bool GOHello_go_acherus_soul_prison(Player *player, GameObject* _GO)
## npc_death_knight_initiate
######*/
-#define GOSSIP_DKI "Duel with me!"
+#define GOSSIP_ACCEPT_DUEL "[PH] I challenge you!"
-const char * SAY_DKI_DUEL1 = "Remember this day, $N, for it is the day that you will be thoroughly owned.";
-const char * SAY_DKI_DUEL2 = "I'm going to tear your heart out, cupcake!";
-const char * SAY_DKI_DUEL3 = "You have challenged death itself!";
-const char * SAY_DKI_DUEL4 = "Don't make me laugh.";
-const char * SAY_DKI_DUEL5 = "Here come the tears...";
-const char * SAY_DKI_DUEL6 = "No potions!";
-#define SAY_DKI_DUEL RAND(SAY_DKI_DUEL1,SAY_DKI_DUEL2,SAY_DKI_DUEL3,SAY_DKI_DUEL4,SAY_DKI_DUEL5,SAY_DKI_DUEL6)
+enum
+{
+ SAY_DUEL_A = -1609017,
+ SAY_DUEL_B = -1609018,
+ SAY_DUEL_C = -1609019,
+ SAY_DUEL_D = -1609020,
+ SAY_DUEL_E = -1609021,
+ SAY_DUEL_F = -1609022,
+
+ SPELL_DUEL = 52996,
+ SPELL_DUEL_TRIGGERED = 52990,
+ SPELL_DUEL_VICTORY = 52994,
+ SPELL_DUEL_FLAG = 52991,
+
+ QUEST_DEATH_CHALLENGE = 12733,
+ FACTION_HOSTILE = 2068
+};
-#define SPELL_DUEL_FLAG 52991
+int32 m_auiRandomSay[] =
+{
+ SAY_DUEL_A, SAY_DUEL_B, SAY_DUEL_C, SAY_DUEL_D, SAY_DUEL_E, SAY_DUEL_F
+};
-struct TRINITY_DLL_DECL npc_death_knight_initiateAI : public SpellAI
+struct TRINITY_DLL_DECL npc_death_knight_initiateAI : public ScriptedAI
{
- npc_death_knight_initiateAI(Creature *c) : SpellAI(c) {}
+ npc_death_knight_initiateAI(Creature* pCreature) : ScriptedAI(pCreature) { }
+
+ uint64 m_uiDuelerGUID;
+ uint32 m_uiDuelTimer;
+ bool m_bIsDuelInProgress;
void Reset()
{
me->RestoreFaction();
- lose = false;
- SpellAI::Reset();
- }
- bool lose;
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_15);
- void EnterCombat(Unit *who)
+ m_uiDuelerGUID = 0;
+ m_uiDuelTimer = 5000;
+ m_bIsDuelInProgress = false;
+ }
+
+ void AttackedBy(Unit* pAttacker)
{
- if(who->GetTypeId() == TYPEID_PLAYER)
- me->MonsterSay(SAY_DKI_DUEL, LANG_UNIVERSAL, who->GetGUID());
- SpellAI::EnterCombat(who);
+ if (m_creature->getVictim())
+ return;
+
+ if (m_creature->IsFriendlyTo(pAttacker))
+ return;
+
+ AttackStart(pAttacker);
}
- void UpdateAI(const uint32 diff)
+ void SpellHit(Unit* pCaster, const SpellEntry* pSpell)
{
- if(me->getVictim() && me->getVictim()->GetTypeId() == TYPEID_PLAYER)
+ if (!m_bIsDuelInProgress && pSpell->Id == SPELL_DUEL_TRIGGERED)
{
- if(lose)
- {
- if(!me->HasAura(7267)) // beg aura has faded
- {
- me->getVictim()->CastSpell(me->getVictim(), 52994, true);
- EnterEvadeMode();
- }
- return;
- }
- else if(me->getVictim()->GetHealth() * 10 < me->getVictim()->GetMaxHealth())
- {
- me->getVictim()->CastSpell(me->getVictim(), 7267, true); // beg
- me->getVictim()->RemoveGameObject(SPELL_DUEL_FLAG, true);
- EnterEvadeMode();
- return; // must return after enterevademode
- }
+ m_uiDuelerGUID = pCaster->GetGUID();
+ m_bIsDuelInProgress = true;
}
+ }
+
+ void DamageTaken(Unit* pDoneBy, uint32 &uiDamage)
+ {
+ if (m_bIsDuelInProgress && uiDamage > m_creature->GetHealth())
+ {
+ uiDamage = 0;
+
+ if (Unit* pUnit = Unit::GetUnit(*m_creature, m_uiDuelerGUID))
+ m_creature->CastSpell(pUnit, SPELL_DUEL_VICTORY, true);
- SpellAI::UpdateAI(diff);
+ //possibly not evade, but instead have end sequenze
+ EnterEvadeMode();
+ }
}
- void DamageTaken(Unit *done_by, uint32 & damage)
+ void UpdateAI(const uint32 uiDiff)
{
- if(done_by->GetTypeId() == TYPEID_PLAYER)
+ if (!UpdateVictim())
{
- if(done_by != me->getVictim())
- damage = 0; // not allow other player to help
- else if(damage > me->GetHealth())
+ if (m_bIsDuelInProgress)
{
- damage = 0;
- done_by->AttackStop();
- if(!lose)
+ if (m_uiDuelTimer < uiDiff)
{
- lose = true;
- me->CastSpell(me, 7267, true); // beg
- me->getVictim()->RemoveGameObject(SPELL_DUEL_FLAG, true);
- me->RestoreFaction();
+ m_creature->setFaction(FACTION_HOSTILE);
+
+ if (Unit* pUnit = Unit::GetUnit(*m_creature, m_uiDuelerGUID))
+ AttackStart(pUnit);
}
+ else
+ m_uiDuelTimer -= uiDiff;
}
+ return;
}
+
+ // TODO: spells
+
+ DoMeleeAttackIfReady();
}
};
-CreatureAI* GetAI_npc_death_knight_initiate(Creature *_Creature)
+CreatureAI* GetAI_npc_death_knight_initiate(Creature* pCreature)
{
- return new npc_death_knight_initiateAI(_Creature);
+ return new npc_death_knight_initiateAI(pCreature);
}
-bool GossipHello_npc_death_knight_initiate(Player *player, Creature *_Creature)
+bool GossipHello_npc_death_knight_initiate(Player* pPlayer, Creature* pCreature)
{
- if( player->GetQuestStatus(12733) == QUEST_STATUS_INCOMPLETE && _Creature->GetHealth() == _Creature->GetMaxHealth())
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DKI, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
-
- player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(),_Creature->GetGUID());
+ if (pPlayer->GetQuestStatus(QUEST_DEATH_CHALLENGE) == QUEST_STATUS_INCOMPLETE && pCreature->GetHealth() == pCreature->GetMaxHealth())
+ {
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ACCEPT_DUEL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
+ pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(),pCreature->GetGUID());
+ }
return true;
}
-bool GossipSelect_npc_death_knight_initiate(Player *player, Creature *_Creature, uint32 sender, uint32 action )
+bool GossipSelect_npc_death_knight_initiate(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
{
- if( action == GOSSIP_ACTION_INFO_DEF )
+ if( uiAction == GOSSIP_ACTION_INFO_DEF )
{
- player->CastSpell(player, SPELL_DUEL_FLAG, true);
- if (player->GetTeam() == HORDE ) // Check the player team, then choose faction
- _Creature->setFaction(1);
- else
- _Creature->setFaction(2);
- _Creature->AI()->AttackStart(player);
+ pPlayer->CLOSE_GOSSIP_MENU();
+
+ if (((npc_death_knight_initiateAI*)pCreature)->m_bIsDuelInProgress)
+ return true;
+
+ pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_15);
+
+ int32 uiSayId = rand()% (sizeof(m_auiRandomSay)/sizeof(int32));
+ DoScriptText(m_auiRandomSay[uiSayId], pCreature, pPlayer);
+
+ pCreature->CastSpell(pPlayer, SPELL_DUEL, false);
+ pCreature->CastSpell(pPlayer, SPELL_DUEL_FLAG, true);
}
return true;
}
@@ -1241,9 +1275,9 @@ void AddSC_the_scarlet_enclave()
newscript = new Script;
newscript->Name="npc_death_knight_initiate";
+ newscript->GetAI = &GetAI_npc_death_knight_initiate;
newscript->pGossipHello = &GossipHello_npc_death_knight_initiate;
newscript->pGossipSelect = &GossipSelect_npc_death_knight_initiate;
- newscript->GetAI = &GetAI_npc_death_knight_initiate;
newscript->RegisterSelf();
newscript = new Script;
diff --git a/src/bindings/scripts/scripts/zone/gruuls_lair/boss_high_king_maulgar.cpp b/src/bindings/scripts/scripts/zone/gruuls_lair/boss_high_king_maulgar.cpp
index ede59d50f53..88de477d238 100644
--- a/src/bindings/scripts/scripts/zone/gruuls_lair/boss_high_king_maulgar.cpp
+++ b/src/bindings/scripts/scripts/zone/gruuls_lair/boss_high_king_maulgar.cpp
@@ -324,6 +324,21 @@ struct TRINITY_DLL_DECL boss_olm_the_summonerAI : public ScriptedAI
pInstance->SetData(DATA_MAULGAREVENT, NOT_STARTED);
}
+ void AttackStart(Unit* pWho)
+ {
+ if (!pWho)
+ return;
+
+ if (m_creature->Attack(pWho, true))
+ {
+ m_creature->AddThreat(pWho, 0.0f);
+ m_creature->SetInCombatWith(pWho);
+ pWho->SetInCombatWith(m_creature);
+
+ m_creature->GetMotionMaster()->MoveChase(pWho, 30.0f);
+ }
+ }
+
void EnterCombat(Unit *who)
{
if(pInstance)
@@ -718,8 +733,6 @@ struct TRINITY_DLL_DECL boss_krosh_firehandAI : public ScriptedAI
DoCast(target, SPELL_BLAST_WAVE);
BlastWave_Timer = 60000;
}else BlastWave_Timer -= diff;
-
- DoMeleeAttackIfReady();
}
};
diff --git a/src/bindings/scripts/scripts/zone/obsidian_sanctum/boss_sartharion.cpp b/src/bindings/scripts/scripts/zone/obsidian_sanctum/boss_sartharion.cpp
index 3f3a37fb5b4..98439172b21 100644
--- a/src/bindings/scripts/scripts/zone/obsidian_sanctum/boss_sartharion.cpp
+++ b/src/bindings/scripts/scripts/zone/obsidian_sanctum/boss_sartharion.cpp
@@ -447,6 +447,8 @@ struct TRINITY_DLL_DECL boss_sartharionAI : public ScriptedAI
}else m_uiVesperonTimer -= uiDiff;
DoMeleeAttackIfReady();
+
+ EnterEvadeIfOutOfCombatArea(uiDiff);
}
};
diff --git a/src/bindings/scripts/scripts/zone/orgrimmar/orgrimmar.cpp b/src/bindings/scripts/scripts/zone/orgrimmar/orgrimmar.cpp
index 7e6c439b4a8..daf71a0324d 100644
--- a/src/bindings/scripts/scripts/zone/orgrimmar/orgrimmar.cpp
+++ b/src/bindings/scripts/scripts/zone/orgrimmar/orgrimmar.cpp
@@ -126,13 +126,13 @@ struct TRINITY_DLL_DECL npc_shenthulAI : public ScriptedAI
DoMeleeAttackIfReady();
}
- void ReciveEmote_npc_shenthul(Player *player, uint32 emote)
+ void ReceiveEmote(Player* pPlayer, uint32 emote)
{
- if( emote == TEXTEMOTE_SALUTE && player->GetQuestStatus(QUEST_SHATTERED_SALUTE) == QUEST_STATUS_INCOMPLETE )
+ if( emote == TEXTEMOTE_SALUTE && pPlayer->GetQuestStatus(QUEST_SHATTERED_SALUTE) == QUEST_STATUS_INCOMPLETE )
{
if(CanEmote)
{
- player->AreaExploredOrEventHappens(QUEST_SHATTERED_SALUTE);
+ pPlayer->AreaExploredOrEventHappens(QUEST_SHATTERED_SALUTE);
Reset();
}
}
diff --git a/src/bindings/scripts/scripts/zone/stratholme/stratholme.cpp b/src/bindings/scripts/scripts/zone/stratholme/stratholme.cpp
index ea64fd8d738..8441831165a 100644
--- a/src/bindings/scripts/scripts/zone/stratholme/stratholme.cpp
+++ b/src/bindings/scripts/scripts/zone/stratholme/stratholme.cpp
@@ -172,7 +172,11 @@ CreatureAI* GetAI_mob_restless_soul(Creature *_Creature)
## mobs_spectral_ghostly_citizen
######*/
-#define SPELL_HAUNTING_PHANTOM 16336
+enum
+{
+ SPELL_HAUNTING_PHANTOM = 16336,
+ SPELL_SLAP = 6754
+};
struct TRINITY_DLL_DECL mobs_spectral_ghostly_citizenAI : public ScriptedAI
{
@@ -228,7 +232,7 @@ struct TRINITY_DLL_DECL mobs_spectral_ghostly_citizenAI : public ScriptedAI
DoMeleeAttackIfReady();
}
- void ReciveEmote(Player *player, uint32 emote)
+ void ReceiveEmote(Player* pPlayer, uint32 emote)
{
switch(emote)
{
@@ -236,9 +240,8 @@ struct TRINITY_DLL_DECL mobs_spectral_ghostly_citizenAI : public ScriptedAI
EnterEvadeMode();
break;
case TEXTEMOTE_RUDE:
- //Should instead cast spell, kicking player back. Spell not found.
- if (m_creature->IsWithinDistInMap(player, 5))
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_RUDE);
+ if (m_creature->IsWithinDistInMap(pPlayer, 5))
+ m_creature->CastSpell(pPlayer,SPELL_SLAP,false);
else
m_creature->HandleEmoteCommand(EMOTE_ONESHOT_RUDE);
break;
diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_astromancer.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_astromancer.cpp
index ea2c8902c4a..8d6f9aebcf4 100644
--- a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_astromancer.cpp
+++ b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_astromancer.cpp
@@ -24,48 +24,49 @@ EndScriptData */
#include "precompiled.h"
#include "def_the_eye.h"
-#define SAY_AGGRO -1550007
-#define SAY_SUMMON1 -1550008
-#define SAY_SUMMON2 -1550009
-#define SAY_KILL1 -1550010
-#define SAY_KILL2 -1550011
-#define SAY_KILL3 -1550012
-#define SAY_DEATH -1550013
-#define SAY_VOIDA -1550014
-#define SAY_VOIDB -1550015
-
-#define SPELL_ARCANE_MISSILES 33031
-#define SPELL_MARK_OF_THE_ASTROMANCER 33045
-#define MARK_OF_SOLARIAN 33023
-#define SPELL_BLINDING_LIGHT 33009
-#define SPELL_FEAR 29321
-#define SPELL_VOID_BOLT 39329
-#define SPELL_SPOTLIGHT 25824
-#define SPELL_WRATH_OF_THE_ASTROMANCER 42783
-
-#define CENTER_X 432.909f
-#define CENTER_Y -373.424f
-#define CENTER_Z 17.9608f
-#define CENTER_O 1.06421f
-#define SMALL_PORTAL_RADIUS 12.6f
-#define LARGE_PORTAL_RADIUS 26.0f
-#define PORTAL_Z 17.005f
-
-#define SOLARIUM_AGENT 18925
-#define SOLARIUM_PRIEST 18806
-#define ASTROMANCER_SOLARIAN_SPOTLIGHT 18928
-
-#define MODEL_HUMAN 18239
-#define MODEL_VOIDWALKER 18988
-
-#define SOLARIUM_HEAL 41378
-#define SOLARIUM_SMITE 31740
-#define SOLARIUM_SILENCE 37160
-
-#define WV_ARMOR 31000
-#define MIN_RANGE_FOR_DOT_JUMP 20.0f
-
- // x, y, z, o
+enum
+{
+ SAY_AGGRO = -1550007,
+ SAY_SUMMON1 = -1550008,
+ SAY_SUMMON2 = -1550009,
+ SAY_KILL1 = -1550010,
+ SAY_KILL2 = -1550011,
+ SAY_KILL3 = -1550012,
+ SAY_DEATH = -1550013,
+ SAY_VOIDA = -1550014,
+ SAY_VOIDB = -1550015,
+
+ SPELL_ARCANE_MISSILES = 33031,
+ SPELL_WRATH_OF_THE_ASTROMANCER = 42783,
+ SPELL_BLINDING_LIGHT = 33009,
+ SPELL_FEAR = 34322,
+ SPELL_VOID_BOLT = 39329,
+
+ SPELL_SPOTLIGHT = 25824,
+ NPC_ASTROMANCER_SOLARIAN_SPOTLIGHT = 18928,
+
+ NPC_SOLARIUM_AGENT = 18925,
+ NPC_SOLARIUM_PRIEST = 18806,
+
+ MODEL_HUMAN = 18239,
+ MODEL_VOIDWALKER = 18988,
+
+ SPELL_SOLARIUM_GREAT_HEAL = 33387,
+ SPELL_SOLARIUM_HOLY_SMITE = 25054,
+ SPELL_SOLARIUM_ARCANE_TORRENT = 33390,
+
+ WV_ARMOR = 31000
+};
+
+const float CENTER_X = 432.909f;
+const float CENTER_Y = -373.424f;
+const float CENTER_Z = 17.9608f;
+const float CENTER_O = 1.06421f;
+const float SMALL_PORTAL_RADIUS = 12.6f;
+const float LARGE_PORTAL_RADIUS = 26.0f;
+const float PORTAL_Z = 17.005f;
+
+ // x, y, z, o
static float SolarianPos[4] = {432.909, -373.424, 17.9608, 1.06421};
struct TRINITY_DLL_DECL boss_high_astromancer_solarianAI : public ScriptedAI
@@ -84,7 +85,7 @@ struct TRINITY_DLL_DECL boss_high_astromancer_solarianAI : public ScriptedAI
uint8 Phase;
uint32 ArcaneMissiles_Timer;
- uint32 MarkOfTheAstromancer_Timer;
+ uint32 m_uiWrathOfTheAstromancer_Timer;
uint32 BlindingLight_Timer;
uint32 Fear_Timer;
uint32 VoidBolt_Timer;
@@ -92,8 +93,6 @@ struct TRINITY_DLL_DECL boss_high_astromancer_solarianAI : public ScriptedAI
uint32 Phase2_Timer;
uint32 Phase3_Timer;
uint32 AppearDelay_Timer;
- uint32 MarkOfTheSolarian_Timer;
- uint32 Jump_Timer;
uint32 defaultarmor;
uint32 Wrath_Timer;
@@ -106,7 +105,7 @@ struct TRINITY_DLL_DECL boss_high_astromancer_solarianAI : public ScriptedAI
void Reset()
{
ArcaneMissiles_Timer = 2000;
- MarkOfTheAstromancer_Timer = 15000;
+ m_uiWrathOfTheAstromancer_Timer = 15000;
BlindingLight_Timer = 41000;
Fear_Timer = 20000;
VoidBolt_Timer = 10000;
@@ -116,8 +115,6 @@ struct TRINITY_DLL_DECL boss_high_astromancer_solarianAI : public ScriptedAI
AppearDelay_Timer = 2000;
BlindingLight = false;
AppearDelay = false;
- MarkOfTheSolarian_Timer=45000;
- Jump_Timer=8000;
Wrath_Timer = 20000+rand()%5000;//twice in phase one
Phase = 1;
Wrath_Timer = 20000+rand()%5000;//twice in phase one
@@ -134,14 +131,6 @@ struct TRINITY_DLL_DECL boss_high_astromancer_solarianAI : public ScriptedAI
Summons.DespawnAll();
}
- void StartEvent()
- {
- DoScriptText(SAY_AGGRO, m_creature);
-
- if(pInstance)
- pInstance->SetData(DATA_HIGHASTROMANCERSOLARIANEVENT, IN_PROGRESS);
- }
-
void KilledUnit(Unit *victim)
{
switch(rand()%3)
@@ -164,7 +153,11 @@ struct TRINITY_DLL_DECL boss_high_astromancer_solarianAI : public ScriptedAI
void EnterCombat(Unit *who)
{
- StartEvent();
+ DoScriptText(SAY_AGGRO, m_creature);
+ DoZoneInCombat();
+
+ if (pInstance)
+ pInstance->SetData(DATA_HIGHASTROMANCERSOLARIANEVENT, IN_PROGRESS);
}
void SummonMinion(uint32 entry, float x, float y, float z)
@@ -252,20 +245,20 @@ struct TRINITY_DLL_DECL boss_high_astromancer_solarianAI : public ScriptedAI
ArcaneMissiles_Timer = 3000;
}else ArcaneMissiles_Timer -= diff;
- if (MarkOfTheSolarian_Timer < diff)
+ if (m_uiWrathOfTheAstromancer_Timer < diff)
{
- DoCast(m_creature->getVictim(), MARK_OF_SOLARIAN);
- MarkOfTheSolarian_Timer = 45000;
- }else MarkOfTheSolarian_Timer -= diff;
+ m_creature->InterruptNonMeleeSpells(false);
- if (MarkOfTheAstromancer_Timer < diff) //A debuff that lasts for 5 seconds, cast several times each phase on a random raid member, but not the main tank
- {
- Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true);
- if(target)
- DoCast(target, SPELL_MARK_OF_THE_ASTROMANCER);
- else DoCast(m_creature->getVictim(), SPELL_MARK_OF_THE_ASTROMANCER);
- MarkOfTheAstromancer_Timer = 15000;
- }else MarkOfTheAstromancer_Timer -= diff;
+ //Target the tank ?
+ if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1))
+ if (pTarget->GetTypeId() == TYPEID_PLAYER)
+ {
+ DoCast(pTarget, SPELL_WRATH_OF_THE_ASTROMANCER);
+ m_uiWrathOfTheAstromancer_Timer = 25000;
+ }
+ else
+ m_uiWrathOfTheAstromancer_Timer = 1000;
+ }else m_uiWrathOfTheAstromancer_Timer -= diff;
//Phase1_Timer
if (Phase1_Timer < diff)
@@ -300,8 +293,7 @@ struct TRINITY_DLL_DECL boss_high_astromancer_solarianAI : public ScriptedAI
}
for (int i=0; i<=2; i++)
{
- Creature* Summoned = m_creature->SummonCreature(ASTROMANCER_SOLARIAN_SPOTLIGHT, Portals[i][0], Portals[i][1], Portals[i][2], CENTER_O, TEMPSUMMON_TIMED_DESPAWN, Phase2_Timer+Phase3_Timer+AppearDelay_Timer+1700);
- if(Summoned)
+ if (Creature* Summoned = m_creature->SummonCreature(NPC_ASTROMANCER_SOLARIAN_SPOTLIGHT, Portals[i][0], Portals[i][1], Portals[i][2], CENTER_O, TEMPSUMMON_TIMED_DESPAWN, Phase2_Timer+Phase3_Timer+AppearDelay_Timer+1700))
{
Summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
Summoned->CastSpell(Summoned, SPELL_SPOTLIGHT, false);
@@ -320,7 +312,7 @@ struct TRINITY_DLL_DECL boss_high_astromancer_solarianAI : public ScriptedAI
Phase = 3;
for (int i=0; i<=2; i++)
for (int j=1; j<=4; j++)
- SummonMinion(SOLARIUM_AGENT, Portals[i][0], Portals[i][1], Portals[i][2]);
+ SummonMinion(NPC_SOLARIUM_AGENT, Portals[i][0], Portals[i][1], Portals[i][2]);
DoScriptText(SAY_SUMMON1, m_creature);
Phase2_Timer = 10000;
@@ -343,7 +335,7 @@ struct TRINITY_DLL_DECL boss_high_astromancer_solarianAI : public ScriptedAI
for (int j=0; j<=2; j++)
if (j!=i)
- SummonMinion(SOLARIUM_PRIEST, Portals[j][0], Portals[j][1], Portals[j][2]);
+ SummonMinion(NPC_SOLARIUM_PRIEST, Portals[j][0], Portals[j][1], Portals[j][2]);
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_creature->SetVisibility(VISIBILITY_ON);
@@ -358,7 +350,7 @@ struct TRINITY_DLL_DECL boss_high_astromancer_solarianAI : public ScriptedAI
//Fear_Timer
if (Fear_Timer < diff)
{
- DoCast(m_creature->getVictim(), SPELL_FEAR);
+ DoCast(m_creature, SPELL_FEAR);
Fear_Timer = 20000;
}else Fear_Timer -= diff;
@@ -435,20 +427,20 @@ struct TRINITY_DLL_DECL mob_solarium_priestAI : public ScriptedAI
if(target)
{
- DoCast(target,SOLARIUM_HEAL);
+ DoCast(target,SPELL_SOLARIUM_GREAT_HEAL);
healTimer = 9000;
}
} else healTimer -= diff;
if(holysmiteTimer < diff)
{
- DoCast(m_creature->getVictim(), SOLARIUM_SMITE);
+ DoCast(m_creature->getVictim(), SPELL_SOLARIUM_HOLY_SMITE);
holysmiteTimer = 4000;
} else holysmiteTimer -= diff;
if (aoesilenceTimer < diff)
{
- DoCast(m_creature->getVictim(), SOLARIUM_SILENCE);
+ DoCast(m_creature->getVictim(), SPELL_SOLARIUM_ARCANE_TORRENT);
aoesilenceTimer = 13000;
} else aoesilenceTimer -= diff;
diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_void_reaver.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_void_reaver.cpp
index aea073a89f8..5bc50a88a5a 100644
--- a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_void_reaver.cpp
+++ b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_void_reaver.cpp
@@ -24,18 +24,21 @@ EndScriptData */
#include "precompiled.h"
#include "def_the_eye.h"
-#define SAY_AGGRO -1550000
-#define SAY_SLAY1 -1550001
-#define SAY_SLAY2 -1550002
-#define SAY_SLAY3 -1550003
-#define SAY_DEATH -1550004
-#define SAY_POUNDING1 -1550005
-#define SAY_POUNDING2 -1550006
-
-#define SPELL_POUNDING 34162
-#define SPELL_ARCANE_ORB 34172
-#define SPELL_KNOCK_AWAY 25778
-#define SPELL_BERSERK 27680
+enum
+{
+ SAY_AGGRO = -1550000,
+ SAY_SLAY1 = -1550001,
+ SAY_SLAY2 = -1550002,
+ SAY_SLAY3 = -1550003,
+ SAY_DEATH = -1550004,
+ SAY_POUNDING1 = -1550005,
+ SAY_POUNDING2 = -1550006,
+
+ SPELL_POUNDING = 34162,
+ SPELL_ARCANE_ORB = 34172,
+ SPELL_KNOCK_AWAY = 25778,
+ SPELL_BERSERK = 27680
+};
struct TRINITY_DLL_DECL boss_void_reaverAI : public ScriptedAI
{
@@ -161,6 +164,8 @@ struct TRINITY_DLL_DECL boss_void_reaverAI : public ScriptedAI
}else Berserk_Timer -= diff;
DoMeleeAttackIfReady();
+
+ EnterEvadeIfOutOfCombatArea(diff);
}
};
diff --git a/src/bindings/scripts/scripts/zone/zulaman/boss_janalai.cpp b/src/bindings/scripts/scripts/zone/zulaman/boss_janalai.cpp
index 36b915539c9..7207e33e398 100644
--- a/src/bindings/scripts/scripts/zone/zulaman/boss_janalai.cpp
+++ b/src/bindings/scripts/scripts/zone/zulaman/boss_janalai.cpp
@@ -122,7 +122,6 @@ struct TRINITY_DLL_DECL boss_janalaiAI : public ScriptedAI
uint32 BombCount;
uint32 HatcherTimer;
uint32 EnrageTimer;
- uint32 ResetTimer;
bool noeggs;
bool enraged;
@@ -143,7 +142,6 @@ struct TRINITY_DLL_DECL boss_janalaiAI : public ScriptedAI
BombCount = 0;
HatcherTimer = 10000;
EnrageTimer = MINUTE*5*IN_MILISECONDS;
- ResetTimer = 5000;
noeggs = false;
isBombing =false;
@@ -420,17 +418,7 @@ struct TRINITY_DLL_DECL boss_janalaiAI : public ScriptedAI
}else HatcherTimer -= diff;
}
- if(ResetTimer < diff)
- {
- float x, y, z, o;
- m_creature->GetHomePosition(x, y, z, o);
- if(m_creature->GetPositionZ() <= z-7)
- {
- EnterEvadeMode();
- return;
- }
- ResetTimer = 5000;
- }else ResetTimer -= diff;
+ EnterEvadeIfOutOfCombatArea(diff);
DoMeleeAttackIfReady();