MichaelCrow

Untitled

Dec 5th, 2018
317
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. #include "ScriptPCH.h"
  2. #include "CreatureAI.h"
  3. #include "ObjectAccessor.h"
  4. #include "Player.h"
  5. #include "ScriptMgr.h"
  6. #include "ScriptedCreature.h"
  7.  
  8. class blackhole_passives : public CreatureScript
  9. {
  10. public:
  11. blackhole_passives() : CreatureScript("blackhole_passives") { }
  12.  
  13. struct blackhole_passivesAI : public ScriptedAI
  14. {
  15. blackhole_passivesAI(Creature * c) : ScriptedAI(c) { }
  16.  
  17. uint32 visual;
  18.  
  19. void Reset()
  20. {
  21.  
  22. me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
  23. me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
  24. me->SetReactState(REACT_PASSIVE);
  25. me->GetMotionMaster()->MoveIdle();
  26. me->AddUnitState(UNIT_STATE_ROOT);
  27. OnSpawn();
  28. visual = 1700;
  29.  
  30. }
  31.  
  32. void OnSpawn()
  33. {
  34. me->CastSpell(me, 90074, false);
  35. }
  36.  
  37. void UpdateAI(const uint32 diff)
  38. {
  39. if (!UpdateVictim())
  40. return;
  41.  
  42. if (visual <= diff)
  43. {
  44. me->CastSpell(me, 62003, false);
  45. }
  46. else
  47. visual -= diff;
  48.  
  49. }
  50.  
  51. };
  52.  
  53. CreatureAI * GetAI(Creature * pCreature) const
  54. {
  55. return new blackhole_passivesAI(pCreature);
  56. }
  57. };
  58.  
  59. void AddSC_blackhole_passives()
  60. {
  61. new blackhole_passives();
  62. }
Advertisement
Add Comment
Please, Sign In to add comment