aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGacko <gacko28@gmx.de>2014-06-01 19:39:57 +0200
committerGacko <gacko28@gmx.de>2014-06-01 19:39:57 +0200
commit26370223a0b9ab7b9542a6a727347063397f0fa7 (patch)
treef655a79a50b0155aca36e7271e42cc39876a0b35 /src
parent8ef34535a4d8533ed0cc292bf9c53f95adaa4aea (diff)
Script/Shadowmoon Valley: Remove hack in npc_shadowmoon_tuber_node.
This script will be converted to SAI (if possible) later.
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/Outland/zone_shadowmoon_valley.cpp39
1 files changed, 3 insertions, 36 deletions
diff --git a/src/server/scripts/Outland/zone_shadowmoon_valley.cpp b/src/server/scripts/Outland/zone_shadowmoon_valley.cpp
index ba20c7e020b..116beb3d081 100644
--- a/src/server/scripts/Outland/zone_shadowmoon_valley.cpp
+++ b/src/server/scripts/Outland/zone_shadowmoon_valley.cpp
@@ -1867,13 +1867,6 @@ public:
{
npc_shadowmoon_tuber_nodeAI(Creature* creature) : ScriptedAI(creature) { }
- void Reset() override
- {
- tapped = false;
- tuberGUID = 0;
- resetTimer = 60000;
- }
-
void SetData(uint32 id, uint32 data) override
{
if (id == TYPE_BOAR && data == DATA_BOAR)
@@ -1884,49 +1877,23 @@ public:
// Despawn the tuber
if (GameObject* tuber = me->FindNearestGameObject(GO_SHADOWMOON_TUBER_MOUND, 5.0f))
{
- tuberGUID = tuber->GetGUID();
- // @Workaround: find how to properly despawn the GO
- tuber->SetPhaseMask(2, true);
+ tuber->SetLootState(GO_JUST_DEACTIVATED);
+ me->DespawnOrUnsummon();
}
}
}
void SpellHit(Unit* /*caster*/, const SpellInfo* spell) override
{
- if (!tapped && spell->Id == SPELL_WHISTLE)
+ if (spell->Id == SPELL_WHISTLE)
{
if (Creature* boar = me->FindNearestCreature(NPC_BOAR_ENTRY, 30.0f))
{
- // Disable trigger and force nearest boar to walk to him
- tapped = true;
boar->SetWalk(false);
boar->GetMotionMaster()->MovePoint(POINT_TUBER, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ());
}
}
}
-
- void UpdateAI(uint32 diff) override
- {
- if (tapped)
- {
- if (resetTimer <= diff)
- {
- // Respawn the tuber
- if (tuberGUID)
- if (GameObject* tuber = GameObject::GetGameObject(*me, tuberGUID))
- // @Workaround: find how to properly respawn the GO
- tuber->SetPhaseMask(1, true);
-
- Reset();
- }
- else
- resetTimer -= diff;
- }
- }
- private:
- bool tapped;
- uint64 tuberGUID;
- uint32 resetTimer;
};
CreatureAI* GetAI(Creature* creature) const override