@@ -25,44 +25,51 @@ EndScriptData */
25
25
26
26
enum
27
27
{
28
- SPELL_MIGHTYBLOW = 14099 ,
29
- SPELL_HAMSTRING = 9080 ,
30
- SPELL_CLEAVE = 20691 ,
28
+ EMOTE_ALARM = -1230035 ,
29
+
30
+ SPELL_FLURRY = 15088 ,
31
+ SPELL_ENRAGE = 15097 ,
32
+ SPELL_SUNDER_ARMOR = 15572 ,
31
33
32
- NPC_ANVILRAGE_RESERVIST = 8901 ,
33
34
NPC_ANVILRAGE_MEDIC = 8894 ,
35
+ NPC_ANVILRAGE_RESERVIST = 8901 ,
36
+
37
+ NPC_ELITE_AMOUNT = 2 ,
38
+ NPC_NORMAL_AMOUNT = 8 ,
34
39
};
35
40
41
+ static const float aAlarmPoint[4 ] = {717 .343f , 22 .116f , -45 .4321f , 3 .1415f };
42
+
36
43
struct boss_general_angerforgeAI : public ScriptedAI
37
44
{
38
45
boss_general_angerforgeAI (Creature* pCreature) : ScriptedAI(pCreature) { Reset (); }
39
46
40
- uint32 m_uiMightyBlowTimer;
41
- uint32 m_uiHamStringTimer;
42
- uint32 m_uiCleaveTimer;
43
- uint32 m_uiAddsTimer;
44
- bool m_bSummonedMedics;
47
+ uint32 m_uiSunderArmorTimer;
48
+ uint32 m_uiAlarmTimer;
45
49
46
50
void Reset () override
47
51
{
48
- m_uiMightyBlowTimer = 8000 ;
49
- m_uiHamStringTimer = 12000 ;
50
- m_uiCleaveTimer = 16000 ;
51
- m_uiAddsTimer = 0 ;
52
- m_bSummonedMedics = false ;
52
+ m_uiSunderArmorTimer = urand (5 * IN_MILLISECONDS, 10 * IN_MILLISECONDS);
53
+ m_uiAlarmTimer = 0 ;
54
+ }
55
+
56
+ void Aggro (Unit* /* pWho*/ ) override
57
+ {
58
+ DoCastSpellIfCan (m_creature, SPELL_FLURRY, CAST_AURA_NOT_PRESENT | CAST_TRIGGERED);
59
+ DoCastSpellIfCan (m_creature, SPELL_ENRAGE, CAST_AURA_NOT_PRESENT | CAST_TRIGGERED);
53
60
}
54
61
55
62
void SummonAdd (uint32 uiEntry)
56
63
{
57
64
float fX , fY , fZ ;
58
- m_creature->GetRandomPoint (m_creature-> GetPositionX (), m_creature-> GetPositionY (), m_creature-> GetPositionZ (), 20 .0f , fX , fY , fZ );
59
- m_creature->SummonCreature (uiEntry, fX , fY , fZ , 0 . 0f , TEMPSUMMON_TIMED_OOC_OR_DEAD_DESPAWN, 60000 );
65
+ m_creature->GetRandomPoint (aAlarmPoint[ 0 ], aAlarmPoint[ 1 ], aAlarmPoint[ 2 ], 1 .0f , fX , fY , fZ );
66
+ m_creature->SummonCreature (uiEntry, fX , fY , fZ , aAlarmPoint[ 3 ] , TEMPSUMMON_TIMED_OOC_OR_DEAD_DESPAWN, 30 * IN_MILLISECONDS );
60
67
}
61
68
62
69
void JustSummoned (Creature* pSummoned) override
63
70
{
64
- if (Unit* pTarget = m_creature->SelectAttackingTarget (ATTACKING_TARGET_RANDOM, 0 ))
65
- pSummoned->AI ()->AttackStart (pTarget );
71
+ if (m_creature->getVictim ( ))
72
+ pSummoned->AI ()->AttackStart (m_creature-> getVictim () );
66
73
}
67
74
68
75
void UpdateAI (const uint32 uiDiff) override
@@ -71,55 +78,31 @@ struct boss_general_angerforgeAI : public ScriptedAI
71
78
if (!m_creature->SelectHostileTarget () || !m_creature->getVictim ())
72
79
return ;
73
80
74
- // MightyBlow_Timer
75
- if (m_uiMightyBlowTimer < uiDiff)
76
- {
77
- DoCastSpellIfCan (m_creature->getVictim (), SPELL_MIGHTYBLOW);
78
- m_uiMightyBlowTimer = 18000 ;
79
- }
80
- else
81
- m_uiMightyBlowTimer -= uiDiff;
82
-
83
- // HamString_Timer
84
- if (m_uiHamStringTimer < uiDiff)
85
- {
86
- DoCastSpellIfCan (m_creature->getVictim (), SPELL_HAMSTRING);
87
- m_uiHamStringTimer = 15000 ;
88
- }
89
- else
90
- m_uiHamStringTimer -= uiDiff;
91
-
92
- // Cleave_Timer
93
- if (m_uiCleaveTimer < uiDiff)
81
+ // Sunder_Armor-Timer
82
+ if (m_uiSunderArmorTimer < uiDiff)
94
83
{
95
- DoCastSpellIfCan (m_creature->getVictim (), SPELL_CLEAVE);
96
- m_uiCleaveTimer = 9000 ;
84
+ if ( DoCastSpellIfCan (m_creature->getVictim (), SPELL_SUNDER_ARMOR) == CAST_OK)
85
+ m_uiSunderArmorTimer = urand ( 5 * IN_MILLISECONDS, 15 * IN_MILLISECONDS) ;
97
86
}
98
87
else
99
- m_uiCleaveTimer -= uiDiff;
88
+ m_uiSunderArmorTimer -= uiDiff;
100
89
101
- // Adds_Timer
102
- if (m_creature->GetHealthPercent () < 21 .0f )
90
+ // Alarm-Timer
91
+ if (m_creature->GetHealthPercent () < 40 .0f )
103
92
{
104
- if (m_uiAddsTimer < uiDiff)
93
+ if (m_uiAlarmTimer < uiDiff)
105
94
{
106
- // summon 3 Adds every 25s
107
- SummonAdd (NPC_ANVILRAGE_RESERVIST);
108
- SummonAdd (NPC_ANVILRAGE_RESERVIST);
109
- SummonAdd (NPC_ANVILRAGE_RESERVIST);
95
+ DoScriptText (EMOTE_ALARM, m_creature);
96
+
97
+ for (int i = 0 ; i < NPC_NORMAL_AMOUNT; i++)
98
+ SummonAdd (NPC_ANVILRAGE_RESERVIST);
99
+ for (int i = 0 ; i < NPC_ELITE_AMOUNT; i++)
100
+ SummonAdd (NPC_ANVILRAGE_MEDIC);
110
101
111
- m_uiAddsTimer = 25000 ;
102
+ m_uiAlarmTimer = 3 * MINUTE * IN_MILLISECONDS ;
112
103
}
113
104
else
114
- m_uiAddsTimer -= uiDiff;
115
- }
116
-
117
- // Summon Medics
118
- if (!m_bSummonedMedics && m_creature->GetHealthPercent () < 21 .0f )
119
- {
120
- SummonAdd (NPC_ANVILRAGE_MEDIC);
121
- SummonAdd (NPC_ANVILRAGE_MEDIC);
122
- m_bSummonedMedics = true ;
105
+ m_uiAlarmTimer -= uiDiff;
123
106
}
124
107
125
108
DoMeleeAttackIfReady ();
0 commit comments