aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts
diff options
context:
space:
mode:
authorariel- <ariel-@users.noreply.github.com>2016-09-04 12:06:10 +0200
committerjoschiwald <joschiwald.trinity@gmail.com>2017-02-26 15:30:07 +0100
commit0afe0e536d2be8b51a4bd8f21993190cd40f0b37 (patch)
treef3d278b01310585f97ecc76578a1d47540564516 /src/server/scripts
parenta33bc3148a8b8570672096dfe4974ed7af94b011 (diff)
Core/Scripts: Implement Flag of Ownership. Closes #12265
Core/Spells: Implemented TARGET_CORPSE_SRC_AREA_ENEMY. Closes #12803 (cherry picked from commit bc4b4f656cda98be06c03301f22750804fea8fa0)
Diffstat (limited to 'src/server/scripts')
-rw-r--r--src/server/scripts/Spells/spell_item.cpp60
1 files changed, 60 insertions, 0 deletions
diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp
index 88ed028ad73..4e699034780 100644
--- a/src/server/scripts/Spells/spell_item.cpp
+++ b/src/server/scripts/Spells/spell_item.cpp
@@ -3137,6 +3137,65 @@ public:
}
};
+enum TauntFlag
+{
+ SPELL_TAUNT_FLAG = 51657,
+
+ EMOTE_PLANTS_FLAG = 28008
+};
+
+// 51640 - Taunt Flag Targeting
+class spell_item_taunt_flag_targeting : public SpellScriptLoader
+{
+ public:
+ spell_item_taunt_flag_targeting() : SpellScriptLoader("spell_item_taunt_flag_targeting") { }
+
+ class spell_item_taunt_flag_targeting_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_item_taunt_flag_targeting_SpellScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_TAUNT_FLAG))
+ return false;
+ if (!sBroadcastTextStore.LookupEntry(EMOTE_PLANTS_FLAG))
+ return false;
+ return true;
+ }
+
+ void FilterTargets(std::list<WorldObject*>& targets)
+ {
+ if (targets.empty())
+ {
+ FinishCast(SPELL_FAILED_NO_VALID_TARGETS);
+ return;
+ }
+
+ Trinity::Containers::RandomResizeList(targets, 1);
+ }
+
+ void HandleDummy(SpellEffIndex /*effIndex*/)
+ {
+ // we *really* want the unit implementation here
+ // it sends a packet like seen on sniff
+ GetCaster()->Unit::TextEmote(EMOTE_PLANTS_FLAG, GetHitUnit(), false);
+
+ GetCaster()->CastSpell(GetHitUnit(), SPELL_TAUNT_FLAG, true);
+ }
+
+ void Register() override
+ {
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_item_taunt_flag_targeting_SpellScript::FilterTargets, EFFECT_0, TARGET_CORPSE_SRC_AREA_ENEMY);
+ OnEffectHitTarget += SpellEffectFn(spell_item_taunt_flag_targeting_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const override
+ {
+ return new spell_item_taunt_flag_targeting_SpellScript();
+ }
+};
+
class spell_item_artifical_stamina : public SpellScriptLoader
{
public:
@@ -3524,6 +3583,7 @@ void AddSC_item_spell_scripts()
new spell_item_trinket_stack("spell_item_toc25_heroic_caster_trinket", SPELL_TOC25_CASTER_TRINKET_HEROIC_STACK, SPELL_TOC25_CASTER_TRINKET_HEROIC_TRIGGER);
new spell_item_darkmoon_card_greatness();
new spell_item_mana_drain();
+ new spell_item_taunt_flag_targeting();
new spell_item_artifical_stamina();
new spell_item_artifical_damage();
new spell_item_talisman_of_ascendance();