Jump to content
  • Announcements

    • Xmat

      Pravidlo pro postování v TTT

      Do sekce Tipy, triky, tutoriály nepatří žádné dotazy.   Postujte sem vaše návody, tipy a různé další věci jež uznáte za vhodné sdělit zdejšímu osazenstvu, ale veškeré dotazy směřujte do sekce Všeobecná diskuse.
    • Replik

      Seznam návodů a důležitých témat v této sekci

      Pro lepší přehlednost jsem vytvořil tento seznam, který vás, méně zkušené, lépe provede touto sekcí. Věřím, že zde najdete, co hledáte. Vypsané jsou návody, které jsou oficiálně uznané jako návody. Běžné diskuze, které neposkytují postupy a rady zvěřejněny nejsou.   Instalace vlastního MaNGOS Serveru Díky těmto návodům budete (měli by jste být) schopni vytvořit a následně spustit váš vlastní server. Nastavení je pro verze s i bez datadisku.   Instalace MaNGOS Serveru (bez datadisku TBC) - Autor Benny Instalace MaNGOS Serveru (s datadiskem TBC) - Autor Malfik Instalace MaNGOS Serveru v prostředí Linux - Autor charlie Instalace MaNGOS Serveru v prostředí Linux - Autor kupkoid   Chyby a jejich řešení při přihlašování k serveru - Autor Cybe   Zálohování uživatelských dat   Dávkový soubor (BAT soubor) pro vytvoření SQL záloh - Autor Replik   Kompilování - tvoření vlastních release (revizí)   Tvorba kompilací pro Win32 (MangoScript) - Autor bLuma   Ostatní - těžko zařaditelné, ale neznamená to, že nejsou dobré   VIP Systém - Autor charlie Tvorba Webových stránek pro MaNGOS - Autor zahuba Tvorba teleportačních NPC (MangoScript) - Autor Replik Registrační web (původně předělaná SPORA) Funkční pro Antrix i MaNGOS - Autor Replik Nastavení a spuštění Minimanager pro MaNGOS - Autor BlackMartin Nastavení MaNGOS Website - Autor Artorius   Samozřejmě jsou zde i jiné návody, ale tyto jsou nejvíce používané, proto věřím, že vám budou nápomocné. Tuto sekci budeme upravovat podle potřeby. Pokud by jste něco nenašli nebo si nevěděli rady, hledejte na fóru a teprve potom založte vlastní topik. Pokud nějaký autor vytvoří kvalitní návod a chtěl by ho zveřejnit i v tomto seznamu, doporučuji, aby mi napsal zprávu skrze PM.   Díky a přeji hezký den na WoWResource   Replik
    • Aristo

      Příspěvky tam, kde nemají co dělat

      Dodržujte zákaz přispívání do topiků s repaky pokud si to zakladatelé nepřejí!! Opakované psaní příspěvků bude trestáno warnem.
    • Aristo

      Používání spoilerů

      Poslední dobou má většina uživatelů fora zvláštní nutkání postovat extrémně dlouhé texty nebo kódy, které zabírají v nejedenom případu i 80% obsahu celé stránky a hodně tak zvedají nepřehlednost v topiku. Chtěl bych všechny uživatele požádat, aby při postování citací, jakýchkoliv kódů, errorů, atp... delších než 30 řádků používali funkci spoileru.   Funkci vyvoláte příkazem [spoiler] text [/spoiler]   Ukázka:  
Sign in to follow this  
Zachy

[Release] Black Temple (trash mobs)

Recommended Posts

BLACK TEMPLE \\\\ TRASH MOBS


PART 1.
//Trash mobs
// Aqueous_Lord

#define Aqueous_Lord 22878
//spells
#define Vile_Slime 40099 

class AqueousLordAI : public CreatureAIScript
{
protected:
  SP_AI_Spell spells[1];
  int nrspells;
public:
  ADD_CREATURE_FACTORY_FUNCTION(AqueousLordAI);

AqueousLordAI(Creature* pCreature) : CreatureAIScript(pCreature)
{
  nrspells = 1;

  spells[0].info = dbcSpell.LookupEntry(Vile_Slime);
  spells[0].targettype = TARGET_RANDOM_SINGLE;
  spells[0].cooldown = 8;
  spells[0].perctrigger = 20.0f;



}

void OnCombatStart(Unit* mTarget)
{
  for(int i=0;i<nrspells;i++)  spells[i].Timer = 0;
  RegisterAIUpdateEvent(1000);
}


  void OnTargetDied(Unit* mTarget)
{
}

void OnCombatStop(Unit *mTarget)
{
	RemoveAIUpdateEvent();
}

void OnDied(Unit * mKiller)
{
  RemoveAIUpdateEvent();
}

void AIUpdate()
  {
  SpellCastVal(spells,_unit,0,nrspells);
}

};

// Aqueous_Spawn

#define Aqueous_Spawn 22883
//spells
#define Sludge_Nova 40102

class AqueousSpawnAI : public CreatureAIScript
{
protected:
  SP_AI_Spell spells[1];
  int nrspells;
public:
  ADD_CREATURE_FACTORY_FUNCTION(AqueousSpawnAI);

AqueousSpawnAI(Creature* pCreature) : CreatureAIScript(pCreature)
{
  nrspells = 1;

  spells[0].info = dbcSpell.LookupEntry(Sludge_Nova);
  spells[0].targettype = TARGET_RANDOM_SINGLE;
  spells[0].maxdist2cast = 30.0f;
  spells[0].instant = false;
  spells[0].cooldown = 5;
  spells[0].perctrigger = 30.0f;



}

void OnCombatStart(Unit* mTarget)
{
  for(int i=0;i<nrspells;i++)  spells[i].Timer = 0;
  RegisterAIUpdateEvent(1000);
}


  void OnTargetDied(Unit* mTarget)
{
}

void OnCombatStop(Unit *mTarget)
{
	RemoveAIUpdateEvent();
}

void OnDied(Unit * mKiller)
{
  _unit->Despawn(30000,0);
  RemoveAIUpdateEvent();
}

void AIUpdate()
  {
  SpellCastVal(spells,_unit,0,nrspells);
}

};

// Bonechewer Worker

#define Bonechewer_Worker 22963
//spells
#define BW_Throw_Pick 40844

class BonechewerWorkerAI : public CreatureAIScript
{
protected:
  SP_AI_Spell spells[1];
  int nrspells;
public:
  ADD_CREATURE_FACTORY_FUNCTION(BonechewerWorkerAI);

BonechewerWorkerAI(Creature* pCreature) : CreatureAIScript(pCreature)
{
  nrspells = 1;

  spells[0].info = dbcSpell.LookupEntry(BW_Throw_Pick);
  spells[0].targettype = TARGET_RANDOM_SINGLE;
  spells[0].maxdist2cast = 35.0f;
  spells[0].instant = false;
  spells[0].cooldown = 11;
  spells[0].perctrigger = 20.0f;


}

void OnCombatStart(Unit* mTarget)
{
  for(int i=0;i<nrspells;i++)  spells[i].Timer = 0;
  RegisterAIUpdateEvent(1000);
}


  void OnTargetDied(Unit* mTarget)
{
}

void OnCombatStop(Unit *mTarget)
{
	RemoveAIUpdateEvent();
}

void OnDied(Unit * mKiller)
{
  RemoveAIUpdateEvent();
}

void AIUpdate()
  {
  SpellCastVal(spells,_unit,0,nrspells);
}

};

// Coilskar Harpooner

#define Coilskar_Harpooner 22874 
//spells
#define CH_Spear_Throw 31772
#define CH_Hooked_Net 36827 

class CoilskarHarpoonerAI : public CreatureAIScript
{
protected:
  SP_AI_Spell spells[2];
  int nrspells;
public:
  ADD_CREATURE_FACTORY_FUNCTION(CoilskarHarpoonerAI);

CoilskarHarpoonerAI(Creature* pCreature) : CreatureAIScript(pCreature)
{
  nrspells = 2;

  spells[0].info = dbcSpell.LookupEntry(CH_Spear_Throw);
  spells[0].targettype = TARGET_RANDOM_SINGLE;
  spells[0].maxdist2cast = 40.0f;
  spells[0].mindist2cast = 8.0f;
  spells[0].instant = false;
  spells[0].cooldown = 14;
  spells[0].perctrigger = 20.0f;

  spells[1].info = dbcSpell.LookupEntry(CH_Hooked_Net);
  spells[1].targettype = TARGET_RANDOM_SINGLE;
  spells[1].maxdist2cast = 30.0f;
  spells[1].instant = false;
  spells[1].cooldown = 8;
  spells[1].perctrigger = 20.0f;


}

void OnCombatStart(Unit* mTarget)
{
  for(int i=0;i<nrspells;i++)  spells[i].Timer = 0;
  RegisterAIUpdateEvent(1000);
}


  void OnTargetDied(Unit* mTarget)
{
}

void OnCombatStop(Unit *mTarget)
{
	RemoveAIUpdateEvent();
}

void OnDied(Unit * mKiller)
{
  RemoveAIUpdateEvent();
}

void AIUpdate()
  {
  SpellCastVal(spells,_unit,0,nrspells);
}

};

//Coilskar Soothsayer

#define Coilskar_Soothsayer 22876
//spells
#define CS_Holy_Nova 37669

class CoilskarSoothsayerAI : public CreatureAIScript
{
protected:
  SP_AI_Spell spells[1];
  int nrspells;
public:
  ADD_CREATURE_FACTORY_FUNCTION(CoilskarSoothsayerAI);

CoilskarSoothsayerAI(Creature* pCreature) : CreatureAIScript(pCreature)
{
  nrspells = 1;

  spells[0].info = dbcSpell.LookupEntry(CS_Holy_Nova);
  spells[0].targettype = TARGET_SELF;
  spells[0].cooldown = 11;
  spells[0].perctrigger = 20.0f;


}

void OnCombatStart(Unit* mTarget)
{
  for(int i=0;i<nrspells;i++)  spells[i].Timer = 0;
  RegisterAIUpdateEvent(1000);
}


  void OnTargetDied(Unit* mTarget)
{
}

void OnCombatStop(Unit *mTarget)
{
	RemoveAIUpdateEvent();
}

void OnDied(Unit * mKiller)
{
  RemoveAIUpdateEvent();
}

void AIUpdate()
  {
  SpellCastVal(spells,_unit,0,nrspells);
}

};

#define Dragon_Turtle	  22885
//Spells
#define DT_Water_Spit	  35008

class DragonTurtleAI : public CreatureAIScript
{protected:
  int nrspells;
  SP_AI_Spell spells[1];
public:
  ADD_CREATURE_FACTORY_FUNCTION(DragonTurtleAI);
  DragonTurtleAI(Creature* pCreature) : CreatureAIScript(pCreature)
  {
  nrspells = 1;

  spells[0].info = dbcSpell.LookupEntry(DT_Water_Spit);
  spells[0].targettype =TARGET_VARIOUS;
  spells[0].instant = false;
  spells[0].cooldown = 12;
  spells[0].perctrigger = 20.0f;

  }
  void OnCombatStart(Unit* mTarget)
  {
  for(int i=0;i<nrspells;i++)  spells[i].Timer = 0;
  RegisterAIUpdateEvent(1000);
  }
  void OnCombatStop(Unit *mTarget)
  {
  RemoveAIUpdateEvent();
  }
  void OnDied(Unit * mKiller)
  {
  RemoveAIUpdateEvent();
  }
  void AIUpdate()
  {
  SpellCastVal(spells,_unit,0,nrspells);
  }
};

//mobs gener.

//--------------------------------------------------------------------------------------Ashtongue_Battlelord
#define CN_Ashtongue_Battlelord	  22844
//Spells
#define SPELL_Cleave	  15284
#define SPELL_Concussion_Blow	  32588
#define SPELL_Concussive_Throw	  41182
#define SPELL_Enrage_AB	  34970

class AshtongueBattlelordAI : public CreatureAIScript
{protected:
  int nrspells;
  SP_AI_Spell spells[4];
  bool enrage;
public:
  ADD_CREATURE_FACTORY_FUNCTION(AshtongueBattlelordAI);
  AshtongueBattlelordAI(Creature* pCreature) : CreatureAIScript(pCreature)
  {
  nrspells = 4;

  spells[0].info = dbcSpell.LookupEntry(SPELL_Cleave);
  spells[0].targettype =TARGET_ATTACKING;
  spells[0].cooldown = 12;
  spells[0].perctrigger = 20.0f;

  spells[1].info = dbcSpell.LookupEntry(SPELL_Concussion_Blow);
  spells[1].targettype =TARGET_RANDOM_SINGLE;
  spells[1].maxdist2cast=10.0f;
  spells[1].cooldown = 16;
  spells[1].perctrigger = 20.0f;

  spells[2].info = dbcSpell.LookupEntry(SPELL_Concussive_Throw);
  spells[2].targettype =TARGET_RANDOM_SINGLE;
  spells[2].mindist2cast=10.0f;
  spells[2].maxdist2cast=40.0f;
  spells[2].cooldown = 21;
  spells[2].perctrigger = 20.0f;

  spells[3].info = dbcSpell.LookupEntry(SPELL_Enrage_AB);
  spells[3].targettype =TARGET_ATTACKING;
  spells[3].perctrigger = 100.0f;

  }
  void OnCombatStart(Unit* mTarget)
  {
  for(int i=0;i<nrspells;i++)  spells[i].Timer = 0;
  nrspells = 3;
  enrage = 0;
  RegisterAIUpdateEvent(1000);
  }
  void OnCombatStop(Unit *mTarget)
  {
  RemoveAIUpdateEvent();
  }
  void OnDied(Unit * mKiller)
  {
  _unit->Despawn(30000,0);
  RemoveAIUpdateEvent();
  }
  void AIUpdate()
  {
  if(_unit->GetHealthPct() < 50 && !enrage)
	{
	 SpellCastNew(spells[3],_unit);
	 enrage = 1;
	}
  SpellCastVal(spells,_unit,0,nrspells);
  }
};




//--------------------------------------------------------------------------------------Ashtongue_Mystic
#define CN_Ashtongue_Mystic	  22845
//Spells
#define SPELL_Bloodlust	  41185
#define SPELL_Chain_Heal	  41114
#define SPELL_Cyclone_Totem	  39589
#define SPELL_Flame_Shock	  41115
#define SPELL_Frost_Shock	  41116
#define SPELL_Searing_Totem	  39588
#define SPELL_Summon_Windfury_Totem	  39586

class AshtongueMysticAI : public CreatureAIScript
{protected:
  int nrspells;
  SP_AI_Spell spells[7];
public:
  ADD_CREATURE_FACTORY_FUNCTION(AshtongueMysticAI);
  AshtongueMysticAI(Creature* pCreature) : CreatureAIScript(pCreature)
  {
  nrspells = 7;

  spells[0].info = dbcSpell.LookupEntry(SPELL_Bloodlust);
  spells[0].targettype =TARGET_RANDOM_SINGLE;
  spells[0].maxdist2cast=20.0f;
  spells[0].cooldown = 25;
  spells[0].perctrigger = 20.0f;

  spells[1].info = dbcSpell.LookupEntry(SPELL_Chain_Heal);
  spells[1].targettype =TARGET_SELF;
  spells[1].maxhp2cast=50;
  spells[1].cooldown = 50;
  spells[1].perctrigger = 20.0f;

  spells[2].info = dbcSpell.LookupEntry(SPELL_Cyclone_Totem);
  spells[2].targettype =TARGET_SELF;
  spells[2].cooldown = 120;
  spells[2].perctrigger = 20.0f;

  spells[3].info = dbcSpell.LookupEntry(SPELL_Flame_Shock);
  spells[3].targettype =TARGET_RANDOM_SINGLE;
  spells[3].maxdist2cast=20.0f;
  spells[3].cooldown = 18;
  spells[3].perctrigger = 20.0f;

  spells[4].info = dbcSpell.LookupEntry(SPELL_Frost_Shock);
  spells[4].targettype =TARGET_RANDOM_SINGLE;
  spells[4].maxdist2cast=20.0f;
  spells[4].cooldown = 37;
  spells[4].perctrigger = 20.0f;

  spells[5].info = dbcSpell.LookupEntry(SPELL_Searing_Totem);
  spells[5].targettype =TARGET_SELF;
  spells[5].cooldown = 195;
  spells[5].perctrigger = 20.0f;

  spells[6].info = dbcSpell.LookupEntry(SPELL_Summon_Windfury_Totem);
  spells[6].targettype =TARGET_SELF;
  spells[6].cooldown = 214;
  spells[6].perctrigger = 20.0f;

  }
  void OnCombatStart(Unit* mTarget)
  {
  for(int i=0;i<nrspells;i++)  spells[i].Timer = 0;
  RegisterAIUpdateEvent(1000);
  }
  void OnCombatStop(Unit *mTarget)
  {
  RemoveAIUpdateEvent();
  }
  void OnDied(Unit * mKiller)
  {
  _unit->Despawn(30000,0);
  RemoveAIUpdateEvent();
  }
  void AIUpdate()
  {
  SpellCastVal(spells,_unit,0,nrspells);
  }
};




//--------------------------------------------------------------------------------------Ashtongue_Stormcaller
#define CN_Ashtongue_Stormcaller	  22846
//Spells
#define SPELL_Chain_Lightning	  41183
#define SPELL_Lightning_Bolt	  41184
#define SPELL_Lightning_Shield	  41151

class AshtongueStormcallerAI : public CreatureAIScript
{protected:
  int nrspells;
  SP_AI_Spell spells[3];
  bool shield;
public:
  ADD_CREATURE_FACTORY_FUNCTION(AshtongueStormcallerAI);
  AshtongueStormcallerAI(Creature* pCreature) : CreatureAIScript(pCreature)
  {
  nrspells = 3;

  spells[0].info = dbcSpell.LookupEntry(SPELL_Chain_Lightning);
  spells[0].targettype =TARGET_RANDOM_SINGLE;
  spells[0].instant=false;
  spells[0].maxdist2cast=30.0f;
  spells[0].cooldown = 9;
  spells[0].perctrigger = 20.0f;

  spells[1].info = dbcSpell.LookupEntry(SPELL_Lightning_Bolt);
  spells[1].targettype =TARGET_RANDOM_SINGLE;
  spells[1].mindist2cast=8.0f;
  spells[1].instant=false;
  spells[1].maxdist2cast=40.0f;
  spells[1].cooldown = 15;
  spells[1].perctrigger = 20.0f;

  spells[2].info = dbcSpell.LookupEntry(SPELL_Lightning_Shield);
  spells[2].targettype =TARGET_SELF;
  spells[2].perctrigger = 100.0f;

  }
  void OnCombatStart(Unit* mTarget)
  {
  for(int i=0;i<nrspells;i++)  spells[i].Timer = 0;
  nrspells = 2;
  shield = 0;
  RegisterAIUpdateEvent(1000);
  }
  void OnCombatStop(Unit *mTarget)
  {
  RemoveAIUpdateEvent();
  }
  void OnDied(Unit * mKiller)
  {
  _unit->Despawn(30000,0);
  RemoveAIUpdateEvent();
  }
  void AIUpdate()
  {
  if(_unit->GetHealthPct() < 80 && !shield)
	{
	 SpellCastNew(spells[2],_unit);
	 shield = 1;
	}
  SpellCastVal(spells,_unit,0,nrspells);
  }
};




//--------------------------------------------------------------------------------------Ashtongue_Primalist
#define CN_Ashtongue_Primalist	  22847
//Spells
#define SPELL_Multi_Shot_AP	  41187
#define SPELL_Shoot	  41188
#define SPELL_Sweeping_Wing_Clip	  39584
#define SPELL_Wyvern_Sting	  41186

class AshtonguePrimalistAI : public CreatureAIScript
{protected:
  int nrspells;
  SP_AI_Spell spells[4];
public:
  ADD_CREATURE_FACTORY_FUNCTION(AshtonguePrimalistAI);
  AshtonguePrimalistAI(Creature* pCreature) : CreatureAIScript(pCreature)
  {
  nrspells = 4;

  spells[0].info = dbcSpell.LookupEntry(SPELL_Multi_Shot_AP);
  spells[0].targettype =TARGET_RANDOM_SINGLE;
  spells[0].mindist2cast=5.0f;
  spells[0].maxdist2cast=30.0f;
  spells[0].cooldown = 21;
  spells[0].perctrigger = 20.0f;

  spells[1].info = dbcSpell.LookupEntry(SPELL_Shoot);
  spells[1].targettype =TARGET_RANDOM_SINGLE;
  spells[1].mindist2cast=5.0f;
  spells[1].maxdist2cast=30.0f;
  spells[1].cooldown = 14;
  spells[1].perctrigger = 20.0f;

  spells[2].info = dbcSpell.LookupEntry(SPELL_Sweeping_Wing_Clip);
  spells[2].targettype =TARGET_ATTACKING;
  spells[2].cooldown = 19;
  spells[2].perctrigger = 20.0f;

  spells[3].info = dbcSpell.LookupEntry(SPELL_Wyvern_Sting);
  spells[3].targettype =TARGET_RANDOM_SINGLE;
  spells[3].maxdist2cast=35.0f;
  spells[3].cooldown = 11;
  spells[3].perctrigger = 20.0f;

  }
  void OnCombatStart(Unit* mTarget)
  {
  for(int i=0;i<nrspells;i++)  spells[i].Timer = 0;
  RegisterAIUpdateEvent(1000);
  }
  void OnCombatStop(Unit *mTarget)
  {
  RemoveAIUpdateEvent();
  }
  void OnDied(Unit * mKiller)
  {
  _unit->Despawn(30000,0);
  RemoveAIUpdateEvent();
  }
  void AIUpdate()
  {
  SpellCastVal(spells,_unit,0,nrspells);
  }
};




//--------------------------------------------------------------------------------------Storm_Fury
#define CN_Storm_Fury	  22848
//Spells
#define SPELL_Storm_Blink	  39581

class StormFuryAI : public CreatureAIScript
{protected:
  int nrspells;
  SP_AI_Spell spells[1];
public:
  ADD_CREATURE_FACTORY_FUNCTION(StormFuryAI);
  StormFuryAI(Creature* pCreature) : CreatureAIScript(pCreature)
  {
  nrspells = 1;

  spells[0].info = dbcSpell.LookupEntry(SPELL_Storm_Blink);
  spells[0].targettype =TARGET_SELF;
  spells[0].cooldown = 45;
  spells[0].perctrigger = 20.0f;

  }
  void OnCombatStart(Unit* mTarget)
  {
  for(int i=0;i<nrspells;i++)  spells[i].Timer = 0;
  RegisterAIUpdateEvent(1000);
  }
  void OnCombatStop(Unit *mTarget)
  {
  RemoveAIUpdateEvent();
  }
  void OnDied(Unit * mKiller)
  {
  _unit->Despawn(30000,0);
  RemoveAIUpdateEvent();
  }
  void AIUpdate()
  {
  SpellCastVal(spells,_unit,0,nrspells);
  }
};




//--------------------------------------------------------------------------------------Ashtongue_Feral_Spirit
#define CN_Ashtongue_Feral_Spirit	  22849
//Spells
#define SPELL_Charge_Frenzy	  39575
#define SPELL_Spirit_Bond	  39578

class AshtongueFeralSpiritAI : public CreatureAIScript
{protected:
  int nrspells;
  SP_AI_Spell spells[2];
public:
  ADD_CREATURE_FACTORY_FUNCTION(AshtongueFeralSpiritAI);
  AshtongueFeralSpiritAI(Creature* pCreature) : CreatureAIScript(pCreature)
  {
  nrspells = 2;

  spells[0].info = dbcSpell.LookupEntry(SPELL_Charge_Frenzy);
  spells[0].targettype =TARGET_SELF;
  spells[0].cooldown = 23;
  spells[0].perctrigger = 20.0f;

  spells[1].info = dbcSpell.LookupEntry(SPELL_Spirit_Bond);
  spells[1].targettype =TARGET_SELF;
  spells[1].cooldown = 29;
  spells[1].perctrigger = 20.0f;

  }
  void OnCombatStart(Unit* mTarget)
  {
  for(int i=0;i<nrspells;i++)  spells[i].Timer = 0;
  RegisterAIUpdateEvent(1000);
  }
  void OnCombatStop(Unit *mTarget)
  {
  RemoveAIUpdateEvent();
  }
  void OnDied(Unit * mKiller)
  {
  _unit->Despawn(30000,0);
  RemoveAIUpdateEvent();
  }
  void AIUpdate()
  {
  SpellCastVal(spells,_unit,0,nrspells);
  }
};




//--------------------------------------------------------------------------------------Illidari_Defiler
#define CN_Illidari_Defiler	  22853
//Spells
#define SPELL_Banish	  39674
#define SPELL_Curse_of_Agony	  39672
#define SPELL_Fel_Immolate	  39670
#define SPELL_Rain_of_Chaos_ID	  39671

class IllidariDefilerAI : public CreatureAIScript
{protected:
  int nrspells;
  SP_AI_Spell spells[4];
public:
  ADD_CREATURE_FACTORY_FUNCTION(IllidariDefilerAI);
  IllidariDefilerAI(Creature* pCreature) : CreatureAIScript(pCreature)
  {
  nrspells = 4;

  spells[0].info = dbcSpell.LookupEntry(SPELL_Banish);
  spells[0].targettype =TARGET_RANDOM_SINGLE;
  spells[0].instant=false;
  spells[0].maxdist2cast=30.0f;
  spells[0].cooldown = 33;
  spells[0].perctrigger = 20.0f;

  spells[1].info = dbcSpell.LookupEntry(SPELL_Curse_of_Agony);
  spells[1].targettype =TARGET_RANDOM_SINGLE;
  spells[1].maxdist2cast=30.0f;
  spells[1].cooldown = 25;
  spells[1].perctrigger = 20.0f;

  spells[2].info = dbcSpell.LookupEntry(SPELL_Fel_Immolate);
  spells[2].targettype =TARGET_RANDOM_SINGLE;
  spells[2].instant=false;
  spells[2].maxdist2cast=30.0f;
  spells[2].cooldown = 37;
  spells[2].perctrigger = 20.0f;

  spells[3].info = dbcSpell.LookupEntry(SPELL_Rain_of_Chaos_ID);
  spells[3].targettype =TARGET_RANDOM_SINGLE;
  spells[3].instant=false;
  spells[3].maxdist2cast=30.0f;
  spells[3].cooldown = 29;
  spells[3].perctrigger = 20.0f;

  }
  void OnCombatStart(Unit* mTarget)
  {
  for(int i=0;i<nrspells;i++)  spells[i].Timer = 0;
  RegisterAIUpdateEvent(1000);
  }
  void OnCombatStop(Unit *mTarget)
  {
  RemoveAIUpdateEvent();
  }
  void OnDied(Unit * mKiller)
  {
  _unit->Despawn(30000,0);
  RemoveAIUpdateEvent();
  }
  void AIUpdate()
  {
  SpellCastVal(spells,_unit,0,nrspells);
  }
};




//--------------------------------------------------------------------------------------Illidari_Nightlord
#define CN_Illidari_Nightlord	  22855
//Spells
#define SPELL_Curse_of_Mending	  39647
#define SPELL_Fear	  41150
#define SPELL_Shadow_Inferno	  39645
#define SPELL_Summon_Shadowfiends	  39649

class IllidariNightlordAI : public CreatureAIScript
{protected:
  int nrspells;
  SP_AI_Spell spells[4];
public:
  ADD_CREATURE_FACTORY_FUNCTION(IllidariNightlordAI);
  IllidariNightlordAI(Creature* pCreature) : CreatureAIScript(pCreature)
  {
  nrspells = 4;

  spells[0].info = dbcSpell.LookupEntry(SPELL_Curse_of_Mending);
  spells[0].targettype =TARGET_SELF;
  spells[0].instant=false;
  spells[0].cooldown = 190;
  spells[0].perctrigger = 20.0f;

  spells[1].info = dbcSpell.LookupEntry(SPELL_Fear);
  spells[1].targettype =TARGET_RANDOM_SINGLE;
  spells[1].maxdist2cast=20.0f;
  spells[1].instant=false;
  spells[1].cooldown = 10;
  spells[1].perctrigger = 20.0f;

  spells[2].info = dbcSpell.LookupEntry(SPELL_Shadow_Inferno);
  spells[2].targettype =TARGET_SELF;
  spells[2].cooldown = 15;
  spells[2].perctrigger = 20.0f;

  spells[3].info = dbcSpell.LookupEntry(SPELL_Summon_Shadowfiends);
  spells[3].targettype =TARGET_SELF;
  spells[3].cooldown = 30;
  spells[3].perctrigger = 20.0f;

  }
  void OnCombatStart(Unit* mTarget)
  {
  for(int i=0;i<nrspells;i++)  spells[i].Timer = 0;
  RegisterAIUpdateEvent(1000);
  }
  void OnCombatStop(Unit *mTarget)
  {
  RemoveAIUpdateEvent();
  }
  void OnDied(Unit * mKiller)
  {
  _unit->Despawn(30000,0);
  RemoveAIUpdateEvent();
  }
  void AIUpdate()
  {
  SpellCastVal(spells,_unit,0,nrspells);
  }
};




//--------------------------------------------------------------------------------------Illidari_Boneslicer
#define CN_Illidari_Boneslicer	  22869
//Spells
#define SPELL_Cloak_of_Shadows	  39666
#define SPELL_Gouge	  24698
#define SPELL_Shadowstep	  41176

class IllidariBoneslicerAI : public CreatureAIScript
{protected:
  int nrspells;
  SP_AI_Spell spells[3];
public:
  ADD_CREATURE_FACTORY_FUNCTION(IllidariBoneslicerAI);
  IllidariBoneslicerAI(Creature* pCreature) : CreatureAIScript(pCreature)
  {
  nrspells = 3;

  spells[0].info = dbcSpell.LookupEntry(SPELL_Cloak_of_Shadows);
  spells[0].targettype =TARGET_SELF;
  spells[0].cooldown = 17;
  spells[0].perctrigger = 20.0f;

  spells[1].info = dbcSpell.LookupEntry(SPELL_Gouge);
  spells[1].targettype =TARGET_ATTACKING;
  spells[1].cooldown = 8;
  spells[1].perctrigger = 20.0f;

  spells[2].info = dbcSpell.LookupEntry(SPELL_Shadowstep);
  spells[2].targettype =TARGET_RANDOM_SINGLE;
  spells[2].maxdist2cast=40.0f;
  spells[2].cooldown = 10;
  spells[2].perctrigger = 20.0f;

  }
  void OnCombatStart(Unit* mTarget)
  {
  for(int i=0;i<nrspells;i++)  spells[i].Timer = 0;
  RegisterAIUpdateEvent(1000);
  }
  void OnCombatStop(Unit *mTarget)
  {
  RemoveAIUpdateEvent();
  }
  void OnDied(Unit * mKiller)
  {
  _unit->Despawn(30000,0);
  RemoveAIUpdateEvent();
  }
  void AIUpdate()
  {
  SpellCastVal(spells,_unit,0,nrspells);
  }
};




//--------------------------------------------------------------------------------------Coilskar_General
#define CN_Coilskar_General	  22873
//Spells
#define SPELL_Booming_Voice	  40080
#define SPELL_Free_Friend	  40081

class CoilskarGeneralAI : public CreatureAIScript
{protected:
  int nrspells;
  SP_AI_Spell spells[2];
public:
  ADD_CREATURE_FACTORY_FUNCTION(CoilskarGeneralAI);
  CoilskarGeneralAI(Creature* pCreature) : CreatureAIScript(pCreature)
  {
  nrspells = 2;

  spells[0].info = dbcSpell.LookupEntry(SPELL_Booming_Voice);
  spells[0].targettype =TARGET_SELF;
  spells[0].cooldown = 50;
  spells[0].perctrigger = 20.0f;

  spells[1].info = dbcSpell.LookupEntry(SPELL_Free_Friend);
  spells[1].targettype =TARGET_VARIOUS;
  spells[1].cooldown = 19;
  spells[1].perctrigger = 20.0f;

  }
  void OnCombatStart(Unit* mTarget)
  {
  for(int i=0;i<nrspells;i++)  spells[i].Timer = 0;
  RegisterAIUpdateEvent(1000);
  }
  void OnCombatStop(Unit *mTarget)
  {
  RemoveAIUpdateEvent();
  }
  void OnDied(Unit * mKiller)
  {
  _unit->Despawn(30000,0);
  RemoveAIUpdateEvent();
  }
  void AIUpdate()
  {
  SpellCastVal(spells,_unit,0,nrspells);
  }
};






//--------------------------------------------------------------------------------------Coilskar_Sea-Caller
#define CN_Coilskar_SeaCaller	  22875
//Spells
#define SPELL_Forked_Lightning	  40088
#define SPELL_Hurricane	  40090
#define SPELL_Summon_Geyser	  40091

class CoilskarSeaCallerAI : public CreatureAIScript
{protected:
  int nrspells;
  SP_AI_Spell spells[3];
public:
  ADD_CREATURE_FACTORY_FUNCTION(CoilskarSeaCallerAI);
  CoilskarSeaCallerAI(Creature* pCreature) : CreatureAIScript(pCreature)
  {
  nrspells = 3;

  spells[0].info = dbcSpell.LookupEntry(SPELL_Forked_Lightning);
  spells[0].targettype =TARGET_RANDOM_SINGLE;
  spells[0].maxdist2cast=30.0f;
  spells[0].instant=false;
  spells[0].cooldown = 10;
  spells[0].perctrigger = 20.0f;

  spells[1].info = dbcSpell.LookupEntry(SPELL_Hurricane);
  spells[1].targettype =TARGET_RANDOM_SINGLE;
  spells[1].maxdist2cast=30.0f;
  spells[1].instant=false;
  spells[1].cooldown = 25;
  spells[1].perctrigger = 20.0f;

  spells[2].info = dbcSpell.LookupEntry(SPELL_Summon_Geyser);
  spells[2].targettype =TARGET_SELF;
  spells[2].cooldown = 90;
  spells[2].perctrigger = 20.0f;

  }
  void OnCombatStart(Unit* mTarget)
  {
  for(int i=0;i<nrspells;i++)  spells[i].Timer = 0;
  RegisterAIUpdateEvent(1000);
  }
  void OnCombatStop(Unit *mTarget)
  {
  RemoveAIUpdateEvent();
  }
  void OnDied(Unit * mKiller)
  {
  _unit->Despawn(30000,0);
  RemoveAIUpdateEvent();
  }
  void AIUpdate()
  {
  SpellCastVal(spells,_unit,0,nrspells);
  }
};





//--------------------------------------------------------------------------------------Coilskar_Wrangler
#define CN_Coilskar_Wrangler	  22877
//Spells
#define SPELL_Cleave	  15284
#define SPELL_Electric_Spur	  40076
#define SPELL_Lightning_Prod	  40066

class CoilskarWranglerAI : public CreatureAIScript
{protected:
  int nrspells;
  SP_AI_Spell spells[3];
public:
  ADD_CREATURE_FACTORY_FUNCTION(CoilskarWranglerAI);
  CoilskarWranglerAI(Creature* pCreature) : CreatureAIScript(pCreature)
  {
  nrspells = 3;

  spells[0].info = dbcSpell.LookupEntry(SPELL_Cleave);
  spells[0].targettype =TARGET_ATTACKING;
  spells[0].cooldown = 11;
  spells[0].perctrigger = 20.0f;

  spells[1].info = dbcSpell.LookupEntry(SPELL_Electric_Spur);
  spells[1].targettype =TARGET_SELF;
  spells[1].instant=false;
  spells[1].cooldown = 35;
  spells[1].perctrigger = 20.0f;

  spells[2].info = dbcSpell.LookupEntry(SPELL_Lightning_Prod);
  spells[2].targettype =TARGET_RANDOM_SINGLE;
  spells[2].instant=false;
  spells[2].maxdist2cast=30.0f;
  spells[2].cooldown = 14;
  spells[2].perctrigger = 20.0f;

  }
  void OnCombatStart(Unit* mTarget)
  {
  for(int i=0;i<nrspells;i++)  spells[i].Timer = 0;
  RegisterAIUpdateEvent(1000);
  }
  void OnCombatStop(Unit *mTarget)
  {
  RemoveAIUpdateEvent();
  }
  void OnDied(Unit * mKiller)
  {
  _unit->Despawn(30000,0);
  RemoveAIUpdateEvent();
  }
  void AIUpdate()
  {
  SpellCastVal(spells,_unit,0,nrspells);
  }
};





//--------------------------------------------------------------------------------------Shadowmoon_Reaver
#define CN_Shadowmoon_Reaver	  22879
//Spells
#define SPELL_Spell_Absorption	  41034

class ShadowmoonReaverAI : public CreatureAIScript
{protected:
  int nrspells;
  SP_AI_Spell spells[1];
public:
  ADD_CREATURE_FACTORY_FUNCTION(ShadowmoonReaverAI);
  ShadowmoonReaverAI(Creature* pCreature) : CreatureAIScript(pCreature)
  {
  nrspells = 1;

  spells[0].info = dbcSpell.LookupEntry(SPELL_Spell_Absorption);
  spells[0].targettype =TARGET_SELF;
  spells[0].cooldown = 23;
  spells[0].perctrigger = 20.0f;

  }
  void OnCombatStart(Unit* mTarget)
  {
  for(int i=0;i<nrspells;i++)  spells[i].Timer = 0;
  RegisterAIUpdateEvent(1000);
  }
  void OnCombatStop(Unit *mTarget)
  {
  RemoveAIUpdateEvent();
  }
  void OnDied(Unit * mKiller)
  {
  _unit->Despawn(30000,0);
  RemoveAIUpdateEvent();
  }
  void AIUpdate()
  {
  SpellCastVal(spells,_unit,0,nrspells);
  }
};




//--------------------------------------------------------------------------------------Shadowmoon_Champion
#define CN_Shadowmoon_Champion	  22880
//Spells
#define SPELL_Chaotic_Light	  41063
#define SPELL_Whirling_Blade	  41053

class ShadowmoonChampionAI : public CreatureAIScript
{protected:
  int nrspells;
  SP_AI_Spell spells[2];
public:
  ADD_CREATURE_FACTORY_FUNCTION(ShadowmoonChampionAI);
  ShadowmoonChampionAI(Creature* pCreature) : CreatureAIScript(pCreature)
  {
  nrspells = 2;

  spells[0].info = dbcSpell.LookupEntry(SPELL_Chaotic_Light);
  spells[0].targettype =TARGET_ATTACKING;
  spells[0].cooldown = 15;
  spells[0].perctrigger = 20.0f;

  spells[1].info = dbcSpell.LookupEntry(SPELL_Whirling_Blade);
  spells[1].targettype =TARGET_RANDOM_SINGLE;
  spells[1].cooldown = 65;
  spells[1].maxdist2cast=60.0f;
  spells[1].perctrigger = 20.0f;

  }
  void OnCombatStart(Unit* mTarget)
  {
  for(int i=0;i<nrspells;i++)  spells[i].Timer = 0;
  RegisterAIUpdateEvent(1000);
  }
  void OnCombatStop(Unit *mTarget)
  {
  RemoveAIUpdateEvent();
  }
  void OnDied(Unit * mKiller)
  {
  _unit->Despawn(30000,0);
  RemoveAIUpdateEvent();
  }
  void AIUpdate()
  {
  SpellCastVal(spells,_unit,0,nrspells);
  }
};




//--------------------------------------------------------------------------------------Aqueous_Surger
#define CN_Aqueous_Surger	  22881
//Spells
#define SPELL_Poison_Bolt_Volley	  40095

class AqueousSurgerAI : public CreatureAIScript
{protected:
  int nrspells;
  SP_AI_Spell spells[1];
public:
  ADD_CREATURE_FACTORY_FUNCTION(AqueousSurgerAI);
  AqueousSurgerAI(Creature* pCreature) : CreatureAIScript(pCreature)
  {
  nrspells = 1;

  spells[0].info = dbcSpell.LookupEntry(SPELL_Poison_Bolt_Volley);
  spells[0].targettype =TARGET_RANDOM_SINGLE;
  spells[0].cooldown = 15;
  spells[0].perctrigger = 20.0f;

  }
  void OnCombatStart(Unit* mTarget)
  {
  for(int i=0;i<nrspells;i++)  spells[i].Timer = 0;
  RegisterAIUpdateEvent(1000);
  }
  void OnCombatStop(Unit *mTarget)
  {
  RemoveAIUpdateEvent();
  }
  void OnDied(Unit * mKiller)
  {
  _unit->Despawn(30000,0);
  RemoveAIUpdateEvent();
  }
  void AIUpdate()
  {
  SpellCastVal(spells,_unit,0,nrspells);
  }
};




