aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGooyeth <migmadmu@hotmail.com>2014-12-28 17:03:33 +0000
committerNayd <dnpd.dd@gmail.com>2014-12-28 17:07:00 +0000
commita26b0f2c76e70f5d695819bb89c4ec605049513d (patch)
treedf3058dc67162fe89f82f4fcc1fd0ce6afa94262
parent8fec200670e89003773b9bea4e0e90b3b5c3028c (diff)
Scripts/Quests: Fix Red Snapper - Very Tasty! GOb
Fix 'School of Red Snapper' now disappear correctly when using 'Draenei Fishing Net', the bug is caused because the GameObject is SpellFocus type. Fix #1673 Closes #13748 (cherry picked from commit b0b7a55bdba20aad5b7914c55933daa70afe59ba)
-rw-r--r--src/server/game/Spells/SpellMgr.cpp3
-rw-r--r--src/server/scripts/Spells/spell_quest.cpp28
2 files changed, 28 insertions, 3 deletions
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp
index 544abc9ca87..0c82730f5a1 100644
--- a/src/server/game/Spells/SpellMgr.cpp
+++ b/src/server/game/Spells/SpellMgr.cpp
@@ -3661,6 +3661,9 @@ void SpellMgr::LoadSpellInfoCorrections()
break;
// ENDOF ISLE OF CONQUEST SPELLS
//
+ case 29866: // Cast Fishing Net
+ spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(140); // 6yd
+ break;
default:
break;
}
diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp
index e9cf81f2e64..434a8f75693 100644
--- a/src/server/scripts/Spells/spell_quest.cpp
+++ b/src/server/scripts/Spells/spell_quest.cpp
@@ -1076,9 +1076,12 @@ class spell_q14112_14145_chum_the_water: public SpellScriptLoader
// http://old01.wowhead.com/quest=9452 - Red Snapper - Very Tasty!
enum RedSnapperVeryTasty
{
- SPELL_CAST_NET = 29866,
- ITEM_RED_SNAPPER = 23614,
- SPELL_NEW_SUMMON_TEST = 49214,
+ ITEM_RED_SNAPPER = 23614,
+
+ SPELL_CAST_NET = 29866,
+ SPELL_NEW_SUMMON_TEST = 49214,
+
+ GO_SCHOOL_OF_RED_SNAPPER = 181616
};
class spell_q9452_cast_net: public SpellScriptLoader
@@ -1095,6 +1098,15 @@ class spell_q9452_cast_net: public SpellScriptLoader
return GetCaster()->GetTypeId() == TYPEID_PLAYER;
}
+ SpellCastResult CheckCast()
+ {
+ GameObject* go = GetCaster()->FindNearestGameObject(GO_SCHOOL_OF_RED_SNAPPER, 3.0f);
+ if (!go || go->GetRespawnTime())
+ return SPELL_FAILED_REQUIRES_SPELL_FOCUS;
+
+ return SPELL_CAST_OK;
+ }
+
void HandleDummy(SpellEffIndex /*effIndex*/)
{
Player* caster = GetCaster()->ToPlayer();
@@ -1104,9 +1116,19 @@ class spell_q9452_cast_net: public SpellScriptLoader
caster->CastSpell(caster, SPELL_NEW_SUMMON_TEST, true);
}
+ void HandleActiveObject(SpellEffIndex effIndex)
+ {
+ PreventHitDefaultEffect(effIndex);
+ GetHitGObj()->SetRespawnTime(roll_chance_i(50) ? 2 * MINUTE : 3 * MINUTE);
+ GetHitGObj()->Use(GetCaster());
+ GetHitGObj()->SetLootState(GO_JUST_DEACTIVATED);
+ }
+
void Register() override
{
+ OnCheckCast += SpellCheckCastFn(spell_q9452_cast_net_SpellScript::CheckCast);
OnEffectHit += SpellEffectFn(spell_q9452_cast_net_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ OnEffectHitTarget += SpellEffectFn(spell_q9452_cast_net_SpellScript::HandleActiveObject, EFFECT_1, SPELL_EFFECT_ACTIVATE_OBJECT);
}
};