Advertisement
Guest User

Tranced.cpp

a guest
Feb 1st, 2012
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.09 KB | None | 0 0
  1. #include "StdAfx.h"
  2. #include "Setup.h"
  3. #include "../Common/Base.h"
  4.  
  5. #ifdef WIN32
  6. #pragma warning(disable:4305)
  7. #endif
  8.  
  9. #define TRANCED 810017
  10.  
  11. #define BOMB 91563
  12. #define PYROBLAST 101809
  13. #define FIREBALL 69583
  14. #define AE 33273
  15.  
  16. class TRANCEDBOSSAI : public MoonScriptBossAI
  17. {
  18. public:
  19. MOONSCRIPT_FACTORY_FUNCTION(TRANCEDBOSSAI, MoonScriptBossAI);
  20. TRANCEDBOSSAI(Creature* pCreature) : MoonScriptBossAI(pCreature)
  21. {
  22. BOMB = AddSpell(BOMB, Target_Current, 20, 0, 10); //spell number, target of spell, percent chance to occur, cast time, cooldown
  23. PYROBLAST = AddSpell(PYROBLAST, Target_CURRENT, 40, 6, 10);
  24.  
  25. AddPhaseSpell(2, AddSpell(FIREBALL, Target_Current, 20, 3, 7));
  26.  
  27. AddPhaseSpell(3, AddSpell(AE, TARGET_DESTINATION, 30, 0, 6));
  28.  
  29. AddEmote(Event_OnCombatStart, "Fools! You know not with what you intefere!", Text_Yell, 10292);
  30. AddEmote(Event_OnTargetDied, "You may win today, but my superiors will avenge me tomorrow!", Text_Yell, 10297);
  31. }
  32. }
  33.  
  34. void OnCombatStart(Unit *pTarget) //sets up phase 1
  35.  
  36. {
  37. if (BOMB != NULL)
  38. {
  39. BOMB->mChance = 20.0f;
  40. BOMB->mCooldown = 10;
  41. BOMB->mEnabled = true;
  42. }
  43. if (PYROBLAST != NULL)
  44. {
  45. PYROBLAST->mChance = 40.0f;
  46. PYROBLAST->mCooldown = 10;
  47. PYROBLAST->mEnabled = true;
  48. }
  49. ParentClass::OnCombatStart(pTarget);
  50. }
  51.  
  52. void OnCombatStop(Unit* pTarget)
  53. {
  54. if(GetHealthPercent() >= 1)
  55. {
  56. sEventMgr.AddEvent(TO_UNIT(GetUnit()), &Unit::SendChatMessage (uint8)CHAT_MSG_MONSTER_YELL, (uint32)LANG_UNIVERSAL, "Long live Silent Requiem!", EVENT_UNIT_CHAT_MSG, 2000, 1, EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT);
  57. sEventMgr.AddEvent(TO_OBJECT(GetUnit()), &Object::PlaySoundToSet, (uint32)10293, EVENT_UNK, 2000, 1, EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT);
  58. GetUnit()->SetHealthPct(100);
  59. }
  60. ParentClass::OnCombatStop(pTarget);
  61. }
  62.  
  63. void AIUpdate()
  64.  
  65. {
  66. if(GetHealthPercent() <= 95 && GetPhase() == 1)
  67. {
  68. SetPhase(2);
  69. if (PYROBLAST != NULL)
  70. {
  71. PYROBLAST->mEnabled = false;
  72. PYROBLAST->mChance = 20.0f;
  73. }
  74. if (FIREBALL != NULL)
  75. {
  76. FIREBALL->mChance = 20.0f;
  77. FIREBALL->mEnabled = false;
  78. }
  79. }
  80.  
  81. if(GetHealthPercent() <= 65 && GetPhase() == 2)
  82. {
  83. Emote("Your days are done!", Text_Yell, 10298);
  84. SetPhase(3);
  85. if (BOMB != NULL)
  86. {
  87. BOMB->mEnabled = false;
  88. }
  89.  
  90. if (AE != NULL)
  91. {
  92. AE->mEnabled = true;
  93. AE->mChance = 30.0f;
  94. }
  95. }
  96.  
  97. ParentClass::AIUpdate();
  98. }
  99.  
  100. void SetupStratInstance(ScriptMgr * mgr)
  101. {
  102. mgr->register_creature_script(TRANCED, &TRANCEDBOSSAI::Create);
  103. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement