aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/base/world_database.sql1
-rw-r--r--sql/updates/10402_world_spell_script_names.sql3
-rwxr-xr-xsrc/server/game/Spells/SpellEffects.cpp6
-rw-r--r--src/server/scripts/Spells/spell_generic.cpp40
4 files changed, 47 insertions, 3 deletions
diff --git a/sql/base/world_database.sql b/sql/base/world_database.sql
index 716b4cfe12e..0819301b499 100644
--- a/sql/base/world_database.sql
+++ b/sql/base/world_database.sql
@@ -26793,6 +26793,7 @@ INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
( 74490, 'spell_creature_permanent_feign_death'),
( 72752, 'spell_pvp_trinket_wotf_shared_cd'),
( 72757, 'spell_pvp_trinket_wotf_shared_cd'),
+( 46221, 'spell_gen_animal_blood'),
-- instances
-- Forge of Souls
( 68793, 'spell_bronjahm_magic_bane'),
diff --git a/sql/updates/10402_world_spell_script_names.sql b/sql/updates/10402_world_spell_script_names.sql
new file mode 100644
index 00000000000..1f70a1d018f
--- /dev/null
+++ b/sql/updates/10402_world_spell_script_names.sql
@@ -0,0 +1,3 @@
+DELETE FROM `spell_script_names` WHERE `spell_id`=46221 AND `ScriptName`='spell_gen_animal_blood';
+INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
+(46221,'spell_gen_animal_blood');
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index 8dddcbf42e9..bc94dd09114 100755
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -6335,7 +6335,7 @@ void Spell::EffectTransmitted(SpellEffIndex effIndex)
}
Map *cMap = m_caster->GetMap();
- if (goinfo->type == GAMEOBJECT_TYPE_FISHINGNODE)
+ if (goinfo->type == GAMEOBJECT_TYPE_FISHINGNODE || goinfo->type == GAMEOBJECT_TYPE_FISHINGHOLE)
{
LiquidData liqData;
if ( !cMap->IsInWater(fx, fy, fz + 1.f/* -0.5f */, &liqData)) // Hack to prevent fishing bobber from failing to land on fishing hole
@@ -6391,8 +6391,8 @@ void Spell::EffectTransmitted(SpellEffIndex effIndex)
{
if (m_caster->GetTypeId() == TYPEID_PLAYER)
{
- pGameObj->AddUniqueUse(m_caster->ToPlayer());
- m_caster->AddGameObject(pGameObj); // will removed at spell cancel
+ pGameObj->AddUniqueUse(m_caster->ToPlayer());
+ m_caster->AddGameObject(pGameObj); // will removed at spell cancel
}
break;
}
diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp
index 0c81e29af75..80bca7e28e8 100644
--- a/src/server/scripts/Spells/spell_generic.cpp
+++ b/src/server/scripts/Spells/spell_generic.cpp
@@ -478,6 +478,45 @@ public:
}
};
+enum AnimalBloodPoolSpell
+{
+ SPELL_SPAWN_BLOOD_POOL = 63471,
+};
+
+class spell_gen_animal_blood : public SpellScriptLoader
+{
+ public:
+ spell_gen_animal_blood() : SpellScriptLoader("spell_gen_animal_blood") { }
+
+ class spell_gen_animal_blood_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_gen_animal_blood_AuraScript);
+
+ bool Validate(SpellEntry const* /*spell*/)
+ {
+ if (!sSpellStore.LookupEntry(SPELL_SPAWN_BLOOD_POOL))
+ return false;
+ return true;
+ }
+
+ void OnRemove(AuraEffect const* /*aurEff*/, AuraApplication const* aurApp, AuraEffectHandleModes /*mode*/)
+ {
+ if (GetUnitOwner()->IsInWater())
+ GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_SPAWN_BLOOD_POOL, true);
+ }
+
+ void Register()
+ {
+ OnEffectRemove += AuraEffectRemoveFn(spell_gen_animal_blood_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_gen_animal_blood_AuraScript();
+ }
+};
+
void AddSC_generic_spell_scripts()
{
new spell_gen_aura_of_anger();
@@ -490,4 +529,5 @@ void AddSC_generic_spell_scripts()
new spell_gen_trick_or_treat();
new spell_creature_permanent_feign_death();
new spell_pvp_trinket_wotf_shared_cd();
+ new spell_gen_animal_blood();
}