Skip to content

Commit 80175b1

Browse files
authored
Scripts/Hellfire Ramparts: Update Gargolmar (TrinityCore#31774)
1 parent fe37942 commit 80175b1

2 files changed

Lines changed: 67 additions & 25 deletions

File tree

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
--
2+
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 13 AND `SourceEntry` = 30642;
3+
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
4+
(13,1,30642,0,0,31,0,3,17309,0,0,0,0,"","Group 0: Spell 'Request Heal' (Effect 0) targets creature 'Hellfire Watcher'");
5+
6+
DELETE FROM `creature_text` WHERE `CreatureID` = 17309;
7+
INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
8+
(17309,0,0,"We are the true Horde!",12,0,100,0,0,0,16697,0,"Hellfire Watcher"),
9+
(17309,0,1,"For Kargath! For Victory!",12,0,100,0,0,0,16698,0,"Hellfire Watcher"),
10+
(17309,0,2,"Gakarah ma!",12,0,100,0,0,0,16699,0,"Hellfire Watcher"),
11+
(17309,0,3,"The blood is our power! ",12,0,100,0,0,0,16700,0,"Hellfire Watcher"),
12+
(17309,0,4,"Lok'tar Illadari!\n",12,0,100,0,0,0,16701,0,"Hellfire Watcher"),
13+
(17309,0,5,"This world is OURS!",12,0,100,0,0,0,16702,0,"Hellfire Watcher"),
14+
(17309,0,6,"Lok narash!",12,0,100,0,0,0,16703,0,"Hellfire Watcher");
15+
16+
DELETE FROM `smart_scripts` WHERE `entryorguid` = 17309 AND `source_type` = 0;
17+
INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`event_param5`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_param4`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
18+
(17309,0,0,0,4,0,15,0,0,0,0,0,0,1,0,0,1,0,0,0,7,0,0,0,0,0,0,0,0,"Hellfire Watcher - On Aggro - Say Line 0"),
19+
(17309,0,1,0,0,0,100,0,2400,6100,10500,23400,0,11,14032,0,0,0,0,0,2,0,0,0,0,0,0,0,0,"Hellfire Watcher - In Combat - Cast 'Shadow Word: Pain'"),
20+
(17309,0,2,0,74,0,100,0,0,50,20000,25000,40,11,8362,0,0,0,0,0,7,0,0,0,0,0,0,0,0,"Hellfire Watcher - On Friendly Between 0-50% Health - Cast 'Renew'"),
21+
(17309,0,3,0,74,0,100,0,0,40,12000,20000,40,11,12039,0,0,0,0,0,7,0,0,0,0,0,0,0,0,"Hellfire Watcher - On Friendly Between 0-40% Health - Cast 'Heal'"),
22+
(17309,0,4,0,8,0,100,0,30642,0,0,0,0,11,30643,0,0,0,0,0,7,0,0,0,0,0,0,0,0,"Hellfire Watcher - On Spellhit 'Request Heal' - Cast 'Heal'");

src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_watchkeeper_gargolmar.cpp

Lines changed: 45 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@
1515
* with this program. If not, see <http://www.gnu.org/licenses/>.
1616
*/
1717

18-
/* Missing adds to heal him
19-
* Surge should be used on target furthest away, not random */
18+
/*
19+
* Timers requires to be revisited
20+
*/
2021

2122
#include "ScriptMgr.h"
2223
#include "hellfire_ramparts.h"
@@ -36,16 +37,17 @@ enum GargolmarSpells
3637
{
3738
SPELL_MORTAL_WOUND = 30641,
3839
SPELL_SURGE = 34645,
40+
SPELL_REQUEST_HEAL = 30642,
3941
SPELL_RETALIATION = 22857
4042
};
4143

4244
enum GargolmarEvents
4345
{
44-
EVENT_MORTAL_WOUND = 1,
46+
EVENT_TAUNT = 1,
47+
EVENT_MORTAL_WOUND,
4548
EVENT_SURGE,
46-
EVENT_RETALIATION,
47-
EVENT_TAUNT,
48-
EVENT_HEAL
49+
EVENT_REQUEST_HEAL,
50+
EVENT_RETALIATION
4951
};
5052

5153
enum GargolmarMisc
@@ -56,7 +58,7 @@ enum GargolmarMisc
5658
// 17306 - Watchkeeper Gargolmar
5759
struct boss_watchkeeper_gargolmar : public BossAI
5860
{
59-
boss_watchkeeper_gargolmar(Creature* creature) : BossAI(creature, DATA_WATCHKEEPER_GARGOLMAR), _yelledForHeal(false), _retaliation(false) { }
61+
boss_watchkeeper_gargolmar(Creature* creature) : BossAI(creature, DATA_WATCHKEEPER_GARGOLMAR), _hasRequestedHeal(false), _hasRetaliation(false) { }
6062

6163
void JustAppeared() override
6264
{
@@ -67,37 +69,49 @@ struct boss_watchkeeper_gargolmar : public BossAI
6769
void Reset() override
6870
{
6971
_Reset();
70-
_yelledForHeal = false;
71-
_retaliation = false;
72+
_hasRequestedHeal = false;
73+
_hasRetaliation = false;
7274
}
7375

7476
void JustEngagedWith(Unit* who) override
7577
{
76-
Talk(SAY_AGGRO);
7778
BossAI::JustEngagedWith(who);
79+
80+
Talk(SAY_AGGRO);
81+
7882
events.ScheduleEvent(EVENT_MORTAL_WOUND, 5s, 10s);
7983
events.ScheduleEvent(EVENT_SURGE, 3s, 5s);
8084
}
8185

8286
void DamageTaken(Unit* /*attacker*/, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
8387
{
84-
if (!_yelledForHeal && me->HealthBelowPctDamaged(40, damage))
88+
if (!_hasRequestedHeal && me->HealthBelowPctDamaged(40, damage))
8589
{
86-
_yelledForHeal = true;
87-
events.ScheduleEvent(EVENT_HEAL, 0s);
90+
_hasRequestedHeal = true;
91+
events.ScheduleEvent(EVENT_REQUEST_HEAL, 0s);
8892
}
89-
if (!_retaliation && me->HealthBelowPctDamaged(20, damage))
93+
94+
if (!_hasRetaliation && me->HealthBelowPctDamaged(20, damage))
9095
{
91-
_retaliation = true;
96+
_hasRetaliation = true;
9297
events.ScheduleEvent(EVENT_RETALIATION, 0s);
9398
}
9499
}
95100

96-
void OnSpellCast(SpellInfo const* spell) override
101+
void OnSpellCast(SpellInfo const* spellInfo) override
97102
{
98-
if (spell->Id == SPELL_SURGE)
99-
if (roll_chance_i(50))
100-
Talk(SAY_SURGE);
103+
switch (spellInfo->Id)
104+
{
105+
case SPELL_SURGE:
106+
if (roll_chance_i(50))
107+
Talk(SAY_SURGE);
108+
break;
109+
case SPELL_REQUEST_HEAL:
110+
Talk(SAY_HEAL);
111+
break;
112+
default:
113+
break;
114+
}
101115
}
102116

103117
void KilledUnit(Unit* /*victim*/) override
@@ -128,6 +142,9 @@ struct boss_watchkeeper_gargolmar : public BossAI
128142

129143
events.Update(diff);
130144

145+
if (me->HasUnitState(UNIT_STATE_CASTING))
146+
return;
147+
131148
while (uint32 eventId = events.ExecuteEvent())
132149
{
133150
switch (eventId)
@@ -137,28 +154,31 @@ struct boss_watchkeeper_gargolmar : public BossAI
137154
events.Repeat(5s, 15s);
138155
break;
139156
case EVENT_SURGE:
140-
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
157+
if (Unit* target = SelectTarget(SelectTargetMethod::MaxDistance, 0))
141158
DoCast(target, SPELL_SURGE);
142159
events.Repeat(15s, 40s);
143160
break;
161+
case EVENT_REQUEST_HEAL:
162+
DoCastSelf(SPELL_REQUEST_HEAL);
163+
break;
144164
case EVENT_RETALIATION:
145165
DoCastSelf(SPELL_RETALIATION);
146166
events.Repeat(30s);
147167
break;
148-
case EVENT_HEAL:
149-
Talk(SAY_HEAL);
150-
break;
151168
default:
152169
break;
153170
}
171+
172+
if (me->HasUnitState(UNIT_STATE_CASTING))
173+
return;
154174
}
155175

156176
DoMeleeAttackIfReady();
157177
}
158178

159179
private:
160-
bool _yelledForHeal;
161-
bool _retaliation;
180+
bool _hasRequestedHeal;
181+
bool _hasRetaliation;
162182
};
163183

164184
void AddSC_boss_watchkeeper_gargolmar()

0 commit comments

Comments
 (0)