//--------------------------------------------------------------------------------------Shadowmoon_Deathshaper
#define CN_Shadowmoon_Deathshaper	  22882
//Spells
#define SPELL_Death_Coil	  41070
#define SPELL_Demon_Armor	  13787
#define SPELL_Raise_Dead	  41071
#define SPELL_Shadow_Bolt	  41069

class ShadowmoonDeathshaperAI : public CreatureAIScript
{protected:
  int nrspells;
  SP_AI_Spell spells[4];
public:
  ADD_CREATURE_FACTORY_FUNCTION(ShadowmoonDeathshaperAI);
  ShadowmoonDeathshaperAI(Creature* pCreature) : CreatureAIScript(pCreature)
  {
  nrspells = 4;

  spells[0].info = dbcSpell.LookupEntry(SPELL_Death_Coil);
  spells[0].targettype =TARGET_RANDOM_SINGLE;
  spells[0].maxdist2cast=30.0f;
  spells[0].cooldown = 17;
  spells[0].perctrigger = 20.0f;

  spells[1].info = dbcSpell.LookupEntry(SPELL_Raise_Dead);
  spells[1].targettype =TARGET_RANDOM_SINGLE;
  spells[1].instant=false;
  spells[1].maxdist2cast=50.0f;
  spells[1].cooldown = 60;
  spells[1].perctrigger = 20.0f;

  spells[2].info = dbcSpell.LookupEntry(SPELL_Shadow_Bolt);
  spells[2].targettype =TARGET_RANDOM_SINGLE;
  spells[2].maxdist2cast=30.0f;
  spells[2].cooldown = 12;
  spells[2].perctrigger = 20.0f;

  spells[3].info = dbcSpell.LookupEntry(SPELL_Demon_Armor);
  spells[3].targettype =TARGET_SELF;
  spells[3].perctrigger = 20.0f;

  }
  void OnCombatStart(Unit* mTarget)
  {
  for(int i=0;i<nrspells;i++)  spells[i].Timer = 0;
  nrspells = 4;
  SpellCastNew(spells[3],_unit);
  RegisterAIUpdateEvent(1000);
  }
  void OnCombatStop(Unit *mTarget)
  {
  RemoveAIUpdateEvent();
  }
  void OnDied(Unit * mKiller)
  {
  _unit->Despawn(30000,0);
  RemoveAIUpdateEvent();
  }
  void AIUpdate()
  {
  SpellCastVal(spells,_unit,0,nrspells);
  }
};



PART 2.

//--------------------------------------------------------------------------------------Leviathan
#define CN_Leviathan      22884
//Spells
#define SPELL_Debilitating_Spray      40079
#define SPELL_Poison_Spit      40078
#define SPELL_Tail_Sweep      40077

class LeviathanAI : public CreatureAIScript
{protected:
   int nrspells;
   SP_AI_Spell spells[3];
public:
   ADD_CREATURE_FACTORY_FUNCTION(LeviathanAI);
   LeviathanAI(Creature* pCreature) : CreatureAIScript(pCreature)
   {
      nrspells = 3;

      spells[0].info = dbcSpell.LookupEntry(SPELL_Debilitating_Spray);
      spells[0].targettype =TARGET_RANDOM_SINGLE;
      spells[0].instant=false;
      spells[0].maxdist2cast=50.0f;
      spells[0].cooldown = 22;
      spells[0].perctrigger = 20.0f;

      spells[1].info = dbcSpell.LookupEntry(SPELL_Poison_Spit);
      spells[1].targettype =TARGET_RANDOM_SINGLE;
      spells[1].instant=false;
      spells[1].maxdist2cast=30.0f;
      spells[1].cooldown = 27;
      spells[1].perctrigger = 20.0f;

      spells[2].info = dbcSpell.LookupEntry(SPELL_Tail_Sweep);
      spells[2].targettype =TARGET_VARIOUS;
      spells[2].cooldown = 15;
      spells[2].perctrigger = 20.0f;

   }
   void OnCombatStart(Unit* mTarget)
   {
      for(int i=0;i<nrspells;i++)  spells[i].Timer = 0;
      RegisterAIUpdateEvent(1000);
   }
   void OnCombatStop(Unit *mTarget)
   {
      RemoveAIUpdateEvent();
   }
   void OnDied(Unit * mKiller)
   {
      _unit->Despawn(30000,0);
      RemoveAIUpdateEvent();
   }
   void AIUpdate()
   {
      SpellCastVal(spells,_unit,0,nrspells);
   }
};






//--------------------------------------------------------------------------------------Shadowmoon_Blood_Mage
#define CN_Shadowmoon_Blood_Mage      22945
//Spells
#define SPELL_Blood_Siphon      41068
#define SPELL_Bloodbolt_SBM      41072

class ShadowmoonBloodMageAI : public CreatureAIScript
{protected:
   int nrspells;
   SP_AI_Spell spells[2];
public:
   ADD_CREATURE_FACTORY_FUNCTION(ShadowmoonBloodMageAI);
   ShadowmoonBloodMageAI(Creature* pCreature) : CreatureAIScript(pCreature)
   {
      nrspells = 2;

      spells[0].info = dbcSpell.LookupEntry(SPELL_Blood_Siphon);
      spells[0].targettype =TARGET_SELF;
      spells[0].cooldown = 35;
      spells[0].perctrigger = 20.0f;

      spells[1].info = dbcSpell.LookupEntry(SPELL_Bloodbolt_SBM);
      spells[1].targettype =TARGET_RANDOM_SINGLE;
      spells[1].instant=false;
      spells[1].maxdist2cast=40.0f;
      spells[1].cooldown = 65;
      spells[1].perctrigger = 20.0f;

   }
   void OnCombatStart(Unit* mTarget)
   {
      for(int i=0;i<nrspells;i++)  spells[i].Timer = 0;
      RegisterAIUpdateEvent(1000);
   }
   void OnCombatStop(Unit *mTarget)
   {
      RemoveAIUpdateEvent();
   }
   void OnDied(Unit * mKiller)
   {
      _unit->Despawn(30000,0);
      RemoveAIUpdateEvent();
   }
   void AIUpdate()
   {
      SpellCastVal(spells,_unit,0,nrspells);
   }
};




//--------------------------------------------------------------------------------------Wrathbone_Flayer
#define CN_Wrathbone_Flayer      22953
//Spells
#define SPELL_Cleave_WF      15496
#define SPELL_Ignored      39544

class WrathboneFlayerAI : public CreatureAIScript
{protected:
   int nrspells;
   SP_AI_Spell spells[2];
public:
   ADD_CREATURE_FACTORY_FUNCTION(WrathboneFlayerAI);
   WrathboneFlayerAI(Creature* pCreature) : CreatureAIScript(pCreature)
   {
      nrspells = 2;

      spells[0].info = dbcSpell.LookupEntry(SPELL_Cleave_WF);
      spells[0].targettype =TARGET_ATTACKING;
      spells[0].cooldown = 14;
      spells[0].perctrigger = 20.0f;

      spells[1].info = dbcSpell.LookupEntry(SPELL_Ignored);
      spells[1].targettype =TARGET_ATTACKING;
      spells[1].cooldown = 19;
      spells[1].perctrigger = 20.0f;

   }
   void OnCombatStart(Unit* mTarget)
   {
      for(int i=0;i<nrspells;i++)  spells[i].Timer = 0;
      RegisterAIUpdateEvent(1000);
   }
   void OnCombatStop(Unit *mTarget)
   {
      RemoveAIUpdateEvent();
   }
   void OnDied(Unit * mKiller)
   {
      _unit->Despawn(30000,0);
      RemoveAIUpdateEvent();
   }
   void AIUpdate()
   {
      SpellCastVal(spells,_unit,0,nrspells);
   }
};




//--------------------------------------------------------------------------------------Illidari_Fearbringer
#define CN_Illidari_Fearbringer      22954
//Spells
#define SPELL_Illidari_Flames      40938
#define SPELL_Rain_of_Chaos      40946
#define SPELL_War_Stomp      40936

class IllidariFearbringerAI : public CreatureAIScript
{protected:
   int nrspells;
   SP_AI_Spell spells[3];
public:
   ADD_CREATURE_FACTORY_FUNCTION(IllidariFearbringerAI);
   IllidariFearbringerAI(Creature* pCreature) : CreatureAIScript(pCreature)
   {
      nrspells = 3;

      spells[0].info = dbcSpell.LookupEntry(SPELL_Illidari_Flames);
      spells[0].targettype =TARGET_DESTINATION;
      spells[0].instant=false;
      spells[0].cooldown = 18;
      spells[0].perctrigger = 20.0f;

      spells[1].info = dbcSpell.LookupEntry(SPELL_Rain_of_Chaos);
      spells[1].targettype =TARGET_RANDOM_SINGLE;
      spells[1].maxdist2cast=50.0f;
      spells[1].cooldown = 23;
      spells[1].perctrigger = 20.0f;

      spells[2].info = dbcSpell.LookupEntry(SPELL_War_Stomp);
      spells[2].targettype =TARGET_SELF;
      spells[2].cooldown = 28;
      spells[2].perctrigger = 20.0f;

   }
   void OnCombatStart(Unit* mTarget)
   {
      for(int i=0;i<nrspells;i++)  spells[i].Timer = 0;
      RegisterAIUpdateEvent(1000);
   }
   void OnCombatStop(Unit *mTarget)
   {
      RemoveAIUpdateEvent();
   }
   void OnDied(Unit * mKiller)
   {
      _unit->Despawn(30000,0);
      RemoveAIUpdateEvent();
   }
   void AIUpdate()
   {
      SpellCastVal(spells,_unit,0,nrspells);
   }
};




//--------------------------------------------------------------------------------------Dragonmaw_Wyrmcaller
#define CN_Dragonmaw_Wyrmcaller      22960
//Spells
#define SPELL_Cleave      15284
#define SPELL_Fixate      40892
#define SPELL_Jab      40895

class DragonmawWyrmcallerAI : public CreatureAIScript
{protected:
   int nrspells;
   SP_AI_Spell spells[3];
public:
   ADD_CREATURE_FACTORY_FUNCTION(DragonmawWyrmcallerAI);
   DragonmawWyrmcallerAI(Creature* pCreature) : CreatureAIScript(pCreature)
   {
      nrspells = 3;

      spells[0].info = dbcSpell.LookupEntry(SPELL_Cleave);
      spells[0].targettype =TARGET_ATTACKING;
      spells[0].cooldown = 12;
      spells[0].perctrigger = 20.0f;

      spells[1].info = dbcSpell.LookupEntry(SPELL_Fixate);
      spells[1].targettype =TARGET_RANDOM_SINGLE;
      spells[1].cooldown = 21;
      spells[1].perctrigger = 20.0f;

      spells[2].info = dbcSpell.LookupEntry(SPELL_Jab);
      spells[2].targettype =TARGET_ATTACKING;
      spells[2].cooldown = 16;
      spells[2].perctrigger = 20.0f;

   }
   void OnCombatStart(Unit* mTarget)
   {
      for(int i=0;i<nrspells;i++)  spells[i].Timer = 0;
      RegisterAIUpdateEvent(1000);
   }
   void OnCombatStop(Unit *mTarget)
   {
      RemoveAIUpdateEvent();
   }
   void OnDied(Unit * mKiller)
   {
      _unit->Despawn(30000,0);
      RemoveAIUpdateEvent();
   }
   void AIUpdate()
   {
      SpellCastVal(spells,_unit,0,nrspells);
   }
};





//--------------------------------------------------------------------------------------Shadowmoon_Houndmaster
#define CN_Shadowmoon_Houndmaster      23018
//Spells
#define SPELL_Flare      41094
#define SPELL_Freezing_Trap      41085
#define SPELL_Shoot_SH      41093
#define SPELL_Silencing_Shot      41084
#define SPELL_Summon_Riding_Warhound      39906
#define SPELL_Volley      41091
#define SPELL_Wing_Clip      32908

class ShadowmoonHoundmasterAI : public CreatureAIScript
{protected:
   int nrspells;
   SP_AI_Spell spells[7];
public:
   ADD_CREATURE_FACTORY_FUNCTION(ShadowmoonHoundmasterAI);
   ShadowmoonHoundmasterAI(Creature* pCreature) : CreatureAIScript(pCreature)
   {
      nrspells = 7;

      spells[0].info = dbcSpell.LookupEntry(SPELL_Flare);
      spells[0].targettype =TARGET_SELF;
      spells[0].cooldown = 70;
      spells[0].perctrigger = 20.0f;

      spells[1].info = dbcSpell.LookupEntry(SPELL_Freezing_Trap);
      spells[1].targettype =TARGET_RANDOM_SINGLE;
      spells[1].maxdist2cast=20.0f;
      spells[1].cooldown = 10;
      spells[1].perctrigger = 20.0f;

      spells[2].info = dbcSpell.LookupEntry(SPELL_Shoot_SH);
      spells[2].targettype =TARGET_RANDOM_SINGLE;
      spells[2].maxdist2cast=30.0f;
      spells[2].mindist2cast=5.0f;
      spells[2].cooldown = 18;
      spells[2].perctrigger = 20.0f;

      spells[3].info = dbcSpell.LookupEntry(SPELL_Silencing_Shot);
      spells[3].targettype =TARGET_RANDOM_SINGLE;
      spells[3].maxdist2cast=40.0f;
      spells[3].mindist2cast=8.0f;
      spells[3].cooldown = 33;
      spells[3].perctrigger = 20.0f;

      spells[4].info = dbcSpell.LookupEntry(SPELL_Summon_Riding_Warhound);
      spells[4].targettype =TARGET_SELF;
      spells[4].cooldown = 105;
      spells[4].perctrigger = 20.0f;

      spells[5].info = dbcSpell.LookupEntry(SPELL_Volley);
      spells[5].targettype =TARGET_RANDOM_SINGLE;
      spells[5].instant=false;
      spells[5].maxdist2cast=40.0f;
      spells[5].mindist2cast=10.0f;
      spells[5].cooldown = 25;
      spells[5].perctrigger = 20.0f;

      spells[6].info = dbcSpell.LookupEntry(SPELL_Wing_Clip);
      spells[6].targettype =TARGET_ATTACKING;
      spells[6].cooldown = 14;
      spells[6].perctrigger = 20.0f;

   }
   void OnCombatStart(Unit* mTarget)
   {
      for(int i=0;i<nrspells;i++)  spells[i].Timer = 0;
      RegisterAIUpdateEvent(1000);
   }
   void OnCombatStop(Unit *mTarget)
   {
      RemoveAIUpdateEvent();
   }
   void OnDied(Unit * mKiller)
   {
      _unit->Despawn(30000,0);
      RemoveAIUpdateEvent();
   }
   void AIUpdate()
   {
      SpellCastVal(spells,_unit,0,nrspells);
   }
};




//--------------------------------------------------------------------------------------Bonechewer_Taskmaster
#define CN_Bonechewer_Taskmaster      23028
//Spells
#define SPELL_Disgruntled      40851
#define SPELL_Fury      40845

class BonechewerTaskmasterAI : public CreatureAIScript
{protected:
   int nrspells;
   SP_AI_Spell spells[2];
   bool enrage;
public:
   ADD_CREATURE_FACTORY_FUNCTION(BonechewerTaskmasterAI);
   BonechewerTaskmasterAI(Creature* pCreature) : CreatureAIScript(pCreature)
   {
      nrspells = 2;

      spells[0].info = dbcSpell.LookupEntry(SPELL_Fury);
      spells[0].targettype =TARGET_SELF;
      spells[0].cooldown = 30;
      spells[0].perctrigger = 20.0f;
      
      spells[1].info = dbcSpell.LookupEntry(SPELL_Disgruntled);
      spells[1].targettype =TARGET_SELF;
      spells[1].perctrigger = 20.0f;

   }
   void OnCombatStart(Unit* mTarget)
   {
      for(int i=0;i<nrspells;i++)  spells[i].Timer = 0;
      nrspells = 1;
      RegisterAIUpdateEvent(1000);
   }
   void OnCombatStop(Unit *mTarget)
   {
      RemoveAIUpdateEvent();
   }
   void OnDied(Unit * mKiller)
   {
      _unit->Despawn(30000,0);
      RemoveAIUpdateEvent();
   }
   void AIUpdate()
   {
        if(_unit->GetHealthPct() < 80 && !enrage)
        {
         SpellCastNew(spells[1],_unit);
         enrage = 1;

        }
      SpellCastVal(spells,_unit,0,nrspells);
   }
};




//--------------------------------------------------------------------------------------Dragonmaw_Sky_Stalker
#define CN_Dragonmaw_Sky_Stalker      23030
//Spells
#define SPELL_Immolation_Arrow      40872
#define SPELL_Shoot_DSS      40873

class DragonmawSkyStalkerAI : public CreatureAIScript
{protected:
   int nrspells;
   SP_AI_Spell spells[2];
public:
   ADD_CREATURE_FACTORY_FUNCTION(DragonmawSkyStalkerAI);
   DragonmawSkyStalkerAI(Creature* pCreature) : CreatureAIScript(pCreature)
   {
      nrspells = 2;

      spells[0].info = dbcSpell.LookupEntry(SPELL_Immolation_Arrow);
      spells[0].targettype =TARGET_RANDOM_SINGLE;
      spells[0].instant=false;
      spells[0].maxdist2cast=60.0f;
      spells[0].cooldown = 27;
      spells[0].perctrigger = 20.0f;

      spells[1].info = dbcSpell.LookupEntry(SPELL_Shoot_DSS);
      spells[1].targettype =TARGET_RANDOM_SINGLE;
      spells[1].maxdist2cast=40.0f;
      spells[1].cooldown = 19;
      spells[1].perctrigger = 20.0f;

   }
   void OnCombatStart(Unit* mTarget)
   {
      for(int i=0;i<nrspells;i++)  spells[i].Timer = 0;
      RegisterAIUpdateEvent(1000);
   }
   void OnCombatStop(Unit *mTarget)
   {
      RemoveAIUpdateEvent();
   }
   void OnDied(Unit * mKiller)
   {
      _unit->Despawn(30000,0);
      RemoveAIUpdateEvent();
   }
   void AIUpdate()
   {
      SpellCastVal(spells,_unit,0,nrspells);
   }
};




//--------------------------------------------------------------------------------------Shadowmoon_Soldier
#define CN_Shadowmoon_Soldier      23047
//Spells
#define SPELL_Strike_SS      11976

class ShadowmoonSoldierAI : public CreatureAIScript
{protected:
   int nrspells;
   SP_AI_Spell spells[1];
public:
   ADD_CREATURE_FACTORY_FUNCTION(ShadowmoonSoldierAI);
   ShadowmoonSoldierAI(Creature* pCreature) : CreatureAIScript(pCreature)
   {
      nrspells = 1;

      spells[0].info = dbcSpell.LookupEntry(SPELL_Strike_SS);
      spells[0].targettype =TARGET_ATTACKING;
      spells[0].cooldown = 11;
      spells[0].perctrigger = 20.0f;

   }
   void OnCombatStart(Unit* mTarget)
   {
      for(int i=0;i<nrspells;i++)  spells[i].Timer = 0;
      RegisterAIUpdateEvent(1000);
   }
   void OnCombatStop(Unit *mTarget)
   {
      RemoveAIUpdateEvent();
   }
   void OnDied(Unit * mKiller)
   {
      _unit->Despawn(30000,0);
      RemoveAIUpdateEvent();
   }
   void AIUpdate()
   {
      SpellCastVal(spells,_unit,0,nrspells);
   }
};




//--------------------------------------------------------------------------------------Shadowmoon_Weapon_Master
#define CN_Shadowmoon_Weapon_Master      23049
//Spells
#define SPELL_Berseker_Aura      41107
#define SPELL_Berserker_Stance      41100
#define SPELL_Knock_Away      18813
#define SPELL_Whirlwind_SWM      41097

class ShadowmoonWeaponMasterAI : public CreatureAIScript
{protected:
   int nrspells;
   SP_AI_Spell spells[4];
   bool enrage;
public:
   ADD_CREATURE_FACTORY_FUNCTION(ShadowmoonWeaponMasterAI);
   ShadowmoonWeaponMasterAI(Creature* pCreature) : CreatureAIScript(pCreature)
   {
      nrspells = 4;

      spells[0].info = dbcSpell.LookupEntry(SPELL_Knock_Away);
      spells[0].targettype =TARGET_ATTACKING;
      spells[0].cooldown = 8;
      spells[0].perctrigger = 20.0f;

      spells[1].info = dbcSpell.LookupEntry(SPELL_Whirlwind_SWM);
      spells[1].targettype =TARGET_SELF;
      spells[1].cooldown = 27;
      spells[1].perctrigger = 20.0f;
      
      spells[2].info = dbcSpell.LookupEntry(SPELL_Berseker_Aura);
      spells[2].targettype =TARGET_SELF;
      spells[2].perctrigger = 100.0f;

      spells[3].info = dbcSpell.LookupEntry(SPELL_Berserker_Stance);
      spells[3].targettype =TARGET_SELF;
      spells[3].perctrigger = 100.0f;

   }
   void OnCombatStart(Unit* mTarget)
   {
      for(int i=0;i<nrspells;i++)  spells[i].Timer = 0;
      SpellCastNew(spells[3],_unit);
      nrspells = 2;
      RegisterAIUpdateEvent(1000);
   }
   void OnCombatStop(Unit *mTarget)
   {
      RemoveAIUpdateEvent();
   }
   void OnDied(Unit * mKiller)
   {
      _unit->Despawn(30000,0);
      RemoveAIUpdateEvent();
   }
   void AIUpdate()
   {
   if(_unit->GetHealthPct() < 70 && !enrage)
        {
         SpellCastNew(spells[2],_unit);
         enrage = 1;

        }
      SpellCastVal(spells,_unit,0,nrspells);
   }
};


//--------------------------------------------------------------------------------------Hand_of_Gorefiend
#define CN_Hand_of_Gorefiend      23172
//Spells
#define SPELL_Frenzy_HoG      38166

class HandofGorefiendAI : public CreatureAIScript
{protected:
   int nrspells;
   SP_AI_Spell spells[1];
public:
   ADD_CREATURE_FACTORY_FUNCTION(HandofGorefiendAI);
   HandofGorefiendAI(Creature* pCreature) : CreatureAIScript(pCreature)
   {
      nrspells = 1;

      spells[0].info = dbcSpell.LookupEntry(SPELL_Frenzy_HoG);
      spells[0].targettype =TARGET_SELF;
      spells[0].cooldown = 40;
      spells[0].perctrigger = 20.0f;

   }
   void OnCombatStart(Unit* mTarget)
   {
      for(int i=0;i<nrspells;i++)  spells[i].Timer = 0;
      RegisterAIUpdateEvent(1000);
   }
   void OnCombatStop(Unit *mTarget)
   {
      RemoveAIUpdateEvent();
   }
   void OnDied(Unit * mKiller)
   {
      _unit->Despawn(30000,0);
      RemoveAIUpdateEvent();
   }
   void AIUpdate()
   {
      SpellCastVal(spells,_unit,0,nrspells);
   }
};




//--------------------------------------------------------------------------------------Bonechewer_Behemoth
#define CN_Bonechewer_Behemoth      23196
//Spells
#define SPELL_Behemoth_Charge      41272
#define SPELL_Enrage_BB      8269
#define SPELL_Fel_Stomp      41274
#define SPELL_Fiery_Comet      41277
#define SPELL_Meteor      41276

class BonechewerBehemothAI : public CreatureAIScript
{protected:
   int nrspells;
   SP_AI_Spell spells[5];
   bool enrage;
public:
   ADD_CREATURE_FACTORY_FUNCTION(BonechewerBehemothAI);
   BonechewerBehemothAI(Creature* pCreature) : CreatureAIScript(pCreature)
   {
      nrspells = 5;

      spells[0].info = dbcSpell.LookupEntry(SPELL_Behemoth_Charge);
      spells[0].targettype =TARGET_RANDOM_SINGLE;
      spells[0].maxdist2cast=30.0f;
      spells[0].mindist2cast=5.0f;
      spells[0].cooldown = 9;
      spells[0].perctrigger = 20.0f;

      spells[1].info = dbcSpell.LookupEntry(SPELL_Fel_Stomp);
      spells[1].targettype =TARGET_VARIOUS;
      spells[1].cooldown = 17;
      spells[1].perctrigger = 20.0f;

      spells[2].info = dbcSpell.LookupEntry(SPELL_Fiery_Comet);
      spells[2].targettype =TARGET_RANDOM_SINGLE;
      spells[2].instant=false;
      spells[2].maxdist2cast=40.0f;
      spells[2].mindist2cast=10.0f;
      spells[2].cooldown = 12;
      spells[2].perctrigger = 20.0f;

      spells[3].info = dbcSpell.LookupEntry(SPELL_Meteor);
      spells[3].targettype =TARGET_RANDOM_SINGLE;
      spells[3].instant=false;
      spells[3].cooldown = 120;
      spells[3].perctrigger = 20.0f;
      
      spells[4].info = dbcSpell.LookupEntry(SPELL_Enrage_BB);
      spells[4].targettype =TARGET_SELF;
      spells[4].perctrigger = 20.0f;

   }
   void OnCombatStart(Unit* mTarget)
   {
      for(int i=0;i<nrspells;i++)  spells[i].Timer = 0;
      nrspells = 4;
      enrage = 0;
      RegisterAIUpdateEvent(1000);
   }
   void OnCombatStop(Unit *mTarget)
   {
      RemoveAIUpdateEvent();
   }
   void OnDied(Unit * mKiller)
   {
      _unit->Despawn(30000,0);
      RemoveAIUpdateEvent();
   }
   void AIUpdate()
   {
        if(_unit->GetHealthPct() < 21 && !enrage)
        {
         SpellCastNew(spells[4],_unit);
         enrage = 1;
        }
      SpellCastVal(spells,_unit,0,nrspells);
   }
};







//--------------------------------------------------------------------------------------Bonechewer_Brawler
#define CN_Bonechewer_Brawler      23222
//Spells
#define SPELL_Frenzy      41254

class BonechewerBrawlerAI : public CreatureAIScript
{protected:
   int nrspells;
   SP_AI_Spell spells[1];
public:
   ADD_CREATURE_FACTORY_FUNCTION(BonechewerBrawlerAI);
   BonechewerBrawlerAI(Creature* pCreature) : CreatureAIScript(pCreature)
   {
      nrspells = 1;

      spells[0].info = dbcSpell.LookupEntry(SPELL_Frenzy);
      spells[0].targettype =TARGET_SELF;
      spells[0].cooldown = 17;
      spells[0].perctrigger = 20.0f;

   }
   void OnCombatStart(Unit* mTarget)
   {
      for(int i=0;i<nrspells;i++)  spells[i].Timer = 0;
      RegisterAIUpdateEvent(1000);
   }
   void OnCombatStop(Unit *mTarget)
   {
      RemoveAIUpdateEvent();
   }
   void OnDied(Unit * mKiller)
   {
      _unit->Despawn(30000,0);
      RemoveAIUpdateEvent();
   }
   void AIUpdate()
   {
      SpellCastVal(spells,_unit,0,nrspells);
   }
};




//--------------------------------------------------------------------------------------Bonechewer_Spectator
#define CN_Bonechewer_Spectator      23223
//Spells
#define SPELL_Charge_BS      36140
#define SPELL_Cleave_BS      40505
#define SPELL_Enrage_BS      8269
#define SPELL_Mortal_Wound      25646
#define SPELL_Strike_BS      13446
#define SPELL_Sunder_Armor      13444

class BonechewerSpectatorAI : public CreatureAIScript
{protected:
   int nrspells;
   SP_AI_Spell spells[6];
   bool enrage;
public:
   ADD_CREATURE_FACTORY_FUNCTION(BonechewerSpectatorAI);
   BonechewerSpectatorAI(Creature* pCreature) : CreatureAIScript(pCreature)
   {
      nrspells = 6;

      spells[0].info = dbcSpell.LookupEntry(SPELL_Charge_BS);
      spells[0].targettype =TARGET_RANDOM_SINGLE;
      spells[0].maxdist2cast=25.0f;
      spells[0].mindist2cast=8.0f;
      spells[0].cooldown = 14;
      spells[0].perctrigger = 20.0f;

      spells[1].info = dbcSpell.LookupEntry(SPELL_Cleave_BS);
      spells[1].targettype =TARGET_ATTACKING;
      spells[1].cooldown = 21;
      spells[1].perctrigger = 20.0f;

      spells[2].info = dbcSpell.LookupEntry(SPELL_Mortal_Wound);
      spells[2].targettype =TARGET_ATTACKING;
      spells[2].cooldown = 17;
      spells[2].perctrigger = 20.0f;

      spells[3].info = dbcSpell.LookupEntry(SPELL_Strike_BS);
      spells[3].targettype =TARGET_ATTACKING;
      spells[3].cooldown = 35;
      spells[3].perctrigger = 20.0f;

      spells[4].info = dbcSpell.LookupEntry(SPELL_Sunder_Armor);
      spells[4].targettype =TARGET_ATTACKING;
      spells[4].cooldown = 10;
      spells[4].perctrigger = 20.0f;

      spells[5].info = dbcSpell.LookupEntry(SPELL_Enrage_BS);
      spells[5].targettype =TARGET_ATTACKING;
      spells[5].perctrigger = 100.0f;
   }
   void OnCombatStart(Unit* mTarget)
   {
      for(int i=0;i<nrspells;i++)  spells[i].Timer = 0;
      nrspells = 5;
      enrage = 0;
      RegisterAIUpdateEvent(1000);
   }
   void OnCombatStop(Unit *mTarget)
   {
      RemoveAIUpdateEvent();
   }
   void OnDied(Unit * mKiller)
   {
      _unit->Despawn(30000,0);
      RemoveAIUpdateEvent();
   }
   void AIUpdate()
   {
        if(_unit->GetHealthPct() < 70 && !enrage)
        {
         SpellCastNew(spells[5],_unit);
         enrage = 1;
        }
      SpellCastVal(spells,_unit,0,nrspells);
   }
};




//--------------------------------------------------------------------------------------Mutant_War_Hound
#define CN_Mutant_War_Hound      23232
//Spells
#define SPELL_Cloud_of_Disease      41193

class MutantWarHoundAI : public CreatureAIScript
{protected:
   int nrspells;
   SP_AI_Spell spells[1];
public:
   ADD_CREATURE_FACTORY_FUNCTION(MutantWarHoundAI);
   MutantWarHoundAI(Creature* pCreature) : CreatureAIScript(pCreature)
   {
      nrspells = 1;

      spells[0].info = dbcSpell.LookupEntry(SPELL_Cloud_of_Disease);
      spells[0].targettype =TARGET_VARIOUS;
      spells[0].cooldown = 25;
      spells[0].perctrigger = 20.0f;

   }
   void OnCombatStart(Unit* mTarget)
   {
      for(int i=0;i<nrspells;i++)  spells[i].Timer = 0;
      RegisterAIUpdateEvent(1000);
   }
   void OnCombatStop(Unit *mTarget)
   {
      RemoveAIUpdateEvent();
   }
   void OnDied(Unit * mKiller)
   {
      _unit->Despawn(30000,0);
      RemoveAIUpdateEvent();
   }
   void AIUpdate()
   {
      SpellCastVal(spells,_unit,0,nrspells);
   }
};




//--------------------------------------------------------------------------------------Bonechewer_Blade_Fury
#define CN_Bonechewer_Blade_Fury      23235
//Spells
#define SPELL_Whirlwind_BBF      41195
#define SPELL_Whirlwind2_BBF      41194

class BonechewerBladeFuryAI : public CreatureAIScript
{protected:
   int nrspells;
   SP_AI_Spell spells[1];
public:
   ADD_CREATURE_FACTORY_FUNCTION(BonechewerBladeFuryAI);
   BonechewerBladeFuryAI(Creature* pCreature) : CreatureAIScript(pCreature)
   {
      nrspells = 1;

      spells[0].info = dbcSpell.LookupEntry(SPELL_Whirlwind_BBF);
      spells[0].targettype =TARGET_VARIOUS;
      spells[0].cooldown = 18;
      spells[0].perctrigger = 20.0f;

   }
   void OnCombatStart(Unit* mTarget)
   {
      for(int i=0;i<nrspells;i++)  spells[i].Timer = 0;
      RegisterAIUpdateEvent(1000);
   }
   void OnCombatStop(Unit *mTarget)
   {
      RemoveAIUpdateEvent();
   }
   void OnDied(Unit * mKiller)
   {
      _unit->Despawn(30000,0);
      RemoveAIUpdateEvent();
   }
   void AIUpdate()
   {
      SpellCastVal(spells,_unit,0,nrspells);
   }
};




//--------------------------------------------------------------------------------------Bonechewer_Shield_Disciple
#define CN_Bonechewer_Shield_Disciple      23236
//Spells
#define SPELL_Intervene      41198
#define SPELL_Shield_Bash      41197
#define SPELL_Shield_Wall      41196
#define SPELL_Throw_Shield      41213

class BonechewerShieldDiscipleAI : public CreatureAIScript
{protected:
   int nrspells;
   SP_AI_Spell spells[4];
public:
   ADD_CREATURE_FACTORY_FUNCTION(BonechewerShieldDiscipleAI);
   BonechewerShieldDiscipleAI(Creature* pCreature) : CreatureAIScript(pCreature)
   {
      nrspells = 4;

      spells[0].info = dbcSpell.LookupEntry(SPELL_Intervene);
      spells[0].targettype =TARGET_RANDOM_SINGLE;
      spells[0].maxdist2cast=25.0f;
      spells[0].mindist2cast=8.0f;
      spells[0].cooldown = 30;
      spells[0].perctrigger = 20.0f;

      spells[1].info = dbcSpell.LookupEntry(SPELL_Shield_Bash);
      spells[1].targettype =TARGET_ATTACKING;
      spells[1].cooldown = 10;
      spells[1].perctrigger = 20.0f;

      spells[2].info = dbcSpell.LookupEntry(SPELL_Shield_Wall);
      spells[2].targettype =TARGET_SELF;
      spells[2].cooldown = 24;
      spells[2].perctrigger = 20.0f;

      spells[3].info = dbcSpell.LookupEntry(SPELL_Throw_Shield);
      spells[3].targettype =TARGET_RANDOM_SINGLE;
      spells[3].maxdist2cast=45.0f;
      spells[3].mindist2cast=5.0f;
      spells[3].cooldown = 8;
      spells[3].perctrigger = 20.0f;

   }
   void OnCombatStart(Unit* mTarget)
   {
      for(int i=0;i<nrspells;i++)  spells[i].Timer = 0;
      RegisterAIUpdateEvent(1000);
   }
   void OnCombatStop(Unit *mTarget)
   {
      RemoveAIUpdateEvent();
   }
   void OnDied(Unit * mKiller)
   {
      _unit->Despawn(30000,0);
      RemoveAIUpdateEvent();
   }
   void AIUpdate()
   {
      SpellCastVal(spells,_unit,0,nrspells);
   }
};




//--------------------------------------------------------------------------------------Bonechewer_Blood_Prophet
#define CN_Bonechewer_Blood_Prophet      23237
//Spells
#define SPELL_Blood_Drain      41238
#define SPELL_Bloodbolt      41229
#define SPELL_Prophecy_of_Blood      41230
#define SPELL_Prophecy_of_Blood2      41231
#define SPELL_Enrage      8269

class BonechewerBloodProphetAI : public CreatureAIScript
{protected:
   int nrspells;
   SP_AI_Spell spells[5];
   bool enrage;
public:
   ADD_CREATURE_FACTORY_FUNCTION(BonechewerBloodProphetAI);
   BonechewerBloodProphetAI(Creature* pCreature) : CreatureAIScript(pCreature)
   {
      nrspells = 5;

      spells[0].info = dbcSpell.LookupEntry(SPELL_Blood_Drain);
      spells[0].targettype =TARGET_RANDOM_SINGLE;
      spells[0].maxdist2cast=20.0f;
      spells[0].cooldown = 12;
      spells[0].perctrigger = 20.0f;

      spells[1].info = dbcSpell.LookupEntry(SPELL_Bloodbolt);
      spells[1].targettype =TARGET_RANDOM_SINGLE;
      spells[1].maxdist2cast=40.0f;
      spells[1].cooldown = 17;
      spells[1].perctrigger = 20.0f;

      spells[2].info = dbcSpell.LookupEntry(SPELL_Prophecy_of_Blood);
      spells[2].maxdist2cast=20.0f;
      spells[2].targettype =TARGET_RANDOM_SINGLE;
      spells[2].cooldown = 33;
      spells[2].perctrigger = 20.0f;

      spells[3].info = dbcSpell.LookupEntry(SPELL_Prophecy_of_Blood2);
      spells[3].maxdist2cast=20.0f;
      spells[3].targettype =TARGET_RANDOM_SINGLE;
      spells[3].cooldown = 55;
      spells[3].perctrigger = 20.0f;
      
      spells[4].info = dbcSpell.LookupEntry(SPELL_Enrage);
      spells[4].targettype =TARGET_ATTACKING;
      spells[4].cooldown = 10;
      spells[4].perctrigger = 20.0f;

   }
   void OnCombatStart(Unit* mTarget)
   {
      for(int i=0;i<nrspells;i++)  spells[i].Timer = 0;
      nrspells = 4;
      enrage = 0;
      RegisterAIUpdateEvent(1000);
   }
   void OnCombatStop(Unit *mTarget)
   {
      RemoveAIUpdateEvent();
   }
   void OnDied(Unit * mKiller)
   {
      _unit->Despawn(30000,0);
      RemoveAIUpdateEvent();
   }
   void AIUpdate()
   {
        if(_unit->GetHealthPct() < 70 && !enrage)
        {
         SpellCastNew(spells[3],_unit);
         enrage = 1;
        }
      SpellCastVal(spells,_unit,0,nrspells);
   }
};




//--------------------------------------------------------------------------------------Dragonmaw_Wind_Reaver
#define CN_Dragonmaw_Wind_Reaver      23330
//Spells
#define SPELL_Doom_Bolt      40876
#define SPELL_Fireball      40877
#define SPELL_Freeze      40875

class DragonmawWindReaverAI : public CreatureAIScript
{protected:
   int nrspells;
   SP_AI_Spell spells[3];
public:
   ADD_CREATURE_FACTORY_FUNCTION(DragonmawWindReaverAI);
   DragonmawWindReaverAI(Creature* pCreature) : CreatureAIScript(pCreature)
   {
      nrspells = 3;

      spells[0].info = dbcSpell.LookupEntry(SPELL_Doom_Bolt);
      spells[0].targettype =TARGET_RANDOM_SINGLE;
      spells[0].maxdist2cast=40.0f;
      spells[0].instant=false;
      spells[0].cooldown = 11;
      spells[0].perctrigger = 20.0f;

      spells[1].info = dbcSpell.LookupEntry(SPELL_Fireball);
      spells[1].targettype =TARGET_RANDOM_SINGLE;
      spells[1].maxdist2cast=40.0f;
      spells[1].instant=false;
      spells[1].cooldown = 16;
      spells[1].perctrigger = 20.0f;

      spells[2].info = dbcSpell.LookupEntry(SPELL_Freeze);
      spells[2].targettype =TARGET_RANDOM_SINGLE;
      spells[2].maxdist2cast=60.0f;
      spells[2].instant=false;
      spells[2].cooldown = 24;
      spells[2].perctrigger = 20.0f;

   }
   void OnCombatStart(Unit* mTarget)
   {
      for(int i=0;i<nrspells;i++)  spells[i].Timer = 0;
      RegisterAIUpdateEvent(1000);
   }
   void OnCombatStop(Unit *mTarget)
   {
      RemoveAIUpdateEvent();
   }
   void OnDied(Unit * mKiller)
   {
      _unit->Despawn(30000,0);
      RemoveAIUpdateEvent();
   }
   void AIUpdate()
   {
      SpellCastVal(spells,_unit,0,nrspells);
   }
};




