- #include "ScriptedPch.h"
- enum eBloodmaul
- {
- NPC_OGRE_BRUTE = 19995,
- NPC_QUEST_CREDIT = 21241,
- GO_KEG = 184315
- };
- struct npc_bloodmaul_brutebaneAI : public ScriptedAI
- {
- npc_bloodmaul_brutebaneAI(Creature *c) : ScriptedAI(c)
- {
- if(Creature* Ogre = m_creature->FindNearestCreature(NPC_OGRE_BRUTE, 50, true))
- {
- Ogre->SetReactState(REACT_DEFENSIVE);
- Ogre->GetMotionMaster()->MovePoint(1, m_creature->GetPositionX()-1, m_creature->GetPositionY()+1, m_creature->GetPositionZ());
- }
- }
- uint64 OgreGUID;
- void Reset()
- {
- OgreGUID = 0;
- }
- void UpdateAI(const uint32 uiDiff) {}
- };
- CreatureAI* GetAI_npc_bloodmaul_brutebane(Creature* pCreature)
- {
- return new npc_bloodmaul_brutebaneAI (pCreature);
- }
- //Ogre Brute
- struct npc_ogre_bruteAI : public ScriptedAI
- {
- npc_ogre_bruteAI(Creature *c) : ScriptedAI(c) {}
- uint64 PlayerGUID;
- void Reset()
- {
- PlayerGUID = 0;
- }
- void MoveInLineOfSight(Unit *who)
- {
- if (!who || (!who->isAlive())) return;
- if (m_creature->IsWithinDistInMap(who, 50.0f) && (who->GetTypeId() == TYPEID_PLAYER) && CAST_PLR(who)->GetQuestStatus(10512) == QUEST_STATUS_INCOMPLETE)
- {
- PlayerGUID = who->GetGUID();
- }
- }
- void MovementInform(uint32 type, uint32 id)
- {
- Player* pPlayer = Unit::GetPlayer(PlayerGUID);
- if(id == 1)
- {
- GameObject* Keg = m_creature->FindNearestGameObject(GO_KEG, 20);
- if(Keg)
- Keg->Delete();
- m_creature->HandleEmoteCommand(7);
- Creature* Credit = m_creature->FindNearestCreature(NPC_QUEST_CREDIT, 50, true);
- if(pPlayer)
- pPlayer->KilledMonster(Credit->GetCreatureInfo(),Credit->GetGUID());
- }
- }
- void UpdateAI(const uint32 diff)
- {
- if (!UpdateVictim())
- return;
- DoMeleeAttackIfReady();
- }
- };
- CreatureAI* GetAI_npc_ogre_brute(Creature* pCreature)
- {
- return new npc_ogre_bruteAI(pCreature);
- }
- void AddSC_npc_bloodmaul_brutebane()
- {
- Script* newscript;
- newscript = new Script;
- newscript->Name = "npc_bloodmaul_brutebane";
- newscript->GetAI = &GetAI_npc_bloodmaul_brutebane;
- newscript->RegisterSelf();
- newscript = new Script;
- newscript->Name = "npc_ogre_brute";
- newscript->GetAI = &GetAI_npc_ogre_brute;
- newscript->RegisterSelf();
- }
