Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "ScriptPCH.h"
- #include "CreatureAI.h"
- #include "ObjectAccessor.h"
- #include "Player.h"
- #include "ScriptMgr.h"
- #include "ScriptedCreature.h"
- class blackhole_passives : public CreatureScript
- {
- public:
- blackhole_passives() : CreatureScript("blackhole_passives") { }
- struct blackhole_passivesAI : public ScriptedAI
- {
- blackhole_passivesAI(Creature * c) : ScriptedAI(c) { }
- uint32 visual;
- void Reset()
- {
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- me->SetReactState(REACT_PASSIVE);
- me->GetMotionMaster()->MoveIdle();
- me->AddUnitState(UNIT_STATE_ROOT);
- OnSpawn();
- visual = 1700;
- }
- void OnSpawn()
- {
- me->CastSpell(me, 90074, false);
- }
- void UpdateAI(const uint32 diff)
- {
- if (!UpdateVictim())
- return;
- if (visual <= diff)
- {
- me->CastSpell(me, 62003, false);
- }
- else
- visual -= diff;
- }
- };
- CreatureAI * GetAI(Creature * pCreature) const
- {
- return new blackhole_passivesAI(pCreature);
- }
- };
- void AddSC_blackhole_passives()
- {
- new blackhole_passives();
- }
Advertisement
Add Comment
Please, Sign In to add comment