Share Pastebin
Guest
Public paste!

xx

By: a guest | Sep 5th, 2010 | Syntax: C++ | Size: 2.30 KB | Hits: 24 | Expires: Never
Copy text to clipboard
  1. /*
  2.  * Copyright (C) 2008-2009 Sun++ Team <http://www.sunscripting.com/>
  3.  * Copyright (C) 2005-2007 Ascent Team <http://www.ascentemu.com/>
  4.  * Copyright (C) 2007-2008 Moon++ Team <http://www.moonplusplus.info/>
  5.  *
  6.  * This program is free software: you can redistribute it and/or modify
  7.  * it under the terms of the GNU General Public License as published by
  8.  * the Free Software Foundation, either version 3 of the License, or
  9.  * any later version.
  10.  *
  11.  * This program is distributed in the hope that it will be useful,
  12.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.  * GNU General Public License for more details.
  15.  *
  16.  * You should have received a copy of the GNU General Public License
  17.  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  18.  */
  19.  
  20. #include "StdAfx.h"
  21.  
  22. //Tehdark Custom Mob by Sybil
  23. //DisplayID is 15613
  24.  
  25. #define CN_TEHDARK ???
  26.  
  27. #define SPELL_CORRUPTION                        47813
  28. #define SPELL_SHADOWFURY                        47847
  29. #define SPELL_CHAOSBOLT                         71108
  30. #define SPELL_SHADOWBOLT                        69387
  31. #define SPELL_AOEFEAR                           65543
  32. #define SPELL_FEAR                                      65809
  33.  
  34. class TehdarkAI : public MoonScriptBossAI
  35. {
  36.         SpellDesc* Shadowfury;
  37.  
  38.         MOONSCRIPT_FACTORY_FUNCTION(TehdarkAI, MoonScriptBossAI)
  39.         TehdarkAI(Creature *pCreature) : MoonScriptBossAI(pCreature)
  40.         {
  41.                 AddPhaseMaskSpell(0x2 | 0x4, AddSpell2(SPELL_CORRUPTION, Target_RandomPlayer, 5000, 3000));
  42.                 Shadowfury = AddPhaseSpell(1, AddSpell2(SPELL_SHADOWFURY, Target_Self)
  43.                 AddPhaseSpell(3, AddSpell2(SPELL_CHAOSBOLT, Target_Current, 7200, 1000));
  44.                 AddPhaseSpell(2, AddSpell2(SPELL_SHADOWBOLT, Target Current, 7200, 1000));
  45.                 AddPhaseMaskSpell(0x2 | 0x4, AddSpell2(SPELL_FEAR, Target_RandomPlayerNotCurrent, 20000, 500));
  46.                 AddSpell(SPELL_AOEFEAR, Target_Self);
  47.  
  48.                 _unit->AddProcTriggerSpell(0, 0, SPELL_AOEFEAR, PROC_ON_PHYSICAL_ATTACK, 35.f NULL);
  49.         }
  50.  
  51.         void OnCombatStart(Unit *pAttacker)
  52.         {
  53.                 ApplyAura(SPELL_AOEFEAR);
  54.         }
  55.  
  56.         void AIUpdate()
  57.         {
  58.                 if(GetHealthPercent() <=50)
  59.                 {
  60.                         SetPhase(3);
  61.                 }
  62.  
  63.                 if(GetPhase() == 1 && GetHealthPercent() <=99)
  64.                 {
  65.                         CastSpellNowNoScheduling(Shadowfury);
  66.                         SetPhase(2);
  67.                 }
  68.  
  69.                 ParentClass::AIUpdate();
  70.         }
  71. };
  72.  
  73. void SetupMaraudon(ScriptMgr * mgr)
  74. {
  75.                 mgr->register_creature_script(CN_TEHDARK, &TehdarkAI::Create);
  76. }