Share Pastebin
Guest
Public paste!

xx

By: a guest | Sep 5th, 2010 | Syntax: C++ | Size: 2.08 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. //Allie script. By Sybil.
  23. //DisplayID is -
  24.  
  25. #define CN_ALLIE ?
  26.  
  27. #define SPELL_MIND_SEAR                         60440 //800 Dmg a second.
  28. #define SPELL_SHIELD                            68033 //Absorbs 16k.
  29. #define SPELL_PAIN                                      68090 //7000 - 8000 damage every 3 sec.
  30. #define SPELL_PLAGUE                            56444 //Reduces stam and has a chance to jump.
  31. #define SPELL_HEAL_SELF                         68023 //Heals self for 40k ish.
  32. #define SPELL_HEAL_ALLY                         68025 //Heals ally for 95k ish.
  33.  
  34. class AllieAI : public MoonScriptBossAI
  35. {
  36.         MOONSCRIPT_FACTORY_FUNCTION(AllieAI, MoonScriptBossAI)
  37.         AllieAI(Creature *pCreature) : MoonScriptBossAI(pCreature)
  38.  
  39.         SpellDesc* Heal;
  40.  
  41.         {
  42.                 AddSpell2(SPELL_MIND_SEAR, Target_Current, 11000, 5000);
  43.                 AddSpell2(SPELL_SHIELD, Target_Friendly, 25000, 5000);
  44.                 AddSpell2(SPELL_PAIN, Target_RandomPlayer, 6000, 10000);
  45.                 AddSpell2(SPELL_PLAGUE, Target_Current, 10000, 10000);
  46.                 Heal = AddSpell(SPELL_HEAL_SELF, Target_Self);
  47.                 AddSpell2(SPELL_HEAL_ALLY, Target_Friendly, 13000, 4000);
  48.         }
  49.  
  50.         void AIUpdate()
  51.         {
  52.                 if(GetHealthPercent <=30)
  53.                 {
  54.                         CastSpellNowNoScheduling(Heal);
  55.                         Heal->mEnabled = false;
  56.                 }
  57.                
  58.                 ParentClass::AIUpdate();
  59.         }
  60. };
  61.  
  62. void SetupMaraudon(ScriptMgr * mgr)
  63. {
  64.                 mgr->register_creature_script(CN_ALLIE, &AllieAI::Create);
  65. }