Skip to content

Commit 03c27ae

Browse files
Tobschinskixfurry
authored andcommitted
[3148] BRD - General Angerforge
Close scriptdev2/scriptdev2-classic#45 (based on commit 7722c86) Signed-off-by: Xfurry <xfurry@scriptdev2.com>
1 parent 4ec687c commit 03c27ae

File tree

4 files changed

+48
-60
lines changed

4 files changed

+48
-60
lines changed

scripts/eastern_kingdoms/blackrock_depths/boss_general_angerforge.cpp

+41-58
Original file line numberDiff line numberDiff line change
@@ -25,44 +25,51 @@ EndScriptData */
2525

2626
enum
2727
{
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,
3133

32-
NPC_ANVILRAGE_RESERVIST = 8901,
3334
NPC_ANVILRAGE_MEDIC = 8894,
35+
NPC_ANVILRAGE_RESERVIST = 8901,
36+
37+
NPC_ELITE_AMOUNT = 2,
38+
NPC_NORMAL_AMOUNT = 8,
3439
};
3540

41+
static const float aAlarmPoint[4] = {717.343f, 22.116f, -45.4321f, 3.1415f};
42+
3643
struct boss_general_angerforgeAI : public ScriptedAI
3744
{
3845
boss_general_angerforgeAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); }
3946

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;
4549

4650
void Reset() override
4751
{
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);
5360
}
5461

5562
void SummonAdd(uint32 uiEntry)
5663
{
5764
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);
6067
}
6168

6269
void JustSummoned(Creature* pSummoned) override
6370
{
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());
6673
}
6774

6875
void UpdateAI(const uint32 uiDiff) override
@@ -71,55 +78,31 @@ struct boss_general_angerforgeAI : public ScriptedAI
7178
if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
7279
return;
7380

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)
9483
{
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);
9786
}
9887
else
99-
m_uiCleaveTimer -= uiDiff;
88+
m_uiSunderArmorTimer -= uiDiff;
10089

101-
// Adds_Timer
102-
if (m_creature->GetHealthPercent() < 21.0f)
90+
// Alarm-Timer
91+
if (m_creature->GetHealthPercent() < 40.0f)
10392
{
104-
if (m_uiAddsTimer < uiDiff)
93+
if (m_uiAlarmTimer < uiDiff)
10594
{
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);
110101

111-
m_uiAddsTimer = 25000;
102+
m_uiAlarmTimer = 3 * MINUTE * IN_MILLISECONDS;
112103
}
113104
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;
123106
}
124107

125108
DoMeleeAttackIfReady();

sd2_revision_nr.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#ifndef __SD2_REVISION_NR_H__
22
#define __SD2_REVISION_NR_H__
3-
#define SD2_REVISION_NR "3147"
3+
#define SD2_REVISION_NR "3148"
44
#endif // __SD2_REVISION_NR_H__

sql/scriptdev2_script_full.sql

+3-1
Original file line numberDiff line numberDiff line change
@@ -1577,7 +1577,9 @@ INSERT INTO script_texts (entry,content_default,sound,type,language,emote,commen
15771577
(-1230032,'Thank you! I will run for safety immediately!',0,0,0,0,'tobias SAY_TOBIAS_FREE_1'),
15781578
(-1230033,'Finally!! I can leave this dump.',0,0,0,0,'tobias SAY_TOBIAS_FREE_2'),
15791579

1580-
(-1230034,'You\'ll pay for this insult, $c!',0,0,0,15,'coren direbrew SAY_AGGRO');
1580+
(-1230034,'You\'ll pay for this insult, $c!',0,0,0,15,'coren direbrew SAY_AGGRO'),
1581+
1582+
(-1230035,'%s cries out an alarm!',0,2,0,0,'general_angerforge EMOTE_ALARM');
15811583

15821584
-- -1 249 000 ONYXIA'S LAIR
15831585
INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES

sql/updates/r3148_scriptdev2.sql

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
DELETE FROM script_texts WHERE entry=1230035;
2+
INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES
3+
(-1230035,'%s cries out an alarm!',0,2,0,0,'general_angerforge EMOTE_ALARM');

0 commit comments

Comments
 (0)