Supabad
By: a guest | Mar 20th, 2010 | Syntax:
None | Size: 1.34 KB | Hits: 60 | Expires: Never
#include "ScriptedPch.h"
enum eBloodmaul
{
NPC_OGRE_BRUTE = 19995
};
struct npc_bloodmaul_brutebaneAI : public ScriptedAI
{
npc_bloodmaul_brutebaneAI(Creature *c) : ScriptedAI(c) {}
uint64 OgreGUID;
uint64 PlayerGUID;
Creature* Ogre;
void Reset()
{
OgreGUID = 0;
PlayerGUID = 0;
}
void MovementInform(uint32 id, Player* pPlayer)
{
pPlayer = Unit::GetPlayer(PlayerGUID);
if (id == 1)
pPlayer->KilledMonster(m_creature->GetCreatureInfo(),m_creature->GetGUID());
}
void UpdateAI(const uint32 uiDiff)
{
Ogre = m_creature->FindNearestCreature(NPC_OGRE_BRUTE, 50, true);
if (Ogre)
{
Ogre->SetReactState(REACT_DEFENSIVE);
Ogre->GetMotionMaster()->MovePoint(1, m_creature->GetPositionX()+1, m_creature->GetPositionY(), m_creature->GetPositionZ());
}
}
};
CreatureAI* GetAI_npc_bloodmaul_brutebane(Creature* pCreature)
{
return new npc_bloodmaul_brutebaneAI (pCreature);
}
void AddSC_npc_bloodmaul_brutebane()
{
Script* newscript;
newscript = new Script;
newscript->Name = "npc_bloodmaul_brutebane";
newscript->GetAI = &GetAI_npc_bloodmaul_brutebane;
newscript->RegisterSelf();
}