//--------------------------------------------------------------------------------------Illidari_Centurion
#define CN_Illidari_Centurion      23337
//Spells
#define SPELL_Cleave      15284
#define SPELL_Sonic_Strike      41168

class IllidariCenturionAI : public CreatureAIScript
{protected:
   int nrspells;
   SP_AI_Spell spells[2];
public:
   ADD_CREATURE_FACTORY_FUNCTION(IllidariCenturionAI);
   IllidariCenturionAI(Creature* pCreature) : CreatureAIScript(pCreature)
   {
      nrspells = 2;

      spells[0].info = dbcSpell.LookupEntry(SPELL_Cleave);
      spells[0].targettype =TARGET_ATTACKING;
      spells[0].cooldown = 11;
      spells[0].perctrigger = 20.0f;

      spells[1].info = dbcSpell.LookupEntry(SPELL_Sonic_Strike);
      spells[1].targettype =TARGET_SELF;
      spells[1].cooldown = 18;
      spells[1].perctrigger = 20.0f;

   }
   void OnCombatStart(Unit* mTarget)
   {
      for(int i=0;i<nrspells;i++)  spells[i].Timer = 0;
      RegisterAIUpdateEvent(1000);
   }
   void OnCombatStop(Unit *mTarget)
   {
      RemoveAIUpdateEvent();
   }
   void OnDied(Unit * mKiller)
   {
      _unit->Despawn(30000,0);
      RemoveAIUpdateEvent();
   }
   void AIUpdate()
   {
      SpellCastVal(spells,_unit,0,nrspells);
   }
};




//--------------------------------------------------------------------------------------Illidari_Heartseeker
#define CN_Illidari_Heartseeker      23339
//Spells
#define SPELL_Curse_of_the_Bleakheart      41170
#define SPELL_Rapid_Shot      41173
#define SPELL_Shoot_IH      41169
#define SPELL_Skeleton_Shot_IH      41171

class IllidariHeartseekerAI : public CreatureAIScript
{protected:
   int nrspells;
   SP_AI_Spell spells[4];
public:
   ADD_CREATURE_FACTORY_FUNCTION(IllidariHeartseekerAI);
   IllidariHeartseekerAI(Creature* pCreature) : CreatureAIScript(pCreature)
   {
      nrspells = 4;

      spells[0].info = dbcSpell.LookupEntry(SPELL_Curse_of_the_Bleakheart);
      spells[0].targettype =TARGET_RANDOM_SINGLE;
      spells[0].maxdist2cast=60.0f;
      spells[0].instant=false;
      spells[0].cooldown = 185;
      spells[0].perctrigger = 20.0f;

      spells[1].info = dbcSpell.LookupEntry(SPELL_Rapid_Shot);
      spells[1].targettype =TARGET_SELF;
      spells[1].cooldown = 17;
      spells[1].perctrigger = 20.0f;

      spells[2].info = dbcSpell.LookupEntry(SPELL_Shoot_IH);
      spells[2].targettype =TARGET_RANDOM_SINGLE;
      spells[2].maxdist2cast=30.0f;
      spells[2].mindist2cast=5.0f;
      spells[2].cooldown = 11;
      spells[2].perctrigger = 20.0f;

      spells[3].info = dbcSpell.LookupEntry(SPELL_Skeleton_Shot_IH);
      spells[3].targettype =TARGET_RANDOM_SINGLE;
      spells[3].maxdist2cast=45.0f;
      spells[3].mindist2cast=5.0f;
      spells[3].cooldown = 25;
      spells[3].perctrigger = 20.0f;

   }
   void OnCombatStart(Unit* mTarget)
   {
      for(int i=0;i<nrspells;i++)  spells[i].Timer = 0;
      RegisterAIUpdateEvent(1000);
   }
   void OnCombatStop(Unit *mTarget)
   {
      RemoveAIUpdateEvent();
   }
   void OnDied(Unit * mKiller)
   {
      _unit->Despawn(30000,0);
      RemoveAIUpdateEvent();
   }
   void AIUpdate()
   {
      SpellCastVal(spells,_unit,0,nrspells);
   }
};




//--------------------------------------------------------------------------------------Ashtongue_Stalker
#define CN_Ashtongue_Stalker      23374
//Spells
#define SPELL_Blind      34654
#define SPELL_Instant_Poison      41189
#define SPELL_Mindnumbing_Poison      41190
#define SPELL_Stealth      34189

class AshtongueStalkerAI : public CreatureAIScript
{protected:
   int nrspells;
   SP_AI_Spell spells[4];
public:
   ADD_CREATURE_FACTORY_FUNCTION(AshtongueStalkerAI);
   AshtongueStalkerAI(Creature* pCreature) : CreatureAIScript(pCreature)
   {
      nrspells = 4;

      spells[0].info = dbcSpell.LookupEntry(SPELL_Blind);
      spells[0].targettype =TARGET_RANDOM_SINGLE;
      spells[0].maxdist2cast=10.0f;
      spells[0].cooldown = 15;
      spells[0].perctrigger = 20.0f;

      spells[1].info = dbcSpell.LookupEntry(SPELL_Instant_Poison);
      spells[1].targettype =TARGET_RANDOM_SINGLE;
      spells[1].maxdist2cast=10.0f;
      spells[1].cooldown = 8;
      spells[1].perctrigger = 20.0f;

      spells[2].info = dbcSpell.LookupEntry(SPELL_Mindnumbing_Poison);
      spells[1].targettype =TARGET_RANDOM_SINGLE;
      spells[1].maxdist2cast=40.0f;
      spells[2].cooldown = 19;
      spells[2].perctrigger = 20.0f;

      spells[3].info = dbcSpell.LookupEntry(SPELL_Stealth);
      spells[3].targettype =TARGET_SELF;
      spells[3].cooldown = 125;
      spells[3].perctrigger = 20.0f;

   }
   void OnCombatStart(Unit* mTarget)
   {
      for(int i=0;i<nrspells;i++)  spells[i].Timer = 0;
      RegisterAIUpdateEvent(1000);
   }
   void OnCombatStop(Unit *mTarget)
   {
      RemoveAIUpdateEvent();
   }
   void OnDied(Unit * mKiller)
   {
      _unit->Despawn(30000,0);
      RemoveAIUpdateEvent();
   }
   void AIUpdate()
   {
      SpellCastVal(spells,_unit,0,nrspells);
   }
};




//--------------------------------------------------------------------------------------Angered_Soul_Fragment
#define CN_Angered_Soul_Fragment      23398
//Spells
#define SPELL_Anger      41986

class AngeredSoulFragmentAI : public CreatureAIScript
{protected:
   int nrspells;
   SP_AI_Spell spells[1];
public:
   ADD_CREATURE_FACTORY_FUNCTION(AngeredSoulFragmentAI);
   AngeredSoulFragmentAI(Creature* pCreature) : CreatureAIScript(pCreature)
   {
      nrspells = 1;

      spells[0].info = dbcSpell.LookupEntry(SPELL_Anger);
      spells[0].targettype =TARGET_SELF;
      spells[0].instant=false;
      spells[0].cooldown = 9;
      spells[0].perctrigger = 20.0f;

   }
   void OnCombatStart(Unit* mTarget)
   {
      for(int i=0;i<nrspells;i++)  spells[i].Timer = 0;
      RegisterAIUpdateEvent(1000);
   }
   void OnCombatStop(Unit *mTarget)
   {
      RemoveAIUpdateEvent();
   }
   void OnDied(Unit * mKiller)
   {
      _unit->Despawn(30000,0);
      RemoveAIUpdateEvent();
   }
   void AIUpdate()
   {
      SpellCastVal(spells,_unit,0,nrspells);
   }
};




//--------------------------------------------------------------------------------------Suffering_Soul_Fragment
#define CN_Suffering_Soul_Fragment      23399
//Spells
#define SPELL_Soul_Blast      41245

class SufferingSoulFragmentAI : public CreatureAIScript
{protected:
   int nrspells;
   SP_AI_Spell spells[1];
public:
   ADD_CREATURE_FACTORY_FUNCTION(SufferingSoulFragmentAI);
   SufferingSoulFragmentAI(Creature* pCreature) : CreatureAIScript(pCreature)
   {
      nrspells = 1;

      spells[0].info = dbcSpell.LookupEntry(SPELL_Soul_Blast);
      spells[0].targettype =TARGET_RANDOM_SINGLE;
      spells[0].instant=false;
      spells[0].maxdist2cast=20.0f;
      spells[0].cooldown = 12;
      spells[0].perctrigger = 20.0f;

   }
   void OnCombatStart(Unit* mTarget)
   {
      for(int i=0;i<nrspells;i++)  spells[i].Timer = 0;
      RegisterAIUpdateEvent(1000);
   }
   void OnCombatStop(Unit *mTarget)
   {
      RemoveAIUpdateEvent();
   }
   void OnDied(Unit * mKiller)
   {
      _unit->Despawn(30000,0);
      RemoveAIUpdateEvent();
   }
   void AIUpdate()
   {
      SpellCastVal(spells,_unit,0,nrspells);
   }
};




//--------------------------------------------------------------------------------------Hungering_Soul_Fragment
#define CN_Hungering_Soul_Fragment      23401
//Spells
#define SPELL_Consuming_Strikes      41248

class HungeringSoulFragmentAI : public CreatureAIScript
{protected:
   int nrspells;
   SP_AI_Spell spells[1];
public:
   ADD_CREATURE_FACTORY_FUNCTION(HungeringSoulFragmentAI);
   HungeringSoulFragmentAI(Creature* pCreature) : CreatureAIScript(pCreature)
   {
      nrspells = 1;

      spells[0].info = dbcSpell.LookupEntry(SPELL_Consuming_Strikes);
      spells[0].targettype =TARGET_SELF;
      spells[0].cooldown = 21;
      spells[0].perctrigger = 20.0f;

   }
   void OnCombatStart(Unit* mTarget)
   {
      for(int i=0;i<nrspells;i++)  spells[i].Timer = 0;
      RegisterAIUpdateEvent(1000);
   }
   void OnCombatStop(Unit *mTarget)
   {
      RemoveAIUpdateEvent();
   }
   void OnDied(Unit * mKiller)
   {
      _unit->Despawn(30000,0);
      RemoveAIUpdateEvent();
   }
   void AIUpdate()
   {
      SpellCastVal(spells,_unit,0,nrspells);
   }
};




//--------------------------------------------------------------------------------------Enslaved_Soul
#define CN_Enslaved_Soul      23469
//Spells
#define SPELL_Soul_Release      41542

class EnslavedSoulAI : public CreatureAIScript
{protected:
   int nrspells;
   SP_AI_Spell spells[1];
public:
   ADD_CREATURE_FACTORY_FUNCTION(EnslavedSoulAI);
   EnslavedSoulAI(Creature* pCreature) : CreatureAIScript(pCreature)
   {
      nrspells = 1;

      spells[0].info = dbcSpell.LookupEntry(SPELL_Soul_Release);
      spells[0].targettype =TARGET_SELF;
      spells[0].cooldown = 15;
      spells[0].perctrigger = 20.0f;

   }
   void OnCombatStart(Unit* mTarget)
   {
      for(int i=0;i<nrspells;i++)  spells[i].Timer = 0;
      RegisterAIUpdateEvent(1000);
   }
   void OnCombatStop(Unit *mTarget)
   {
      RemoveAIUpdateEvent();
   }
   void OnDied(Unit * mKiller)
   {
      _unit->Despawn(30000,0);
      RemoveAIUpdateEvent();
   }
   void AIUpdate()
   {
      SpellCastVal(spells,_unit,0,nrspells);
   }
};

//summons

//--------------------------------------------------------------------------------------Ashtongue_Searing_Totem
#define CN_Ashtongue_Searing_Totem      22896
//Spells
#define SPELL_Attack      39593

class AshtongueSearingTotemAI : public CreatureAIScript
{protected:
   int nrspells;
   SP_AI_Spell spells[1];
   int timer;
   bool desummon;
public:
   ADD_CREATURE_FACTORY_FUNCTION(AshtongueSearingTotemAI);
   AshtongueSearingTotemAI(Creature* pCreature) : CreatureAIScript(pCreature)
   {
      nrspells = 1;

      spells[0].info = dbcSpell.LookupEntry(SPELL_Attack);
      spells[0].targettype =TARGET_RANDOM_SINGLE;
      spells[0].instant=false;
      spells[0].maxdist2cast=40.0f;
      spells[0].cooldown = 23;
      spells[0].perctrigger = 20.0f;

   }
   void OnCombatStart(Unit* mTarget)
   {
      for(int i=0;i<nrspells;i++)  spells[i].Timer = 0;
      timer = 60;
      desummon = 0;
      RegisterAIUpdateEvent(1000);
   }
   void OnCombatStop(Unit *mTarget)
   {
      RemoveAIUpdateEvent();
   }
   void OnDied(Unit * mKiller)
   {
      _unit->Despawn(30000,0);
      RemoveAIUpdateEvent();
   }
   void AIUpdate()
   {
      if (!desummon && !timer)
      {
         _unit->Despawn(30000,0);
         desummon = 1;
         RemoveAIUpdateEvent();
      }
      else
      {
         timer--;
      }
      SpellCastVal(spells,_unit,0,nrspells);
   }
};

//--------------------------------------------------------------------------------------Cyclone Totem
#define CN_Cyclone_Totem      22894


