MichaelCrow

dire maul arena

Jan 12th, 2023
955
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 142.88 KB | None | 0 0
  1. From ea166c6383d167214462051bc3da4e1d1860c5c8 Mon Sep 17 00:00:00 2001
  2. From: LordPsyan <realmsofwarcraft@gmail.com>
  3. Date: Sun, 28 Jan 2018 09:07:19 -0500
  4. Subject: [PATCH] 2018_01_27-Dire_Maul_Arena
  5.  
  6. ---
  7.  .../Dire_Maul/world_dire_maul_arena.sql            |   29 +
  8.  src/server/scripts/Custom/custom_script_loader.cpp |    6 +-
  9.  src/server/scripts/Custom/npcs_dm_battle.cpp       | 2480 ++++++++++++++++++++
  10.  src/server/scripts/Custom/npcs_dm_battle.h         |  369 +++
  11.  4 files changed, 2882 insertions(+), 2 deletions(-)
  12.  create mode 100644 sql/LordPsyan-Patches/Dire_Maul/world_dire_maul_arena.sql
  13.  create mode 100644 src/server/scripts/Custom/npcs_dm_battle.cpp
  14.  create mode 100644 src/server/scripts/Custom/npcs_dm_battle.h
  15.  
  16. diff --git a/sql/LordPsyan-Patches/Dire_Maul/world_dire_maul_arena.sql b/sql/LordPsyan-Patches/Dire_Maul/world_dire_maul_arena.sql
  17. new file mode 100644
  18. index 0000000..496ad46
  19. --- /dev/null
  20. +++ b/sql/LordPsyan-Patches/Dire_Maul/world_dire_maul_arena.sql
  21. @@ -0,0 +1,29 @@
  22. +
  23. +REPLACE INTO `creature_template`(`entry`,`difficulty_entry_1`,`difficulty_entry_2`,`difficulty_entry_3`,`KillCredit1`,`KillCredit2`,`modelid1`,`modelid2`,`modelid3`,`modelid4`,`name`,`subname`,`IconName`,`gossip_menu_id`,`minlevel`,`maxlevel`,`exp`,`faction`,`npcflag`,`speed_walk`,`speed_run`,`scale`,`rank`,`dmgschool`,`BaseAttackTime`,`RangeAttackTime`,`BaseVariance`,`RangeVariance`,`unit_class`,`unit_flags`,`unit_flags2`,`dynamicflags`,`family`,`trainer_type`,`trainer_spell`,`trainer_class`,`trainer_race`,`type`,`type_flags`,`lootid`,`pickpocketloot`,`skinloot`,`resistance1`,`resistance2`,`resistance3`,`resistance4`,`resistance5`,`resistance6`,`spell1`,`spell2`,`spell3`,`spell4`,`spell5`,`spell6`,`spell7`,`spell8`,`PetSpellDataId`,`VehicleId`,`mingold`,`maxgold`,`AIName`,`MovementType`,`InhabitType`,`HoverHeight`,`HealthModifier`,`ManaModifier`,`ArmorModifier`,`DamageModifier`,`ExperienceModifier`,`RacialLeader`,`movementId`,`RegenHealth`,`mechanic_immune_mask`,`flags_extra`,`ScriptName`,`VerifiedBuild`) values (88002,0,0,0,0,0,18653,18653,18653,18653,'Mini Blood Guard','','',0,80,80,0,16,0,1,1.14286,1,0,0,1209,1414,1,1,1,0,0,0,0,0,0,0,0,0,7,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,3,'',0,1,0,0,0,0,0,0,0,1,1,0,0,'npc_red_blood_mini',12340);
  24. +REPLACE INTO `creature_template`(`entry`,`difficulty_entry_1`,`difficulty_entry_2`,`difficulty_entry_3`,`KillCredit1`,`KillCredit2`,`modelid1`,`modelid2`,`modelid3`,`modelid4`,`name`,`subname`,`IconName`,`gossip_menu_id`,`minlevel`,`maxlevel`,`exp`,`faction`,`npcflag`,`speed_walk`,`speed_run`,`scale`,`rank`,`dmgschool`,`BaseAttackTime`,`RangeAttackTime`,`BaseVariance`,`RangeVariance`,`unit_class`,`unit_flags`,`unit_flags2`,`dynamicflags`,`family`,`trainer_type`,`trainer_spell`,`trainer_class`,`trainer_race`,`type`,`type_flags`,`lootid`,`pickpocketloot`,`skinloot`,`resistance1`,`resistance2`,`resistance3`,`resistance4`,`resistance5`,`resistance6`,`spell1`,`spell2`,`spell3`,`spell4`,`spell5`,`spell6`,`spell7`,`spell8`,`PetSpellDataId`,`VehicleId`,`mingold`,`maxgold`,`AIName`,`MovementType`,`InhabitType`,`HoverHeight`,`HealthModifier`,`ManaModifier`,`ArmorModifier`,`DamageModifier`,`ExperienceModifier`,`RacialLeader`,`movementId`,`RegenHealth`,`mechanic_immune_mask`,`flags_extra`,`ScriptName`,`VerifiedBuild`) values (88003,0,0,0,0,0,18653,18653,18653,18653,'Mini Blood Guard','','',0,80,80,0,16,0,1,1.14286,1,0,0,781,834,1,1,1,0,0,0,0,0,0,0,0,0,7,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,3,'',0,1,0,0,0,0,0,1,0,1,1,0,0,'npc_red_blood_mini',12340);
  25. +REPLACE INTO `creature_template`(`entry`,`difficulty_entry_1`,`difficulty_entry_2`,`difficulty_entry_3`,`KillCredit1`,`KillCredit2`,`modelid1`,`modelid2`,`modelid3`,`modelid4`,`name`,`subname`,`IconName`,`gossip_menu_id`,`minlevel`,`maxlevel`,`exp`,`faction`,`npcflag`,`speed_walk`,`speed_run`,`scale`,`rank`,`dmgschool`,`BaseAttackTime`,`RangeAttackTime`,`BaseVariance`,`RangeVariance`,`unit_class`,`unit_flags`,`unit_flags2`,`dynamicflags`,`family`,`trainer_type`,`trainer_spell`,`trainer_class`,`trainer_race`,`type`,`type_flags`,`lootid`,`pickpocketloot`,`skinloot`,`resistance1`,`resistance2`,`resistance3`,`resistance4`,`resistance5`,`resistance6`,`spell1`,`spell2`,`spell3`,`spell4`,`spell5`,`spell6`,`spell7`,`spell8`,`PetSpellDataId`,`VehicleId`,`mingold`,`maxgold`,`AIName`,`MovementType`,`InhabitType`,`HoverHeight`,`HealthModifier`,`ManaModifier`,`ArmorModifier`,`DamageModifier`,`ExperienceModifier`,`RacialLeader`,`movementId`,`RegenHealth`,`mechanic_immune_mask`,`flags_extra`,`ScriptName`,`VerifiedBuild`) values (88004,0,0,0,0,0,18653,18653,18653,18653,'Mini Blood Guard','','',0,80,80,0,16,0,1,1.14286,1,0,0,781,982,1,1,1,0,0,0,0,0,0,0,0,0,7,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,3,'',0,1,0,0,0,0,0,1,0,1,1,0,0,'npc_red_blood_mini',12340);
  26. +REPLACE INTO `creature_template`(`entry`,`difficulty_entry_1`,`difficulty_entry_2`,`difficulty_entry_3`,`KillCredit1`,`KillCredit2`,`modelid1`,`modelid2`,`modelid3`,`modelid4`,`name`,`subname`,`IconName`,`gossip_menu_id`,`minlevel`,`maxlevel`,`exp`,`faction`,`npcflag`,`speed_walk`,`speed_run`,`scale`,`rank`,`dmgschool`,`BaseAttackTime`,`RangeAttackTime`,`BaseVariance`,`RangeVariance`,`unit_class`,`unit_flags`,`unit_flags2`,`dynamicflags`,`family`,`trainer_type`,`trainer_spell`,`trainer_class`,`trainer_race`,`type`,`type_flags`,`lootid`,`pickpocketloot`,`skinloot`,`resistance1`,`resistance2`,`resistance3`,`resistance4`,`resistance5`,`resistance6`,`spell1`,`spell2`,`spell3`,`spell4`,`spell5`,`spell6`,`spell7`,`spell8`,`PetSpellDataId`,`VehicleId`,`mingold`,`maxgold`,`AIName`,`MovementType`,`InhabitType`,`HoverHeight`,`HealthModifier`,`ManaModifier`,`ArmorModifier`,`DamageModifier`,`ExperienceModifier`,`RacialLeader`,`movementId`,`RegenHealth`,`mechanic_immune_mask`,`flags_extra`,`ScriptName`,`VerifiedBuild`) values (88500,0,0,0,0,0,169,0,0,0,'Wave Spawn Trigger','','',0,1,1,0,16,0,1,1.14286,1,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,'',0,1,0,0,0,0,0,1,0,1,1,0,0,'npc_dm_wave_trigger',12340);
  27. +REPLACE INTO `creature_template`(`entry`,`difficulty_entry_1`,`difficulty_entry_2`,`difficulty_entry_3`,`KillCredit1`,`KillCredit2`,`modelid1`,`modelid2`,`modelid3`,`modelid4`,`name`,`subname`,`IconName`,`gossip_menu_id`,`minlevel`,`maxlevel`,`exp`,`faction`,`npcflag`,`speed_walk`,`speed_run`,`scale`,`rank`,`dmgschool`,`BaseAttackTime`,`RangeAttackTime`,`BaseVariance`,`RangeVariance`,`unit_class`,`unit_flags`,`unit_flags2`,`dynamicflags`,`family`,`trainer_type`,`trainer_spell`,`trainer_class`,`trainer_race`,`type`,`type_flags`,`lootid`,`pickpocketloot`,`skinloot`,`resistance1`,`resistance2`,`resistance3`,`resistance4`,`resistance5`,`resistance6`,`spell1`,`spell2`,`spell3`,`spell4`,`spell5`,`spell6`,`spell7`,`spell8`,`PetSpellDataId`,`VehicleId`,`mingold`,`maxgold`,`AIName`,`MovementType`,`InhabitType`,`HoverHeight`,`HealthModifier`,`ManaModifier`,`ArmorModifier`,`DamageModifier`,`ExperienceModifier`,`RacialLeader`,`movementId`,`RegenHealth`,`mechanic_immune_mask`,`flags_extra`,`ScriptName`,`VerifiedBuild`) values (88501,0,0,0,0,0,27393,0,0,0,'Portal','','',0,1,1,0,35,0,1,1.14286,1,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,10,1024,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,12,'',0,1,0,0,0,0,0,1,0,1,1,0,0,'npc_dm_wave_portals',12340);
  28. +REPLACE INTO `creature_template`(`entry`,`difficulty_entry_1`,`difficulty_entry_2`,`difficulty_entry_3`,`KillCredit1`,`KillCredit2`,`modelid1`,`modelid2`,`modelid3`,`modelid4`,`name`,`subname`,`IconName`,`gossip_menu_id`,`minlevel`,`maxlevel`,`exp`,`faction`,`npcflag`,`speed_walk`,`speed_run`,`scale`,`rank`,`dmgschool`,`BaseAttackTime`,`RangeAttackTime`,`BaseVariance`,`RangeVariance`,`unit_class`,`unit_flags`,`unit_flags2`,`dynamicflags`,`family`,`trainer_type`,`trainer_spell`,`trainer_class`,`trainer_race`,`type`,`type_flags`,`lootid`,`pickpocketloot`,`skinloot`,`resistance1`,`resistance2`,`resistance3`,`resistance4`,`resistance5`,`resistance6`,`spell1`,`spell2`,`spell3`,`spell4`,`spell5`,`spell6`,`spell7`,`spell8`,`PetSpellDataId`,`VehicleId`,`mingold`,`maxgold`,`AIName`,`MovementType`,`InhabitType`,`HoverHeight`,`HealthModifier`,`ManaModifier`,`ArmorModifier`,`DamageModifier`,`ExperienceModifier`,`RacialLeader`,`movementId`,`RegenHealth`,`mechanic_immune_mask`,`flags_extra`,`ScriptName`,`VerifiedBuild`) values (88001,0,0,0,0,0,18653,18653,18653,18653,'Red Blood Guard','','',0,80,80,0,16,0,1,1.14286,1,0,0,781,1021,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,13,'',0,1,0,0,0,0,0,1,0,1,1,0,0,'npc_dire_maul_rb_guard',12340);
  29. +REPLACE INTO `creature_template`(`entry`,`difficulty_entry_1`,`difficulty_entry_2`,`difficulty_entry_3`,`KillCredit1`,`KillCredit2`,`modelid1`,`modelid2`,`modelid3`,`modelid4`,`name`,`subname`,`IconName`,`gossip_menu_id`,`minlevel`,`maxlevel`,`exp`,`faction`,`npcflag`,`speed_walk`,`speed_run`,`scale`,`rank`,`dmgschool`,`BaseAttackTime`,`RangeAttackTime`,`BaseVariance`,`RangeVariance`,`unit_class`,`unit_flags`,`unit_flags2`,`dynamicflags`,`family`,`trainer_type`,`trainer_spell`,`trainer_class`,`trainer_race`,`type`,`type_flags`,`lootid`,`pickpocketloot`,`skinloot`,`resistance1`,`resistance2`,`resistance3`,`resistance4`,`resistance5`,`resistance6`,`spell1`,`spell2`,`spell3`,`spell4`,`spell5`,`spell6`,`spell7`,`spell8`,`PetSpellDataId`,`VehicleId`,`mingold`,`maxgold`,`AIName`,`MovementType`,`InhabitType`,`HoverHeight`,`HealthModifier`,`ManaModifier`,`ArmorModifier`,`DamageModifier`,`ExperienceModifier`,`RacialLeader`,`movementId`,`RegenHealth`,`mechanic_immune_mask`,`flags_extra`,`ScriptName`,`VerifiedBuild`) values (80700,0,0,0,0,0,28930,28930,28930,28930,'Arena Commander','Arena Commander','',0,80,80,0,35,1,1,0.91,1,3,0,4781,6231,1,1,1,0,0,0,0,0,0,0,0,0,7,0,0,0,100,7,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,5,'',0,1,0,0,0,0,0,1,0,1,1,0,0,'npc_dire_arena_commander',12340);
  30. +REPLACE INTO `creature_template`(`entry`,`difficulty_entry_1`,`difficulty_entry_2`,`difficulty_entry_3`,`KillCredit1`,`KillCredit2`,`modelid1`,`modelid2`,`modelid3`,`modelid4`,`name`,`subname`,`IconName`,`gossip_menu_id`,`minlevel`,`maxlevel`,`exp`,`faction`,`npcflag`,`speed_walk`,`speed_run`,`scale`,`rank`,`dmgschool`,`BaseAttackTime`,`RangeAttackTime`,`BaseVariance`,`RangeVariance`,`unit_class`,`unit_flags`,`unit_flags2`,`dynamicflags`,`family`,`trainer_type`,`trainer_spell`,`trainer_class`,`trainer_race`,`type`,`type_flags`,`lootid`,`pickpocketloot`,`skinloot`,`resistance1`,`resistance2`,`resistance3`,`resistance4`,`resistance5`,`resistance6`,`spell1`,`spell2`,`spell3`,`spell4`,`spell5`,`spell6`,`spell7`,`spell8`,`PetSpellDataId`,`VehicleId`,`mingold`,`maxgold`,`AIName`,`MovementType`,`InhabitType`,`HoverHeight`,`HealthModifier`,`ManaModifier`,`ArmorModifier`,`DamageModifier`,`ExperienceModifier`,`RacialLeader`,`movementId`,`RegenHealth`,`mechanic_immune_mask`,`flags_extra`,`ScriptName`,`VerifiedBuild`) values (80050,0,0,0,0,0,24842,0,0,0,'Garm Watcher','','',0,80,80,0,16,0,1,1.14286,1,0,0,387,543,1,1,1,0,0,0,0,0,0,0,0,0,7,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,3,'',0,1,0,0,0,0,0,1,0,1,1,0,0,'npc_dm_wave_spawns',12340);
  31. +REPLACE INTO `creature_template`(`entry`,`difficulty_entry_1`,`difficulty_entry_2`,`difficulty_entry_3`,`KillCredit1`,`KillCredit2`,`modelid1`,`modelid2`,`modelid3`,`modelid4`,`name`,`subname`,`IconName`,`gossip_menu_id`,`minlevel`,`maxlevel`,`exp`,`faction`,`npcflag`,`speed_walk`,`speed_run`,`scale`,`rank`,`dmgschool`,`BaseAttackTime`,`RangeAttackTime`,`BaseVariance`,`RangeVariance`,`unit_class`,`unit_flags`,`unit_flags2`,`dynamicflags`,`family`,`trainer_type`,`trainer_spell`,`trainer_class`,`trainer_race`,`type`,`type_flags`,`lootid`,`pickpocketloot`,`skinloot`,`resistance1`,`resistance2`,`resistance3`,`resistance4`,`resistance5`,`resistance6`,`spell1`,`spell2`,`spell3`,`spell4`,`spell5`,`spell6`,`spell7`,`spell8`,`PetSpellDataId`,`VehicleId`,`mingold`,`maxgold`,`AIName`,`MovementType`,`InhabitType`,`HoverHeight`,`HealthModifier`,`ManaModifier`,`ArmorModifier`,`DamageModifier`,`ExperienceModifier`,`RacialLeader`,`movementId`,`RegenHealth`,`mechanic_immune_mask`,`flags_extra`,`ScriptName`,`VerifiedBuild`) values (80051,0,0,0,0,0,26740,0,0,0,'Frigid Proto-Drake','','',0,80,80,0,16,0,1,1.14286,1,0,2,422,586,1,1,2,0,0,0,0,0,0,0,0,0,7,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,3,'',0,1,0,0,0,0,0,1,0,1,1,0,0,'npc_dm_wave_spawns',12340);
  32. +REPLACE INTO `creature_template`(`entry`,`difficulty_entry_1`,`difficulty_entry_2`,`difficulty_entry_3`,`KillCredit1`,`KillCredit2`,`modelid1`,`modelid2`,`modelid3`,`modelid4`,`name`,`subname`,`IconName`,`gossip_menu_id`,`minlevel`,`maxlevel`,`exp`,`faction`,`npcflag`,`speed_walk`,`speed_run`,`scale`,`rank`,`dmgschool`,`BaseAttackTime`,`RangeAttackTime`,`BaseVariance`,`RangeVariance`,`unit_class`,`unit_flags`,`unit_flags2`,`dynamicflags`,`family`,`trainer_type`,`trainer_spell`,`trainer_class`,`trainer_race`,`type`,`type_flags`,`lootid`,`pickpocketloot`,`skinloot`,`resistance1`,`resistance2`,`resistance3`,`resistance4`,`resistance5`,`resistance6`,`spell1`,`spell2`,`spell3`,`spell4`,`spell5`,`spell6`,`spell7`,`spell8`,`PetSpellDataId`,`VehicleId`,`mingold`,`maxgold`,`AIName`,`MovementType`,`InhabitType`,`HoverHeight`,`HealthModifier`,`ManaModifier`,`ArmorModifier`,`DamageModifier`,`ExperienceModifier`,`RacialLeader`,`movementId`,`RegenHealth`,`mechanic_immune_mask`,`flags_extra`,`ScriptName`,`VerifiedBuild`) values (80052,0,0,0,0,0,25495,0,0,0,'Osterkil','','',0,80,80,0,16,0,1,1.14286,1,0,0,431,582,1,1,1,0,0,0,0,0,0,0,0,0,7,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,3,'',0,1,0,0,0,0,0,1,0,1,1,0,0,'npc_dm_wave_spawns',12340);
  33. +REPLACE INTO `creature_template`(`entry`,`difficulty_entry_1`,`difficulty_entry_2`,`difficulty_entry_3`,`KillCredit1`,`KillCredit2`,`modelid1`,`modelid2`,`modelid3`,`modelid4`,`name`,`subname`,`IconName`,`gossip_menu_id`,`minlevel`,`maxlevel`,`exp`,`faction`,`npcflag`,`speed_walk`,`speed_run`,`scale`,`rank`,`dmgschool`,`BaseAttackTime`,`RangeAttackTime`,`BaseVariance`,`RangeVariance`,`unit_class`,`unit_flags`,`unit_flags2`,`dynamicflags`,`family`,`trainer_type`,`trainer_spell`,`trainer_class`,`trainer_race`,`type`,`type_flags`,`lootid`,`pickpocketloot`,`skinloot`,`resistance1`,`resistance2`,`resistance3`,`resistance4`,`resistance5`,`resistance6`,`spell1`,`spell2`,`spell3`,`spell4`,`spell5`,`spell6`,`spell7`,`spell8`,`PetSpellDataId`,`VehicleId`,`mingold`,`maxgold`,`AIName`,`MovementType`,`InhabitType`,`HoverHeight`,`HealthModifier`,`ManaModifier`,`ArmorModifier`,`DamageModifier`,`ExperienceModifier`,`RacialLeader`,`movementId`,`RegenHealth`,`mechanic_immune_mask`,`flags_extra`,`ScriptName`,`VerifiedBuild`) values (80053,0,0,0,0,0,27541,0,0,0,'Blight Falconer','','',0,80,80,0,16,0,1,1.14286,1,0,0,417,582,1,1,1,0,0,0,0,0,0,0,0,0,7,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,3,'',0,1,0,0,0,0,0,1,0,1,1,0,0,'npc_dm_wave_spawns',12340);
  34. +REPLACE INTO `creature_template`(`entry`,`difficulty_entry_1`,`difficulty_entry_2`,`difficulty_entry_3`,`KillCredit1`,`KillCredit2`,`modelid1`,`modelid2`,`modelid3`,`modelid4`,`name`,`subname`,`IconName`,`gossip_menu_id`,`minlevel`,`maxlevel`,`exp`,`faction`,`npcflag`,`speed_walk`,`speed_run`,`scale`,`rank`,`dmgschool`,`BaseAttackTime`,`RangeAttackTime`,`BaseVariance`,`RangeVariance`,`unit_class`,`unit_flags`,`unit_flags2`,`dynamicflags`,`family`,`trainer_type`,`trainer_spell`,`trainer_class`,`trainer_race`,`type`,`type_flags`,`lootid`,`pickpocketloot`,`skinloot`,`resistance1`,`resistance2`,`resistance3`,`resistance4`,`resistance5`,`resistance6`,`spell1`,`spell2`,`spell3`,`spell4`,`spell5`,`spell6`,`spell7`,`spell8`,`PetSpellDataId`,`VehicleId`,`mingold`,`maxgold`,`AIName`,`MovementType`,`InhabitType`,`HoverHeight`,`HealthModifier`,`ManaModifier`,`ArmorModifier`,`DamageModifier`,`ExperienceModifier`,`RacialLeader`,`movementId`,`RegenHealth`,`mechanic_immune_mask`,`flags_extra`,`ScriptName`,`VerifiedBuild`) values (80054,0,0,0,0,0,27776,27777,27778,27779,'Converted Hero','','',0,80,80,0,16,0,1,1.14286,1,0,0,417,582,1,1,1,0,0,0,0,0,0,0,0,0,7,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,'',0,1,0,0,0,0,0,1,0,1,1,0,0,'npc_dm_wave_spawns',12340);
  35. +REPLACE INTO `creature_template`(`entry`,`difficulty_entry_1`,`difficulty_entry_2`,`difficulty_entry_3`,`KillCredit1`,`KillCredit2`,`modelid1`,`modelid2`,`modelid3`,`modelid4`,`name`,`subname`,`IconName`,`gossip_menu_id`,`minlevel`,`maxlevel`,`exp`,`faction`,`npcflag`,`speed_walk`,`speed_run`,`scale`,`rank`,`dmgschool`,`BaseAttackTime`,`RangeAttackTime`,`BaseVariance`,`RangeVariance`,`unit_class`,`unit_flags`,`unit_flags2`,`dynamicflags`,`family`,`trainer_type`,`trainer_spell`,`trainer_class`,`trainer_race`,`type`,`type_flags`,`lootid`,`pickpocketloot`,`skinloot`,`resistance1`,`resistance2`,`resistance3`,`resistance4`,`resistance5`,`resistance6`,`spell1`,`spell2`,`spell3`,`spell4`,`spell5`,`spell6`,`spell7`,`spell8`,`PetSpellDataId`,`VehicleId`,`mingold`,`maxgold`,`AIName`,`MovementType`,`InhabitType`,`HoverHeight`,`HealthModifier`,`ManaModifier`,`ArmorModifier`,`DamageModifier`,`ExperienceModifier`,`RacialLeader`,`movementId`,`RegenHealth`,`mechanic_immune_mask`,`flags_extra`,`ScriptName`,`VerifiedBuild`) values (88011,0,0,0,0,0,27930,0,0,0,'Hank the Tank','Arena Defender','',0,80,80,0,16,0,1,1.14286,1,2,0,341,454,1,1,1,0,0,0,0,0,0,0,0,0,7,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,18,'',0,1,0,0,0,0,0,1,0,1,1,0,0,'npc_dm_hank_the_tank',12340);
  36. +REPLACE INTO `creature_template`(`entry`,`difficulty_entry_1`,`difficulty_entry_2`,`difficulty_entry_3`,`KillCredit1`,`KillCredit2`,`modelid1`,`modelid2`,`modelid3`,`modelid4`,`name`,`subname`,`IconName`,`gossip_menu_id`,`minlevel`,`maxlevel`,`exp`,`faction`,`npcflag`,`speed_walk`,`speed_run`,`scale`,`rank`,`dmgschool`,`BaseAttackTime`,`RangeAttackTime`,`BaseVariance`,`RangeVariance`,`unit_class`,`unit_flags`,`unit_flags2`,`dynamicflags`,`family`,`trainer_type`,`trainer_spell`,`trainer_class`,`trainer_race`,`type`,`type_flags`,`lootid`,`pickpocketloot`,`skinloot`,`resistance1`,`resistance2`,`resistance3`,`resistance4`,`resistance5`,`resistance6`,`spell1`,`spell2`,`spell3`,`spell4`,`spell5`,`spell6`,`spell7`,`spell8`,`PetSpellDataId`,`VehicleId`,`mingold`,`maxgold`,`AIName`,`MovementType`,`InhabitType`,`HoverHeight`,`HealthModifier`,`ManaModifier`,`ArmorModifier`,`DamageModifier`,`ExperienceModifier`,`RacialLeader`,`movementId`,`RegenHealth`,`mechanic_immune_mask`,`flags_extra`,`ScriptName`,`VerifiedBuild`) values (88012,0,0,0,0,0,17544,0,0,0,'Field Medic','Hank the Tank\'s Guardian','',0,80,80,0,16,0,1,1.14286,1,2,0,189,232,1,1,1,0,0,0,0,0,0,0,0,0,7,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,20,'',0,1,0,0,0,0,0,1,0,1,1,0,0,'npc_dm_field_medic',12340);
  37. +REPLACE INTO `creature_template`(`entry`,`difficulty_entry_1`,`difficulty_entry_2`,`difficulty_entry_3`,`KillCredit1`,`KillCredit2`,`modelid1`,`modelid2`,`modelid3`,`modelid4`,`name`,`subname`,`IconName`,`gossip_menu_id`,`minlevel`,`maxlevel`,`exp`,`faction`,`npcflag`,`speed_walk`,`speed_run`,`scale`,`rank`,`dmgschool`,`BaseAttackTime`,`RangeAttackTime`,`BaseVariance`,`RangeVariance`,`unit_class`,`unit_flags`,`unit_flags2`,`dynamicflags`,`family`,`trainer_type`,`trainer_spell`,`trainer_class`,`trainer_race`,`type`,`type_flags`,`lootid`,`pickpocketloot`,`skinloot`,`resistance1`,`resistance2`,`resistance3`,`resistance4`,`resistance5`,`resistance6`,`spell1`,`spell2`,`spell3`,`spell4`,`spell5`,`spell6`,`spell7`,`spell8`,`PetSpellDataId`,`VehicleId`,`mingold`,`maxgold`,`AIName`,`MovementType`,`InhabitType`,`HoverHeight`,`HealthModifier`,`ManaModifier`,`ArmorModifier`,`DamageModifier`,`ExperienceModifier`,`RacialLeader`,`movementId`,`RegenHealth`,`mechanic_immune_mask`,`flags_extra`,`ScriptName`,`VerifiedBuild`) values (88013,0,0,0,0,0,24918,0,0,0,'Rogue Initiate','Arena Champion','',0,80,80,0,16,0,1,1.14286,1,1,3,331,546,1,1,3,0,0,0,0,0,0,0,0,0,7,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,20,'',0,1,0,0,0,0,0,1,0,1,1,0,0,'npc_dm_main_rogue',12340);
  38. +REPLACE INTO `creature_template`(`entry`,`difficulty_entry_1`,`difficulty_entry_2`,`difficulty_entry_3`,`KillCredit1`,`KillCredit2`,`modelid1`,`modelid2`,`modelid3`,`modelid4`,`name`,`subname`,`IconName`,`gossip_menu_id`,`minlevel`,`maxlevel`,`exp`,`faction`,`npcflag`,`speed_walk`,`speed_run`,`scale`,`rank`,`dmgschool`,`BaseAttackTime`,`RangeAttackTime`,`BaseVariance`,`RangeVariance`,`unit_class`,`unit_flags`,`unit_flags2`,`dynamicflags`,`family`,`trainer_type`,`trainer_spell`,`trainer_class`,`trainer_race`,`type`,`type_flags`,`lootid`,`pickpocketloot`,`skinloot`,`resistance1`,`resistance2`,`resistance3`,`resistance4`,`resistance5`,`resistance6`,`spell1`,`spell2`,`spell3`,`spell4`,`spell5`,`spell6`,`spell7`,`spell8`,`PetSpellDataId`,`VehicleId`,`mingold`,`maxgold`,`AIName`,`MovementType`,`InhabitType`,`HoverHeight`,`HealthModifier`,`ManaModifier`,`ArmorModifier`,`DamageModifier`,`ExperienceModifier`,`RacialLeader`,`movementId`,`RegenHealth`,`mechanic_immune_mask`,`flags_extra`,`ScriptName`,`VerifiedBuild`) values (88014,0,0,0,0,0,24919,0,0,0,'Rogue Initiate','Minion of the Champ','',0,80,80,0,16,0,1,1.14286,1,1,3,273,341,1,1,3,0,0,0,0,0,0,0,0,0,7,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,16,'',0,1,0,0,0,0,0,1,0,1,1,0,0,'npc_dm_rogue_initiate',12340);
  39. +REPLACE INTO `creature_template`(`entry`,`difficulty_entry_1`,`difficulty_entry_2`,`difficulty_entry_3`,`KillCredit1`,`KillCredit2`,`modelid1`,`modelid2`,`modelid3`,`modelid4`,`name`,`subname`,`IconName`,`gossip_menu_id`,`minlevel`,`maxlevel`,`exp`,`faction`,`npcflag`,`speed_walk`,`speed_run`,`scale`,`rank`,`dmgschool`,`BaseAttackTime`,`RangeAttackTime`,`BaseVariance`,`RangeVariance`,`unit_class`,`unit_flags`,`unit_flags2`,`dynamicflags`,`family`,`trainer_type`,`trainer_spell`,`trainer_class`,`trainer_race`,`type`,`type_flags`,`lootid`,`pickpocketloot`,`skinloot`,`resistance1`,`resistance2`,`resistance3`,`resistance4`,`resistance5`,`resistance6`,`spell1`,`spell2`,`spell3`,`spell4`,`spell5`,`spell6`,`spell7`,`spell8`,`PetSpellDataId`,`VehicleId`,`mingold`,`maxgold`,`AIName`,`MovementType`,`InhabitType`,`HoverHeight`,`HealthModifier`,`ManaModifier`,`ArmorModifier`,`DamageModifier`,`ExperienceModifier`,`RacialLeader`,`movementId`,`RegenHealth`,`mechanic_immune_mask`,`flags_extra`,`ScriptName`,`VerifiedBuild`) values (88015,0,0,0,0,0,24919,0,0,0,'Rogue Initiate','Minion of the Champ','',0,80,80,0,16,0,1,1.14286,1,1,3,273,341,1,1,3,0,0,0,0,0,0,0,0,0,7,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,16,'',0,1,0,0,0,0,0,1,0,1,1,0,0,'npc_dm_rogue_initiate',12340);
  40. +REPLACE INTO `creature_template`(`entry`,`difficulty_entry_1`,`difficulty_entry_2`,`difficulty_entry_3`,`KillCredit1`,`KillCredit2`,`modelid1`,`modelid2`,`modelid3`,`modelid4`,`name`,`subname`,`IconName`,`gossip_menu_id`,`minlevel`,`maxlevel`,`exp`,`faction`,`npcflag`,`speed_walk`,`speed_run`,`scale`,`rank`,`dmgschool`,`BaseAttackTime`,`RangeAttackTime`,`BaseVariance`,`RangeVariance`,`unit_class`,`unit_flags`,`unit_flags2`,`dynamicflags`,`family`,`trainer_type`,`trainer_spell`,`trainer_class`,`trainer_race`,`type`,`type_flags`,`lootid`,`pickpocketloot`,`skinloot`,`resistance1`,`resistance2`,`resistance3`,`resistance4`,`resistance5`,`resistance6`,`spell1`,`spell2`,`spell3`,`spell4`,`spell5`,`spell6`,`spell7`,`spell8`,`PetSpellDataId`,`VehicleId`,`mingold`,`maxgold`,`AIName`,`MovementType`,`InhabitType`,`HoverHeight`,`HealthModifier`,`ManaModifier`,`ArmorModifier`,`DamageModifier`,`ExperienceModifier`,`RacialLeader`,`movementId`,`RegenHealth`,`mechanic_immune_mask`,`flags_extra`,`ScriptName`,`VerifiedBuild`) values (88016,0,0,0,0,0,25446,0,0,0,'The Unholy','Arena Gladiator','',0,80,80,0,16,0,1,1.14286,1,0,2,782,992,1,1,2,0,0,0,0,0,0,0,0,0,7,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,22,'',0,1,0,0,0,0,0,1,0,1,1,0,0,'npc_dm_main_unholy',12340);
  41. +REPLACE INTO `creature_template`(`entry`,`difficulty_entry_1`,`difficulty_entry_2`,`difficulty_entry_3`,`KillCredit1`,`KillCredit2`,`modelid1`,`modelid2`,`modelid3`,`modelid4`,`name`,`subname`,`IconName`,`gossip_menu_id`,`minlevel`,`maxlevel`,`exp`,`faction`,`npcflag`,`speed_walk`,`speed_run`,`scale`,`rank`,`dmgschool`,`BaseAttackTime`,`RangeAttackTime`,`BaseVariance`,`RangeVariance`,`unit_class`,`unit_flags`,`unit_flags2`,`dynamicflags`,`family`,`trainer_type`,`trainer_spell`,`trainer_class`,`trainer_race`,`type`,`type_flags`,`lootid`,`pickpocketloot`,`skinloot`,`resistance1`,`resistance2`,`resistance3`,`resistance4`,`resistance5`,`resistance6`,`spell1`,`spell2`,`spell3`,`spell4`,`spell5`,`spell6`,`spell7`,`spell8`,`PetSpellDataId`,`VehicleId`,`mingold`,`maxgold`,`AIName`,`MovementType`,`InhabitType`,`HoverHeight`,`HealthModifier`,`ManaModifier`,`ArmorModifier`,`DamageModifier`,`ExperienceModifier`,`RacialLeader`,`movementId`,`RegenHealth`,`mechanic_immune_mask`,`flags_extra`,`ScriptName`,`VerifiedBuild`) values (88017,0,0,0,0,0,25496,0,0,0,'The Unholy Twin','','',0,80,80,0,16,0,1,1.14286,1,0,2,681,893,1,1,2,0,0,0,0,0,0,0,0,0,7,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,19,'',0,1,0,0,0,0,0,1,0,1,1,0,0,'npc_dm_unholy_twin',12340);
  42. +REPLACE INTO `creature_template`(`entry`,`difficulty_entry_1`,`difficulty_entry_2`,`difficulty_entry_3`,`KillCredit1`,`KillCredit2`,`modelid1`,`modelid2`,`modelid3`,`modelid4`,`name`,`subname`,`IconName`,`gossip_menu_id`,`minlevel`,`maxlevel`,`exp`,`faction`,`npcflag`,`speed_walk`,`speed_run`,`scale`,`rank`,`dmgschool`,`BaseAttackTime`,`RangeAttackTime`,`BaseVariance`,`RangeVariance`,`unit_class`,`unit_flags`,`unit_flags2`,`dynamicflags`,`family`,`trainer_type`,`trainer_spell`,`trainer_class`,`trainer_race`,`type`,`type_flags`,`lootid`,`pickpocketloot`,`skinloot`,`resistance1`,`resistance2`,`resistance3`,`resistance4`,`resistance5`,`resistance6`,`spell1`,`spell2`,`spell3`,`spell4`,`spell5`,`spell6`,`spell7`,`spell8`,`PetSpellDataId`,`VehicleId`,`mingold`,`maxgold`,`AIName`,`MovementType`,`InhabitType`,`HoverHeight`,`HealthModifier`,`ManaModifier`,`ArmorModifier`,`DamageModifier`,`ExperienceModifier`,`RacialLeader`,`movementId`,`RegenHealth`,`mechanic_immune_mask`,`flags_extra`,`ScriptName`,`VerifiedBuild`) values (88018,0,0,0,0,0,25467,0,0,0,'Guin','Pet of The Unholy','',0,80,80,0,16,0,1,1.14286,1,0,0,221,432,1,1,1,0,0,0,0,0,0,0,0,0,7,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,13,'',0,1,0,0,0,0,0,1,0,1,1,0,0,'npc_dm_unholy_pet',12340);
  43. +REPLACE INTO `creature_template`(`entry`,`difficulty_entry_1`,`difficulty_entry_2`,`difficulty_entry_3`,`KillCredit1`,`KillCredit2`,`modelid1`,`modelid2`,`modelid3`,`modelid4`,`name`,`subname`,`IconName`,`gossip_menu_id`,`minlevel`,`maxlevel`,`exp`,`faction`,`npcflag`,`speed_walk`,`speed_run`,`scale`,`rank`,`dmgschool`,`BaseAttackTime`,`RangeAttackTime`,`BaseVariance`,`RangeVariance`,`unit_class`,`unit_flags`,`unit_flags2`,`dynamicflags`,`family`,`trainer_type`,`trainer_spell`,`trainer_class`,`trainer_race`,`type`,`type_flags`,`lootid`,`pickpocketloot`,`skinloot`,`resistance1`,`resistance2`,`resistance3`,`resistance4`,`resistance5`,`resistance6`,`spell1`,`spell2`,`spell3`,`spell4`,`spell5`,`spell6`,`spell7`,`spell8`,`PetSpellDataId`,`VehicleId`,`mingold`,`maxgold`,`AIName`,`MovementType`,`InhabitType`,`HoverHeight`,`HealthModifier`,`ManaModifier`,`ArmorModifier`,`DamageModifier`,`ExperienceModifier`,`RacialLeader`,`movementId`,`RegenHealth`,`mechanic_immune_mask`,`flags_extra`,`ScriptName`,`VerifiedBuild`) values (88019,0,0,0,0,0,25083,0,0,0,'Riders Guardian','Arena Medic','',0,80,80,0,16,0,1,1.14286,1,1,0,331,341,1,1,1,0,0,0,0,0,0,0,0,0,7,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,18,'',0,1,0,0,0,0,0,1,0,1,1,0,0,'npc_dm_rider_guardian',12340);
  44. +REPLACE INTO `creature_template`(`entry`,`difficulty_entry_1`,`difficulty_entry_2`,`difficulty_entry_3`,`KillCredit1`,`KillCredit2`,`modelid1`,`modelid2`,`modelid3`,`modelid4`,`name`,`subname`,`IconName`,`gossip_menu_id`,`minlevel`,`maxlevel`,`exp`,`faction`,`npcflag`,`speed_walk`,`speed_run`,`scale`,`rank`,`dmgschool`,`BaseAttackTime`,`RangeAttackTime`,`BaseVariance`,`RangeVariance`,`unit_class`,`unit_flags`,`unit_flags2`,`dynamicflags`,`family`,`trainer_type`,`trainer_spell`,`trainer_class`,`trainer_race`,`type`,`type_flags`,`lootid`,`pickpocketloot`,`skinloot`,`resistance1`,`resistance2`,`resistance3`,`resistance4`,`resistance5`,`resistance6`,`spell1`,`spell2`,`spell3`,`spell4`,`spell5`,`spell6`,`spell7`,`spell8`,`PetSpellDataId`,`VehicleId`,`mingold`,`maxgold`,`AIName`,`MovementType`,`InhabitType`,`HoverHeight`,`HealthModifier`,`ManaModifier`,`ArmorModifier`,`DamageModifier`,`ExperienceModifier`,`RacialLeader`,`movementId`,`RegenHealth`,`mechanic_immune_mask`,`flags_extra`,`ScriptName`,`VerifiedBuild`) values (88020,0,0,0,0,0,25082,0,0,0,'Rider Brute','Arena Brute','',0,80,80,0,16,0,1,1.14286,1,1,0,1331,1651,1,1,1,0,0,0,0,0,0,0,0,0,7,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,22,'',0,1,0,0,0,0,0,1,0,1,1,0,0,'npc_dm_rider_brute',12340);
  45. +REPLACE INTO `creature_template`(`entry`,`difficulty_entry_1`,`difficulty_entry_2`,`difficulty_entry_3`,`KillCredit1`,`KillCredit2`,`modelid1`,`modelid2`,`modelid3`,`modelid4`,`name`,`subname`,`IconName`,`gossip_menu_id`,`minlevel`,`maxlevel`,`exp`,`faction`,`npcflag`,`speed_walk`,`speed_run`,`scale`,`rank`,`dmgschool`,`BaseAttackTime`,`RangeAttackTime`,`BaseVariance`,`RangeVariance`,`unit_class`,`unit_flags`,`unit_flags2`,`dynamicflags`,`family`,`trainer_type`,`trainer_spell`,`trainer_class`,`trainer_race`,`type`,`type_flags`,`lootid`,`pickpocketloot`,`skinloot`,`resistance1`,`resistance2`,`resistance3`,`resistance4`,`resistance5`,`resistance6`,`spell1`,`spell2`,`spell3`,`spell4`,`spell5`,`spell6`,`spell7`,`spell8`,`PetSpellDataId`,`VehicleId`,`mingold`,`maxgold`,`AIName`,`MovementType`,`InhabitType`,`HoverHeight`,`HealthModifier`,`ManaModifier`,`ArmorModifier`,`DamageModifier`,`ExperienceModifier`,`RacialLeader`,`movementId`,`RegenHealth`,`mechanic_immune_mask`,`flags_extra`,`ScriptName`,`VerifiedBuild`) values (88021,0,0,0,0,0,25082,0,0,0,'Rider Brute','Arena Brute','',0,80,80,0,16,0,1,1.14286,1,0,0,822,920,1,1,1,0,0,0,0,0,0,0,0,0,7,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,18,'',0,1,0,0,0,0,0,1,0,1,1,0,0,'npc_dm_rider_brute',12340);
  46. +REPLACE INTO `creature_template`(`entry`,`difficulty_entry_1`,`difficulty_entry_2`,`difficulty_entry_3`,`KillCredit1`,`KillCredit2`,`modelid1`,`modelid2`,`modelid3`,`modelid4`,`name`,`subname`,`IconName`,`gossip_menu_id`,`minlevel`,`maxlevel`,`exp`,`faction`,`npcflag`,`speed_walk`,`speed_run`,`scale`,`rank`,`dmgschool`,`BaseAttackTime`,`RangeAttackTime`,`BaseVariance`,`RangeVariance`,`unit_class`,`unit_flags`,`unit_flags2`,`dynamicflags`,`family`,`trainer_type`,`trainer_spell`,`trainer_class`,`trainer_race`,`type`,`type_flags`,`lootid`,`pickpocketloot`,`skinloot`,`resistance1`,`resistance2`,`resistance3`,`resistance4`,`resistance5`,`resistance6`,`spell1`,`spell2`,`spell3`,`spell4`,`spell5`,`spell6`,`spell7`,`spell8`,`PetSpellDataId`,`VehicleId`,`mingold`,`maxgold`,`AIName`,`MovementType`,`InhabitType`,`HoverHeight`,`HealthModifier`,`ManaModifier`,`ArmorModifier`,`DamageModifier`,`ExperienceModifier`,`RacialLeader`,`movementId`,`RegenHealth`,`mechanic_immune_mask`,`flags_extra`,`ScriptName`,`VerifiedBuild`) values (88022,0,0,0,0,0,25015,0,0,0,'Arena Dragon','Spawn of Death','',0,82,82,0,16,0,1,1.14286,1,4,2,273,663,2,2,2,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,38,'',0,1,0,0,0,0,0,1,0,1,1,0,0,'npc_dm_dragon_final',12340);
  47. +REPLACE INTO `creature_template`(`entry`,`difficulty_entry_1`,`difficulty_entry_2`,`difficulty_entry_3`,`KillCredit1`,`KillCredit2`,`modelid1`,`modelid2`,`modelid3`,`modelid4`,`name`,`subname`,`IconName`,`gossip_menu_id`,`minlevel`,`maxlevel`,`exp`,`faction`,`npcflag`,`speed_walk`,`speed_run`,`scale`,`rank`,`dmgschool`,`BaseAttackTime`,`RangeAttackTime`,`BaseVariance`,`RangeVariance`,`unit_class`,`unit_flags`,`unit_flags2`,`dynamicflags`,`family`,`trainer_type`,`trainer_spell`,`trainer_class`,`trainer_race`,`type`,`type_flags`,`lootid`,`pickpocketloot`,`skinloot`,`resistance1`,`resistance2`,`resistance3`,`resistance4`,`resistance5`,`resistance6`,`spell1`,`spell2`,`spell3`,`spell4`,`spell5`,`spell6`,`spell7`,`spell8`,`PetSpellDataId`,`VehicleId`,`mingold`,`maxgold`,`AIName`,`MovementType`,`InhabitType`,`HoverHeight`,`HealthModifier`,`ManaModifier`,`ArmorModifier`,`DamageModifier`,`ExperienceModifier`,`RacialLeader`,`movementId`,`RegenHealth`,`mechanic_immune_mask`,`flags_extra`,`ScriptName`,`VerifiedBuild`) values (88023,0,0,0,0,0,169,0,0,0,'Dragon Boss Trigger','','',0,80,80,0,16,0,1,1.14286,1,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,'',0,1,0,0,0,0,0,1,0,1,1,0,0,'',12340);
  48. +
  49. +UPDATE creature_template SET ScriptName='npc_army_ghoul' WHERE entry='24207';
  50. +UPDATE `creature_template` SET `ScriptName`='npc_dm_wave_portals' WHERE (`entry`='88501')
  51. \ No newline at end of file
  52. diff --git a/src/server/scripts/Custom/custom_script_loader.cpp b/src/server/scripts/Custom/custom_script_loader.cpp
  53. index 5412cf1..70d23d2 100644
  54. --- a/src/server/scripts/Custom/custom_script_loader.cpp
  55. +++ b/src/server/scripts/Custom/custom_script_loader.cpp
  56. @@ -213,7 +213,8 @@
  57.  // start195
  58.  // start196
  59.  // start197
  60. -// start198
  61. +// Dire Maul Event
  62. +void AddSC_arena_link_battle();
  63.  // start199
  64.  // start200
  65.  
  66. @@ -418,7 +419,8 @@ void AddCustomScripts()
  67.  // end195
  68.  // end196
  69.  // end197
  70. -// end198
  71. +// Dire Maul Event
  72. +    AddSC_arena_link_battle();
  73.  // end199
  74.  // end200
  75.  }
  76. diff --git a/src/server/scripts/Custom/npcs_dm_battle.cpp b/src/server/scripts/Custom/npcs_dm_battle.cpp
  77. new file mode 100644
  78. index 0000000..7112786
  79. --- /dev/null
  80. +++ b/src/server/scripts/Custom/npcs_dm_battle.cpp
  81. @@ -0,0 +1,2480 @@
  82. +/**********************************************************
  83. +**********************************************************
  84. + *                      Title:                          *
  85. +  *            NPC Arena Battle(Dire Maul)             *
  86. +   *                                                  *
  87. +    *             Idea by: QQrofl                    *
  88. +     *            Sub-Ideas by: Foereaper           *
  89. +      *            Scripted by: QQrofl             *
  90. +       *              Fondled by: Faded           *
  91. +        *    Mental Support by: Foereaper        *
  92. +         *        Updated by: LordPsyan         *
  93. +          *                                    *
  94. +*##########*##################################*##########*
  95. +*        MAIN SPAWN                                      *
  96. +*    Arena Commander:  Entry: 80700                      *
  97. +*    -3815.866699f, 1102.770874f, 132.355194f, 6.182988f *
  98. +*########################################################*/
  99. +#include "ScriptPCH.h"
  100. +#include "npcs_dm_battle.h"
  101. +#include "Player.h"
  102. +#include "ScriptMgr.h"
  103. +#include "Log.h"
  104. +#include "CombatAI.h"
  105. +#include "CreatureTextMgr.h"
  106. +#include "GameEventMgr.h"
  107. +#include "GameObject.h"
  108. +#include "GossipDef.h"
  109. +#include "ScriptedCreature.h"
  110. +#include "ScriptedGossip.h"
  111. +#include "ScriptMgr.h"
  112. +#include "Chat.h"
  113. +#include "WorldSession.h"
  114. +#include "Unit.h"
  115. +#include "World.h"
  116. +
  117. +class npc_dire_arena_commander : public CreatureScript
  118. +{
  119. +   public:
  120. +       npc_dire_arena_commander() : CreatureScript("npc_dire_arena_commander") { }
  121. +
  122. +       static bool OnGossipHello(Player * player, Creature * creature)
  123. +       {
  124. +           if(player->IsInCombat())
  125. +               return false;
  126. +
  127. +           if(isBattleActive)
  128. +               AddGossipItemFor(player, GOSSIP_ICON_BATTLE, "I'm sorry, but a battle is already active.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
  129. +           else
  130. +               AddGossipItemFor(player, GOSSIP_ICON_BATTLE, MSG_FIGHT_COMPUTER, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
  131. +           AddGossipItemFor(player, GOSSIP_ICON_DOT, "Nevermind", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
  132. +           SendGossipMenuFor(player, 1, creature->GetGUID());
  133. +           return true;
  134. +       }
  135. +
  136. +       static bool OnGossipSelect(Player * player, Creature * creature, uint32 sender, uint32 actions)
  137. +       {
  138. +           if(sender != GOSSIP_SENDER_MAIN)
  139. +               return false;
  140. +           player->PlayerTalkClass->ClearMenus();
  141. +           switch(actions)
  142. +           {
  143. +              case GOSSIP_ACTION_INFO_DEF+1:
  144. +                   m_PlayerGUID = player->GetGUID();
  145. +                   playerName = player->GetName();
  146. +                   isBattleActive = true;
  147. +                   player->CastSpell(player, SPELL_TELEPORT_VISUAL, true);
  148. +                   player->TeleportTo(1, -3739.533447f, 1095.419434f, 131.969559f, 3.029968f);
  149. +                   CloseGossipMenuFor(player);
  150. +                  break;
  151. +
  152. +              case GOSSIP_ACTION_INFO_DEF+2:
  153. +                      CloseGossipMenuFor(player);
  154. +                  break;
  155. +
  156. +              case GOSSIP_ACTION_INFO_DEF+3:
  157. +                      CloseGossipMenuFor(player);
  158. +                  break;
  159. +           }
  160. +           return true;
  161. +       }
  162. +
  163. +       struct npc_dire_arena_commanderAI : public ScriptedAI
  164. +       {
  165. +           npc_dire_arena_commanderAI(Creature * c) : ScriptedAI(c), summons(me) { }
  166. +
  167. +           uint32 checkBattle;
  168. +           uint32 checkPlayer;
  169. +           bool checkIsDead;
  170. +           bool resetOnce;
  171. +
  172. +           void Reset()
  173. +           {
  174. +               events.Reset();
  175. +               player = 0;
  176. +               summons.DespawnAll();
  177. +               checkIsDead = true;
  178. +               resetOnce = false;
  179. +               checkBattle = 2000;
  180. +               checkPlayer = 1000;
  181. +           }
  182. +
  183. +           void UpdateAI(const uint32 diff)
  184. +           {
  185. +               events.Update(diff);
  186. +
  187. +               if(checkBattle <= diff)
  188. +               {
  189. +                   if(!isBattleActive && m_PlayerGUID == 0 && !resetOnce)
  190. +                   {
  191. +                       events.Reset();
  192. +                       resetOnce = true;
  193. +                   }
  194. +
  195. +                   if(isBattleActive && m_PlayerGUID != 0 && resetOnce)
  196. +                   {
  197. +                       player = ObjectAccessor::GetPlayer(*me, m_PlayerGUID);
  198. +                       events.ScheduleEvent(EVENT_CHECK_ACTIVITY, 1000);
  199. +                       resetOnce = false;
  200. +                   }
  201. +                   if(resetOnce)
  202. +                       checkBattle = 2000;
  203. +               }
  204. +               else
  205. +                   checkBattle -= diff;
  206. +
  207. +               if(checkPlayer <= diff) // Checking battle as well
  208. +               {
  209. +                   if(m_PlayerGUID == 0)
  210. +                       return;
  211. +
  212. +                   if(hasLogged || !inZone)
  213. +                   {
  214. +                        isBattleActive = false;
  215. +                        summons.DespawnAll();
  216. +                        events.Reset();
  217. +                        isWaveBossDead = 0;
  218. +                        checkIsDead = true;
  219. +                        hasLogged = false;
  220. +                        inZone = true;
  221. +                        resetOnce = false;
  222. +                        player = 0;
  223. +                        //m_PlayerGUID = 0;
  224. +                        playerName = "";
  225. +                        sWorld->SendGlobalText("A challenger has been scared off and left the Dire Maul Arena Challenge! Who's next?", nullptr);
  226. +                   }
  227. +                    checkPlayer = 1000;
  228. +               }
  229. +               else
  230. +                   checkPlayer -= diff;
  231. +
  232. +               if (isWaveBossDead == 1 && checkIsDead)
  233. +               {
  234. +                   events.ScheduleEvent(EVENT_CHECK_WAVES, 1000);
  235. +                   checkIsDead = false;
  236. +               }
  237. +               else if (isWaveBossDead == 2 && !checkIsDead)
  238. +               {
  239. +                   events.ScheduleEvent(EVENT_CHECK_WAVES, 1000);
  240. +                   checkIsDead = true;
  241. +               }
  242. +               else if (isWaveBossDead == 3 && checkIsDead)
  243. +               {
  244. +                   events.ScheduleEvent(EVENT_CHECK_WAVES, 1000);
  245. +                   checkIsDead = false;
  246. +               }
  247. +               else if (isWaveBossDead == 4 && !checkIsDead)
  248. +               {
  249. +                   events.ScheduleEvent(EVENT_CHECK_WAVES, 1000);
  250. +                   checkIsDead = true;
  251. +               }
  252. +               else if (isWaveBossDead == 5 && checkIsDead)
  253. +               {
  254. +                   events.ScheduleEvent(EVENT_CHECK_WAVES, 1000);
  255. +                   checkIsDead = false;
  256. +               }
  257. +               else if (isWaveBossDead == 6 && !checkIsDead)
  258. +               {
  259. +                   events.ScheduleEvent(EVENT_CHECK_WAVES, 1000);
  260. +                   checkIsDead = true;
  261. +               }
  262. +               else if (isWaveBossDead == 7 && checkIsDead)
  263. +               {
  264. +                   events.ScheduleEvent(EVENT_CHECK_WAVES, 1000);
  265. +                   checkIsDead = false;
  266. +               }
  267. +
  268. +               while(uint32 eventIds = events.ExecuteEvent())
  269. +               {
  270. +                   switch(eventIds)
  271. +                   {
  272. +                      case EVENT_CHECK_ACTIVITY:
  273. +                          {
  274. +                              if(isBattleActive)
  275. +                              {
  276. +                                   MessageOnWave(me, EVENT_CHECK_ACTIVITY);
  277. +                                   events.ScheduleEvent(EVENT_FIRST_WAVE, 10000);
  278. +                              }
  279. +                               else
  280. +                                   events.ScheduleEvent(EVENT_CHECK_ACTIVITY, 1000);
  281. +                          }break;
  282. +
  283. +                      case EVENT_CHECK_WAVES:
  284. +                          {
  285. +                              if(!player)
  286. +                                  return;
  287. +
  288. +                              if(!isBattleActive)
  289. +                              {
  290. +                                  summons.DespawnAll();
  291. +                                  checkIsDead = true;
  292. +                                  resetOnce = false;
  293. +                                  return;
  294. +                              }
  295. +
  296. +                              int itemCount = player->GetItemCount(ITEM_INTRAVENOUS_HEALING_POTION);
  297. +                              if(itemCount == 0)
  298. +                                  player->AddItem(ITEM_INTRAVENOUS_HEALING_POTION, 1);
  299. +                              if(isWaveBossDead == 1) // Red Blood Guard
  300. +                              {
  301. +                                  MessageOnWave(me, EVENT_CHECK_WAVES);
  302. +                                  player->CastSpell(player, SPELL_TELEPORT_VISUAL, true);
  303. +                                  player->TeleportTo(1, -3739.533447f, 1095.419434f, 131.969559f, 3.029968f);
  304. +                                  AddEndRewards(nullptr, player, 500, PVP_END_TOKEN, 1);
  305. +                                  events.ScheduleEvent(EVENT_FIRST_WAVE_TREAT, 25000);
  306. +                                  isWaveBossDead = 0;
  307. +                              }
  308. +
  309. +                              if (isWaveBossDead == 2) // Spawn Event
  310. +                              {
  311. +                                  MessageOnWave(me, EVENT_CHECK_WAVES);
  312. +                                  player->CastSpell(player, SPELL_TELEPORT_VISUAL, true);
  313. +                                  player->TeleportTo(1, -3739.533447f, 1095.419434f, 131.969559f, 3.029968f);
  314. +                                  AddEndRewards(nullptr, player, 1000, PVP_END_TOKEN, 2);
  315. +                                  events.ScheduleEvent(EVENT_FIRST_WAVE_ELITE, 35000);
  316. +                                  isWaveBossDead = 0;
  317. +                              }
  318. +
  319. +                              if(isWaveBossDead == 3) // Hank the Tank
  320. +                              {
  321. +                                  MessageOnWave(me, EVENT_CHECK_WAVES);
  322. +                                  AddEndRewards(nullptr, player, 2000, PVP_END_TOKEN, 5);
  323. +                                  player->CastSpell(player, SPELL_TELEPORT_VISUAL, true);
  324. +                                  player->TeleportTo(1, -3739.533447f, 1095.419434f, 131.969559f, 3.029968f);
  325. +                                  events.ScheduleEvent(EVENT_SECOND_WAVE, 35000);
  326. +                                  isWaveBossDead = 0;
  327. +                              }
  328. +
  329. +                              if(isWaveBossDead == 4) // Rogue Initiates
  330. +                              {
  331. +                                  MessageOnWave(me, EVENT_CHECK_WAVES);
  332. +                                  AddEndRewards(nullptr, player, 3000, PVP_END_TOKEN, 10);
  333. +                                  player->CastSpell(player, SPELL_TELEPORT_VISUAL, true);
  334. +                                  player->TeleportTo(1, -3739.533447f, 1095.419434f, 131.969559f, 3.029968f);
  335. +                                  events.ScheduleEvent(EVENT_SECOND_WAVE_TREAT, 35000);
  336. +                                  isWaveBossDead = 0;
  337. +                              }
  338. +
  339. +                              if(isWaveBossDead == 5) // The Unholys
  340. +                              {
  341. +                                  MessageOnWave(me, EVENT_CHECK_WAVES);
  342. +                                  player->CastSpell(player, SPELL_TELEPORT_VISUAL, true);
  343. +                                  AddEndRewards(nullptr, player, 4000, PVP_END_TOKEN, 20);
  344. +                                  player->TeleportTo(1, -3739.533447f, 1095.419434f, 131.969559f, 3.029968f);
  345. +                                  events.ScheduleEvent(EVENT_SECOND_WAVE_ELITE, 40000);
  346. +                                  isWaveBossDead = 0;
  347. +                              }
  348. +
  349. +                              if(isWaveBossDead == 6) // The Riders of the Ice
  350. +                              {
  351. +                                  MessageOnWave(me, EVENT_CHECK_WAVES);
  352. +                                  player->CastSpell(player, SPELL_TELEPORT_VISUAL, true);
  353. +                                  AddEndRewards(nullptr, player, 5000, PVP_END_TOKEN, 30);
  354. +                                  player->TeleportTo(1, -3739.533447f, 1095.419434f, 131.969559f, 3.029968f);
  355. +                                  events.ScheduleEvent(EVENT_FINAL_WAVE_BOSS, 35000);
  356. +                                  isWaveBossDead = 0;
  357. +                              }
  358. +
  359. +                              if(isWaveBossDead == 7) // Dragon Final Event
  360. +                              {
  361. +                                  MessageOnWave(me, EVENT_CHECK_WAVES);
  362. +                                  player->CastSpell(player, SPELL_TELEPORT_VISUAL, true);
  363. +                                  AddEndRewards(nullptr, player, 10000, PVP_END_TOKEN, 50);
  364. +                                  events.ScheduleEvent(EVENT_COMPLETED_WAVES, 5000);
  365. +                                  isWaveBossDead = 0;
  366. +                              }
  367. +                          }break;
  368. +
  369. +                      case EVENT_FIRST_WAVE:
  370. +                          TC_LOG_DEBUG("events.dire", "[Dire Maul Arena]: Starting First Wave...");
  371. +                          MessageOnWave(me, EVENT_FIRST_WAVE);
  372. +                          player->CastSpell(player, SPELL_TELEPORT_VISUAL, true);
  373. +                          player->TeleportTo(1, -3739.533447f, 1095.419434f, 131.969559f, 3.029968f); // Making sure you're in the right place
  374. +                          player->PlayDirectSound(SOUND_HORN_WAVE_START);
  375. +                          me->SummonCreature(waveList[0], m_WaveSpawns[0].m_positionX, m_WaveSpawns[0].m_positionY, m_WaveSpawns[0].m_positionZ, m_WaveSpawns[0].m_orientation,
  376. +                              TEMPSUMMON_MANUAL_DESPAWN, 0);
  377. +                          break;
  378. +
  379. +                      case EVENT_FIRST_WAVE_TREAT:
  380. +                          MessageOnWave(me, EVENT_FIRST_WAVE_TREAT);
  381. +                          me->SummonCreature(waveList[1], -3739.533447f, 1095.419434f, 131.969559f, 3.029968f, TEMPSUMMON_MANUAL_DESPAWN, 0);
  382. +                          me->SummonCreature(NPC_PORTAL, m_WaveSpawns[1].m_positionX, m_WaveSpawns[1].m_positionY, m_WaveSpawns[1].m_positionZ, m_WaveSpawns[1].m_orientation,
  383. +                                TEMPSUMMON_MANUAL_DESPAWN, 0);
  384. +                          me->SummonCreature(NPC_PORTAL, m_WaveSpawns[2].m_positionX, m_WaveSpawns[2].m_positionY, m_WaveSpawns[2].m_positionZ, m_WaveSpawns[2].m_orientation,
  385. +                                TEMPSUMMON_MANUAL_DESPAWN, 0);
  386. +                          player->CastSpell(player, SPELL_TELEPORT_VISUAL, true);
  387. +                          player->TeleportTo(1, -3739.533447f, 1095.419434f, 131.969559f, 3.029968f); // Making sure you're in the right place
  388. +                          player->PlayDirectSound(SOUND_HORN_WAVE_START);
  389. +                          break;
  390. +
  391. +                      case EVENT_FIRST_WAVE_ELITE:
  392. +                          MessageOnWave(me, EVENT_FIRST_WAVE_ELITE);
  393. +                          player->PlayDirectSound(SOUND_HORN_WAVE_START);
  394. +                          player->CastSpell(player, SPELL_TELEPORT_VISUAL, true);
  395. +                          player->TeleportTo(1, -3739.533447f, 1095.419434f, 131.969559f, 3.029968f); // Making sure you're in the right place
  396. +                          me->SummonCreature(waveList[8], m_WaveSpawns[0].m_positionX, m_WaveSpawns[0].m_positionY, m_WaveSpawns[0].m_positionZ, m_WaveSpawns[0].m_orientation,
  397. +                                TEMPSUMMON_MANUAL_DESPAWN, 0);
  398. +                          break;
  399. +
  400. +                      case EVENT_SECOND_WAVE:
  401. +                          MessageOnWave(me, EVENT_SECOND_WAVE);
  402. +                          player->PlayDirectSound(SOUND_HORN_WAVE_START);
  403. +                          player->CastSpell(player, SPELL_TELEPORT_VISUAL, true);
  404. +                          player->TeleportTo(1, -3739.533447f, 1095.419434f, 131.969559f, 3.029968f); // Making sure you're in the right place
  405. +                          me->SummonCreature(waveList[10], m_WaveSpawns[0].m_positionX, m_WaveSpawns[0].m_positionY, m_WaveSpawns[0].m_positionZ, m_WaveSpawns[0].m_orientation,
  406. +                                TEMPSUMMON_MANUAL_DESPAWN, 0);
  407. +                          break;
  408. +
  409. +                      case EVENT_SECOND_WAVE_TREAT:
  410. +                          MessageOnWave(me, EVENT_SECOND_WAVE_TREAT);
  411. +                          player->PlayDirectSound(SOUND_HORN_WAVE_START);
  412. +                          player->CastSpell(player, SPELL_TELEPORT_VISUAL, true);
  413. +                          player->TeleportTo(1, -3739.533447f, 1095.419434f, 131.969559f, 3.029968f); // Making sure you're in the right place
  414. +                          me->SummonCreature(waveList[13], m_WaveSpawns[0].m_positionX, m_WaveSpawns[0].m_positionY, m_WaveSpawns[0].m_positionZ, m_WaveSpawns[0].m_orientation,
  415. +                                TEMPSUMMON_MANUAL_DESPAWN, 0);
  416. +                          break;
  417. +
  418. +                      case EVENT_SECOND_WAVE_ELITE:
  419. +                          MessageOnWave(me, EVENT_SECOND_WAVE_ELITE);
  420. +                          player->PlayDirectSound(SOUND_HORN_WAVE_START);
  421. +                          player->CastSpell(player, SPELL_TELEPORT_VISUAL, true);
  422. +                          player->TeleportTo(1, -3739.533447f, 1095.419434f, 131.969559f, 3.029968f); // Making sure you're in the right place
  423. +                          me->SummonCreature(waveList[16], m_WaveSpawns[0].m_positionX, m_WaveSpawns[0].m_positionY, m_WaveSpawns[0].m_positionZ, m_WaveSpawns[0].m_orientation,
  424. +                                TEMPSUMMON_MANUAL_DESPAWN, 0);
  425. +                          break;
  426. +
  427. +                      case EVENT_FINAL_WAVE_BOSS:
  428. +                          TC_LOG_DEBUG("events.dire", "[Dire Maul Arena]: Starting Final Wave...");
  429. +                          MessageOnWave(me, EVENT_FINAL_WAVE_BOSS);
  430. +                          player->PlayDirectSound(SOUND_HORN_WAVE_START);
  431. +                          player->CastSpell(player, SPELL_TELEPORT_VISUAL, true);
  432. +                          player->TeleportTo(1, -3739.533447f, 1095.419434f, 131.969559f, 3.029968f); // Making sure you're in the right place
  433. +                          me->SummonCreature(waveList[19], m_WaveSpawns[0].m_positionX, m_WaveSpawns[0].m_positionY, m_WaveSpawns[0].m_positionZ, m_WaveSpawns[0].m_orientation,
  434. +                                TEMPSUMMON_MANUAL_DESPAWN, 0);
  435. +                          break;
  436. +
  437. +                      case EVENT_COMPLETED_WAVES:
  438. +                          me->Yell("Congratulations to our finest Gladiator that went through a lot to earn our rewards! Who will be our next challenger?",
  439. +                              LANG_UNIVERSAL, me);
  440. +                          DoSendCompleteMessage(player->GetName());
  441. +                          player->TeleportTo(1, sTeleOut[0].m_positionX, sTeleOut[0].m_positionY, sTeleOut[0].m_positionZ, sTeleOut[0].m_orientation);
  442. +                          isBattleActive = false;
  443. +                          //m_PlayerGUID = 0;
  444. +                          playerName = "";
  445. +                          summons.DespawnAll();
  446. +                          events.Reset();
  447. +                          isWaveBossDead = 0;
  448. +                          checkIsDead = true;
  449. +                          break;
  450. +                    }
  451. +                }
  452. +           }
  453. +
  454. +           void JustSummoned(Creature * summoned)
  455. +           {
  456. +               summons.Summon(summoned);
  457. +           }
  458. +       private:
  459. +           EventMap events;
  460. +           Player * player;
  461. +           SummonList summons;
  462. +       };
  463. +
  464. +    static bool OnGossipSelectCode(Player* player, Creature* m_creature, uint32 sender, uint32 action, char const* code)
  465. +        {
  466. +            player->PlayerTalkClass->ClearMenus();
  467. +            // code
  468. +            return true;
  469. +        }
  470. +    struct MyAI : public ScriptedAI
  471. +        {
  472. +            MyAI(Creature* m_creature) : ScriptedAI(m_creature) { }
  473. +            bool GossipHello(Player* player) override
  474. +            {
  475. +                return OnGossipHello(player, me);
  476. +            }
  477. +            bool GossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override
  478. +            {
  479. +                uint32 sender = player->PlayerTalkClass->GetGossipOptionSender(gossipListId);
  480. +                uint32 action = player->PlayerTalkClass->GetGossipOptionAction(gossipListId);
  481. +                return OnGossipSelect(player, me, sender, action);
  482. +            }
  483. +            bool GossipSelectCode(Player* player, uint32 menuId, uint32 gossipListId, char const* code) override
  484. +            {
  485. +                uint32 sender = player->PlayerTalkClass->GetGossipOptionSender(gossipListId);
  486. +                uint32 action = player->PlayerTalkClass->GetGossipOptionAction(gossipListId);
  487. +                return OnGossipSelectCode(player, me, sender, action, code);
  488. +            }
  489. +        };
  490. +
  491. +    CreatureAI* GetAI(Creature* m_creature) const override
  492. +        {
  493. +            return new MyAI(m_creature);
  494. +        }
  495. +};
  496. +
  497. +class npc_dire_maul_rb_guard : public CreatureScript
  498. +{
  499. +   public:
  500. +       npc_dire_maul_rb_guard() : CreatureScript("npc_dire_maul_rb_guard") { }
  501. +
  502. +       struct npc_dire_maul_rb_guardAI : public ScriptedAI
  503. +       {
  504. +           npc_dire_maul_rb_guardAI(Creature * c) : ScriptedAI(c), summons(me) { }
  505. +
  506. +           uint32 uiCharge;
  507. +           uint32 uiMortalStrike;
  508. +           uint32 uiCheckOutOfRange;
  509. +           bool spawnMinis;
  510. +
  511. +           void Reset()
  512. +           {
  513. +               spawnMinis = true;
  514. +               uiCharge = 2000;
  515. +               uiMortalStrike = urand(5000, 8000);
  516. +               me->Yell("You can't defeat me!", LANG_UNIVERSAL, me);
  517. +               me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 45233);
  518. +           }
  519. +
  520. +           void KilledUnit(Unit * who)
  521. +           {
  522. +               if(who && who->GetTypeId() != TYPEID_PLAYER)
  523. +                   return;
  524. +               DoEndBattle(me, summons);
  525. +           }
  526. +
  527. +           void JustDied(Unit * killer)
  528. +           {
  529. +               if(killer && killer->GetTypeId() != TYPEID_PLAYER)
  530. +                   return;
  531. +               me->PlayDirectSound(SOUND_WAVE_COMPLETE, killer->ToPlayer());
  532. +               isWaveBossDead = 1;
  533. +               summons.DespawnAll();
  534. +           }
  535. +
  536. +           void JustSummoned(Creature * summoned)
  537. +           {
  538. +               summons.Summon(summoned);
  539. +               summoned->AI()->AttackStart(me->GetVictim());
  540. +               summoned->GetMotionMaster()->MoveChase(me->GetVictim(), 100.0f);
  541. +           }
  542. +
  543. +           void UpdateAI(const uint32 diff)
  544. +           {
  545. +               if(!UpdateVictim())
  546. +               {
  547. +                   summons.DespawnAll();
  548. +                   return;
  549. +               }
  550. +
  551. +               ScriptedAI::UpdateAI(diff);
  552. +               if(!isBattleActive)
  553. +               {
  554. +                   me->DespawnOrUnsummon(1);
  555. +                   return;
  556. +               }
  557. +
  558. +               if(uiCharge <= diff)
  559. +               {
  560. +                   me->CastSpell(me->GetVictim(), SPELL_BERSERKER_CHARGE, true);
  561. +                   uiCharge = 12000;
  562. +               }
  563. +               else
  564. +                   uiCharge -= diff;
  565. +
  566. +               if(uiMortalStrike <= diff)
  567. +               {
  568. +                   me->CastSpell(me->GetVictim(), SPELL_MORTAL_STRIKE, true);
  569. +                   me->CastSpell(me->GetVictim(), SPELL_DEEP_WOUNDS, true); // Cast deep wounds after Mortal strike
  570. +                   uiMortalStrike = urand(5000, 120000);
  571. +               }
  572. +               else
  573. +                   uiMortalStrike -= diff;
  574. +
  575. +               if(me->GetHealthPct() <= 45 && spawnMinis)
  576. +               {
  577. +                   me->Yell("Minions, come to my aid!", LANG_UNIVERSAL, me);
  578. +                   me->SummonCreature(NPC_RED_BLOOD_GUARD_MINI, me->GetPositionX(), me->GetPositionY()+1, me->GetPositionZ(), me->GetOrientation(), TEMPSUMMON_MANUAL_DESPAWN, 0);
  579. +                   me->SummonCreature(NPC_RED_BLOOD_GUARD_MINI2, me->GetPositionX()+2, me->GetPositionY()+1, me->GetPositionZ(), me->GetOrientation(), TEMPSUMMON_MANUAL_DESPAWN, 0);
  580. +                   me->SummonCreature(NPC_RED_BLOOD_GUARD_MINI3, me->GetPositionX()+2, me->GetPositionY()+1, me->GetPositionZ(), me->GetOrientation(), TEMPSUMMON_MANUAL_DESPAWN, 0);
  581. +                   spawnMinis = false;
  582. +               }
  583. +               DoMeleeAttackIfReady();
  584. +           }
  585. +       private:
  586. +           SummonList summons;
  587. +       };
  588. +
  589. +       CreatureAI * GetAI(Creature * pCreature) const
  590. +       {
  591. +           return new npc_dire_maul_rb_guardAI(pCreature);
  592. +       }
  593. +};
  594. +
  595. +class npc_red_blood_mini : public CreatureScript
  596. +{
  597. +   public:
  598. +       npc_red_blood_mini() : CreatureScript("npc_red_blood_mini") { }
  599. +
  600. +       struct npc_red_blood_miniAI : public ScriptedAI
  601. +       {
  602. +           npc_red_blood_miniAI(Creature * c) : ScriptedAI(c) { me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 45233); }
  603. +
  604. +           void KilledUnit(Unit * who)
  605. +           {
  606. +               if(who && who->GetTypeId() != TYPEID_PLAYER)
  607. +                   return;
  608. +               DoEndBattle(me);
  609. +           }
  610. +       };
  611. +
  612. +       CreatureAI * GetAI(Creature * pCreature) const
  613. +       {
  614. +           return new npc_red_blood_miniAI(pCreature);
  615. +       }
  616. +};
  617. +
  618. +class npc_dm_wave_trigger : public CreatureScript
  619. +{
  620. +   public:
  621. +       npc_dm_wave_trigger() : CreatureScript("npc_dm_wave_trigger") { }
  622. +
  623. +       struct npc_dm_wave_triggerAI : public ScriptedAI
  624. +       {
  625. +           npc_dm_wave_triggerAI(Creature * c) : ScriptedAI(c), summons(me) { }
  626. +
  627. +           uint32 startSpawnWave;
  628. +           int spawnPhase;
  629. +
  630. +           void Reset()
  631. +           {
  632. +               startSpawnWave = 1000;
  633. +               spawnPhase = 0;
  634. +           }
  635. +
  636. +           void UpdateAI(const uint32 diff)
  637. +           {
  638. +               if(!isBattleActive)
  639. +               {
  640. +                   summons.DespawnAll();
  641. +                   me->DespawnOrUnsummon(1);
  642. +                   return;
  643. +               }
  644. +
  645. +               if(startSpawnWave <= diff)
  646. +               {
  647. +                   switch(spawnPhase)
  648. +                   {
  649. +                      case 0:
  650. +                          {
  651. +                              spawnPhase = 1;
  652. +                              DoPortalSpawns();
  653. +                              startSpawnWave = 13000;
  654. +                          }break;
  655. +
  656. +                      case 1:
  657. +                          {
  658. +                              spawnPhase = 2;
  659. +                              DoPortalSpawns();
  660. +                              startSpawnWave = 13000;
  661. +                          }break;
  662. +
  663. +                      case 2:
  664. +                          {
  665. +                              spawnPhase = 3;
  666. +                              DoPortalSpawns();
  667. +                              startSpawnWave = 13000;
  668. +                          }break;
  669. +
  670. +                      case 3:
  671. +                          {
  672. +                              spawnPhase = 4;
  673. +                              for(int i = 0; i < 2; i++)
  674. +                                DoPortalSpawns();
  675. +                              startSpawnWave = 25000;
  676. +                          }break;
  677. +
  678. +                      case 4:
  679. +                          {
  680. +                              spawnPhase = 5;
  681. +                              for(int i = 0; i < 2; i++)
  682. +                                DoPortalSpawns();
  683. +                              startSpawnWave = 25000;
  684. +                          }break;
  685. +
  686. +                      case 5:
  687. +                          {
  688. +                              spawnPhase = 6;
  689. +                              for(int i = 0; i < 4; i++)
  690. +                                DoPortalSpawns();
  691. +                              startSpawnWave = 36000;
  692. +                          }break;
  693. +
  694. +                      case 6:
  695. +                          {
  696. +                              spawnPhase = 7;
  697. +                              for(int i = 0; i < 4; i++)
  698. +                                DoPortalSpawns();
  699. +                              startSpawnWave = 36000;
  700. +                          }break;
  701. +
  702. +                      case 7:
  703. +                          {
  704. +                              spawnPhase = 8;
  705. +                              DoPortalSpawns();
  706. +                              startSpawnWave = 10000;
  707. +                          }break;
  708. +
  709. +                      case 8:
  710. +                          {
  711. +                              spawnPhase = 9;
  712. +                              DoPortalSpawns();
  713. +                              startSpawnWave = 10000;
  714. +                          }break;
  715. +
  716. +                      case 9:
  717. +                          {
  718. +                              spawnPhase = 10;
  719. +                              DoPortalSpawns();
  720. +                              startSpawnWave = 15000;
  721. +                          }break;
  722. +
  723. +                      case 10:
  724. +                          {
  725. +                              spawnPhase = 11;
  726. +                              for(int i = 0; i < 4; i++)
  727. +                                DoPortalSpawns();
  728. +                              startSpawnWave = 60000;
  729. +                          }break;
  730. +
  731. +                      case 11:
  732. +                          {
  733. +                              if(Player * player = ObjectAccessor::GetPlayer(*me, m_PlayerGUID))
  734. +                              {
  735. +                                  if(!player)
  736. +                                      return;
  737. +                                  me->PlayDirectSound(SOUND_WAVE_COMPLETE, player);
  738. +                              }
  739. +                              isWaveBossDead = 2;
  740. +                              summons.DespawnAll();
  741. +                              spawnPhase = 0;
  742. +                              me->DespawnOrUnsummon(1);
  743. +                          }break;
  744. +                   }
  745. +               }
  746. +               else
  747. +                   startSpawnWave -= diff;
  748. +           }
  749. +
  750. +           void JustSummoned(Creature * summoned)
  751. +           {
  752. +               summons.Summon(summoned);
  753. +               if(Player * player = ObjectAccessor::GetPlayer(*me, m_PlayerGUID))
  754. +               {
  755. +                   if(!player)
  756. +                       return;
  757. +                   summoned->SetInCombatWith(player);
  758. +                   summoned->AI()->AttackStart(player);
  759. +                   summoned->GetMotionMaster()->MoveChase(player, 500.0f);
  760. +               }
  761. +           }
  762. +
  763. +           void DoPortalSpawns() // Spawns Random Npcs
  764. +           {
  765. +               int random = urand(0, 4);
  766. +               switch(random)
  767. +               {
  768. +                   case 0:
  769. +                       me->SummonCreature(waveList[2], m_WaveSpawns[1].m_positionX, m_WaveSpawns[1].m_positionY, m_WaveSpawns[1].m_positionZ, m_WaveSpawns[1].m_orientation,
  770. +                           TEMPSUMMON_MANUAL_DESPAWN, 0);
  771. +                       break;
  772. +
  773. +                   case 1:
  774. +                       me->SummonCreature(waveList[3], m_WaveSpawns[1].m_positionX, m_WaveSpawns[1].m_positionY, m_WaveSpawns[1].m_positionZ, m_WaveSpawns[1].m_orientation,
  775. +                           TEMPSUMMON_MANUAL_DESPAWN, 0);
  776. +                       break;
  777. +
  778. +                   case 2:
  779. +                       me->SummonCreature(waveList[4], m_WaveSpawns[1].m_positionX, m_WaveSpawns[1].m_positionY, m_WaveSpawns[1].m_positionZ, m_WaveSpawns[1].m_orientation,
  780. +                           TEMPSUMMON_MANUAL_DESPAWN, 0);
  781. +                       break;
  782. +
  783. +                   case 3:
  784. +                       me->SummonCreature(waveList[5], m_WaveSpawns[1].m_positionX, m_WaveSpawns[1].m_positionY, m_WaveSpawns[1].m_positionZ, m_WaveSpawns[1].m_orientation,
  785. +                           TEMPSUMMON_MANUAL_DESPAWN, 0);
  786. +                       break;
  787. +
  788. +                   case 4:
  789. +                       me->SummonCreature(waveList[6], m_WaveSpawns[1].m_positionX, m_WaveSpawns[1].m_positionY, m_WaveSpawns[1].m_positionZ, m_WaveSpawns[1].m_orientation,
  790. +                           TEMPSUMMON_MANUAL_DESPAWN, 0);
  791. +                       break;
  792. +               }
  793. +               int random2 = urand(0, 4);
  794. +               switch(random2)
  795. +               {
  796. +                   case 0:
  797. +                       me->SummonCreature(waveList[2], m_WaveSpawns[2].m_positionX, m_WaveSpawns[2].m_positionY, m_WaveSpawns[2].m_positionZ, m_WaveSpawns[2].m_orientation,
  798. +                           TEMPSUMMON_MANUAL_DESPAWN, 0);
  799. +                       break;
  800. +
  801. +                   case 1:
  802. +                       me->SummonCreature(waveList[3], m_WaveSpawns[2].m_positionX, m_WaveSpawns[2].m_positionY, m_WaveSpawns[2].m_positionZ, m_WaveSpawns[2].m_orientation,
  803. +                           TEMPSUMMON_MANUAL_DESPAWN, 0);
  804. +                       break;
  805. +
  806. +                   case 2:
  807. +                       me->SummonCreature(waveList[4], m_WaveSpawns[2].m_positionX, m_WaveSpawns[2].m_positionY, m_WaveSpawns[2].m_positionZ, m_WaveSpawns[2].m_orientation,
  808. +                           TEMPSUMMON_MANUAL_DESPAWN, 0);
  809. +                       break;
  810. +
  811. +                   case 3:
  812. +                       me->SummonCreature(waveList[5], m_WaveSpawns[2].m_positionX, m_WaveSpawns[2].m_positionY, m_WaveSpawns[2].m_positionZ, m_WaveSpawns[2].m_orientation,
  813. +                           TEMPSUMMON_MANUAL_DESPAWN, 0);
  814. +                       break;
  815. +
  816. +                   case 4:
  817. +                       me->SummonCreature(waveList[6], m_WaveSpawns[2].m_positionX, m_WaveSpawns[2].m_positionY, m_WaveSpawns[2].m_positionZ, m_WaveSpawns[2].m_orientation,
  818. +                           TEMPSUMMON_MANUAL_DESPAWN, 0);
  819. +                       break;
  820. +               }
  821. +           }
  822. +       private:
  823. +           SummonList summons;
  824. +       };
  825. +
  826. +       CreatureAI * GetAI(Creature * pCreature) const
  827. +       {
  828. +           return new npc_dm_wave_triggerAI(pCreature);
  829. +       }
  830. +};
  831. +
  832. +class npc_dm_wave_spawns : public CreatureScript
  833. +{
  834. +   public:
  835. +       npc_dm_wave_spawns() : CreatureScript("npc_dm_wave_spawns") { }
  836. +
  837. +       struct npc_dm_wave_spawnsAI : public ScriptedAI
  838. +       {
  839. +           npc_dm_wave_spawnsAI(Creature * c) : ScriptedAI(c) { }
  840. +
  841. +           void KilledUnit(Unit * who)
  842. +           {
  843. +               if(who && who->GetTypeId() != TYPEID_PLAYER)
  844. +                   return;
  845. +               DoEndBattle(me);
  846. +           }
  847. +
  848. +           void UpdateAI(const uint32 diff)
  849. +           {
  850. +               if(!isBattleActive)
  851. +                   me->DespawnOrUnsummon(1);
  852. +
  853. +               if(!UpdateVictim())
  854. +                   return;
  855. +
  856. +               DoMeleeAttackIfReady();
  857. +           }
  858. +       };
  859. +
  860. +       CreatureAI * GetAI(Creature * pCreature) const
  861. +       {
  862. +           return new npc_dm_wave_spawnsAI(pCreature);
  863. +       }
  864. +};
  865. +
  866. +class npc_dm_wave_portals : public CreatureScript
  867. +{
  868. +   public:
  869. +       npc_dm_wave_portals() : CreatureScript("npc_dm_wave_portals") { }
  870. +
  871. +       struct npc_dm_wave_portalsAI : public ScriptedAI
  872. +       {
  873. +           npc_dm_wave_portalsAI(Creature * c) : ScriptedAI(c) { }
  874. +
  875. +           void UpdateAI(const uint32 diff)
  876. +           {
  877. +               if(!isBattleActive)
  878. +                   me->DespawnOrUnsummon(1);
  879. +           }
  880. +       };
  881. +
  882. +       CreatureAI * GetAI(Creature * pCreature) const
  883. +       {
  884. +           return new npc_dm_wave_portalsAI(pCreature);
  885. +       }
  886. +};
  887. +
  888. +uint32 hankAuras[] = { SPELL_BATTLE_STANCE, SPELL_INCREASE_BLOCK_VALUE, SPELL_INCREASE_DEFENSE_RATING, SPELL_INCREASE_DODGE_RATING };
  889. +class npc_dm_hank_the_tank : public CreatureScript
  890. +{
  891. +   public:
  892. +       npc_dm_hank_the_tank() : CreatureScript("npc_dm_hank_the_tank") { }
  893. +
  894. +       struct npc_dm_hank_the_tankAI : public ScriptedAI
  895. +       {
  896. +           npc_dm_hank_the_tankAI(Creature * c) : ScriptedAI(c), summons(me) { }
  897. +
  898. +           uint32 shoutBuff;
  899. +           uint32 groundStomp;
  900. +           uint32 uiExecute;
  901. +           uint32 tankStrike;
  902. +           uint32 uiRend;
  903. +           uint32 shieldBlock;
  904. +           uint32 shieldBash;
  905. +
  906. +           void Reset()
  907. +           {
  908. +               me->Yell("You will succumb to death, young scums!", LANG_UNIVERSAL, me);
  909. +               summons.DespawnAll();
  910. +               me->SummonCreature(waveList[9], me->GetPositionX(), me->GetPositionY()+3, me->GetPositionZ(), me->GetOrientation(), TEMPSUMMON_MANUAL_DESPAWN, 0);
  911. +               shoutBuff = 1000;
  912. +               groundStomp = 6000;
  913. +               shieldBash = urand(9000, 13000);
  914. +               uiExecute = urand(21000, 26000);
  915. +               shieldBlock = 18000;
  916. +               tankStrike = urand(4000, 8000);
  917. +               uiRend = 11000;
  918. +               me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+0, 51516);
  919. +               me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 51533);
  920. +               for(int i = 0; i < 4; i++)
  921. +                   me->AddAura(hankAuras[i], me);
  922. +           }
  923. +
  924. +           void EnterCombat(Unit * who)
  925. +           {
  926. +               if(who && who->GetTypeId() != TYPEID_PLAYER)
  927. +                   return;
  928. +               DoCast(who, SPELL_TANK_CHARGE);
  929. +           }
  930. +
  931. +           void JustDied(Unit * killer)
  932. +           {
  933. +               if(killer && killer->GetTypeId() != TYPEID_PLAYER)
  934. +                   return;
  935. +               me->PlayDirectSound(SOUND_WAVE_COMPLETE, killer->ToPlayer());
  936. +               summons.DespawnAll();
  937. +               isWaveBossDead = 3;
  938. +           }
  939. +
  940. +           void KilledUnit(Unit * who)
  941. +           {
  942. +               if(who && who->GetTypeId() != TYPEID_PLAYER)
  943. +                   return;
  944. +               DoEndBattle(me, summons);
  945. +           }
  946. +
  947. +           void JustSummoned(Creature * summoned)
  948. +           {
  949. +               summons.Summon(summoned);
  950. +           }
  951. +
  952. +           void UpdateAI(const uint32 diff)
  953. +           {
  954. +               if(!UpdateVictim())
  955. +                   return;
  956. +
  957. +               if(!isBattleActive)
  958. +               {
  959. +                   summons.DespawnAll();
  960. +                   me->DespawnOrUnsummon(1);
  961. +                   return;
  962. +               }
  963. +
  964. +               if(shoutBuff <= diff)
  965. +               {
  966. +                   me->AddAura(SPELL_SHOUT_BUFF, me);
  967. +                   shoutBuff = 120000; // 2 minutes
  968. +               }
  969. +               else
  970. +                   shoutBuff -= diff;
  971. +
  972. +               if(groundStomp <= diff)
  973. +               {
  974. +                   DoCast(me->GetVictim(), SPELL_GROUND_STOMP, true);
  975. +                   groundStomp = 6000;
  976. +               }
  977. +               else
  978. +                   groundStomp -= diff;
  979. +
  980. +               if(uiExecute <= diff)
  981. +               {
  982. +                   if(me->GetVictim()->GetHealthPct() <= 20)
  983. +                       DoCast(me->GetVictim(), SPELL_EXECUTE);
  984. +                   uiExecute = urand(21000, 26000);
  985. +               }
  986. +               else
  987. +                   uiExecute -= diff;
  988. +
  989. +               if(shieldBlock <= diff)
  990. +               {
  991. +                   DoCast(me, SPELL_SHIELD_BLOCK); // Cast on self
  992. +                   shieldBlock = 18000;
  993. +               }
  994. +               else
  995. +                   shieldBlock -= diff;
  996. +
  997. +               if(tankStrike <= diff)
  998. +               {
  999. +                   DoCast(me->GetVictim(), SPELL_TANK_STRIKE);
  1000. +                   tankStrike = urand(4000, 8000);
  1001. +               }
  1002. +               else
  1003. +                   tankStrike -= diff;
  1004. +
  1005. +               if(uiRend <= diff)
  1006. +               {
  1007. +                   DoCast(me->GetVictim(), SPELL_REND, true);
  1008. +                   uiRend = 15000;
  1009. +               }
  1010. +               else
  1011. +                   uiRend -= diff;
  1012. +               DoMeleeAttackIfReady();
  1013. +           }
  1014. +       private:
  1015. +           SummonList summons;
  1016. +       };
  1017. +
  1018. +       CreatureAI * GetAI(Creature * pCreature) const
  1019. +       {
  1020. +           return new npc_dm_hank_the_tankAI(pCreature);
  1021. +       }
  1022. +};
  1023. +
  1024. +class npc_dm_field_medic : public CreatureScript
  1025. +{
  1026. +   public:
  1027. +       npc_dm_field_medic() : CreatureScript("npc_dm_field_medic") { }
  1028. +
  1029. +       struct npc_dm_field_medicAI : public ScriptedAI
  1030. +       {
  1031. +           npc_dm_field_medicAI(Creature * c) : ScriptedAI(c) { }
  1032. +
  1033. +           uint32 uiRegrowthTimer;
  1034. +           uint32 uiHealingTouchTimer;
  1035. +           uint32 uiHealRejuvTimer;
  1036. +           uint32 uiFlashHealTimer;
  1037. +           uint32 uiPowerShieldTimer;
  1038. +           uint32 uiLifebloomTimer;
  1039. +           int casted;
  1040. +           bool showOnce;
  1041. +           bool canHealMaster;
  1042. +
  1043. +           void Reset()
  1044. +           {
  1045. +               uiRegrowthTimer = urand(11000, 13000);
  1046. +               uiHealingTouchTimer = urand(6000, 8000);
  1047. +               uiHealRejuvTimer = 15000;
  1048. +               uiFlashHealTimer = urand(14000, 17000);
  1049. +               uiPowerShieldTimer = 1000;
  1050. +               uiLifebloomTimer = 2000;
  1051. +               canHealMaster = true;
  1052. +               showOnce = false;
  1053. +               int casted = 0;
  1054. +               me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+0, 51404);
  1055. +               me->AddAura(SPELL_HEAL_AURA_HOTS, me);
  1056. +               hank = 0;
  1057. +               hank = me->FindNearestCreature(NPC_HANK_THE_TANK, 50.0f, true);
  1058. +           }
  1059. +
  1060. +           void UpdateAI(const uint32 diff)
  1061. +           {
  1062. +               if(!hank)
  1063. +                   return;
  1064. +
  1065. +               if(hank && hank->isDead() && !showOnce)
  1066. +               {
  1067. +                   me->Yell("Master Dead?!!! I give up!...", LANG_UNIVERSAL, me);
  1068. +                   me->SetFaction(35);
  1069. +                   me->DespawnOrUnsummon(1);
  1070. +                   showOnce = true;
  1071. +                   return;
  1072. +               }
  1073. +
  1074. +               if(hank && !hank->IsInCombat())
  1075. +                   return;
  1076. +
  1077. +               if(hank && hank->GetHealthPct() >= 100)
  1078. +                   canHealMaster = false;
  1079. +               else
  1080. +                   canHealMaster = true;
  1081. +
  1082. +               if(uiRegrowthTimer <= diff)
  1083. +               {
  1084. +                   if(canHealMaster)
  1085. +                       DoCast(hank, SPELL_HEAL_REGROWTH, true);
  1086. +                   if(me->GetHealthPct() <= 70)
  1087. +                       DoCast(me, SPELL_HEAL_REGROWTH, true);
  1088. +                   uiRegrowthTimer = urand(10000, 16000);
  1089. +               }
  1090. +               else
  1091. +                   uiRegrowthTimer -= diff;
  1092. +
  1093. +               if(uiHealingTouchTimer <= diff)
  1094. +               {
  1095. +                   if(hank->GetHealthPct() <= 45 && canHealMaster)
  1096. +                       DoCast(hank, SPELL_HEAL_NORMAL, true);
  1097. +                   if(me->GetHealthPct() <= 30)
  1098. +                       DoCast(me, SPELL_HEAL_NORMAL, true);
  1099. +                   uiHealingTouchTimer = urand(6000, 8000);
  1100. +               }
  1101. +               else
  1102. +                   uiHealingTouchTimer -= diff;
  1103. +
  1104. +               if(uiHealRejuvTimer <= diff)
  1105. +               {
  1106. +                   if(canHealMaster)
  1107. +                       DoCast(hank, SPELL_HEAL_REJUV, true);
  1108. +                   if(me->GetHealthPct() <= 90)
  1109. +                       DoCast(me, SPELL_HEAL_REJUV, true);
  1110. +                   uiHealRejuvTimer = 15000;
  1111. +               }
  1112. +               else
  1113. +                   uiHealRejuvTimer -= diff;
  1114. +
  1115. +               if(uiFlashHealTimer <= diff)
  1116. +               {
  1117. +                   if(canHealMaster)
  1118. +                       DoCast(hank, SPELL_FLASH_HEAL, true);
  1119. +                   if(me->GetHealthPct() <= 55)
  1120. +                       DoCast(me, SPELL_FLASH_HEAL, true);
  1121. +                   uiFlashHealTimer = urand(14000, 17000);
  1122. +               }
  1123. +               else
  1124. +                   uiFlashHealTimer -= diff;
  1125. +
  1126. +               if(uiPowerShieldTimer <= diff)
  1127. +               {
  1128. +                   DoCast(me, SPELL_POWER_WORD_SHIELD);
  1129. +                   uiPowerShieldTimer = 30000;
  1130. +               }
  1131. +               else
  1132. +                   uiPowerShieldTimer -= diff;
  1133. +
  1134. +               if(uiLifebloomTimer <= diff)
  1135. +               {
  1136. +                   if(canHealMaster)
  1137. +                   {
  1138. +                       DoCast(hank, SPELL_HEAL_LIFEBLOOM, true); // Stacking
  1139. +                       casted++; // Increment the value
  1140. +                       if(casted != 3)
  1141. +                           uiLifebloomTimer = 2000;
  1142. +                       else // Prevents further stacking of this spell
  1143. +                       {
  1144. +                           uiLifebloomTimer = 26000;
  1145. +                           casted = 0;
  1146. +                       }
  1147. +                   }
  1148. +               }
  1149. +               else
  1150. +                   uiLifebloomTimer -= diff;
  1151. +           }
  1152. +       private:
  1153. +           Creature * hank;
  1154. +       };
  1155. +
  1156. +       CreatureAI * GetAI(Creature * pCreature) const
  1157. +       {
  1158. +           return new npc_dm_field_medicAI(pCreature);
  1159. +       }
  1160. +};
  1161. +
  1162. +class npc_dm_main_rogue : public CreatureScript
  1163. +{
  1164. +   public:
  1165. +       npc_dm_main_rogue() : CreatureScript("npc_dm_main_rogue") { }
  1166. +
  1167. +       struct npc_dm_main_rogueAI : public ScriptedAI
  1168. +       {
  1169. +           npc_dm_main_rogueAI(Creature * c) : ScriptedAI(c), summons(me) { }
  1170. +
  1171. +           uint32 uiVanishTimer;
  1172. +           uint32 uiCheapShotTimer;
  1173. +           uint32 uiStrikeTimer;
  1174. +           uint32 uiFinisherTimer;
  1175. +           uint32 uiKickTimer;
  1176. +           uint32 uiWaitTimer;
  1177. +           uint32 uiRuptureTimer;
  1178. +           int comboPoints;
  1179. +           bool InStealth;
  1180. +           bool InVanish;
  1181. +
  1182. +           void Reset()
  1183. +           {
  1184. +               me->Yell("We'll teach you a valued lesson.", LANG_UNIVERSAL, me);
  1185. +               InStealth = true;
  1186. +               InVanish = false;
  1187. +               comboPoints = 0;
  1188. +               uiFinisherTimer = 4000;
  1189. +               uiStrikeTimer = 6000;
  1190. +               uiRuptureTimer = 9000;
  1191. +               uiKickTimer = 10000;
  1192. +               uiVanishTimer = 17000;
  1193. +               DoCast(me, SPELL_ROGUE_STEALTH);
  1194. +               me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+0, 51517);
  1195. +               me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 51441);
  1196. +               summons.DespawnAll();
  1197. +               me->SummonCreature(waveList[11], m_WaveSpawns[0].m_positionX, m_WaveSpawns[0].m_positionY+3, m_WaveSpawns[0].m_positionZ, m_WaveSpawns[0].m_orientation, TEMPSUMMON_MANUAL_DESPAWN, 0);
  1198. +               me->SummonCreature(waveList[12], m_WaveSpawns[0].m_positionX, m_WaveSpawns[0].m_positionY-3, m_WaveSpawns[0].m_positionZ, m_WaveSpawns[0].m_orientation, TEMPSUMMON_MANUAL_DESPAWN, 0);
  1199. +           }
  1200. +
  1201. +           void JustDied(Unit * killer)
  1202. +           {
  1203. +               if(killer && killer->GetTypeId() != TYPEID_PLAYER)
  1204. +                   return;
  1205. +               me->PlayDirectSound(SOUND_WAVE_COMPLETE, killer->ToPlayer());
  1206. +               summons.DespawnAll();
  1207. +               isWaveBossDead = 4;
  1208. +           }
  1209. +
  1210. +           void KilledUnit(Unit * who)
  1211. +           {
  1212. +               if(who && who->GetTypeId() != TYPEID_PLAYER)
  1213. +                   return;
  1214. +               DoEndBattle(me, summons);
  1215. +           }
  1216. +
  1217. +           void JustSummoned(Creature * summoned)
  1218. +           {
  1219. +               summons.Summon(summoned);
  1220. +           }
  1221. +
  1222. +           void UpdateAI(const uint32 diff)
  1223. +           {
  1224. +               if(!UpdateVictim())
  1225. +                   return;
  1226. +
  1227. +               if(!isBattleActive)
  1228. +               {
  1229. +                   summons.DespawnAll();
  1230. +                   me->DespawnOrUnsummon(1);
  1231. +                   return;
  1232. +               }
  1233. +
  1234. +               if(InStealth)
  1235. +               {
  1236. +                   me->CastSpell(me->GetVictim(), SPELL_ROGUE_CHEAP_SHOT, true);
  1237. +                   InStealth = false;
  1238. +               }
  1239. +
  1240. +               if(uiStrikeTimer <= diff)
  1241. +               {
  1242. +                   if(!InVanish)
  1243. +                   {
  1244. +                       DoCast(me->GetVictim(), SPELL_ROGUE_STRIKE);
  1245. +                       comboPoints++;
  1246. +                   }
  1247. +                   uiStrikeTimer = 6000;
  1248. +               }
  1249. +               else
  1250. +                   uiStrikeTimer -= diff;
  1251. +
  1252. +               if(uiFinisherTimer <= diff)
  1253. +               {
  1254. +                   if(!InVanish && comboPoints >= 2)
  1255. +                   {
  1256. +                       me->CastSpell(me->GetVictim(), SPELL_ROGUE_FINISHER, true);
  1257. +                       comboPoints = 0;
  1258. +                   }
  1259. +                   uiFinisherTimer = 4000;
  1260. +               }
  1261. +               else
  1262. +                   uiFinisherTimer -= diff;
  1263. +
  1264. +               if(uiKickTimer <= diff)
  1265. +               {
  1266. +                   if(!InVanish)
  1267. +                       DoCast(me->GetVictim(), SPELL_ROGUE_KICK);
  1268. +                   uiKickTimer = 10000;
  1269. +               }
  1270. +               else
  1271. +                   uiKickTimer -= diff;
  1272. +
  1273. +               if(uiVanishTimer <= diff)
  1274. +               {
  1275. +                   DoCast(me, SPELL_ROGUE_VANISH);
  1276. +                   InVanish = true;
  1277. +                   uiVanishTimer = 20000;
  1278. +                   uiWaitTimer = 6000;
  1279. +               }
  1280. +               else
  1281. +                   uiVanishTimer -= diff;
  1282. +
  1283. +               if(uiRuptureTimer <= diff)
  1284. +               {
  1285. +                   if(!InVanish)
  1286. +                       DoCast(me->GetVictim(), SPELL_ROGUE_RUPTURE, true);
  1287. +                   uiRuptureTimer = 9000;
  1288. +               }
  1289. +               else
  1290. +                   uiRuptureTimer -= diff;
  1291. +
  1292. +               if(InVanish)
  1293. +               {
  1294. +                   if(uiWaitTimer <= diff)
  1295. +                   {
  1296. +                       me->CastSpell(me->GetVictim(), SPELL_ROGUE_CHEAP_SHOT, true);
  1297. +                       me->Yell("Attack!", LANG_UNIVERSAL, me);
  1298. +                       InVanish = false;
  1299. +                   }
  1300. +                   else
  1301. +                       uiWaitTimer -= diff;
  1302. +               }
  1303. +               if(!InVanish)
  1304. +                   DoMeleeAttackIfReady();
  1305. +           }
  1306. +       private:
  1307. +           SummonList summons;
  1308. +       };
  1309. +
  1310. +       CreatureAI * GetAI(Creature * pCreature) const
  1311. +       {
  1312. +           return new npc_dm_main_rogueAI(pCreature);
  1313. +       }
  1314. +};
  1315. +
  1316. +class npc_dm_rogue_initiate : public CreatureScript
  1317. +{
  1318. +   public:
  1319. +       npc_dm_rogue_initiate() : CreatureScript("npc_dm_rogue_initiate") { }
  1320. +
  1321. +       struct npc_dm_rogue_initiateAI : public ScriptedAI
  1322. +       {
  1323. +           npc_dm_rogue_initiateAI(Creature * c) : ScriptedAI(c) { }
  1324. +
  1325. +           uint32 uiVanishTimer;
  1326. +           uint32 uiCheapShotTimer;
  1327. +           uint32 uiStrikeTimer;
  1328. +           uint32 uiFinisherTimer;
  1329. +           uint32 uiKickTimer;
  1330. +           uint32 uiWaitTimer;
  1331. +           uint32 uiKidneyShotTimer;
  1332. +           int comboPoints;
  1333. +           bool InVanish;
  1334. +           bool InStealth;
  1335. +
  1336. +           void Reset()
  1337. +           {
  1338. +               InVanish = false;
  1339. +               InStealth = true;
  1340. +               comboPoints = 0;
  1341. +               uiFinisherTimer = 4000;
  1342. +               uiStrikeTimer = 6000;
  1343. +               uiKickTimer = 10000;
  1344. +               uiKidneyShotTimer = 14000;
  1345. +               uiVanishTimer = 17000;
  1346. +               DoCast(me, SPELL_ROGUE_STEALTH);
  1347. +               me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+0, 51517);
  1348. +               me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 51441);
  1349. +           }
  1350. +
  1351. +           void KilledUnit(Unit * who)
  1352. +           {
  1353. +               if(who && who->GetTypeId() != TYPEID_PLAYER)
  1354. +                   return;
  1355. +               DoEndBattle(me);
  1356. +           }
  1357. +
  1358. +           void UpdateAI(const uint32 diff)
  1359. +           {
  1360. +               if(!UpdateVictim())
  1361. +                   return;
  1362. +
  1363. +               if(InStealth)
  1364. +               {
  1365. +                   DoCast(me->GetVictim(), SPELL_ROGUE_BACKSTAB);
  1366. +                   InStealth = false;
  1367. +               }
  1368. +
  1369. +               if(uiStrikeTimer <= diff)
  1370. +               {
  1371. +                   if(!InVanish)
  1372. +                   {
  1373. +                       DoCast(me->GetVictim(), SPELL_ROGUE_STRIKE);
  1374. +                       comboPoints++;
  1375. +                   }
  1376. +                   uiStrikeTimer = 6000;
  1377. +               }
  1378. +               else
  1379. +                   uiStrikeTimer -= diff;
  1380. +
  1381. +               if(uiFinisherTimer <= diff)
  1382. +               {
  1383. +                   if(!InVanish && comboPoints >= 2)
  1384. +                   {
  1385. +                       me->CastSpell(me->GetVictim(), SPELL_ROGUE_FINISHER, true);
  1386. +                       comboPoints = 0;
  1387. +                   }
  1388. +                   uiFinisherTimer = 4000;
  1389. +               }
  1390. +               else
  1391. +                   uiFinisherTimer -= diff;
  1392. +
  1393. +               if(uiKickTimer <= diff)
  1394. +               {
  1395. +                   if(!InVanish)
  1396. +                       DoCast(me->GetVictim(), SPELL_ROGUE_KICK);
  1397. +                   uiKickTimer = 10000;
  1398. +               }
  1399. +               else
  1400. +                   uiKickTimer -= diff;
  1401. +
  1402. +               if(uiKidneyShotTimer <= diff)
  1403. +               {
  1404. +                   if(!InVanish)
  1405. +                       DoCast(me->GetVictim(), SPELL_ROGUE_KIDNEY_SHOT);
  1406. +                   uiKidneyShotTimer = 12000;
  1407. +               }
  1408. +               else
  1409. +                   uiKidneyShotTimer -= diff;
  1410. +
  1411. +               if(uiVanishTimer <= diff)
  1412. +               {
  1413. +                   DoCast(me, SPELL_ROGUE_VANISH);
  1414. +                   InVanish = true;
  1415. +                   uiVanishTimer = 20000;
  1416. +                   uiWaitTimer = 6000;
  1417. +               }
  1418. +               else
  1419. +                   uiVanishTimer -= diff;
  1420. +
  1421. +               if(InVanish)
  1422. +               {
  1423. +                   if(uiWaitTimer <= diff)
  1424. +                   {
  1425. +                       DoCast(me->GetVictim(), SPELL_ROGUE_BACKSTAB);
  1426. +                       InVanish = false;
  1427. +                   }
  1428. +                   else
  1429. +                       uiWaitTimer -= diff;
  1430. +               }
  1431. +               if(!InVanish)
  1432. +                   DoMeleeAttackIfReady();
  1433. +           }
  1434. +       };
  1435. +
  1436. +       CreatureAI * GetAI(Creature * pCreature) const
  1437. +       {
  1438. +           return new npc_dm_rogue_initiateAI(pCreature);
  1439. +       }
  1440. +};
  1441. +
  1442. +class npc_dm_main_unholy : public CreatureScript
  1443. +{
  1444. +   public:
  1445. +       npc_dm_main_unholy() : CreatureScript("npc_dm_main_unholy") { }
  1446. +
  1447. +       struct npc_dm_main_unholyAI : public ScriptedAI
  1448. +       {
  1449. +           npc_dm_main_unholyAI(Creature * c) : ScriptedAI(c), summons(me) { }
  1450. +
  1451. +           uint32 uiCinematic;
  1452. +           uint32 uiAoeTimer;
  1453. +           uint32 uiPlagueStrikeTimer;
  1454. +           uint32 uiStangulateTimer;
  1455. +           uint32 uiDeathStrikeTimer;
  1456. +           uint32 uiArmyOfTheDeadTimer;
  1457. +           int cinematicPassed;
  1458. +           bool checkGuin;
  1459. +           bool boneArmor;
  1460. +
  1461. +           void Reset()
  1462. +           {
  1463. +               me->Say("What is this? A trap?", LANG_UNIVERSAL, 0);
  1464. +               uiCinematic = 9000;
  1465. +               cinematicPassed = 0;
  1466. +               checkGuin = true;
  1467. +               boneArmor = true;
  1468. +               me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_1 | UNIT_FLAG_NOT_SELECTABLE);
  1469. +               me->SetReactState(REACT_PASSIVE);
  1470. +               me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+0, 51393);
  1471. +               summons.DespawnAll();
  1472. +               twin = me->SummonCreature(waveList[14], m_WaveSpawns[0].m_positionX, m_WaveSpawns[0].m_positionY+3, m_WaveSpawns[0].m_positionZ, m_WaveSpawns[0].m_orientation, TEMPSUMMON_MANUAL_DESPAWN, 0);
  1473. +               guin = me->SummonCreature(waveList[15], m_WaveSpawns[0].m_positionX, m_WaveSpawns[0].m_positionY-3, m_WaveSpawns[0].m_positionZ, m_WaveSpawns[0].m_orientation, TEMPSUMMON_MANUAL_DESPAWN, 0);
  1474. +           }
  1475. +
  1476. +           void KilledUnit(Unit * who)
  1477. +           {
  1478. +               if(who && who->GetTypeId() != TYPEID_PLAYER)
  1479. +                   return;
  1480. +               DoEndBattle(me, summons);
  1481. +               twin = 0;
  1482. +               guin = 0;
  1483. +           }
  1484. +
  1485. +           void JustDied(Unit * killer)
  1486. +           {
  1487. +               if(killer && killer->GetTypeId() != TYPEID_PLAYER)
  1488. +                   return;
  1489. +               me->PlayDirectSound(SOUND_WAVE_COMPLETE, killer->ToPlayer());
  1490. +               summons.DespawnAll();
  1491. +               twin = 0;
  1492. +               guin = 0;
  1493. +               isWaveBossDead = 5;
  1494. +           }
  1495. +
  1496. +           void UpdateAI(const uint32 diff)
  1497. +           {
  1498. +               if(!isBattleActive)
  1499. +               {
  1500. +                   summons.DespawnAll();
  1501. +                   twin = 0;
  1502. +                   guin = 0;
  1503. +                   me->DespawnOrUnsummon(1);
  1504. +                   return;
  1505. +               }
  1506. +
  1507. +               if(uiCinematic <= diff)
  1508. +               {
  1509. +                   switch(cinematicPassed)
  1510. +                   {
  1511. +                       case 0:
  1512. +                           me->Say("Ahh, so this thing wants to fight, huh?", LANG_UNIVERSAL, 0);
  1513. +                           cinematicPassed = 1;
  1514. +                           uiCinematic = 10000;
  1515. +                           break;
  1516. +
  1517. +                       case 1:
  1518. +                           me->Say("Don't be a fool!", LANG_UNIVERSAL, 0);
  1519. +                           cinematicPassed = 2;
  1520. +                           uiCinematic = 9000;
  1521. +                           break;
  1522. +
  1523. +                       case 2:
  1524. +                           me->Say("Twin, no! Let him go. We can just watch, for now....", LANG_UNIVERSAL, 0);
  1525. +                           cinematicPassed = 3;
  1526. +                           break;
  1527. +                   }
  1528. +               }
  1529. +               else
  1530. +                   uiCinematic -= diff;
  1531. +
  1532. +               if(checkGuin)
  1533. +               {
  1534. +                   if(guin && guin->isDead())
  1535. +                   {
  1536. +                       me->Yell("SO BE IT!", LANG_UNIVERSAL, me);
  1537. +                       me->AddAura(SPELL_UNHOLY_BONE_SHIELD, me);
  1538. +                       me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_1 | UNIT_FLAG_NOT_SELECTABLE);
  1539. +                       uiAoeTimer = 25000;
  1540. +                       uiPlagueStrikeTimer = urand(5000, 8000);
  1541. +                       uiDeathStrikeTimer = urand(9000, 12000);
  1542. +                       uiStangulateTimer = 15000;
  1543. +                       uiArmyOfTheDeadTimer = 30000;
  1544. +                       me->SetReactState(REACT_AGGRESSIVE);
  1545. +                       if(twin)
  1546. +                       {
  1547. +                           twin->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_1 | UNIT_FLAG_NOT_SELECTABLE);
  1548. +                           twin->SetReactState(REACT_AGGRESSIVE);
  1549. +                       }
  1550. +                       checkGuin = false;
  1551. +                   }
  1552. +               }
  1553. +
  1554. +               if(!UpdateVictim())
  1555. +                   return;
  1556. +
  1557. +               if(HealthBelowPct(25) && boneArmor)
  1558. +               {
  1559. +                   me->AddAura(SPELL_UNHOLY_BONE_SHIELD, me);
  1560. +                   boneArmor = false;
  1561. +               }
  1562. +
  1563. +               if(uiAoeTimer <= diff)
  1564. +               {
  1565. +                   me->CastSpell(me->GetVictim(), SPELL_UNHOLY_AOE, true);
  1566. +                   uiAoeTimer = 25000;
  1567. +               }
  1568. +               else
  1569. +                   uiAoeTimer -= diff;
  1570. +
  1571. +               if(uiPlagueStrikeTimer <= diff)
  1572. +               {
  1573. +                   DoCast(me->GetVictim(), SPELL_UNHOLY_PLAGUE_STRIKE);
  1574. +                   uiPlagueStrikeTimer = urand(5000, 8000);
  1575. +               }
  1576. +               else
  1577. +                   uiPlagueStrikeTimer -= diff;
  1578. +
  1579. +               if(uiStangulateTimer <= diff)
  1580. +               {
  1581. +                   DoCast(me->GetVictim(), SPELL_UNHOLY_STANGULATE, true);
  1582. +                   uiStangulateTimer = 15000;
  1583. +               }
  1584. +               else
  1585. +                   uiStangulateTimer -= diff;
  1586. +
  1587. +               if(uiDeathStrikeTimer <= diff)
  1588. +               {
  1589. +                   DoCast(me->GetVictim(), SPELL_UNHOLY_DEATH_STRIKE);
  1590. +                   uiDeathStrikeTimer = urand(9000, 12000);
  1591. +               }
  1592. +               else
  1593. +                   uiDeathStrikeTimer -= diff;
  1594. +
  1595. +               if(uiArmyOfTheDeadTimer <= diff)
  1596. +               {
  1597. +                   DoCast(me, SPELL_UNHOLY_ARMY, true);
  1598. +                   uiArmyOfTheDeadTimer = 30000;
  1599. +               }
  1600. +               else
  1601. +                   uiArmyOfTheDeadTimer -= diff;
  1602. +               DoMeleeAttackIfReady();
  1603. +           }
  1604. +
  1605. +           void JustSummoned(Creature * summoned)
  1606. +           {
  1607. +               summons.Summon(summoned);
  1608. +           }
  1609. +
  1610. +          private:
  1611. +              Creature * guin;
  1612. +              Creature * twin;
  1613. +              SummonList summons;
  1614. +       };
  1615. +
  1616. +       CreatureAI * GetAI(Creature * pCreature) const
  1617. +       {
  1618. +           return new npc_dm_main_unholyAI(pCreature);
  1619. +       }
  1620. +};
  1621. +
  1622. +class npc_dm_unholy_twin : public CreatureScript
  1623. +{
  1624. +   public:
  1625. +       npc_dm_unholy_twin() : CreatureScript("npc_dm_unholy_twin") { }
  1626. +
  1627. +       struct npc_dm_unholy_twinAI : public ScriptedAI
  1628. +       {
  1629. +           npc_dm_unholy_twinAI(Creature * c) : ScriptedAI(c) { }
  1630. +
  1631. +           uint32 uiCinematic;
  1632. +           uint32 uiAoeTimer;
  1633. +           uint32 uiPlagueStrikeTimer;
  1634. +           uint32 uiStangulateTimer;
  1635. +           uint32 uiDeathStrikeTimer;
  1636. +           uint32 uiArmyOfTheDeadTimer;
  1637. +           int cinematicPassed;
  1638. +           bool boneArmor;
  1639. +
  1640. +           void Reset()
  1641. +           {
  1642. +               uiCinematic = 6000;
  1643. +               boneArmor = true;
  1644. +               cinematicPassed = 0;
  1645. +               me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_1 | UNIT_FLAG_NOT_SELECTABLE);
  1646. +               me->SetReactState(REACT_PASSIVE);
  1647. +               me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+0, 51393);
  1648. +           }
  1649. +
  1650. +           void OnCombatStart(Unit * /* who */)
  1651. +           {
  1652. +               me->AddAura(SPELL_UNHOLY_BONE_SHIELD, me);
  1653. +               uiAoeTimer = 25000;
  1654. +               uiPlagueStrikeTimer = urand(5000, 8000);
  1655. +               uiDeathStrikeTimer = urand(9000, 12000);
  1656. +               uiStangulateTimer = 15000;
  1657. +               uiArmyOfTheDeadTimer = 30000;
  1658. +           }
  1659. +
  1660. +           void KilledUnit(Unit * who)
  1661. +           {
  1662. +               if(who && who->GetTypeId() != TYPEID_PLAYER)
  1663. +                   return;
  1664. +               DoEndBattle(me);
  1665. +           }
  1666. +
  1667. +           void UpdateAI(const uint32 diff)
  1668. +           {
  1669. +               if(uiCinematic <= diff)
  1670. +               {
  1671. +                   switch(cinematicPassed)
  1672. +                   {
  1673. +                       case 0:
  1674. +                           me->Say("I believe it wants to fight us.", LANG_UNIVERSAL, 0);
  1675. +                           cinematicPassed = 1;
  1676. +                           uiCinematic = 7000;
  1677. +                           break;
  1678. +
  1679. +                       case 1:
  1680. +                           me->Say("Yes. So it seems.", LANG_UNIVERSAL, 0);
  1681. +                           cinematicPassed = 2;
  1682. +                           uiCinematic = 6000;
  1683. +                           break;
  1684. +
  1685. +                       case 2:
  1686. +                           me->Say("What? FIGHT?", LANG_UNIVERSAL, 0);
  1687. +                           cinematicPassed = 3;
  1688. +                           uiCinematic = 3000;
  1689. +                           break;
  1690. +
  1691. +                       case 3:
  1692. +                           me->Yell("GUIN! NO!", LANG_UNIVERSAL, 0);
  1693. +                           cinematicPassed = 4;
  1694. +                           break;
  1695. +                   }
  1696. +               }
  1697. +               else
  1698. +                   uiCinematic -= diff;
  1699. +
  1700. +               if(!UpdateVictim())
  1701. +                   return;
  1702. +
  1703. +               if(HealthBelowPct(25) && boneArmor)
  1704. +               {
  1705. +                   me->AddAura(SPELL_UNHOLY_BONE_SHIELD, me);
  1706. +                   boneArmor = false;
  1707. +               }
  1708. +
  1709. +               if(uiAoeTimer <= diff)
  1710. +               {
  1711. +                   me->CastSpell(me->GetVictim(), SPELL_UNHOLY_AOE, true);
  1712. +                   uiAoeTimer = 25000;
  1713. +               }
  1714. +               else
  1715. +                   uiAoeTimer -= diff;
  1716. +
  1717. +               if(uiPlagueStrikeTimer <= diff)
  1718. +               {
  1719. +                   DoCast(me->GetVictim(), SPELL_UNHOLY_PLAGUE_STRIKE);
  1720. +                   uiPlagueStrikeTimer = urand(5000, 8000);
  1721. +               }
  1722. +               else
  1723. +                   uiPlagueStrikeTimer -= diff;
  1724. +
  1725. +               if(uiStangulateTimer <= diff)
  1726. +               {
  1727. +                   DoCast(me->GetVictim(), SPELL_UNHOLY_STANGULATE, true);
  1728. +                   uiStangulateTimer = 15000;
  1729. +               }
  1730. +               else
  1731. +                   uiStangulateTimer -= diff;
  1732. +
  1733. +               if(uiDeathStrikeTimer <= diff)
  1734. +               {
  1735. +                   DoCast(me->GetVictim(), SPELL_UNHOLY_DEATH_STRIKE);
  1736. +                   uiDeathStrikeTimer = urand(9000, 12000);
  1737. +               }
  1738. +               else
  1739. +                   uiDeathStrikeTimer -= diff;
  1740. +
  1741. +               if(uiArmyOfTheDeadTimer <= diff)
  1742. +               {
  1743. +                   DoCast(me, SPELL_UNHOLY_ARMY, true);
  1744. +                   uiArmyOfTheDeadTimer = 30000;
  1745. +               }
  1746. +               else
  1747. +                   uiArmyOfTheDeadTimer -= diff;
  1748. +               DoMeleeAttackIfReady();
  1749. +           }
  1750. +
  1751. +       };
  1752. +
  1753. +       CreatureAI * GetAI(Creature * pCreature) const
  1754. +       {
  1755. +           return new npc_dm_unholy_twinAI(pCreature);
  1756. +       }
  1757. +};
  1758. +
  1759. +class npc_dm_unholy_pet : public CreatureScript
  1760. +{
  1761. +   public:
  1762. +       npc_dm_unholy_pet() : CreatureScript("npc_dm_unholy_pet") { }
  1763. +
  1764. +       struct npc_dm_unholy_petAI : public ScriptedAI
  1765. +       {
  1766. +           npc_dm_unholy_petAI(Creature * c) : ScriptedAI(c) { }
  1767. +
  1768. +           uint32 uiCinematicTimer;
  1769. +           uint32 uiPhaseChangeTimer;
  1770. +           uint32 uiEnrageTimer;
  1771. +           int phase;
  1772. +           int cinematicPassed;
  1773. +
  1774. +           void Reset()
  1775. +           {
  1776. +               uiCinematicTimer = 16000;
  1777. +               uiPhaseChangeTimer = 1000;
  1778. +               uiEnrageTimer = 5000;
  1779. +               phase = 1;
  1780. +               cinematicPassed = 0;
  1781. +               me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_1 | UNIT_FLAG_NOT_SELECTABLE);
  1782. +               me->SetReactState(REACT_PASSIVE);
  1783. +           }
  1784. +
  1785. +           void KilledUnit(Unit * who)
  1786. +           {
  1787. +               if(who && who->GetTypeId() != TYPEID_PLAYER)
  1788. +                   return;
  1789. +               DoEndBattle(me);
  1790. +           }
  1791. +
  1792. +           void UpdateAI(const uint32 diff)
  1793. +           {
  1794. +               if(uiCinematicTimer <= diff)
  1795. +               {
  1796. +                   switch(cinematicPassed)
  1797. +                   {
  1798. +                       case 0:
  1799. +                           me->Say("Why can't we fight masters?", LANG_UNIVERSAL, 0);
  1800. +                           cinematicPassed = 1;
  1801. +                           uiCinematicTimer = 5000;
  1802. +                           break;
  1803. +
  1804. +                       case 1:
  1805. +                           me->Yell("Well, I'm hungry!", LANG_UNIVERSAL, me);
  1806. +                           me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_1 | UNIT_FLAG_NOT_SELECTABLE);
  1807. +                           me->SetReactState(REACT_AGGRESSIVE);
  1808. +                           if(Player * player = me->SelectNearestPlayer(500.0f))
  1809. +                               if(player && player->GetGUID() == m_PlayerGUID)
  1810. +                               {
  1811. +                                   me->Attack(player, true);
  1812. +                                   me->GetMotionMaster()->MoveChase(player);
  1813. +                               }
  1814. +                           cinematicPassed = 2;
  1815. +                           break;
  1816. +                   }
  1817. +               }
  1818. +               else
  1819. +                   uiCinematicTimer -= diff;
  1820. +
  1821. +               if(!UpdateVictim())
  1822. +                   return;
  1823. +
  1824. +               if(uiPhaseChangeTimer <= diff)
  1825. +               {
  1826. +                   switch(phase)
  1827. +                   {
  1828. +                       case 1:
  1829. +                           break;
  1830. +
  1831. +                       case 2:
  1832. +                           break;
  1833. +
  1834. +                       case 3:
  1835. +                           break;
  1836. +
  1837. +                       case 4:
  1838. +                           break;
  1839. +                   }
  1840. +                   if(HealthBelowPct(85) && phase == 1)
  1841. +                   {
  1842. +                       DoIncreaseHealth(me, 2.0f, phase, 2);
  1843. +                   }
  1844. +                   else if(HealthBelowPct(65) && phase == 2)
  1845. +                   {
  1846. +                       DoIncreaseHealth(me, 2.5f, phase, 3);
  1847. +                   }
  1848. +                   else if(HealthBelowPct(35) && phase == 3)
  1849. +                   {
  1850. +                       DoIncreaseHealth(me, 3.0f, phase, 4);
  1851. +                   }
  1852. +                   else if(HealthBelowPct(15) && phase == 4)
  1853. +                   {
  1854. +                       me->Yell("HUNGER!", LANG_UNIVERSAL, me);
  1855. +                       DoIncreaseHealth(me, 3.5f, phase, 5);
  1856. +                   }
  1857. +               }
  1858. +               else
  1859. +                   uiPhaseChangeTimer -= diff;
  1860. +
  1861. +               if(uiEnrageTimer <= diff)
  1862. +               {
  1863. +                   DoCast(SPELL_ENRAGE);
  1864. +                   uiEnrageTimer = 5000;
  1865. +               }
  1866. +               else
  1867. +                   uiEnrageTimer -= diff;
  1868. +               DoMeleeAttackIfReady();
  1869. +           }
  1870. +       };
  1871. +
  1872. +       CreatureAI * GetAI(Creature * pCreature) const
  1873. +       {
  1874. +           return new npc_dm_unholy_petAI(pCreature);
  1875. +       }
  1876. +};
  1877. +
  1878. +class npc_army_ghoul : public CreatureScript
  1879. +{
  1880. +   public:
  1881. +       npc_army_ghoul() : CreatureScript("npc_army_ghoul") { }
  1882. +
  1883. +       struct npc_army_ghoulAI : public ScriptedAI
  1884. +       {
  1885. +           npc_army_ghoulAI(Creature * c) : ScriptedAI(c) { }
  1886. +
  1887. +           void KilledUnit(Unit * who)
  1888. +           {
  1889. +               if(who && who->GetTypeId() != TYPEID_PLAYER)
  1890. +                   return;
  1891. +               DoEndBattle(me);
  1892. +           }
  1893. +       };
  1894. +       CreatureAI * GetAI(Creature * pCreature) const
  1895. +       {
  1896. +           return new npc_army_ghoulAI(pCreature);
  1897. +       }
  1898. +};
  1899. +
  1900. +class npc_dm_rider_guardian : public CreatureScript
  1901. +{
  1902. +   public:
  1903. +       npc_dm_rider_guardian() : CreatureScript("npc_dm_rider_guardian") { }
  1904. +
  1905. +       struct npc_dm_rider_guardianAI : public ScriptedAI
  1906. +       {
  1907. +           npc_dm_rider_guardianAI(Creature * c) : ScriptedAI(c), summons(me) { }
  1908. +
  1909. +           uint32 uiShieldTimer;
  1910. +           uint32 uiHealingBoltTimer;
  1911. +           uint32 uiRenewTimer;
  1912. +           uint32 uiGreaterHealTimer;
  1913. +           uint32 uiHealingBoltWaitTimer;
  1914. +           bool checkBrutes;
  1915. +           bool giveUp;
  1916. +           bool InHealingBolt;
  1917. +
  1918. +           void Reset()
  1919. +           {
  1920. +               uiShieldTimer = 25000;
  1921. +               uiHealingBoltTimer = urand(10000, 14000);
  1922. +               uiRenewTimer = 5000;
  1923. +               uiGreaterHealTimer = 8000;
  1924. +               me->SetReactState(REACT_PASSIVE);
  1925. +               me->CastSpell(me, SPELL_RIDERS_SHIELD, true);
  1926. +               me->CastSpell(me, SPELL_RIDERS_STAM_BUFF, true);
  1927. +               me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+0, 51453);
  1928. +               checkBrutes = false;
  1929. +               giveUp = false;
  1930. +               InHealingBolt = false;
  1931. +               summons.DespawnAll();
  1932. +               brute = me->SummonCreature(waveList[17], m_WaveSpawns[0].m_positionX, m_WaveSpawns[0].m_positionY+3, m_WaveSpawns[0].m_positionZ, m_WaveSpawns[0].m_orientation, TEMPSUMMON_MANUAL_DESPAWN, 0);
  1933. +               brute2 = me->SummonCreature(waveList[18], m_WaveSpawns[0].m_positionX, m_WaveSpawns[0].m_positionY-3, m_WaveSpawns[0].m_positionZ, m_WaveSpawns[0].m_orientation, TEMPSUMMON_MANUAL_DESPAWN, 0);
  1934. +           }
  1935. +
  1936. +           void KilledUnit(Unit * who)
  1937. +           {
  1938. +               if(who && who->GetTypeId() != TYPEID_PLAYER)
  1939. +                   return;
  1940. +               DoEndBattle(me, summons);
  1941. +           }
  1942. +
  1943. +           void JustSummoned(Creature * summoned)
  1944. +           {
  1945. +               summons.Summon(summoned);
  1946. +           }
  1947. +
  1948. +           void UpdateAI(const uint32 diff)
  1949. +           {
  1950. +               if(!isBattleActive)
  1951. +               {
  1952. +                   summons.DespawnAll();
  1953. +                   brute = 0;
  1954. +                   brute2 = 0;
  1955. +                   me->DespawnOrUnsummon(1);
  1956. +                   return;
  1957. +               }
  1958. +
  1959. +               if(HealthBelowPct(25) && !giveUp)
  1960. +               {
  1961. +                   me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_1 | UNIT_FLAG_NOT_SELECTABLE);
  1962. +                   me->Yell("I.. I GIVE UP!", LANG_UNIVERSAL, me);
  1963. +                   me->SetHealth(me->GetMaxHealth());
  1964. +                   checkBrutes = true;
  1965. +                   giveUp = true;
  1966. +               }
  1967. +
  1968. +               if(checkBrutes && giveUp)
  1969. +               {
  1970. +                   if(brute && brute->isDead() && brute2 && brute2->isDead())
  1971. +                   {
  1972. +                       if(Player * player = me->SelectNearestPlayer(200.0f))
  1973. +                           if(player && player->GetGUID() == m_PlayerGUID)
  1974. +                               me->PlayDirectSound(SOUND_WAVE_COMPLETE, player);
  1975. +                       summons.DespawnAll();
  1976. +                       me->DespawnOrUnsummon(1);
  1977. +                       isWaveBossDead = 6;
  1978. +                   }
  1979. +                   return;
  1980. +               }
  1981. +
  1982. +               if(uiShieldTimer <= diff && !InHealingBolt)
  1983. +               {
  1984. +                   int target = urand(0, 2);
  1985. +                   switch(target)
  1986. +                   {
  1987. +                      case 0:
  1988. +                          if(brute)
  1989. +                              DoCast(brute, SPELL_RIDERS_SHIELD);
  1990. +                          break;
  1991. +
  1992. +                      case 1:
  1993. +                          if(brute2)
  1994. +                              DoCast(brute2, SPELL_RIDERS_SHIELD);
  1995. +                          break;
  1996. +
  1997. +                      case 2:
  1998. +                          DoCast(me, SPELL_RIDERS_SHIELD);
  1999. +                          break;
  2000. +                   }
  2001. +                   uiShieldTimer = 16000;
  2002. +               }
  2003. +               else
  2004. +                   uiShieldTimer -= diff;
  2005. +
  2006. +               if(uiHealingBoltTimer <= diff)
  2007. +               {
  2008. +                   int target = urand(0, 1);
  2009. +                   switch(target)
  2010. +                   {
  2011. +                      case 0:
  2012. +                          if(brute && brute->GetHealthPct() <= 85)
  2013. +                              me->CastSpell(brute, SPELL_RIDERS_HEALING_BOLT, true);
  2014. +                          break;
  2015. +
  2016. +                      case 1:
  2017. +                          if(brute2 && brute2->GetHealthPct() <= 65)
  2018. +                              me->CastSpell(brute2, SPELL_RIDERS_HEALING_BOLT, true);
  2019. +                          break;
  2020. +                   }
  2021. +                   InHealingBolt = true;
  2022. +                   uiHealingBoltWaitTimer = 3000;
  2023. +                   uiHealingBoltTimer = urand(10000, 14000);
  2024. +               }
  2025. +               else
  2026. +                   uiHealingBoltTimer -= diff;
  2027. +
  2028. +               if(InHealingBolt)
  2029. +               {
  2030. +                   if(uiHealingBoltWaitTimer <= diff)
  2031. +                   {
  2032. +                       InHealingBolt = false;
  2033. +                   }
  2034. +                   else
  2035. +                       uiHealingBoltWaitTimer -= diff;
  2036. +               }
  2037. +
  2038. +               if(uiRenewTimer <= diff && !InHealingBolt)
  2039. +               {
  2040. +                   int target = urand(0, 2);
  2041. +                   switch(target)
  2042. +                   {
  2043. +                      case 0:
  2044. +                          if(brute)
  2045. +                              DoCast(brute, SPELL_RIDERS_RENEW);
  2046. +                          break;
  2047. +
  2048. +                      case 1:
  2049. +                          if(brute2)
  2050. +                              DoCast(brute2, SPELL_RIDERS_RENEW);
  2051. +                          break;
  2052. +
  2053. +                      case 2:
  2054. +                          if(HealthBelowPct(80))
  2055. +                              DoCast(me, SPELL_RIDERS_RENEW);
  2056. +                          break;
  2057. +                   }
  2058. +                   uiRenewTimer = 5000;
  2059. +               }
  2060. +               else
  2061. +                   uiRenewTimer -= diff;
  2062. +
  2063. +               if(uiGreaterHealTimer <= diff && !InHealingBolt)
  2064. +               {
  2065. +                   int target = urand(0, 2);
  2066. +                   switch(target)
  2067. +                   {
  2068. +                      case 0:
  2069. +                          if(brute && brute->GetHealthPct() <= 30)
  2070. +                              me->CastSpell(brute, SPELL_RIDERS_GREATER_HEAL, true);
  2071. +                          break;
  2072. +
  2073. +                      case 1:
  2074. +                          if(brute2 && brute2->GetHealthPct() <= 20)
  2075. +                              me->CastSpell(brute2, SPELL_RIDERS_GREATER_HEAL, true);
  2076. +                          break;
  2077. +
  2078. +                      case 2:
  2079. +                          if(HealthBelowPct(40))
  2080. +                              me->CastSpell(me, SPELL_RIDERS_GREATER_HEAL, true);
  2081. +                          break;
  2082. +                   }
  2083. +                   uiGreaterHealTimer = 6000;
  2084. +               }
  2085. +               else
  2086. +                   uiGreaterHealTimer -= diff;
  2087. +           }
  2088. +          private:
  2089. +              Creature * brute;
  2090. +              Creature * brute2;
  2091. +              SummonList summons;
  2092. +       };
  2093. +
  2094. +       CreatureAI * GetAI(Creature * pCreature) const
  2095. +       {
  2096. +           return new npc_dm_rider_guardianAI(pCreature);
  2097. +       }
  2098. +};
  2099. +
  2100. +class npc_dm_rider_brute : public CreatureScript
  2101. +{
  2102. +   public:
  2103. +       npc_dm_rider_brute() : CreatureScript("npc_dm_rider_brute") { }
  2104. +
  2105. +       struct npc_dm_rider_bruteAI : public ScriptedAI
  2106. +       {
  2107. +           npc_dm_rider_bruteAI(Creature * c) : ScriptedAI(c) { }
  2108. +
  2109. +           uint32 uiLightningTimer;
  2110. +           uint32 uiChainLightningTimer;
  2111. +           uint32 uiMoonfireTimer;
  2112. +           uint32 uiLightningStormTimer;
  2113. +           uint32 uiLightningWaitTimer;
  2114. +           bool InLightningChannel;
  2115. +
  2116. +           void Reset()
  2117. +           {
  2118. +               uiLightningTimer = 13000;
  2119. +               uiChainLightningTimer = urand(6000, 9000);
  2120. +               uiMoonfireTimer = 5000;
  2121. +               uiLightningStormTimer = urand(20000, 26000);
  2122. +               InLightningChannel = false;
  2123. +               me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+0, 51517);
  2124. +               me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 51447);
  2125. +           }
  2126. +
  2127. +           void KilledUnit(Unit * who)
  2128. +           {
  2129. +               if(who && who->GetTypeId() != TYPEID_PLAYER)
  2130. +                   return;
  2131. +               DoEndBattle(me);
  2132. +           }
  2133. +
  2134. +           void UpdateAI(const uint32 diff)
  2135. +           {
  2136. +               if(!UpdateVictim())
  2137. +                   return;
  2138. +
  2139. +               if(!isBattleActive)
  2140. +               {
  2141. +                   me->DespawnOrUnsummon(1);
  2142. +                   return;
  2143. +               }
  2144. +
  2145. +               if(uiLightningTimer <= diff)
  2146. +               {
  2147. +                   if(!InLightningChannel)
  2148. +                       DoCast(me->GetVictim(), SPELL_RIDERS_LIGHTNING);
  2149. +                   uiLightningTimer = 13000;
  2150. +               }
  2151. +               else
  2152. +                   uiLightningTimer -= diff;
  2153. +
  2154. +               if(uiChainLightningTimer <= diff)
  2155. +               {
  2156. +                   if(!InLightningChannel)
  2157. +                       DoCast(me->GetVictim(), SPELL_RIDERS_CHAIN_LIGHTNING, true);
  2158. +                   uiChainLightningTimer = urand(6000, 9000);
  2159. +               }
  2160. +               else
  2161. +                   uiChainLightningTimer -= diff;
  2162. +
  2163. +               if(uiMoonfireTimer <= diff)
  2164. +               {
  2165. +                   if(!InLightningChannel)
  2166. +                       DoCast(me->GetVictim(), SPELL_RIDERS_MOONFIRE);
  2167. +                   uiMoonfireTimer = 5000;
  2168. +               }
  2169. +               else
  2170. +                   uiMoonfireTimer -= diff;
  2171. +
  2172. +               if(uiLightningStormTimer <= diff)
  2173. +               {
  2174. +                   if(!InLightningChannel)
  2175. +                   {
  2176. +                       me->CastSpell(me->GetVictim(), SPELL_RIDERS_STORM, true);
  2177. +                       InLightningChannel = true;
  2178. +                       uiLightningWaitTimer = 10000;
  2179. +                   }
  2180. +                   uiLightningStormTimer = urand(20000, 26000);
  2181. +               }
  2182. +               else
  2183. +                   uiLightningStormTimer -= diff;
  2184. +
  2185. +               if(InLightningChannel)
  2186. +               {
  2187. +                   if(uiLightningWaitTimer <= diff)
  2188. +                   {
  2189. +                       InLightningChannel = false;
  2190. +                   }
  2191. +                   else
  2192. +                       uiLightningWaitTimer -= diff;
  2193. +               }
  2194. +
  2195. +               if(!InLightningChannel)
  2196. +                   DoMeleeAttackIfReady();
  2197. +           }
  2198. +       };
  2199. +
  2200. +       CreatureAI * GetAI(Creature * pCreature) const
  2201. +       {
  2202. +           return new npc_dm_rider_bruteAI(pCreature);
  2203. +       }
  2204. +};
  2205. +
  2206. +class npc_dm_dragon_final : public CreatureScript
  2207. +{
  2208. +   public:
  2209. +       npc_dm_dragon_final() : CreatureScript("npc_dm_dragon_final") { }
  2210. +
  2211. +       struct npc_dm_dragon_finalAI : public ScriptedAI
  2212. +       {
  2213. +           npc_dm_dragon_finalAI(Creature * c) : ScriptedAI(c), summons(me) { }
  2214. +
  2215. +           uint32 uiBerserkTimer;
  2216. +           uint32 uiBreathTimer;
  2217. +           uint32 uiTailWhipTimer;
  2218. +           uint32 uiClawTimer;
  2219. +           uint32 uiFlameStrikeTimer;
  2220. +           uint32 uiFlightTimer;
  2221. +           uint32 uiFlightWaitTimer;
  2222. +           uint32 uiLandTimer;
  2223. +
  2224. +           uint32 m_Phase;
  2225. +           int  FlameStrikeData;
  2226. +           bool IsInFlight;
  2227. +           bool FireShield;
  2228. +           bool canLand;
  2229. +
  2230. +           void Reset()
  2231. +           {
  2232. +           if (!IsCombatMovementAllowed())
  2233. +               SetCombatMovement(true);
  2234. +
  2235. +               uiFlightTimer = 10000; // 10s
  2236. +               uiClawTimer = urand(3000, 5000);
  2237. +               uiTailWhipTimer = urand(12000, 16000);
  2238. +               uiBreathTimer = urand(18000, 22000);
  2239. +
  2240. +               FlameStrikeData = 0;
  2241. +
  2242. +               summons.DespawnAll();
  2243. +               IsInFlight = false;
  2244. +               FireShield = true;
  2245. +               canLand = false;
  2246. +           }
  2247. +
  2248. +           void EnterCombat(Unit * /* who */)
  2249. +           {
  2250. +               m_Phase = PHASE_START_COMBAT;
  2251. +               uiBerserkTimer = 420000; // 7 Mins
  2252. +           }
  2253. +
  2254. +           void KilledUnit(Unit * who)
  2255. +           {
  2256. +               if(who && who->GetTypeId() != TYPEID_PLAYER)
  2257. +                   return;
  2258. +               DoEndBattle(me, summons);
  2259. +           }
  2260. +
  2261. +           void JustDied(Unit * killer)
  2262. +           {
  2263. +               if(killer && killer->GetTypeId() != TYPEID_PLAYER &&
  2264. +                   killer->GetGUID() != m_PlayerGUID)
  2265. +                   return;
  2266. +               me->PlayDirectSound(SOUND_WAVE_COMPLETE, killer->ToPlayer());
  2267. +               m_Phase = PHASE_END;
  2268. +               isWaveBossDead = 7;
  2269. +           }
  2270. +
  2271. +           void MovementInform(uint32 type, uint32 id)
  2272. +           {
  2273. +               if(type == POINT_MOTION_TYPE)
  2274. +               {
  2275. +                   switch(id)
  2276. +                   {
  2277. +                       case 1:
  2278. +                           //me->SetFacingTo(sMoveData[0].o);
  2279. +                           //me->SetLevitate(true);
  2280. +                           break;
  2281. +                   }
  2282. +               }
  2283. +           }
  2284. +
  2285. +           void JustSummoned(Creature * summoned)
  2286. +           {
  2287. +               summons.Summon(summoned);
  2288. +           }
  2289. +
  2290. +           void UpdateAI(const uint32 diff)
  2291. +           {
  2292. +               if(!UpdateVictim() || m_Phase == PHASE_END)
  2293. +                   return;
  2294. +
  2295. +               if(!isBattleActive)
  2296. +               {
  2297. +                   summons.DespawnAll();
  2298. +                   m_Phase = PHASE_END;
  2299. +                   me->DespawnOrUnsummon(1);
  2300. +                   return;
  2301. +               }
  2302. +
  2303. +               if(m_Phase == PHASE_START_COMBAT)
  2304. +               {
  2305. +                   if(HealthBelowPct(15) && FireShield) // Doesn't matter if you're flying
  2306. +                   {
  2307. +                       DoCast(me, SPELL_DRAGON_FIRE_SHIELD, true);
  2308. +                       FireShield = false;
  2309. +                   }
  2310. +
  2311. +                   if(uiClawTimer <= diff)
  2312. +                   {
  2313. +                       if(!IsInFlight)
  2314. +                           DoCast(me->GetVictim(), SPELL_DRAGON_CLAW);
  2315. +                       uiClawTimer = urand(3000, 5000);
  2316. +                   }
  2317. +                   else
  2318. +                       uiClawTimer -= diff;
  2319. +
  2320. +                   if(uiBreathTimer <= diff)
  2321. +                   {
  2322. +                       if(!IsInFlight)
  2323. +                           me->CastSpell(me->GetVictim(), SPELL_DRAGON_BREATH, true);
  2324. +                       uiBreathTimer = urand(18000, 24000);
  2325. +                   }
  2326. +                   else
  2327. +                       uiBreathTimer -= diff;
  2328. +
  2329. +                   if(uiTailWhipTimer <= diff)
  2330. +                   {
  2331. +                       if(!IsInFlight)
  2332. +                           DoCastAOE(SPELL_DRAGON_TAIL_WHIP, false);
  2333. +                       uiTailWhipTimer = urand(12000, 16000);
  2334. +                   }
  2335. +                   else
  2336. +                       uiTailWhipTimer -= diff;
  2337. +
  2338. +                   if(uiBerserkTimer <= diff)
  2339. +                   {
  2340. +                       DoCast(me, SPELL_DRAGON_BERSERK);
  2341. +                       uiBerserkTimer = 420000;
  2342. +                   }
  2343. +                   else
  2344. +                       uiBerserkTimer -= diff;
  2345. +
  2346. +                   if(uiFlightTimer <= diff && !IsInFlight)
  2347. +                   {
  2348. +                       //me->SetFlying(true);
  2349. +                       me->SetSpeed(MOVE_FLIGHT, 1.3f);
  2350. +                       me->GetMotionMaster()->MovePoint(1, -3786.241943f, 1096.538452f, 153.903366f);
  2351. +                       FlameStrikeData = 0;
  2352. +                       uiFlameStrikeTimer = 6000;
  2353. +                       uiFlightWaitTimer = 30000;
  2354. +                       IsInFlight = true;
  2355. +                       uiFlightTimer = 50000;
  2356. +                   }
  2357. +                   else
  2358. +                       uiFlightTimer -= diff;
  2359. +
  2360. +                   if(IsInFlight)
  2361. +                   {
  2362. +                       if(uiFlameStrikeTimer <= diff)
  2363. +                       {
  2364. +                           switch(FlameStrikeData)
  2365. +                           {
  2366. +                              case 0:
  2367. +                                  me->TextEmote("The Arena Dragon has a lot of fire inside!", 0, true);
  2368. +                                  groundTarget = me->SummonGameObject(sMoveData[0].gobject, me->GetVictim()->GetPositionX()-3, me->GetVictim()->GetPositionY()+6, me->GetVictim()->GetPositionZ(),
  2369. +                                  me->GetOrientation(), QuaternionData(), 1);
  2370. +                                  uiFlameStrikeTimer = 2000;
  2371. +                                  FlameStrikeData = 1;
  2372. +                                  break;
  2373. +
  2374. +                              case 1:
  2375. +                                  trigger = me->SummonCreature(NPC_DRAGON_BOSS_TRIGGER, groundTarget->GetPositionX(), groundTarget->GetPositionY(), groundTarget->GetPositionZ(), 0.0f,
  2376. +                                      TEMPSUMMON_TIMED_DESPAWN, 3000);
  2377. +                                  me->CastSpell(trigger, sMoveData[0].spellId, true);
  2378. +                                  uiFlameStrikeTimer = 2000;
  2379. +                                  FlameStrikeData = 2;
  2380. +                                  break;
  2381. +
  2382. +                              case 2:
  2383. +                                  if(groundTarget)
  2384. +                                      groundTarget->Delete();
  2385. +                                  me->TextEmote("The Arena Dragon has a lot of fire inside!", 0, true);
  2386. +                                  groundTarget = me->SummonGameObject(sMoveData[0].gobject, me->GetVictim()->GetPositionX()-3, me->GetVictim()->GetPositionY()-6, me->GetVictim()->GetPositionZ(),
  2387. +                                      me->GetOrientation(), QuaternionData(), 1);
  2388. +                                  uiFlameStrikeTimer = 2000;
  2389. +                                  FlameStrikeData = 3;
  2390. +                                  break;
  2391. +
  2392. +                              case 3:
  2393. +                                  trigger = me->SummonCreature(NPC_DRAGON_BOSS_TRIGGER, groundTarget->GetPositionX(), groundTarget->GetPositionY(), groundTarget->GetPositionZ(), 0.0f,
  2394. +                                      TEMPSUMMON_TIMED_DESPAWN, 3000);
  2395. +                                  me->CastSpell(trigger, sMoveData[0].spellId, true);
  2396. +                                  uiFlameStrikeTimer = 2000;
  2397. +                                  FlameStrikeData = 4;
  2398. +                                  break;
  2399. +
  2400. +                              case 4:
  2401. +                                  if(groundTarget)
  2402. +                                      groundTarget->Delete();
  2403. +                                  me->TextEmote("The Arena Dragon has a lot of fire inside!", 0, true);
  2404. +                                  groundTarget = me->SummonGameObject(sMoveData[0].gobject, me->GetVictim()->GetPositionX()-3, me->GetVictim()->GetPositionY()-6, me->GetVictim()->GetPositionZ(),
  2405. +                                      me->GetOrientation(), QuaternionData(), 1);
  2406. +                                  uiFlameStrikeTimer = 2000;
  2407. +                                  FlameStrikeData = 5;
  2408. +                                  break;
  2409. +
  2410. +                              case 5:
  2411. +                                  trigger = me->SummonCreature(NPC_DRAGON_BOSS_TRIGGER, groundTarget->GetPositionX(), groundTarget->GetPositionY(), groundTarget->GetPositionZ(), 0.0f,
  2412. +                                      TEMPSUMMON_TIMED_DESPAWN, 3000);
  2413. +                                  me->CastSpell(trigger, sMoveData[0].spellId, true);
  2414. +                                  uiFlameStrikeTimer = 2000;
  2415. +                                  FlameStrikeData = 6;
  2416. +                                  break;
  2417. +
  2418. +                              case 6:
  2419. +                                  if(groundTarget)
  2420. +                                      groundTarget->Delete();
  2421. +                                  me->TextEmote("The Arena Dragon has a lot of fire inside!", 0, true);
  2422. +                                  groundTarget = me->SummonGameObject(sMoveData[0].gobject, me->GetVictim()->GetPositionX()-3, me->GetVictim()->GetPositionY()+6, me->GetVictim()->GetPositionZ(),
  2423. +                                      me->GetOrientation(), QuaternionData(), 1);
  2424. +                                  uiFlameStrikeTimer = 2000;
  2425. +                                  FlameStrikeData = 7;
  2426. +                                  break;
  2427. +
  2428. +                              case 7:
  2429. +                                  trigger = me->SummonCreature(NPC_DRAGON_BOSS_TRIGGER, groundTarget->GetPositionX(), groundTarget->GetPositionY(), groundTarget->GetPositionZ(), 0.0f,
  2430. +                                      TEMPSUMMON_TIMED_DESPAWN, 3000);
  2431. +                                  me->CastSpell(trigger, sMoveData[0].spellId, true);
  2432. +                                  uiFlameStrikeTimer = 2000;
  2433. +                                  FlameStrikeData = 8;
  2434. +                                  break;
  2435. +
  2436. +                              case 8:
  2437. +                                  if(groundTarget)
  2438. +                                      groundTarget->Delete();
  2439. +                                  me->TextEmote("The Arena Dragon has a lot of fire inside!", 0, true);
  2440. +                                  groundTarget = me->SummonGameObject(sMoveData[0].gobject, me->GetVictim()->GetPositionX()-3, me->GetVictim()->GetPositionY()+6, me->GetVictim()->GetPositionZ(),
  2441. +                                      me->GetOrientation(), QuaternionData(), 1);
  2442. +                                  uiFlameStrikeTimer = 2000;
  2443. +                                  FlameStrikeData = 9;
  2444. +                                  break;
  2445. +
  2446. +                              case 9:
  2447. +                                  trigger = me->SummonCreature(NPC_DRAGON_BOSS_TRIGGER, groundTarget->GetPositionX(), groundTarget->GetPositionY(), groundTarget->GetPositionZ(), 0.0f,
  2448. +                                      TEMPSUMMON_TIMED_DESPAWN, 3000);
  2449. +                                  me->CastSpell(trigger, sMoveData[0].spellId, true);
  2450. +                                  uiFlameStrikeTimer = 1000;
  2451. +                                  FlameStrikeData = 10;
  2452. +                                  break;
  2453. +
  2454. +                              case 10:
  2455. +                                  if(groundTarget)
  2456. +                                      groundTarget->Delete();
  2457. +                                  FlameStrikeData = 11;
  2458. +                                  break;
  2459. +                           }
  2460. +                       }
  2461. +                       else
  2462. +                           uiFlameStrikeTimer -= diff;
  2463. +
  2464. +                       if(uiFlightWaitTimer <= diff && !canLand)
  2465. +                       {
  2466. +                           me->GetMotionMaster()->MovePoint(2, me->GetHomePosition()); // Back Home
  2467. +                           canLand = true;
  2468. +                           uiLandTimer = 5000;
  2469. +                       }
  2470. +                       else
  2471. +                           uiFlightWaitTimer -= diff;
  2472. +
  2473. +                       if(uiLandTimer <= diff && canLand)
  2474. +                       {
  2475. +                           //me->SetFlying(false);
  2476. +                           //me->SetLevitate(false);
  2477. +                           SetCombatMovement(true);
  2478. +                           me->GetMotionMaster()->Clear(false);
  2479. +                           me->GetMotionMaster()->MoveChase(me->GetVictim());
  2480. +                           IsInFlight = false;
  2481. +                           canLand = false;
  2482. +                       }
  2483. +                       else
  2484. +                           uiLandTimer -= diff;
  2485. +                   }
  2486. +               }
  2487. +              if(!IsInFlight)
  2488. +                  DoMeleeAttackIfReady();
  2489. +           }
  2490. +           private:
  2491. +               GameObject * groundTarget;
  2492. +               Creature * trigger;
  2493. +               SummonList summons;
  2494. +       };
  2495. +
  2496. +       CreatureAI * GetAI(Creature * pCreature) const
  2497. +       {
  2498. +           return new npc_dm_dragon_finalAI(pCreature);
  2499. +       }
  2500. +};
  2501. +
  2502. +class remove_non_battle_player : public PlayerScript
  2503. +{
  2504. +   public:
  2505. +       remove_non_battle_player() : PlayerScript("remove_non_battle_player") { }
  2506. +
  2507. +       void OnUpdateZone(Player * player, uint32 zone, uint32 area)
  2508. +       {
  2509. +           if(m_PlayerGUID == 0)
  2510. +               return;
  2511. +
  2512. +           if(player->GetZoneId() != DIRE_MAUL_ZONE && player->GetAreaId() != DIRE_MAUL_AREA && player->GetGUID() == m_PlayerGUID)
  2513. +           {
  2514. +               inZone = false;
  2515. +               return;
  2516. +           }
  2517. +
  2518. +           if(player->GetAreaId() != DIRE_MAUL_AREA || player->GetSession()->GetSecurity() > 1)
  2519. +               return;
  2520. +
  2521. +           if(isBattleActive && player->GetGUID() != m_PlayerGUID)
  2522. +           {
  2523. +               player->TeleportTo(player->GetStartPosition().GetMapId(), player->GetStartPosition().GetPositionX(), player->GetStartPosition().GetPositionY(),
  2524. +                  player->GetStartPosition().GetPositionZ(), player->GetStartPosition().GetOrientation());
  2525. +               ChatHandler(player->GetSession()).PSendSysMessage("You cannot be in the Dire Maul Arena while the event is going on!");
  2526. +           }
  2527. +       }
  2528. +
  2529. +       void OnLogout(Player * player)
  2530. +       {
  2531. +           if(m_PlayerGUID == 0)
  2532. +               return;
  2533. +
  2534. +           if(player->GetGUID() == m_PlayerGUID)
  2535. +               hasLogged = true;
  2536. +       }
  2537. +};
  2538. +
  2539. +void AddSC_arena_link_battle()
  2540. +{
  2541. +    /* Npc Classes */
  2542. +    new npc_dire_arena_commander();
  2543. +    new npc_dire_maul_rb_guard();
  2544. +    new npc_red_blood_mini();
  2545. +    new npc_dm_wave_trigger();
  2546. +    new npc_dm_wave_spawns();
  2547. +    new npc_dm_hank_the_tank();
  2548. +    new npc_dm_field_medic();
  2549. +    new npc_dm_main_rogue();
  2550. +    new npc_dm_rogue_initiate();
  2551. +    new npc_dm_main_unholy();
  2552. +    new npc_dm_unholy_twin();
  2553. +    new npc_dm_unholy_pet();
  2554. +    new npc_army_ghoul();
  2555. +    new npc_dm_rider_guardian();
  2556. +    new npc_dm_rider_brute();
  2557. +    new npc_dm_dragon_final();
  2558. +    new npc_dm_wave_portals();
  2559. +    /* Player Classes */
  2560. +    new remove_non_battle_player();
  2561. +}
  2562. diff --git a/src/server/scripts/Custom/npcs_dm_battle.h b/src/server/scripts/Custom/npcs_dm_battle.h
  2563. new file mode 100644
  2564. index 0000000..698e183
  2565. --- /dev/null
  2566. +++ b/src/server/scripts/Custom/npcs_dm_battle.h
  2567. @@ -0,0 +1,369 @@
  2568. +/**********************************************************
  2569. +**********************************************************
  2570. + *                      Title:                          *
  2571. +  *            NPC Arena Battle(Dire Maul)             *
  2572. +   *                                                  *
  2573. +    *             Idea by: QQrofl                    *
  2574. +     *            Sub-Ideas by: Foereaper           *
  2575. +      *            Scripted by: QQrofl             *
  2576. +       *              Fondled by: Faded           *
  2577. +        *    Mental Support by: Foereaper        *
  2578. +         *        Updated by: LordPsyan         *
  2579. +          *                                    *
  2580. +*##########*##################################*##########*
  2581. +*        MAIN SPAWN                                      *
  2582. +*    Arena Commander:  Entry: 80700                      *
  2583. +*    -3815.866699f, 1102.770874f, 132.355194f, 6.182988f *
  2584. +*########################################################*/
  2585. +#include "Chat.h"
  2586. +#include "ScriptPCH.h"
  2587. +#include "World.h"
  2588. +
  2589. +using namespace std;
  2590. +
  2591. +/* Player */
  2592. +ObjectGuid m_PlayerGUID;
  2593. +string playerName;
  2594. +/* Is Active */
  2595. +bool isBattleActive = false;
  2596. +bool hasLogged = false;
  2597. +bool inZone = true;
  2598. +/* Is Bosses Dead */
  2599. +int isWaveBossDead = 0;
  2600. +
  2601. +#define MSG_FIGHT_COMPUTER "I would like to fight!"
  2602. +
  2603. +enum Events
  2604. +{
  2605. +    EVENT_NONE,
  2606. +    EVENT_CHECK_ACTIVITY, // Check Activity of the battle : if true or false ? can start?
  2607. +    EVENT_CHECK_WAVES, // Checks the waves so it can move on to the next event, if it is allowed
  2608. +    EVENT_CHECK_PLAYER,
  2609. +    EVENT_FIRST_WAVE,
  2610. +    EVENT_FIRST_WAVE_TREAT,
  2611. +    EVENT_FIRST_WAVE_ELITE,
  2612. +    EVENT_SECOND_WAVE,
  2613. +    EVENT_SECOND_WAVE_TREAT,
  2614. +    EVENT_SECOND_WAVE_ELITE,
  2615. +    EVENT_FINAL_WAVE_BOSS,
  2616. +    EVENT_COMPLETED_WAVES,
  2617. +};
  2618. +
  2619. +enum bPhases
  2620. +{
  2621. +    /* Final Boss Phases */
  2622. +    PHASE_START_COMBAT,
  2623. +    PHASE_END,
  2624. +};
  2625. +
  2626. +enum SpellIds
  2627. +{
  2628. +    /* First Wave Spells */
  2629. +    /* Red Blood Guard */
  2630. +    SPELL_BERSERKER_CHARGE = 38907,
  2631. +    SPELL_MORTAL_STRIKE = 68783,
  2632. +    SPELL_DEEP_WOUNDS = 23256,
  2633. +    /* First Wave Elite Spells */
  2634. +    /* `- Spore Healer */
  2635. +    SPELL_HEAL_REGROWTH = 48443, //heal+H.O.T.
  2636. +    SPELL_HEAL_NORMAL = 48378, //heal normal
  2637. +    SPELL_HEAL_REJUV = 48441, //H.O.T.
  2638. +    SPELL_HEAL_AURA_HOTS = 38299, // Aura hots
  2639. +    SPELL_FLASH_HEAL = 48071,
  2640. +    SPELL_POWER_WORD_SHIELD = 20697, // Absorbs a ton of damage
  2641. +    SPELL_HEAL_LIFEBLOOM = 67958,
  2642. +    /* `- Hank the Tank */
  2643. +    SPELL_BATTLE_STANCE = 2487, //warrior bstance
  2644. +    SPELL_SHOUT_BUFF = 47436,    //attk pwr self buff
  2645. +    SPELL_TANK_CHARGE = 11578,    //warrior charge
  2646. +    SPELL_GROUND_STOMP = 47502, //thunderclap
  2647. +    SPELL_EXECUTE = 47471,        //normal strike
  2648. +    SPELL_TANK_STRIKE = 47450,    //normal strike
  2649. +    SPELL_INCREASE_BLOCK_VALUE = 67515, // Increases block value
  2650. +    SPELL_SHIELD_BLOCK = 69580, // Blocks attacks
  2651. +    SPELL_INCREASE_DEFENSE_RATING = 60343, // Increases Defense by 180+
  2652. +    SPELL_INCREASE_DODGE_RATING = 18062, // Increase dodge by 96
  2653. +    SPELL_REND = 47465, // Rends the target ~Bleeds
  2654. +    SPELL_SHIELD_BASH = 47488, // Bashes the target with a shield
  2655. +    /* Second Wave Spells */
  2656. +    SPELL_ROGUE_STEALTH = 1784,
  2657. +    SPELL_ROGUE_CHEAP_SHOT = 1833, //in stealth only
  2658. +    SPELL_ROGUE_STRIKE = 48660,
  2659. +    SPELL_ROGUE_FINISHER = 48668,
  2660. +    SPELL_ROGUE_VANISH = 26889, //idea here is to make the sidekicks(and main?) vanish in/out of the fight
  2661. +    SPELL_ROGUE_KICK = 27814,
  2662. +    SPELL_ROGUE_BACKSTAB = 52540,
  2663. +    SPELL_ROGUE_RUPTURE = 48672,
  2664. +    SPELL_ROGUE_KIDNEY_SHOT = 41389,
  2665. +    /* Second Wave Treat Spells */
  2666. +    SPELL_UNHOLY_BONE_SHIELD = 49222,
  2667. +    SPELL_UNHOLY_AOE = 49938,
  2668. +    SPELL_UNHOLY_PLAGUE_STRIKE = 49921,
  2669. +    SPELL_UNHOLY_STANGULATE = 47476,
  2670. +    SPELL_UNHOLY_DEATH_STRIKE = 49924,
  2671. +    SPELL_UNHOLY_ARMY = 42650, // <- should happen with both NPC's simultaneously
  2672. +    SPELL_ENRAGE = 59707,
  2673. +    /* Second Wave Elite Spells */
  2674. +    /*    `- Rider Brutes    */
  2675. +    SPELL_RIDERS_LIGHTNING = 59159, // aoe
  2676. +    SPELL_RIDERS_CHAIN_LIGHTNING = 49269, // aoe
  2677. +    SPELL_RIDERS_MOONFIRE = 48463,
  2678. +    SPELL_RIDERS_STORM = 48467, // aoe
  2679. +    /*    `- Rider Healer    */
  2680. +    SPELL_RIDERS_STAM_BUFF = 48161, // fortitude buff
  2681. +    SPELL_RIDERS_SHIELD = 48066, // absorbs damage
  2682. +    SPELL_RIDERS_HEALING_BOLT = 66097,
  2683. +    SPELL_RIDERS_RENEW = 48068,
  2684. +    SPELL_RIDERS_GREATER_HEAL = 48063,
  2685. +    /* Final Wave Boss Spells */
  2686. +    SPELL_DRAGON_FIRE_SHIELD = 57108, //Reduces damage by 95% for 5s
  2687. +    SPELL_DRAGON_ENGULF = 74562,
  2688. +    SPELL_DRAGON_BREATH = 74525,
  2689. +    SPELL_DRAGON_TAIL_WHIP = 74531,
  2690. +    SPELL_DRAGON_BERSERK = 26662,
  2691. +    SPELL_DRAGON_CLAW = 74524,
  2692. +    SPELL_DRAGON_MASSIVE_FLAMESTRIKE = 26558,
  2693. +    //SPELL_DRAGON_FIREBALL_BARRAGE = 37541,
  2694. +    /* Others */
  2695. +    SPELL_TELEPORT_VISUAL = 64446,
  2696. +    /* Disable Class Spells */
  2697. +    SPELL_VANISH_1 = 1856,
  2698. +    SPELL_VANISH_2 = 1857,
  2699. +    SPELL_VANISH_3 = 26889,
  2700. +};
  2701. +
  2702. +enum SpawnIds
  2703. +{
  2704. +    /* First Wave */
  2705. +    NPC_RED_BLOOD_GUARD =         88001,
  2706. +    NPC_RED_BLOOD_GUARD_MINI =    88002,
  2707. +    NPC_RED_BLOOD_GUARD_MINI2 =   88003,
  2708. +    NPC_RED_BLOOD_GUARD_MINI3 =   88004,
  2709. +    /* First Wave Treat */
  2710. +    NPC_WAVE_SPAWN_TRIGGER =      88500,
  2711. +    NPC_GARM_WATCHER       =      80050,
  2712. +    NPC_FRIGID_PROTO_DRAKE =      80051,
  2713. +    NPC_OSTERKILGR         =      80052,
  2714. +    NPC_BLIGHT_FALCONER    =      80053,
  2715. +    NPC_CONVERTED_HERO     =      80054,
  2716. +    NPC_PORTAL =                  88501,
  2717. +    /* First Wave Elite */                     /* NPC : Display ID */
  2718. +    NPC_HANK_THE_TANK  =          88011,    // Tank: 27930 Paladin Tank BE
  2719. +    NPC_FIELD_MEDIC  =              88012,    // Healer: 17544 Spore thing
  2720. +    /* Second Wave */
  2721. +    NPC_ROGUE_INITIATE =           88013, // Main rogue: 24918
  2722. +    NPC_ROGUE_INITIATE_1 =          88014, // Sidekick(easier to kill): 24919
  2723. +    NPC_ROGUE_INITIATE_2 =           88015, // Sidekick(easier to kill): 24919
  2724. +    /* Second Wave Treat */
  2725. +    NPC_THE_UNHOLY =               88016, // Main: 25446
  2726. +    NPC_THE_UNHOLY_TWIN =           88017, // Twin: 25496
  2727. +    NPC_THE_UNHOLY_PET =           88018, // Their Pet: 25467 (no spells, normal attacks just to occupy the player) Maybe just SPELL_PET_BITE ?
  2728. +    /* Second Wave Elite */
  2729. +    NPC_RIDERS_OFTHE_ICE =           88019, // Main/Healer: 25083
  2730. +    NPC_RIDERS_OFTHE_ICE_1 =      88020, // Brute: 25082
  2731. +    NPC_RIDERS_OFTHE_ICE_2 =       88021, // Brute: 25082
  2732. +    /* Final Wave Boss */
  2733. +    NPC_DRAGON_BOSS =               88022, // Dragon: 25015
  2734. +    NPC_DRAGON_BOSS_TRIGGER =     88023,
  2735. +    GOBJECT_DRAGON_BOSS_RUNE =    183036,
  2736. +};
  2737. +
  2738. +enum eEnums
  2739. +{
  2740. +    ITEM_INTRAVENOUS_HEALING_POTION = 44698, // You can change the items they can heal with here
  2741. +    DIRE_MAUL_ZONE = 2557,
  2742. +    DIRE_MAUL_AREA = 357, //3217,
  2743. +    PVP_END_TOKEN = 47241, // You can easily change this
  2744. +    SOUND_HORN_WAVE_START = 7054,
  2745. +    SOUND_WAVE_COMPLETE = 8571,
  2746. +};
  2747. +
  2748. +struct DragonMove
  2749. +{
  2750. +    uint32 gobject;
  2751. +    uint32 spellId;
  2752. +    float x, y, z, o;
  2753. +};
  2754. +
  2755. +uint32 spellDisables[] = { SPELL_VANISH_1, SPELL_VANISH_2, SPELL_VANISH_3 };
  2756. +
  2757. +static Position sTeleOut[] =
  2758. +{
  2759. +    { -4286.56f, 1330.970f, 161.21f, 0.019994f }
  2760. +};
  2761. +
  2762. +static DragonMove sMoveData[] =
  2763. +{
  2764. +    {GOBJECT_DRAGON_BOSS_RUNE, SPELL_DRAGON_MASSIVE_FLAMESTRIKE, -3786.241943f, 1096.538452f, 153.903366f, 6.257603f }
  2765. +};
  2766. +
  2767. +#define MAX_WAVE_SPAWN_LOCATIONS 20
  2768. +const uint32 waveList[MAX_WAVE_SPAWN_LOCATIONS] =
  2769. +{
  2770. +       /* First Wave Ids */
  2771. +       NPC_RED_BLOOD_GUARD,
  2772. +       /* First Wave Treat Ids */
  2773. +       NPC_WAVE_SPAWN_TRIGGER, NPC_GARM_WATCHER, NPC_FRIGID_PROTO_DRAKE, NPC_OSTERKILGR, NPC_BLIGHT_FALCONER, NPC_CONVERTED_HERO, NPC_PORTAL,
  2774. +       /* First Wave Elite Ids */
  2775. +       NPC_HANK_THE_TANK, NPC_FIELD_MEDIC,
  2776. +       /* Second Wave Ids */
  2777. +       NPC_ROGUE_INITIATE, NPC_ROGUE_INITIATE_1, NPC_ROGUE_INITIATE_2,
  2778. +       /* Second Wave Treat Ids */
  2779. +       NPC_THE_UNHOLY, NPC_THE_UNHOLY_TWIN, NPC_THE_UNHOLY_PET,
  2780. +       /* Second Wave Elite Ids */
  2781. +       NPC_RIDERS_OFTHE_ICE, NPC_RIDERS_OFTHE_ICE_1, NPC_RIDERS_OFTHE_ICE_2,
  2782. +       /* Final Wave Boss */
  2783. +       NPC_DRAGON_BOSS,
  2784. +};
  2785. +
  2786. +static Position m_WaveSpawns[] =
  2787. +{
  2788. +    /*    X               Y            Z           O      */
  2789. +                 /* All Waves Spawns */
  2790. +    { -3756.859863f, 1097.575317f, 131.969559f, 6.159780f },
  2791. +                 /* First Wave Treat */
  2792. +    { -3760.98f, 1082.98f, 131.96f, 0.214342f }, // Portal 1 Location
  2793. +    { -3751.31f, 1106.84f, 131.96f, 5.364266f }  // Portal 2 Location
  2794. +};
  2795. +
  2796. +void MessageOnWave(Creature * me, uint32 eventId)
  2797. +{
  2798. +    stringstream ss;
  2799. +    switch(eventId)
  2800. +    {
  2801. +       case EVENT_CHECK_ACTIVITY: // Before Wave 1 starts
  2802. +           ss << playerName.c_str()
  2803. +              << " get ready! Next wave begins in 10 seconds!";
  2804. +           break;
  2805. +
  2806. +       case EVENT_CHECK_WAVES:
  2807. +           {
  2808. +               if( isWaveBossDead == 1)
  2809. +               {
  2810. +                   ss << "I can't believe it! "
  2811. +                      << playerName.c_str()
  2812. +                      << " has killed the Red Blood Guard! We will see next wave, which is in 25 seconds, gear up!";
  2813. +               }
  2814. +               else if (isWaveBossDead == 2)
  2815. +               {
  2816. +                   ss << "This is unreal! "
  2817. +                      << playerName.c_str()
  2818. +                      << " has dominated the treat wave! Next wave is in 35 seconds! Get ready for a good experience.";
  2819. +               }
  2820. +               else if (isWaveBossDead == 3)
  2821. +               {
  2822. +                   ss << "Holy shit! "
  2823. +                      << playerName.c_str()
  2824. +                      << " has demolished the elite! Good luck getting through the others... Second wave begins in 25 seconds! You may want to heal...";
  2825. +               }
  2826. +               else if (isWaveBossDead == 4)
  2827. +               {
  2828. +                   ss << "Excellent! "
  2829. +                      << playerName.c_str()
  2830. +                      << " has stricken down the rogues! Well done! Next wave is in 35 seconds, be prepared!";
  2831. +               }
  2832. +               else if (isWaveBossDead == 5)
  2833. +               {
  2834. +                   ss << "Zing! I can't believe what I'm seeing! "
  2835. +                      << playerName.c_str()
  2836. +                      << " has defeated the Unholy Twins, EPIC WIN! Next wave in 40 seconds, get ready!";
  2837. +               }
  2838. +               else if (isWaveBossDead == 6)
  2839. +               {
  2840. +                   ss << "WOW! No Way! "
  2841. +                      << playerName.c_str()
  2842. +                      << " has stopped the riders dead in their tracks. Great job! Final wave beings in 35 seconds, get buffed up!";
  2843. +               }
  2844. +               else if (isWaveBossDead == 7)
  2845. +               {
  2846. +                   ss << "Just...a moment of silence. "
  2847. +                      << playerName.c_str()
  2848. +                      << " has just won this entire challenge! Congratulations!";
  2849. +               }
  2850. +           }break;
  2851. +
  2852. +       case EVENT_FIRST_WAVE:
  2853. +           ss << "First wave has begun!"
  2854. +              << " From the blood gates of hell, here is,"
  2855. +              << " Arena Master, Red Blood Guard!";
  2856. +           break;
  2857. +
  2858. +       case EVENT_FIRST_WAVE_TREAT:
  2859. +           ss << "First treat wave has begun!"
  2860. +              << " Bounding across the continent, you will face many challenges!";
  2861. +           break;
  2862. +
  2863. +       case EVENT_FIRST_WAVE_ELITE:
  2864. +           ss << "First elite wave has begun!"
  2865. +              << " Say your last words, this elite team wont give you another chance to."
  2866. +              << " Entering the arena, Hank the Tank and his heal happy spore companion. Prepare for the worst!";
  2867. +           break;
  2868. +
  2869. +       case EVENT_SECOND_WAVE:
  2870. +           ss << "Second wave has begun!"
  2871. +              << " Trust your eyes and dont blink, this team of initiates only provide pain!"
  2872. +              << " The quick, the stealthy.. The Rogue Initiates, maybe run?";
  2873. +           break;
  2874. +
  2875. +       case EVENT_SECOND_WAVE_TREAT:
  2876. +          ss << "Second treat wave has begun!"
  2877. +             << " From the depths of the underworld, they were sent back here to take care of business!"
  2878. +             << " The deadliest duo, the Unholy Twins - Seal your fate, destroy them!";
  2879. +           break;
  2880. +
  2881. +       case EVENT_SECOND_WAVE_ELITE:
  2882. +          ss << "Second elite wave has begun!"
  2883. +             << " The Riders of the Ice have entered the arena!"
  2884. +             << " Don't be fooled by their size, they will walk all over you. Attack!";
  2885. +           break;
  2886. +
  2887. +       case EVENT_FINAL_WAVE_BOSS:
  2888. +          ss << "From deep into the Earth's core "
  2889. +             << " there lies a entirely different aspect of a challenge. "
  2890. +             << " Get Ready! Arena Dragon is here!";
  2891. +           break;
  2892. +    }
  2893. +    me->Yell(ss.str().c_str(), LANG_UNIVERSAL, 0);
  2894. +}
  2895. +
  2896. +void DoSendCompleteMessage(string who)
  2897. +{
  2898. +    stringstream ss;
  2899. +    ss << who.c_str()
  2900. +        << "has completed the Dire Maul Arena Event!"
  2901. +        << "The event is now opened and ready for another victim!";
  2902. +    sWorld->SendGlobalText(ss.str().c_str(), nullptr);
  2903. +}
  2904. +
  2905. +void AddEndRewards(ChatHandler* handler, Player * player, uint32 honoramount, uint32 tokenId, uint32 tokenAmount)
  2906. +{
  2907. +    //uint32 curHonor = player->GetHonorPoints();
  2908. +    player->RewardHonor(player, honoramount, -1, true);
  2909. +    handler->PSendSysMessage("Added %u honor!", honoramount);
  2910. +    player->AddItem(tokenId, tokenAmount);
  2911. +}
  2912. +/* End Battle Functions */
  2913. +void DoEndBattle(Creature * me)
  2914. +{
  2915. +    isBattleActive = false;
  2916. +    //m_PlayerGUID = 0;
  2917. +    playerName = "";
  2918. +    me->DespawnOrUnsummon(1);
  2919. +}
  2920. +
  2921. +void DoEndBattle(Creature * me, SummonList summons)
  2922. +{
  2923. +    isBattleActive = false;
  2924. +    //m_PlayerGUID = 0;
  2925. +    playerName = "";
  2926. +    summons.DespawnAll();
  2927. +    me->DespawnOrUnsummon(1);
  2928. +}
  2929. +/* Increase Health Function ~ Boss Fight Pet */
  2930. +void DoIncreaseHealth(Creature * me, float size, uint32 phase, uint32 phaseAmount)
  2931. +{
  2932. +    me->SetMaxHealth(me->GetMaxHealth()+40000);
  2933. +    me->SetHealth(me->GetMaxHealth()+40000);
  2934. +    me->SetFloatValue(OBJECT_FIELD_SCALE_X, size);
  2935. +    phase = phaseAmount;
  2936. +}
  2937. --
  2938. 2.8.4
  2939.  
  2940.  
Advertisement
Add Comment
Please, Sign In to add comment