aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShauren <none@none>2010-11-10 11:37:41 +0100
committerShauren <none@none>2010-11-10 11:37:41 +0100
commitcc220ca7b6550b9f86643b9e6c082475e5d904ae (patch)
treef9b6c7ecb33f4c797a1ced063fa1fc44de5eafe0 /src
parent03e4ecfbfd57367ea015fdef9fc978fbeafff84e (diff)
Scripts/Spells: Added script for Animal Blood pool spawning (fixes fishing daily quest "Blood is Thicker")
--HG-- branch : trunk
Diffstat (limited to 'src')
-rwxr-xr-xsrc/server/game/Spells/SpellEffects.cpp6
-rw-r--r--src/server/scripts/Spells/spell_generic.cpp40
2 files changed, 43 insertions, 3 deletions
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();
}