Advertisement
Guest User

Untitled

a guest
Aug 18th, 2011
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.10 KB | None | 0 0
  1. enum queldelarSpells
  2. {
  3. Bladestorm = 67541,
  4. Heroic_Strike = 29426,
  5. Mortal_Strike = 16856,
  6. Whirlind = 67716
  7. };
  8.  
  9. class npc_queldelar : public CreatureScript
  10. {
  11. public:
  12. npc_queldelar() : CreatureScript("npc_queldelar") { }
  13.  
  14. CreatureAI* GetAI(Creature* creature) const
  15. {
  16. return new npc_queldelarAI(creature);
  17. }
  18. struct npc_queldelarAI : public ScriptedAI
  19. {
  20. uint32 Bladestorm;
  21. uint32 Heroic_Strike;
  22. uint32 Mortal_Strike;
  23. uint32 Whirlind;
  24. bool summoned;
  25.  
  26. void Reset()
  27. {
  28. Bladestorm = 10000;
  29. Heroic_Strike = 5000;
  30. Mortal_Strike = 7000;
  31. Whirlind = 13000;
  32. bool summoned = false;
  33. me->SetVisible(false);
  34. me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE);
  35. }
  36.  
  37. npc_queldelarAI(Creature *c) : ScriptedAI(c)
  38. {
  39. }
  40.  
  41. void MoveInLineOfSight(Unit* who)
  42. {
  43. if (!who)
  44. return;
  45. if (me->IsWithinDistInMap(who, 20) && who->HasAura(SPELL_QUELDELAR_AURA) && (summoned==false))
  46. {
  47. me->SetVisible(true);
  48. me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE);
  49. summoned==true;
  50. }
  51. }
  52.  
  53. void UpdateAI(const uint32 uiDiff)
  54. {
  55.  
  56.  
  57. if (!UpdateVictim())
  58. return;
  59.  
  60. if (Bladestorm <= uiDiff)
  61. {
  62. DoCast(me->getVictim(), Bladestorm);
  63. Bladestorm = 10000;
  64. } else Bladestorm -= uiDiff;
  65.  
  66. if (Heroic_Strike <= uiDiff)
  67. {
  68. DoCast(me->getVictim(), Heroic_Strike);
  69. Heroic_Strike = 5000;
  70. } else Heroic_Strike -= uiDiff;
  71.  
  72. if (Mortal_Strike <= uiDiff)
  73. {
  74. DoCast(me->getVictim(), Mortal_Strike);
  75. Mortal_Strike = 7000;
  76. } else Mortal_Strike -= uiDiff;
  77.  
  78. if (Whirlind <= uiDiff)
  79. {
  80. DoCast(me->getVictim(), Whirlind);
  81. Whirlind = 13000;
  82. } else Whirlind -= uiDiff;
  83.  
  84. DoMeleeAttackIfReady();
  85. }
  86. };
  87. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement