@@ -1589,7 +1589,7 @@ class spell_dh_vengeful_retreat_damage : public SpellScript
1589
1589
void HandleVengefulBonds (std::list<WorldObject*>& targets)
1590
1590
{
1591
1591
if (!GetCaster ()->HasAura (SPELL_DH_VENGEFUL_BONDS))
1592
- targets.clear ();
1592
+ targets.clear ();
1593
1593
}
1594
1594
1595
1595
void Register () override
@@ -3396,21 +3396,32 @@ class spell_dh_demonic_appetite : public SpellScriptLoader
3396
3396
class spell_dh_demonic_appetite_AuraScript : public AuraScript
3397
3397
{
3398
3398
3399
- void OnProc (AuraEffect* /* aurEff*/ , ProcEventInfo& /* eventInfo*/ )
3399
+ bool CheckProc (ProcEventInfo& eventInfo)
3400
+ {
3401
+ return true ;
3402
+ }
3403
+
3404
+ void OnProc (AuraEffect const * /* aurEff*/ , ProcEventInfo& /* eventInfo*/ )
3400
3405
{
3401
- PreventDefaultAction ();
3402
3406
Unit* caster = GetCaster ();
3403
3407
if (!caster)
3404
3408
return ;
3409
+
3410
+ CastSpellExtraArgs args;
3411
+ args.SetOriginalCaster (caster->GetGUID ());
3412
+ args.AddSpellMod (SPELLVALUE_BASE_POINT0, SPELL_DH_LESSER_SOUL_SHARD);
3413
+
3414
+ caster->CastSpell (caster, SPELL_DH_SHATTERED_SOULS_MISSILE, args);
3405
3415
}
3406
3416
3407
- void Register ()
3417
+ void Register () override
3408
3418
{
3419
+ DoCheckProc += AuraCheckProcFn (spell_dh_demonic_appetite_AuraScript::CheckProc);
3409
3420
OnEffectProc += AuraEffectProcFn (spell_dh_demonic_appetite_AuraScript::OnProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
3410
3421
}
3411
3422
};
3412
3423
3413
- AuraScript* GetAuraScript () const
3424
+ AuraScript* GetAuraScript () const override
3414
3425
{
3415
3426
return new spell_dh_demonic_appetite_AuraScript ();
3416
3427
}
@@ -4299,6 +4310,210 @@ class DemonHunterAllowSpec : public PlayerScript
4299
4310
}
4300
4311
};
4301
4312
4313
+ // 209651 - Shattered Souls missile
4314
+ class spell_dh_shattered_souls_missile : public SpellScriptLoader
4315
+ {
4316
+ public:
4317
+ spell_dh_shattered_souls_missile () : SpellScriptLoader(" spell_dh_shattered_souls_missile" ) { }
4318
+
4319
+ class spell_dh_shattered_souls_missile_SpellScript : public SpellScript
4320
+ {
4321
+
4322
+ void HandleHit (SpellEffIndex effIndex)
4323
+ {
4324
+ PreventHitDefaultEffect (effIndex);
4325
+ Unit* caster = GetCaster ();
4326
+ if (!caster)
4327
+ return ;
4328
+
4329
+ int32 spellToCast = GetSpellValue ()->EffectBasePoints [0 ];
4330
+ if (WorldLocation* dest = GetHitDest ())
4331
+ caster->CastSpell (Position (dest->GetPositionX (), dest->GetPositionY (), dest->GetPositionZ ()), spellToCast, true );
4332
+ }
4333
+
4334
+ void Register ()
4335
+ {
4336
+ OnEffectHit += SpellEffectFn (spell_dh_shattered_souls_missile_SpellScript::HandleHit, EFFECT_1, SPELL_EFFECT_TRIGGER_MISSILE);
4337
+ }
4338
+ };
4339
+
4340
+ SpellScript* GetSpellScript () const
4341
+ {
4342
+ return new spell_dh_shattered_souls_missile_SpellScript ();
4343
+ }
4344
+ };
4345
+
4346
+ // 178940 - Shattered Souls (havoc)
4347
+ // 204254 - Shattered Souls (vengeance)
4348
+ class spell_dh_shattered_souls_havoc : public SpellScriptLoader
4349
+ {
4350
+ public:
4351
+ spell_dh_shattered_souls_havoc () : SpellScriptLoader(" spell_dh_shattered_souls_havoc" ) { }
4352
+
4353
+ class spell_dh_shattered_souls_havoc_AuraScript : public AuraScript
4354
+ {
4355
+
4356
+ bool CheckProc (ProcEventInfo& eventInfo)
4357
+ {
4358
+ Unit* target = eventInfo.GetActionTarget ();
4359
+ return target != nullptr ;
4360
+ }
4361
+
4362
+ void OnProc (AuraEffect const * /* aurEff*/ , ProcEventInfo& eventInfo)
4363
+ {
4364
+ Unit* caster = GetCaster ();
4365
+ Unit* target = eventInfo.GetActionTarget ();
4366
+ if (!caster || !target)
4367
+ return ;
4368
+
4369
+ uint32 triggerSpellId = target->GetCreatureType () == CREATURE_TYPE_DEMON
4370
+ ? SPELL_DH_SHATTERED_SOULS_DEMON
4371
+ : SPELL_DH_SHATTERED_SOULS;
4372
+
4373
+ CastSpellExtraArgs args;
4374
+ args.SetOriginalCaster (caster->GetGUID ());
4375
+ args.AddSpellMod (SPELLVALUE_BASE_POINT0, triggerSpellId);
4376
+
4377
+ caster->CastSpell (caster, SPELL_DH_SHATTERED_SOULS_MISSILE, args);
4378
+ }
4379
+
4380
+ void Register () override
4381
+ {
4382
+ DoCheckProc += AuraCheckProcFn (spell_dh_shattered_souls_havoc_AuraScript::CheckProc);
4383
+ OnEffectProc += AuraEffectProcFn (spell_dh_shattered_souls_havoc_AuraScript::OnProc, EFFECT_0, SPELL_AURA_DUMMY);
4384
+ }
4385
+ };
4386
+
4387
+ AuraScript* GetAuraScript () const override
4388
+ {
4389
+ return new spell_dh_shattered_souls_havoc_AuraScript ();
4390
+ }
4391
+ };
4392
+
4393
+ // Fel Rush Damage - 192611
4394
+ class spell_dh_fel_rush_damage : public SpellScriptLoader
4395
+ {
4396
+ public:
4397
+ spell_dh_fel_rush_damage () : SpellScriptLoader(" spell_dh_fel_rush_damage" ) {}
4398
+
4399
+ class spell_dh_fel_rush_damage_SpellScript : public SpellScript
4400
+ {
4401
+ bool targetHit;
4402
+
4403
+ bool Validate (SpellInfo const * /* spellInfo*/ ) override
4404
+ {
4405
+ if (!sSpellMgr ->GetSpellInfo (SPELL_DH_FEL_MASTERY_FURY, DIFFICULTY_NONE))
4406
+ return false ;
4407
+
4408
+ return true ;
4409
+ }
4410
+
4411
+ void CountTargets (std::list<WorldObject*>& targets)
4412
+ {
4413
+ Unit* caster = GetCaster ();
4414
+ if (!caster)
4415
+ return ;
4416
+
4417
+ targets.clear ();
4418
+ std::list<Unit*> units;
4419
+ caster->GetAttackableUnitListInRange (units, 25 .f );
4420
+ units.remove_if ([caster](Unit* unit)
4421
+ {
4422
+ return !caster->HasInLine (unit, 6 .f , caster->GetObjectScale ());
4423
+ });
4424
+
4425
+ for (Unit* unit : units)
4426
+ targets.push_back (unit);
4427
+
4428
+ targetHit = !targets.empty ();
4429
+ }
4430
+
4431
+ void HandleCast ()
4432
+ {
4433
+ if (Unit* caster = GetCaster ())
4434
+ if (caster->HasAura (SPELL_DH_FEL_MASTERY) && targetHit)
4435
+ caster->CastSpell (caster, SPELL_DH_FEL_MASTERY_FURY, true );
4436
+ }
4437
+
4438
+ void Register () override
4439
+ {
4440
+ OnCast += SpellCastFn (spell_dh_fel_rush_damage_SpellScript::HandleCast);
4441
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn (spell_dh_fel_rush_damage_SpellScript::CountTargets, EFFECT_0, TARGET_UNIT_LINE_CASTER_TO_DEST_ENEMY);
4442
+ }
4443
+ };
4444
+
4445
+ SpellScript* GetSpellScript () const override
4446
+ {
4447
+ return new spell_dh_fel_rush_damage_SpellScript ();
4448
+ }
4449
+ };
4450
+
4451
+ // 204255, 204256 - Soul Fragment
4452
+ // MiscId - 5977, 6007
4453
+ struct at_dh_soul_fragment_havoc : AreaTriggerAI
4454
+ {
4455
+ at_dh_soul_fragment_havoc (AreaTrigger* areatrigger) : AreaTriggerAI(areatrigger) { }
4456
+
4457
+ void OnUnitEnter (Unit* unit) override
4458
+ {
4459
+ Unit* caster = at->GetCaster ();
4460
+ if (!caster || !unit)
4461
+ return ;
4462
+
4463
+ if (caster == unit)
4464
+ {
4465
+ if (caster->GetClass () == CLASS_DEMON_HUNTER && at->GetCaster ()->ToPlayer ()->GetPrimarySpecialization () == ChrSpecialization::DemonHunterHavoc)
4466
+ {
4467
+ caster->CastSpell (caster, SPELL_DH_SOUL_FRAGMENT_HEAL_25_HAVOC, true );
4468
+ }
4469
+ else
4470
+ {
4471
+ caster->CastSpell (caster, SPELL_DH_SOUL_FRAGMENT_HEAL_VENGEANCE, true );
4472
+ }
4473
+
4474
+ if (at->GetTemplate () && at->GetTemplate ()->Id == AreaTriggerId (6007 ))
4475
+ caster->CastSpell (caster, SPELL_DH_SOUL_FRAGMENT_DEMON_BONUS, true );
4476
+
4477
+ if (caster->HasAura (SPELL_DH_FEED_THE_DEMON))
4478
+ {
4479
+ if (SpellInfo const * spellInfo = sSpellMgr ->GetSpellInfo (SPELL_DH_DEMON_SPIKES, DIFFICULTY_NONE))
4480
+ {
4481
+ caster->GetSpellHistory ()->ReduceChargeCooldown (spellInfo->ChargeCategoryId , 1000 );
4482
+ }
4483
+ }
4484
+
4485
+ // Painbringer
4486
+ if (caster->HasAura (SPELL_DH_PAINBRINGER))
4487
+ caster->CastSpell (caster, SPELL_DH_PAINBRINGER_BUFF, true );
4488
+
4489
+ if (Aura* soulBarrier = caster->GetAura (SPELL_DH_SOUL_BARRIER))
4490
+ {
4491
+ if (AuraEffect* soulBarrierEffect = soulBarrier->GetEffect (EFFECT_0))
4492
+ {
4493
+ if (SpellInfo const * spellInfo = sSpellMgr ->AssertSpellInfo (SPELL_DH_SOUL_BARRIER, DIFFICULTY_NONE))
4494
+ {
4495
+ int32 basePoints = 0 ;
4496
+ if (SpellEffectInfo const * effect = &spellInfo->GetEffect (EFFECT_1))
4497
+ {
4498
+ basePoints = effect->BasePoints ;
4499
+ }
4500
+
4501
+ float apCoeff = basePoints / 100 .0f ;
4502
+
4503
+ int32 bonusAmount = static_cast <int32>(caster->GetTotalAttackPowerValue (BASE_ATTACK) * apCoeff);
4504
+
4505
+ int32 currentAmount = soulBarrierEffect->GetAmount ();
4506
+ soulBarrierEffect->SetAmount (currentAmount + bonusAmount);
4507
+ }
4508
+ }
4509
+ }
4510
+
4511
+ at->SetDuration (0 );
4512
+ }
4513
+ }
4514
+ };
4515
+
4516
+
4302
4517
void AddSC_demon_hunter_spell_scripts ()
4303
4518
{
4304
4519
RegisterSpellScript (spell_dh_army_unto_oneself);
@@ -4434,4 +4649,8 @@ void AddSC_demon_hunter_spell_scripts()
4434
4649
new spell_dh_fel_rush_specless ();
4435
4650
RegisterPlayerScript (DH_DisableDoubleJump_OnMount);
4436
4651
new DemonHunterAllowSpec ();
4652
+ new spell_dh_shattered_souls_missile ();
4653
+ new spell_dh_shattered_souls_havoc ();
4654
+ new spell_dh_fel_rush_damage ();
4655
+ RegisterAreaTriggerAI (at_dh_soul_fragment_havoc);
4437
4656
}
0 commit comments