Guest User

Untitled

a guest
Jul 5th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. #include "ScriptPCH.h"
  2.  
  3.  
  4. enum Spells
  5. {
  6. SPELL_DIVINE_SHIELD = 40733
  7.  
  8. };
  9.  
  10. enum Speech
  11. {
  12. SAY_DEFAULT = -1608000,
  13.  
  14. };
  15.  
  16. class test_npc : public CreatureScript
  17. {
  18. public:
  19. test_npc()
  20. : CreatureScript("test_npc") { }
  21.  
  22. struct test_npcAI : public ScriptedAI
  23. {
  24. test_npcAI(Creature *c) : ScriptedAI(c)
  25. {
  26. pInstance = c->GetInstanceScript();
  27. }
  28.  
  29. uint32 m_uiSayTimer;
  30. uint32 m_uiRebuffTimer;
  31.  
  32. void Reset()
  33. {
  34.  
  35. m_uiSayTimer = 10000;
  36. m_uiRebuffTimer = 15000;
  37.  
  38. me->RestoreFaction(); // ???????????????????????????
  39. }
  40.  
  41. void EnterCombat(Unit* /*who*/)
  42. {
  43. DoScriptText(SAY_DEFAULT, me);
  44.  
  45. }
  46.  
  47. void MoveInLineOfSight(Unit* /*who*/) {}
  48.  
  49. void UpdateAI(const uint32 diff)
  50. {
  51.  
  52. //Out of combat timers
  53. if (!me->getVictim())
  54. {
  55. //Rebuff timer
  56. if (m_uiRebuffTimer <= uiDiff)
  57. {
  58. DoCast(me, SPELL_DIVINE_SHIELD);
  59. m_uiRebuffTimer = 15000; //Rebuff agian in 15 sec
  60. }
  61. else
  62. m_uiRebuffTimer -= uiDiff;
  63. }
  64. }
  65.  
  66.  
  67. };
  68.  
  69. };
  70.  
  71.  
  72. void AddSC_test_npc()
  73. {
  74. new test_npc();
  75. }
Advertisement
Add Comment
Please, Sign In to add comment