Share Pastebin
Guest
Public paste!

Supabad

By: a guest | Mar 20th, 2010 | Syntax: None | Size: 1.34 KB | Hits: 60 | Expires: Never
Copy text to clipboard
  1. #include "ScriptedPch.h"
  2.  
  3. enum eBloodmaul
  4. {
  5.     NPC_OGRE_BRUTE        = 19995
  6. };
  7.  
  8. struct npc_bloodmaul_brutebaneAI : public ScriptedAI
  9. {
  10.     npc_bloodmaul_brutebaneAI(Creature *c) : ScriptedAI(c) {}
  11.  
  12.     uint64 OgreGUID;
  13.     uint64 PlayerGUID;
  14.  
  15.     Creature* Ogre;
  16.    
  17.     void Reset()
  18.     {
  19.         OgreGUID = 0;
  20.         PlayerGUID = 0;
  21.     }    
  22.  
  23.     void MovementInform(uint32 id, Player* pPlayer)
  24.     {
  25.         pPlayer = Unit::GetPlayer(PlayerGUID);
  26.         if (id == 1)
  27.             pPlayer->KilledMonster(m_creature->GetCreatureInfo(),m_creature->GetGUID());
  28.     }
  29.  
  30.     void UpdateAI(const uint32 uiDiff)
  31.     {        
  32.         Ogre = m_creature->FindNearestCreature(NPC_OGRE_BRUTE, 50, true);
  33.             if (Ogre)
  34.             {
  35.                 Ogre->SetReactState(REACT_DEFENSIVE);
  36.                 Ogre->GetMotionMaster()->MovePoint(1, m_creature->GetPositionX()+1, m_creature->GetPositionY(), m_creature->GetPositionZ());          
  37.             }
  38.     }
  39. };
  40.  
  41. CreatureAI* GetAI_npc_bloodmaul_brutebane(Creature* pCreature)
  42. {
  43.     return new npc_bloodmaul_brutebaneAI (pCreature);
  44. }
  45.  
  46. void AddSC_npc_bloodmaul_brutebane()
  47. {
  48.     Script* newscript;
  49.  
  50.     newscript = new Script;
  51.     newscript->Name = "npc_bloodmaul_brutebane";
  52.     newscript->GetAI = &GetAI_npc_bloodmaul_brutebane;
  53.     newscript->RegisterSelf();
  54. }