Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // 130216 - Magni Bronzebeard
- enum MagniBronzebeard
- {
- CONVERSATION_A_THE_SPEAKERS_PERSPECTIVE = 6617,
- KILLMONSTERCREDIT_A_THE_SPEAKERS_PERSPECTIVE = 130216,
- QUEST_H_THE_SPEAKERS_PERSPECTIVE = 50055,
- QUEST_A_THE_SPEAKERS_PERSPECTIVE = 50049,
- QUEST_A_DYING_WORLD_A = 50364,
- QUEST_A_DYING_WORLD_H = 53028
- };
- struct npc_magni_bronzebeard_silithus : public ScriptedAI
- {
- npc_magni_bronzebeard_silithus(Creature* creature) : ScriptedAI(creature) { }
- void Initialize()
- {
- m_playerGUID = ObjectGuid::Empty;
- }
- void AddPlayer()
- {
- if (!HasPlayer(m_playerGUID))
- pList.insert(m_playerGUID);
- }
- bool HasPlayer(ObjectGuid guid)
- {
- return (pList.find(guid) != pList.end());
- }
- void MoveInLineOfSight(Unit* unit) override
- {
- if (Player* player = unit->GetCharmerOrOwnerPlayerOrPlayerItself())
- {
- if (!unit || !unit->IsInWorld())
- return;
- if (!me->IsWithinDist(unit, 15.0f, false))
- return;
- if (player->HasQuest(QUEST_A_THE_SPEAKERS_PERSPECTIVE) || player->HasQuest(QUEST_H_THE_SPEAKERS_PERSPECTIVE))
- {
- m_playerGUID = player->GetGUID();
- AddPlayer();
- player->KilledMonsterCredit(KILLMONSTERCREDIT_A_THE_SPEAKERS_PERSPECTIVE);
- Conversation::CreateConversation(CONVERSATION_A_THE_SPEAKERS_PERSPECTIVE, player, player->GetPosition(), { player->GetGUID() });
- m_playerGUID = ObjectGuid::Empty;
- }
- else if (player->HasQuest(QUEST_A_DYING_WORLD_A) || player->HasQuest(QUEST_A_DYING_WORLD_H))
- {
- player->GetDistance(me) < 20.0f)
- player->KilledMonsterCredit(me->GetEntry());
- }
- }
- }
- private:
- std::set<ObjectGuid> pList;
- ObjectGuid m_playerGUID;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement