aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/updates/world/master/2022_03_13_01_world_2021_08_19_01_world.sql22
-rw-r--r--src/server/scripts/Northrend/AzjolNerub/Ahnkahet/ahnkahet.h6
-rw-r--r--src/server/scripts/Northrend/AzjolNerub/Ahnkahet/instance_ahnkahet.cpp39
3 files changed, 67 insertions, 0 deletions
diff --git a/sql/updates/world/master/2022_03_13_01_world_2021_08_19_01_world.sql b/sql/updates/world/master/2022_03_13_01_world_2021_08_19_01_world.sql
new file mode 100644
index 00000000000..59aca88d849
--- /dev/null
+++ b/sql/updates/world/master/2022_03_13_01_world_2021_08_19_01_world.sql
@@ -0,0 +1,22 @@
+ -- Ahn'kahar Spell Flinger
+SET @ENTRY := 30278;
+DELETE FROM `smart_scripts` WHERE `entryOrGuid` = @ENTRY AND `source_type` = 0;
+UPDATE `creature_template` SET `AIName` = "SmartAI", `ScriptName` = "" WHERE `entry` = @ENTRY;
+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`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(@ENTRY, 0, 0, 0, 0, 0, 100, 2, 1000, 2000, 23000, 27000, 11, 56698, 64, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, "Every 23 - 27 seconds (1 - 2s initially) - Self: Cast spell Shadow Blast (56698) on Victim (flags: combat move) (Normal)"),
+(@ENTRY, 0, 2, 0, 0, 0, 100, 4, 1000, 2000, 23000, 27000, 11, 59102, 64, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, "Every 23 - 27 seconds (1 - 2s initially) - Self: Cast spell Shadow Blast (56698) on Victim (flags: combat move) (Heroic)"),
+(@ENTRY, 0, 1, 0, 0, 0, 100, 2, 5000, 8000, 13000, 16000, 11, 56702, 64, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Every 13 - 16 seconds (5 - 8s initially) - Self: Cast spell Shadow Sickle (56702) on Self (flags: combat move) (Normal)"),
+(@ENTRY, 0, 3, 0, 0, 0, 100, 4, 5000, 8000, 13000, 16000, 11, 59103, 64, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Every 13 - 16 seconds (5 - 8s initially) - Self: Cast spell Shadow Sickle (56702) on Self (flags: combat move) (Heroic)");
+
+DELETE FROM `spell_script_names` WHERE `spell_id` IN (56698, 59102, 56702, 59103);
+INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
+-- (56698, 'spell_shadow_blast'),
+-- (59102, 'spell_shadow_blast'),
+(56702, 'spell_shadow_sickle'),
+(59103, 'spell_shadow_sickle');
+
+-- DELETE FROM `spelldifficulty_dbc` WHERE `id` IN (56698, 56701, 56702);
+-- INSERT INTO `spelldifficulty_dbc` (`id`, `spellid0`, `spellid1`) VALUES
+-- (56698, 56698, 59102),
+-- (56701, 56701, 59104),
+-- (56702, 56702, 59103);
diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/ahnkahet.h b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/ahnkahet.h
index e0b70b3fa36..830975a8fcd 100644
--- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/ahnkahet.h
+++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/ahnkahet.h
@@ -78,6 +78,12 @@ enum AKGameObjectIds
GO_SPHERE_2 = 193094
};
+enum AKSpellIds
+{
+ SPELL_SHADOW_SICKLE_TRIGGERED = 56701,
+ SPELL_SHADOW_SICKLE_TRIGGERED_H = 59104,
+};
+
template <class AI, class T>
inline AI* GetAhnKahetAI(T* obj)
{
diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/instance_ahnkahet.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/instance_ahnkahet.cpp
index 2a31175bb65..a3347456a9d 100644
--- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/instance_ahnkahet.cpp
+++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/instance_ahnkahet.cpp
@@ -170,6 +170,45 @@ class spell_combined_toxins : public AuraScript
}
};
+// 56702, 59103 - Shadow Sickle
+class spell_shadow_sickle : public AuraScript
+{
+ PrepareAuraScript(spell_shadow_sickle);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ return ValidateSpellInfo({ SPELL_SHADOW_SICKLE_TRIGGERED, SPELL_SHADOW_SICKLE_TRIGGERED_H });
+ }
+
+ void HandlePeriodic(AuraEffect const* aurEff)
+ {
+ Unit* owner = GetUnitOwner();
+
+ uint32 spellId = 0;
+
+ switch (GetId())
+ {
+ case 56702:
+ spellId = SPELL_SHADOW_SICKLE_TRIGGERED;
+ break;
+ case 59103:
+ spellId = SPELL_SHADOW_SICKLE_TRIGGERED_H;
+ break;
+ default:
+ return;
+ }
+
+ if (owner->IsAIEnabled())
+ if (Unit* target = owner->GetAI()->SelectTarget(SelectTargetMethod::Random, 0, 40.f))
+ owner->CastSpell(target, spellId, CastSpellExtraArgs(aurEff).SetTriggerFlags(TriggerCastFlags::TRIGGERED_FULL_MASK));
+ }
+
+ void Register() override
+ {
+ OnEffectPeriodic += AuraEffectPeriodicFn(spell_shadow_sickle::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
+ }
+};
+
void AddSC_instance_ahnkahet()
{
new instance_ahnkahet();