aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoroffl <11556157+offl@users.noreply.github.com>2022-07-03 23:24:16 +0300
committerShauren <shauren.trinity@gmail.com>2022-09-05 19:49:45 +0200
commita01141c426be517c1d2bd40753b277b453d15ce0 (patch)
tree5eb7982b89d7b5fae0dce2a123c7bb94a2161779 /src
parentefae1a28ef5b82dce9dbb39dcb75ea932a293e1a (diff)
Scripts/Events: Update few Love is in the Air quests & items (#28084)
(cherry picked from commit b339fbaaf3832a468acdc35d5dfa2f7024b67ff0)
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/Events/love_is_in_the_air.cpp205
-rw-r--r--src/server/scripts/Spells/spell_generic.cpp47
2 files changed, 204 insertions, 48 deletions
diff --git a/src/server/scripts/Events/love_is_in_the_air.cpp b/src/server/scripts/Events/love_is_in_the_air.cpp
index da14388823c..52809092f92 100644
--- a/src/server/scripts/Events/love_is_in_the_air.cpp
+++ b/src/server/scripts/Events/love_is_in_the_air.cpp
@@ -105,6 +105,10 @@ class spell_love_is_in_the_air_romantic_picnic : public AuraScript
}
};
+/*######
+## Item 21813: Bag of Heart Candies
+######*/
+
enum CreateHeartCandy
{
SPELL_CREATE_HEART_CANDY_1 = 26668,
@@ -135,7 +139,7 @@ class spell_love_is_in_the_air_create_heart_candy : public SpellScript
void HandleScript(SpellEffIndex /*effIndex*/)
{
- GetCaster()->CastSpell(GetCaster(), Trinity::Containers::SelectRandomContainerElement(CreateHeartCandySpells), true);
+ GetCaster()->CastSpell(GetCaster(), Trinity::Containers::SelectRandomContainerElement(CreateHeartCandySpells));
}
void Register() override
@@ -144,8 +148,207 @@ class spell_love_is_in_the_air_create_heart_candy : public SpellScript
}
};
+/*######
+## Quest 24536, 24655: Something Stinks
+######*/
+
+enum SomethingStinks
+{
+ SPELL_HEAVILY_PERFUMED = 71507
+};
+
+// 70192 - Fragrant Air Analysis
+class spell_love_is_in_the_air_fragrant_air_analysis : public SpellScript
+{
+ PrepareSpellScript(spell_love_is_in_the_air_fragrant_air_analysis);
+
+ bool Validate(SpellInfo const* spellInfo) override
+ {
+ return ValidateSpellInfo({ uint32(spellInfo->GetEffect(EFFECT_0).CalcValue()) });
+ }
+
+ void HandleScript(SpellEffIndex /*effIndex*/)
+ {
+ GetHitUnit()->RemoveAurasDueToSpell(uint32(GetEffectValue()));
+ }
+
+ void Register() override
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_love_is_in_the_air_fragrant_air_analysis::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+};
+
+// 71507 - Heavily Perfumed
+class spell_love_is_in_the_air_heavily_perfumed : public AuraScript
+{
+ PrepareAuraScript(spell_love_is_in_the_air_heavily_perfumed);
+
+ bool Validate(SpellInfo const* spellInfo) override
+ {
+ return ValidateSpellInfo({ uint32(spellInfo->GetEffect(EFFECT_0).CalcValue()) });
+ }
+
+ void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ GetTarget()->CastSpell(GetTarget(), uint32(GetEffectInfo(EFFECT_0).CalcValue()));
+ }
+
+ void Register() override
+ {
+ AfterEffectRemove += AuraEffectRemoveFn(spell_love_is_in_the_air_heavily_perfumed::AfterRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
+ }
+};
+
+// 71508 - Recently Analyzed
+class spell_love_is_in_the_air_recently_analyzed : public AuraScript
+{
+ PrepareAuraScript(spell_love_is_in_the_air_recently_analyzed);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ return ValidateSpellInfo({ SPELL_HEAVILY_PERFUMED });
+ }
+
+ void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ GetTarget()->CastSpell(GetTarget(), SPELL_HEAVILY_PERFUMED);
+ }
+
+ void Register() override
+ {
+ AfterEffectRemove += AuraEffectRemoveFn(spell_love_is_in_the_air_recently_analyzed::AfterRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
+ }
+};
+
+/*######
+## Quest 24629, 24635, 24636: A Perfect Puff of Perfume & A Cloudlet of Classy Cologne & Bonbon Blitz
+######*/
+
+// 69438 - Sample Satisfaction
+class spell_love_is_in_the_air_sample_satisfaction : public AuraScript
+{
+ PrepareAuraScript(spell_love_is_in_the_air_sample_satisfaction);
+
+ void OnPeriodic(AuraEffect const* /*aurEff*/)
+ {
+ if (roll_chance_i(30))
+ Remove();
+ }
+
+ void Register() override
+ {
+ OnEffectPeriodic += AuraEffectPeriodicFn(spell_love_is_in_the_air_sample_satisfaction::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
+ }
+};
+
+/*######
+## Quest 24541, 24656: Pilfering Perfume
+######*/
+
+enum PilferingPerfume
+{
+ SPELL_SERVICE_UNIFORM = 71450,
+
+ MODEL_GOBLIN_MALE = 31002,
+ MODEL_GOBLIN_FEMALE = 31003
+};
+
+// 71450 - Crown Parcel Service Uniform
+class spell_love_is_in_the_air_service_uniform : public AuraScript
+{
+ PrepareAuraScript(spell_love_is_in_the_air_service_uniform);
+
+ bool Validate(SpellInfo const* spellInfo) override
+ {
+ return ValidateSpellInfo({ uint32(spellInfo->GetEffect(EFFECT_0).CalcValue()) });
+ }
+
+ void AfterApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ Unit* target = GetTarget();
+ if (target->GetTypeId() == TYPEID_PLAYER)
+ {
+ if (target->GetNativeGender() == GENDER_MALE)
+ target->SetDisplayId(MODEL_GOBLIN_MALE);
+ else
+ target->SetDisplayId(MODEL_GOBLIN_FEMALE);
+ }
+ }
+
+ void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ GetTarget()->RemoveAurasDueToSpell(uint32(GetEffectInfo(EFFECT_0).CalcValue()));
+ }
+
+ void Register() override
+ {
+ AfterEffectApply += AuraEffectRemoveFn(spell_love_is_in_the_air_service_uniform::AfterApply, EFFECT_0, SPELL_AURA_TRANSFORM, AURA_EFFECT_HANDLE_REAL);
+ AfterEffectRemove += AuraEffectRemoveFn(spell_love_is_in_the_air_service_uniform::AfterRemove, EFFECT_0, SPELL_AURA_TRANSFORM, AURA_EFFECT_HANDLE_REAL);
+ }
+};
+
+// 71522 - Crown Chemical Co. Supplies
+// 71539 - Crown Chemical Co. Supplies
+class spell_love_is_in_the_air_cancel_service_uniform : public SpellScript
+{
+ PrepareSpellScript(spell_love_is_in_the_air_cancel_service_uniform);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ return ValidateSpellInfo({ SPELL_SERVICE_UNIFORM });
+ }
+
+ void HandleScript(SpellEffIndex /*effIndex*/)
+ {
+ GetHitUnit()->RemoveAurasDueToSpell(SPELL_SERVICE_UNIFORM);
+ }
+
+ void Register() override
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_love_is_in_the_air_cancel_service_uniform::HandleScript, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+};
+
+/*######
+## Item 49351, 49352: Perfume Neutralizer & Cologne Neutralizer
+######*/
+
+// 68529 - Perfume Immune
+// 68530 - Cologne Immune
+class spell_love_is_in_the_air_perfume_cologne_immune : public SpellScript
+{
+ PrepareSpellScript(spell_love_is_in_the_air_perfume_cologne_immune);
+
+ bool Validate(SpellInfo const* spellInfo) override
+ {
+ return ValidateSpellInfo(
+ {
+ uint32(spellInfo->GetEffect(EFFECT_0).CalcValue()),
+ uint32(spellInfo->GetEffect(EFFECT_1).CalcValue())
+ });
+ }
+
+ void HandleScript(SpellEffIndex /*effIndex*/)
+ {
+ GetCaster()->RemoveAurasDueToSpell(uint32(GetEffectValue()));
+ }
+
+ void Register() override
+ {
+ OnEffectHit += SpellEffectFn(spell_love_is_in_the_air_perfume_cologne_immune::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ OnEffectHit += SpellEffectFn(spell_love_is_in_the_air_perfume_cologne_immune::HandleScript, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+};
+
void AddSC_event_love_is_in_the_air()
{
RegisterSpellScript(spell_love_is_in_the_air_romantic_picnic);
RegisterSpellScript(spell_love_is_in_the_air_create_heart_candy);
+ RegisterSpellScript(spell_love_is_in_the_air_fragrant_air_analysis);
+ RegisterSpellScript(spell_love_is_in_the_air_heavily_perfumed);
+ RegisterSpellScript(spell_love_is_in_the_air_recently_analyzed);
+ RegisterSpellScript(spell_love_is_in_the_air_sample_satisfaction);
+ RegisterSpellScript(spell_love_is_in_the_air_service_uniform);
+ RegisterSpellScript(spell_love_is_in_the_air_cancel_service_uniform);
+ RegisterSpellScript(spell_love_is_in_the_air_perfume_cologne_immune);
}
diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp
index ed0d1706650..d280d8b50ab 100644
--- a/src/server/scripts/Spells/spell_generic.cpp
+++ b/src/server/scripts/Spells/spell_generic.cpp
@@ -353,52 +353,6 @@ class spell_gen_aura_of_fear : public AuraScript
}
};
-enum ServiceUniform
-{
- // Spells
- SPELL_SERVICE_UNIFORM = 71450,
-
- // Models
- MODEL_GOBLIN_MALE = 31002,
- MODEL_GOBLIN_FEMALE = 31003
-};
-
-class spell_gen_aura_service_uniform : public AuraScript
-{
- PrepareAuraScript(spell_gen_aura_service_uniform);
-
- bool Validate(SpellInfo const* /*spellInfo*/) override
- {
- return ValidateSpellInfo({ SPELL_SERVICE_UNIFORM });
- }
-
- void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
- {
- // Apply model goblin
- Unit* target = GetTarget();
- if (target->GetTypeId() == TYPEID_PLAYER)
- {
- if (target->GetNativeGender() == GENDER_MALE)
- target->SetDisplayId(MODEL_GOBLIN_MALE);
- else
- target->SetDisplayId(MODEL_GOBLIN_FEMALE);
- }
- }
-
- void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
- {
- Unit* target = GetTarget();
- if (target->GetTypeId() == TYPEID_PLAYER)
- target->RestoreDisplayId();
- }
-
- void Register() override
- {
- AfterEffectApply += AuraEffectRemoveFn(spell_gen_aura_service_uniform::OnApply, EFFECT_0, SPELL_AURA_TRANSFORM, AURA_EFFECT_HANDLE_REAL);
- AfterEffectRemove += AuraEffectRemoveFn(spell_gen_aura_service_uniform::OnRemove, EFFECT_0, SPELL_AURA_TRANSFORM, AURA_EFFECT_HANDLE_REAL);
- }
-};
-
class spell_gen_av_drekthar_presence : public AuraScript
{
PrepareAuraScript(spell_gen_av_drekthar_presence);
@@ -5007,7 +4961,6 @@ void AddSC_generic_spell_scripts()
RegisterSpellScript(spell_spawn_blood_pool);
RegisterSpellScript(spell_gen_arena_drink);
RegisterSpellScript(spell_gen_aura_of_fear);
- RegisterSpellScript(spell_gen_aura_service_uniform);
RegisterSpellScript(spell_gen_av_drekthar_presence);
RegisterSpellScript(spell_gen_bandage);
RegisterSpellScript(spell_gen_battleground_mercenary_shapeshift);