Script/Quest: Apply Heat and Stir.

Enjoy one of the most frustrating quests in Northrend!
This commit is contained in:
Aokromes committed 2016-10-24 11:15:17 +02:00
1 parent 7835c9bd64
commit d68a119d5d
2 files changed
+164

No files matched your search

@@ -0,0 +1,20 @@
--
DELETE FROM `spell_scripts` WHERE `id`=43375;
DELETE FROM `spell_script_names` WHERE `spell_id` IN (43375, 43376, 43378, 43972);
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(43972, "spell_q11306_mixing_blood"),
(43375, "spell_q11306_mixing_vrykul_blood"),
(43376, "spell_q11306_failed_mix_43376"),
(43378, "spell_q11306_failed_mix_43378");
DELETE FROM creature_text WHERE entry IN (24042, 24251);
INSERT INTO creature_text (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
(24042, 0, 0, "$N's concoction is ruined. A new one must be created from scratch.", 16, 0, 100, 0, 0, 0, 23540, 0, "Generic Trigger LAB"),
(24042, 1, 0, "The failed concoction spills on the floor and appears to come to life!", 16, 0, 100, 0, 0, 0, 23071, 0, "Generic Trigger LAB"),
(24251, 0, 0, "The mixture! It moves!", 14, 0, 100, 0, 0, 0, 23101, 0, "Chief Plaguebringer Harris");
UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=24279;
DELETE FROM `smart_scripts` WHERE `entryorguid`=24279;
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
(24279, 0, 0, 0, 4, 0, 100, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 19, 24251, 0, 0, 0, 0, 0, 0, "Animated Plague Slime - On Aggro - Talk 0 (Chief Plaguebringer Harris) (no repeat)"),
(24279, 0, 1, 0, 0, 0, 100, 0, 0, 0, 10000, 10000, 11, 3335, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, "Animated Plague Slime - In Combat - Cast Dark Sludge");
+144
View File
@@ -2611,6 +2611,146 @@ class spell_q12414_hand_over_reins : public SpellScriptLoader
} }
}; };
enum ApplyHeatAndStir
{
SPELL_SPURTS_AND_SMOKE = 38594,
SPELL_FAILED_MIX_1 = 43376,
SPELL_FAILED_MIX_2 = 43378,
SPELL_FAILED_MIX_3 = 43970,
SPELL_SUCCESSFUL_MIX = 43377,
CREATURE_GENERIC_TRIGGER_LAB = 24042,
TALK_0 = 0,
TALK_1 = 1
};
class spell_q11306_mixing_blood : public SpellScriptLoader
{
public:
spell_q11306_mixing_blood() : SpellScriptLoader("spell_q11306_mixing_blood") { }
class spell_q11306_mixing_blood_SpellScript : public SpellScript
{
PrepareSpellScript(spell_q11306_mixing_blood_SpellScript);
void HandleEffect(SpellEffIndex /*effIndex*/)
{
if (Unit* caster = GetCaster())
if (Creature* trigger = caster->FindNearestCreature(CREATURE_GENERIC_TRIGGER_LAB, 100.0f))
trigger->AI()->DoCastSelf(SPELL_SPURTS_AND_SMOKE);
}
void Register() override
{
OnEffectHit += SpellEffectFn(spell_q11306_mixing_blood_SpellScript::HandleEffect, EFFECT_1, SPELL_EFFECT_SEND_EVENT);
}
};
SpellScript* GetSpellScript() const override
{
return new spell_q11306_mixing_blood_SpellScript();
}
};
class spell_q11306_mixing_vrykul_blood : public SpellScriptLoader
{
public:
spell_q11306_mixing_vrykul_blood() : SpellScriptLoader("spell_q11306_mixing_vrykul_blood") { }
class spell_q11306_mixing_vrykul_blood_SpellScript : public SpellScript
{
PrepareSpellScript(spell_q11306_mixing_vrykul_blood_SpellScript);
void HandleDummy(SpellEffIndex /*effIndex*/)
{
if (Unit* caster = GetCaster())
{
uint8 chance = urand(0, 99);
uint32 spellId = 0;
// 90% chance of getting one out of three failure effects
if (chance < 30)
spellId = SPELL_FAILED_MIX_1;
else if (chance < 60)
spellId = SPELL_FAILED_MIX_2;
else if (chance < 90)
spellId = SPELL_FAILED_MIX_3;
else // 10% chance of successful cast
spellId = SPELL_SUCCESSFUL_MIX;
caster->CastSpell(caster, spellId, true);
}
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_q11306_mixing_vrykul_blood_SpellScript::HandleDummy, EFFECT_1, SPELL_EFFECT_DUMMY);
}
};
SpellScript* GetSpellScript() const override
{
return new spell_q11306_mixing_vrykul_blood_SpellScript();
}
};
class spell_q11306_failed_mix_43376 : public SpellScriptLoader
{
public:
spell_q11306_failed_mix_43376() : SpellScriptLoader("spell_q11306_failed_mix_43376") { }
class spell_q11306_failed_mix_43376_SpellScript : public SpellScript
{
PrepareSpellScript(spell_q11306_failed_mix_43376_SpellScript);
void HandleEffect(SpellEffIndex /*effIndex*/)
{
if (Unit* caster = GetCaster())
if (Creature* trigger = caster->FindNearestCreature(CREATURE_GENERIC_TRIGGER_LAB, 100.0f))
trigger->AI()->Talk(TALK_0, caster);
}
void Register() override
{
OnEffectHit += SpellEffectFn(spell_q11306_failed_mix_43376_SpellScript::HandleEffect, EFFECT_1, SPELL_EFFECT_SEND_EVENT);
}
};
SpellScript* GetSpellScript() const override
{
return new spell_q11306_failed_mix_43376_SpellScript();
}
};
class spell_q11306_failed_mix_43378 : public SpellScriptLoader
{
public:
spell_q11306_failed_mix_43378() : SpellScriptLoader("spell_q11306_failed_mix_43378") { }
class spell_q11306_failed_mix_43378_SpellScript : public SpellScript
{
PrepareSpellScript(spell_q11306_failed_mix_43378_SpellScript);
void HandleEffect(SpellEffIndex /*effIndex*/)
{
if (Unit* caster = GetCaster())
if (Creature* trigger = caster->FindNearestCreature(CREATURE_GENERIC_TRIGGER_LAB, 100.0f))
trigger->AI()->Talk(TALK_1, caster);
}
void Register() override
{
OnEffectHit += SpellEffectFn(spell_q11306_failed_mix_43378_SpellScript::HandleEffect, EFFECT_2, SPELL_EFFECT_SEND_EVENT);
}
};
SpellScript* GetSpellScript() const override
{
return new spell_q11306_failed_mix_43378_SpellScript();
}
};
void AddSC_quest_spell_scripts() void AddSC_quest_spell_scripts()
{ {
new spell_q55_sacred_cleansing(); new spell_q55_sacred_cleansing();
@@ -2675,4 +2815,8 @@ void AddSC_quest_spell_scripts()
new spell_q28813_set_health_random(); new spell_q28813_set_health_random();
new spell_q13665_q13790_bested_trigger(); new spell_q13665_q13790_bested_trigger();
new spell_q12414_hand_over_reins(); new spell_q12414_hand_over_reins();
new spell_q11306_mixing_blood();
new spell_q11306_mixing_vrykul_blood();
new spell_q11306_failed_mix_43376();
new spell_q11306_failed_mix_43378();
} }