class CycloneTotemAI : public CreatureAIScript
{protected:
   int timer;
   bool desummon;
public:
   ADD_CREATURE_FACTORY_FUNCTION(CycloneTotemAI);
   CycloneTotemAI(Creature* pCreature) : CreatureAIScript(pCreature)
   {


   }
   void OnCombatStart(Unit* mTarget)
   {
      timer = 60;
      desummon = 0;
      RegisterAIUpdateEvent(1000);
   }
   void OnCombatStop(Unit *mTarget)
   {
      RemoveAIUpdateEvent();
   }
   void OnDied(Unit * mKiller)
   {
      _unit->Despawn(30000,0);
      RemoveAIUpdateEvent();
   }
   void AIUpdate()
   {
      if (!desummon && !timer)
      {
         _unit->Despawn(30000,0);
         desummon = 1;
         RemoveAIUpdateEvent();
      }
      else
      {
         timer--;
      }
      //SpellCastVal(spells,_unit,0,nrspells);
   }
};

//--------------------------------------------------------------------------------------Cyclone Totem
#define CN_Summon_Windfury_Totem      22897


class SummonWindfuryTotemAI : public CreatureAIScript
{protected:
   int timer;
   bool desummon;
public:
   ADD_CREATURE_FACTORY_FUNCTION(SummonWindfuryTotemAI);
   SummonWindfuryTotemAI(Creature* pCreature) : CreatureAIScript(pCreature)
   {


   }
   void OnCombatStart(Unit* mTarget)
   {
      timer = 90;
      desummon = 0;
      RegisterAIUpdateEvent(1000);
   }
   void OnCombatStop(Unit *mTarget)
   {
      RemoveAIUpdateEvent();
   }
   void OnDied(Unit * mKiller)
   {
      _unit->Despawn(30000,0);
      RemoveAIUpdateEvent();
   }
   void AIUpdate()
   {
      if (!desummon && !timer)
      {
         _unit->Despawn(30000,0);
         desummon = 1;
         RemoveAIUpdateEvent();
      }
      else
      {
         timer--;
      }
      //SpellCastVal(spells,_unit,0,nrspells);
   }
};

//--------------------------------------------------------------------------------------Coilskar Geyser
#define CN_Coilskar_Geyser      23080


class CoilskarGeyserAI : public CreatureAIScript
{protected:

public:
   ADD_CREATURE_FACTORY_FUNCTION(CoilskarGeyserAI);
   CoilskarGeyserAI(Creature* pCreature) : CreatureAIScript(pCreature)
   {


   }
   void OnCombatStart(Unit* mTarget)
   {
      RegisterAIUpdateEvent(1000);
   }
   void OnCombatStop(Unit *mTarget)
   {
      RemoveAIUpdateEvent();
   }
   void OnDied(Unit * mKiller)
   {
      _unit->Despawn(30000,0);
      RemoveAIUpdateEvent();
   }
   void AIUpdate()
   {

      //SpellCastVal(spells,_unit,0,nrspells);
   }
};

//--------------------------------------------------------------------------------------Whirling Blade
#define CN_Whirling_Blade      23369


class WhirlingBladeAI : public CreatureAIScript
{protected:

public:
   ADD_CREATURE_FACTORY_FUNCTION(WhirlingBladeAI);
   WhirlingBladeAI(Creature* pCreature) : CreatureAIScript(pCreature)
   {


   }
   void OnCombatStart(Unit* mTarget)
   {
      RegisterAIUpdateEvent(1000);
   }
   void OnCombatStop(Unit *mTarget)
   {
      RemoveAIUpdateEvent();
   }
   void OnDied(Unit * mKiller)
   {
      _unit->Despawn(30000,0);
      RemoveAIUpdateEvent();
   }
   void AIUpdate()
   {
      //SpellCastVal(spells,_unit,0,nrspells);
   }
};

#define CN_Shadowmoon_Fallen      23371


class ShadowmoonFallenAI : public CreatureAIScript
{protected:

public:
   ADD_CREATURE_FACTORY_FUNCTION(ShadowmoonFallenAI);
   ShadowmoonFallenAI(Creature* pCreature) : CreatureAIScript(pCreature)
   {


   }
   void OnCombatStart(Unit* mTarget)
   {
      RegisterAIUpdateEvent(1000);
   }
   void OnCombatStop(Unit *mTarget)
   {
      RemoveAIUpdateEvent();
   }
   void OnDied(Unit * mKiller)
   {
      _unit->Despawn(30000,0);
      RemoveAIUpdateEvent();
   }
   void AIUpdate()
   {
      //SpellCastVal(spells,_unit,0,nrspells);
   }
};

//Houndmaster Flare Dummy

#define CN_Houndmaster_Flare_Dummy      23379


class HoundmasterFlareDummyAI : public CreatureAIScript
{protected:

public:
   ADD_CREATURE_FACTORY_FUNCTION(HoundmasterFlareDummyAI);
   HoundmasterFlareDummyAI(Creature* pCreature) : CreatureAIScript(pCreature)
   {


   }
   void OnCombatStart(Unit* mTarget)
   {
      RegisterAIUpdateEvent(1000);
   }
   void OnCombatStop(Unit *mTarget)
   {
      RemoveAIUpdateEvent();
   }
   void OnDied(Unit * mKiller)
   {
      _unit->Despawn(30000,0);
      RemoveAIUpdateEvent();
   }
   void AIUpdate()
   {
      //SpellCastVal(spells,_unit,0,nrspells);
   }
};

//--------------------------------------------------------------------------------------Shadowmoon_Riding_Hound
#define CN_Shadowmoon_Riding_Hound      23083
//Spells
#define SPELL_Carnivorous_Bite      41092
#define SPELL_Charge_SRH      25821
#define SPELL_Enrage_SRH      8599

class ShadowmoonRidingHoundAI : public CreatureAIScript
{protected:
   int nrspells;
   SP_AI_Spell spells[3];
   bool enrage;
public:
   ADD_CREATURE_FACTORY_FUNCTION(ShadowmoonRidingHoundAI);
   ShadowmoonRidingHoundAI(Creature* pCreature) : CreatureAIScript(pCreature)
   {
      nrspells = 3;

      spells[0].info = dbcSpell.LookupEntry(SPELL_Carnivorous_Bite);
      spells[0].targettype =TARGET_ATTACKING;
      spells[0].cooldown = 17;
      spells[0].perctrigger = 20.0f;

      spells[1].info = dbcSpell.LookupEntry(SPELL_Charge_SRH);
      spells[1].targettype =TARGET_RANDOM_SINGLE;
      spells[1].maxdist2cast=40.0f;
      spells[1].cooldown = 12;
      spells[1].perctrigger = 20.0f;

      spells[2].info = dbcSpell.LookupEntry(SPELL_Enrage_SRH);
      spells[2].targettype =TARGET_SELF;
      spells[2].perctrigger = 100.0f;

   }
   void OnCombatStart(Unit* mTarget)
   {
      for(int i=0;i<nrspells;i++)  spells[i].Timer = 0;
      nrspells = 2;
      RegisterAIUpdateEvent(1000);
   }
   void OnCombatStop(Unit *mTarget)
   {
      RemoveAIUpdateEvent();
   }
   void OnDied(Unit * mKiller)
   {
      _unit->Despawn(30000,0);
      RemoveAIUpdateEvent();
   }
   void AIUpdate()
   {
          if(_unit->GetHealthPct() < 50 && !enrage)
        {
         SpellCastNew(spells[2],_unit);
         enrage = 1;

        }
      SpellCastVal(spells,_unit,0,nrspells);
   }
};

   //mobs trash
   mgr->register_creature_script(Aqueous_Lord, &AqueousLordAI::Create);
   mgr->register_creature_script(Aqueous_Spawn, &AqueousSpawnAI::Create);
   mgr->register_creature_script(Bonechewer_Worker, &BonechewerWorkerAI::Create);
   mgr->register_creature_script(Coilskar_Harpooner, &CoilskarHarpoonerAI::Create);
   mgr->register_creature_script(Coilskar_Soothsayer, &CoilskarSoothsayerAI::Create);
   mgr->register_creature_script(Dragon_Turtle, &DragonTurtleAI::Create);
   mgr->register_creature_script(CN_Ashtongue_Battlelord, &AshtongueBattlelordAI::Create);
   mgr->register_creature_script(CN_Ashtongue_Mystic, &AshtongueMysticAI::Create);
   mgr->register_creature_script(CN_Ashtongue_Stormcaller, &AshtongueStormcallerAI::Create);
   mgr->register_creature_script(CN_Ashtongue_Primalist, &AshtonguePrimalistAI::Create);
   mgr->register_creature_script(CN_Storm_Fury, &StormFuryAI::Create);
   mgr->register_creature_script(CN_Ashtongue_Feral_Spirit, &AshtongueFeralSpiritAI::Create);
   mgr->register_creature_script(CN_Illidari_Defiler, &IllidariDefilerAI::Create);
   mgr->register_creature_script(CN_Illidari_Nightlord, &IllidariNightlordAI::Create);
   mgr->register_creature_script(CN_Illidari_Boneslicer, &IllidariBoneslicerAI::Create);
   mgr->register_creature_script(CN_Coilskar_General, &CoilskarGeneralAI::Create);
   mgr->register_creature_script(CN_Coilskar_SeaCaller, &CoilskarSeaCallerAI::Create);
   mgr->register_creature_script(CN_Coilskar_Wrangler, &CoilskarWranglerAI::Create);
   mgr->register_creature_script(CN_Shadowmoon_Reaver, &ShadowmoonReaverAI::Create);
   mgr->register_creature_script(CN_Shadowmoon_Champion, &ShadowmoonChampionAI::Create);
   mgr->register_creature_script(CN_Aqueous_Surger, &AqueousSurgerAI::Create);
   mgr->register_creature_script(CN_Shadowmoon_Deathshaper, &ShadowmoonDeathshaperAI::Create);
   mgr->register_creature_script(CN_Leviathan, &LeviathanAI::Create);
   mgr->register_creature_script(CN_Shadowmoon_Blood_Mage, &ShadowmoonBloodMageAI::Create);
   mgr->register_creature_script(CN_Wrathbone_Flayer, &WrathboneFlayerAI::Create);
   mgr->register_creature_script(CN_Illidari_Fearbringer, &IllidariFearbringerAI::Create);
   mgr->register_creature_script(CN_Dragonmaw_Wyrmcaller, &DragonmawWyrmcallerAI::Create);
   mgr->register_creature_script(CN_Shadowmoon_Houndmaster, &ShadowmoonHoundmasterAI::Create);
   mgr->register_creature_script(CN_Bonechewer_Taskmaster, &BonechewerTaskmasterAI::Create);
   mgr->register_creature_script(CN_Dragonmaw_Sky_Stalker, &DragonmawSkyStalkerAI::Create);
   mgr->register_creature_script(CN_Shadowmoon_Soldier, &ShadowmoonSoldierAI::Create);
   mgr->register_creature_script(CN_Shadowmoon_Weapon_Master, &ShadowmoonWeaponMasterAI::Create);
   mgr->register_creature_script(CN_Hand_of_Gorefiend, &HandofGorefiendAI::Create);
   mgr->register_creature_script(CN_Bonechewer_Behemoth, &BonechewerBehemothAI::Create);
   mgr->register_creature_script(CN_Bonechewer_Brawler, &BonechewerBrawlerAI::Create);
   mgr->register_creature_script(CN_Bonechewer_Spectator, &BonechewerSpectatorAI::Create);
   mgr->register_creature_script(CN_Mutant_War_Hound, &MutantWarHoundAI::Create);
   mgr->register_creature_script(CN_Bonechewer_Blade_Fury, &BonechewerBladeFuryAI::Create);
   mgr->register_creature_script(CN_Bonechewer_Shield_Disciple, &BonechewerShieldDiscipleAI::Create);
   mgr->register_creature_script(CN_Bonechewer_Blood_Prophet, &BonechewerBloodProphetAI::Create);
   mgr->register_creature_script(CN_Dragonmaw_Wind_Reaver, &DragonmawWindReaverAI::Create);
   mgr->register_creature_script(CN_Illidari_Centurion, &IllidariCenturionAI::Create);
   mgr->register_creature_script(CN_Illidari_Heartseeker, &IllidariHeartseekerAI::Create);
   mgr->register_creature_script(CN_Ashtongue_Stalker, &AshtongueStalkerAI::Create);
   mgr->register_creature_script(CN_Angered_Soul_Fragment, &AngeredSoulFragmentAI::Create);
   mgr->register_creature_script(CN_Suffering_Soul_Fragment, &SufferingSoulFragmentAI::Create);
   mgr->register_creature_script(CN_Hungering_Soul_Fragment, &HungeringSoulFragmentAI::Create);
   mgr->register_creature_script(CN_Enslaved_Soul, &EnslavedSoulAI::Create);
   
   //summons from trash
   mgr->register_creature_script(CN_Ashtongue_Searing_Totem, &AshtongueSearingTotemAI::Create);
   mgr->register_creature_script(CN_Cyclone_Totem, &CycloneTotemAI::Create);
   mgr->register_creature_script(CN_Summon_Windfury_Totem, &SummonWindfuryTotemAI::Create);
   mgr->register_creature_script(CN_Coilskar_Geyser, &CoilskarGeyserAI::Create);
   mgr->register_creature_script(CN_Whirling_Blade, &WhirlingBladeAI::Create);
   mgr->register_creature_script(CN_Shadowmoon_Fallen, &ShadowmoonFallenAI::Create);
   mgr->register_creature_script(CN_Houndmaster_Flare_Dummy, &HoundmasterFlareDummyAI::Create);
   mgr->register_creature_script(CN_Shadowmoon_Riding_Hound, &ShadowmoonRidingHoundAI::Create);



>>>By AscentEmu<<<

Edited by bLuma
codebox

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×