diff options
author | Dr-J <daniel.jarrott0@gmail.com> | 2015-02-14 20:13:32 +0000 |
---|---|---|
committer | Dr-J <daniel.jarrott0@gmail.com> | 2015-02-14 20:13:32 +0000 |
commit | 77bed4c4bb7b31dbaf82d81a91a0714c457e9450 (patch) | |
tree | 01a77c70b5ed648c7cdbdf10a671f2b0fbcdc8e9 /src | |
parent | 11151f447c6a89157fce8d9d53e3d7c83b531818 (diff) |
Remove CPP script for Blueleaf tubers
Diffstat (limited to 'src')
-rw-r--r-- | src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp | 124 |
1 files changed, 0 insertions, 124 deletions
diff --git a/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp b/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp index a7c17a9df3e..f4a7e1f4185 100644 --- a/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp +++ b/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp @@ -136,131 +136,7 @@ public: } }; -enum SnufflenoseGopher -{ - NPC_SNUFFLENOSE_GOPHER = 4781, - GO_BLUELEAF_TUBBER = 20920, - ACTION_FIND_NEW_TUBBER = 0, - POINT_TUBBER = 0 -}; - -struct npc_snufflenose_gopher : public CreatureScript -{ -public: - npc_snufflenose_gopher() : CreatureScript("npc_snufflenose_gopher") { } - - CreatureAI* GetAI(Creature* creature) const override - { - return new npc_snufflenose_gopherAI(creature); - } - - struct npc_snufflenose_gopherAI : public PetAI - { - npc_snufflenose_gopherAI(Creature* creature) : PetAI(creature) - { - IsMovementActive = false; - } - - void Reset() override - { - IsMovementActive = false; - TargetTubberGUID.Clear(); - } - - void MovementInform(uint32 type, uint32 id) override - { - if (type == POINT_MOTION_TYPE && id == POINT_TUBBER) - { - if (GameObject* go = me->GetMap()->GetGameObject(TargetTubberGUID)) - { - go->SetRespawnTime(5 * MINUTE); - go->Refresh(); - go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_INTERACT_COND); - } - - IsMovementActive = false; - } - else - PetAI::MovementInform(type, id); - } - - void DoFindNewTubber() - { - std::list<GameObject*> tubbersInRange; - GetGameObjectListWithEntryInGrid(tubbersInRange, me, GO_BLUELEAF_TUBBER, 40.0f); - - if (tubbersInRange.empty()) - return; - - tubbersInRange.remove_if([](GameObject* go) - { - return go->isSpawned() || !go->HasFlag(GAMEOBJECT_FLAGS, GO_FLAG_INTERACT_COND); - }); - - tubbersInRange.sort(Trinity::ObjectDistanceOrderPred(me)); - - GameObject* nearestTubber = tubbersInRange.front(); - if (!nearestTubber) - return; - - TargetTubberGUID = nearestTubber->GetGUID(); - - // XFurry was wrong... - me->GetMotionMaster()->MovePoint(POINT_TUBBER, nearestTubber->GetPositionX(), - nearestTubber->GetPositionY(), - nearestTubber->GetPositionZ()); - IsMovementActive = true; - } - - void UpdateAI(uint32 diff) override - { - if (!IsMovementActive) - PetAI::UpdateAI(diff); - } - - void DoAction(int32 action) override - { - if (action == ACTION_FIND_NEW_TUBBER) - DoFindNewTubber(); - } - - - bool IsMovementActive; - ObjectGuid TargetTubberGUID; - }; -}; - -class spell_snufflenose_command : public SpellScriptLoader -{ - public: - spell_snufflenose_command() : SpellScriptLoader("spell_snufflenose_command") { } - - class spell_snufflenose_commandSpellScript : public SpellScript - { - PrepareSpellScript(spell_snufflenose_commandSpellScript); - - void HandleEffect(SpellEffIndex /*effIndex*/) - { - if (Creature* target = GetHitCreature()) - if (target->GetEntry() == NPC_SNUFFLENOSE_GOPHER) - target->AI()->DoAction(ACTION_FIND_NEW_TUBBER); - } - - void Register() override - { - OnEffectHitTarget += SpellEffectFn(spell_snufflenose_commandSpellScript::HandleEffect, EFFECT_0, SPELL_EFFECT_DUMMY); - } - }; - - SpellScript* GetSpellScript() const override - { - return new spell_snufflenose_commandSpellScript(); - } -}; - void AddSC_razorfen_kraul() { - new npc_snufflenose_gopher(); new npc_willix(); - new spell_snufflenose_command(); } |