Advertisement
Guest User

Untitled

a guest
Sep 20th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.13 KB | None | 0 0
  1. // Script Generated: 29/06/2011 19:41:15
  2. // Run this query on your world database
  3. // UPDATE `creature_template` SET ScriptName='npc_boss_curator' WHERE `entry`=77000;
  4. #include "ScriptedPch.h"
  5.  
  6.  
  7. struct boss_curatorAI : public ScriptedAI
  8. {
  9. boss_curatorAI(Creature *c) : ScriptedAI(c)
  10. {
  11. SetCombatMovement(false);
  12. }
  13.  
  14. uint32 spell1_phase1_Timer;
  15. uint32 spell1_phase2_Timer;
  16. uint32 phase1_Percent;
  17. uint32 phase2_Percent;
  18. uint32 phase;
  19.  
  20. bool enraged;
  21.  
  22. void EnterCombat(Unit *who)
  23. {
  24. }
  25.  
  26. void KilledUnit(Unit* victim)
  27. {
  28. }
  29.  
  30. void JustDied(Unit* Killer)
  31. {
  32. }
  33.  
  34. void Reset()
  35. {
  36. spell1_phase1_Timer = 10000+rand()%5000;
  37. spell1_phase2_Timer = 10000+rand()%5000;
  38. phase1_Percent = 100;
  39. phase2_Percent = 90;
  40. phase = 0;
  41. enraged = false;
  42. }
  43.  
  44. void UpdateAI(const uint32 diff)
  45. {
  46. if (!UpdateVictim())
  47. return;
  48.  
  49. if ((m_creature->GetHealth() * 100 / m_creature->GetMaxHealth() <= 40) && !enraged)
  50. {
  51. enraged = true;
  52. DoCast(m_creature->getVictim(), 61714);
  53. m_creature->MonsterYell("hahaha", LANG_UNIVERSAL, NULL);
  54. }
  55.  
  56. if ((m_creature->GetHealth() * 100 / m_creature->GetMaxHealth() <= 100) && phase == 0)
  57. {
  58. phase = 1;
  59. m_creature->MonsterTextEmote("100", NULL, false);
  60. }
  61.  
  62. if ((m_creature->GetHealth() * 100 / m_creature->GetMaxHealth() <= 90) && phase == 1)
  63. {
  64. phase = 2;
  65. m_creature->MonsterYell("90", LANG_UNIVERSAL, NULL);
  66. }
  67.  
  68. if (phase == 1)
  69. {
  70.  
  71. if (spell1_phase1_Timer <= diff)
  72. {
  73. DoCast(m_creature->getVictim(), 62632);
  74. spell1_phase1_Timer = 10000+rand()%5000;
  75. } else spell1_phase1_Timer -= diff;
  76. }
  77.  
  78. if (phase == 2)
  79. {
  80.  
  81. if (spell1_phase2_Timer <= diff)
  82. {
  83. DoCast(m_creature->getVictim(), 7441);
  84. spell1_phase2_Timer = 10000+rand()%5000;
  85. } else spell1_phase2_Timer -= diff;
  86. }
  87.  
  88. DoMeleeAttackIfReady();
  89. }
  90. };
  91.  
  92. CreatureAI* GetAIboss_curator(Creature* pCreature)
  93. {
  94. return new boss_curatorAI (pCreature);
  95. }
  96.  
  97. void AddSC_boss_curator()
  98. {
  99. Script *newscript;
  100. newscript = new Script;
  101. newscript->Name = "npc_boss_curator";
  102. newscript->GetAI = &GetAIboss_curator;
  103. newscript->RegisterSelf();
  104. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement