Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From 7b31ff39481e47517efdfaedde29603ad22c2ddd Mon Sep 17 00:00:00 2001
- From: unknown <cristi@cristis-PC.(none)>
- Date: Fri, 27 Jul 2012 01:57:34 +0300
- Subject: [PATCH] Fix quest Lost in Deeps
- ---
- src/server/scripts/Maelstrom/deepholm.cpp | 97 +++++++++++++++++++++++++++++
- 1 file changed, 97 insertions(+)
- diff --git a/src/server/scripts/Maelstrom/deepholm.cpp b/src/server/scripts/Maelstrom/deepholm.cpp
- index f87ae1c..9957d20 100644
- --- a/src/server/scripts/Maelstrom/deepholm.cpp
- +++ b/src/server/scripts/Maelstrom/deepholm.cpp
- @@ -1511,6 +1511,102 @@ public:
- }
- };
- +/*####
- +## Support for quest Lot in the Deeps
- +##########*/
- +
- +enum eLostInTheDeeps
- +{
- + QUEST_LOST_IN_THE_DEEPS = 26710,
- + NPC_FOLLOWER_PEBBLE = 49956,
- + SPELL_BIG_BLUE_ARROW_MARK = 87864,
- + NPC_CRUMBLING_DEPTHS_ENTRANCE_01 = 44282
- +};
- +
- +#define PEBBLE_FOLLOWER_GOSSIP "Let's get out of here. Follow me!"
- +
- +class npc_pebble_follower : public CreatureScript
- +{
- + public:
- + npc_pebble_follower() : CreatureScript("npc_pebble_follower") { }
- +
- + bool OnGossipHello(Player* player, Creature* creature)
- + {
- + if(player->GetQuestStatus(QUEST_LOST_IN_THE_DEEPS)==QUEST_STATUS_INCOMPLETE)
- + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, PEBBLE_FOLLOWER_GOSSIP, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- +
- + player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
- + return true;
- + }
- +
- + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
- + {
- + player->PlayerTalkClass->ClearMenus();
- + player->CLOSE_GOSSIP_MENU();
- +
- + if (npc_pebble_follower::npc_pebble_followerAI* pPebble = CAST_AI(npc_pebble_follower::npc_pebble_followerAI, creature->AI()))
- + pPebble->StartFollow(player);
- +
- + return true;
- + }
- +
- + struct npc_pebble_followerAI : public FollowerAI
- + {
- + npc_pebble_followerAI(Creature* creature) : FollowerAI(creature) { }
- +
- + void Reset()
- + {
- + me->SetFlag(UNIT_NPC_FLAGS,UNIT_NPC_FLAG_GOSSIP);
- + me->CastSpell(me,SPELL_BIG_BLUE_ARROW_MARK);
- + }
- + void MoveInLineOfSight(Unit* who)
- + {
- + FollowerAI::MoveInLineOfSight(who);
- +
- + if (!me->getVictim() && !HasFollowState(STATE_FOLLOW_COMPLETE) && who->GetEntry() == NPC_CRUMBLING_DEPTHS_ENTRANCE_01)
- + {
- + if (me->IsWithinDistInMap(who, 25.0f))
- + {
- + DoComplete();
- + }
- + }
- + }
- +
- + void DoComplete()
- + {
- + if (Player* player = GetLeaderForFollower())
- + {
- + if (player->GetQuestStatus(QUEST_LOST_IN_THE_DEEPS) == QUEST_STATUS_INCOMPLETE)
- + player->KilledMonsterCredit(NPC_FOLLOWER_PEBBLE,0);
- + }
- +
- + SetFollowComplete();
- + }
- +
- + void UpdateFollowerAI(const uint32 uiDiff)
- + {
- + if(Player* player = GetLeaderForFollower())
- + {
- + if(me->GetDistance(player) > 75.0f)
- + {
- + me->DespawnOrUnsummon();
- + return;
- + }
- + }
- +
- + if (!UpdateVictim())
- + return;
- +
- + DoMeleeAttackIfReady();
- + }
- + };
- +
- + CreatureAI* GetAI(Creature* creature) const
- + {
- + return new npc_pebble_followerAI(creature);
- + }
- +};
- +
- void AddSC_deepholm()
- {
- new npc_lodestone();
- @@ -1538,4 +1634,5 @@ void AddSC_deepholm()
- new spell_earthen_ring_proclamation();
- new npc_ricket_ticker();
- new npc_earthen_ring_shaman();
- + new npc_pebble_follower();
- }
- --
- 1.7.10.msysgit.1
Advertisement
Add Comment
Please, Sign In to add comment