aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoroffl <11556157+offl@users.noreply.github.com>2022-06-20 20:04:52 +0300
committerShauren <shauren.trinity@gmail.com>2022-09-05 19:01:28 +0200
commitc8d56b8c6741b237ebf6c7f8f023c4b5ebd0d0ca (patch)
tree8acedafbfb11668cb8b4c00adf91030d0dd7d0c7
parenta2e68ccabf1cfda56de44946c1390dbdd1627240 (diff)
Scripts/Quest: Update 'Dissension Amongst the Ranks...' (10769, 10776) (#28044)
(cherry picked from commit ffcc976524e3b1ba99023e40e7fc9cce4d01a2f7)
-rw-r--r--sql/updates/world/master/2022_09_05_10_world_2022_06_20_03_world.sql16
-rw-r--r--src/server/scripts/Outland/zone_shadowmoon_valley.cpp71
2 files changed, 87 insertions, 0 deletions
diff --git a/sql/updates/world/master/2022_09_05_10_world_2022_06_20_03_world.sql b/sql/updates/world/master/2022_09_05_10_world_2022_06_20_03_world.sql
new file mode 100644
index 00000000000..d7263fd974b
--- /dev/null
+++ b/sql/updates/world/master/2022_09_05_10_world_2022_06_20_03_world.sql
@@ -0,0 +1,16 @@
+--
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger` = 38224;
+
+DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_shadowmoon_illidari_agent_illusion','spell_shadowmoon_quest_credit_crazed_colossus');
+INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
+(38224,'spell_shadowmoon_illidari_agent_illusion'),
+(38223,'spell_shadowmoon_quest_credit_crazed_colossus');
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 22 AND `SourceEntry` = 19823 AND `SourceId` = 0;
+
+DELETE FROM `smart_scripts` WHERE `entryorguid` = 19823 AND `source_type` = 0;
+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
+(19823,0,0,0,2,0,100,1,0,75,0,0,0,11,37947,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Crazed Colossus - Between 0-75% Health - Cast 'Summon Crazed Shardling' (No Repeat)"),
+(19823,0,1,0,2,0,100,1,0,50,0,0,0,11,37948,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Crazed Colossus - Between 0-50% Health - Cast 'Summon Crazed Shardling' (No Repeat)"),
+(19823,0,2,0,2,0,100,1,0,25,0,0,0,11,37949,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Crazed Colossus - Between 0-25% Health - Cast 'Summon Crazed Shardling' (No Repeat)"),
+(19823,0,3,0,6,0,100,0,0,0,0,0,0,11,38223,2,0,0,0,0,7,0,0,0,0,0,0,0,0,"Crazed Colossus - On Death - Cast 'Quest Credit: Crazed Colossus'");
diff --git a/src/server/scripts/Outland/zone_shadowmoon_valley.cpp b/src/server/scripts/Outland/zone_shadowmoon_valley.cpp
index 5b13b473208..a5dd73a2f37 100644
--- a/src/server/scripts/Outland/zone_shadowmoon_valley.cpp
+++ b/src/server/scripts/Outland/zone_shadowmoon_valley.cpp
@@ -1592,6 +1592,75 @@ public:
}
};
+/*######
+## Quest 10769, 10776: Dissension Amongst the Ranks...
+######*/
+
+enum DissensionAmongstTheRanks
+{
+ SPELL_ILLIDARI_DISGUISE_MALE = 38225,
+ SPELL_ILLIDARI_DISGUISE_FEMALE = 38227,
+ SPELL_KILL_CREDIT_CRAZED_COLOSSUS = 38228
+};
+
+// 38224 - Illidari Agent Illusion
+class spell_shadowmoon_illidari_agent_illusion : public AuraScript
+{
+ PrepareAuraScript(spell_shadowmoon_illidari_agent_illusion);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ return ValidateSpellInfo({ SPELL_ILLIDARI_DISGUISE_MALE, SPELL_ILLIDARI_DISGUISE_FEMALE });
+ }
+
+ void AfterApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ if (Player* target = GetTarget()->ToPlayer())
+ target->CastSpell(target, target->GetNativeGender() == GENDER_MALE ?
+ SPELL_ILLIDARI_DISGUISE_MALE : SPELL_ILLIDARI_DISGUISE_FEMALE);
+ }
+
+ void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ Unit* target = GetTarget();
+ target->RemoveAurasDueToSpell(SPELL_ILLIDARI_DISGUISE_MALE);
+ target->RemoveAurasDueToSpell(SPELL_ILLIDARI_DISGUISE_FEMALE);
+ }
+
+ void Register() override
+ {
+ AfterEffectApply += AuraEffectApplyFn(spell_shadowmoon_illidari_agent_illusion::AfterApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
+ AfterEffectRemove += AuraEffectApplyFn(spell_shadowmoon_illidari_agent_illusion::AfterRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
+ }
+};
+
+// 38223 - Quest Credit: Crazed Colossus
+class spell_shadowmoon_quest_credit_crazed_colossus : public SpellScript
+{
+ PrepareSpellScript(spell_shadowmoon_quest_credit_crazed_colossus);
+
+ bool Validate(SpellInfo const* spellInfo) override
+ {
+ return ValidateSpellInfo(
+ {
+ uint32(spellInfo->GetEffect(EFFECT_0).CalcValue()),
+ SPELL_KILL_CREDIT_CRAZED_COLOSSUS
+ });
+ }
+
+ void HandleScript(SpellEffIndex /*effIndex*/)
+ {
+ Unit* target = GetHitUnit();
+ if (target->HasAura(uint32(GetEffectValue())))
+ target->CastSpell(target, SPELL_KILL_CREDIT_CRAZED_COLOSSUS);
+ }
+
+ void Register() override
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_shadowmoon_quest_credit_crazed_colossus::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+};
+
void AddSC_shadowmoon_valley()
{
new npc_invis_infernal_caster();
@@ -1606,4 +1675,6 @@ void AddSC_shadowmoon_valley()
new npc_enraged_spirit();
new spell_unlocking_zuluheds_chains();
new npc_shadowmoon_tuber_node();
+ RegisterSpellScript(spell_shadowmoon_illidari_agent_illusion);
+ RegisterSpellScript(spell_shadowmoon_quest_credit_crazed_colossus);
}