From 5052e39b8c3a9e59c3bed847b887b5bee6c9853c Mon Sep 17 00:00:00 2001 From: click Date: Thu, 23 Jun 2011 18:15:13 +0200 Subject: Core/Spells: Remove now deprecated spellscript for Shroud of Death --- src/server/scripts/Spells/spell_generic.cpp | 36 ----------------------------- 1 file changed, 36 deletions(-) (limited to 'src/server/scripts/Spells') diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index f693c1b249e..2c8ab099ceb 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -623,42 +623,6 @@ class spell_gen_animal_blood : public SpellScriptLoader } }; -class spell_gen_shroud_of_death : public SpellScriptLoader -{ - public: - spell_gen_shroud_of_death() : SpellScriptLoader("spell_gen_shroud_of_death") { } - - class spell_gen_shroud_of_death_AuraScript : public AuraScript - { - PrepareAuraScript(spell_gen_shroud_of_death_AuraScript); - - void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) - { - Unit* target = GetTarget(); - target->m_serverSideVisibility.SetValue(SERVERSIDE_VISIBILITY_GHOST, GHOST_VISIBILITY_GHOST); - target->m_serverSideVisibilityDetect.SetValue(SERVERSIDE_VISIBILITY_GHOST, GHOST_VISIBILITY_GHOST); - } - - void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) - { - Unit* target = GetTarget(); - target->m_serverSideVisibility.SetValue(SERVERSIDE_VISIBILITY_GHOST, GHOST_VISIBILITY_ALIVE); - target->m_serverSideVisibilityDetect.SetValue(SERVERSIDE_VISIBILITY_GHOST, GHOST_VISIBILITY_ALIVE); - } - - void Register() - { - OnEffectApply += AuraEffectApplyFn(spell_gen_shroud_of_death_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); - OnEffectRemove += AuraEffectRemoveFn(spell_gen_shroud_of_death_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); - } - }; - - AuraScript* GetAuraScript() const - { - return new spell_gen_shroud_of_death_AuraScript(); - } -}; - enum DivineStormSpell { SPELL_DIVINE_STORM = 53385, -- cgit v1.2.3 From 713e2df3f76270846ca216646dd2ad36eca3ffbb Mon Sep 17 00:00:00 2001 From: click Date: Thu, 23 Jun 2011 18:41:34 +0200 Subject: Core/Spells: remove the Shroud of Death from the spell-script list as well - thanks Rasmusik for reminding me --- src/server/scripts/Spells/spell_generic.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'src/server/scripts/Spells') diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 2c8ab099ceb..583e199979a 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -1140,7 +1140,6 @@ void AddSC_generic_spell_scripts() new spell_creature_permanent_feign_death(); new spell_pvp_trinket_wotf_shared_cd(); new spell_gen_animal_blood(); - new spell_gen_shroud_of_death(); new spell_gen_divine_storm_cd_reset(); new spell_gen_parachute_ic(); new spell_gen_gunship_portal(); -- cgit v1.2.3 From 3de42791ee0343696586137d385f53bcc46ebd90 Mon Sep 17 00:00:00 2001 From: Shocker Date: Fri, 24 Jun 2011 21:56:37 +0300 Subject: Core/Spells: Partial revert of 5ddf90c5fe8e51a72697, use checkcast hook for disallowing spells to be casted directly Closes #2108 --- sql/scripts/world_scripts_full.sql | 5 ++++ .../2011_06_24_06_world_spell_script_names.sql | 7 +++++ src/server/game/Spells/Spell.cpp | 3 --- src/server/scripts/Spells/spell_generic.cpp | 30 ++++++++++++++++++++++ 4 files changed, 42 insertions(+), 3 deletions(-) create mode 100644 sql/updates/world/2011_06_24_06_world_spell_script_names.sql (limited to 'src/server/scripts/Spells') diff --git a/sql/scripts/world_scripts_full.sql b/sql/scripts/world_scripts_full.sql index 92c5b80d603..c9f3efd4b8e 100644 --- a/sql/scripts/world_scripts_full.sql +++ b/sql/scripts/world_scripts_full.sql @@ -1976,6 +1976,11 @@ INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES ( 25281, 'spell_gen_turkey_marker'), (-55428, 'spell_gen_lifeblood'), ( 65917, 'spell_gen_magic_rooster'), +( 4073, 'spell_gen_allow_cast_from_item_only'), +( 19804, 'spell_gen_allow_cast_from_item_only'), +( 12749, 'spell_gen_allow_cast_from_item_only'), +( 13258, 'spell_gen_allow_cast_from_item_only'), +( 13166, 'spell_gen_allow_cast_from_item_only'), -- instances -- Black Temple ( 41475, 'spell_boss_lady_malande_shield'), diff --git a/sql/updates/world/2011_06_24_06_world_spell_script_names.sql b/sql/updates/world/2011_06_24_06_world_spell_script_names.sql new file mode 100644 index 00000000000..5c7b6e9bfc0 --- /dev/null +++ b/sql/updates/world/2011_06_24_06_world_spell_script_names.sql @@ -0,0 +1,7 @@ +DELETE FROM `spell_script_names` WHERE `spell_id` IN(4073,19804,12749,13258,13166); +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(4073,'spell_gen_allow_cast_from_item_only'), +(19804,'spell_gen_allow_cast_from_item_only'), +(12749,'spell_gen_allow_cast_from_item_only'), +(13258,'spell_gen_allow_cast_from_item_only'), +(13166,'spell_gen_allow_cast_from_item_only'); diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 4357fb4bbc2..118f46cd701 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -4652,9 +4652,6 @@ SpellCastResult Spell::CheckCast(bool strict) if (m_spellInfo->AttributesEx7 & SPELL_ATTR7_IS_CHEAT_SPELL && !m_caster->HasFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_ALLOW_CHEAT_SPELLS)) return SPELL_FAILED_SPELL_UNAVAILABLE; - if (m_castedClientside && m_spellInfo->Attributes & SPELL_ATTR0_HIDDEN_CLIENTSIDE && m_caster->GetTypeId() == TYPEID_PLAYER && !m_CastItem) - return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW; - // Check global cooldown if (strict && !m_IsTriggeredSpell && HasGlobalCooldown()) return SPELL_FAILED_NOT_READY; diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 583e199979a..9de0ffa6f54 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -1125,6 +1125,35 @@ class spell_gen_magic_rooster : public SpellScriptLoader } }; +class spell_gen_allow_cast_from_item_only : public SpellScriptLoader +{ +public: + spell_gen_allow_cast_from_item_only() : SpellScriptLoader("spell_gen_allow_cast_from_item_only") { } + + class spell_gen_allow_cast_from_item_only_SpellScript : public SpellScript + { + PrepareSpellScript(spell_gen_allow_cast_from_item_only_SpellScript); + + SpellCastResult CheckRequirement() + { + if (!GetCastItem()) + return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW; + + return SPELL_CAST_OK; + } + + void Register() + { + OnCheckCast += SpellCheckCastFn(spell_gen_allow_cast_from_item_only_SpellScript::CheckRequirement); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_gen_allow_cast_from_item_only_SpellScript(); + } +}; + void AddSC_generic_spell_scripts() { new spell_gen_absorb0_hitlimit1(); @@ -1151,4 +1180,5 @@ void AddSC_generic_spell_scripts() new spell_gen_turkey_marker(); new spell_gen_lifeblood(); new spell_gen_magic_rooster(); + new spell_gen_allow_cast_by_item_only(); } -- cgit v1.2.3 From 9c70f586e0a30a57c78bd62929b807e8fd222a8a Mon Sep 17 00:00:00 2001 From: Shocker Date: Fri, 24 Jun 2011 22:41:13 +0300 Subject: Core/Misc: Build fix --- src/server/scripts/Spells/spell_generic.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/server/scripts/Spells') diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 9de0ffa6f54..67939a61f23 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -1180,5 +1180,5 @@ void AddSC_generic_spell_scripts() new spell_gen_turkey_marker(); new spell_gen_lifeblood(); new spell_gen_magic_rooster(); - new spell_gen_allow_cast_by_item_only(); + new spell_gen_allow_cast_from_item_only(); } -- cgit v1.2.3