16
16
17
17
/* ScriptData
18
18
SDName: boss_deathbringer_saurfang
19
- SD%Complete: 60 %
20
- SDComment: Blood Power and all the related spells require core support; Intro and Outro event NYI.
19
+ SD%Complete: 80 %
20
+ SDComment: Intro and Outro event NYI.
21
21
SDCategory: Icecrown Citadel
22
22
EndScriptData */
23
23
73
73
SAY_OUTRO_HORDE_4 = -1631069 ,
74
74
75
75
// intro event related
76
- // SPELL_GRIP_OF_AGONY = 70572,
77
- // SPELL_VEHICLE_HARDCODED = 46598,
76
+ SPELL_GRIP_OF_AGONY = 70572 ,
77
+ SPELL_VEHICLE_HARDCODED = 46598 ,
78
78
79
- // combat spells
80
- SPELL_BLOOD_POWER = 72371 ,
81
- // SPELL_BLOOD_POWER_SCALE = 72370 , // included in creature_template_addon
82
- // SPELL_ZERO_POWER = 72242 , // included in creature_template_addon
79
+ // aggro spells
80
+ SPELL_BLOOD_LINK = 72178 ,
81
+ SPELL_MARK_FALLEN_DAMAGE = 72256 , // procs 72255 on Saurfang melee attack
82
+ SPELL_RUNE_OF_BLOOD_PROC = 72408 , // procs 72409 on Saurfang melee attack
83
83
84
- // SPELL_MARK_FALLEN_DAMAGE = 72256, // procs on Saurfang melee attack - 72255 - included in creature_template_addon
85
- SPELL_MARK_FALLEN_CHAMPION = 72293 , // procs on target death - 72260
86
- SPELL_REMOVE_MARKS = 72257 ,
84
+ // combat spells
85
+ SPELL_BLOOD_POWER = 72371 , // triggered by 72195
86
+ // SPELL_BLOOD_POWER_SCALE = 72370, // purpose unk
87
+ // SPELL_ZERO_POWER = 72242, // included in creature_template_addon
87
88
88
- // SPELL_RUNE_OF_BLOOD_PROC = 72408 , // procs on Saurfang mele attack - 72409 - included in creature_template_addon
89
+ SPELL_MARK_FALLEN_CHAMPION = 72254 , // triggers 72293 which procs 72260 on target death
89
90
SPELL_RUNE_OF_BLOOD = 72410 ,
90
-
91
91
SPELL_BLOOD_NOVA = 72378 ,
92
92
SPELL_BOILING_BLOOD = 72385 ,
93
93
@@ -101,14 +101,17 @@ enum
101
101
SPELL_BERSERK = 26662 ,
102
102
SPELL_FRENZY = 72737 ,
103
103
104
+ // evade / death spells
105
+ SPELL_REMOVE_MARKS = 72257 ,
106
+ SPELL_ACHIEVEMENT = 72928 ,
107
+
104
108
// Summoned spells
105
109
SPELL_RESISTANT_SKIN = 72723 ,
106
110
SPELL_BLOOD_LINK_BEAST = 72176 ,
107
111
108
112
FACTION_ID_UNDEAD = 974 ,
109
113
110
114
POINT_ID_INTRO = 1 ,
111
- POINT_ID_EVADE = 2 ,
112
115
};
113
116
114
117
static const float fIntroPosition [4 ] = { -491 .30f , 2211 .35f , 541 .11f , 3 .16f };
@@ -118,7 +121,6 @@ struct boss_deathbringer_saurfangAI : public ScriptedAI
118
121
boss_deathbringer_saurfangAI (Creature* pCreature) : ScriptedAI(pCreature)
119
122
{
120
123
m_pInstance = (instance_icecrown_citadel*)pCreature->GetInstanceData ();
121
- m_powerBloodPower = m_creature->GetPowerType ();
122
124
m_bIsIntroDone = false ;
123
125
Reset ();
124
126
}
@@ -135,8 +137,6 @@ struct boss_deathbringer_saurfangAI : public ScriptedAI
135
137
bool m_bIsFrenzied;
136
138
bool m_bIsIntroDone;
137
139
138
- Powers m_powerBloodPower;
139
-
140
140
void Reset () override
141
141
{
142
142
m_uiRuneOfBloodTimer = 25000 ;
@@ -150,14 +150,15 @@ struct boss_deathbringer_saurfangAI : public ScriptedAI
150
150
m_uiBerserkTimer = 6 * MINUTE * IN_MILLISECONDS;
151
151
152
152
m_bIsFrenzied = false ;
153
-
154
- m_creature->SetPower (m_powerBloodPower, 0 );
155
153
}
156
154
157
155
void Aggro (Unit* /* pWho*/ ) override
158
156
{
159
157
DoScriptText (SAY_AGGRO, m_creature);
160
- DoCastSpellIfCan (m_creature, SPELL_BLOOD_POWER, CAST_TRIGGERED);
158
+
159
+ DoCastSpellIfCan (m_creature, SPELL_BLOOD_LINK, CAST_TRIGGERED);
160
+ DoCastSpellIfCan (m_creature, SPELL_MARK_FALLEN_DAMAGE, CAST_TRIGGERED);
161
+ DoCastSpellIfCan (m_creature, SPELL_RUNE_OF_BLOOD_PROC, CAST_TRIGGERED);
161
162
162
163
if (m_pInstance)
163
164
m_pInstance->SetData (TYPE_DEATHBRINGER_SAURFANG, IN_PROGRESS);
@@ -189,6 +190,7 @@ struct boss_deathbringer_saurfangAI : public ScriptedAI
189
190
{
190
191
DoScriptText (SAY_DEATH, m_creature);
191
192
DoCastSpellIfCan (m_creature, SPELL_REMOVE_MARKS, CAST_TRIGGERED);
193
+ DoCastSpellIfCan (m_creature, SPELL_ACHIEVEMENT, CAST_TRIGGERED);
192
194
193
195
if (m_pInstance)
194
196
m_pInstance->SetData (TYPE_DEATHBRINGER_SAURFANG, DONE);
@@ -198,46 +200,27 @@ struct boss_deathbringer_saurfangAI : public ScriptedAI
198
200
{
199
201
if (m_pInstance)
200
202
m_pInstance->SetData (TYPE_DEATHBRINGER_SAURFANG, FAIL);
201
- }
202
-
203
- void EnterEvadeMode () override
204
- {
205
- m_creature->RemoveAllAurasOnEvade ();
206
- m_creature->DeleteThreatList ();
207
- m_creature->CombatStop (true );
208
-
209
- // Boss needs to evade to the point in front of the door
210
- if (m_creature->isAlive ())
211
- m_creature->GetMotionMaster ()->MovePoint (POINT_ID_EVADE, fIntroPosition [0 ], fIntroPosition [1 ], fIntroPosition [2 ]);
212
203
213
- m_creature->SetLootRecipient (NULL );
214
-
215
- Reset ();
204
+ DoCastSpellIfCan (m_creature, SPELL_REMOVE_MARKS, CAST_TRIGGERED);
205
+ m_creature->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
216
206
}
217
207
218
208
void MovementInform (uint32 uiMoveType, uint32 uiPointId) override
219
209
{
220
210
if (uiMoveType != POINT_MOTION_TYPE)
221
211
return ;
222
212
223
- if (uiPointId == POINT_ID_EVADE)
224
- {
225
- m_creature->SetFacingTo (fIntroPosition [3 ]);
226
-
227
- if (m_pInstance)
228
- m_pInstance->SetData (TYPE_DEATHBRINGER_SAURFANG, FAIL);
229
- }
230
- else if (uiPointId == POINT_ID_INTRO)
213
+ if (uiPointId == POINT_ID_INTRO)
231
214
{
232
215
if (m_pInstance)
233
216
m_pInstance->DoUseDoorOrButton (GO_SAURFANG_DOOR);
234
217
235
218
// Note: this should be done only after the intro event is finished
236
219
// ToDo: move this to the proper place after the intro will be implemented
237
220
// Also the faction needs to be checked if it should be handled in database
238
- m_creature->setFaction (FACTION_ID_UNDEAD);
239
- m_creature->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_PASSIVE);
240
- m_creature->SetInCombatWithZone ( );
221
+ m_creature->SetFactionTemporary (FACTION_ID_UNDEAD, TEMPFACTION_NONE );
222
+ m_creature->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_PASSIVE | UNIT_FLAG_OOC_NOT_ATTACKABLE );
223
+ m_creature->SetRespawnCoord (m_creature-> GetPositionX (), m_creature-> GetPositionY (), m_creature-> GetPositionZ (), m_creature-> GetOrientation () );
241
224
}
242
225
}
243
226
@@ -251,46 +234,21 @@ struct boss_deathbringer_saurfangAI : public ScriptedAI
251
234
pSummoned->AI ()->AttackStart (pTarget);
252
235
}
253
236
254
- // Wrapper to help get a random player for the Mark of the Fallen Champion
255
- Unit* SelectRandomPlayerForMark ()
256
- {
257
- // Search only for players which are not within 18 yards of the boss
258
- std::vector<Unit*> suitableTargets;
259
- ThreatList const & threatList = m_creature->getThreatManager ().getThreatList ();
260
-
261
- for (ThreatList::const_iterator itr = threatList.begin (); itr != threatList.end (); ++itr)
262
- {
263
- if (Unit* pTarget = m_creature->GetMap ()->GetUnit ((*itr)->getUnitGuid ()))
264
- {
265
- if (pTarget->GetTypeId () == TYPEID_PLAYER && pTarget != m_creature->getVictim () && !pTarget->HasAura (SPELL_MARK_FALLEN_CHAMPION))
266
- suitableTargets.push_back (pTarget);
267
- }
268
- }
269
-
270
- if (suitableTargets.empty ())
271
- return m_creature->getVictim ();
272
- else
273
- return suitableTargets[urand (0 , suitableTargets.size () - 1 )];
274
- }
275
-
276
237
void UpdateAI (const uint32 uiDiff) override
277
238
{
278
239
if (!m_creature->SelectHostileTarget () || !m_creature->getVictim ())
279
240
return ;
280
241
281
242
// Mark of the Fallen Champion
282
- // ToDo: enable this when blood power is fully supported by the core
283
- /* if (m_creature->GetPower(m_powerBloodPower) >= 100)
243
+ if (m_creature->GetPower (m_creature->GetPowerType ()) == 100 )
284
244
{
285
- if (Unit* pTarget = SelectRandomPlayerForMark() )
245
+ if (DoCastSpellIfCan (m_creature, SPELL_MARK_FALLEN_CHAMPION) == CAST_OK )
286
246
{
287
- if (DoCastSpellIfCan(pTarget, SPELL_MARK_FALLEN_CHAMPION) == CAST_OK)
288
- {
289
- DoScriptText(SAY_FALLENCHAMPION, m_creature);
290
- m_creature->SetPower(m_powerBloodPower, 0);
291
- }
247
+ DoScriptText (SAY_FALLENCHAMPION, m_creature);
248
+ m_creature->RemoveAurasDueToSpell (SPELL_BLOOD_POWER);
249
+ m_creature->SetPower (m_creature->GetPowerType (), 0 );
292
250
}
293
- }*/
251
+ }
294
252
295
253
// Frenzy (soft enrage)
296
254
if (!m_bIsFrenzied)
@@ -308,7 +266,7 @@ struct boss_deathbringer_saurfangAI : public ScriptedAI
308
266
// Berserk (hard enrage)
309
267
if (m_uiBerserkTimer)
310
268
{
311
- if (m_uiBerserkTimer < uiDiff)
269
+ if (m_uiBerserkTimer <= uiDiff)
312
270
{
313
271
if (DoCastSpellIfCan (m_creature, SPELL_BERSERK) == CAST_OK)
314
272
{
0 commit comments