From dc510c9a143de1977daedea0aefb9589c01adde2 Mon Sep 17 00:00:00 2001 From: click Date: Mon, 7 Jun 2010 00:54:06 +0200 Subject: Some more consistency-renaming of script-zones --HG-- branch : trunk rename : src/server/scripts/EasternKingdoms/alterac_valley/alterac_valley.cpp => src/server/scripts/EasternKingdoms/AlteracValley/alterac_valley.cpp rename : src/server/scripts/EasternKingdoms/alterac_valley/boss_balinda.cpp => src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp rename : src/server/scripts/EasternKingdoms/alterac_valley/boss_drekthar.cpp => src/server/scripts/EasternKingdoms/AlteracValley/boss_drekthar.cpp rename : src/server/scripts/EasternKingdoms/alterac_valley/boss_galvangar.cpp => src/server/scripts/EasternKingdoms/AlteracValley/boss_galvangar.cpp rename : src/server/scripts/EasternKingdoms/alterac_valley/boss_vanndar.cpp => src/server/scripts/EasternKingdoms/AlteracValley/boss_vanndar.cpp rename : src/server/scripts/EasternKingdoms/blackrock_depths/blackrock_depths.cpp => src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp rename : src/server/scripts/EasternKingdoms/blackrock_depths/blackrock_depths.h => src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.h rename : src/server/scripts/EasternKingdoms/blackrock_depths/boss_ambassador_flamelash.cpp => src/server/scripts/EasternKingdoms/BlackrockDepths/boss_ambassador_flamelash.cpp rename : src/server/scripts/EasternKingdoms/blackrock_depths/boss_anubshiah.cpp => src/server/scripts/EasternKingdoms/BlackrockDepths/boss_anubshiah.cpp rename : src/server/scripts/EasternKingdoms/blackrock_depths/boss_emperor_dagran_thaurissan.cpp => src/server/scripts/EasternKingdoms/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp rename : src/server/scripts/EasternKingdoms/blackrock_depths/boss_general_angerforge.cpp => src/server/scripts/EasternKingdoms/BlackrockDepths/boss_general_angerforge.cpp rename : src/server/scripts/EasternKingdoms/blackrock_depths/boss_gorosh_the_dervish.cpp => src/server/scripts/EasternKingdoms/BlackrockDepths/boss_gorosh_the_dervish.cpp rename : src/server/scripts/EasternKingdoms/blackrock_depths/boss_grizzle.cpp => src/server/scripts/EasternKingdoms/BlackrockDepths/boss_grizzle.cpp rename : src/server/scripts/EasternKingdoms/blackrock_depths/boss_high_interrogator_gerstahn.cpp => src/server/scripts/EasternKingdoms/BlackrockDepths/boss_high_interrogator_gerstahn.cpp rename : src/server/scripts/EasternKingdoms/blackrock_depths/boss_magmus.cpp => src/server/scripts/EasternKingdoms/BlackrockDepths/boss_magmus.cpp rename : src/server/scripts/EasternKingdoms/blackrock_depths/boss_moira_bronzebeard.cpp => src/server/scripts/EasternKingdoms/BlackrockDepths/boss_moira_bronzebeard.cpp rename : src/server/scripts/EasternKingdoms/blackrock_depths/boss_tomb_of_seven.cpp => src/server/scripts/EasternKingdoms/BlackrockDepths/boss_tomb_of_seven.cpp rename : src/server/scripts/EasternKingdoms/blackrock_depths/instance_blackrock_depths.cpp => src/server/scripts/EasternKingdoms/BlackrockDepths/instance_blackrock_depths.cpp rename : src/server/scripts/EasternKingdoms/blackrock_spire/blackrock_spire.cpp => src/server/scripts/EasternKingdoms/BlackrockSpire/blackrock_spire.cpp rename : src/server/scripts/EasternKingdoms/blackrock_spire/blackrock_spire.h => src/server/scripts/EasternKingdoms/BlackrockSpire/blackrock_spire.h rename : src/server/scripts/EasternKingdoms/blackrock_spire/boss_drakkisath.cpp => src/server/scripts/EasternKingdoms/BlackrockSpire/boss_drakkisath.cpp rename : src/server/scripts/EasternKingdoms/blackrock_spire/boss_gyth.cpp => src/server/scripts/EasternKingdoms/BlackrockSpire/boss_gyth.cpp rename : src/server/scripts/EasternKingdoms/blackrock_spire/boss_halycon.cpp => src/server/scripts/EasternKingdoms/BlackrockSpire/boss_halycon.cpp rename : src/server/scripts/EasternKingdoms/blackrock_spire/boss_highlord_omokk.cpp => src/server/scripts/EasternKingdoms/BlackrockSpire/boss_highlord_omokk.cpp rename : src/server/scripts/EasternKingdoms/blackrock_spire/boss_mother_smolderweb.cpp => src/server/scripts/EasternKingdoms/BlackrockSpire/boss_mother_smolderweb.cpp rename : src/server/scripts/EasternKingdoms/blackrock_spire/boss_overlord_wyrmthalak.cpp => src/server/scripts/EasternKingdoms/BlackrockSpire/boss_overlord_wyrmthalak.cpp rename : src/server/scripts/EasternKingdoms/blackrock_spire/boss_pyroguard_emberseer.cpp => src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp rename : src/server/scripts/EasternKingdoms/blackrock_spire/boss_quartermaster_zigris.cpp => src/server/scripts/EasternKingdoms/BlackrockSpire/boss_quartermaster_zigris.cpp rename : src/server/scripts/EasternKingdoms/blackrock_spire/boss_rend_blackhand.cpp => src/server/scripts/EasternKingdoms/BlackrockSpire/boss_rend_blackhand.cpp rename : src/server/scripts/EasternKingdoms/blackrock_spire/boss_shadow_hunter_voshgajin.cpp => src/server/scripts/EasternKingdoms/BlackrockSpire/boss_shadow_hunter_voshgajin.cpp rename : src/server/scripts/EasternKingdoms/blackrock_spire/boss_the_beast.cpp => src/server/scripts/EasternKingdoms/BlackrockSpire/boss_the_beast.cpp rename : src/server/scripts/EasternKingdoms/blackrock_spire/boss_warmaster_voone.cpp => src/server/scripts/EasternKingdoms/BlackrockSpire/boss_warmaster_voone.cpp rename : src/server/scripts/EasternKingdoms/blackrock_spire/instance_blackrock_spire.cpp => src/server/scripts/EasternKingdoms/BlackrockSpire/instance_blackrock_spire.cpp rename : src/server/scripts/EasternKingdoms/blackwing_lair/boss_broodlord_lashlayer.cpp => src/server/scripts/EasternKingdoms/BlackwingLair/boss_broodlord_lashlayer.cpp rename : src/server/scripts/EasternKingdoms/blackwing_lair/boss_chromaggus.cpp => src/server/scripts/EasternKingdoms/BlackwingLair/boss_chromaggus.cpp rename : src/server/scripts/EasternKingdoms/blackwing_lair/boss_ebonroc.cpp => src/server/scripts/EasternKingdoms/BlackwingLair/boss_ebonroc.cpp rename : src/server/scripts/EasternKingdoms/blackwing_lair/boss_firemaw.cpp => src/server/scripts/EasternKingdoms/BlackwingLair/boss_firemaw.cpp rename : src/server/scripts/EasternKingdoms/blackwing_lair/boss_flamegor.cpp => src/server/scripts/EasternKingdoms/BlackwingLair/boss_flamegor.cpp rename : src/server/scripts/EasternKingdoms/blackwing_lair/boss_nefarian.cpp => src/server/scripts/EasternKingdoms/BlackwingLair/boss_nefarian.cpp rename : src/server/scripts/EasternKingdoms/blackwing_lair/boss_razorgore.cpp => src/server/scripts/EasternKingdoms/BlackwingLair/boss_razorgore.cpp rename : src/server/scripts/EasternKingdoms/blackwing_lair/boss_vaelastrasz.cpp => src/server/scripts/EasternKingdoms/BlackwingLair/boss_vaelastrasz.cpp rename : src/server/scripts/EasternKingdoms/blackwing_lair/boss_victor_nefarius.cpp => src/server/scripts/EasternKingdoms/BlackwingLair/boss_victor_nefarius.cpp rename : src/server/scripts/EasternKingdoms/blackwing_lair/instance_blackwing_lair.cpp => src/server/scripts/EasternKingdoms/BlackwingLair/instance_blackwing_lair.cpp rename : src/server/scripts/EasternKingdoms/deadmines/boss_mr_smite.cpp => src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp rename : src/server/scripts/EasternKingdoms/deadmines/deadmines.cpp => src/server/scripts/EasternKingdoms/Deadmines/deadmines.cpp rename : src/server/scripts/EasternKingdoms/deadmines/deadmines.h => src/server/scripts/EasternKingdoms/Deadmines/deadmines.h rename : src/server/scripts/EasternKingdoms/deadmines/instance_deadmines.cpp => src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp rename : src/server/scripts/EasternKingdoms/gnomeregan/gnomeregan.cpp => src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp rename : src/server/scripts/EasternKingdoms/gnomeregan/gnomeregan.h => src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.h rename : src/server/scripts/EasternKingdoms/gnomeregan/instance_gnomeregan.cpp => src/server/scripts/EasternKingdoms/Gnomeregan/instance_gnomeregan.cpp rename : src/server/scripts/EasternKingdoms/karazhan/boss_curator.cpp => src/server/scripts/EasternKingdoms/Karazhan/boss_curator.cpp rename : src/server/scripts/EasternKingdoms/karazhan/boss_maiden_of_virtue.cpp => src/server/scripts/EasternKingdoms/Karazhan/boss_maiden_of_virtue.cpp rename : src/server/scripts/EasternKingdoms/karazhan/boss_midnight.cpp => src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp rename : src/server/scripts/EasternKingdoms/karazhan/boss_moroes.cpp => src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp rename : src/server/scripts/EasternKingdoms/karazhan/boss_netherspite.cpp => src/server/scripts/EasternKingdoms/Karazhan/boss_netherspite.cpp rename : src/server/scripts/EasternKingdoms/karazhan/boss_nightbane.cpp => src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp rename : src/server/scripts/EasternKingdoms/karazhan/boss_prince_malchezaar.cpp => src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp rename : src/server/scripts/EasternKingdoms/karazhan/boss_shade_of_aran.cpp => src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp rename : src/server/scripts/EasternKingdoms/karazhan/boss_terestian_illhoof.cpp => src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp rename : src/server/scripts/EasternKingdoms/karazhan/bosses_opera.cpp => src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp rename : src/server/scripts/EasternKingdoms/karazhan/instance_karazhan.cpp => src/server/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp rename : src/server/scripts/EasternKingdoms/karazhan/karazhan.cpp => src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp rename : src/server/scripts/EasternKingdoms/karazhan/karazhan.h => src/server/scripts/EasternKingdoms/Karazhan/karazhan.h rename : src/server/scripts/EasternKingdoms/magisters_terrace/boss_felblood_kaelthas.cpp => src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp rename : src/server/scripts/EasternKingdoms/magisters_terrace/boss_priestess_delrissa.cpp => src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp rename : src/server/scripts/EasternKingdoms/magisters_terrace/boss_selin_fireheart.cpp => src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp rename : src/server/scripts/EasternKingdoms/magisters_terrace/boss_vexallus.cpp => src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp rename : src/server/scripts/EasternKingdoms/magisters_terrace/instance_magisters_terrace.cpp => src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp rename : src/server/scripts/EasternKingdoms/magisters_terrace/magisters_terrace.cpp => src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.cpp rename : src/server/scripts/EasternKingdoms/magisters_terrace/magisters_terrace.h => src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.h rename : src/server/scripts/EasternKingdoms/molten_core/boss_baron_geddon.cpp => src/server/scripts/EasternKingdoms/MoltenCore/boss_baron_geddon.cpp rename : src/server/scripts/EasternKingdoms/molten_core/boss_garr.cpp => src/server/scripts/EasternKingdoms/MoltenCore/boss_garr.cpp rename : src/server/scripts/EasternKingdoms/molten_core/boss_gehennas.cpp => src/server/scripts/EasternKingdoms/MoltenCore/boss_gehennas.cpp rename : src/server/scripts/EasternKingdoms/molten_core/boss_golemagg.cpp => src/server/scripts/EasternKingdoms/MoltenCore/boss_golemagg.cpp rename : src/server/scripts/EasternKingdoms/molten_core/boss_lucifron.cpp => src/server/scripts/EasternKingdoms/MoltenCore/boss_lucifron.cpp rename : src/server/scripts/EasternKingdoms/molten_core/boss_magmadar.cpp => src/server/scripts/EasternKingdoms/MoltenCore/boss_magmadar.cpp rename : src/server/scripts/EasternKingdoms/molten_core/boss_majordomo_executus.cpp => src/server/scripts/EasternKingdoms/MoltenCore/boss_majordomo_executus.cpp rename : src/server/scripts/EasternKingdoms/molten_core/boss_ragnaros.cpp => src/server/scripts/EasternKingdoms/MoltenCore/boss_ragnaros.cpp rename : src/server/scripts/EasternKingdoms/molten_core/boss_shazzrah.cpp => src/server/scripts/EasternKingdoms/MoltenCore/boss_shazzrah.cpp rename : src/server/scripts/EasternKingdoms/molten_core/boss_sulfuron_harbinger.cpp => src/server/scripts/EasternKingdoms/MoltenCore/boss_sulfuron_harbinger.cpp rename : src/server/scripts/EasternKingdoms/molten_core/instance_molten_core.cpp => src/server/scripts/EasternKingdoms/MoltenCore/instance_molten_core.cpp rename : src/server/scripts/EasternKingdoms/molten_core/molten_core.cpp => src/server/scripts/EasternKingdoms/MoltenCore/molten_core.cpp rename : src/server/scripts/EasternKingdoms/molten_core/molten_core.h => src/server/scripts/EasternKingdoms/MoltenCore/molten_core.h rename : src/server/scripts/EasternKingdoms/scarlet_enclave/chapter1.cpp => src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp rename : src/server/scripts/EasternKingdoms/scarlet_enclave/chapter2.cpp => src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp rename : src/server/scripts/EasternKingdoms/scarlet_enclave/chapter5.cpp => src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp rename : src/server/scripts/EasternKingdoms/scarlet_enclave/the_scarlet_enclave.cpp => src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp rename : src/server/scripts/EasternKingdoms/scarlet_monastery/boss_arcanist_doan.cpp => src/server/scripts/EasternKingdoms/ScarletMonastery/boss_arcanist_doan.cpp rename : src/server/scripts/EasternKingdoms/scarlet_monastery/boss_azshir_the_sleepless.cpp => src/server/scripts/EasternKingdoms/ScarletMonastery/boss_azshir_the_sleepless.cpp rename : src/server/scripts/EasternKingdoms/scarlet_monastery/boss_bloodmage_thalnos.cpp => src/server/scripts/EasternKingdoms/ScarletMonastery/boss_bloodmage_thalnos.cpp rename : src/server/scripts/EasternKingdoms/scarlet_monastery/boss_headless_horseman.cpp => src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp rename : src/server/scripts/EasternKingdoms/scarlet_monastery/boss_herod.cpp => src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp rename : src/server/scripts/EasternKingdoms/scarlet_monastery/boss_high_inquisitor_fairbanks.cpp => src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp rename : src/server/scripts/EasternKingdoms/scarlet_monastery/boss_houndmaster_loksey.cpp => src/server/scripts/EasternKingdoms/ScarletMonastery/boss_houndmaster_loksey.cpp rename : src/server/scripts/EasternKingdoms/scarlet_monastery/boss_interrogator_vishas.cpp => src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp rename : src/server/scripts/EasternKingdoms/scarlet_monastery/boss_mograine_and_whitemane.cpp => src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp rename : src/server/scripts/EasternKingdoms/scarlet_monastery/boss_scorn.cpp => src/server/scripts/EasternKingdoms/ScarletMonastery/boss_scorn.cpp rename : src/server/scripts/EasternKingdoms/scarlet_monastery/instance_scarlet_monastery.cpp => src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp rename : src/server/scripts/EasternKingdoms/scarlet_monastery/scarlet_monastery.h => src/server/scripts/EasternKingdoms/ScarletMonastery/scarlet_monastery.h rename : src/server/scripts/EasternKingdoms/scholomance/boss_darkmaster_gandling.cpp => src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp rename : src/server/scripts/EasternKingdoms/scholomance/boss_death_knight_darkreaver.cpp => src/server/scripts/EasternKingdoms/Scholomance/boss_death_knight_darkreaver.cpp rename : src/server/scripts/EasternKingdoms/scholomance/boss_doctor_theolen_krastinov.cpp => src/server/scripts/EasternKingdoms/Scholomance/boss_doctor_theolen_krastinov.cpp rename : src/server/scripts/EasternKingdoms/scholomance/boss_illucia_barov.cpp => src/server/scripts/EasternKingdoms/Scholomance/boss_illucia_barov.cpp rename : src/server/scripts/EasternKingdoms/scholomance/boss_instructor_malicia.cpp => src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp rename : src/server/scripts/EasternKingdoms/scholomance/boss_jandice_barov.cpp => src/server/scripts/EasternKingdoms/Scholomance/boss_jandice_barov.cpp rename : src/server/scripts/EasternKingdoms/scholomance/boss_kormok.cpp => src/server/scripts/EasternKingdoms/Scholomance/boss_kormok.cpp rename : src/server/scripts/EasternKingdoms/scholomance/boss_lord_alexei_barov.cpp => src/server/scripts/EasternKingdoms/Scholomance/boss_lord_alexei_barov.cpp rename : src/server/scripts/EasternKingdoms/scholomance/boss_lorekeeper_polkelt.cpp => src/server/scripts/EasternKingdoms/Scholomance/boss_lorekeeper_polkelt.cpp rename : src/server/scripts/EasternKingdoms/scholomance/boss_ras_frostwhisper.cpp => src/server/scripts/EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp rename : src/server/scripts/EasternKingdoms/scholomance/boss_the_ravenian.cpp => src/server/scripts/EasternKingdoms/Scholomance/boss_the_ravenian.cpp rename : src/server/scripts/EasternKingdoms/scholomance/boss_vectus.cpp => src/server/scripts/EasternKingdoms/Scholomance/boss_vectus.cpp rename : src/server/scripts/EasternKingdoms/scholomance/instance_scholomance.cpp => src/server/scripts/EasternKingdoms/Scholomance/instance_scholomance.cpp rename : src/server/scripts/EasternKingdoms/scholomance/scholomance.h => src/server/scripts/EasternKingdoms/Scholomance/scholomance.h rename : src/server/scripts/EasternKingdoms/shadowfang_keep/instance_shadowfang_keep.cpp => src/server/scripts/EasternKingdoms/ShadowfangKeep/instance_shadowfang_keep.cpp rename : src/server/scripts/EasternKingdoms/shadowfang_keep/shadowfang_keep.cpp => src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp rename : src/server/scripts/EasternKingdoms/shadowfang_keep/shadowfang_keep.h => src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.h rename : src/server/scripts/EasternKingdoms/stratholme/boss_baron_rivendare.cpp => src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp rename : src/server/scripts/EasternKingdoms/stratholme/boss_baroness_anastari.cpp => src/server/scripts/EasternKingdoms/Stratholme/boss_baroness_anastari.cpp rename : src/server/scripts/EasternKingdoms/stratholme/boss_cannon_master_willey.cpp => src/server/scripts/EasternKingdoms/Stratholme/boss_cannon_master_willey.cpp rename : src/server/scripts/EasternKingdoms/stratholme/boss_dathrohan_balnazzar.cpp => src/server/scripts/EasternKingdoms/Stratholme/boss_dathrohan_balnazzar.cpp rename : src/server/scripts/EasternKingdoms/stratholme/boss_magistrate_barthilas.cpp => src/server/scripts/EasternKingdoms/Stratholme/boss_magistrate_barthilas.cpp rename : src/server/scripts/EasternKingdoms/stratholme/boss_maleki_the_pallid.cpp => src/server/scripts/EasternKingdoms/Stratholme/boss_maleki_the_pallid.cpp rename : src/server/scripts/EasternKingdoms/stratholme/boss_nerubenkan.cpp => src/server/scripts/EasternKingdoms/Stratholme/boss_nerubenkan.cpp rename : src/server/scripts/EasternKingdoms/stratholme/boss_order_of_silver_hand.cpp => src/server/scripts/EasternKingdoms/Stratholme/boss_order_of_silver_hand.cpp rename : src/server/scripts/EasternKingdoms/stratholme/boss_postmaster_malown.cpp => src/server/scripts/EasternKingdoms/Stratholme/boss_postmaster_malown.cpp rename : src/server/scripts/EasternKingdoms/stratholme/boss_ramstein_the_gorger.cpp => src/server/scripts/EasternKingdoms/Stratholme/boss_ramstein_the_gorger.cpp rename : src/server/scripts/EasternKingdoms/stratholme/boss_timmy_the_cruel.cpp => src/server/scripts/EasternKingdoms/Stratholme/boss_timmy_the_cruel.cpp rename : src/server/scripts/EasternKingdoms/stratholme/instance_stratholme.cpp => src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp rename : src/server/scripts/EasternKingdoms/stratholme/stratholme.cpp => src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp rename : src/server/scripts/EasternKingdoms/stratholme/stratholme.h => src/server/scripts/EasternKingdoms/Stratholme/stratholme.h rename : src/server/scripts/EasternKingdoms/sunken_temple/instance_sunken_temple.cpp => src/server/scripts/EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp rename : src/server/scripts/EasternKingdoms/sunken_temple/sunken_temple.cpp => src/server/scripts/EasternKingdoms/SunkenTemple/sunken_temple.cpp rename : src/server/scripts/EasternKingdoms/sunken_temple/sunken_temple.h => src/server/scripts/EasternKingdoms/SunkenTemple/sunken_temple.h rename : src/server/scripts/EasternKingdoms/sunwell_plateau/boss_brutallus.cpp => src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp rename : src/server/scripts/EasternKingdoms/sunwell_plateau/boss_eredar_twins.cpp => src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp rename : src/server/scripts/EasternKingdoms/sunwell_plateau/boss_felmyst.cpp => src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp rename : src/server/scripts/EasternKingdoms/sunwell_plateau/boss_kalecgos.cpp => src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp rename : src/server/scripts/EasternKingdoms/sunwell_plateau/boss_kiljaeden.cpp => src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp rename : src/server/scripts/EasternKingdoms/sunwell_plateau/boss_muru.cpp => src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp rename : src/server/scripts/EasternKingdoms/sunwell_plateau/instance_sunwell_plateau.cpp => src/server/scripts/EasternKingdoms/SunwellPlateau/instance_sunwell_plateau.cpp rename : src/server/scripts/EasternKingdoms/sunwell_plateau/sunwell_plateau.cpp => src/server/scripts/EasternKingdoms/SunwellPlateau/sunwell_plateau.cpp rename : src/server/scripts/EasternKingdoms/sunwell_plateau/sunwell_plateau.h => src/server/scripts/EasternKingdoms/SunwellPlateau/sunwell_plateau.h rename : src/server/scripts/EasternKingdoms/uldaman/boss_archaedas.cpp => src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp rename : src/server/scripts/EasternKingdoms/uldaman/boss_ironaya.cpp => src/server/scripts/EasternKingdoms/Uldaman/boss_ironaya.cpp rename : src/server/scripts/EasternKingdoms/uldaman/instance_uldaman.cpp => src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp rename : src/server/scripts/EasternKingdoms/uldaman/uldaman.cpp => src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp rename : src/server/scripts/EasternKingdoms/zulaman/boss_akilzon.cpp => src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp rename : src/server/scripts/EasternKingdoms/zulaman/boss_halazzi.cpp => src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp rename : src/server/scripts/EasternKingdoms/zulaman/boss_hexlord.cpp => src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp rename : src/server/scripts/EasternKingdoms/zulaman/boss_janalai.cpp => src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp rename : src/server/scripts/EasternKingdoms/zulaman/boss_nalorakk.cpp => src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp rename : src/server/scripts/EasternKingdoms/zulaman/boss_zuljin.cpp => src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp rename : src/server/scripts/EasternKingdoms/zulaman/instance_zulaman.cpp => src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp rename : src/server/scripts/EasternKingdoms/zulaman/zulaman.cpp => src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp rename : src/server/scripts/EasternKingdoms/zulaman/zulaman.h => src/server/scripts/EasternKingdoms/ZulAman/zulaman.h rename : src/server/scripts/EasternKingdoms/zulgurub/boss_arlokk.cpp => src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp rename : src/server/scripts/EasternKingdoms/zulgurub/boss_gahzranka.cpp => src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp rename : src/server/scripts/EasternKingdoms/zulgurub/boss_grilek.cpp => src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp rename : src/server/scripts/EasternKingdoms/zulgurub/boss_hakkar.cpp => src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp rename : src/server/scripts/EasternKingdoms/zulgurub/boss_hazzarah.cpp => src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp rename : src/server/scripts/EasternKingdoms/zulgurub/boss_jeklik.cpp => src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp rename : src/server/scripts/EasternKingdoms/zulgurub/boss_jindo.cpp => src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp rename : src/server/scripts/EasternKingdoms/zulgurub/boss_mandokir.cpp => src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp rename : src/server/scripts/EasternKingdoms/zulgurub/boss_marli.cpp => src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp rename : src/server/scripts/EasternKingdoms/zulgurub/boss_renataki.cpp => src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp rename : src/server/scripts/EasternKingdoms/zulgurub/boss_thekal.cpp => src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp rename : src/server/scripts/EasternKingdoms/zulgurub/boss_venoxis.cpp => src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp rename : src/server/scripts/EasternKingdoms/zulgurub/boss_wushoolay.cpp => src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp rename : src/server/scripts/EasternKingdoms/zulgurub/instance_zulgurub.cpp => src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp rename : src/server/scripts/EasternKingdoms/zulgurub/zulgurub.h => src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h rename : src/server/scripts/Kalimdor/blackfathom_depths/blackfathom_deeps.cpp => src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp rename : src/server/scripts/Kalimdor/blackfathom_depths/blackfathom_deeps.h => src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.h rename : src/server/scripts/Kalimdor/blackfathom_depths/boss_aku_mai.cpp => src/server/scripts/Kalimdor/BlackfathomDeeps/boss_aku_mai.cpp rename : src/server/scripts/Kalimdor/blackfathom_depths/boss_gelihast.cpp => src/server/scripts/Kalimdor/BlackfathomDeeps/boss_gelihast.cpp rename : src/server/scripts/Kalimdor/blackfathom_depths/boss_kelris.cpp => src/server/scripts/Kalimdor/BlackfathomDeeps/boss_kelris.cpp rename : src/server/scripts/Kalimdor/blackfathom_depths/instance_blackfathom_deeps.cpp => src/server/scripts/Kalimdor/BlackfathomDeeps/instance_blackfathom_deeps.cpp rename : src/server/scripts/Kalimdor/caverns_of_time/culling_of_stratholme/boss_epoch.cpp => src/server/scripts/Kalimdor/CavernsOfTime/culling_of_stratholme/boss_epoch.cpp rename : src/server/scripts/Kalimdor/caverns_of_time/culling_of_stratholme/boss_infinite.cpp => src/server/scripts/Kalimdor/CavernsOfTime/culling_of_stratholme/boss_infinite.cpp rename : src/server/scripts/Kalimdor/caverns_of_time/culling_of_stratholme/boss_mal_ganis.cpp => src/server/scripts/Kalimdor/CavernsOfTime/culling_of_stratholme/boss_mal_ganis.cpp rename : src/server/scripts/Kalimdor/caverns_of_time/culling_of_stratholme/boss_meathook.cpp => src/server/scripts/Kalimdor/CavernsOfTime/culling_of_stratholme/boss_meathook.cpp rename : src/server/scripts/Kalimdor/caverns_of_time/culling_of_stratholme/boss_salramm.cpp => src/server/scripts/Kalimdor/CavernsOfTime/culling_of_stratholme/boss_salramm.cpp rename : src/server/scripts/Kalimdor/caverns_of_time/culling_of_stratholme/culling_of_stratholme.cpp => src/server/scripts/Kalimdor/CavernsOfTime/culling_of_stratholme/culling_of_stratholme.cpp rename : src/server/scripts/Kalimdor/caverns_of_time/culling_of_stratholme/culling_of_stratholme.h => src/server/scripts/Kalimdor/CavernsOfTime/culling_of_stratholme/culling_of_stratholme.h rename : src/server/scripts/Kalimdor/caverns_of_time/culling_of_stratholme/instance_culling_of_stratholme.cpp => src/server/scripts/Kalimdor/CavernsOfTime/culling_of_stratholme/instance_culling_of_stratholme.cpp rename : src/server/scripts/Kalimdor/caverns_of_time/dark_portal/boss_aeonus.cpp => src/server/scripts/Kalimdor/CavernsOfTime/dark_portal/boss_aeonus.cpp rename : src/server/scripts/Kalimdor/caverns_of_time/dark_portal/boss_chrono_lord_deja.cpp => src/server/scripts/Kalimdor/CavernsOfTime/dark_portal/boss_chrono_lord_deja.cpp rename : src/server/scripts/Kalimdor/caverns_of_time/dark_portal/boss_temporus.cpp => src/server/scripts/Kalimdor/CavernsOfTime/dark_portal/boss_temporus.cpp rename : src/server/scripts/Kalimdor/caverns_of_time/dark_portal/dark_portal.cpp => src/server/scripts/Kalimdor/CavernsOfTime/dark_portal/dark_portal.cpp rename : src/server/scripts/Kalimdor/caverns_of_time/dark_portal/dark_portal.h => src/server/scripts/Kalimdor/CavernsOfTime/dark_portal/dark_portal.h rename : src/server/scripts/Kalimdor/caverns_of_time/dark_portal/instance_dark_portal.cpp => src/server/scripts/Kalimdor/CavernsOfTime/dark_portal/instance_dark_portal.cpp rename : src/server/scripts/Kalimdor/caverns_of_time/hyjal/boss_anetheron.cpp => src/server/scripts/Kalimdor/CavernsOfTime/hyjal/boss_anetheron.cpp rename : src/server/scripts/Kalimdor/caverns_of_time/hyjal/boss_archimonde.cpp => src/server/scripts/Kalimdor/CavernsOfTime/hyjal/boss_archimonde.cpp rename : src/server/scripts/Kalimdor/caverns_of_time/hyjal/boss_azgalor.cpp => src/server/scripts/Kalimdor/CavernsOfTime/hyjal/boss_azgalor.cpp rename : src/server/scripts/Kalimdor/caverns_of_time/hyjal/boss_kazrogal.cpp => src/server/scripts/Kalimdor/CavernsOfTime/hyjal/boss_kazrogal.cpp rename : src/server/scripts/Kalimdor/caverns_of_time/hyjal/boss_rage_winterchill.cpp => src/server/scripts/Kalimdor/CavernsOfTime/hyjal/boss_rage_winterchill.cpp rename : src/server/scripts/Kalimdor/caverns_of_time/hyjal/hyjal.cpp => src/server/scripts/Kalimdor/CavernsOfTime/hyjal/hyjal.cpp rename : src/server/scripts/Kalimdor/caverns_of_time/hyjal/hyjal.h => src/server/scripts/Kalimdor/CavernsOfTime/hyjal/hyjal.h rename : src/server/scripts/Kalimdor/caverns_of_time/hyjal/hyjalAI.cpp => src/server/scripts/Kalimdor/CavernsOfTime/hyjal/hyjalAI.cpp rename : src/server/scripts/Kalimdor/caverns_of_time/hyjal/hyjalAI.h => src/server/scripts/Kalimdor/CavernsOfTime/hyjal/hyjalAI.h rename : src/server/scripts/Kalimdor/caverns_of_time/hyjal/hyjal_trash.cpp => src/server/scripts/Kalimdor/CavernsOfTime/hyjal/hyjal_trash.cpp rename : src/server/scripts/Kalimdor/caverns_of_time/hyjal/hyjal_trash.h => src/server/scripts/Kalimdor/CavernsOfTime/hyjal/hyjal_trash.h rename : src/server/scripts/Kalimdor/caverns_of_time/hyjal/instance_hyjal.cpp => src/server/scripts/Kalimdor/CavernsOfTime/hyjal/instance_hyjal.cpp rename : src/server/scripts/Kalimdor/caverns_of_time/old_hillsbrad/boss_captain_skarloc.cpp => src/server/scripts/Kalimdor/CavernsOfTime/old_hillsbrad/boss_captain_skarloc.cpp rename : src/server/scripts/Kalimdor/caverns_of_time/old_hillsbrad/boss_epoch_hunter.cpp => src/server/scripts/Kalimdor/CavernsOfTime/old_hillsbrad/boss_epoch_hunter.cpp rename : src/server/scripts/Kalimdor/caverns_of_time/old_hillsbrad/boss_leutenant_drake.cpp => src/server/scripts/Kalimdor/CavernsOfTime/old_hillsbrad/boss_leutenant_drake.cpp rename : src/server/scripts/Kalimdor/caverns_of_time/old_hillsbrad/instance_old_hillsbrad.cpp => src/server/scripts/Kalimdor/CavernsOfTime/old_hillsbrad/instance_old_hillsbrad.cpp rename : src/server/scripts/Kalimdor/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp => src/server/scripts/Kalimdor/CavernsOfTime/old_hillsbrad/old_hillsbrad.cpp rename : src/server/scripts/Kalimdor/caverns_of_time/old_hillsbrad/old_hillsbrad.h => src/server/scripts/Kalimdor/CavernsOfTime/old_hillsbrad/old_hillsbrad.h rename : src/server/scripts/Kalimdor/maraudon/boss_celebras_the_cursed.cpp => src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp rename : src/server/scripts/Kalimdor/maraudon/boss_landslide.cpp => src/server/scripts/Kalimdor/Maraudon/boss_landslide.cpp rename : src/server/scripts/Kalimdor/maraudon/boss_noxxion.cpp => src/server/scripts/Kalimdor/Maraudon/boss_noxxion.cpp rename : src/server/scripts/Kalimdor/maraudon/boss_princess_theradras.cpp => src/server/scripts/Kalimdor/Maraudon/boss_princess_theradras.cpp rename : src/server/scripts/Kalimdor/onyxias_lair/boss_onyxia.cpp => src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp rename : src/server/scripts/Kalimdor/onyxias_lair/instance_onyxias_lair.cpp => src/server/scripts/Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp rename : src/server/scripts/Kalimdor/onyxias_lair/onyxias_lair.h => src/server/scripts/Kalimdor/OnyxiasLair/onyxias_lair.h rename : src/server/scripts/Kalimdor/razorfen_downs/boss_amnennar_the_coldbringer.cpp => src/server/scripts/Kalimdor/RazorfenDowns/boss_amnennar_the_coldbringer.cpp rename : src/server/scripts/Kalimdor/razorfen_downs/instance_razorfen_downs.cpp => src/server/scripts/Kalimdor/RazorfenDowns/instance_razorfen_downs.cpp rename : src/server/scripts/Kalimdor/razorfen_downs/razorfen_downs.cpp => src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp rename : src/server/scripts/Kalimdor/razorfen_downs/razorfen_downs.h => src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.h rename : src/server/scripts/Kalimdor/razorfen_kraul/instance_razorfen_kraul.cpp => src/server/scripts/Kalimdor/RazorfenKraul/instance_razorfen_kraul.cpp rename : src/server/scripts/Kalimdor/razorfen_kraul/razorfen_kraul.cpp => src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp rename : src/server/scripts/Kalimdor/razorfen_kraul/razorfen_kraul.h => src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.h rename : src/server/scripts/Kalimdor/ruins_of_ahnqiraj/boss_ayamiss.cpp => src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp rename : src/server/scripts/Kalimdor/ruins_of_ahnqiraj/boss_buru.cpp => src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp rename : src/server/scripts/Kalimdor/ruins_of_ahnqiraj/boss_kurinnaxx.cpp => src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_kurinnaxx.cpp rename : src/server/scripts/Kalimdor/ruins_of_ahnqiraj/boss_moam.cpp => src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp rename : src/server/scripts/Kalimdor/ruins_of_ahnqiraj/boss_ossirian.cpp => src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp rename : src/server/scripts/Kalimdor/ruins_of_ahnqiraj/boss_rajaxx.cpp => src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp rename : src/server/scripts/Kalimdor/ruins_of_ahnqiraj/instance_ruins_of_ahnqiraj.cpp => src/server/scripts/Kalimdor/RuinsOfAhnQiraj/instance_ruins_of_ahnqiraj.cpp rename : src/server/scripts/Kalimdor/ruins_of_ahnqiraj/ruins_of_ahnqiraj.h => src/server/scripts/Kalimdor/RuinsOfAhnQiraj/ruins_of_ahnqiraj.h rename : src/server/scripts/Kalimdor/temple_of_ahnqiraj/boss_bug_trio.cpp => src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp rename : src/server/scripts/Kalimdor/temple_of_ahnqiraj/boss_cthun.cpp => src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp rename : src/server/scripts/Kalimdor/temple_of_ahnqiraj/boss_fankriss.cpp => src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp rename : src/server/scripts/Kalimdor/temple_of_ahnqiraj/boss_huhuran.cpp => src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_huhuran.cpp rename : src/server/scripts/Kalimdor/temple_of_ahnqiraj/boss_ouro.cpp => src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp rename : src/server/scripts/Kalimdor/temple_of_ahnqiraj/boss_sartura.cpp => src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_sartura.cpp rename : src/server/scripts/Kalimdor/temple_of_ahnqiraj/boss_skeram.cpp => src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp rename : src/server/scripts/Kalimdor/temple_of_ahnqiraj/boss_twinemperors.cpp => src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp rename : src/server/scripts/Kalimdor/temple_of_ahnqiraj/boss_viscidus.cpp => src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp rename : src/server/scripts/Kalimdor/temple_of_ahnqiraj/instance_temple_of_ahnqiraj.cpp => src/server/scripts/Kalimdor/TempleOfAhnQiraj/instance_temple_of_ahnqiraj.cpp rename : src/server/scripts/Kalimdor/temple_of_ahnqiraj/mob_anubisath_sentinel.cpp => src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp rename : src/server/scripts/Kalimdor/temple_of_ahnqiraj/temple_of_ahnqiraj.h => src/server/scripts/Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.h rename : src/server/scripts/Kalimdor/wailing_caverns/instance_wailing_caverns.cpp => src/server/scripts/Kalimdor/WailingCaverns/instance_wailing_caverns.cpp rename : src/server/scripts/Kalimdor/wailing_caverns/wailing_caverns.cpp => src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp rename : src/server/scripts/Kalimdor/wailing_caverns/wailing_caverns.h => src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.h rename : src/server/scripts/Kalimdor/zulfarrak/instance_zulfarrak.cpp => src/server/scripts/Kalimdor/ZulFarrak/instance_zulfarrak.cpp rename : src/server/scripts/Kalimdor/zulfarrak/zulfarrak.cpp => src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp rename : src/server/scripts/Northrend/azjol_nerub/ahnkahet/ahnkahet.h => src/server/scripts/Northrend/AzjolNerub/ahnkahet/ahnkahet.h rename : src/server/scripts/Northrend/azjol_nerub/ahnkahet/boss_amanitar.cpp => src/server/scripts/Northrend/AzjolNerub/ahnkahet/boss_amanitar.cpp rename : src/server/scripts/Northrend/azjol_nerub/ahnkahet/boss_elder_nadox.cpp => src/server/scripts/Northrend/AzjolNerub/ahnkahet/boss_elder_nadox.cpp rename : src/server/scripts/Northrend/azjol_nerub/ahnkahet/boss_herald_volazj.cpp => src/server/scripts/Northrend/AzjolNerub/ahnkahet/boss_herald_volazj.cpp rename : src/server/scripts/Northrend/azjol_nerub/ahnkahet/boss_jedoga_shadowseeker.cpp => src/server/scripts/Northrend/AzjolNerub/ahnkahet/boss_jedoga_shadowseeker.cpp rename : src/server/scripts/Northrend/azjol_nerub/ahnkahet/boss_prince_taldaram.cpp => src/server/scripts/Northrend/AzjolNerub/ahnkahet/boss_prince_taldaram.cpp rename : src/server/scripts/Northrend/azjol_nerub/ahnkahet/instance_ahnkahet.cpp => src/server/scripts/Northrend/AzjolNerub/ahnkahet/instance_ahnkahet.cpp rename : src/server/scripts/Northrend/azjol_nerub/azjol_nerub/azjol_nerub.h => src/server/scripts/Northrend/AzjolNerub/azjol_nerub/azjol_nerub.h rename : src/server/scripts/Northrend/azjol_nerub/azjol_nerub/boss_anubarak.cpp => src/server/scripts/Northrend/AzjolNerub/azjol_nerub/boss_anubarak.cpp rename : src/server/scripts/Northrend/azjol_nerub/azjol_nerub/boss_hadronox.cpp => src/server/scripts/Northrend/AzjolNerub/azjol_nerub/boss_hadronox.cpp rename : src/server/scripts/Northrend/azjol_nerub/azjol_nerub/boss_krikthir_the_gatewatcher.cpp => src/server/scripts/Northrend/AzjolNerub/azjol_nerub/boss_krikthir_the_gatewatcher.cpp rename : src/server/scripts/Northrend/azjol_nerub/azjol_nerub/instance_azjol_nerub.cpp => src/server/scripts/Northrend/AzjolNerub/azjol_nerub/instance_azjol_nerub.cpp rename : src/server/scripts/Northrend/crusaders_coliseum/trial_of_the_champion/boss_argent_challenge.cpp => src/server/scripts/Northrend/CrusadersColiseum/trial_of_the_champion/boss_argent_challenge.cpp rename : src/server/scripts/Northrend/crusaders_coliseum/trial_of_the_champion/boss_black_knight.cpp => src/server/scripts/Northrend/CrusadersColiseum/trial_of_the_champion/boss_black_knight.cpp rename : src/server/scripts/Northrend/crusaders_coliseum/trial_of_the_champion/boss_grand_champions.cpp => src/server/scripts/Northrend/CrusadersColiseum/trial_of_the_champion/boss_grand_champions.cpp rename : src/server/scripts/Northrend/crusaders_coliseum/trial_of_the_champion/instance_trial_of_the_champion.cpp => src/server/scripts/Northrend/CrusadersColiseum/trial_of_the_champion/instance_trial_of_the_champion.cpp rename : src/server/scripts/Northrend/crusaders_coliseum/trial_of_the_champion/trial_of_the_champion.cpp => src/server/scripts/Northrend/CrusadersColiseum/trial_of_the_champion/trial_of_the_champion.cpp rename : src/server/scripts/Northrend/crusaders_coliseum/trial_of_the_champion/trial_of_the_champion.h => src/server/scripts/Northrend/CrusadersColiseum/trial_of_the_champion/trial_of_the_champion.h rename : src/server/scripts/Northrend/draktharon_keep/boss_dred.cpp => src/server/scripts/Northrend/DraktharonKeep/boss_dred.cpp rename : src/server/scripts/Northrend/draktharon_keep/boss_novos.cpp => src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp rename : src/server/scripts/Northrend/draktharon_keep/boss_tharon_ja.cpp => src/server/scripts/Northrend/DraktharonKeep/boss_tharon_ja.cpp rename : src/server/scripts/Northrend/draktharon_keep/boss_trollgore.cpp => src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp rename : src/server/scripts/Northrend/draktharon_keep/drak_tharon_keep.h => src/server/scripts/Northrend/DraktharonKeep/drak_tharon_keep.h rename : src/server/scripts/Northrend/draktharon_keep/instance_drak_tharon_keep.cpp => src/server/scripts/Northrend/DraktharonKeep/instance_drak_tharon_keep.cpp rename : src/server/scripts/Northrend/frozen_halls/forge_of_souls/boss_bronjahm.cpp => src/server/scripts/Northrend/FrozenHalls/forge_of_souls/boss_bronjahm.cpp rename : src/server/scripts/Northrend/frozen_halls/forge_of_souls/boss_devourer_of_souls.cpp => src/server/scripts/Northrend/FrozenHalls/forge_of_souls/boss_devourer_of_souls.cpp rename : src/server/scripts/Northrend/frozen_halls/forge_of_souls/forge_of_souls.cpp => src/server/scripts/Northrend/FrozenHalls/forge_of_souls/forge_of_souls.cpp rename : src/server/scripts/Northrend/frozen_halls/forge_of_souls/forge_of_souls.h => src/server/scripts/Northrend/FrozenHalls/forge_of_souls/forge_of_souls.h rename : src/server/scripts/Northrend/frozen_halls/forge_of_souls/instance_forge_of_souls.cpp => src/server/scripts/Northrend/FrozenHalls/forge_of_souls/instance_forge_of_souls.cpp rename : src/server/scripts/Northrend/frozen_halls/halls_of_reflection/boss_falric.cpp => src/server/scripts/Northrend/FrozenHalls/halls_of_reflection/boss_falric.cpp rename : src/server/scripts/Northrend/frozen_halls/halls_of_reflection/boss_marwyn.cpp => src/server/scripts/Northrend/FrozenHalls/halls_of_reflection/boss_marwyn.cpp rename : src/server/scripts/Northrend/frozen_halls/halls_of_reflection/halls_of_reflection.cpp => src/server/scripts/Northrend/FrozenHalls/halls_of_reflection/halls_of_reflection.cpp rename : src/server/scripts/Northrend/frozen_halls/halls_of_reflection/halls_of_reflection.h => src/server/scripts/Northrend/FrozenHalls/halls_of_reflection/halls_of_reflection.h rename : src/server/scripts/Northrend/frozen_halls/halls_of_reflection/instance_halls_of_reflection.cpp => src/server/scripts/Northrend/FrozenHalls/halls_of_reflection/instance_halls_of_reflection.cpp rename : src/server/scripts/Northrend/frozen_halls/pit_of_saron/boss_forgemaster_garfrost.cpp => src/server/scripts/Northrend/FrozenHalls/pit_of_saron/boss_forgemaster_garfrost.cpp rename : src/server/scripts/Northrend/frozen_halls/pit_of_saron/boss_krickandick.cpp => src/server/scripts/Northrend/FrozenHalls/pit_of_saron/boss_krickandick.cpp rename : src/server/scripts/Northrend/frozen_halls/pit_of_saron/boss_scourgelord_tyrannus.cpp => src/server/scripts/Northrend/FrozenHalls/pit_of_saron/boss_scourgelord_tyrannus.cpp rename : src/server/scripts/Northrend/frozen_halls/pit_of_saron/instance_pit_of_saron.cpp => src/server/scripts/Northrend/FrozenHalls/pit_of_saron/instance_pit_of_saron.cpp rename : src/server/scripts/Northrend/frozen_halls/pit_of_saron/pit_of_saron.cpp => src/server/scripts/Northrend/FrozenHalls/pit_of_saron/pit_of_saron.cpp rename : src/server/scripts/Northrend/frozen_halls/pit_of_saron/pit_of_saron.h => src/server/scripts/Northrend/FrozenHalls/pit_of_saron/pit_of_saron.h rename : src/server/scripts/Northrend/gundrak/boss_drakkari_colossus.cpp => src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp rename : src/server/scripts/Northrend/gundrak/boss_eck.cpp => src/server/scripts/Northrend/Gundrak/boss_eck.cpp rename : src/server/scripts/Northrend/gundrak/boss_gal_darah.cpp => src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp rename : src/server/scripts/Northrend/gundrak/boss_moorabi.cpp => src/server/scripts/Northrend/Gundrak/boss_moorabi.cpp rename : src/server/scripts/Northrend/gundrak/boss_slad_ran.cpp => src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp rename : src/server/scripts/Northrend/gundrak/gundrak.h => src/server/scripts/Northrend/Gundrak/gundrak.h rename : src/server/scripts/Northrend/gundrak/instance_gundrak.cpp => src/server/scripts/Northrend/Gundrak/instance_gundrak.cpp rename : src/server/scripts/Northrend/naxxramas/boss_anubrekhan.cpp => src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp rename : src/server/scripts/Northrend/naxxramas/boss_faerlina.cpp => src/server/scripts/Northrend/Naxxramas/boss_faerlina.cpp rename : src/server/scripts/Northrend/naxxramas/boss_four_horsemen.cpp => src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp rename : src/server/scripts/Northrend/naxxramas/boss_gluth.cpp => src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp rename : src/server/scripts/Northrend/naxxramas/boss_gothik.cpp => src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp rename : src/server/scripts/Northrend/naxxramas/boss_grobbulus.cpp => src/server/scripts/Northrend/Naxxramas/boss_grobbulus.cpp rename : src/server/scripts/Northrend/naxxramas/boss_heigan.cpp => src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp rename : src/server/scripts/Northrend/naxxramas/boss_highlord_mograine.cpp => src/server/scripts/Northrend/Naxxramas/boss_highlord_mograine.cpp rename : src/server/scripts/Northrend/naxxramas/boss_kelthuzad.cpp => src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp rename : src/server/scripts/Northrend/naxxramas/boss_loatheb.cpp => src/server/scripts/Northrend/Naxxramas/boss_loatheb.cpp rename : src/server/scripts/Northrend/naxxramas/boss_maexxna.cpp => src/server/scripts/Northrend/Naxxramas/boss_maexxna.cpp rename : src/server/scripts/Northrend/naxxramas/boss_noth.cpp => src/server/scripts/Northrend/Naxxramas/boss_noth.cpp rename : src/server/scripts/Northrend/naxxramas/boss_patchwerk.cpp => src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp rename : src/server/scripts/Northrend/naxxramas/boss_razuvious.cpp => src/server/scripts/Northrend/Naxxramas/boss_razuvious.cpp rename : src/server/scripts/Northrend/naxxramas/boss_sapphiron.cpp => src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp rename : src/server/scripts/Northrend/naxxramas/boss_thaddius.cpp => src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp rename : src/server/scripts/Northrend/naxxramas/instance_naxxramas.cpp => src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp rename : src/server/scripts/Northrend/naxxramas/naxxramas.h => src/server/scripts/Northrend/Naxxramas/naxxramas.h rename : src/server/scripts/Northrend/obsidian_sanctum/boss_sartharion.cpp => src/server/scripts/Northrend/ObsidianSanctum/boss_sartharion.cpp rename : src/server/scripts/Northrend/obsidian_sanctum/instance_obsidian_sanctum.cpp => src/server/scripts/Northrend/ObsidianSanctum/instance_obsidian_sanctum.cpp rename : src/server/scripts/Northrend/obsidian_sanctum/obsidian_sanctum.h => src/server/scripts/Northrend/ObsidianSanctum/obsidian_sanctum.h rename : src/server/scripts/Northrend/nexus/eye_of_eternity/boss_malygos.cpp => src/server/scripts/Northrend/TheNexus/eye_of_eternity/boss_malygos.cpp rename : src/server/scripts/Northrend/nexus/eye_of_eternity/eye_of_eternity.h => src/server/scripts/Northrend/TheNexus/eye_of_eternity/eye_of_eternity.h rename : src/server/scripts/Northrend/nexus/eye_of_eternity/instance_eye_of_eternity.cpp => src/server/scripts/Northrend/TheNexus/eye_of_eternity/instance_eye_of_eternity.cpp rename : src/server/scripts/Northrend/nexus/nexus/boss_anomalus.cpp => src/server/scripts/Northrend/TheNexus/nexus/boss_anomalus.cpp rename : src/server/scripts/Northrend/nexus/nexus/boss_keristrasza.cpp => src/server/scripts/Northrend/TheNexus/nexus/boss_keristrasza.cpp rename : src/server/scripts/Northrend/nexus/nexus/boss_magus_telestra.cpp => src/server/scripts/Northrend/TheNexus/nexus/boss_magus_telestra.cpp rename : src/server/scripts/Northrend/nexus/nexus/boss_ormorok.cpp => src/server/scripts/Northrend/TheNexus/nexus/boss_ormorok.cpp rename : src/server/scripts/Northrend/nexus/nexus/commander_kolurg.cpp => src/server/scripts/Northrend/TheNexus/nexus/commander_kolurg.cpp rename : src/server/scripts/Northrend/nexus/nexus/commander_stoutbeard.cpp => src/server/scripts/Northrend/TheNexus/nexus/commander_stoutbeard.cpp rename : src/server/scripts/Northrend/nexus/nexus/instance_nexus.cpp => src/server/scripts/Northrend/TheNexus/nexus/instance_nexus.cpp rename : src/server/scripts/Northrend/nexus/nexus/nexus.h => src/server/scripts/Northrend/TheNexus/nexus/nexus.h rename : src/server/scripts/Northrend/nexus/oculus/boss_drakos.cpp => src/server/scripts/Northrend/TheNexus/oculus/boss_drakos.cpp rename : src/server/scripts/Northrend/nexus/oculus/boss_eregos.cpp => src/server/scripts/Northrend/TheNexus/oculus/boss_eregos.cpp rename : src/server/scripts/Northrend/nexus/oculus/boss_urom.cpp => src/server/scripts/Northrend/TheNexus/oculus/boss_urom.cpp rename : src/server/scripts/Northrend/nexus/oculus/boss_varos.cpp => src/server/scripts/Northrend/TheNexus/oculus/boss_varos.cpp rename : src/server/scripts/Northrend/nexus/oculus/instance_oculus.cpp => src/server/scripts/Northrend/TheNexus/oculus/instance_oculus.cpp rename : src/server/scripts/Northrend/nexus/oculus/oculus.cpp => src/server/scripts/Northrend/TheNexus/oculus/oculus.cpp rename : src/server/scripts/Northrend/nexus/oculus/oculus.h => src/server/scripts/Northrend/TheNexus/oculus/oculus.h rename : src/server/scripts/Northrend/ulduar/halls_of_lightning/boss_bjarngrim.cpp => src/server/scripts/Northrend/Ulduar/halls_of_lightning/boss_bjarngrim.cpp rename : src/server/scripts/Northrend/ulduar/halls_of_lightning/boss_ionar.cpp => src/server/scripts/Northrend/Ulduar/halls_of_lightning/boss_ionar.cpp rename : src/server/scripts/Northrend/ulduar/halls_of_lightning/boss_loken.cpp => src/server/scripts/Northrend/Ulduar/halls_of_lightning/boss_loken.cpp rename : src/server/scripts/Northrend/ulduar/halls_of_lightning/boss_volkhan.cpp => src/server/scripts/Northrend/Ulduar/halls_of_lightning/boss_volkhan.cpp rename : src/server/scripts/Northrend/ulduar/halls_of_lightning/halls_of_lightning.h => src/server/scripts/Northrend/Ulduar/halls_of_lightning/halls_of_lightning.h rename : src/server/scripts/Northrend/ulduar/halls_of_lightning/instance_halls_of_lightning.cpp => src/server/scripts/Northrend/Ulduar/halls_of_lightning/instance_halls_of_lightning.cpp rename : src/server/scripts/Northrend/ulduar/halls_of_stone/boss_krystallus.cpp => src/server/scripts/Northrend/Ulduar/halls_of_stone/boss_krystallus.cpp rename : src/server/scripts/Northrend/ulduar/halls_of_stone/boss_maiden_of_grief.cpp => src/server/scripts/Northrend/Ulduar/halls_of_stone/boss_maiden_of_grief.cpp rename : src/server/scripts/Northrend/ulduar/halls_of_stone/boss_sjonnir.cpp => src/server/scripts/Northrend/Ulduar/halls_of_stone/boss_sjonnir.cpp rename : src/server/scripts/Northrend/ulduar/halls_of_stone/halls_of_stone.cpp => src/server/scripts/Northrend/Ulduar/halls_of_stone/halls_of_stone.cpp rename : src/server/scripts/Northrend/ulduar/halls_of_stone/halls_of_stone.h => src/server/scripts/Northrend/Ulduar/halls_of_stone/halls_of_stone.h rename : src/server/scripts/Northrend/ulduar/halls_of_stone/instance_halls_of_stone.cpp => src/server/scripts/Northrend/Ulduar/halls_of_stone/instance_halls_of_stone.cpp rename : src/server/scripts/Northrend/ulduar/ulduar/boss_algalon.cpp => src/server/scripts/Northrend/Ulduar/ulduar/boss_algalon.cpp rename : src/server/scripts/Northrend/ulduar/ulduar/boss_assembly_of_iron.cpp => src/server/scripts/Northrend/Ulduar/ulduar/boss_assembly_of_iron.cpp rename : src/server/scripts/Northrend/ulduar/ulduar/boss_auriaya.cpp => src/server/scripts/Northrend/Ulduar/ulduar/boss_auriaya.cpp rename : src/server/scripts/Northrend/ulduar/ulduar/boss_flame_leviathan.cpp => src/server/scripts/Northrend/Ulduar/ulduar/boss_flame_leviathan.cpp rename : src/server/scripts/Northrend/ulduar/ulduar/boss_freya.cpp => src/server/scripts/Northrend/Ulduar/ulduar/boss_freya.cpp rename : src/server/scripts/Northrend/ulduar/ulduar/boss_general_vezax.cpp => src/server/scripts/Northrend/Ulduar/ulduar/boss_general_vezax.cpp rename : src/server/scripts/Northrend/ulduar/ulduar/boss_hodir.cpp => src/server/scripts/Northrend/Ulduar/ulduar/boss_hodir.cpp rename : src/server/scripts/Northrend/ulduar/ulduar/boss_ignis.cpp => src/server/scripts/Northrend/Ulduar/ulduar/boss_ignis.cpp rename : src/server/scripts/Northrend/ulduar/ulduar/boss_kologarn.cpp => src/server/scripts/Northrend/Ulduar/ulduar/boss_kologarn.cpp rename : src/server/scripts/Northrend/ulduar/ulduar/boss_mimiron.cpp => src/server/scripts/Northrend/Ulduar/ulduar/boss_mimiron.cpp rename : src/server/scripts/Northrend/ulduar/ulduar/boss_razorscale.cpp => src/server/scripts/Northrend/Ulduar/ulduar/boss_razorscale.cpp rename : src/server/scripts/Northrend/ulduar/ulduar/boss_thorim.cpp => src/server/scripts/Northrend/Ulduar/ulduar/boss_thorim.cpp rename : src/server/scripts/Northrend/ulduar/ulduar/boss_xt002.cpp => src/server/scripts/Northrend/Ulduar/ulduar/boss_xt002.cpp rename : src/server/scripts/Northrend/ulduar/ulduar/boss_yoggsaron.cpp => src/server/scripts/Northrend/Ulduar/ulduar/boss_yoggsaron.cpp rename : src/server/scripts/Northrend/ulduar/ulduar/instance_ulduar.cpp => src/server/scripts/Northrend/Ulduar/ulduar/instance_ulduar.cpp rename : src/server/scripts/Northrend/ulduar/ulduar/ulduar.h => src/server/scripts/Northrend/Ulduar/ulduar/ulduar.h rename : src/server/scripts/Northrend/ulduar/ulduar/ulduar_teleporter.cpp => src/server/scripts/Northrend/Ulduar/ulduar/ulduar_teleporter.cpp rename : src/server/scripts/Northrend/utgarde_keep/utgarde_keep/boss_ingvar_the_plunderer.cpp => src/server/scripts/Northrend/UtgardeKeep/utgarde_keep/boss_ingvar_the_plunderer.cpp rename : src/server/scripts/Northrend/utgarde_keep/utgarde_keep/boss_keleseth.cpp => src/server/scripts/Northrend/UtgardeKeep/utgarde_keep/boss_keleseth.cpp rename : src/server/scripts/Northrend/utgarde_keep/utgarde_keep/boss_skarvald_dalronn.cpp => src/server/scripts/Northrend/UtgardeKeep/utgarde_keep/boss_skarvald_dalronn.cpp rename : src/server/scripts/Northrend/utgarde_keep/utgarde_keep/instance_utgarde_keep.cpp => src/server/scripts/Northrend/UtgardeKeep/utgarde_keep/instance_utgarde_keep.cpp rename : src/server/scripts/Northrend/utgarde_keep/utgarde_keep/utgarde_keep.cpp => src/server/scripts/Northrend/UtgardeKeep/utgarde_keep/utgarde_keep.cpp rename : src/server/scripts/Northrend/utgarde_keep/utgarde_keep/utgarde_keep.h => src/server/scripts/Northrend/UtgardeKeep/utgarde_keep/utgarde_keep.h rename : src/server/scripts/Northrend/utgarde_keep/utgarde_pinnacle/boss_palehoof.cpp => src/server/scripts/Northrend/UtgardeKeep/utgarde_pinnacle/boss_palehoof.cpp rename : src/server/scripts/Northrend/utgarde_keep/utgarde_pinnacle/boss_skadi.cpp => src/server/scripts/Northrend/UtgardeKeep/utgarde_pinnacle/boss_skadi.cpp rename : src/server/scripts/Northrend/utgarde_keep/utgarde_pinnacle/boss_svala.cpp => src/server/scripts/Northrend/UtgardeKeep/utgarde_pinnacle/boss_svala.cpp rename : src/server/scripts/Northrend/utgarde_keep/utgarde_pinnacle/boss_ymiron.cpp => src/server/scripts/Northrend/UtgardeKeep/utgarde_pinnacle/boss_ymiron.cpp rename : src/server/scripts/Northrend/utgarde_keep/utgarde_pinnacle/instance_pinnacle.cpp => src/server/scripts/Northrend/UtgardeKeep/utgarde_pinnacle/instance_pinnacle.cpp rename : src/server/scripts/Northrend/utgarde_keep/utgarde_pinnacle/utgarde_pinnacle.h => src/server/scripts/Northrend/UtgardeKeep/utgarde_pinnacle/utgarde_pinnacle.h rename : src/server/scripts/Northrend/vault_of_archavon/boss_archavon.cpp => src/server/scripts/Northrend/VaultOfArchavon/boss_archavon.cpp rename : src/server/scripts/Northrend/vault_of_archavon/boss_emalon.cpp => src/server/scripts/Northrend/VaultOfArchavon/boss_emalon.cpp rename : src/server/scripts/Northrend/vault_of_archavon/boss_koralon.cpp => src/server/scripts/Northrend/VaultOfArchavon/boss_koralon.cpp rename : src/server/scripts/Northrend/vault_of_archavon/boss_toravon.cpp => src/server/scripts/Northrend/VaultOfArchavon/boss_toravon.cpp rename : src/server/scripts/Northrend/vault_of_archavon/instance_vault_of_archavon.cpp => src/server/scripts/Northrend/VaultOfArchavon/instance_vault_of_archavon.cpp rename : src/server/scripts/Northrend/vault_of_archavon/vault_of_archavon.h => src/server/scripts/Northrend/VaultOfArchavon/vault_of_archavon.h rename : src/server/scripts/Northrend/violet_hold/boss_cyanigosa.cpp => src/server/scripts/Northrend/VioletHold/boss_cyanigosa.cpp rename : src/server/scripts/Northrend/violet_hold/boss_erekem.cpp => src/server/scripts/Northrend/VioletHold/boss_erekem.cpp rename : src/server/scripts/Northrend/violet_hold/boss_ichoron.cpp => src/server/scripts/Northrend/VioletHold/boss_ichoron.cpp rename : src/server/scripts/Northrend/violet_hold/boss_lavanthor.cpp => src/server/scripts/Northrend/VioletHold/boss_lavanthor.cpp rename : src/server/scripts/Northrend/violet_hold/boss_moragg.cpp => src/server/scripts/Northrend/VioletHold/boss_moragg.cpp rename : src/server/scripts/Northrend/violet_hold/boss_xevozz.cpp => src/server/scripts/Northrend/VioletHold/boss_xevozz.cpp rename : src/server/scripts/Northrend/violet_hold/boss_zuramat.cpp => src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp rename : src/server/scripts/Northrend/violet_hold/instance_violet_hold.cpp => src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp rename : src/server/scripts/Northrend/violet_hold/violet_hold.cpp => src/server/scripts/Northrend/VioletHold/violet_hold.cpp rename : src/server/scripts/Northrend/violet_hold/violet_hold.h => src/server/scripts/Northrend/VioletHold/violet_hold.h rename : src/server/scripts/Outland/auchindoun/auchenai_crypts/boss_exarch_maladaar.cpp => src/server/scripts/Outland/Auchindoun/auchenai_crypts/boss_exarch_maladaar.cpp rename : src/server/scripts/Outland/auchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp => src/server/scripts/Outland/Auchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp rename : src/server/scripts/Outland/auchindoun/mana_tombs/boss_nexusprince_shaffar.cpp => src/server/scripts/Outland/Auchindoun/mana_tombs/boss_nexusprince_shaffar.cpp rename : src/server/scripts/Outland/auchindoun/mana_tombs/boss_pandemonius.cpp => src/server/scripts/Outland/Auchindoun/mana_tombs/boss_pandemonius.cpp rename : src/server/scripts/Outland/auchindoun/sethekk_halls/boss_darkweaver_syth.cpp => src/server/scripts/Outland/Auchindoun/sethekk_halls/boss_darkweaver_syth.cpp rename : src/server/scripts/Outland/auchindoun/sethekk_halls/boss_tailonking_ikiss.cpp => src/server/scripts/Outland/Auchindoun/sethekk_halls/boss_tailonking_ikiss.cpp rename : src/server/scripts/Outland/auchindoun/sethekk_halls/instance_sethekk_halls.cpp => src/server/scripts/Outland/Auchindoun/sethekk_halls/instance_sethekk_halls.cpp rename : src/server/scripts/Outland/auchindoun/sethekk_halls/sethekk_halls.h => src/server/scripts/Outland/Auchindoun/sethekk_halls/sethekk_halls.h rename : src/server/scripts/Outland/auchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp => src/server/scripts/Outland/Auchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp rename : src/server/scripts/Outland/auchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp => src/server/scripts/Outland/Auchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp rename : src/server/scripts/Outland/auchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp => src/server/scripts/Outland/Auchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp rename : src/server/scripts/Outland/auchindoun/shadow_labyrinth/boss_murmur.cpp => src/server/scripts/Outland/Auchindoun/shadow_labyrinth/boss_murmur.cpp rename : src/server/scripts/Outland/auchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp => src/server/scripts/Outland/Auchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp rename : src/server/scripts/Outland/auchindoun/shadow_labyrinth/shadow_labyrinth.h => src/server/scripts/Outland/Auchindoun/shadow_labyrinth/shadow_labyrinth.h rename : src/server/scripts/Outland/black_temple/black_temple.cpp => src/server/scripts/Outland/BlackTemple/black_temple.cpp rename : src/server/scripts/Outland/black_temple/black_temple.h => src/server/scripts/Outland/BlackTemple/black_temple.h rename : src/server/scripts/Outland/black_temple/boss_bloodboil.cpp => src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp rename : src/server/scripts/Outland/black_temple/boss_illidan.cpp => src/server/scripts/Outland/BlackTemple/boss_illidan.cpp rename : src/server/scripts/Outland/black_temple/boss_mother_shahraz.cpp => src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp rename : src/server/scripts/Outland/black_temple/boss_reliquary_of_souls.cpp => src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp rename : src/server/scripts/Outland/black_temple/boss_shade_of_akama.cpp => src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp rename : src/server/scripts/Outland/black_temple/boss_supremus.cpp => src/server/scripts/Outland/BlackTemple/boss_supremus.cpp rename : src/server/scripts/Outland/black_temple/boss_teron_gorefiend.cpp => src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp rename : src/server/scripts/Outland/black_temple/boss_warlord_najentus.cpp => src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp rename : src/server/scripts/Outland/black_temple/illidari_council.cpp => src/server/scripts/Outland/BlackTemple/illidari_council.cpp rename : src/server/scripts/Outland/black_temple/instance_black_temple.cpp => src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp rename : src/server/scripts/Outland/coilfang_resevoir/serpent_shrine/boss_fathomlord_karathress.cpp => src/server/scripts/Outland/CoilfangReservoir/serpent_shrine/boss_fathomlord_karathress.cpp rename : src/server/scripts/Outland/coilfang_resevoir/serpent_shrine/boss_hydross_the_unstable.cpp => src/server/scripts/Outland/CoilfangReservoir/serpent_shrine/boss_hydross_the_unstable.cpp rename : src/server/scripts/Outland/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp => src/server/scripts/Outland/CoilfangReservoir/serpent_shrine/boss_lady_vashj.cpp rename : src/server/scripts/Outland/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp => src/server/scripts/Outland/CoilfangReservoir/serpent_shrine/boss_leotheras_the_blind.cpp rename : src/server/scripts/Outland/coilfang_resevoir/serpent_shrine/boss_lurker_below.cpp => src/server/scripts/Outland/CoilfangReservoir/serpent_shrine/boss_lurker_below.cpp rename : src/server/scripts/Outland/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp => src/server/scripts/Outland/CoilfangReservoir/serpent_shrine/boss_morogrim_tidewalker.cpp rename : src/server/scripts/Outland/coilfang_resevoir/serpent_shrine/instance_serpent_shrine.cpp => src/server/scripts/Outland/CoilfangReservoir/serpent_shrine/instance_serpent_shrine.cpp rename : src/server/scripts/Outland/coilfang_resevoir/serpent_shrine/serpent_shrine.h => src/server/scripts/Outland/CoilfangReservoir/serpent_shrine/serpent_shrine.h rename : src/server/scripts/Outland/coilfang_resevoir/steam_vault/boss_hydromancer_thespia.cpp => src/server/scripts/Outland/CoilfangReservoir/steam_vault/boss_hydromancer_thespia.cpp rename : src/server/scripts/Outland/coilfang_resevoir/steam_vault/boss_mekgineer_steamrigger.cpp => src/server/scripts/Outland/CoilfangReservoir/steam_vault/boss_mekgineer_steamrigger.cpp rename : src/server/scripts/Outland/coilfang_resevoir/steam_vault/boss_warlord_kalithresh.cpp => src/server/scripts/Outland/CoilfangReservoir/steam_vault/boss_warlord_kalithresh.cpp rename : src/server/scripts/Outland/coilfang_resevoir/steam_vault/instance_steam_vault.cpp => src/server/scripts/Outland/CoilfangReservoir/steam_vault/instance_steam_vault.cpp rename : src/server/scripts/Outland/coilfang_resevoir/steam_vault/steam_vault.h => src/server/scripts/Outland/CoilfangReservoir/steam_vault/steam_vault.h rename : src/server/scripts/Outland/coilfang_resevoir/underbog/boss_hungarfen.cpp => src/server/scripts/Outland/CoilfangReservoir/underbog/boss_hungarfen.cpp rename : src/server/scripts/Outland/coilfang_resevoir/underbog/boss_the_black_stalker.cpp => src/server/scripts/Outland/CoilfangReservoir/underbog/boss_the_black_stalker.cpp rename : src/server/scripts/Outland/gruuls_lair/boss_gruul.cpp => src/server/scripts/Outland/GruulsLair/boss_gruul.cpp rename : src/server/scripts/Outland/gruuls_lair/boss_high_king_maulgar.cpp => src/server/scripts/Outland/GruulsLair/boss_high_king_maulgar.cpp rename : src/server/scripts/Outland/gruuls_lair/gruuls_lair.h => src/server/scripts/Outland/GruulsLair/gruuls_lair.h rename : src/server/scripts/Outland/gruuls_lair/instance_gruuls_lair.cpp => src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp rename : src/server/scripts/Outland/hellfire_citadel/blood_furnace/blood_furnace.h => src/server/scripts/Outland/HellfireCitadel/blood_furnace/blood_furnace.h rename : src/server/scripts/Outland/hellfire_citadel/blood_furnace/boss_broggok.cpp => src/server/scripts/Outland/HellfireCitadel/blood_furnace/boss_broggok.cpp rename : src/server/scripts/Outland/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp => src/server/scripts/Outland/HellfireCitadel/blood_furnace/boss_kelidan_the_breaker.cpp rename : src/server/scripts/Outland/hellfire_citadel/blood_furnace/boss_the_maker.cpp => src/server/scripts/Outland/HellfireCitadel/blood_furnace/boss_the_maker.cpp rename : src/server/scripts/Outland/hellfire_citadel/blood_furnace/instance_blood_furnace.cpp => src/server/scripts/Outland/HellfireCitadel/blood_furnace/instance_blood_furnace.cpp rename : src/server/scripts/Outland/hellfire_citadel/hellfire_ramparts/boss_omor_the_unscarred.cpp => src/server/scripts/Outland/HellfireCitadel/hellfire_ramparts/boss_omor_the_unscarred.cpp rename : src/server/scripts/Outland/hellfire_citadel/hellfire_ramparts/boss_vazruden_the_herald.cpp => src/server/scripts/Outland/HellfireCitadel/hellfire_ramparts/boss_vazruden_the_herald.cpp rename : src/server/scripts/Outland/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp => src/server/scripts/Outland/HellfireCitadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp rename : src/server/scripts/Outland/hellfire_citadel/hellfire_ramparts/hellfire_ramparts.h => src/server/scripts/Outland/HellfireCitadel/hellfire_ramparts/hellfire_ramparts.h rename : src/server/scripts/Outland/hellfire_citadel/hellfire_ramparts/instance_hellfire_ramparts.cpp => src/server/scripts/Outland/HellfireCitadel/hellfire_ramparts/instance_hellfire_ramparts.cpp rename : src/server/scripts/Outland/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp => src/server/scripts/Outland/HellfireCitadel/magtheridons_lair/boss_magtheridon.cpp rename : src/server/scripts/Outland/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp => src/server/scripts/Outland/HellfireCitadel/magtheridons_lair/instance_magtheridons_lair.cpp rename : src/server/scripts/Outland/hellfire_citadel/magtheridons_lair/magtheridons_lair.h => src/server/scripts/Outland/HellfireCitadel/magtheridons_lair/magtheridons_lair.h rename : src/server/scripts/Outland/hellfire_citadel/shattered_halls/boss_nethekurse.cpp => src/server/scripts/Outland/HellfireCitadel/shattered_halls/boss_nethekurse.cpp rename : src/server/scripts/Outland/hellfire_citadel/shattered_halls/boss_warbringer_omrogg.cpp => src/server/scripts/Outland/HellfireCitadel/shattered_halls/boss_warbringer_omrogg.cpp rename : src/server/scripts/Outland/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp => src/server/scripts/Outland/HellfireCitadel/shattered_halls/boss_warchief_kargath_bladefist.cpp rename : src/server/scripts/Outland/hellfire_citadel/shattered_halls/instance_shattered_halls.cpp => src/server/scripts/Outland/HellfireCitadel/shattered_halls/instance_shattered_halls.cpp rename : src/server/scripts/Outland/hellfire_citadel/shattered_halls/shattered_halls.h => src/server/scripts/Outland/HellfireCitadel/shattered_halls/shattered_halls.h rename : src/server/scripts/Outland/tempest_keep/arcatraz/arcatraz.cpp => src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp rename : src/server/scripts/Outland/tempest_keep/arcatraz/arcatraz.h => src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.h rename : src/server/scripts/Outland/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp => src/server/scripts/Outland/TempestKeep/arcatraz/boss_harbinger_skyriss.cpp rename : src/server/scripts/Outland/tempest_keep/arcatraz/instance_arcatraz.cpp => src/server/scripts/Outland/TempestKeep/arcatraz/instance_arcatraz.cpp rename : src/server/scripts/Outland/tempest_keep/botanica/boss_high_botanist_freywinn.cpp => src/server/scripts/Outland/TempestKeep/botanica/boss_high_botanist_freywinn.cpp rename : src/server/scripts/Outland/tempest_keep/botanica/boss_laj.cpp => src/server/scripts/Outland/TempestKeep/botanica/boss_laj.cpp rename : src/server/scripts/Outland/tempest_keep/botanica/boss_warp_splinter.cpp => src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp rename : src/server/scripts/Outland/tempest_keep/the_eye/boss_alar.cpp => src/server/scripts/Outland/TempestKeep/the_eye/boss_alar.cpp rename : src/server/scripts/Outland/tempest_keep/the_eye/boss_astromancer.cpp => src/server/scripts/Outland/TempestKeep/the_eye/boss_astromancer.cpp rename : src/server/scripts/Outland/tempest_keep/the_eye/boss_kaelthas.cpp => src/server/scripts/Outland/TempestKeep/the_eye/boss_kaelthas.cpp rename : src/server/scripts/Outland/tempest_keep/the_eye/boss_void_reaver.cpp => src/server/scripts/Outland/TempestKeep/the_eye/boss_void_reaver.cpp rename : src/server/scripts/Outland/tempest_keep/the_eye/instance_the_eye.cpp => src/server/scripts/Outland/TempestKeep/the_eye/instance_the_eye.cpp rename : src/server/scripts/Outland/tempest_keep/the_eye/the_eye.cpp => src/server/scripts/Outland/TempestKeep/the_eye/the_eye.cpp rename : src/server/scripts/Outland/tempest_keep/the_eye/the_eye.h => src/server/scripts/Outland/TempestKeep/the_eye/the_eye.h rename : src/server/scripts/Outland/tempest_keep/the_mechanar/boss_gatewatcher_gyrokill.cpp => src/server/scripts/Outland/TempestKeep/the_mechanar/boss_gatewatcher_gyrokill.cpp rename : src/server/scripts/Outland/tempest_keep/the_mechanar/boss_gatewatcher_ironhand.cpp => src/server/scripts/Outland/TempestKeep/the_mechanar/boss_gatewatcher_ironhand.cpp rename : src/server/scripts/Outland/tempest_keep/the_mechanar/boss_nethermancer_sepethrea.cpp => src/server/scripts/Outland/TempestKeep/the_mechanar/boss_nethermancer_sepethrea.cpp rename : src/server/scripts/Outland/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp => src/server/scripts/Outland/TempestKeep/the_mechanar/boss_pathaleon_the_calculator.cpp rename : src/server/scripts/Outland/tempest_keep/the_mechanar/instance_mechanar.cpp => src/server/scripts/Outland/TempestKeep/the_mechanar/instance_mechanar.cpp rename : src/server/scripts/Outland/tempest_keep/the_mechanar/mechanar.h => src/server/scripts/Outland/TempestKeep/the_mechanar/mechanar.h --- .../auchenai_crypts/boss_exarch_maladaar.cpp | 348 +++ .../boss_shirrak_the_dead_watcher.cpp | 211 ++ .../mana_tombs/boss_nexusprince_shaffar.cpp | 358 ++++ .../Auchindoun/mana_tombs/boss_pandemonius.cpp | 126 ++ .../sethekk_halls/boss_darkweaver_syth.cpp | 414 ++++ .../sethekk_halls/boss_tailonking_ikiss.cpp | 213 ++ .../sethekk_halls/instance_sethekk_halls.cpp | 91 + .../Auchindoun/sethekk_halls/sethekk_halls.h | 14 + .../shadow_labyrinth/boss_ambassador_hellmaw.cpp | 206 ++ .../boss_blackheart_the_inciter.cpp | 169 ++ .../shadow_labyrinth/boss_grandmaster_vorpil.cpp | 313 +++ .../Auchindoun/shadow_labyrinth/boss_murmur.cpp | 205 ++ .../shadow_labyrinth/instance_shadow_labyrinth.cpp | 227 ++ .../Auchindoun/shadow_labyrinth/shadow_labyrinth.h | 15 + .../scripts/Outland/BlackTemple/black_temple.cpp | 69 + .../scripts/Outland/BlackTemple/black_temple.h | 39 + .../scripts/Outland/BlackTemple/boss_bloodboil.cpp | 332 +++ .../scripts/Outland/BlackTemple/boss_illidan.cpp | 2248 ++++++++++++++++++++ .../Outland/BlackTemple/boss_mother_shahraz.cpp | 302 +++ .../BlackTemple/boss_reliquary_of_souls.cpp | 690 ++++++ .../Outland/BlackTemple/boss_shade_of_akama.cpp | 871 ++++++++ .../scripts/Outland/BlackTemple/boss_supremus.cpp | 296 +++ .../Outland/BlackTemple/boss_teron_gorefiend.cpp | 508 +++++ .../Outland/BlackTemple/boss_warlord_najentus.cpp | 226 ++ .../Outland/BlackTemple/illidari_council.cpp | 874 ++++++++ .../Outland/BlackTemple/instance_black_temple.cpp | 346 +++ .../serpent_shrine/boss_fathomlord_karathress.cpp | 746 +++++++ .../serpent_shrine/boss_hydross_the_unstable.cpp | 379 ++++ .../serpent_shrine/boss_lady_vashj.cpp | 1039 +++++++++ .../serpent_shrine/boss_leotheras_the_blind.cpp | 787 +++++++ .../serpent_shrine/boss_lurker_below.cpp | 458 ++++ .../serpent_shrine/boss_morogrim_tidewalker.cpp | 369 ++++ .../serpent_shrine/instance_serpent_shrine.cpp | 398 ++++ .../serpent_shrine/serpent_shrine.h | 45 + .../steam_vault/boss_hydromancer_thespia.cpp | 187 ++ .../steam_vault/boss_mekgineer_steamrigger.cpp | 264 +++ .../steam_vault/boss_warlord_kalithresh.cpp | 204 ++ .../steam_vault/instance_steam_vault.cpp | 231 ++ .../CoilfangReservoir/steam_vault/steam_vault.h | 17 + .../CoilfangReservoir/underbog/boss_hungarfen.cpp | 154 ++ .../underbog/boss_the_black_stalker.cpp | 185 ++ .../scripts/Outland/GruulsLair/boss_gruul.cpp | 255 +++ .../Outland/GruulsLair/boss_high_king_maulgar.cpp | 783 +++++++ .../scripts/Outland/GruulsLair/gruuls_lair.h | 21 + .../Outland/GruulsLair/instance_gruuls_lair.cpp | 193 ++ .../HellfireCitadel/blood_furnace/blood_furnace.h | 29 + .../HellfireCitadel/blood_furnace/boss_broggok.cpp | 131 ++ .../blood_furnace/boss_kelidan_the_breaker.cpp | 356 ++++ .../blood_furnace/boss_the_maker.cpp | 152 ++ .../blood_furnace/instance_blood_furnace.cpp | 232 ++ .../hellfire_ramparts/boss_omor_the_unscarred.cpp | 206 ++ .../hellfire_ramparts/boss_vazruden_the_herald.cpp | 467 ++++ .../boss_watchkeeper_gargolmar.cpp | 156 ++ .../hellfire_ramparts/hellfire_ramparts.h | 16 + .../instance_hellfire_ramparts.cpp | 84 + .../magtheridons_lair/boss_magtheridon.cpp | 570 +++++ .../instance_magtheridons_lair.cpp | 254 +++ .../magtheridons_lair/magtheridons_lair.h | 14 + .../shattered_halls/boss_nethekurse.cpp | 396 ++++ .../shattered_halls/boss_warbringer_omrogg.cpp | 404 ++++ .../boss_warchief_kargath_bladefist.cpp | 288 +++ .../shattered_halls/instance_shattered_halls.cpp | 114 + .../shattered_halls/shattered_halls.h | 14 + .../Outland/TempestKeep/arcatraz/arcatraz.cpp | 520 +++++ .../Outland/TempestKeep/arcatraz/arcatraz.h | 21 + .../arcatraz/boss_harbinger_skyriss.cpp | 293 +++ .../TempestKeep/arcatraz/instance_arcatraz.cpp | 240 +++ .../botanica/boss_high_botanist_freywinn.cpp | 191 ++ .../Outland/TempestKeep/botanica/boss_laj.cpp | 205 ++ .../TempestKeep/botanica/boss_warp_splinter.cpp | 216 ++ .../Outland/TempestKeep/the_eye/boss_alar.cpp | 523 +++++ .../TempestKeep/the_eye/boss_astromancer.cpp | 466 ++++ .../Outland/TempestKeep/the_eye/boss_kaelthas.cpp | 1498 +++++++++++++ .../TempestKeep/the_eye/boss_void_reaver.cpp | 179 ++ .../TempestKeep/the_eye/instance_the_eye.cpp | 176 ++ .../Outland/TempestKeep/the_eye/the_eye.cpp | 98 + .../scripts/Outland/TempestKeep/the_eye/the_eye.h | 20 + .../the_mechanar/boss_gatewatcher_gyrokill.cpp | 39 + .../the_mechanar/boss_gatewatcher_ironhand.cpp | 130 ++ .../the_mechanar/boss_nethermancer_sepethrea.cpp | 245 +++ .../the_mechanar/boss_pathaleon_the_calculator.cpp | 246 +++ .../TempestKeep/the_mechanar/instance_mechanar.cpp | 86 + .../Outland/TempestKeep/the_mechanar/mechanar.h | 6 + .../auchenai_crypts/boss_exarch_maladaar.cpp | 348 --- .../boss_shirrak_the_dead_watcher.cpp | 211 -- .../mana_tombs/boss_nexusprince_shaffar.cpp | 358 ---- .../auchindoun/mana_tombs/boss_pandemonius.cpp | 126 -- .../sethekk_halls/boss_darkweaver_syth.cpp | 414 ---- .../sethekk_halls/boss_tailonking_ikiss.cpp | 213 -- .../sethekk_halls/instance_sethekk_halls.cpp | 91 - .../auchindoun/sethekk_halls/sethekk_halls.h | 14 - .../shadow_labyrinth/boss_ambassador_hellmaw.cpp | 206 -- .../boss_blackheart_the_inciter.cpp | 169 -- .../shadow_labyrinth/boss_grandmaster_vorpil.cpp | 313 --- .../auchindoun/shadow_labyrinth/boss_murmur.cpp | 205 -- .../shadow_labyrinth/instance_shadow_labyrinth.cpp | 227 -- .../auchindoun/shadow_labyrinth/shadow_labyrinth.h | 15 - .../scripts/Outland/black_temple/black_temple.cpp | 69 - .../scripts/Outland/black_temple/black_temple.h | 39 - .../Outland/black_temple/boss_bloodboil.cpp | 332 --- .../scripts/Outland/black_temple/boss_illidan.cpp | 2248 -------------------- .../Outland/black_temple/boss_mother_shahraz.cpp | 302 --- .../black_temple/boss_reliquary_of_souls.cpp | 690 ------ .../Outland/black_temple/boss_shade_of_akama.cpp | 871 -------- .../scripts/Outland/black_temple/boss_supremus.cpp | 296 --- .../Outland/black_temple/boss_teron_gorefiend.cpp | 508 ----- .../Outland/black_temple/boss_warlord_najentus.cpp | 226 -- .../Outland/black_temple/illidari_council.cpp | 874 -------- .../Outland/black_temple/instance_black_temple.cpp | 346 --- .../serpent_shrine/boss_fathomlord_karathress.cpp | 746 ------- .../serpent_shrine/boss_hydross_the_unstable.cpp | 379 ---- .../serpent_shrine/boss_lady_vashj.cpp | 1039 --------- .../serpent_shrine/boss_leotheras_the_blind.cpp | 787 ------- .../serpent_shrine/boss_lurker_below.cpp | 458 ---- .../serpent_shrine/boss_morogrim_tidewalker.cpp | 369 ---- .../serpent_shrine/instance_serpent_shrine.cpp | 398 ---- .../serpent_shrine/serpent_shrine.h | 45 - .../steam_vault/boss_hydromancer_thespia.cpp | 187 -- .../steam_vault/boss_mekgineer_steamrigger.cpp | 264 --- .../steam_vault/boss_warlord_kalithresh.cpp | 204 -- .../steam_vault/instance_steam_vault.cpp | 231 -- .../coilfang_resevoir/steam_vault/steam_vault.h | 17 - .../coilfang_resevoir/underbog/boss_hungarfen.cpp | 154 -- .../underbog/boss_the_black_stalker.cpp | 185 -- .../scripts/Outland/gruuls_lair/boss_gruul.cpp | 255 --- .../Outland/gruuls_lair/boss_high_king_maulgar.cpp | 783 ------- .../scripts/Outland/gruuls_lair/gruuls_lair.h | 21 - .../Outland/gruuls_lair/instance_gruuls_lair.cpp | 193 -- .../hellfire_citadel/blood_furnace/blood_furnace.h | 29 - .../blood_furnace/boss_broggok.cpp | 131 -- .../blood_furnace/boss_kelidan_the_breaker.cpp | 356 ---- .../blood_furnace/boss_the_maker.cpp | 152 -- .../blood_furnace/instance_blood_furnace.cpp | 232 -- .../hellfire_ramparts/boss_omor_the_unscarred.cpp | 206 -- .../hellfire_ramparts/boss_vazruden_the_herald.cpp | 467 ---- .../boss_watchkeeper_gargolmar.cpp | 156 -- .../hellfire_ramparts/hellfire_ramparts.h | 16 - .../instance_hellfire_ramparts.cpp | 84 - .../magtheridons_lair/boss_magtheridon.cpp | 570 ----- .../instance_magtheridons_lair.cpp | 254 --- .../magtheridons_lair/magtheridons_lair.h | 14 - .../shattered_halls/boss_nethekurse.cpp | 396 ---- .../shattered_halls/boss_warbringer_omrogg.cpp | 404 ---- .../boss_warchief_kargath_bladefist.cpp | 288 --- .../shattered_halls/instance_shattered_halls.cpp | 114 - .../shattered_halls/shattered_halls.h | 14 - .../Outland/tempest_keep/arcatraz/arcatraz.cpp | 520 ----- .../Outland/tempest_keep/arcatraz/arcatraz.h | 21 - .../arcatraz/boss_harbinger_skyriss.cpp | 293 --- .../tempest_keep/arcatraz/instance_arcatraz.cpp | 240 --- .../botanica/boss_high_botanist_freywinn.cpp | 191 -- .../Outland/tempest_keep/botanica/boss_laj.cpp | 205 -- .../tempest_keep/botanica/boss_warp_splinter.cpp | 216 -- .../Outland/tempest_keep/the_eye/boss_alar.cpp | 523 ----- .../tempest_keep/the_eye/boss_astromancer.cpp | 466 ---- .../Outland/tempest_keep/the_eye/boss_kaelthas.cpp | 1498 ------------- .../tempest_keep/the_eye/boss_void_reaver.cpp | 179 -- .../tempest_keep/the_eye/instance_the_eye.cpp | 176 -- .../Outland/tempest_keep/the_eye/the_eye.cpp | 98 - .../scripts/Outland/tempest_keep/the_eye/the_eye.h | 20 - .../the_mechanar/boss_gatewatcher_gyrokill.cpp | 39 - .../the_mechanar/boss_gatewatcher_ironhand.cpp | 130 -- .../the_mechanar/boss_nethermancer_sepethrea.cpp | 245 --- .../the_mechanar/boss_pathaleon_the_calculator.cpp | 246 --- .../the_mechanar/instance_mechanar.cpp | 86 - .../Outland/tempest_keep/the_mechanar/mechanar.h | 6 - 166 files changed, 25707 insertions(+), 25707 deletions(-) create mode 100644 src/server/scripts/Outland/Auchindoun/auchenai_crypts/boss_exarch_maladaar.cpp create mode 100644 src/server/scripts/Outland/Auchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp create mode 100644 src/server/scripts/Outland/Auchindoun/mana_tombs/boss_nexusprince_shaffar.cpp create mode 100644 src/server/scripts/Outland/Auchindoun/mana_tombs/boss_pandemonius.cpp create mode 100644 src/server/scripts/Outland/Auchindoun/sethekk_halls/boss_darkweaver_syth.cpp create mode 100644 src/server/scripts/Outland/Auchindoun/sethekk_halls/boss_tailonking_ikiss.cpp create mode 100644 src/server/scripts/Outland/Auchindoun/sethekk_halls/instance_sethekk_halls.cpp create mode 100644 src/server/scripts/Outland/Auchindoun/sethekk_halls/sethekk_halls.h create mode 100644 src/server/scripts/Outland/Auchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp create mode 100644 src/server/scripts/Outland/Auchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp create mode 100644 src/server/scripts/Outland/Auchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp create mode 100644 src/server/scripts/Outland/Auchindoun/shadow_labyrinth/boss_murmur.cpp create mode 100644 src/server/scripts/Outland/Auchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp create mode 100644 src/server/scripts/Outland/Auchindoun/shadow_labyrinth/shadow_labyrinth.h create mode 100644 src/server/scripts/Outland/BlackTemple/black_temple.cpp create mode 100644 src/server/scripts/Outland/BlackTemple/black_temple.h create mode 100644 src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp create mode 100644 src/server/scripts/Outland/BlackTemple/boss_illidan.cpp create mode 100644 src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp create mode 100644 src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp create mode 100644 src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp create mode 100644 src/server/scripts/Outland/BlackTemple/boss_supremus.cpp create mode 100644 src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp create mode 100644 src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp create mode 100644 src/server/scripts/Outland/BlackTemple/illidari_council.cpp create mode 100644 src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp create mode 100644 src/server/scripts/Outland/CoilfangReservoir/serpent_shrine/boss_fathomlord_karathress.cpp create mode 100644 src/server/scripts/Outland/CoilfangReservoir/serpent_shrine/boss_hydross_the_unstable.cpp create mode 100644 src/server/scripts/Outland/CoilfangReservoir/serpent_shrine/boss_lady_vashj.cpp create mode 100644 src/server/scripts/Outland/CoilfangReservoir/serpent_shrine/boss_leotheras_the_blind.cpp create mode 100644 src/server/scripts/Outland/CoilfangReservoir/serpent_shrine/boss_lurker_below.cpp create mode 100644 src/server/scripts/Outland/CoilfangReservoir/serpent_shrine/boss_morogrim_tidewalker.cpp create mode 100644 src/server/scripts/Outland/CoilfangReservoir/serpent_shrine/instance_serpent_shrine.cpp create mode 100644 src/server/scripts/Outland/CoilfangReservoir/serpent_shrine/serpent_shrine.h create mode 100644 src/server/scripts/Outland/CoilfangReservoir/steam_vault/boss_hydromancer_thespia.cpp create mode 100644 src/server/scripts/Outland/CoilfangReservoir/steam_vault/boss_mekgineer_steamrigger.cpp create mode 100644 src/server/scripts/Outland/CoilfangReservoir/steam_vault/boss_warlord_kalithresh.cpp create mode 100644 src/server/scripts/Outland/CoilfangReservoir/steam_vault/instance_steam_vault.cpp create mode 100644 src/server/scripts/Outland/CoilfangReservoir/steam_vault/steam_vault.h create mode 100644 src/server/scripts/Outland/CoilfangReservoir/underbog/boss_hungarfen.cpp create mode 100644 src/server/scripts/Outland/CoilfangReservoir/underbog/boss_the_black_stalker.cpp create mode 100644 src/server/scripts/Outland/GruulsLair/boss_gruul.cpp create mode 100644 src/server/scripts/Outland/GruulsLair/boss_high_king_maulgar.cpp create mode 100644 src/server/scripts/Outland/GruulsLair/gruuls_lair.h create mode 100644 src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp create mode 100644 src/server/scripts/Outland/HellfireCitadel/blood_furnace/blood_furnace.h create mode 100644 src/server/scripts/Outland/HellfireCitadel/blood_furnace/boss_broggok.cpp create mode 100644 src/server/scripts/Outland/HellfireCitadel/blood_furnace/boss_kelidan_the_breaker.cpp create mode 100644 src/server/scripts/Outland/HellfireCitadel/blood_furnace/boss_the_maker.cpp create mode 100644 src/server/scripts/Outland/HellfireCitadel/blood_furnace/instance_blood_furnace.cpp create mode 100644 src/server/scripts/Outland/HellfireCitadel/hellfire_ramparts/boss_omor_the_unscarred.cpp create mode 100644 src/server/scripts/Outland/HellfireCitadel/hellfire_ramparts/boss_vazruden_the_herald.cpp create mode 100644 src/server/scripts/Outland/HellfireCitadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp create mode 100644 src/server/scripts/Outland/HellfireCitadel/hellfire_ramparts/hellfire_ramparts.h create mode 100644 src/server/scripts/Outland/HellfireCitadel/hellfire_ramparts/instance_hellfire_ramparts.cpp create mode 100644 src/server/scripts/Outland/HellfireCitadel/magtheridons_lair/boss_magtheridon.cpp create mode 100644 src/server/scripts/Outland/HellfireCitadel/magtheridons_lair/instance_magtheridons_lair.cpp create mode 100644 src/server/scripts/Outland/HellfireCitadel/magtheridons_lair/magtheridons_lair.h create mode 100644 src/server/scripts/Outland/HellfireCitadel/shattered_halls/boss_nethekurse.cpp create mode 100644 src/server/scripts/Outland/HellfireCitadel/shattered_halls/boss_warbringer_omrogg.cpp create mode 100644 src/server/scripts/Outland/HellfireCitadel/shattered_halls/boss_warchief_kargath_bladefist.cpp create mode 100644 src/server/scripts/Outland/HellfireCitadel/shattered_halls/instance_shattered_halls.cpp create mode 100644 src/server/scripts/Outland/HellfireCitadel/shattered_halls/shattered_halls.h create mode 100644 src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp create mode 100644 src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.h create mode 100644 src/server/scripts/Outland/TempestKeep/arcatraz/boss_harbinger_skyriss.cpp create mode 100644 src/server/scripts/Outland/TempestKeep/arcatraz/instance_arcatraz.cpp create mode 100644 src/server/scripts/Outland/TempestKeep/botanica/boss_high_botanist_freywinn.cpp create mode 100644 src/server/scripts/Outland/TempestKeep/botanica/boss_laj.cpp create mode 100644 src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp create mode 100644 src/server/scripts/Outland/TempestKeep/the_eye/boss_alar.cpp create mode 100644 src/server/scripts/Outland/TempestKeep/the_eye/boss_astromancer.cpp create mode 100644 src/server/scripts/Outland/TempestKeep/the_eye/boss_kaelthas.cpp create mode 100644 src/server/scripts/Outland/TempestKeep/the_eye/boss_void_reaver.cpp create mode 100644 src/server/scripts/Outland/TempestKeep/the_eye/instance_the_eye.cpp create mode 100644 src/server/scripts/Outland/TempestKeep/the_eye/the_eye.cpp create mode 100644 src/server/scripts/Outland/TempestKeep/the_eye/the_eye.h create mode 100644 src/server/scripts/Outland/TempestKeep/the_mechanar/boss_gatewatcher_gyrokill.cpp create mode 100644 src/server/scripts/Outland/TempestKeep/the_mechanar/boss_gatewatcher_ironhand.cpp create mode 100644 src/server/scripts/Outland/TempestKeep/the_mechanar/boss_nethermancer_sepethrea.cpp create mode 100644 src/server/scripts/Outland/TempestKeep/the_mechanar/boss_pathaleon_the_calculator.cpp create mode 100644 src/server/scripts/Outland/TempestKeep/the_mechanar/instance_mechanar.cpp create mode 100644 src/server/scripts/Outland/TempestKeep/the_mechanar/mechanar.h delete mode 100644 src/server/scripts/Outland/auchindoun/auchenai_crypts/boss_exarch_maladaar.cpp delete mode 100644 src/server/scripts/Outland/auchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp delete mode 100644 src/server/scripts/Outland/auchindoun/mana_tombs/boss_nexusprince_shaffar.cpp delete mode 100644 src/server/scripts/Outland/auchindoun/mana_tombs/boss_pandemonius.cpp delete mode 100644 src/server/scripts/Outland/auchindoun/sethekk_halls/boss_darkweaver_syth.cpp delete mode 100644 src/server/scripts/Outland/auchindoun/sethekk_halls/boss_tailonking_ikiss.cpp delete mode 100644 src/server/scripts/Outland/auchindoun/sethekk_halls/instance_sethekk_halls.cpp delete mode 100644 src/server/scripts/Outland/auchindoun/sethekk_halls/sethekk_halls.h delete mode 100644 src/server/scripts/Outland/auchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp delete mode 100644 src/server/scripts/Outland/auchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp delete mode 100644 src/server/scripts/Outland/auchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp delete mode 100644 src/server/scripts/Outland/auchindoun/shadow_labyrinth/boss_murmur.cpp delete mode 100644 src/server/scripts/Outland/auchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp delete mode 100644 src/server/scripts/Outland/auchindoun/shadow_labyrinth/shadow_labyrinth.h delete mode 100644 src/server/scripts/Outland/black_temple/black_temple.cpp delete mode 100644 src/server/scripts/Outland/black_temple/black_temple.h delete mode 100644 src/server/scripts/Outland/black_temple/boss_bloodboil.cpp delete mode 100644 src/server/scripts/Outland/black_temple/boss_illidan.cpp delete mode 100644 src/server/scripts/Outland/black_temple/boss_mother_shahraz.cpp delete mode 100644 src/server/scripts/Outland/black_temple/boss_reliquary_of_souls.cpp delete mode 100644 src/server/scripts/Outland/black_temple/boss_shade_of_akama.cpp delete mode 100644 src/server/scripts/Outland/black_temple/boss_supremus.cpp delete mode 100644 src/server/scripts/Outland/black_temple/boss_teron_gorefiend.cpp delete mode 100644 src/server/scripts/Outland/black_temple/boss_warlord_najentus.cpp delete mode 100644 src/server/scripts/Outland/black_temple/illidari_council.cpp delete mode 100644 src/server/scripts/Outland/black_temple/instance_black_temple.cpp delete mode 100644 src/server/scripts/Outland/coilfang_resevoir/serpent_shrine/boss_fathomlord_karathress.cpp delete mode 100644 src/server/scripts/Outland/coilfang_resevoir/serpent_shrine/boss_hydross_the_unstable.cpp delete mode 100644 src/server/scripts/Outland/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp delete mode 100644 src/server/scripts/Outland/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp delete mode 100644 src/server/scripts/Outland/coilfang_resevoir/serpent_shrine/boss_lurker_below.cpp delete mode 100644 src/server/scripts/Outland/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp delete mode 100644 src/server/scripts/Outland/coilfang_resevoir/serpent_shrine/instance_serpent_shrine.cpp delete mode 100644 src/server/scripts/Outland/coilfang_resevoir/serpent_shrine/serpent_shrine.h delete mode 100644 src/server/scripts/Outland/coilfang_resevoir/steam_vault/boss_hydromancer_thespia.cpp delete mode 100644 src/server/scripts/Outland/coilfang_resevoir/steam_vault/boss_mekgineer_steamrigger.cpp delete mode 100644 src/server/scripts/Outland/coilfang_resevoir/steam_vault/boss_warlord_kalithresh.cpp delete mode 100644 src/server/scripts/Outland/coilfang_resevoir/steam_vault/instance_steam_vault.cpp delete mode 100644 src/server/scripts/Outland/coilfang_resevoir/steam_vault/steam_vault.h delete mode 100644 src/server/scripts/Outland/coilfang_resevoir/underbog/boss_hungarfen.cpp delete mode 100644 src/server/scripts/Outland/coilfang_resevoir/underbog/boss_the_black_stalker.cpp delete mode 100644 src/server/scripts/Outland/gruuls_lair/boss_gruul.cpp delete mode 100644 src/server/scripts/Outland/gruuls_lair/boss_high_king_maulgar.cpp delete mode 100644 src/server/scripts/Outland/gruuls_lair/gruuls_lair.h delete mode 100644 src/server/scripts/Outland/gruuls_lair/instance_gruuls_lair.cpp delete mode 100644 src/server/scripts/Outland/hellfire_citadel/blood_furnace/blood_furnace.h delete mode 100644 src/server/scripts/Outland/hellfire_citadel/blood_furnace/boss_broggok.cpp delete mode 100644 src/server/scripts/Outland/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp delete mode 100644 src/server/scripts/Outland/hellfire_citadel/blood_furnace/boss_the_maker.cpp delete mode 100644 src/server/scripts/Outland/hellfire_citadel/blood_furnace/instance_blood_furnace.cpp delete mode 100644 src/server/scripts/Outland/hellfire_citadel/hellfire_ramparts/boss_omor_the_unscarred.cpp delete mode 100644 src/server/scripts/Outland/hellfire_citadel/hellfire_ramparts/boss_vazruden_the_herald.cpp delete mode 100644 src/server/scripts/Outland/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp delete mode 100644 src/server/scripts/Outland/hellfire_citadel/hellfire_ramparts/hellfire_ramparts.h delete mode 100644 src/server/scripts/Outland/hellfire_citadel/hellfire_ramparts/instance_hellfire_ramparts.cpp delete mode 100644 src/server/scripts/Outland/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp delete mode 100644 src/server/scripts/Outland/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp delete mode 100644 src/server/scripts/Outland/hellfire_citadel/magtheridons_lair/magtheridons_lair.h delete mode 100644 src/server/scripts/Outland/hellfire_citadel/shattered_halls/boss_nethekurse.cpp delete mode 100644 src/server/scripts/Outland/hellfire_citadel/shattered_halls/boss_warbringer_omrogg.cpp delete mode 100644 src/server/scripts/Outland/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp delete mode 100644 src/server/scripts/Outland/hellfire_citadel/shattered_halls/instance_shattered_halls.cpp delete mode 100644 src/server/scripts/Outland/hellfire_citadel/shattered_halls/shattered_halls.h delete mode 100644 src/server/scripts/Outland/tempest_keep/arcatraz/arcatraz.cpp delete mode 100644 src/server/scripts/Outland/tempest_keep/arcatraz/arcatraz.h delete mode 100644 src/server/scripts/Outland/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp delete mode 100644 src/server/scripts/Outland/tempest_keep/arcatraz/instance_arcatraz.cpp delete mode 100644 src/server/scripts/Outland/tempest_keep/botanica/boss_high_botanist_freywinn.cpp delete mode 100644 src/server/scripts/Outland/tempest_keep/botanica/boss_laj.cpp delete mode 100644 src/server/scripts/Outland/tempest_keep/botanica/boss_warp_splinter.cpp delete mode 100644 src/server/scripts/Outland/tempest_keep/the_eye/boss_alar.cpp delete mode 100644 src/server/scripts/Outland/tempest_keep/the_eye/boss_astromancer.cpp delete mode 100644 src/server/scripts/Outland/tempest_keep/the_eye/boss_kaelthas.cpp delete mode 100644 src/server/scripts/Outland/tempest_keep/the_eye/boss_void_reaver.cpp delete mode 100644 src/server/scripts/Outland/tempest_keep/the_eye/instance_the_eye.cpp delete mode 100644 src/server/scripts/Outland/tempest_keep/the_eye/the_eye.cpp delete mode 100644 src/server/scripts/Outland/tempest_keep/the_eye/the_eye.h delete mode 100644 src/server/scripts/Outland/tempest_keep/the_mechanar/boss_gatewatcher_gyrokill.cpp delete mode 100644 src/server/scripts/Outland/tempest_keep/the_mechanar/boss_gatewatcher_ironhand.cpp delete mode 100644 src/server/scripts/Outland/tempest_keep/the_mechanar/boss_nethermancer_sepethrea.cpp delete mode 100644 src/server/scripts/Outland/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp delete mode 100644 src/server/scripts/Outland/tempest_keep/the_mechanar/instance_mechanar.cpp delete mode 100644 src/server/scripts/Outland/tempest_keep/the_mechanar/mechanar.h (limited to 'src/server/scripts/Outland') diff --git a/src/server/scripts/Outland/Auchindoun/auchenai_crypts/boss_exarch_maladaar.cpp b/src/server/scripts/Outland/Auchindoun/auchenai_crypts/boss_exarch_maladaar.cpp new file mode 100644 index 00000000000..bfde95ffcb0 --- /dev/null +++ b/src/server/scripts/Outland/Auchindoun/auchenai_crypts/boss_exarch_maladaar.cpp @@ -0,0 +1,348 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Exarch_Maladaar +SD%Complete: 95 +SDComment: Most of event implemented, some adjustments to timers remain and possibly make some better code for switching his dark side in to better "images" of player. +SDCategory: Auchindoun, Auchenai Crypts +EndScriptData */ + +/* ContentData +mob_stolen_soul +boss_exarch_maladaar +mob_avatar_of_martyred +EndContentData */ + +#include "ScriptedPch.h" + +#define SPELL_MOONFIRE 37328 +#define SPELL_FIREBALL 37329 +#define SPELL_MIND_FLAY 37330 +#define SPELL_HEMORRHAGE 37331 +#define SPELL_FROSTSHOCK 37332 +#define SPELL_CURSE_OF_AGONY 37334 +#define SPELL_MORTAL_STRIKE 37335 +#define SPELL_FREEZING_TRAP 37368 +#define SPELL_HAMMER_OF_JUSTICE 37369 + +struct mob_stolen_soulAI : public ScriptedAI +{ + mob_stolen_soulAI(Creature *c) : ScriptedAI(c) {} + + uint8 myClass; + uint32 Class_Timer; + + void Reset() + { + Class_Timer = 1000; + } + + void EnterCombat(Unit * /*who*/) + { } + + void SetMyClass(uint8 myclass) + { + myClass = myclass; + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (Class_Timer <= diff) + { + switch (myClass) + { + case CLASS_WARRIOR: + DoCast(me->getVictim(), SPELL_MORTAL_STRIKE); + Class_Timer = 6000; + break; + case CLASS_PALADIN: + DoCast(me->getVictim(), SPELL_HAMMER_OF_JUSTICE); + Class_Timer = 6000; + break; + case CLASS_HUNTER: + DoCast(me->getVictim(), SPELL_FREEZING_TRAP); + Class_Timer = 20000; + break; + case CLASS_ROGUE: + DoCast(me->getVictim(), SPELL_HEMORRHAGE); + Class_Timer = 10000; + break; + case CLASS_PRIEST: + DoCast(me->getVictim(), SPELL_MIND_FLAY); + Class_Timer = 5000; + break; + case CLASS_SHAMAN: + DoCast(me->getVictim(), SPELL_FROSTSHOCK); + Class_Timer = 8000; + break; + case CLASS_MAGE: + DoCast(me->getVictim(), SPELL_FIREBALL); + Class_Timer = 5000; + break; + case CLASS_WARLOCK: + DoCast(me->getVictim(), SPELL_CURSE_OF_AGONY); + Class_Timer = 20000; + break; + case CLASS_DRUID: + DoCast(me->getVictim(), SPELL_MOONFIRE); + Class_Timer = 10000; + break; + } + } else Class_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_stolen_soul(Creature* pCreature) +{ + return new mob_stolen_soulAI (pCreature); +} + +#define SAY_INTRO -1558000 +#define SAY_SUMMON -1558001 + +#define SAY_AGGRO_1 -1558002 +#define SAY_AGGRO_2 -1558003 +#define SAY_AGGRO_3 -1558004 + +#define SAY_ROAR -1558005 +#define SAY_SOUL_CLEAVE -1558006 + +#define SAY_SLAY_1 -1558007 +#define SAY_SLAY_2 -1558008 + +#define SAY_DEATH -1558009 + +#define SPELL_RIBBON_OF_SOULS 32422 +#define SPELL_SOUL_SCREAM 32421 + +#define SPELL_STOLEN_SOUL 32346 +#define SPELL_STOLEN_SOUL_VISUAL 32395 + +#define SPELL_SUMMON_AVATAR 32424 + +#define ENTRY_STOLEN_SOUL 18441 + +struct boss_exarch_maladaarAI : public ScriptedAI +{ + boss_exarch_maladaarAI(Creature *c) : ScriptedAI(c) + { + HasTaunted = false; + } + + uint32 soulmodel; + uint64 soulholder; + uint8 soulclass; + + uint32 Fear_timer; + uint32 Ribbon_of_Souls_timer; + uint32 StolenSoul_Timer; + + bool HasTaunted; + bool Avatar_summoned; + + void Reset() + { + soulmodel = 0; + soulholder = 0; + soulclass = 0; + + Fear_timer = 15000 + rand()% 5000; + Ribbon_of_Souls_timer = 5000; + StolenSoul_Timer = 25000 + rand()% 10000; + + Avatar_summoned = false; + } + + void MoveInLineOfSight(Unit *who) + { + if (!HasTaunted && me->IsWithinDistInMap(who, 150.0)) + { + DoScriptText(SAY_INTRO, me); + HasTaunted = true; + } + + ScriptedAI::MoveInLineOfSight(who); + } + + void EnterCombat(Unit * /*who*/) + { + DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3), me); + } + + void JustSummoned(Creature *summoned) + { + if (summoned->GetEntry() == ENTRY_STOLEN_SOUL) + { + //SPELL_STOLEN_SOUL_VISUAL has shapeshift effect, but not implemented feature in Trinity for this spell. + summoned->CastSpell(summoned,SPELL_STOLEN_SOUL_VISUAL,false); + summoned->SetDisplayId(soulmodel); + summoned->setFaction(me->getFaction()); + + if (Unit *pTarget = Unit::GetUnit(*me,soulholder)) + { + + CAST_AI(mob_stolen_soulAI, summoned->AI())->SetMyClass(soulclass); + summoned->AI()->AttackStart(pTarget); + } + } + } + + void KilledUnit(Unit* /*victim*/) + { + if (rand()%2) + return; + + DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me); + } + + void JustDied(Unit* /*Killer*/) + { + DoScriptText(SAY_DEATH, me); + //When Exarch Maladar is defeated D'ore appear. + me->SummonCreature(19412, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 600000); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (!Avatar_summoned && ((me->GetHealth()*100) / me->GetMaxHealth() < 25)) + { + if (me->IsNonMeleeSpellCasted(false)) + me->InterruptNonMeleeSpells(true); + + DoScriptText(SAY_SUMMON, me); + + DoCast(me, SPELL_SUMMON_AVATAR); + Avatar_summoned = true; + StolenSoul_Timer = 15000 + rand()% 15000; + } + + if (StolenSoul_Timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + { + if (pTarget->GetTypeId() == TYPEID_PLAYER) + { + if (me->IsNonMeleeSpellCasted(false)) + me->InterruptNonMeleeSpells(true); + + uint32 i = urand(1,2); + if (i == 1) + DoScriptText(SAY_ROAR, me); + else + DoScriptText(SAY_SOUL_CLEAVE, me); + + soulmodel = pTarget->GetDisplayId(); + soulholder = pTarget->GetGUID(); + soulclass = pTarget->getClass(); + + DoCast(pTarget, SPELL_STOLEN_SOUL); + me->SummonCreature(ENTRY_STOLEN_SOUL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); + + StolenSoul_Timer = 20000 + rand()% 10000; + } else StolenSoul_Timer = 1000; + } + } else StolenSoul_Timer -= diff; + + if (Ribbon_of_Souls_timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(pTarget, SPELL_RIBBON_OF_SOULS); + + Ribbon_of_Souls_timer = 5000 + (rand()%20 * 1000); + } else Ribbon_of_Souls_timer -= diff; + + if (Fear_timer <= diff) + { + DoCast(me, SPELL_SOUL_SCREAM); + Fear_timer = 15000 + rand()% 15000; + } else Fear_timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_exarch_maladaar(Creature* pCreature) +{ + return new boss_exarch_maladaarAI (pCreature); +} + +#define SPELL_AV_MORTAL_STRIKE 16856 +#define SPELL_AV_SUNDER_ARMOR 16145 + +struct mob_avatar_of_martyredAI : public ScriptedAI +{ + mob_avatar_of_martyredAI(Creature *c) : ScriptedAI(c) {} + + uint32 Mortal_Strike_timer; + + void Reset() + { + Mortal_Strike_timer = 10000; + } + + void EnterCombat(Unit * /*who*/) + { + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (Mortal_Strike_timer <= diff) + { + DoCast(me->getVictim(), SPELL_AV_MORTAL_STRIKE); + Mortal_Strike_timer = 10000 + rand()%20 * 1000; + } else Mortal_Strike_timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_avatar_of_martyred(Creature* pCreature) +{ + return new mob_avatar_of_martyredAI (pCreature); +} + +void AddSC_boss_exarch_maladaar() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_exarch_maladaar"; + newscript->GetAI = &GetAI_boss_exarch_maladaar; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_avatar_of_martyred"; + newscript->GetAI = &GetAI_mob_avatar_of_martyred; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_stolen_soul"; + newscript->GetAI = &GetAI_mob_stolen_soul; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/Outland/Auchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp b/src/server/scripts/Outland/Auchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp new file mode 100644 index 00000000000..c13e2905171 --- /dev/null +++ b/src/server/scripts/Outland/Auchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp @@ -0,0 +1,211 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +Name: Boss_Shirrak_the_dead_watcher +%Complete: 80 +Comment: InhibitMagic should stack slower far from the boss, proper Visual for Focus Fire, heroic implemented +Category: Auchindoun, Auchenai Crypts +EndScriptData */ + +#include "ScriptedPch.h" + +#define SPELL_INHIBITMAGIC 32264 +#define SPELL_ATTRACTMAGIC 32265 +#define N_SPELL_CARNIVOROUSBITE 36383 +#define H_SPELL_CARNIVOROUSBITE 39382 +#define SPELL_CARNIVOROUSBITE DUNGEON_MODE(N_SPELL_CARNIVOROUSBITE, H_SPELL_CARNIVOROUSBITE) + +#define ENTRY_FOCUS_FIRE 18374 + +#define N_SPELL_FIERY_BLAST 32302 +#define H_SPELL_FIERY_BLAST 38382 +#define SPELL_FIERY_BLAST DUNGEON_MODE(N_SPELL_FIERY_BLAST, H_SPELL_FIERY_BLAST) +#define SPELL_FOCUS_FIRE_VISUAL 42075 //need to find better visual + +#define EMOTE_FOCUSES_ON "focuses on " + +struct boss_shirrak_the_dead_watcherAI : public ScriptedAI +{ + boss_shirrak_the_dead_watcherAI(Creature *c) : ScriptedAI(c) + { + } + + uint32 Inhibitmagic_Timer; + uint32 Attractmagic_Timer; + uint32 Carnivorousbite_Timer; + uint32 FocusFire_Timer; + + uint64 FocusedTargetGUID; + + void Reset() + { + Inhibitmagic_Timer = 0; + Attractmagic_Timer = 28000; + Carnivorousbite_Timer = 10000; + FocusFire_Timer = 17000; + FocusedTargetGUID = 0; + } + + void EnterCombat(Unit * /*who*/) + { } + + void JustSummoned(Creature *summoned) + { + if (summoned && summoned->GetEntry() == ENTRY_FOCUS_FIRE) + { + summoned->CastSpell(summoned,SPELL_FOCUS_FIRE_VISUAL,false); + summoned->setFaction(me->getFaction()); + summoned->SetLevel(me->getLevel()); + summoned->addUnitState(UNIT_STAT_ROOT); + + if (Unit *pFocusedTarget = Unit::GetUnit(*me, FocusedTargetGUID)) + summoned->AI()->AttackStart(pFocusedTarget); + } + } + + void UpdateAI(const uint32 diff) + { + //Inhibitmagic_Timer + if (Inhibitmagic_Timer <= diff) + { + float dist; + Map* pMap = me->GetMap(); + Map::PlayerList const &PlayerList = pMap->GetPlayers(); + for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) + if (Player* i_pl = i->getSource()) + if (i_pl->isAlive() && (dist = i_pl->IsWithinDist(me, 45))) + { + i_pl->RemoveAurasDueToSpell(SPELL_INHIBITMAGIC); + me->AddAura(SPELL_INHIBITMAGIC, i_pl); + if (dist < 35) + me->AddAura(SPELL_INHIBITMAGIC, i_pl); + if (dist < 25) + me->AddAura(SPELL_INHIBITMAGIC, i_pl); + if (dist < 15) + me->AddAura(SPELL_INHIBITMAGIC, i_pl); + } + Inhibitmagic_Timer = 3000+(rand()%1000); + } else Inhibitmagic_Timer -= diff; + + //Return since we have no target + if (!UpdateVictim()) + return; + + //Attractmagic_Timer + if (Attractmagic_Timer <= diff) + { + DoCast(me, SPELL_ATTRACTMAGIC); + Attractmagic_Timer = 30000; + Carnivorousbite_Timer = 1500; + } else Attractmagic_Timer -= diff; + + //Carnivorousbite_Timer + if (Carnivorousbite_Timer <= diff) + { + DoCast(me, SPELL_CARNIVOROUSBITE); + Carnivorousbite_Timer = 10000; + } else Carnivorousbite_Timer -= diff; + + //FocusFire_Timer + if (FocusFire_Timer <= diff) + { + // Summon Focus Fire & Emote + Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1); + if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER && pTarget->isAlive()) + { + FocusedTargetGUID = pTarget->GetGUID(); + me->SummonCreature(ENTRY_FOCUS_FIRE,pTarget->GetPositionX(),pTarget->GetPositionY(),pTarget->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,5500); + + // TODO: Find better way to handle emote + // Emote + std::string *emote = new std::string(EMOTE_FOCUSES_ON); + emote->append(pTarget->GetName()); + emote->append("!"); + const char* text = emote->c_str(); + me->MonsterTextEmote(text, 0, true); + delete emote; + } + FocusFire_Timer = 15000+(rand()%5000); + } else FocusFire_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_shirrak_the_dead_watcher(Creature* pCreature) +{ + return new boss_shirrak_the_dead_watcherAI (pCreature); +} + +struct mob_focus_fireAI : public ScriptedAI +{ + mob_focus_fireAI(Creature *c) : ScriptedAI(c) + { + } + + uint32 FieryBlast_Timer; + bool fiery1, fiery2; + + void Reset() + { + FieryBlast_Timer = 3000+(rand()%1000); + fiery1 = fiery2 = true; + } + + void EnterCombat(Unit * /*who*/) + { } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //FieryBlast_Timer + if (fiery2 && FieryBlast_Timer <= diff) + { + DoCast(me, SPELL_FIERY_BLAST); + + if (fiery1) fiery1 = false; + else if (fiery2) fiery2 = false; + + FieryBlast_Timer = 1000; + } else FieryBlast_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_focus_fire(Creature* pCreature) +{ + return new mob_focus_fireAI (pCreature); +} + +void AddSC_boss_shirrak_the_dead_watcher() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_shirrak_the_dead_watcher"; + newscript->GetAI = &GetAI_boss_shirrak_the_dead_watcher; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_focus_fire"; + newscript->GetAI = &GetAI_mob_focus_fire; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/Outland/Auchindoun/mana_tombs/boss_nexusprince_shaffar.cpp b/src/server/scripts/Outland/Auchindoun/mana_tombs/boss_nexusprince_shaffar.cpp new file mode 100644 index 00000000000..5b15178c33e --- /dev/null +++ b/src/server/scripts/Outland/Auchindoun/mana_tombs/boss_nexusprince_shaffar.cpp @@ -0,0 +1,358 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_NexusPrince_Shaffar +SD%Complete: 80 +SDComment: Need more tuning of spell timers, it should not be as linear fight as current. Also should possibly find a better way to deal with his three initial beacons to make sure all aggro. +SDCategory: Auchindoun, Mana Tombs +EndScriptData */ + +/* ContentData +boss_nexusprince_shaffar +mob_ethereal_beacon +EndContentData */ + +#include "ScriptedPch.h" + +enum ePrince +{ + SAY_INTRO = -1557000, + SAY_AGGRO_1 = -1557001, + SAY_AGGRO_2 = -1557002, + SAY_AGGRO_3 = -1557003, + SAY_SLAY_1 = -1557004, + SAY_SLAY_2 = -1557005, + SAY_SUMMON = -1557006, + SAY_DEAD = -1557007, + + SPELL_BLINK = 34605, + SPELL_FROSTBOLT = 32364, + SPELL_FIREBALL = 32363, + SPELL_FROSTNOVA = 32365, + + SPELL_ETHEREAL_BEACON = 32371, // Summons NPC_BEACON + SPELL_ETHEREAL_BEACON_VISUAL = 32368, + + NPC_BEACON = 18431, + NPC_SHAFFAR = 18344, + + NR_INITIAL_BEACONS = 3 +}; + +struct boss_nexusprince_shaffarAI : public ScriptedAI +{ + boss_nexusprince_shaffarAI(Creature *c) : ScriptedAI(c), summons(me) { HasTaunted = false; } + + uint32 Blink_Timer; + uint32 Beacon_Timer; + uint32 FireBall_Timer; + uint32 Frostbolt_Timer; + uint32 FrostNova_Timer; + + SummonList summons; + + bool HasTaunted; + bool CanBlink; + + void Reset() + { + Blink_Timer = 1500; + Beacon_Timer = 10000; + FireBall_Timer = 8000; + Frostbolt_Timer = 4000; + FrostNova_Timer = 15000; + + CanBlink = false; + + float dist = 8.0f; + float posX, posY, posZ, angle; + me->GetHomePosition(posX, posY, posZ, angle); + + me->SummonCreature(NPC_BEACON, posX - dist, posY - dist, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200000); + me->SummonCreature(NPC_BEACON, posX - dist, posY + dist, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200000); + me->SummonCreature(NPC_BEACON, posX + dist, posY, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200000); + } + + void EnterEvadeMode() + { + summons.DespawnAll(); + ScriptedAI::EnterEvadeMode(); + } + + void MoveInLineOfSight(Unit *who) + { + if (!HasTaunted && who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 100.0f)) + { + DoScriptText(SAY_INTRO, me); + HasTaunted = true; + } + } + + void EnterCombat(Unit * /*who*/) + { + DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3), me); + + DoZoneInCombat(); + summons.DoZoneInCombat(); + } + + void JustSummoned(Creature *summoned) + { + if (summoned->GetEntry() == NPC_BEACON) + { + summoned->CastSpell(summoned,SPELL_ETHEREAL_BEACON_VISUAL,false); + + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + summoned->AI()->AttackStart(pTarget); + } + + summons.Summon(summoned); + } + + void SummonedCreatureDespawn(Creature *summon) + { + summons.Despawn(summon); + } + + void KilledUnit(Unit* /*victim*/) + { + DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me); + } + + void JustDied(Unit* /*Killer*/) + { + DoScriptText(SAY_DEAD, me); + summons.DespawnAll(); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (FrostNova_Timer <= diff) + { + if (me->IsNonMeleeSpellCasted(false)) + me->InterruptNonMeleeSpells(true); + + DoCast(me, SPELL_FROSTNOVA); + FrostNova_Timer = 17500 + rand()%7500; + CanBlink = true; + } else FrostNova_Timer -= diff; + + if (Frostbolt_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_FROSTBOLT); + Frostbolt_Timer = 4500 + rand()%1500; + } else Frostbolt_Timer -= diff; + + if (FireBall_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_FIREBALL); + FireBall_Timer = 4500 + rand()%1500; + } else FireBall_Timer -= diff; + + if (CanBlink) + { + if (Blink_Timer <= diff) + { + if (me->IsNonMeleeSpellCasted(false)) + me->InterruptNonMeleeSpells(true); + + //expire movement, will prevent from running right back to victim after cast + //(but should MoveChase be used again at a certain time or should he not move?) + if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE) + me->GetMotionMaster()->MovementExpired(); + + DoCast(me, SPELL_BLINK); + Blink_Timer = 1000 + rand()%1500; + CanBlink = false; + } else Blink_Timer -= diff; + } + + if (Beacon_Timer <= diff) + { + if (me->IsNonMeleeSpellCasted(false)) + me->InterruptNonMeleeSpells(true); + + if (!urand(0,3)) + DoScriptText(SAY_SUMMON, me); + + DoCast(me, SPELL_ETHEREAL_BEACON, true); + + Beacon_Timer = 10000; + } else Beacon_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_nexusprince_shaffar(Creature* pCreature) +{ + return new boss_nexusprince_shaffarAI (pCreature); +} + +enum eEnums +{ + SPELL_ARCANE_BOLT = 15254, + SPELL_ETHEREAL_APPRENTICE = 32372 // Summon 18430 +}; + +struct mob_ethereal_beaconAI : public ScriptedAI +{ + mob_ethereal_beaconAI(Creature *c) : ScriptedAI(c) + { + } + + uint32 Apprentice_Timer; + uint32 ArcaneBolt_Timer; + uint32 Check_Timer; + + void KillSelf() + { + me->Kill(me); + } + + void Reset() + { + Apprentice_Timer = DUNGEON_MODE(20000, 10000); + ArcaneBolt_Timer = 1000; + Check_Timer = 1000; + } + + void EnterCombat(Unit * who) + { + // Send Shaffar to fight + Creature* Shaffar = me->FindNearestCreature(NPC_SHAFFAR, 100); + if (!Shaffar || Shaffar->isDead()) + { + KillSelf(); + return; + } + if (!Shaffar->isInCombat()) + Shaffar->AI()->AttackStart(who); + } + + void JustSummoned(Creature *summoned) + { + summoned->AI()->AttackStart(me->getVictim()); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (Check_Timer <= diff) + { + Creature *Shaffar = me->FindNearestCreature(NPC_SHAFFAR, 100); + if (!Shaffar || Shaffar->isDead() || !Shaffar->isInCombat()) + { + KillSelf(); + return; + } + Check_Timer = 1000; + } else Check_Timer -= diff; + + if (ArcaneBolt_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_ARCANE_BOLT); + ArcaneBolt_Timer = 2000 + rand()%2500; + } else ArcaneBolt_Timer -= diff; + + if (Apprentice_Timer <= diff) + { + if (me->IsNonMeleeSpellCasted(false)) + me->InterruptNonMeleeSpells(true); + + DoCast(me, SPELL_ETHEREAL_APPRENTICE, true); + me->ForcedDespawn(); + return; + } else Apprentice_Timer -= diff; + } +}; + +CreatureAI* GetAI_mob_ethereal_beacon(Creature* pCreature) +{ + return new mob_ethereal_beaconAI (pCreature); +} + +enum eEthereal +{ + SPELL_ETHEREAL_APPRENTICE_FIREBOLT = 32369, + SPELL_ETHEREAL_APPRENTICE_FROSTBOLT = 32370 +}; + +struct mob_ethereal_apprenticeAI : public ScriptedAI +{ + mob_ethereal_apprenticeAI(Creature *c) : ScriptedAI(c) {} + + uint32 Cast_Timer; + + bool isFireboltTurn; + + void Reset() + { + Cast_Timer = 3000; + isFireboltTurn = true; + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (Cast_Timer <= diff) + { + if (isFireboltTurn) + { + DoCast(me->getVictim(), SPELL_ETHEREAL_APPRENTICE_FIREBOLT, true); + isFireboltTurn = false; + }else{ + DoCast(me->getVictim(), SPELL_ETHEREAL_APPRENTICE_FROSTBOLT, true); + isFireboltTurn = true; + } + Cast_Timer = 3000; + } else Cast_Timer -= diff; + } +}; + +CreatureAI* GetAI_mob_ethereal_apprentice(Creature* pCreature) +{ + return new mob_ethereal_apprenticeAI (pCreature); +} + +void AddSC_boss_nexusprince_shaffar() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_nexusprince_shaffar"; + newscript->GetAI = &GetAI_boss_nexusprince_shaffar; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_ethereal_beacon"; + newscript->GetAI = &GetAI_mob_ethereal_beacon; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_ethereal_apprentice"; + newscript->GetAI = &GetAI_mob_ethereal_apprentice; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/Outland/Auchindoun/mana_tombs/boss_pandemonius.cpp b/src/server/scripts/Outland/Auchindoun/mana_tombs/boss_pandemonius.cpp new file mode 100644 index 00000000000..51ec2e83b46 --- /dev/null +++ b/src/server/scripts/Outland/Auchindoun/mana_tombs/boss_pandemonius.cpp @@ -0,0 +1,126 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Pandemonius +SD%Complete: 75 +SDComment: Not known how void blast is done (amount of rapid cast seems to be related to players in party). All mobs remaining in surrounding area should aggro when engaged. +SDCategory: Auchindoun, Mana Tombs +EndScriptData */ + +#include "ScriptedPch.h" + +#define SAY_AGGRO_1 -1557008 +#define SAY_AGGRO_2 -1557009 +#define SAY_AGGRO_3 -1557010 + +#define SAY_KILL_1 -1557011 +#define SAY_KILL_2 -1557012 + +#define SAY_DEATH -1557013 + +#define EMOTE_DARK_SHELL -1557014 + +#define SPELL_VOID_BLAST 32325 +#define H_SPELL_VOID_BLAST 38760 +#define SPELL_DARK_SHELL 32358 +#define H_SPELL_DARK_SHELL 38759 + +struct boss_pandemoniusAI : public ScriptedAI +{ + boss_pandemoniusAI(Creature *c) : ScriptedAI(c) + { + } + + uint32 VoidBlast_Timer; + uint32 DarkShell_Timer; + uint32 VoidBlast_Counter; + + void Reset() + { + VoidBlast_Timer = 8000+rand()%15000; + DarkShell_Timer = 20000; + VoidBlast_Counter = 0; + } + + void JustDied(Unit* /*Killer*/) + { + DoScriptText(SAY_DEATH, me); + } + + void KilledUnit(Unit* /*victim*/) + { + DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2), me); + } + + void EnterCombat(Unit * /*who*/) + { + DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3), me); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (VoidBlast_Timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + DoCast(pTarget, SPELL_VOID_BLAST); + VoidBlast_Timer = 500; + ++VoidBlast_Counter; + } + + if (VoidBlast_Counter == 5) + { + VoidBlast_Timer = 15000+rand()%10000; + VoidBlast_Counter = 0; + } + } else VoidBlast_Timer -= diff; + + if (!VoidBlast_Counter) + { + if (DarkShell_Timer <= diff) + { + if (me->IsNonMeleeSpellCasted(false)) + me->InterruptNonMeleeSpells(true); + + DoScriptText(EMOTE_DARK_SHELL, me); + + DoCast(me, SPELL_DARK_SHELL); + DarkShell_Timer = 20000; + } else DarkShell_Timer -= diff; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_pandemonius(Creature* pCreature) +{ + return new boss_pandemoniusAI (pCreature); +} + +void AddSC_boss_pandemonius() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_pandemonius"; + newscript->GetAI = &GetAI_boss_pandemonius; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/Outland/Auchindoun/sethekk_halls/boss_darkweaver_syth.cpp b/src/server/scripts/Outland/Auchindoun/sethekk_halls/boss_darkweaver_syth.cpp new file mode 100644 index 00000000000..9628fa1a98f --- /dev/null +++ b/src/server/scripts/Outland/Auchindoun/sethekk_halls/boss_darkweaver_syth.cpp @@ -0,0 +1,414 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Darkweaver_Syth +SD%Complete: 85 +SDComment: Shock spells/times need more work. Heroic partly implemented. +SDCategory: Auchindoun, Sethekk Halls +EndScriptData */ + +#include "ScriptedPch.h" + +#define SAY_SUMMON -1556000 + +#define SAY_AGGRO_1 -1556001 +#define SAY_AGGRO_2 -1556002 +#define SAY_AGGRO_3 -1556003 + +#define SAY_SLAY_1 -1556004 +#define SAY_SLAY_2 -1556005 + +#define SAY_DEATH -1556006 + +#define SPELL_FROST_SHOCK 21401 //37865 +#define SPELL_FLAME_SHOCK 34354 +#define SPELL_SHADOW_SHOCK 30138 +#define SPELL_ARCANE_SHOCK 37132 + +#define SPELL_CHAIN_LIGHTNING 15659 //15305 + +#define SPELL_SUMMON_SYTH_FIRE 33537 // Spawns 19203 +#define SPELL_SUMMON_SYTH_ARCANE 33538 // Spawns 19205 +#define SPELL_SUMMON_SYTH_FROST 33539 // Spawns 19204 +#define SPELL_SUMMON_SYTH_SHADOW 33540 // Spawns 19206 + +#define SPELL_FLAME_BUFFET DUNGEON_MODE(33526, 38141) +#define SPELL_ARCANE_BUFFET DUNGEON_MODE(33527, 38138) +#define SPELL_FROST_BUFFET DUNGEON_MODE(33528, 38142) +#define SPELL_SHADOW_BUFFET DUNGEON_MODE(33529, 38143) + +struct boss_darkweaver_sythAI : public ScriptedAI +{ + boss_darkweaver_sythAI(Creature *c) : ScriptedAI(c) + { + } + + uint32 flameshock_timer; + uint32 arcaneshock_timer; + uint32 frostshock_timer; + uint32 shadowshock_timer; + uint32 chainlightning_timer; + + bool summon90; + bool summon50; + bool summon10; + + void Reset() + { + flameshock_timer = 2000; + arcaneshock_timer = 4000; + frostshock_timer = 6000; + shadowshock_timer = 8000; + chainlightning_timer = 15000; + + summon90 = false; + summon50 = false; + summon10 = false; + } + + void EnterCombat(Unit * /*who*/) + { + DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3), me); + } + + void JustDied(Unit* /*Killer*/) + { + DoScriptText(SAY_DEATH, me); + } + + void KilledUnit(Unit* /*victim*/) + { + if (rand()%2) + return; + + DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me); + } + + void JustSummoned(Creature *summoned) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + summoned->AI()->AttackStart(pTarget); + } + + void SythSummoning() + { + DoScriptText(SAY_SUMMON, me); + + if (me->IsNonMeleeSpellCasted(false)) + me->InterruptNonMeleeSpells(false); + + DoCast(me, SPELL_SUMMON_SYTH_ARCANE, true); //front + DoCast(me, SPELL_SUMMON_SYTH_FIRE, true); //back + DoCast(me, SPELL_SUMMON_SYTH_FROST, true); //left + DoCast(me, SPELL_SUMMON_SYTH_SHADOW, true); //right + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (((me->GetHealth()*100) / me->GetMaxHealth() < 90) && !summon90) + { + SythSummoning(); + summon90 = true; + } + + if (((me->GetHealth()*100) / me->GetMaxHealth() < 50) && !summon50) + { + SythSummoning(); + summon50 = true; + } + + if (((me->GetHealth()*100) / me->GetMaxHealth() < 10) && !summon10) + { + SythSummoning(); + summon10 = true; + } + + if (flameshock_timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(pTarget, SPELL_FLAME_SHOCK); + + flameshock_timer = 10000 + rand()%5000; + } else flameshock_timer -= diff; + + if (arcaneshock_timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(pTarget, SPELL_ARCANE_SHOCK); + + arcaneshock_timer = 10000 + rand()%5000; + } else arcaneshock_timer -= diff; + + if (frostshock_timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(pTarget, SPELL_FROST_SHOCK); + + frostshock_timer = 10000 + rand()%5000; + } else frostshock_timer -= diff; + + if (shadowshock_timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(pTarget, SPELL_SHADOW_SHOCK); + + shadowshock_timer = 10000 + rand()%5000; + } else shadowshock_timer -= diff; + + if (chainlightning_timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(pTarget, SPELL_CHAIN_LIGHTNING); + + chainlightning_timer = 25000; + } else chainlightning_timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_darkweaver_syth(Creature* pCreature) +{ + return new boss_darkweaver_sythAI (pCreature); +} + +/* ELEMENTALS */ + +struct mob_syth_fireAI : public ScriptedAI +{ + mob_syth_fireAI(Creature *c) : ScriptedAI(c) + { + } + + uint32 flameshock_timer; + uint32 flamebuffet_timer; + + void Reset() + { + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true); + flameshock_timer = 2500; + flamebuffet_timer = 5000; + } + + void EnterCombat(Unit * /*who*/) { } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (flameshock_timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(pTarget, SPELL_FLAME_SHOCK); + + flameshock_timer = 5000; + } else flameshock_timer -= diff; + + if (flamebuffet_timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(pTarget, SPELL_FLAME_BUFFET); + + flamebuffet_timer = 5000; + } else flamebuffet_timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_syth_fire(Creature* pCreature) +{ + return new mob_syth_fireAI (pCreature); +} + +struct mob_syth_arcaneAI : public ScriptedAI +{ + mob_syth_arcaneAI(Creature *c) : ScriptedAI(c) + { + } + + uint32 arcaneshock_timer; + uint32 arcanebuffet_timer; + + void Reset() + { + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, true); + arcaneshock_timer = 2500; + arcanebuffet_timer = 5000; + } + + void EnterCombat(Unit * /*who*/) { } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (arcaneshock_timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(pTarget, SPELL_ARCANE_SHOCK); + + arcaneshock_timer = 5000; + } else arcaneshock_timer -= diff; + + if (arcanebuffet_timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(pTarget, SPELL_ARCANE_BUFFET); + + arcanebuffet_timer = 5000; + } else arcanebuffet_timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_syth_arcane(Creature* pCreature) +{ + return new mob_syth_arcaneAI (pCreature); +} + +struct mob_syth_frostAI : public ScriptedAI +{ + mob_syth_frostAI(Creature *c) : ScriptedAI(c) + { + } + + uint32 frostshock_timer; + uint32 frostbuffet_timer; + + void Reset() + { + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true); + frostshock_timer = 2500; + frostbuffet_timer = 5000; + } + + void EnterCombat(Unit * /*who*/) { } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (frostshock_timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(pTarget, SPELL_FROST_SHOCK); + + frostshock_timer = 5000; + } else frostshock_timer -= diff; + + if (frostbuffet_timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(pTarget, SPELL_FROST_BUFFET); + + frostbuffet_timer = 5000; + } else frostbuffet_timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_syth_frost(Creature* pCreature) +{ + return new mob_syth_frostAI (pCreature); +} + +struct mob_syth_shadowAI : public ScriptedAI +{ + mob_syth_shadowAI(Creature *c) : ScriptedAI(c) + { + } + + uint32 shadowshock_timer; + uint32 shadowbuffet_timer; + + void Reset() + { + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, true); + shadowshock_timer = 2500; + shadowbuffet_timer = 5000; + } + + void EnterCombat(Unit * /*who*/) { } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (shadowshock_timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(pTarget, SPELL_SHADOW_SHOCK); + + shadowshock_timer = 5000; + } else shadowshock_timer -= diff; + + if (shadowbuffet_timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(pTarget, SPELL_SHADOW_BUFFET); + + shadowbuffet_timer = 5000; + } else shadowbuffet_timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_syth_shadow(Creature* pCreature) +{ + return new mob_syth_shadowAI (pCreature); +} + +void AddSC_boss_darkweaver_syth() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_darkweaver_syth"; + newscript->GetAI = &GetAI_boss_darkweaver_syth; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_syth_fire"; + newscript->GetAI = &GetAI_mob_syth_arcane; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_syth_arcane"; + newscript->GetAI = &GetAI_mob_syth_arcane; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_syth_frost"; + newscript->GetAI = &GetAI_mob_syth_frost; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_syth_shadow"; + newscript->GetAI = &GetAI_mob_syth_shadow; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/Outland/Auchindoun/sethekk_halls/boss_tailonking_ikiss.cpp b/src/server/scripts/Outland/Auchindoun/sethekk_halls/boss_tailonking_ikiss.cpp new file mode 100644 index 00000000000..32b97293ca3 --- /dev/null +++ b/src/server/scripts/Outland/Auchindoun/sethekk_halls/boss_tailonking_ikiss.cpp @@ -0,0 +1,213 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Talon_King_Ikiss +SD%Complete: 80 +SDComment: Heroic supported. Some details missing, but most are spell related. +SDCategory: Auchindoun, Sethekk Halls +EndScriptData */ + +#include "ScriptedPch.h" +#include "sethekk_halls.h" + +#define SAY_INTRO -1556007 + +#define SAY_AGGRO_1 -1556008 +#define SAY_AGGRO_2 -1556009 +#define SAY_AGGRO_3 -1556010 + +#define SAY_SLAY_1 -1556011 +#define SAY_SLAY_2 -1556012 +#define SAY_DEATH -1556013 +#define EMOTE_ARCANE_EXP -1556015 + +#define SPELL_BLINK 38194 +#define SPELL_BLINK_TELEPORT 38203 +#define SPELL_MANA_SHIELD 38151 +#define SPELL_ARCANE_BUBBLE 9438 +#define H_SPELL_SLOW 35032 + +#define SPELL_POLYMORPH 38245 +#define H_SPELL_POLYMORPH 43309 + +#define SPELL_ARCANE_VOLLEY 35059 +#define H_SPELL_ARCANE_VOLLEY 40424 + +#define SPELL_ARCANE_EXPLOSION 38197 +#define H_SPELL_ARCANE_EXPLOSION 40425 + +struct boss_talon_king_ikissAI : public ScriptedAI +{ + boss_talon_king_ikissAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint32 ArcaneVolley_Timer; + uint32 Sheep_Timer; + uint32 Blink_Timer; + uint32 Slow_Timer; + + bool ManaShield; + bool Blink; + bool Intro; + + void Reset() + { + ArcaneVolley_Timer = 5000; + Sheep_Timer = 8000; + Blink_Timer = 35000; + Slow_Timer = 15000+rand()%15000; + Blink = false; + Intro = false; + ManaShield = false; + } + + void MoveInLineOfSight(Unit *who) + { + if (!me->getVictim() && who->isTargetableForAttack() && (me->IsHostileTo(who)) && who->isInAccessiblePlaceFor(me)) + { + if (!Intro && me->IsWithinDistInMap(who, 100)) + { + Intro = true; + DoScriptText(SAY_INTRO, me); + } + + if (!me->canFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) + return; + + float attackRadius = me->GetAttackDistance(who); + if (me->IsWithinDistInMap(who, attackRadius) && me->IsWithinLOSInMap(who)) + { + //who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); + AttackStart(who); + } + } + } + + void EnterCombat(Unit * /*who*/) + { + DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3), me); + } + + void JustDied(Unit* /*Killer*/) + { + DoScriptText(SAY_DEATH, me); + + if (pInstance) + pInstance->SetData(DATA_IKISSDOOREVENT, DONE); + } + + void KilledUnit(Unit* /*victim*/) + { + DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (Blink) + { + DoCast(me, SPELL_ARCANE_EXPLOSION); + DoCast(me, SPELL_ARCANE_BUBBLE, true); + Blink = false; + } + + if (ArcaneVolley_Timer <= diff) + { + DoCast(me, SPELL_ARCANE_VOLLEY); + ArcaneVolley_Timer = 7000+rand()%5000; + } else ArcaneVolley_Timer -= diff; + + if (Sheep_Timer <= diff) + { + Unit *pTarget; + + //second top aggro target in normal, random target in heroic correct? + if (IsHeroic()) + pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); + else + pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO,1); + + if (pTarget) + DoCast(pTarget, SPELL_POLYMORPH); + Sheep_Timer = 15000+rand()%2500; + } else Sheep_Timer -= diff; + + //may not be correct time to cast + if (!ManaShield && ((me->GetHealth()*100) / me->GetMaxHealth() < 20)) + { + DoCast(me, SPELL_MANA_SHIELD); + ManaShield = true; + } + + if (IsHeroic()) + { + if (Slow_Timer <= diff) + { + DoCast(me, H_SPELL_SLOW); + Slow_Timer = 15000+rand()%25000; + } else Slow_Timer -= diff; + } + + if (Blink_Timer <= diff) + { + DoScriptText(EMOTE_ARCANE_EXP, me); + + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + { + if (me->IsNonMeleeSpellCasted(false)) + me->InterruptNonMeleeSpells(false); + + //Spell doesn't work, but we use for visual effect at least + DoCast(pTarget, SPELL_BLINK); + + float X = pTarget->GetPositionX(); + float Y = pTarget->GetPositionY(); + float Z = pTarget->GetPositionZ(); + + DoTeleportTo(X,Y,Z); + + DoCast(pTarget, SPELL_BLINK_TELEPORT); + Blink = true; + } + Blink_Timer = 35000+rand()%5000; + } else Blink_Timer -= diff; + + if (!Blink) + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_talon_king_ikiss(Creature* pCreature) +{ + return new boss_talon_king_ikissAI (pCreature); +} + +void AddSC_boss_talon_king_ikiss() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_talon_king_ikiss"; + newscript->GetAI = &GetAI_boss_talon_king_ikiss; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/Outland/Auchindoun/sethekk_halls/instance_sethekk_halls.cpp b/src/server/scripts/Outland/Auchindoun/sethekk_halls/instance_sethekk_halls.cpp new file mode 100644 index 00000000000..ee27da3cff5 --- /dev/null +++ b/src/server/scripts/Outland/Auchindoun/sethekk_halls/instance_sethekk_halls.cpp @@ -0,0 +1,91 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance - Sethekk Halls +SD%Complete: 50 +SDComment: Instance Data for Sethekk Halls instance +SDCategory: Auchindoun, Sethekk Halls +EndScriptData */ + +#include "ScriptedPch.h" +#include "sethekk_halls.h" + +enum eEnums +{ + NPC_ANZU = 23035, + IKISS_DOOR = 177203, +}; + +struct instance_sethekk_halls : public ScriptedInstance +{ + instance_sethekk_halls(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 AnzuEncounter; + uint64 m_uiIkissDoorGUID; + + void Initialize() + { + AnzuEncounter = NOT_STARTED; + m_uiIkissDoorGUID = 0; + } + + void OnCreatureCreate(Creature* pCreature, bool /*add*/) + { + if (pCreature->GetEntry() == NPC_ANZU) + { + if (AnzuEncounter >= IN_PROGRESS) + pCreature->DisappearAndDie(); + else + AnzuEncounter = IN_PROGRESS; + } + } + + void OnGameObjectCreate(GameObject* pGo, bool /*add*/) + { + if (pGo->GetEntry() == IKISS_DOOR) + m_uiIkissDoorGUID = pGo->GetGUID(); + } + + void SetData(uint32 type, uint32 data) + { + switch(type) + { + case DATA_IKISSDOOREVENT: + if (data == DONE) + DoUseDoorOrButton(m_uiIkissDoorGUID,DAY*IN_MILISECONDS); + break; + case TYPE_ANZU_ENCOUNTER: + AnzuEncounter = data; + break; + } + } +}; + +InstanceData* GetInstanceData_instance_sethekk_halls(Map* pMap) +{ + return new instance_sethekk_halls(pMap); +} + +void AddSC_instance_sethekk_halls() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_sethekk_halls"; + newscript->GetInstanceData = &GetInstanceData_instance_sethekk_halls; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/Outland/Auchindoun/sethekk_halls/sethekk_halls.h b/src/server/scripts/Outland/Auchindoun/sethekk_halls/sethekk_halls.h new file mode 100644 index 00000000000..79a6cd4952d --- /dev/null +++ b/src/server/scripts/Outland/Auchindoun/sethekk_halls/sethekk_halls.h @@ -0,0 +1,14 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_SETHEKK_HALLS_H +#define DEF_SETHEKK_HALLS_H + +enum eTypes +{ + DATA_IKISSDOOREVENT = 1, + TYPE_ANZU_ENCOUNTER = 2, +}; +#endif + diff --git a/src/server/scripts/Outland/Auchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp b/src/server/scripts/Outland/Auchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp new file mode 100644 index 00000000000..2bb6a717a5a --- /dev/null +++ b/src/server/scripts/Outland/Auchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp @@ -0,0 +1,206 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Ambassador_Hellmaw +SD%Complete: 80 +SDComment: Enrage spell missing/not known +SDCategory: Auchindoun, Shadow Labyrinth +EndScriptData */ + +#include "ScriptedPch.h" +#include "ScriptedEscortAI.h" +#include "shadow_labyrinth.h" + +enum eEnums +{ + SAY_INTRO = -1555000, + SAY_AGGRO1 = -1555001, + SAY_AGGRO2 = -1555002, + SAY_AGGRO3 = -1555003, + SAY_HELP = -1555004, + SAY_SLAY1 = -1555005, + SAY_SLAY2 = -1555006, + SAY_DEATH = -1555007, + + SPELL_BANISH = 30231, + SPELL_CORROSIVE_ACID = 33551, + SPELL_FEAR = 33547, + SPELL_ENRAGE = 34970 +}; + +struct boss_ambassador_hellmawAI : public npc_escortAI +{ + boss_ambassador_hellmawAI(Creature* pCreature) : npc_escortAI(pCreature) + { + m_pInstance = pCreature->GetInstanceData(); + } + + ScriptedInstance* m_pInstance; + + uint32 EventCheck_Timer; + uint32 CorrosiveAcid_Timer; + uint32 Fear_Timer; + uint32 Enrage_Timer; + bool Intro; + bool IsBanished; + bool Enraged; + + void Reset() + { + EventCheck_Timer = 5000; + CorrosiveAcid_Timer = 5000 + rand()%5000; + Fear_Timer = 25000 + rand()%5000; + Enrage_Timer = 180000; + Intro = false; + IsBanished = true; + Enraged = false; + + if (m_pInstance && me->isAlive()) + { + if (m_pInstance->GetData(TYPE_OVERSEER) != DONE) + DoCast(me, SPELL_BANISH, true); + } + } + + void JustReachedHome() + { + if (m_pInstance) + m_pInstance->SetData(TYPE_HELLMAW, FAIL); + } + + void MoveInLineOfSight(Unit* pWho) + { + if (me->HasAura(SPELL_BANISH)) + return; + + npc_escortAI::MoveInLineOfSight(pWho); + } + + void WaypointReached(uint32 /*i*/) + { + } + + void DoIntro() + { + if (me->HasAura(SPELL_BANISH)) + me->RemoveAurasDueToSpell(SPELL_BANISH); + + IsBanished = false; + Intro = true; + + if (m_pInstance) + { + if (m_pInstance->GetData(TYPE_HELLMAW) != FAIL) + { + DoScriptText(SAY_INTRO, me); + Start(true, false, 0, NULL, false, true); + } + + m_pInstance->SetData(TYPE_HELLMAW, IN_PROGRESS); + } + } + + void EnterCombat(Unit * /*who*/) + { + DoScriptText(RAND(SAY_AGGRO1,SAY_AGGRO2,SAY_AGGRO3), me); + } + + void KilledUnit(Unit * /*victim*/) + { + DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me); + } + + void JustDied(Unit * /*victim*/) + { + DoScriptText(SAY_DEATH, me); + + if (m_pInstance) + m_pInstance->SetData(TYPE_HELLMAW, DONE); + } + + void UpdateAI(const uint32 diff) + { + if (!Intro && !HasEscortState(STATE_ESCORT_ESCORTING)) + { + if (EventCheck_Timer <= diff) + { + if (m_pInstance) + { + if (m_pInstance->GetData(TYPE_OVERSEER) == DONE) + { + DoIntro(); + return; + } + } + EventCheck_Timer = 5000; + return; + } + else + { + EventCheck_Timer -= diff; + return; + } + } + + npc_escortAI::UpdateAI(diff); + + if (!UpdateVictim()) + return; + + if (me->HasAura(SPELL_BANISH, 0)) + { + EnterEvadeMode(); + return; + } + + if (CorrosiveAcid_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_CORROSIVE_ACID); + CorrosiveAcid_Timer = 15000 + rand()%10000; + } else CorrosiveAcid_Timer -= diff; + + if (Fear_Timer <= diff) + { + DoCast(me, SPELL_FEAR); + Fear_Timer = 20000 + rand()%15000; + } else Fear_Timer -= diff; + + if (IsHeroic()) + { + if (!Enraged && Enrage_Timer <= diff) + { + DoCast(me, SPELL_ENRAGE); + Enraged = true; + } else Enrage_Timer -= diff; + } + } +}; + +CreatureAI* GetAI_boss_ambassador_hellmaw(Creature* pCreature) +{ + return new boss_ambassador_hellmawAI(pCreature); +} + +void AddSC_boss_ambassador_hellmaw() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_ambassador_hellmaw"; + newscript->GetAI = &GetAI_boss_ambassador_hellmaw; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/Outland/Auchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp b/src/server/scripts/Outland/Auchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp new file mode 100644 index 00000000000..52c60ae0d0e --- /dev/null +++ b/src/server/scripts/Outland/Auchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp @@ -0,0 +1,169 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Blackheart_the_Inciter +SD%Complete: 75 +SDComment: Incite Chaos not functional since core lacks Mind Control support +SDCategory: Auchindoun, Shadow Labyrinth +EndScriptData */ + +#include "ScriptedPch.h" +#include "shadow_labyrinth.h" + +#define SPELL_INCITE_CHAOS 33676 +#define SPELL_INCITE_CHAOS_B 33684 //debuff applied to each member of party +#define SPELL_CHARGE 33709 +#define SPELL_WAR_STOMP 33707 + +#define SAY_INTRO1 -1555008 //not used +#define SAY_INTRO2 -1555009 //not used +#define SAY_INTRO3 -1555010 //not used +#define SAY_AGGRO1 -1555011 +#define SAY_AGGRO2 -1555012 +#define SAY_AGGRO3 -1555013 +#define SAY_SLAY1 -1555014 +#define SAY_SLAY2 -1555015 +#define SAY_HELP -1555016 //not used +#define SAY_DEATH -1555017 + +//below, not used +#define SAY2_INTRO1 -1555018 +#define SAY2_INTRO2 -1555019 +#define SAY2_INTRO3 -1555020 +#define SAY2_AGGRO1 -1555021 +#define SAY2_AGGRO2 -1555022 +#define SAY2_AGGRO3 -1555023 +#define SAY2_SLAY1 -1555024 +#define SAY2_SLAY2 -1555025 +#define SAY2_HELP -1555026 +#define SAY2_DEATH -1555027 + +struct boss_blackheart_the_inciterAI : public ScriptedAI +{ + boss_blackheart_the_inciterAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance *pInstance; + + bool InciteChaos; + uint32 InciteChaos_Timer; + uint32 InciteChaosWait_Timer; + uint32 Charge_Timer; + uint32 Knockback_Timer; + + void Reset() + { + InciteChaos = false; + InciteChaos_Timer = 20000; + InciteChaosWait_Timer = 15000; + Charge_Timer = 5000; + Knockback_Timer = 15000; + + if (pInstance) + pInstance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, NOT_STARTED); + } + + void KilledUnit(Unit * /*victim*/) + { + DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me); + } + + void JustDied(Unit * /*victim*/) + { + DoScriptText(SAY_DEATH, me); + + if (pInstance) + pInstance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, DONE); + } + + void EnterCombat(Unit * /*who*/) + { + DoScriptText(RAND(SAY_AGGRO1,SAY_AGGRO2,SAY_AGGRO3), me); + + if (pInstance) + pInstance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, IN_PROGRESS); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + if (InciteChaos) + { + if (InciteChaosWait_Timer <= diff) + { + InciteChaos = false; + InciteChaosWait_Timer = 15000; + } else InciteChaosWait_Timer -= diff; + + return; + } + + if (InciteChaos_Timer <= diff) + { + DoCast(me, SPELL_INCITE_CHAOS); + + std::list t_list = me->getThreatManager().getThreatList(); + for (std::list::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) + { + Unit *pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid()); + if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER) + pTarget->CastSpell(pTarget,SPELL_INCITE_CHAOS_B,true); + } + + DoResetThreat(); + InciteChaos = true; + InciteChaos_Timer = 40000; + return; + } else InciteChaos_Timer -= diff; + + //Charge_Timer + if (Charge_Timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(pTarget, SPELL_CHARGE); + Charge_Timer = 15000 + rand()%10000; + } else Charge_Timer -= diff; + + //Knockback_Timer + if (Knockback_Timer <= diff) + { + DoCast(me, SPELL_WAR_STOMP); + Knockback_Timer = 18000 + rand()%6000; + } else Knockback_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_blackheart_the_inciter(Creature* pCreature) +{ + return new boss_blackheart_the_inciterAI (pCreature); +} + +void AddSC_boss_blackheart_the_inciter() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_blackheart_the_inciter"; + newscript->GetAI = &GetAI_boss_blackheart_the_inciter; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/Outland/Auchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp b/src/server/scripts/Outland/Auchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp new file mode 100644 index 00000000000..8b63b765b47 --- /dev/null +++ b/src/server/scripts/Outland/Auchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp @@ -0,0 +1,313 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Grandmaster_Vorpil +SD%Complete: 100 +SDComment: +SDCategory: Auchindoun, Shadow Labyrinth +EndScriptData */ + +#include "ScriptedPch.h" +#include "shadow_labyrinth.h" + +#define SAY_INTRO -1555028 +#define SAY_AGGRO1 -1555029 +#define SAY_AGGRO2 -1555030 +#define SAY_AGGRO3 -1555031 +#define SAY_HELP -1555032 +#define SAY_SLAY1 -1555033 +#define SAY_SLAY2 -1555034 +#define SAY_DEATH -1555035 + +#define SPELL_RAIN_OF_FIRE 33617 +#define H_SPELL_RAIN_OF_FIRE 39363 + +#define SPELL_DRAW_SHADOWS 33563 +#define SPELL_SHADOWBOLT_VOLLEY 33841 +#define SPELL_BANISH 38791 + +#define MOB_VOID_TRAVELER 19226 +#define SPELL_SACRIFICE 33587 +#define SPELL_SHADOW_NOVA 33846 +#define SPELL_EMPOWERING_SHADOWS 33783 +#define H_SPELL_EMPOWERING_SHADOWS 39364 + +#define MOB_VOID_PORTAL 19224 +#define SPELL_VOID_PORTAL_VISUAL 33569 + +float VorpilPosition[3] = {-252.8820,-264.3030,17.1}; + +float VoidPortalCoords[5][3] = +{ + {-283.5894, -239.5718, 12.7}, + {-306.5853, -258.4539, 12.7}, + {-295.8789, -269.0899, 12.7}, + {-209.3401, -262.7564, 17.1}, + {-261.4533, -297.3298, 17.1} +}; + +struct mob_voidtravelerAI : public ScriptedAI +{ + mob_voidtravelerAI(Creature *c) : ScriptedAI(c) + { + } + + uint64 VorpilGUID; + uint32 move; + bool sacrificed; + + void Reset() + { + VorpilGUID = 0; + move = 0; + sacrificed = false; + } + + void EnterCombat(Unit * /*who*/){} + + void UpdateAI(const uint32 diff) + { + if (!VorpilGUID) + { + me->Kill(me); + return; + } + if (move <= diff) + { + Creature *Vorpil = Unit::GetCreature(*me, VorpilGUID); + if (!Vorpil) + { + VorpilGUID = 0; + return; + } + + if (sacrificed) + { + me->AddAura(DUNGEON_MODE(SPELL_EMPOWERING_SHADOWS, H_SPELL_EMPOWERING_SHADOWS), Vorpil); + Vorpil->SetHealth(Vorpil->GetHealth() + Vorpil->GetMaxHealth()/25); + DoCast(me, SPELL_SHADOW_NOVA, true); + me->Kill(me); + return; + } + me->GetMotionMaster()->MoveFollow(Vorpil,0,0); + if (me->IsWithinDist(Vorpil, 3)) + { + DoCast(me, SPELL_SACRIFICE, false); + sacrificed = true; + move = 500; + return; + } + if (!Vorpil->isInCombat() || Vorpil->isDead()) + { + me->Kill(me); + return; + } + move = 1000; + } else move -= diff; + } +}; +CreatureAI* GetAI_mob_voidtraveler(Creature* pCreature) +{ + return new mob_voidtravelerAI (pCreature); +} + +struct boss_grandmaster_vorpilAI : public ScriptedAI +{ + boss_grandmaster_vorpilAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + Intro = false; + } + + ScriptedInstance *pInstance; + bool Intro, HelpYell; + bool sumportals; + + uint32 ShadowBoltVolley_Timer; + uint32 DrawShadows_Timer; + uint32 summonTraveler_Timer; + uint32 banish_Timer; + uint64 PortalsGuid[5]; + + void Reset() + { + ShadowBoltVolley_Timer = 7000 + rand()%7000; + DrawShadows_Timer = 45000; + summonTraveler_Timer = 90000; + banish_Timer = 17000; + HelpYell = false; + destroyPortals(); + + if (pInstance) + pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, NOT_STARTED); + } + + void summonPortals() + { + if (!sumportals) + { + for (uint8 i = 0; i < 5; ++i) + { + Creature *Portal = NULL; + Portal = me->SummonCreature(MOB_VOID_PORTAL,VoidPortalCoords[i][0],VoidPortalCoords[i][1],VoidPortalCoords[i][2],0,TEMPSUMMON_CORPSE_DESPAWN,3000000); + if (Portal) + { + PortalsGuid[i] = Portal->GetGUID(); + Portal->CastSpell(Portal,SPELL_VOID_PORTAL_VISUAL,false); + } + } + sumportals = true; + summonTraveler_Timer = 5000; + } + } + + void destroyPortals() + { + if (sumportals) + { + for (uint8 i = 0; i < 5; ++i) + { + Unit *Portal = Unit::GetUnit((*me), PortalsGuid[i]); + if (Portal && Portal->isAlive()) + Portal->DealDamage(Portal, Portal->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + PortalsGuid[i] = 0; + } + sumportals = false; + } + } + + void spawnVoidTraveler() + { + int pos = urand(0,4); + me->SummonCreature(MOB_VOID_TRAVELER,VoidPortalCoords[pos][0],VoidPortalCoords[pos][1],VoidPortalCoords[pos][2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,5000); + if (!HelpYell) + { + DoScriptText(SAY_HELP, me); + HelpYell = true; + } + } + + void JustSummoned(Creature *summoned) + { + if (summoned && summoned->GetEntry() == MOB_VOID_TRAVELER) + CAST_AI(mob_voidtravelerAI, summoned->AI())->VorpilGUID = me->GetGUID(); + } + + void KilledUnit(Unit * /*victim*/) + { + DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me); + } + + void JustDied(Unit * /*victim*/) + { + DoScriptText(SAY_DEATH, me); + destroyPortals(); + + if (pInstance) + pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, DONE); + } + + void EnterCombat(Unit * /*who*/) + { + DoScriptText(RAND(SAY_AGGRO1,SAY_AGGRO2,SAY_AGGRO3), me); + summonPortals(); + + if (pInstance) + pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, IN_PROGRESS); + } + + void MoveInLineOfSight(Unit *who) + { + ScriptedAI::MoveInLineOfSight(who); + + if (!Intro && me->IsWithinLOSInMap(who)&& me->IsWithinDistInMap(who, 100) && me->IsHostileTo(who)) + { + DoScriptText(SAY_INTRO, me); + Intro = true; + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (ShadowBoltVolley_Timer <= diff) + { + DoCast(me, SPELL_SHADOWBOLT_VOLLEY); + ShadowBoltVolley_Timer = 15000 + rand()%15000; + } else ShadowBoltVolley_Timer -= diff; + + if (IsHeroic() && banish_Timer <= diff) + { + Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0,30,false); + if (pTarget) + { + DoCast(pTarget, SPELL_BANISH); + banish_Timer = 16000; + } + } else banish_Timer -= diff; + + if (DrawShadows_Timer <= diff) + { + Map* pMap = me->GetMap(); + Map::PlayerList const &PlayerList = pMap->GetPlayers(); + for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) + if (Player* i_pl = i->getSource()) + if (i_pl->isAlive() && !i_pl->HasAura(SPELL_BANISH)) + i_pl->TeleportTo(me->GetMapId(), VorpilPosition[0],VorpilPosition[1],VorpilPosition[2], 0, TELE_TO_NOT_LEAVE_COMBAT); + + me->GetMap()->CreatureRelocation(me, VorpilPosition[0],VorpilPosition[1],VorpilPosition[2],0.0f); + DoCast(me, SPELL_DRAW_SHADOWS, true); + + DoCast(me, SPELL_RAIN_OF_FIRE); + + ShadowBoltVolley_Timer = 6000; + DrawShadows_Timer = 30000; + } else DrawShadows_Timer -= diff; + + if (summonTraveler_Timer <= diff) + { + spawnVoidTraveler(); + summonTraveler_Timer = 10000; + //enrage at 20% + if ((me->GetHealth()*5) < me->GetMaxHealth()) + summonTraveler_Timer = 5000; + } else summonTraveler_Timer -=diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_grandmaster_vorpil(Creature* pCreature) +{ + return new boss_grandmaster_vorpilAI (pCreature); +} + +void AddSC_boss_grandmaster_vorpil() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_grandmaster_vorpil"; + newscript->GetAI = &GetAI_boss_grandmaster_vorpil; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_voidtraveler"; + newscript->GetAI = &GetAI_mob_voidtraveler; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/Outland/Auchindoun/shadow_labyrinth/boss_murmur.cpp b/src/server/scripts/Outland/Auchindoun/shadow_labyrinth/boss_murmur.cpp new file mode 100644 index 00000000000..14bf249c3b5 --- /dev/null +++ b/src/server/scripts/Outland/Auchindoun/shadow_labyrinth/boss_murmur.cpp @@ -0,0 +1,205 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Murmur +SD%Complete: 90 +SDComment: Timers may be incorrect +SDCategory: Auchindoun, Shadow Labyrinth +EndScriptData */ + +#include "ScriptedPch.h" +#include "shadow_labyrinth.h" + +#define EMOTE_SONIC_BOOM -1555036 + +#define SPELL_SONIC_BOOM_CAST DUNGEON_MODE(33923, 38796) +#define SPELL_SONIC_BOOM_EFFECT DUNGEON_MODE(33666, 38795) +#define SPELL_RESONANCE 33657 +#define SPELL_MURMURS_TOUCH DUNGEON_MODE(33711, 38794) +#define SPELL_MAGNETIC_PULL 33689 +#define SPELL_SONIC_SHOCK 38797 +#define SPELL_THUNDERING_STORM 39365 + +struct boss_murmurAI : public ScriptedAI +{ + boss_murmurAI(Creature *c) : ScriptedAI(c) + { + SetCombatMovement(false); + } + + uint32 SonicBoom_Timer; + uint32 MurmursTouch_Timer; + uint32 Resonance_Timer; + uint32 MagneticPull_Timer; + uint32 SonicShock_Timer; + uint32 ThunderingStorm_Timer; + bool SonicBoom; + + void Reset() + { + SonicBoom_Timer = 30000; + MurmursTouch_Timer = 8000 + rand()%12000; + Resonance_Timer = 5000; + MagneticPull_Timer = 15000 + rand()%15000; + ThunderingStorm_Timer = 15000; + SonicShock_Timer = 10000; + SonicBoom = false; + + //database should have `RegenHealth`=0 to prevent regen + uint32 hp = (me->GetMaxHealth()*40)/100; + if (hp) me->SetHealth(hp); + me->ResetPlayerDamageReq(); + } + + void SonicBoomEffect() + { + std::list t_list = me->getThreatManager().getThreatList(); + for (std::list::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) + { + Unit *pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid()); + if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER) + { + //Not do anything without aura, spell can be resisted! + if (pTarget->HasAura(SPELL_SONIC_BOOM_CAST) && me->IsWithinDistInMap(pTarget, 34.0f)) + { + //This will be wrong calculation. Also, comments suggest it must deal damage + pTarget->SetHealth(uint32(pTarget->GetMaxHealth() - pTarget->GetMaxHealth() * 0.8)); + } + } + } + } + + void EnterCombat(Unit * /*who*/) { } + + // Sonic Boom instant damage (needs core fix instead of this) + void SpellHitTarget(Unit *pTarget, const SpellEntry *spell) + { + if (pTarget && pTarget->isAlive() && spell && spell->Id == uint32(SPELL_SONIC_BOOM_EFFECT)) + me->DealDamage(pTarget,(pTarget->GetHealth()*90)/100,NULL,SPELL_DIRECT_DAMAGE,SPELL_SCHOOL_MASK_NATURE,spell); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target or casting + if (!UpdateVictim() || me->IsNonMeleeSpellCasted(false)) + return; + + // Sonic Boom + if (SonicBoom) + { + DoCast(me, SPELL_SONIC_BOOM_EFFECT, true); + SonicBoomEffect(); + + SonicBoom = false; + Resonance_Timer = 1500; + } + if (SonicBoom_Timer <= diff) + { + DoScriptText(EMOTE_SONIC_BOOM, me); + DoCast(me, SPELL_SONIC_BOOM_CAST); + SonicBoom_Timer = 30000; + SonicBoom = true; + return; + } else SonicBoom_Timer -= diff; + + // Murmur's Touch + if (MurmursTouch_Timer <= diff) + { + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0,80,true)) + DoCast(pTarget, SPELL_MURMURS_TOUCH); + MurmursTouch_Timer = 25000 + rand()%10000; + } else MurmursTouch_Timer -= diff; + + // Resonance + if (!SonicBoom && !(me->IsWithinMeleeRange(me->getVictim()))) + { + if (Resonance_Timer <= diff) + { + DoCast(me, SPELL_RESONANCE); + Resonance_Timer = 5000; + } else Resonance_Timer -= diff; + } + + // Magnetic Pull + if (MagneticPull_Timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (pTarget->GetTypeId() == TYPEID_PLAYER && pTarget->isAlive()) + { + DoCast(pTarget, SPELL_MAGNETIC_PULL); + MagneticPull_Timer = 15000+rand()%15000; + return; + } + MagneticPull_Timer = 500; + } else MagneticPull_Timer -= diff; + + if (IsHeroic()) + { + // Thundering Storm + if (ThunderingStorm_Timer <= diff) + { + std::list& m_threatlist = me->getThreatManager().getThreatList(); + for (std::list::const_iterator i = m_threatlist.begin(); i != m_threatlist.end(); ++i) + if (Unit *pTarget = Unit::GetUnit((*me),(*i)->getUnitGuid())) + if (pTarget->isAlive() && !me->IsWithinDist(pTarget, 35, false)) + DoCast(pTarget, SPELL_THUNDERING_STORM, true); + ThunderingStorm_Timer = 15000; + } else ThunderingStorm_Timer -= diff; + + // Sonic Shock + if (SonicShock_Timer <= diff) + { + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0,20,false)) + if (pTarget->isAlive()) + DoCast(pTarget, SPELL_SONIC_SHOCK); + SonicShock_Timer = 10000+rand()%10000; + } else SonicShock_Timer -= diff; + } + + // Select nearest most aggro target if top aggro too far + if (!me->isAttackReady()) + return; + if (!me->IsWithinMeleeRange(me->getVictim())) + { + std::list& m_threatlist = me->getThreatManager().getThreatList(); + for (std::list::const_iterator i = m_threatlist.begin(); i != m_threatlist.end(); ++i) + if (Unit *pTarget = Unit::GetUnit((*me),(*i)->getUnitGuid())) + if (pTarget->isAlive() && me->IsWithinMeleeRange(pTarget)) + { + me->TauntApply(pTarget); + break; + } + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_murmur(Creature* pCreature) +{ + return new boss_murmurAI (pCreature); +} + +void AddSC_boss_murmur() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_murmur"; + newscript->GetAI = &GetAI_boss_murmur; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/Outland/Auchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp b/src/server/scripts/Outland/Auchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp new file mode 100644 index 00000000000..78340e5e132 --- /dev/null +++ b/src/server/scripts/Outland/Auchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp @@ -0,0 +1,227 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Shadow_Labyrinth +SD%Complete: 85 +SDComment: Some cleanup left along with save +SDCategory: Auchindoun, Shadow Labyrinth +EndScriptData */ + +#include "ScriptedPch.h" +#include "shadow_labyrinth.h" + +#define MAX_ENCOUNTER 5 + +#define REFECTORY_DOOR 183296 //door opened when blackheart the inciter dies +#define SCREAMING_HALL_DOOR 183295 //door opened when grandmaster vorpil dies + +/* Shadow Labyrinth encounters: +1 - Ambassador Hellmaw event +2 - Blackheart the Inciter event +3 - Grandmaster Vorpil event +4 - Murmur event +*/ + +struct instance_shadow_labyrinth : public ScriptedInstance +{ + instance_shadow_labyrinth(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + std::string str_data; + + uint64 m_uiRefectoryDoorGUID; + uint64 m_uiScreamingHallDoorGUID; + + uint64 m_uiGrandmasterVorpil; + uint32 m_uiFelOverseerCount; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + m_uiRefectoryDoorGUID = 0; + m_uiScreamingHallDoorGUID = 0; + + m_uiGrandmasterVorpil = 0; + m_uiFelOverseerCount = 0; + } + + bool IsEncounterInProgress() const + { + for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) return true; + + return false; + } + + void OnGameObjectCreate(GameObject* pGo, bool /*add*/) + { + switch(pGo->GetEntry()) + { + case REFECTORY_DOOR: + m_uiRefectoryDoorGUID = pGo->GetGUID(); + if (m_auiEncounter[2] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case SCREAMING_HALL_DOOR: + m_uiScreamingHallDoorGUID = pGo->GetGUID(); + if (m_auiEncounter[3] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + } + } + + void OnCreatureCreate(Creature* pCreature, bool /*add*/) + { + switch(pCreature->GetEntry()) + { + case 18732: + m_uiGrandmasterVorpil = pCreature->GetGUID(); + break; + case 18796: + if (pCreature->isAlive()) + { + ++m_uiFelOverseerCount; + debug_log("TSCR: Shadow Labyrinth: counting %u Fel Overseers.",m_uiFelOverseerCount); + } + break; + } + } + + void SetData(uint32 type, uint32 uiData) + { + switch(type) + { + case TYPE_HELLMAW: + m_auiEncounter[0] = uiData; + break; + + case TYPE_OVERSEER: + if (uiData != DONE) + { + error_log("TSCR: Shadow Labyrinth: TYPE_OVERSEER did not expect other data than DONE"); + return; + } + if (m_uiFelOverseerCount) + { + --m_uiFelOverseerCount; + + if (m_uiFelOverseerCount) + debug_log("TSCR: Shadow Labyrinth: %u Fel Overseers left to kill.",m_uiFelOverseerCount); + else + { + m_auiEncounter[1] = DONE; + debug_log("TSCR: Shadow Labyrinth: TYPE_OVERSEER == DONE"); + } + } + break; + + case DATA_BLACKHEARTTHEINCITEREVENT: + if (uiData == DONE) + DoUseDoorOrButton(m_uiRefectoryDoorGUID); + m_auiEncounter[2] = uiData; + break; + + case DATA_GRANDMASTERVORPILEVENT: + if (uiData == DONE) + DoUseDoorOrButton(m_uiScreamingHallDoorGUID); + m_auiEncounter[3] = uiData; + break; + + case DATA_MURMUREVENT: + m_auiEncounter[4] = uiData; + break; + } + + if (uiData == DONE) + { + if (type == TYPE_OVERSEER && m_uiFelOverseerCount != 0) + return; + + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " + << m_auiEncounter[2] << " " << m_auiEncounter[3] << " " << m_auiEncounter[4]; + + str_data = saveStream.str(); + + SaveToDB(); + OUT_SAVE_INST_DATA_COMPLETE; + } + } + + uint32 GetData(uint32 type) + { + switch(type) + { + case TYPE_HELLMAW: return m_auiEncounter[0]; + case TYPE_OVERSEER: return m_auiEncounter[1]; + case DATA_GRANDMASTERVORPILEVENT: return m_auiEncounter[3]; + case DATA_MURMUREVENT: return m_auiEncounter[4]; + } + return false; + } + + uint64 GetData64(uint32 identifier) + { + if (identifier == DATA_GRANDMASTERVORPIL) + return m_uiGrandmasterVorpil; + + return 0; + } + + std::string GetSaveData() + { + return str_data; + } + + void Load(const char* in) + { + if (!in) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(in); + + std::istringstream loadStream(in); + loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3] >> m_auiEncounter[4]; + + for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) + m_auiEncounter[i] = NOT_STARTED; + + OUT_LOAD_INST_DATA_COMPLETE; + } +}; + +InstanceData* GetInstanceData_instance_shadow_labyrinth(Map* pMap) +{ + return new instance_shadow_labyrinth(pMap); +} + +void AddSC_instance_shadow_labyrinth() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_shadow_labyrinth"; + newscript->GetInstanceData = &GetInstanceData_instance_shadow_labyrinth; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/Outland/Auchindoun/shadow_labyrinth/shadow_labyrinth.h b/src/server/scripts/Outland/Auchindoun/shadow_labyrinth/shadow_labyrinth.h new file mode 100644 index 00000000000..a78955368bf --- /dev/null +++ b/src/server/scripts/Outland/Auchindoun/shadow_labyrinth/shadow_labyrinth.h @@ -0,0 +1,15 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_SHADOW_LABYRINTH_H +#define DEF_SHADOW_LABYRINTH_H + +#define TYPE_HELLMAW 1 +#define TYPE_OVERSEER 2 +#define DATA_BLACKHEARTTHEINCITEREVENT 3 +#define DATA_GRANDMASTERVORPILEVENT 4 +#define DATA_MURMUREVENT 5 +#define DATA_GRANDMASTERVORPIL 6 +#endif + diff --git a/src/server/scripts/Outland/BlackTemple/black_temple.cpp b/src/server/scripts/Outland/BlackTemple/black_temple.cpp new file mode 100644 index 00000000000..c1e7f19fbb1 --- /dev/null +++ b/src/server/scripts/Outland/BlackTemple/black_temple.cpp @@ -0,0 +1,69 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Black_Temple +SD%Complete: 95 +SDComment: Spirit of Olum: Player Teleporter to Seer Kanai Teleport after defeating Naj'entus and Supremus. TODO: Find proper gossip. +SDCategory: Black Temple +EndScriptData */ + +/* ContentData +npc_spirit_of_olum +EndContentData */ + +#include "ScriptedPch.h" +#include "black_temple.h" + +/*### +# npc_spirit_of_olum +####*/ + +#define SPELL_TELEPORT 41566 // s41566 - Teleport to Ashtongue NPC's +#define GOSSIP_OLUM1 "Teleport me to the other Ashtongue Deathsworn" + +bool GossipHello_npc_spirit_of_olum(Player* pPlayer, Creature* pCreature) +{ + ScriptedInstance* pInstance = pCreature->GetInstanceData(); + + if (pInstance && (pInstance->GetData(DATA_SUPREMUSEVENT) >= DONE) && (pInstance->GetData(DATA_HIGHWARLORDNAJENTUSEVENT) >= DONE)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_OLUM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_spirit_of_olum(Player* pPlayer, Creature* /*pCreature*/, uint32 /*uiSender*/, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) + pPlayer->CLOSE_GOSSIP_MENU(); + + pPlayer->InterruptNonMeleeSpells(false); + pPlayer->CastSpell(pPlayer, SPELL_TELEPORT, false); + return true; +} + +void AddSC_black_temple() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_spirit_of_olum"; + newscript->pGossipHello = &GossipHello_npc_spirit_of_olum; + newscript->pGossipSelect = &GossipSelect_npc_spirit_of_olum; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/Outland/BlackTemple/black_temple.h b/src/server/scripts/Outland/BlackTemple/black_temple.h new file mode 100644 index 00000000000..b7432cd5b20 --- /dev/null +++ b/src/server/scripts/Outland/BlackTemple/black_temple.h @@ -0,0 +1,39 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_BLACK_TEMPLE_H +#define DEF_BLACK_TEMPLE_H + +enum eTypes +{ + DATA_AKAMA = 1, + DATA_AKAMA_SHADE = 2, + DATA_GURTOGGBLOODBOILEVENT = 3, + DATA_HIGHWARLORDNAJENTUS = 4, + DATA_HIGHWARLORDNAJENTUSEVENT = 5, + DATA_ILLIDANSTORMRAGE = 6, + DATA_ILLIDANSTORMRAGEEVENT = 7, + DATA_ILLIDARICOUNCILEVENT = 8, + DATA_ILLIDARICOUNCIL = 9, + DATA_LADYMALANDE = 10, + DATA_HIGHNETHERMANCERZEREVOR = 11, + DATA_GATHIOSTHESHATTERER = 12, + DATA_VERASDARKSHADOW = 13, + DATA_MOTHERSHAHRAZEVENT = 14, + DATA_RELIQUARYOFSOULSEVENT = 15, + DATA_SHADEOFAKAMA = 16, + DATA_SHADEOFAKAMAEVENT = 17, + DATA_SUPREMUS = 18, + DATA_SUPREMUSEVENT = 19, + DATA_TERONGOREFIENDEVENT = 20, + DATA_GAMEOBJECT_NAJENTUS_GATE = 21, + DATA_GAMEOBJECT_ILLIDAN_GATE = 22, + DATA_GAMEOBJECT_ILLIDAN_DOOR_R = 23, + DATA_GAMEOBJECT_ILLIDAN_DOOR_L = 24, + DATA_GAMEOBJECT_SUPREMUS_DOORS = 25, + DATA_BLOOD_ELF_COUNCIL_VOICE = 26 +}; + +#endif + diff --git a/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp b/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp new file mode 100644 index 00000000000..1093ce06cb8 --- /dev/null +++ b/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp @@ -0,0 +1,332 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Bloodboil +SD%Complete: 80 +SDComment: Bloodboil not working correctly, missing enrage +SDCategory: Black Temple +EndScriptData */ + +#include "ScriptedPch.h" +#include "black_temple.h" + +//Speech'n'Sound +#define SAY_AGGRO -1564029 +#define SAY_SLAY1 -1564030 +#define SAY_SLAY2 -1564031 +#define SAY_SPECIAL1 -1564032 +#define SAY_SPECIAL2 -1564033 +#define SAY_ENRAGE1 -1564034 +#define SAY_ENRAGE2 -1564035 +#define SAY_DEATH -1564036 + +//Spells +#define SPELL_ACID_GEYSER 40630 +#define SPELL_ACIDIC_WOUND 40481 +#define SPELL_ARCING_SMASH 40599 +#define SPELL_BLOODBOIL 42005 // This spell is AoE whereas it shouldn't be +#define SPELL_FEL_ACID 40508 +#define SPELL_FEL_RAGE_SELF 40594 +#define SPELL_FEL_RAGE_TARGET 40604 +#define SPELL_FEL_RAGE_2 40616 +#define SPELL_FEL_RAGE_3 41625 +#define SPELL_BEWILDERING_STRIKE 40491 +#define SPELL_EJECT1 40486 // 1000 Physical damage + knockback + script effect (should handle threat reduction I think) +#define SPELL_EJECT2 40597 // 1000 Physical damage + Stun (used in phase 2?) +#define SPELL_TAUNT_GURTOGG 40603 +#define SPELL_INSIGNIFIGANCE 40618 +#define SPELL_BERSERK 45078 + +//This is used to sort the players by distance in preparation for the Bloodboil cast. + +struct boss_gurtogg_bloodboilAI : public ScriptedAI +{ + boss_gurtogg_bloodboilAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint64 TargetGUID; + + float TargetThreat; + + uint32 BloodboilTimer; + uint32 BloodboilCount; + uint32 AcidGeyserTimer; + uint32 AcidicWoundTimer; + uint32 ArcingSmashTimer; + uint32 EnrageTimer; + uint32 FelAcidTimer; + uint32 EjectTimer; + uint32 BewilderingStrikeTimer; + uint32 PhaseChangeTimer; + + bool Phase1; + + void Reset() + { + if (pInstance) + pInstance->SetData(DATA_GURTOGGBLOODBOILEVENT, NOT_STARTED); + + TargetGUID = 0; + + TargetThreat = 0; + + BloodboilTimer = 10000; + BloodboilCount = 0; + AcidGeyserTimer = 1000; + AcidicWoundTimer = 6000; + ArcingSmashTimer = 19000; + EnrageTimer = 600000; + FelAcidTimer = 25000; + EjectTimer = 10000; + BewilderingStrikeTimer = 15000; + PhaseChangeTimer = 60000; + + Phase1 = true; + + me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, false); + me->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, false); + } + + void EnterCombat(Unit * /*who*/) + { + DoZoneInCombat(); + DoScriptText(SAY_AGGRO, me); + if (pInstance) + pInstance->SetData(DATA_GURTOGGBLOODBOILEVENT, IN_PROGRESS); + } + + void KilledUnit(Unit * /*victim*/) + { + DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me); + } + + void JustDied(Unit * /*victim*/) + { + if (pInstance) + pInstance->SetData(DATA_GURTOGGBLOODBOILEVENT, DONE); + + DoScriptText(SAY_DEATH, me); + } + + // Note: This seems like a very complicated fix. The fix needs to be handled by the core, as implementation of limited-target AoE spells are still not limited. + void CastBloodboil() + { + // Get the Threat List + std::list m_threatlist = me->getThreatManager().getThreatList(); + + if (!m_threatlist.size()) // He doesn't have anyone in his threatlist, useless to continue + return; + + std::list targets; + std::list::const_iterator itr = m_threatlist.begin(); + for (; itr!= m_threatlist.end(); ++itr) //store the threat list in a different container + { + Unit *pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid()); + //only on alive players + if (pTarget && pTarget->isAlive() && pTarget->GetTypeId() == TYPEID_PLAYER) + targets.push_back(pTarget); + } + + //Sort the list of players + targets.sort(Trinity::ObjectDistanceOrderPred(me, false)); + //Resize so we only get top 5 + targets.resize(5); + + //Aura each player in the targets list with Bloodboil. Aura code copied+pasted from Aura command in Level3.cpp + /*SpellEntry const *spellInfo = GetSpellStore()->LookupEntry(SPELL_BLOODBOIL); + if (spellInfo) + { + for (std::list::const_iterator itr = targets.begin(); itr != targets.end(); ++itr) + { + Unit *pTarget = *itr; + if (!pTarget) return; + for (uint32 i = 0; i<3; ++i) + { + uint8 eff = spellInfo->Effect[i]; + if (eff >= TOTAL_SPELL_EFFECTS) + continue; + + Aura *Aur = new Aura(spellInfo, i, pTarget, pTarget, pTarget); + pTarget->AddAura(Aur); + } + } + }*/ + } + + void RevertThreatOnTarget(uint64 guid) + { + Unit* pUnit = NULL; + pUnit = Unit::GetUnit((*me), guid); + if (pUnit) + { + if (DoGetThreat(pUnit)) + DoModifyThreatPercent(pUnit, -100); + if (TargetThreat) + me->AddThreat(pUnit, TargetThreat); + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (ArcingSmashTimer <= diff) + { + DoCast(me->getVictim(), SPELL_ARCING_SMASH); + ArcingSmashTimer = 10000; + } else ArcingSmashTimer -= diff; + + if (FelAcidTimer <= diff) + { + DoCast(me->getVictim(), SPELL_FEL_ACID); + FelAcidTimer = 25000; + } else FelAcidTimer -= diff; + + if (!me->HasAura(SPELL_BERSERK)) + { + if (EnrageTimer <= diff) + { + DoCast(me, SPELL_BERSERK); + DoScriptText(RAND(SAY_ENRAGE1,SAY_ENRAGE2), me); + } else EnrageTimer -= diff; + } + + if (Phase1) + { + if (BewilderingStrikeTimer <= diff) + { + DoCast(me->getVictim(), SPELL_BEWILDERING_STRIKE); + float mt_threat = DoGetThreat(me->getVictim()); + if (Unit *pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO, 1)) + me->AddThreat(pTarget, mt_threat); + BewilderingStrikeTimer = 20000; + } else BewilderingStrikeTimer -= diff; + + if (EjectTimer <= diff) + { + DoCast(me->getVictim(), SPELL_EJECT1); + DoModifyThreatPercent(me->getVictim(), -40); + EjectTimer = 15000; + } else EjectTimer -= diff; + + if (AcidicWoundTimer <= diff) + { + DoCast(me->getVictim(), SPELL_ACIDIC_WOUND); + AcidicWoundTimer = 10000; + } else AcidicWoundTimer -= diff; + + if (BloodboilTimer <= diff) + { + if (BloodboilCount < 5) // Only cast it five times. + { + //CastBloodboil(); // Causes issues on windows, so is commented out. + DoCast(me->getVictim(), SPELL_BLOODBOIL); + ++BloodboilCount; + BloodboilTimer = 10000*BloodboilCount; + } + } else BloodboilTimer -= diff; + } + + if (!Phase1) + { + if (AcidGeyserTimer <= diff) + { + DoCast(me->getVictim(), SPELL_ACID_GEYSER); + AcidGeyserTimer = 30000; + } else AcidGeyserTimer -= diff; + + if (EjectTimer <= diff) + { + DoCast(me->getVictim(), SPELL_EJECT2); + EjectTimer = 15000; + } else EjectTimer -= diff; + } + + if (PhaseChangeTimer <= diff) + { + if (Phase1) + { + Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (pTarget && pTarget->isAlive()) + { + Phase1 = false; + + TargetThreat = DoGetThreat(pTarget); + TargetGUID = pTarget->GetGUID(); + pTarget->CastSpell(me, SPELL_TAUNT_GURTOGG, true); + if (DoGetThreat(pTarget)) + DoModifyThreatPercent(pTarget, -100); + me->AddThreat(pTarget, 50000000.0f); + me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true); + me->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true); + // If VMaps are disabled, this spell can call the whole instance + DoCast(me, SPELL_INSIGNIFIGANCE, true); + DoCast(pTarget, SPELL_FEL_RAGE_TARGET, true); + DoCast(pTarget, SPELL_FEL_RAGE_2, true); + /* These spells do not work, comment them out for now. + DoCast(pTarget, SPELL_FEL_RAGE_2, true); + DoCast(pTarget, SPELL_FEL_RAGE_3, true);*/ + + //Cast this without triggered so that it appears in combat logs and shows visual. + DoCast(me, SPELL_FEL_RAGE_SELF); + + DoScriptText(RAND(SAY_SPECIAL1,SAY_SPECIAL2), me); + + AcidGeyserTimer = 1000; + PhaseChangeTimer = 30000; + } + } else // Encounter is a loop pretty much. Phase 1 -> Phase 2 -> Phase 1 -> Phase 2 till death or enrage + { + if (TargetGUID) + RevertThreatOnTarget(TargetGUID); + TargetGUID = 0; + Phase1 = true; + BloodboilTimer = 10000; + BloodboilCount = 0; + AcidicWoundTimer += 2000; + ArcingSmashTimer += 2000; + FelAcidTimer += 2000; + EjectTimer += 2000; + PhaseChangeTimer = 60000; + me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, false); + me->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, false); + } + } else PhaseChangeTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_gurtogg_bloodboil(Creature* pCreature) +{ + return new boss_gurtogg_bloodboilAI (pCreature); +} + +void AddSC_boss_gurtogg_bloodboil() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_gurtogg_bloodboil"; + newscript->GetAI = &GetAI_boss_gurtogg_bloodboil; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp new file mode 100644 index 00000000000..b8e09c0e08e --- /dev/null +++ b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp @@ -0,0 +1,2248 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/* ScriptData +SDName: boss_illidan_stormrage +SD%Complete: 90 +SDComment: Somewhat of a workaround for Parasitic Shadowfiend, unable to summon GOs for Cage Trap. +SDCategory: Black Temple +EndScriptData */ + +#include "ScriptedPch.h" +#include "black_temple.h" + +#define GETGO(obj, guid) GameObject* obj = pInstance->instance->GetGameObject(guid) +#define GETUNIT(unit, guid) Unit* unit = Unit::GetUnit(*me, guid) +#define GETCRE(cre, guid) Creature* cre = Unit::GetCreature(*me, guid) +#define HPPCT(unit) unit->GetHealth()*100 / unit->GetMaxHealth() + +/************* Quotes and Sounds ***********************/ +// Gossip for when a player clicks Akama +#define GOSSIP_ITEM "We are ready to face Illidan" + +// Yells for/by Akama +#define SAY_AKAMA_BEWARE "Be wary friends, The Betrayer meditates in the court just beyond." +#define SOUND_AKAMA_BEWARE 11388 +#define SAY_AKAMA_MINION "Come, my minions. Deal with this traitor as he deserves!" +#define SOUND_AKAMA_MINION 11465 +#define SAY_AKAMA_LEAVE "I'll deal with these mongrels. Strike now, friends! Strike at the betrayer!" +#define SOUND_AKAMA_LEAVE 11390 + +// Self explanatory +const char* SAY_KILL1 = "Who shall be next to taste my blades?!"; +#define SOUND_KILL1 11473 +const char* SAY_KILL2 = "This is too easy!"; +#define SOUND_KILL2 11472 + +// I think I'll fly now and let my subordinates take you on +#define SAY_TAKEOFF "I will not be touched by rabble such as you!" +#define SOUND_TAKEOFF 11479 +#define SAY_SUMMONFLAMES "Behold the flames of Azzinoth!" +#define SOUND_SUMMONFLAMES 11480 + +// When casting Eye Blast. Demon Fire will be appear on places that he casts this +#define SAY_EYE_BLAST "Stare into the eyes of the Betrayer!" +#define SOUND_EYE_BLAST 11481 + +// kk, I go big, dark and demon on you. +#define SAY_MORPH "Behold the power... of the demon within!" +#define SOUND_MORPH 11475 + +// I KILL! +#define SAY_ENRAGE "You've wasted too much time mortals, now you shall fall!" +#define SOUND_ENRAGE 11474 + +/************** Spells *************/ +// Normal Form +#define SPELL_SHEAR 37335 // 41032 is bugged, cannot be block/dodge/parry// Reduces Max. Health by 60% for 7 seconds. Can stack 19 times. 1.5 second cast +#define SPELL_FLAME_CRASH 40832 // Summons an invis/unselect passive mob that has an aura of flame in a circle around him. +#define SPELL_DRAW_SOUL 40904 // 5k Shadow Damage in front of him. Heals Illidan for 100k health (script effect) +#define SPELL_PARASITIC_SHADOWFIEND 41917 // DoT of 3k Shadow every 2 seconds. Lasts 10 seconds. (Script effect: Summon 2 parasites once the debuff has ticked off) +#define SPELL_PARASITIC_SHADOWFIEND2 41914 // Used by Parasitic +#define SPELL_SUMMON_PARASITICS 41915 // Summons 2 Parasitic Shadowfiends on the target. It's supposed to be cast as soon as the Parasitic Shadowfiend debuff is gone, but the spells aren't linked :( +#define SPELL_AGONIZING_FLAMES 40932 // 4k fire damage initial to target and anyone w/i 5 yards. PHASE 3 ONLY +#define SPELL_ENRAGE 40683 // Increases damage by 50% and attack speed by 30%. 20 seconds, PHASE 5 ONLY +// Flying (Phase 2) +#define SPELL_THROW_GLAIVE 39635 // Throws a glaive on the ground +#define SPELL_THROW_GLAIVE2 39849 // Animation for the above spell +#define SPELL_GLAIVE_RETURNS 39873 // Glaive flies back to Illidan +#define SPELL_FIREBALL 40598 // 2.5k-3.5k damage in 10 yard radius. 2 second cast time. +#define SPELL_DARK_BARRAGE 40585 // 10 second channeled spell, 3k shadow damage per second. +// Demon Form +#define SPELL_DEMON_TRANSFORM_1 40511 // First phase of animations for transforming into Dark Illidan (fall to ground) +#define SPELL_DEMON_TRANSFORM_2 40398 // Second phase of animations (kneel) +#define SPELL_DEMON_TRANSFORM_3 40510 // Final phase of animations (stand up and roar) +#define SPELL_DEMON_FORM 40506 // Transforms into Demon Illidan. Has an Aura of Dread on him. +#define SPELL_SHADOW_BLAST 41078 // 8k - 11k Shadow Damage. Targets highest threat. Has a splash effect, damaging anyone in 20 yards of the target. +#define SPELL_FLAME_BURST 41126 // Hurls fire at entire raid for ~3.5k damage every 10 seconds. Resistable. (Does not work: Script effect) +#define SPELL_FLAME_BURST_EFFECT 41131 // The actual damage. Have each player cast it on itself (workaround) +// Other Illidan spells +#define SPELL_KNEEL 39656 // Before beginning encounter, this is how he appears (talking to skully). +#define SPELL_SHADOW_PRISON 40647 // Illidan casts this spell to immobilize entire raid when he summons Maiev. +#define SPELL_DEATH 41220 // This spell doesn't do anything except stun Illidan and set him on his knees. +#define SPELL_BERSERK 45078 // Damage increased by 500%, attack speed by 150% +#define SPELL_DUAL_WIELD 42459 +//Phase Normal spells +#define SPELL_FLAME_CRASH_EFFECT 40836 // Firey blue ring of circle that the other flame crash summons +#define SPELL_SUMMON_SHADOWDEMON 41117 // Summon four shadowfiends +#define SPELL_SHADOWFIEND_PASSIVE 41913 // Passive aura for shadowfiends +#define SPELL_SHADOW_DEMON_PASSIVE 41079 // Adds the "shadowform" aura to Shadow Demons. +#define SPELL_CONSUME_SOUL 41080 // Once the Shadow Demons reach their target, they use this to kill them +#define SPELL_PARALYZE 41083 // Shadow Demons cast this on their target +#define SPELL_PURPLE_BEAM 39123 // Purple Beam connecting Shadow Demon to their target +//Phase Flight spells +#define SPELL_AZZINOTH_CHANNEL 39857 // Glaives cast it on Flames. Not sure if this is the right spell. +#define SPELL_EYE_BLAST_TRIGGER 40017 // This summons Demon Form every few seconds and deals ~20k damage in its radius +#define SPELL_EYE_BLAST 39908 // This does the blue flamey animation. +#define SPELL_BLAZE_EFFECT 40610 // Green flame on the ground, triggers damage (5k) every few seconds +#define SPELL_BLAZE_SUMMON 40637 // Summons the Blaze creature +#define SPELL_DEMON_FIRE 40029 // Blue fire trail left by Eye Blast. Deals 2k per second if players stand on it. +#define SPELL_FLAME_BLAST 40631 // Flames of Azzinoth use this. Frontal cone AoE 7k-9k damage. +#define SPELL_CHARGE 41581 //40602 // Flames of Azzinoth charges whoever is too far from them. They enrage after this. For simplicity, we'll use the same enrage as Illidan. +#define SPELL_FLAME_ENRAGE 45078 +//Akama spells +#define SPELL_AKAMA_DOOR_CHANNEL 41268 // Akama's channel spell on the door before the Temple Summit +#define SPELL_DEATHSWORN_DOOR_CHANNEL 41269 // Olum and Udalo's channel spell on the door before the Temple Summit +#define SPELL_AKAMA_DOOR_FAIL 41271 // Not sure where this is really used... +#define SPELL_HEALING_POTION 40535 // Akama uses this to heal himself to full. +#define SPELL_CHAIN_LIGHTNING 40536 // 6938 to 8062 for 5 targets +//Maiev spells +#define SPELL_CAGE_TRAP_DUMMY 40761 // Put this in DB for cage trap GO. +#define SPELL_CAGED 40695 // Caged Trap triggers will cast this on Illidan if he is within 3 yards +#define SPELL_CAGE_TRAP_SUMMON 40694 // Summons a Cage Trap GO (bugged) on the ground along with a Cage Trap Disturb Trigger mob (working) +#define SPELL_CAGE_TRAP_BEAM 40713 // 8 Triggers on the ground in an octagon cast spells like this on Illidan 'caging him' +#define SPELL_TELEPORT_VISUAL 41232 // Teleport visual for Maiev +#define SPELL_SHADOW_STRIKE 40685 // 4375 to 5625 every 3 seconds for 12 seconds +#define SPELL_THROW_DAGGER 41152 // 5400 to 6600 damage, need dagger +#define SPELL_FAN_BLADES 39954 // bugged visual + +// Other defines +#define CENTER_X 676.740 +#define CENTER_Y 305.297 +#define CENTER_Z 353.192 + +#define FLAME_ENRAGE_DISTANCE 30 +#define FLAME_CHARGE_DISTANCE 50 + +#define EQUIP_ID_MAIN_HAND 32837 +#define EQUIP_ID_OFF_HAND 32838 + +/**** Creature Summon and Recognition IDs ****/ +enum CreatureEntry +{ + EMPTY = 0, + AKAMA = 22990, + ILLIDAN_STORMRAGE = 22917, + BLADE_OF_AZZINOTH = 22996, + FLAME_OF_AZZINOTH = 22997, + MAIEV_SHADOWSONG = 23197, + SHADOW_DEMON = 23375, + DEMON_FIRE = 23069, + FLAME_CRASH = 23336, + ILLIDAN_DOOR_TRIGGER = 23412, + SPIRIT_OF_OLUM = 23411, + SPIRIT_OF_UDALO = 23410, + ILLIDARI_ELITE = 23226, + PARASITIC_SHADOWFIEND = 23498, + CAGE_TRAP_TRIGGER = 23292, +}; + +/*** Phase Names ***/ +enum PhaseIllidan +{ + PHASE_ILLIDAN_NULL = 0, + PHASE_NORMAL = 1, + PHASE_FLIGHT = 2, + PHASE_NORMAL_2 = 3, + PHASE_DEMON = 4, + PHASE_NORMAL_MAIEV = 5, + PHASE_TALK_SEQUENCE = 6, + PHASE_FLIGHT_SEQUENCE = 7, + PHASE_TRANSFORM_SEQUENCE = 8, + PHASE_ILLIDAN_MAX = 9, +};//Maiev uses the same phase + +enum PhaseAkama +{ + PHASE_AKAMA_NULL = 0, + PHASE_CHANNEL = 1, + PHASE_WALK = 2, + PHASE_TALK = 3, + PHASE_FIGHT_ILLIDAN = 4, + PHASE_FIGHT_MINIONS = 5, + PHASE_RETURN = 6, +}; + +enum EventIllidan +{ + EVENT_NULL = 0, + EVENT_BERSERK = 1, + //normal phase + EVENT_TAUNT = 2, + EVENT_SHEAR = 3, + EVENT_FLAME_CRASH = 4, + EVENT_PARASITIC_SHADOWFIEND = 5, + EVENT_PARASITE_CHECK = 6, + EVENT_DRAW_SOUL = 7, + EVENT_AGONIZING_FLAMES = 8, + EVENT_TRANSFORM_NORMAL = 9, + EVENT_ENRAGE = 10, + //flight phase + EVENT_FIREBALL = 2, + EVENT_DARK_BARRAGE = 3, + EVENT_EYE_BLAST = 4, + EVENT_MOVE_POINT = 5, + //demon phase + EVENT_SHADOW_BLAST = 2, + EVENT_FLAME_BURST = 3, + EVENT_SHADOWDEMON = 4, + EVENT_TRANSFORM_DEMON = 5, + //sequence phase + EVENT_TALK_SEQUENCE = 2, + EVENT_FLIGHT_SEQUENCE = 2, + EVENT_TRANSFORM_SEQUENCE = 2, +}; + +enum EventMaiev +{ + EVENT_MAIEV_NULL = 0, + EVENT_MAIEV_STEALTH = 1, + EVENT_MAIEV_TAUNT = 2, + EVENT_MAIEV_SHADOW_STRIKE = 3, + EVENT_MAIEV_THROW_DAGGER = 4, + EVENT_MAIEV_TRAP = 4, +}; + +static EventIllidan MaxTimer[]= +{ + EVENT_NULL, + EVENT_DRAW_SOUL, + EVENT_MOVE_POINT, + EVENT_TRANSFORM_NORMAL, + EVENT_TRANSFORM_DEMON, + EVENT_ENRAGE, + EVENT_TALK_SEQUENCE, + EVENT_FLIGHT_SEQUENCE, + EVENT_TRANSFORM_SEQUENCE +}; + +struct Yells +{ + uint32 sound; + char* text; + uint32 pCreature, timer, emote; + bool Talk; +}; + +static Yells Conversation[]= +{ + {11463, "Akama... your duplicity is hardly surprising. I should have slaughtered you and your malformed brethren long ago.", ILLIDAN_STORMRAGE, 8000, 0, true}, + {0, NULL, ILLIDAN_STORMRAGE, 5000, 396, true}, + {11389, "We've come to end your reign, Illidan. My people and all of Outland shall be free!", AKAMA, 7000, 25, true}, + {0, NULL, AKAMA, 5000, 66, true}, + {11464, "Boldly said. But I remain unconvinced.", ILLIDAN_STORMRAGE, 8000, 396, true}, + {11380, "The time has come! The moment is at hand!", AKAMA, 3000, 22, true}, + {0, NULL, AKAMA, 2000, 15, true}, + {11466, "You are not prepared!", ILLIDAN_STORMRAGE, 3000, 406, true}, + {0, NULL, EMPTY, 1000, 0, true}, + {0, NULL, EMPTY, 0, 0, false},//9 + {11476, "Is this it, mortals? Is this all the fury you can muster?", ILLIDAN_STORMRAGE, 8000, 0, true}, + {11491, "Their fury pales before mine, Illidan. We have some unsettled business between us.", MAIEV_SHADOWSONG, 8000, 5, true}, + {11477, "Maiev... How is this even possible?", ILLIDAN_STORMRAGE, 5000, 1, true}, + {11492, "Ah... my long hunt is finally over. Today, Justice will be done!", MAIEV_SHADOWSONG, 8000, 15, true}, + {11470, "Feel the hatred of ten thousand years!", ILLIDAN_STORMRAGE, 1000, 0, false},//14 + {11496, "Ahh... It is finished. You are beaten.", MAIEV_SHADOWSONG, 6000, 0, true},//15 + {11478, "You have won... Maiev...but the huntress... is nothing...without the hunt... you... are nothing... without me..", ILLIDAN_STORMRAGE, 30000, 65, true}, // Emote dead for now. Kill him later + {11497, "He is right. I feel nothing... I am nothing... Farewell, champions.", MAIEV_SHADOWSONG, 9000, 0, true}, + {11498, NULL, MAIEV_SHADOWSONG, 5000, 0, true}, + {11498, NULL, EMPTY, 1000, 0, true},//19 Maiev disappear + {11387, "The Light will fill these dismal halls once again. I swear it.", AKAMA, 8000, 0, true}, + {0, NULL, EMPTY, 1000, 0, false}//21 +}; + +static Yells RandomTaunts[]= +{ + {11467, "I can feel your hatred.", ILLIDAN_STORMRAGE, 0, 0, false}, + {11468, "Give in to your fear!", ILLIDAN_STORMRAGE, 0, 0, false}, + {11469, "You know nothing of power!", ILLIDAN_STORMRAGE, 0, 0, false}, + {11471, "Such... arrogance!", ILLIDAN_STORMRAGE, 0, 0, false} +}; + +static Yells MaievTaunts[]= +{ + {11493, "That is for Naisha!", MAIEV_SHADOWSONG, 0, false}, + {11494, "Bleed as I have bled!", MAIEV_SHADOWSONG, 0, 0, false}, + {11495, "There shall be no prison for you this time!", MAIEV_SHADOWSONG, 0, 0, false}, + {11500, "Meet your end, demon!", MAIEV_SHADOWSONG, 0, 0, false} +}; + +struct Locations +{ + float x, y, z; +}; + +static Locations HoverPosition[]= +{ + {657, 340, 355}, + {657, 275, 355}, + {705, 275, 355}, + {705, 340, 355} +}; + +static Locations GlaivePosition[]= +{ + {695.105, 305.303, 354.256}, + {659.338, 305.303, 354.256},//the distance between two glaives is 36 + {700.105, 305.303, 354.256}, + {664.338, 305.303, 354.256} +}; + +static Locations EyeBlast[]= +{ + {677, 350, 354},//start point, pass through glaive point + {677, 260, 354} +}; + +static Locations AkamaWP[]= +{ + {770.01, 304.50, 312.29}, // Bottom of the first stairs, at the doors + {780.66, 304.50, 319.74}, // Top of the first stairs + {790.13, 319.68, 319.76}, // Bottom of the second stairs (left from the entrance) + {787.17, 347.38, 341.42}, // Top of the second stairs + {781.34, 350.31, 341.44}, // Bottom of the third stairs + {762.60, 361.06, 353.60}, // Top of the third stairs + {756.35, 360.52, 353.27}, // Before the door-thingy + {743.82, 342.21, 353.00}, // Somewhere further + {732.69, 305.13, 353.00}, // In front of Illidan - (8) + {738.11, 365.44, 353.00}, // in front of the door-thingy (the other one!) + {792.18, 366.62, 341.42}, // Down the first flight of stairs + {796.84, 304.89, 319.76}, // Down the second flight of stairs + {782.01, 304.55, 319.76} // Final location - back at the initial gates. This is where he will fight the minions! (12) +}; +// 755.762, 304.0747, 312.1769 -- This is where Akama should be spawned +static Locations SpiritSpawns[]= +{ + {755.5426, 309.9156, 312.2129}, + {755.5426, 298.7923, 312.0834} +}; + +struct Animation // For the demon transformation +{ + uint32 aura, unaura, timer, size, displayid, phase; + bool equip; +}; + +static Animation DemonTransformation[]= +{ + {SPELL_DEMON_TRANSFORM_1, 0, 1000, 0, 0, 6, true}, + {SPELL_DEMON_TRANSFORM_2, SPELL_DEMON_TRANSFORM_1, 4000, 0, 0, 6, true}, + {0, 0, 3000, 1073741824, 21322, 6, false},//stunned, cannot cast demon form + {SPELL_DEMON_TRANSFORM_3, SPELL_DEMON_TRANSFORM_2, 3500, 0, 0, 6, false}, + {SPELL_DEMON_FORM, SPELL_DEMON_TRANSFORM_3, 0, 0, 0, 4, false}, + {SPELL_DEMON_TRANSFORM_1, 0, 1000, 0, 0, 6, false}, + {SPELL_DEMON_TRANSFORM_2, SPELL_DEMON_TRANSFORM_1, 4000, 0, 0, 6, false}, + {0, SPELL_DEMON_FORM, 3000, 1069547520, 21135, 6, false}, + {SPELL_DEMON_TRANSFORM_3, SPELL_DEMON_TRANSFORM_2, 3500, 0, 0, 6, true}, + {0, SPELL_DEMON_TRANSFORM_3, 0, 0, 0, 8, true} +}; + +#define EMOTE_SETS_GAZE_ON "sets its gaze on $N!" +#define EMOTE_UNABLE_TO_SUMMON "is unable to summon Maiev Shadowsong and enter Phase 4. Resetting Encounter." + +/************************************** Illidan's AI ***************************************/ +struct boss_illidan_stormrageAI : public ScriptedAI +{ + boss_illidan_stormrageAI(Creature* c) : ScriptedAI(c), Summons(me) + { + pInstance = c->GetInstanceData(); + DoCast(me, SPELL_DUAL_WIELD, true); + + SpellEntry *TempSpell = GET_SPELL(SPELL_SHADOWFIEND_PASSIVE); + if (TempSpell) + TempSpell->EffectApplyAuraName[0] = 4; // proc debuff, and summon infinite fiends + } + + ScriptedInstance* pInstance; + + PhaseIllidan Phase; + EventIllidan Event; + uint32 Timer[EVENT_ENRAGE + 1]; + + uint32 TalkCount; + uint32 TransformCount; + uint32 FlightCount; + + uint32 HoverPoint; + + uint64 AkamaGUID; + uint64 MaievGUID; + uint64 FlameGUID[2]; + uint64 GlaiveGUID[2]; + + SummonList Summons; + + void Reset(); + + void JustSummoned(Creature* summon); + + void SummonedCreatureDespawn(Creature* summon) + { + if (summon->GetCreatureInfo()->Entry == FLAME_OF_AZZINOTH) + { + for (uint8 i = 0; i < 2; ++i) + if (summon->GetGUID() == FlameGUID[i]) + FlameGUID[i] = 0; + + if (!FlameGUID[0] && !FlameGUID[1] && Phase != PHASE_ILLIDAN_NULL) + { + me->InterruptNonMeleeSpells(true); + EnterPhase(PHASE_FLIGHT_SEQUENCE); + } + } + Summons.Despawn(summon); + } + + void MovementInform(uint32 /*MovementType*/, uint32 /*Data*/) + { + if (FlightCount == 7) //change hover point + { + if (me->getVictim()) + { + me->SetInFront(me->getVictim()); + me->StopMoving(); + } + EnterPhase(PHASE_FLIGHT); + } + else // handle flight sequence + Timer[EVENT_FLIGHT_SEQUENCE] = 1000; + } + + void EnterCombat(Unit * /*who*/) + { + me->setActive(true); + DoZoneInCombat(); + } + + void AttackStart(Unit *who) + { + if (!who || Phase >= PHASE_TALK_SEQUENCE) + return; + + if (Phase == PHASE_FLIGHT || Phase == PHASE_DEMON) + AttackStartNoMove(who); + else + ScriptedAI::AttackStart(who); + } + + void MoveInLineOfSight(Unit *) {} + + void JustDied(Unit * /*killer*/) + { + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + + if (!pInstance) + return; + + pInstance->SetData(DATA_ILLIDANSTORMRAGEEVENT, DONE); // Completed + + for (uint8 i = DATA_GAMEOBJECT_ILLIDAN_DOOR_R; i < DATA_GAMEOBJECT_ILLIDAN_DOOR_L + 1; ++i) + pInstance->HandleGameObject(pInstance->GetData64(i), true); + } + + void KilledUnit(Unit * victim) + { + if (victim == me) return; + // TODO: Find better way to handle emote + switch (urand(0,1)) + { + case 0: + me->MonsterYell(SAY_KILL1, LANG_UNIVERSAL, victim->GetGUID()); + DoPlaySoundToSet(me, SOUND_KILL1); + break; + case 1: + me->MonsterYell(SAY_KILL2, LANG_UNIVERSAL, victim->GetGUID()); + DoPlaySoundToSet(me, SOUND_KILL2); + break; + } + } + + void DamageTaken(Unit *done_by, uint32 &damage) + { + if (damage >= me->GetHealth() && done_by != me) + damage = 0; + if (done_by->GetGUID() == MaievGUID) + done_by->AddThreat(me, -(3*(float)damage)/4); // do not let maiev tank him + } + + void SpellHit(Unit * /*caster*/, const SpellEntry *spell) + { + if (spell->Id == SPELL_GLAIVE_RETURNS) // Re-equip our warblades! + { + if (!me->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID)) + SetEquipmentSlots(false, EQUIP_ID_MAIN_HAND, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); + else + SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_ID_OFF_HAND, EQUIP_NO_CHANGE); + me->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE); + } + } + + void DeleteFromThreatList(uint64 TargetGUID) + { + for (std::list::const_iterator itr = me->getThreatManager().getThreatList().begin(); itr != me->getThreatManager().getThreatList().end(); ++itr) + { + if ((*itr)->getUnitGuid() == TargetGUID) + { + (*itr)->removeReference(); + break; + } + } + } + + void Talk(uint32 count) + { + Timer[EVENT_TALK_SEQUENCE] = Conversation[count].timer; + + Creature* pCreature = NULL; + if (Conversation[count].pCreature == ILLIDAN_STORMRAGE) + pCreature = me; + else if (Conversation[count].pCreature == AKAMA) + pCreature = (Unit::GetCreature((*me), AkamaGUID)); + else if (Conversation[count].pCreature == MAIEV_SHADOWSONG) + pCreature = (Unit::GetCreature((*me), MaievGUID)); + + if (pCreature) + { + if (Conversation[count].emote) + pCreature->HandleEmoteCommand(Conversation[count].emote); // Make the Creature do some animation! + if (Conversation[count].text) + pCreature->MonsterYell(Conversation[count].text, LANG_UNIVERSAL, 0); // Have the Creature yell out some text + if (Conversation[count].sound) + DoPlaySoundToSet(pCreature, Conversation[count].sound); // Play some sound on the creature + } + } + + void EnterPhase(PhaseIllidan NextPhase); + void CastEyeBlast(); + void SummonFlamesOfAzzinoth(); + void SummonMaiev(); + void HandleTalkSequence(); + void HandleFlightSequence() + { + switch(FlightCount) + { + case 1://lift off + me->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); + me->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); + me->StopMoving(); + me->MonsterYell(SAY_TAKEOFF, LANG_UNIVERSAL, 0); + DoPlaySoundToSet(me, SOUND_TAKEOFF); + Timer[EVENT_FLIGHT_SEQUENCE] = 3000; + break; + case 2://move to center + me->GetMotionMaster()->MovePoint(0, CENTER_X + 5, CENTER_Y, CENTER_Z); //+5, for SPELL_THROW_GLAIVE bug + Timer[EVENT_FLIGHT_SEQUENCE] = 0; + break; + case 3://throw one glaive + { + uint8 i=1; + Creature* Glaive = me->SummonCreature(BLADE_OF_AZZINOTH, GlaivePosition[i].x, GlaivePosition[i].y, GlaivePosition[i].z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); + if (Glaive) + { + GlaiveGUID[i] = Glaive->GetGUID(); + Glaive->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + Glaive->SetDisplayId(11686); + Glaive->setFaction(me->getFaction()); + DoCast(Glaive, SPELL_THROW_GLAIVE2); + } + } + Timer[EVENT_FLIGHT_SEQUENCE] = 700; + break; + case 4://throw another + SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); + { + uint8 i=0; + Creature* Glaive = me->SummonCreature(BLADE_OF_AZZINOTH, GlaivePosition[i].x, GlaivePosition[i].y, GlaivePosition[i].z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); + if (Glaive) + { + GlaiveGUID[i] = Glaive->GetGUID(); + Glaive->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + Glaive->SetDisplayId(11686); + Glaive->setFaction(me->getFaction()); + DoCast(Glaive, SPELL_THROW_GLAIVE, true); + } + } + Timer[EVENT_FLIGHT_SEQUENCE] = 5000; + break; + case 5://summon flames + SummonFlamesOfAzzinoth(); + Timer[EVENT_FLIGHT_SEQUENCE] = 3000; + break; + case 6://fly to hover point + me->GetMotionMaster()->MovePoint(0, HoverPosition[HoverPoint].x, HoverPosition[HoverPoint].y, HoverPosition[HoverPoint].z); + Timer[EVENT_FLIGHT_SEQUENCE] = 0; + break; + case 7://return to center + me->GetMotionMaster()->MovePoint(0, CENTER_X, CENTER_Y, CENTER_Z); + Timer[EVENT_FLIGHT_SEQUENCE] = 0; + break; + case 8://glaive return + for (uint8 i = 0; i < 2; ++i) + { + if (GlaiveGUID[i]) + { + Unit* Glaive = Unit::GetUnit((*me), GlaiveGUID[i]); + if (Glaive) + { + Glaive->CastSpell(me, SPELL_GLAIVE_RETURNS, false); // Make it look like the Glaive flies back up to us + Glaive->SetDisplayId(11686); // disappear but not die for now + } + } + } + Timer[EVENT_FLIGHT_SEQUENCE] = 2000; + break; + case 9://land + me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->StopMoving(); + me->HandleEmoteCommand(EMOTE_ONESHOT_LAND); + for (uint8 i = 0; i < 2; ++i) + { + if (GlaiveGUID[i]) + { + if (GETUNIT(Glaive, GlaiveGUID[i])) + { + Glaive->SetVisibility(VISIBILITY_OFF); + Glaive->setDeathState(JUST_DIED); // Despawn the Glaive + } + GlaiveGUID[i] = 0; + } + } + Timer[EVENT_FLIGHT_SEQUENCE] = 2000; + break; + case 10://attack + DoResetThreat(); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE); + me->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE); + EnterPhase(PHASE_NORMAL_2); + break; + default: + break; + } + ++FlightCount; + } + + void HandleTransformSequence() + { + if (DemonTransformation[TransformCount].unaura) + me->RemoveAurasDueToSpell(DemonTransformation[TransformCount].unaura); + + if (DemonTransformation[TransformCount].aura) + DoCast(me, DemonTransformation[TransformCount].aura, true); + + if (DemonTransformation[TransformCount].displayid) + me->SetDisplayId(DemonTransformation[TransformCount].displayid); // It's morphin time! + + if (DemonTransformation[TransformCount].equip) + { + // Requip warglaives if needed + SetEquipmentSlots(false, EQUIP_ID_MAIN_HAND, EQUIP_ID_OFF_HAND, EQUIP_NO_CHANGE); + me->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE); + } + else + { + // Unequip warglaives if needed + SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); + } + + switch(TransformCount) + { + case 2: + DoResetThreat(); + break; + case 4: + EnterPhase(PHASE_DEMON); + break; + case 7: + DoResetThreat(); + break; + case 9: + if (MaievGUID) + EnterPhase(PHASE_NORMAL_MAIEV); // Depending on whether we summoned Maiev, we switch to either phase 5 or 3 + else + EnterPhase(PHASE_NORMAL_2); + break; + default: + break; + } + if (Phase == PHASE_TRANSFORM_SEQUENCE) + Timer[EVENT_TRANSFORM_SEQUENCE] = DemonTransformation[TransformCount].timer; + ++TransformCount; + } + + void UpdateAI(const uint32 diff) + { + if ((!UpdateVictim()) && Phase < PHASE_TALK_SEQUENCE) + return; + + Event = EVENT_NULL; + for (uint32 i = 1; i <= MaxTimer[Phase]; ++i) + { + if (Timer[i]) // Event is enabled + if (Timer[i] <= diff) + { + if (!Event) // No event with higher priority + Event = (EventIllidan)i; + } + else Timer[i] -= diff; + } + + switch(Phase) + { + case PHASE_NORMAL: + if (HPPCT(me) < 65) + EnterPhase(PHASE_FLIGHT_SEQUENCE); + break; + + case PHASE_NORMAL_2: + if (HPPCT(me) < 30) + EnterPhase(PHASE_TALK_SEQUENCE); + break; + + case PHASE_NORMAL_MAIEV: + if (HPPCT(me) < 1) + EnterPhase(PHASE_TALK_SEQUENCE); + break; + + case PHASE_TALK_SEQUENCE: + if (Event == EVENT_TALK_SEQUENCE) + HandleTalkSequence(); + break; + + case PHASE_FLIGHT_SEQUENCE: + if (Event == EVENT_FLIGHT_SEQUENCE) + HandleFlightSequence(); + break; + + case PHASE_TRANSFORM_SEQUENCE: + if (Event == EVENT_TRANSFORM_SEQUENCE) + HandleTransformSequence(); + break; + } + + if (me->IsNonMeleeSpellCasted(false)) + return; + + if (Phase == PHASE_NORMAL || Phase == PHASE_NORMAL_2 || Phase == PHASE_NORMAL_MAIEV && !me->HasAura(SPELL_CAGED)) + { + switch(Event) + { + //PHASE_NORMAL + case EVENT_BERSERK: + me->MonsterYell(SAY_ENRAGE, LANG_UNIVERSAL, 0); + DoPlaySoundToSet(me, SOUND_ENRAGE); + DoCast(me, SPELL_BERSERK, true); + Timer[EVENT_BERSERK] = 5000;//The buff actually lasts forever. + break; + + case EVENT_TAUNT: + { + uint32 random = rand()%4; + char* yell = RandomTaunts[random].text; + uint32 soundid = RandomTaunts[random].sound; + if (yell) + me->MonsterYell(yell, LANG_UNIVERSAL, 0); + if (soundid) + DoPlaySoundToSet(me, soundid); + } + Timer[EVENT_TAUNT] = 25000 + rand()%10000; + break; + + case EVENT_SHEAR: + // no longer exists in 3.0.2 + //DoCast(me->getVictim(), SPELL_SHEAR); + Timer[EVENT_SHEAR] = 25000 + (rand()%16 * 1000); + break; + + case EVENT_FLAME_CRASH: + DoCast(me->getVictim(), SPELL_FLAME_CRASH); + Timer[EVENT_FLAME_CRASH] = 30000 + rand()%10000; + break; + + case EVENT_PARASITIC_SHADOWFIEND: + { + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 200, true)) + DoCast(pTarget, SPELL_PARASITIC_SHADOWFIEND, true); + Timer[EVENT_PARASITIC_SHADOWFIEND] = 35000 + rand()%10000; + } + break; + + case EVENT_PARASITE_CHECK: + Timer[EVENT_PARASITE_CHECK] = 0; + break; + + case EVENT_DRAW_SOUL: + DoCast(me->getVictim(), SPELL_DRAW_SOUL); + Timer[EVENT_DRAW_SOUL] = 50000 + rand()%10000; + break; + + //PHASE_NORMAL_2 + case EVENT_AGONIZING_FLAMES: + DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_AGONIZING_FLAMES); + Timer[EVENT_AGONIZING_FLAMES] = 0; + break; + + case EVENT_TRANSFORM_NORMAL: + EnterPhase(PHASE_TRANSFORM_SEQUENCE); + break; + + //PHASE_NORMAL_MAIEV + case EVENT_ENRAGE: + DoCast(me, SPELL_ENRAGE); + Timer[EVENT_ENRAGE] = 0; + break; + + default: + break; + } + DoMeleeAttackIfReady(); + } + + if (Phase == PHASE_FLIGHT) + { + switch(Event) + { + case EVENT_FIREBALL: + DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_FIREBALL); + Timer[EVENT_FIREBALL] = 3000; + break; + + case EVENT_DARK_BARRAGE: + DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_DARK_BARRAGE); + Timer[EVENT_DARK_BARRAGE] = 0; + break; + + case EVENT_EYE_BLAST: + CastEyeBlast(); + Timer[EVENT_EYE_BLAST] = 0; + break; + + case EVENT_MOVE_POINT: + Phase = PHASE_FLIGHT_SEQUENCE; + Timer[EVENT_FLIGHT_SEQUENCE] = 0;//do not start Event when changing hover point + HoverPoint += (rand()%3 + 1); + if (HoverPoint > 3) + HoverPoint -= 4; + me->GetMotionMaster()->MovePoint(0, HoverPosition[HoverPoint].x, HoverPosition[HoverPoint].y, HoverPosition[HoverPoint].z); + break; + + default: + break; + } + } + + if (Phase == PHASE_DEMON) + { + switch(Event) + { + case EVENT_SHADOW_BLAST: + me->GetMotionMaster()->Clear(false); + if (!me->IsWithinDistInMap(me->getVictim(), 50)||!me->IsWithinLOSInMap(me->getVictim())) + me->GetMotionMaster()->MoveChase(me->getVictim(), 30); + else + me->GetMotionMaster()->MoveIdle(); + DoCast(me->getVictim(), SPELL_SHADOW_BLAST); + Timer[EVENT_SHADOW_BLAST] = 4000; + break; + case EVENT_SHADOWDEMON: + DoCast(me, SPELL_SUMMON_SHADOWDEMON); + Timer[EVENT_SHADOWDEMON] = 0; + Timer[EVENT_FLAME_BURST] += 10000; + break; + case EVENT_FLAME_BURST: + DoCast(me, SPELL_FLAME_BURST); + Timer[EVENT_FLAME_BURST] = 15000; + break; + case EVENT_TRANSFORM_DEMON: + EnterPhase(PHASE_TRANSFORM_SEQUENCE); + break; + default: + break; + } + } + } +}; + +/********************************** End of Illidan AI ******************************************/ + +struct flame_of_azzinothAI : public ScriptedAI +{ + flame_of_azzinothAI(Creature *c) : ScriptedAI(c) {} + + uint32 FlameBlastTimer; + uint32 CheckTimer; + uint64 GlaiveGUID; + + void Reset() + { + FlameBlastTimer = 15000; + CheckTimer = 5000; + GlaiveGUID = 0; + } + + void EnterCombat(Unit * /*who*/) {DoZoneInCombat();} + + void ChargeCheck() + { + Unit *pTarget = SelectTarget(SELECT_TARGET_FARTHEST, 0, 200, false); + if (pTarget && (!me->IsWithinCombatRange(pTarget, FLAME_CHARGE_DISTANCE))) + { + me->AddThreat(pTarget, 5000000.0f); + AttackStart(pTarget); + DoCast(pTarget, SPELL_CHARGE); + me->MonsterTextEmote(EMOTE_SETS_GAZE_ON, pTarget->GetGUID()); + } + } + + void EnrageCheck() + { + if (GETUNIT(Glaive, GlaiveGUID)) + { + if (!me->IsWithinDistInMap(Glaive, FLAME_ENRAGE_DISTANCE)) + { + Glaive->InterruptNonMeleeSpells(true); + DoCast(me, SPELL_FLAME_ENRAGE, true); + DoResetThreat(); + Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (pTarget && pTarget->isAlive()) + { + me->AddThreat(me->getVictim(), 5000000.0f); + AttackStart(me->getVictim()); + } + } + else if (!me->HasAura(SPELL_AZZINOTH_CHANNEL)) + { + Glaive->CastSpell(me, SPELL_AZZINOTH_CHANNEL, false); + me->RemoveAurasDueToSpell(SPELL_FLAME_ENRAGE); + } + } + } + + void SetGlaiveGUID(uint64 guid){ GlaiveGUID = guid; } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (FlameBlastTimer <= diff) + { + DoCast(me->getVictim(), SPELL_BLAZE_SUMMON, true); //appear at victim + DoCast(me->getVictim(), SPELL_FLAME_BLAST); + FlameBlastTimer = 15000; //10000 is official-like? + DoZoneInCombat(); //in case someone is revived + } else FlameBlastTimer -= diff; + + if (CheckTimer <= diff) + { + ChargeCheck(); + EnrageCheck(); + CheckTimer = 1000; + } else CheckTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +/******* Functions and vars for Akama's AI ******/ +struct npc_akama_illidanAI : public ScriptedAI +{ + npc_akama_illidanAI(Creature* c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + JustCreated = true; + } + bool JustCreated; + ScriptedInstance* pInstance; + + PhaseAkama Phase; + bool Event; + uint32 Timer; + + uint64 IllidanGUID; + uint64 ChannelGUID; + uint64 SpiritGUID[2]; + uint64 GateGUID; + uint64 DoorGUID[2]; + + uint32 ChannelCount; + uint32 WalkCount; + uint32 TalkCount; + uint32 Check_Timer; + + void Reset() + { + WalkCount = 0; + if (pInstance) + { + pInstance->SetData(DATA_ILLIDANSTORMRAGEEVENT, NOT_STARTED); + + IllidanGUID = pInstance->GetData64(DATA_ILLIDANSTORMRAGE); + GateGUID = pInstance->GetData64(DATA_GAMEOBJECT_ILLIDAN_GATE); + DoorGUID[0] = pInstance->GetData64(DATA_GAMEOBJECT_ILLIDAN_DOOR_R); + DoorGUID[1] = pInstance->GetData64(DATA_GAMEOBJECT_ILLIDAN_DOOR_L); + + if (JustCreated)//close all doors at create + { + pInstance->HandleGameObject(GateGUID, false); + + for (uint8 i = 0; i < 2; ++i) + pInstance->HandleGameObject(DoorGUID[i], false); + //JustCreated = false; + }else + {//open all doors, raid wiped + pInstance->HandleGameObject(GateGUID, true); + WalkCount = 1;//skip first wp + for (uint8 i = 0; i < 2; ++i) + pInstance->HandleGameObject(DoorGUID[i], true); + } + } + else + { + IllidanGUID = 0; + GateGUID = 0; + DoorGUID[0] = 0; + DoorGUID[1] = 0; + } + + ChannelGUID = 0; + SpiritGUID[0] = 0; + SpiritGUID[1] = 0; + + Phase = PHASE_AKAMA_NULL; + Timer = 0; + + ChannelCount = 0; + TalkCount = 0; + Check_Timer = 5000; + + KillAllElites(); + + me->SetUInt32Value(UNIT_NPC_FLAGS, 0); // Database sometimes has strange values.. + me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + me->setActive(false); + me->SetVisibility(VISIBILITY_OFF); + } + + // Do not call reset in Akama's evade mode, as this will stop him from summoning minions after he kills the first bit + void EnterEvadeMode() + { + me->RemoveAllAuras(); + me->DeleteThreatList(); + me->CombatStop(true); + } + + void EnterCombat(Unit * /*who*/) {} + void MoveInLineOfSight(Unit* /*who*/) {} + + void MovementInform(uint32 MovementType, uint32 /*Data*/) + { + if (MovementType == POINT_MOTION_TYPE) + Timer = 1; + } + + void DamageTaken(Unit *done_by, uint32 &damage) + { + if (damage > me->GetHealth() || done_by->GetGUID() != IllidanGUID) + damage = 0; + } + + void KillAllElites() + { + std::list& threatList = me->getThreatManager().getThreatList(); + std::vector eliteList; + for (std::list::const_iterator itr = threatList.begin(); itr != threatList.end(); ++itr) + { + Unit* pUnit = Unit::GetUnit((*me), (*itr)->getUnitGuid()); + if (pUnit && pUnit->GetEntry() == ILLIDARI_ELITE) + eliteList.push_back(pUnit); + } + for (std::vector::const_iterator itr = eliteList.begin(); itr != eliteList.end(); ++itr) + (*itr)->setDeathState(JUST_DIED); + EnterEvadeMode(); + } + + void BeginTalk() + { + if (!pInstance) + return; + + pInstance->SetData(DATA_ILLIDANSTORMRAGEEVENT, IN_PROGRESS); + for (uint8 i = 0; i < 2; ++i) + pInstance->HandleGameObject(DoorGUID[i], false); + if (GETCRE(Illidan, IllidanGUID)) + { + Illidan->RemoveAurasDueToSpell(SPELL_KNEEL); + me->SetInFront(Illidan); + Illidan->SetInFront(me); + me->GetMotionMaster()->MoveIdle(); + Illidan->GetMotionMaster()->MoveIdle(); + CAST_AI(boss_illidan_stormrageAI, Illidan->AI())->AkamaGUID = me->GetGUID(); + CAST_AI(boss_illidan_stormrageAI, Illidan->AI())->EnterPhase(PHASE_TALK_SEQUENCE); + } + } + + void BeginChannel() + { + me->setActive(true); + me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + if (!JustCreated) + return; + float x, y, z; + if (GETGO(Gate, GateGUID)) + Gate->GetPosition(x, y, z); + else + return;//if door not spawned, don't crash server + + if (Creature* Channel = me->SummonCreature(ILLIDAN_DOOR_TRIGGER, x, y, z+5, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 360000)) + { + ChannelGUID = Channel->GetGUID(); + Channel->SetDisplayId(11686); // Invisible but spell visuals can still be seen. + DoCast(Channel, SPELL_AKAMA_DOOR_FAIL); + } + + for (uint8 i = 0; i < 2; ++i) + if (Creature* Spirit = me->SummonCreature(i ? SPIRIT_OF_OLUM : SPIRIT_OF_UDALO, SpiritSpawns[i].x, SpiritSpawns[i].y, SpiritSpawns[i].z, 0, TEMPSUMMON_TIMED_DESPAWN, 20000)) + { + Spirit->SetVisibility(VISIBILITY_OFF); + SpiritGUID[i] = Spirit->GetGUID(); + } + } + + void BeginWalk() + { + me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + me->SetSpeed(MOVE_RUN, 1.0f); + me->GetMotionMaster()->MovePoint(0, AkamaWP[WalkCount].x, AkamaWP[WalkCount].y, AkamaWP[WalkCount].z); + } + + void EnterPhase(PhaseAkama NextPhase) + { + if (!pInstance) + return; + switch(NextPhase) + { + case PHASE_CHANNEL: + BeginChannel(); + Timer = 5000; + ChannelCount = 0; + break; + case PHASE_WALK: + if (Phase == PHASE_CHANNEL) + WalkCount = 0; + else if (Phase == PHASE_TALK) + { + if (GETCRE(Illidan, IllidanGUID)) + CAST_AI(boss_illidan_stormrageAI, Illidan->AI())->DeleteFromThreatList(me->GetGUID()); + EnterEvadeMode(); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + ++WalkCount; + } + JustCreated = false; + BeginWalk(); + Timer = 0; + break; + case PHASE_TALK: + if (Phase == PHASE_WALK) + { + BeginTalk(); + Timer = 0; + } + else if (Phase == PHASE_FIGHT_ILLIDAN) + { + Timer = 1; + TalkCount = 0; + } + break; + case PHASE_FIGHT_ILLIDAN: + if (GETUNIT(Illidan, IllidanGUID)) + { + me->AddThreat(Illidan, 10000000.0f); + me->GetMotionMaster()->MoveChase(Illidan); + } + Timer = 30000; //chain lightning + break; + case PHASE_FIGHT_MINIONS: + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + Timer = 10000 + rand()%6000;//summon minion + break; + case PHASE_RETURN: + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + KillAllElites(); + WalkCount = 0; + BeginWalk(); + Timer = 1; + break; + default: + break; + } + Phase = NextPhase; + Event = false; + } + + void HandleTalkSequence() + { + switch(TalkCount) + { + case 0: + if (GETCRE(Illidan, IllidanGUID)) + { + CAST_AI(boss_illidan_stormrageAI, Illidan->AI())->Timer[EVENT_TAUNT] += 30000; + Illidan->MonsterYell(SAY_AKAMA_MINION, LANG_UNIVERSAL, 0); + DoPlaySoundToSet(Illidan, SOUND_AKAMA_MINION); + } + Timer = 8000; + break; + case 1: + me->MonsterYell(SAY_AKAMA_LEAVE, LANG_UNIVERSAL, 0); + DoPlaySoundToSet(me, SOUND_AKAMA_LEAVE); + Timer = 3000; + break; + case 2: + EnterPhase(PHASE_WALK); + break; + } + ++TalkCount; + } + + void HandleChannelSequence() + { + Unit* Channel = NULL, *Spirit[2]; + if (ChannelCount <= 5) + { + Channel = Unit::GetUnit((*me), ChannelGUID); + Spirit[0] = Unit::GetUnit((*me), SpiritGUID[0]); + Spirit[1] = Unit::GetUnit((*me), SpiritGUID[1]); + if (!Channel || !Spirit[0] || !Spirit[1]) + return; + } + + switch(ChannelCount) + { + case 0: // channel failed + me->InterruptNonMeleeSpells(true); + Timer = 2000; + break; + case 1: // spirit appear + Spirit[0]->SetVisibility(VISIBILITY_ON); + Spirit[1]->SetVisibility(VISIBILITY_ON); + Timer = 2000; + break; + case 2: // spirit help + DoCast(Channel, SPELL_AKAMA_DOOR_CHANNEL); + Spirit[0]->CastSpell(Channel, SPELL_DEATHSWORN_DOOR_CHANNEL,false); + Spirit[1]->CastSpell(Channel, SPELL_DEATHSWORN_DOOR_CHANNEL,false); + Timer = 5000; + break; + case 3: //open the gate + me->InterruptNonMeleeSpells(true); + Spirit[0]->InterruptNonMeleeSpells(true); + Spirit[1]->InterruptNonMeleeSpells(true); + if (pInstance) + pInstance->HandleGameObject(GateGUID, true); + Timer = 2000; + break; + case 4: + me->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE); + Timer = 2000; + break; + case 5: + me->MonsterYell(SAY_AKAMA_BEWARE, LANG_UNIVERSAL, 0); + DoPlaySoundToSet(me, SOUND_AKAMA_BEWARE); + Channel->setDeathState(JUST_DIED); + Spirit[0]->SetVisibility(VISIBILITY_OFF); + Spirit[1]->SetVisibility(VISIBILITY_OFF); + Timer = 3000; + break; + case 6: + EnterPhase(PHASE_WALK); + break; + default: + break; + } + ++ChannelCount; + } + + void HandleWalkSequence() + { + switch(WalkCount) + { + case 6: + for (uint8 i = 0; i < 2; ++i) + if (pInstance) + pInstance->HandleGameObject(DoorGUID[i], true); + break; + case 8: + if (Phase == PHASE_WALK) + EnterPhase(PHASE_TALK); + else + EnterPhase(PHASE_FIGHT_ILLIDAN); + break; + case 12: + EnterPhase(PHASE_FIGHT_MINIONS); + break; + } + + if (Phase == PHASE_WALK) + { + Timer = 0; + ++WalkCount; + me->GetMotionMaster()->MovePoint(WalkCount, AkamaWP[WalkCount].x, AkamaWP[WalkCount].y, AkamaWP[WalkCount].z); + } + } + + void UpdateAI(const uint32 diff) + { + if (me->GetVisibility() == VISIBILITY_OFF) + { + if (Check_Timer <= diff) + { + if (pInstance && pInstance->GetData(DATA_ILLIDARICOUNCILEVENT) == DONE) + me->SetVisibility(VISIBILITY_ON); + + Check_Timer = 5000; + } else Check_Timer -= diff; + } + Event = false; + if (Timer) + { + if (Timer <= diff) + Event = true; + else Timer -= diff; + } + + if (Event) + { + switch(Phase) + { + case PHASE_CHANNEL: + if (JustCreated) + HandleChannelSequence(); + else{ + EnterPhase(PHASE_WALK); + } + break; + case PHASE_TALK: + HandleTalkSequence(); + break; + case PHASE_WALK: + case PHASE_RETURN: + HandleWalkSequence(); + break; + case PHASE_FIGHT_ILLIDAN: + { + GETUNIT(Illidan, IllidanGUID); + if (Illidan && HPPCT(Illidan) < 90) + EnterPhase(PHASE_TALK); + else + { + DoCast(me->getVictim(), SPELL_CHAIN_LIGHTNING); + Timer = 30000; + } + } + break; + case PHASE_FIGHT_MINIONS: + { + float x, y, z; + me->GetPosition(x, y, z); + Creature* Elite = me->SummonCreature(ILLIDARI_ELITE, x+rand()%10, y+rand()%10, z, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30000); + //Creature* Elite = me->SummonCreature(ILLIDARI_ELITE, x, y, z, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30000); + if (Elite) + { + Elite->AI()->AttackStart(me); + Elite->AddThreat(me, 1000000.0f); + AttackStart(Elite); + me->AddThreat(Elite, 1000000.0f); + } + Timer = 10000 + rand()%6000; + GETUNIT(Illidan, IllidanGUID); + if (Illidan && HPPCT(Illidan) < 10) + EnterPhase(PHASE_RETURN); + } + break; + default: + break; + } + } + + if (!UpdateVictim()) + return; + + if (me->GetHealth()*100 / me->GetMaxHealth() < 20) + DoCast(me, SPELL_HEALING_POTION); + + DoMeleeAttackIfReady(); + } +}; + +struct boss_maievAI : public ScriptedAI +{ + boss_maievAI(Creature *c) : ScriptedAI(c) {}; + + uint64 IllidanGUID; + + PhaseIllidan Phase; + EventMaiev Event; + uint32 Timer[5]; + uint32 MaxTimer; + + void Reset() + { + MaxTimer = 0; + Phase = PHASE_NORMAL_MAIEV; + IllidanGUID = 0; + Timer[EVENT_MAIEV_STEALTH] = 0; + Timer[EVENT_MAIEV_TAUNT] = 22000 + rand()%21 * 1000; + Timer[EVENT_MAIEV_SHADOW_STRIKE] = 30000; + SetEquipmentSlots(false, 44850, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); + me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2, 45738); + } + + void EnterCombat(Unit * /*who*/) {} + void MoveInLineOfSight(Unit * /*who*/) {} + void EnterEvadeMode() {} + void GetIllidanGUID(uint64 guid) { IllidanGUID = guid; } + + void DamageTaken(Unit *done_by, uint32 &damage) + { + if (done_by->GetGUID() != IllidanGUID) + damage = 0; + else + { + GETUNIT(Illidan, IllidanGUID); + if (Illidan && Illidan->getVictim() == me) + damage = me->GetMaxHealth()/10; + if (damage >= me->GetHealth()) + damage = 0; + } + } + + void AttackStart(Unit *who) + { + if (!who || Timer[EVENT_MAIEV_STEALTH]) + return; + + if (Phase == PHASE_TALK_SEQUENCE) + AttackStartNoMove(who); + else if (Phase == PHASE_DEMON || Phase == PHASE_TRANSFORM_SEQUENCE) + { + GETUNIT(Illidan, IllidanGUID); + if (Illidan && me->IsWithinDistInMap(Illidan, 25)) + BlinkToPlayer();//Do not let dread aura hurt her. + AttackStartNoMove(who); + } + else + ScriptedAI::AttackStart(who); + } + + void DoAction(const int32 param) + { + if (param > PHASE_ILLIDAN_NULL && param < PHASE_ILLIDAN_MAX) + EnterPhase(PhaseIllidan(param)); + } + + void EnterPhase(PhaseIllidan NextPhase)//This is in fact Illidan's phase. + { + switch(NextPhase) + { + case PHASE_TALK_SEQUENCE: + if (Timer[EVENT_MAIEV_STEALTH]) + { + me->SetHealth(me->GetMaxHealth()); + me->SetVisibility(VISIBILITY_ON); + Timer[EVENT_MAIEV_STEALTH] = 0; + } + me->InterruptNonMeleeSpells(false); + me->GetMotionMaster()->Clear(false); + me->AttackStop(); + me->SetUInt64Value(UNIT_FIELD_TARGET, IllidanGUID); + MaxTimer = 0; + break; + case PHASE_TRANSFORM_SEQUENCE: + MaxTimer = 4; + Timer[EVENT_MAIEV_TAUNT] += 10000; + Timer[EVENT_MAIEV_THROW_DAGGER] = 2000; + break; + case PHASE_DEMON: + break; + case PHASE_NORMAL_MAIEV: + MaxTimer = 4; + Timer[EVENT_MAIEV_TAUNT] += 10000; + Timer[EVENT_MAIEV_TRAP] = 22000; + break; + default: + break; + } + if (Timer[EVENT_MAIEV_STEALTH]) + MaxTimer = 1; + Phase = NextPhase; + } + + void BlinkTo(float x, float y, float z) + { + me->AttackStop(); + me->InterruptNonMeleeSpells(false); + me->GetMotionMaster()->Clear(false); + DoTeleportTo(x, y, z); + DoCast(me, SPELL_TELEPORT_VISUAL, true); + } + + void BlinkToPlayer() + { + if (GETCRE(Illidan, IllidanGUID)) + { + Unit *pTarget = CAST_AI(boss_illidan_stormrageAI, Illidan->AI())->SelectUnit(SELECT_TARGET_RANDOM, 0); + + if (!pTarget || !me->IsWithinDistInMap(pTarget, 80) || Illidan->IsWithinDistInMap(pTarget, 20)) + { + uint8 pos = rand()%4; + BlinkTo(HoverPosition[pos].x, HoverPosition[pos].y, HoverPosition[pos].z); + } + else + { + float x, y, z; + pTarget->GetPosition(x, y, z); + BlinkTo(x, y, z); + } + } + } + + void UpdateAI(const uint32 diff) + { + if ((!UpdateVictim()) + && !Timer[EVENT_MAIEV_STEALTH]) + return; + + Event = EVENT_MAIEV_NULL; + for (uint8 i = 1; i <= MaxTimer; ++i) + if (Timer[i]) + { + if (Timer[i] <= diff) + Event = (EventMaiev)i; + else Timer[i] -= diff; + } + + switch(Event) + { + case EVENT_MAIEV_STEALTH: + { + me->SetHealth(me->GetMaxHealth()); + me->SetVisibility(VISIBILITY_ON); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + Timer[EVENT_MAIEV_STEALTH] = 0; + BlinkToPlayer(); + EnterPhase(Phase); + } + break; + case EVENT_MAIEV_TAUNT: + { + uint32 random = rand()%4; + char* text = MaievTaunts[random].text; + uint32 sound = MaievTaunts[random].sound; + me->MonsterYell(text, LANG_UNIVERSAL, 0); + DoPlaySoundToSet(me, sound); + Timer[EVENT_MAIEV_TAUNT] = 22000 + rand()%21 * 1000; + } + break; + case EVENT_MAIEV_SHADOW_STRIKE: + DoCast(me->getVictim(), SPELL_SHADOW_STRIKE); + Timer[EVENT_MAIEV_SHADOW_STRIKE] = 60000; + break; + case EVENT_MAIEV_TRAP: + if (Phase == PHASE_NORMAL_MAIEV) + { + BlinkToPlayer(); + DoCast(me, SPELL_CAGE_TRAP_SUMMON); + Timer[EVENT_MAIEV_TRAP] = 22000; + } + else + { + if (!me->IsWithinDistInMap(me->getVictim(), 40)) + me->GetMotionMaster()->MoveChase(me->getVictim(), 30); + DoCast(me->getVictim(), SPELL_THROW_DAGGER); + Timer[EVENT_MAIEV_THROW_DAGGER] = 2000; + } + break; + default: + break; + } + + if (me->GetHealth()*100 / me->GetMaxHealth() < 50) + { + me->SetVisibility(VISIBILITY_OFF); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + if (GETCRE(Illidan, IllidanGUID)) + CAST_AI(boss_illidan_stormrageAI, Illidan->AI())->DeleteFromThreatList(me->GetGUID()); + me->AttackStop(); + Timer[EVENT_MAIEV_STEALTH] = 60000; //reappear after 1 minute + MaxTimer = 1; + } + + if (Phase == PHASE_NORMAL_MAIEV) + DoMeleeAttackIfReady(); + } +}; + +bool GossipSelect_npc_akama_at_illidan(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF) // Time to begin the Event + { + pPlayer->CLOSE_GOSSIP_MENU(); + CAST_AI(npc_akama_illidanAI, pCreature->AI())->EnterPhase(PHASE_CHANNEL); + } + return true; +} + +bool GossipHello_npc_akama_at_illidan(Player* pPlayer, Creature* pCreature) +{ + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + pPlayer->SEND_GOSSIP_MENU(10465, pCreature->GetGUID()); + + return true; +} + +struct cage_trap_triggerAI : public ScriptedAI +{ + cage_trap_triggerAI(Creature *c) : ScriptedAI(c) {} + + uint64 IllidanGUID; + uint32 DespawnTimer; + + bool Active; + bool SummonedBeams; + + void Reset() + { + IllidanGUID = 0; + + Active = false; + SummonedBeams = false; + + DespawnTimer = 0; + + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + } + + void EnterCombat(Unit * /*who*/){} + + void MoveInLineOfSight(Unit *who) + { + if (!Active) + return; + + if (who && (who->GetTypeId() != TYPEID_PLAYER)) + { + if (who->GetEntry() == ILLIDAN_STORMRAGE) // Check if who is Illidan + { + if (!IllidanGUID && me->IsWithinDistInMap(who, 3) && (!who->HasAura(SPELL_CAGED))) + { + IllidanGUID = who->GetGUID(); + who->CastSpell(who, SPELL_CAGED, true); + DespawnTimer = 5000; + if (who->HasAura(SPELL_ENRAGE)) + who->RemoveAurasDueToSpell(SPELL_ENRAGE); // Dispel his enrage + //if (GameObject* CageTrap = pInstance->instance->GetGameObject(pInstance->GetData64(CageTrapGUID))) + // CageTrap->SetLootState(GO_JUST_DEACTIVATED); + } + } + } + } + + void UpdateAI(const uint32 diff) + { + if (DespawnTimer) + if (DespawnTimer <= diff) + me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + else DespawnTimer -= diff; + + //if (IllidanGUID && !SummonedBeams) + //{ + // if (Unit* Illidan = Unit::GetUnit(*me, IllidanGUID) + // { + // //TODO: Find proper spells and properly apply 'caged' Illidan effect + // } + //} + } +}; + +bool GOHello_cage_trap(Player* pPlayer, GameObject* pGo) +{ + float x, y, z; + pPlayer->GetPosition(x, y, z); + + // Grid search for nearest live Creature of entry 23304 within 10 yards + if (Creature* pTrigger = pGo->FindNearestCreature(23304, 10.0f)) + CAST_AI(cage_trap_triggerAI, pTrigger->AI())->Active = true; + pGo->SetGoState(GO_STATE_ACTIVE); + return true; +} + +struct shadow_demonAI : public ScriptedAI +{ + shadow_demonAI(Creature *c) : ScriptedAI(c) {} + + uint64 TargetGUID; + + void EnterCombat(Unit * /*who*/) {DoZoneInCombat();} + + void Reset() + { + TargetGUID = 0; + DoCast(me, SPELL_SHADOW_DEMON_PASSIVE, true); + } + + void JustDied(Unit * /*killer*/) + { + if (Unit *pTarget = Unit::GetUnit((*me), TargetGUID)) + pTarget->RemoveAurasDueToSpell(SPELL_PARALYZE); + } + + void UpdateAI(const uint32 /*diff*/) + { + if (!UpdateVictim()) return; + + if (me->getVictim()->GetTypeId() != TYPEID_PLAYER) return; // Only cast the below on players. + + if (!me->getVictim()->HasAura(SPELL_PARALYZE)) + { + TargetGUID = me->getVictim()->GetGUID(); + me->AddThreat(me->getVictim(), 10000000.0f); + DoCast(me->getVictim(), SPELL_PURPLE_BEAM, true); + DoCast(me->getVictim(), SPELL_PARALYZE, true); + } + // Kill our target if we're very close. + if (me->IsWithinDistInMap(me->getVictim(), 3)) + DoCast(me->getVictim(), SPELL_CONSUME_SOUL); + } +}; + +// Shadowfiends interact with Illidan, setting more targets in Illidan's hashmap +struct mob_parasitic_shadowfiendAI : public ScriptedAI +{ + mob_parasitic_shadowfiendAI(Creature* c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + uint64 IllidanGUID; + uint32 CheckTimer; + + void Reset() + { + if (pInstance) + IllidanGUID = pInstance->GetData64(DATA_ILLIDANSTORMRAGE); + else + IllidanGUID = 0; + + CheckTimer = 5000; + DoCast(me, SPELL_SHADOWFIEND_PASSIVE, true); + } + + void EnterCombat(Unit* /*who*/) { DoZoneInCombat(); } + + void DoMeleeAttackIfReady() + { + if (me->isAttackReady() && me->IsWithinMeleeRange(me->getVictim())) + { + if (!me->getVictim()->HasAura(SPELL_PARASITIC_SHADOWFIEND) + && !me->getVictim()->HasAura(SPELL_PARASITIC_SHADOWFIEND2)) + { + if (Creature* illidan = Unit::GetCreature((*me),IllidanGUID))//summon only in 1. phase + if (CAST_AI(boss_illidan_stormrageAI, illidan->AI())->Phase == PHASE_NORMAL) + me->CastSpell(me->getVictim(), SPELL_PARASITIC_SHADOWFIEND2, true, 0, 0, IllidanGUID); //do not stack + } + me->AttackerStateUpdate(me->getVictim()); + me->resetAttackTimer(); + } + } + + void UpdateAI(const uint32 diff) + { + if (!me->getVictim()) + { + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 999, true)) + AttackStart(pTarget); + else + { + me->SetVisibility(VISIBILITY_OFF); + me->setDeathState(JUST_DIED); + return; + } + } + + if (CheckTimer <= diff) + { + GETUNIT(Illidan, IllidanGUID); + if (!Illidan || CAST_CRE(Illidan)->IsInEvadeMode()) + { + me->SetVisibility(VISIBILITY_OFF); + me->setDeathState(JUST_DIED); + return; + } else CheckTimer = 5000; + } else CheckTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct blade_of_azzinothAI : public NullCreatureAI +{ + blade_of_azzinothAI(Creature* c) : NullCreatureAI(c) {} + + void SpellHit(Unit * /*caster*/, const SpellEntry *spell) + { + if (spell->Id == SPELL_THROW_GLAIVE2 || spell->Id == SPELL_THROW_GLAIVE) + me->SetDisplayId(21431);//appear when hit by Illidan's glaive + } +}; + +void boss_illidan_stormrageAI::Reset() +{ + if (pInstance) + pInstance->SetData(DATA_ILLIDANSTORMRAGEEVENT, NOT_STARTED); + + if (AkamaGUID) + { + if (GETCRE(Akama, AkamaGUID)) + { + if (!Akama->isAlive()) + Akama->Respawn(); + else + { + CAST_AI(npc_akama_illidanAI, Akama->AI())->EnterEvadeMode(); + Akama->GetMotionMaster()->MoveTargetedHome(); + CAST_AI(npc_akama_illidanAI, Akama->AI())->Reset(); + } + } + AkamaGUID = 0; + } + + MaievGUID = 0; + for (uint8 i = 0; i < 2; ++i) + { + FlameGUID[i] = 0; + GlaiveGUID[i] = 0; + } + + Phase = PHASE_ILLIDAN_NULL; + Event = EVENT_NULL; + Timer[EVENT_BERSERK] = 1500000; + + HoverPoint = 0; + TalkCount = 0; + FlightCount = 0; + TransformCount = 0; + + me->SetDisplayId(21135); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); + me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->setActive(false); + Summons.DespawnAll(); +} + +void boss_illidan_stormrageAI::JustSummoned(Creature* summon) +{ + Summons.Summon(summon); + switch(summon->GetEntry()) + { + case PARASITIC_SHADOWFIEND: + { + if (Phase == PHASE_TALK_SEQUENCE) + { + summon->SetVisibility(VISIBILITY_OFF); + summon->setDeathState(JUST_DIED); + return; + } + Unit *pTarget = SelectTarget(SELECT_TARGET_TOPAGGRO, 0, 999, true); + if (!pTarget || pTarget->HasAura(SPELL_PARASITIC_SHADOWFIEND) + || pTarget->HasAura(SPELL_PARASITIC_SHADOWFIEND2)) + pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 999, true); + if (pTarget) + summon->AI()->AttackStart(pTarget); + } + break; + case SHADOW_DEMON: + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 999, true)) // only on players. + { + summon->AddThreat(pTarget, 5000000.0f); + summon->AI()->AttackStart(pTarget); + } + break; + case MAIEV_SHADOWSONG: + { + summon->SetVisibility(VISIBILITY_OFF); // Leave her invisible until she has to talk + summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + MaievGUID = summon->GetGUID(); + CAST_AI(boss_maievAI, summon->AI())->GetIllidanGUID(me->GetGUID()); + summon->AI()->DoAction(PHASE_TALK_SEQUENCE); + } + break; + case FLAME_OF_AZZINOTH: + { + summon->AI()->AttackStart(summon->SelectNearestTarget(999)); + } + break; + default: + break; + } +} + +void boss_illidan_stormrageAI::HandleTalkSequence() +{ + switch(TalkCount) + { + case 0: + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + break; + case 8: + // Equip our warglaives! + SetEquipmentSlots(false, EQUIP_ID_MAIN_HAND, EQUIP_ID_OFF_HAND, EQUIP_NO_CHANGE); + me->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE); + me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + break; + case 9: + if (GETCRE(Akama, AkamaGUID)) + { + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE); + me->AddThreat(Akama, 100.0f); + CAST_AI(npc_akama_illidanAI, Akama->AI())->EnterPhase(PHASE_FIGHT_ILLIDAN); + EnterPhase(PHASE_NORMAL); + } + break; + case 10: + SummonMaiev(); + break; + case 11: + if (GETUNIT(Maiev, MaievGUID)) + { + Maiev->SetVisibility(VISIBILITY_ON); // Maiev is now visible + Maiev->CastSpell(Maiev, SPELL_TELEPORT_VISUAL, true); // onoz she looks like she teleported! + Maiev->SetInFront(me); // Have her face us + me->SetInFront(Maiev); // Face her, so it's not rude =P + Maiev->GetMotionMaster()->MoveIdle(); + me->GetMotionMaster()->MoveIdle(); + } + break; + case 14: + if (GETCRE(Maiev, MaievGUID)) + { + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE); + Maiev->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE); + Maiev->AddThreat(me, 10000000.0f); // Have Maiev add a lot of threat on us so that players don't pull her off if they damage her via AOE + Maiev->AI()->AttackStart(me); // Force Maiev to attack us. + EnterPhase(PHASE_NORMAL_MAIEV); + } + break; + case 15: + DoCast(me, SPELL_DEATH); // Animate his kneeling + stun him + Summons.DespawnAll(); + break; + case 17: + if (GETUNIT(Akama, AkamaGUID)) + { + if (!me->IsWithinDistInMap(Akama, 15)) + { + float x, y, z; + me->GetPosition(x, y, z); + x += 10; y += 10; + Akama->GetMotionMaster()->Clear(false); + //Akama->GetMotionMaster()->MoveIdle(); + Akama->GetMap()->CreatureRelocation(me, x, y, z, 0.0f); + Akama->SendMonsterMove(x, y, z, 0, MOVEMENTFLAG_NONE, 0);//Illidan must not die until Akama arrives. + Akama->GetMotionMaster()->MoveChase(me); + } + } + break; + case 19: // Make Maiev leave + if (GETUNIT(Maiev, MaievGUID)) + { + Maiev->CastSpell(Maiev, SPELL_TELEPORT_VISUAL, true); + Maiev->setDeathState(JUST_DIED); + me->SetUInt32Value(UNIT_FIELD_BYTES_1,UNIT_STAND_STATE_DEAD); + } + break; + case 21: // Kill ourself. + me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + break; + default: + break; + } + if (Phase == PHASE_TALK_SEQUENCE) + Talk(TalkCount); // This function does most of the talking + ++TalkCount; +} + +void boss_illidan_stormrageAI::CastEyeBlast() +{ + me->InterruptNonMeleeSpells(false); + + me->MonsterYell(SAY_EYE_BLAST, LANG_UNIVERSAL, 0); + DoPlaySoundToSet(me, SOUND_EYE_BLAST); + + float distx, disty, dist[2]; + for (uint8 i = 0; i < 2; ++i) + { + distx = EyeBlast[i].x - HoverPosition[HoverPoint].x; + disty = EyeBlast[i].y - HoverPosition[HoverPoint].y; + dist[i] = distx * distx + disty * disty; + } + Locations initial = EyeBlast[dist[0] < dist[1] ? 0 : 1]; + for (uint8 i = 0; i < 2; ++i) + { + distx = GlaivePosition[i].x - HoverPosition[HoverPoint].x; + disty = GlaivePosition[i].y - HoverPosition[HoverPoint].y; + dist[i] = distx * distx + disty * disty; + } + Locations final = GlaivePosition[dist[0] < dist[1] ? 0 : 1]; + + final.x = 2 * final.x - initial.x; + final.y = 2 * final.y - initial.y; + + Creature* Trigger = me->SummonCreature(23069, initial.x, initial.y, initial.z, 0, TEMPSUMMON_TIMED_DESPAWN, 13000); + if (!Trigger) return; + + Trigger->SetSpeed(MOVE_WALK, 3); + Trigger->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + Trigger->GetMotionMaster()->MovePoint(0, final.x, final.y, final.z); + + //Trigger->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetUInt64Value(UNIT_FIELD_TARGET, Trigger->GetGUID()); + DoCast(Trigger, SPELL_EYE_BLAST); +} + +void boss_illidan_stormrageAI::SummonFlamesOfAzzinoth() +{ + me->MonsterYell(SAY_SUMMONFLAMES, LANG_UNIVERSAL, 0); + DoPlaySoundToSet(me, SOUND_SUMMONFLAMES); + + for (uint8 i = 0; i < 2; ++i) + { + if (GETUNIT(Glaive, GlaiveGUID[i])) + { + Creature* Flame = me->SummonCreature(FLAME_OF_AZZINOTH, GlaivePosition[i+2].x, GlaivePosition[i+2].y, GlaivePosition[i+2].z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000); + if (Flame) + { + Flame->setFaction(me->getFaction()); // Just in case the database has it as a different faction + Flame->SetMeleeDamageSchool(SPELL_SCHOOL_FIRE); + FlameGUID[i] = Flame->GetGUID(); // Record GUID in order to check if they're dead later on to move to the next phase + CAST_AI(flame_of_azzinothAI, Flame->AI())->SetGlaiveGUID(GlaiveGUID[i]); + Glaive->CastSpell(Flame, SPELL_AZZINOTH_CHANNEL, false); // Glaives do some random Beam type channel on it. + } + } + } +} + +void boss_illidan_stormrageAI::SummonMaiev() +{ + DoCast(me, SPELL_SHADOW_PRISON, true); + DoCast(me, 40403, true); + if (!MaievGUID) // If Maiev cannot be summoned, reset the encounter and post some errors to the console. + { + EnterEvadeMode(); + me->MonsterTextEmote(EMOTE_UNABLE_TO_SUMMON, 0); + error_log("SD2 ERROR: Unable to summon Maiev Shadowsong (entry: 23197). Check your database to see if you have the proper SQL for Maiev Shadowsong (entry: 23197)"); + } +} + +void boss_illidan_stormrageAI::EnterPhase(PhaseIllidan NextPhase) +{ + DoZoneInCombat(); + switch(NextPhase) + { + case PHASE_NORMAL: + case PHASE_NORMAL_2: + case PHASE_NORMAL_MAIEV: + AttackStart(me->getVictim()); + Timer[EVENT_TAUNT] = 32000; + Timer[EVENT_SHEAR] = 10000 + rand()%15 * 1000; + Timer[EVENT_FLAME_CRASH] = 20000; + Timer[EVENT_PARASITIC_SHADOWFIEND] = 25000; + Timer[EVENT_PARASITE_CHECK] = 0; + Timer[EVENT_DRAW_SOUL] = 30000; + if (NextPhase == PHASE_NORMAL) + break; + Timer[EVENT_AGONIZING_FLAMES] = 35000; + Timer[EVENT_TRANSFORM_NORMAL] = 60000; + if (NextPhase == PHASE_NORMAL_2) + break; + Timer[EVENT_ENRAGE] = 30000 + rand()%10 * 1000; + break; + case PHASE_FLIGHT: + Timer[EVENT_FIREBALL] = 1000; + if (!(rand()%4)) + Timer[EVENT_DARK_BARRAGE] = 10000; + Timer[EVENT_EYE_BLAST] = 10000 + rand()%15 * 1000; + Timer[EVENT_MOVE_POINT] = 20000 + rand()%20 * 1000; + break; + case PHASE_DEMON: + Timer[EVENT_SHADOW_BLAST] = 1000; + Timer[EVENT_FLAME_BURST] = 10000; + Timer[EVENT_SHADOWDEMON] = 30000; + Timer[EVENT_TRANSFORM_DEMON] = 60000; + AttackStart(me->getVictim()); + break; + case PHASE_TALK_SEQUENCE: + Timer[EVENT_TALK_SEQUENCE] = 100; + me->RemoveAllAuras(); + me->InterruptNonMeleeSpells(false); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE); + me->GetMotionMaster()->Clear(false); + me->AttackStop(); + break; + case PHASE_FLIGHT_SEQUENCE: + if (Phase == PHASE_NORMAL) //lift off + { + FlightCount = 1; + Timer[EVENT_FLIGHT_SEQUENCE] = 1; + me->RemoveAllAuras(); + me->InterruptNonMeleeSpells(false); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->GetMotionMaster()->Clear(false); + me->AttackStop(); + } + else //land + Timer[EVENT_FLIGHT_SEQUENCE] = 2000; + break; + case PHASE_TRANSFORM_SEQUENCE: + if (Phase == PHASE_DEMON) + Timer[EVENT_TRANSFORM_SEQUENCE] = 500; + else + { + TransformCount = 0; + Timer[EVENT_TRANSFORM_SEQUENCE] = 500; + me->MonsterYell(SAY_MORPH, LANG_UNIVERSAL, 0); + DoPlaySoundToSet(me, SOUND_MORPH); + } + me->GetMotionMaster()->Clear(); + me->AttackStop(); + break; + default: + break; + } + if (MaievGUID) + { + GETCRE(Maiev, MaievGUID); + if (Maiev && Maiev->isAlive()) + Maiev->AI()->DoAction(NextPhase); + } + Phase = NextPhase; + Event = EVENT_NULL; +} + +CreatureAI* GetAI_boss_illidan_stormrage(Creature* pCreature) +{ + return new boss_illidan_stormrageAI (pCreature); +} + +CreatureAI* GetAI_npc_akama_at_illidan(Creature* pCreature) +{ + return new npc_akama_illidanAI(pCreature); +} + +CreatureAI* GetAI_boss_maiev(Creature* pCreature) +{ + return new boss_maievAI (pCreature); +} + +CreatureAI* GetAI_mob_flame_of_azzinoth(Creature* pCreature) +{ + return new flame_of_azzinothAI (pCreature); +} + +CreatureAI* GetAI_cage_trap_trigger(Creature* pCreature) +{ + return new cage_trap_triggerAI (pCreature); +} + +CreatureAI* GetAI_shadow_demon(Creature* pCreature) +{ + return new shadow_demonAI (pCreature); +} + +CreatureAI* GetAI_blade_of_azzinoth(Creature* pCreature) +{ + return new blade_of_azzinothAI (pCreature); +} + +CreatureAI* GetAI_parasitic_shadowfiend(Creature* pCreature) +{ + return new mob_parasitic_shadowfiendAI (pCreature); +} + +void AddSC_boss_illidan() +{ + Script* newscript; + + newscript = new Script; + newscript->Name = "boss_illidan_stormrage"; + newscript->GetAI = &GetAI_boss_illidan_stormrage; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_akama_illidan"; + newscript->GetAI = &GetAI_npc_akama_at_illidan; + newscript->pGossipHello = &GossipHello_npc_akama_at_illidan; + newscript->pGossipSelect = &GossipSelect_npc_akama_at_illidan; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_maiev_shadowsong"; + newscript->GetAI = &GetAI_boss_maiev; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_flame_of_azzinoth"; + newscript->GetAI = &GetAI_mob_flame_of_azzinoth; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_blade_of_azzinoth"; + newscript->GetAI = &GetAI_blade_of_azzinoth; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "gameobject_cage_trap"; + newscript->pGOHello = &GOHello_cage_trap; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_cage_trap_trigger"; + newscript->GetAI = &GetAI_cage_trap_trigger; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_shadow_demon"; + newscript->GetAI = &GetAI_shadow_demon; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_parasitic_shadowfiend"; + newscript->GetAI = &GetAI_parasitic_shadowfiend; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp b/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp new file mode 100644 index 00000000000..5949fc46511 --- /dev/null +++ b/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp @@ -0,0 +1,302 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Mother_Shahraz +SD%Complete: 80 +SDComment: Saber Lash missing, Fatal Attraction slightly incorrect; need to damage only if affected players are within range of each other +SDCategory: Black Temple +EndScriptData */ + +#include "ScriptedPch.h" +#include "black_temple.h" + +//Speech'n'Sounds +#define SAY_TAUNT1 -1564018 +#define SAY_TAUNT2 -1564019 +#define SAY_TAUNT3 -1564020 +#define SAY_AGGRO -1564021 +#define SAY_SPELL1 -1564022 +#define SAY_SPELL2 -1564023 +#define SAY_SPELL3 -1564024 +#define SAY_SLAY1 -1564025 +#define SAY_SLAY2 -1564026 +#define SAY_ENRAGE -1564027 +#define SAY_DEATH -1564028 + +//Spells +#define SPELL_BEAM_SINISTER 40859 +#define SPELL_BEAM_VILE 40860 +#define SPELL_BEAM_WICKED 40861 +#define SPELL_BEAM_SINFUL 40827 +#define SPELL_ATTRACTION 40871 +#define SPELL_SILENCING_SHRIEK 40823 +#define SPELL_ENRAGE 23537 +#define SPELL_SABER_LASH 40810//43267 +#define SPELL_SABER_LASH_IMM 43690 +#define SPELL_TELEPORT_VISUAL 40869 +#define SPELL_BERSERK 45078 + +uint32 PrismaticAuras[]= +{ + 40880, // Shadow + 40882, // Fire + 40883, // Nature + 40891, // Arcane + 40896, // Frost + 40897, // Holy +}; + +struct Locations +{ + float x,y,z; +}; + +static Locations TeleportPoint[]= +{ + {959.996, 212.576, 193.843}, + {932.537, 231.813, 193.838}, + {958.675, 254.767, 193.822}, + {946.955, 201.316, 192.535}, + {944.294, 149.676, 197.551}, + {930.548, 284.888, 193.367}, + {965.997, 278.398, 195.777} +}; + +struct boss_shahrazAI : public ScriptedAI +{ + boss_shahrazAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint64 TargetGUID[3]; + uint32 BeamTimer; + uint32 BeamCount; + uint32 CurrentBeam; + uint32 PrismaticShieldTimer; + uint32 FatalAttractionTimer; + uint32 FatalAttractionExplodeTimer; + uint32 ShriekTimer; + uint32 SaberTimer; + uint32 RandomYellTimer; + uint32 EnrageTimer; + uint32 ExplosionCount; + + bool Enraged; + + void Reset() + { + if (pInstance) + pInstance->SetData(DATA_MOTHERSHAHRAZEVENT, NOT_STARTED); + + for (uint8 i = 0; i<3; ++i) + TargetGUID[i] = 0; + + BeamTimer = 20000; // Timers may be incorrect + BeamCount = 0; + CurrentBeam = 0; // 0 - Sinister, 1 - Vile, 2 - Wicked, 3 - Sinful + PrismaticShieldTimer = 0; + FatalAttractionTimer = 60000; + FatalAttractionExplodeTimer = 70000; + ShriekTimer = 30000; + SaberTimer = 35000; + RandomYellTimer = 70000 + rand()%41 * 1000; + EnrageTimer = 600000; + ExplosionCount = 0; + + Enraged = false; + } + + void EnterCombat(Unit * /*who*/) + { + if (pInstance) + pInstance->SetData(DATA_MOTHERSHAHRAZEVENT, IN_PROGRESS); + + DoZoneInCombat(); + DoScriptText(SAY_AGGRO, me); + } + + void KilledUnit(Unit * /*victim*/) + { + DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me); + } + + void JustDied(Unit * /*victim*/) + { + if (pInstance) + pInstance->SetData(DATA_MOTHERSHAHRAZEVENT, DONE); + + DoScriptText(SAY_DEATH, me); + } + + void TeleportPlayers() + { + uint32 random = rand()%7; + float X = TeleportPoint[random].x; + float Y = TeleportPoint[random].y; + float Z = TeleportPoint[random].z; + for (uint8 i = 0; i < 3; ++i) + { + Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 1); + if (pUnit && pUnit->isAlive() && (pUnit->GetTypeId() == TYPEID_PLAYER)) + { + TargetGUID[i] = pUnit->GetGUID(); + pUnit->CastSpell(pUnit, SPELL_TELEPORT_VISUAL, true); + DoTeleportPlayer(pUnit, X, Y, Z, pUnit->GetOrientation()); + } + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (((me->GetHealth()*100 / me->GetMaxHealth()) < 10) && !Enraged) + { + Enraged = true; + DoCast(me, SPELL_ENRAGE, true); + DoScriptText(SAY_ENRAGE, me); + } + + //Randomly cast one beam. + if (BeamTimer <= diff) + { + Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (!pTarget || !pTarget->isAlive()) + return; + + BeamTimer = 9000; + + switch(CurrentBeam) + { + case 0: + DoCast(pTarget, SPELL_BEAM_SINISTER); + break; + case 1: + DoCast(pTarget, SPELL_BEAM_VILE); + break; + case 2: + DoCast(pTarget, SPELL_BEAM_WICKED); + break; + case 3: + DoCast(pTarget, SPELL_BEAM_SINFUL); + break; + } + ++BeamCount; + uint32 Beam = CurrentBeam; + if (BeamCount > 3) + while (CurrentBeam == Beam) + CurrentBeam = rand()%3; + + } else BeamTimer -= diff; + + // Random Prismatic Shield every 15 seconds. + if (PrismaticShieldTimer <= diff) + { + uint32 random = rand()%6; + if (PrismaticAuras[random]) + DoCast(me, PrismaticAuras[random]); + PrismaticShieldTimer = 15000; + } else PrismaticShieldTimer -= diff; + + // Select 3 random targets (can select same target more than once), teleport to a random location then make them cast explosions until they get away from each other. + if (FatalAttractionTimer <= diff) + { + ExplosionCount = 0; + + TeleportPlayers(); + + DoScriptText(RAND(SAY_SPELL2,SAY_SPELL3), me); + FatalAttractionExplodeTimer = 2000; + FatalAttractionTimer = 40000 + rand()%31 * 1000; + } else FatalAttractionTimer -= diff; + + if (FatalAttractionExplodeTimer <= diff) + { + // Just make them explode three times... they're supposed to keep exploding while they are in range, but it'll take too much code. I'll try to think of an efficient way for it later. + if (ExplosionCount < 3) + { + for (uint8 i = 0; i < 3; ++i) + { + Unit* pUnit = NULL; + if (TargetGUID[i]) + { + pUnit = Unit::GetUnit((*me), TargetGUID[i]); + if (pUnit) + pUnit->CastSpell(pUnit, SPELL_ATTRACTION, true); + TargetGUID[i] = 0; + } + } + + ++ExplosionCount; + FatalAttractionExplodeTimer = 1000; + } + else + { + FatalAttractionExplodeTimer = FatalAttractionTimer + 2000; + ExplosionCount = 0; + } + } else FatalAttractionExplodeTimer -= diff; + + if (ShriekTimer <= diff) + { + DoCast(me->getVictim(), SPELL_SILENCING_SHRIEK); + ShriekTimer = 25000+rand()%10 * 1000; + } else ShriekTimer -= diff; + + if (SaberTimer <= diff) + { + DoCast(me->getVictim(), SPELL_SABER_LASH); + SaberTimer = 25000+rand()%10 * 1000; + } else SaberTimer -= diff; + + //Enrage + if (!me->HasAura(SPELL_BERSERK)) + if (EnrageTimer <= diff) + { + DoCast(me, SPELL_BERSERK); + DoScriptText(SAY_ENRAGE, me); + } else EnrageTimer -= diff; + + //Random taunts + if (RandomYellTimer <= diff) + { + DoScriptText(RAND(SAY_TAUNT1,SAY_TAUNT2,SAY_TAUNT3), me); + RandomYellTimer = 60000 + rand()%91 * 1000; + } else RandomYellTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_shahraz(Creature* pCreature) +{ + return new boss_shahrazAI (pCreature); +} + +void AddSC_boss_mother_shahraz() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_mother_shahraz"; + newscript->GetAI = &GetAI_boss_shahraz; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp b/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp new file mode 100644 index 00000000000..3e019a8dc35 --- /dev/null +++ b/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp @@ -0,0 +1,690 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/* ScriptData +SDName: Boss_Reliquary_of_Souls +SD%Complete: 90 +SDComment: +SDCategory: Black Temple +EndScriptData */ + +#include "ScriptedPch.h" +#include "black_temple.h" +#include "Spell.h" + +//Sound'n'speech +//Suffering +#define SUFF_SAY_FREED -1564047 +#define SUFF_SAY_AGGRO -1564048 +#define SUFF_SAY_SLAY1 -1564049 +#define SUFF_SAY_SLAY2 -1564050 +#define SUFF_SAY_SLAY3 -1564051 +#define SUFF_SAY_RECAP -1564052 +#define SUFF_SAY_AFTER -1564053 +#define SUFF_EMOTE_ENRAGE -1564054 + +//Desire +#define DESI_SAY_FREED -1564055 +#define DESI_SAY_SLAY1 -1564056 +#define DESI_SAY_SLAY2 -1564057 +#define DESI_SAY_SLAY3 -1564058 +#define DESI_SAY_SPEC -1564059 +#define DESI_SAY_RECAP -1564060 +#define DESI_SAY_AFTER -1564061 + +//Anger +#define ANGER_SAY_FREED -1564062 +#define ANGER_SAY_FREED2 -1564063 +#define ANGER_SAY_SLAY1 -1564064 +#define ANGER_SAY_SLAY2 -1564065 +#define ANGER_SAY_SPEC -1564066 +#define ANGER_SAY_BEFORE -1564067 +#define ANGER_SAY_DEATH -1564068 + +//Spells +#define AURA_OF_SUFFERING 41292 +#define AURA_OF_SUFFERING_ARMOR 42017 // linked aura, need core support +#define ESSENCE_OF_SUFFERING_PASSIVE 41296 // periodic trigger 41294 +#define ESSENCE_OF_SUFFERING_PASSIVE2 41623 +#define SPELL_FIXATE_TARGET 41294 // dummy, select target +#define SPELL_FIXATE_TAUNT 41295 // force taunt +#define SPELL_ENRAGE 41305 +#define SPELL_SOUL_DRAIN 41303 + +#define AURA_OF_DESIRE 41350 +#define AURA_OF_DESIRE_DAMAGE 41352 +#define SPELL_RUNE_SHIELD 41431 +#define SPELL_DEADEN 41410 +#define SPELL_SOUL_SHOCK 41426 + +#define AURA_OF_ANGER 41337 +#define SPELL_SELF_SEETHE 41364 // force cast 41520 +#define SPELL_ENEMY_SEETHE 41520 +#define SPELL_SOUL_SCREAM 41545 +#define SPELL_SPITE_TARGET 41376 // cast 41377 after 6 sec +#define SPELL_SPITE_DAMAGE 41377 + +#define ENSLAVED_SOUL_PASSIVE 41535 +#define SPELL_SOUL_RELEASE 41542 +#define SPELL_SUBMERGE 37550 //dropout 'head' + +#define CREATURE_ENSLAVED_SOUL 23469 +#define NUMBER_ENSLAVED_SOUL 8 + +struct Position2d +{ + float x,y; +}; + +static Position2d Coords[]= +{ + {450.4, 212.3}, + {542.1, 212.3}, + {542.1, 168.3}, + {542.1, 137.4}, + {450.4, 137.4}, + {450.4, 168.3} +}; + +struct npc_enslaved_soulAI : public ScriptedAI +{ + npc_enslaved_soulAI(Creature *c) : ScriptedAI(c) {} + + uint64 ReliquaryGUID; + + void Reset() {ReliquaryGUID = 0;} + + void EnterCombat(Unit* /*who*/) + { + DoCast(me, ENSLAVED_SOUL_PASSIVE, true); + DoZoneInCombat(); + } + + void JustDied(Unit *killer); +}; + +struct boss_reliquary_of_soulsAI : public ScriptedAI +{ + boss_reliquary_of_soulsAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + EssenceGUID = 0; + } + + ScriptedInstance* pInstance; + + uint64 EssenceGUID; + + uint32 Phase; + uint32 Counter; + uint32 Timer; + + uint32 SoulCount; + uint32 SoulDeathCount; + + void Reset() + { + if (pInstance) + pInstance->SetData(DATA_RELIQUARYOFSOULSEVENT, NOT_STARTED); + + if (EssenceGUID) + { + if (Creature* Essence = Unit::GetCreature(*me, EssenceGUID)) + { + Essence->ForcedDespawn(); + } + EssenceGUID = 0; + } + + Phase = 0; + + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE); + me->RemoveAurasDueToSpell(SPELL_SUBMERGE); + } + + void EnterCombat(Unit* who) + { + me->AddThreat(who, 10000.0f); + DoZoneInCombat(); + if (pInstance) + pInstance->SetData(DATA_RELIQUARYOFSOULSEVENT, IN_PROGRESS); + + Phase = 1; + Counter = 0; + Timer = 0; + } + + bool SummonSoul() + { + uint32 random = rand()%6; + float x = Coords[random].x; + float y = Coords[random].y; + Creature* Soul = me->SummonCreature(CREATURE_ENSLAVED_SOUL, x, y, me->GetPositionZ(), me->GetOrientation(), TEMPSUMMON_CORPSE_DESPAWN, 0); + if (!Soul) return false; + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + CAST_AI(npc_enslaved_soulAI, Soul->AI())->ReliquaryGUID = me->GetGUID(); + Soul->AI()->AttackStart(pTarget); + } else EnterEvadeMode(); + return true; + } + + void MergeThreatList(Creature *pTarget) + { + if (!pTarget) + return; + + std::list& m_threatlist = pTarget->getThreatManager().getThreatList(); + std::list::const_iterator itr = m_threatlist.begin(); + for (; itr != m_threatlist.end(); ++itr) + { + Unit* pUnit = Unit::GetUnit((*me), (*itr)->getUnitGuid()); + if (pUnit) + { + DoModifyThreatPercent(pUnit, -100); + float threat = pTarget->getThreatManager().getThreat(pUnit); + me->AddThreat(pUnit, threat); // This makes it so that the unit has the same amount of threat in Reliquary's threatlist as in the target creature's (One of the Essences). + } + } + } + + void JustDied(Unit* /*killer*/) + { + if (pInstance) + pInstance->SetData(DATA_RELIQUARYOFSOULSEVENT, DONE); + } + + void UpdateAI(const uint32 diff) + { + if (!Phase) + return; + + if (me->getThreatManager().getThreatList().empty()) // Reset if event is begun and we don't have a threatlist + { + EnterEvadeMode(); + return; + } + + Creature* Essence = NULL; + if (EssenceGUID) + { + Essence = Unit::GetCreature(*me, EssenceGUID); + if (!Essence) + { + EnterEvadeMode(); + return; + } + } + + if (Timer <= diff) + { + switch(Counter) + { + case 0: + me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY2H); // I R ANNNGRRRY! + DoStartNoMovement(me); + Timer = 3000; + break; + case 1: + Timer = 2800; + me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_SUBMERGE); // Release the cube + DoCast(me, SPELL_SUBMERGE); + DoStartNoMovement(me); + break; + case 2: + Timer = 5000; + if (Creature* Summon = DoSpawnCreature(23417+Phase, 0, 0, 0, 0, TEMPSUMMON_DEAD_DESPAWN, 0)) + { + me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_SUBMERGED); // Ribs: open + Summon->AI()->AttackStart(SelectUnit(SELECT_TARGET_TOPAGGRO, 0)); + EssenceGUID = Summon->GetGUID(); + DoStartNoMovement(me); + } else EnterEvadeMode(); + break; + case 3: + Timer = 1000; + if (Phase == 3) + { + if (!Essence->isAlive()) + DoCast(me, 7, true); + else return; + } + else + { + if (Essence->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE)) + { + MergeThreatList(Essence); + Essence->RemoveAllAuras(); + Essence->DeleteThreatList(); + Essence->GetMotionMaster()->MoveFollow(me,0.0f,0.0f); + } else return; + } + break; + case 4: + Timer = 1500; + if (Essence->IsWithinDistInMap(me, 10)) + { + Essence->SetUInt32Value(UNIT_NPC_EMOTESTATE,374); //rotate and disappear + Timer = 2000; + me->RemoveAurasDueToSpell(SPELL_SUBMERGE); + } + else + { + MergeThreatList(Essence); + Essence->RemoveAllAuras(); + Essence->DeleteThreatList(); + Essence->GetMotionMaster()->MoveFollow(me, 0, 0); + return; + } + break; + case 5: + if (Phase == 1) + { + DoScriptText(SUFF_SAY_AFTER, Essence); + } + else + { + DoScriptText(DESI_SAY_AFTER, Essence); + } + Essence->ForcedDespawn(); + me->SetUInt32Value(UNIT_NPC_EMOTESTATE,0); + EssenceGUID = 0; + SoulCount = 0; + SoulDeathCount = 0; + Timer = 3000; + break; + case 6: + if (SoulCount < NUMBER_ENSLAVED_SOUL) + { + if (SummonSoul()) + ++SoulCount; + Timer = 500; + return; + } + break; + case 7: + if (SoulDeathCount >= SoulCount) + { + Counter = 1; + ++Phase; + Timer = 5000; + } + return; + default: + break; + } + ++Counter; + } else Timer -= diff; + } +}; + +struct boss_essence_of_sufferingAI : public ScriptedAI +{ + boss_essence_of_sufferingAI(Creature *c) : ScriptedAI(c) {} + + uint64 StatAuraGUID; + + uint32 AggroYellTimer; + uint32 FixateTimer; + uint32 EnrageTimer; + uint32 SoulDrainTimer; + uint32 AuraTimer; + + void Reset() + { + StatAuraGUID = 0; + + AggroYellTimer = 5000; + FixateTimer = 8000; + EnrageTimer = 30000; + SoulDrainTimer = 45000; + AuraTimer = 5000; + } + + void DamageTaken(Unit * /*done_by*/, uint32 &damage) + { + if (damage >= me->GetHealth()) + { + damage = 0; + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->Yell(SUFF_SAY_RECAP,LANG_UNIVERSAL,0); + DoScriptText(SUFF_SAY_RECAP, me); + } + } + + void EnterCombat(Unit * /*who*/) + { + if (!me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE)) + { + DoScriptText(SUFF_SAY_FREED, me); + DoZoneInCombat(); + DoCast(me, AURA_OF_SUFFERING, true); // linked aura need core support + DoCast(me, ESSENCE_OF_SUFFERING_PASSIVE, true); + DoCast(me, ESSENCE_OF_SUFFERING_PASSIVE2, true); + } + else return; + } + + void KilledUnit(Unit * /*victim*/) + { + DoScriptText(RAND(SUFF_SAY_SLAY1,SUFF_SAY_SLAY2,SUFF_SAY_SLAY3), me); + } + + void CastFixate() + { + std::list& m_threatlist = me->getThreatManager().getThreatList(); + if (m_threatlist.empty()) + return; // No point continuing if empty threatlist. + std::list targets; + std::list::const_iterator itr = m_threatlist.begin(); + for (; itr != m_threatlist.end(); ++itr) + { + Unit* pUnit = Unit::GetUnit((*me), (*itr)->getUnitGuid()); + if (pUnit && pUnit->isAlive() && (pUnit->GetTypeId() == TYPEID_PLAYER)) // Only alive players + targets.push_back(pUnit); + } + if (targets.empty()) + return; // No targets added for some reason. No point continuing. + targets.sort(Trinity::ObjectDistanceOrderPred(me)); // Sort players by distance. + targets.resize(1); // Only need closest target. + Unit *pTarget = targets.front(); // Get the first target. + if (pTarget) + pTarget->CastSpell(me, SPELL_FIXATE_TAUNT, true); + DoResetThreat(); + me->AddThreat(pTarget,1000000); + } + + void UpdateAI(const uint32 diff) + { + if (me->isInCombat()) + { + //Supposed to be cast on nearest target + if (FixateTimer <= diff) + { + CastFixate(); + FixateTimer = 5000; + if (!(rand()%16)) + { + DoScriptText(SUFF_SAY_AGGRO, me); + } + } else FixateTimer -= diff; + } + + //Return since we have no target + if (!UpdateVictim()) + return; + + if (EnrageTimer <= diff) + { + DoCast(me, SPELL_ENRAGE); + EnrageTimer = 60000; + DoScriptText(SUFF_EMOTE_ENRAGE, me); + } else EnrageTimer -= diff; + + if (SoulDrainTimer <= diff) + { + DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_SOUL_DRAIN); + SoulDrainTimer = 60000; + } else SoulDrainTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct boss_essence_of_desireAI : public ScriptedAI +{ + boss_essence_of_desireAI(Creature *c) : ScriptedAI(c) {} + + uint32 RuneShieldTimer; + uint32 DeadenTimer; + uint32 SoulShockTimer; + + void Reset() + { + RuneShieldTimer = 60000; + DeadenTimer = 30000; + SoulShockTimer = 5000; + me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_CONFUSE, true); + } + + void DamageTaken(Unit *done_by, uint32 &damage) + { + if (done_by == me) + return; + + if (damage >= me->GetHealth()) + { + damage = 0; + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + DoScriptText(SUFF_SAY_RECAP, me); + } + else + { + int32 bp0 = damage / 2; + me->CastCustomSpell(done_by, AURA_OF_DESIRE_DAMAGE, &bp0, NULL, NULL, true); + } + } + + void SpellHit(Unit * /*caster*/, const SpellEntry *spell) + { + if (me->GetCurrentSpell(CURRENT_GENERIC_SPELL)) + for (uint8 i = 0; i < 3; ++i) + if (spell->Effect[i] == SPELL_EFFECT_INTERRUPT_CAST) + if (me->GetCurrentSpell(CURRENT_GENERIC_SPELL)->m_spellInfo->Id == SPELL_SOUL_SHOCK + || me->GetCurrentSpell(CURRENT_GENERIC_SPELL)->m_spellInfo->Id == SPELL_DEADEN) + me->InterruptSpell(CURRENT_GENERIC_SPELL, false); + } + + void EnterCombat(Unit * /*who*/) + { + DoScriptText(DESI_SAY_FREED, me); + DoZoneInCombat(); + DoCast(me, AURA_OF_DESIRE, true); + } + + void KilledUnit(Unit * /*victim*/) + { + DoScriptText(RAND(DESI_SAY_SLAY1,DESI_SAY_SLAY2,DESI_SAY_SLAY3), me); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (RuneShieldTimer <= diff) + { + me->InterruptNonMeleeSpells(false); + DoCast(me, SPELL_RUNE_SHIELD, true); + SoulShockTimer += 2000; + DeadenTimer += 2000; + RuneShieldTimer = 60000; + } else RuneShieldTimer -= diff; + + if (SoulShockTimer <= diff) + { + DoCast(me->getVictim(), SPELL_SOUL_SHOCK); + SoulShockTimer = 5000; + } else SoulShockTimer -= diff; + + if (DeadenTimer <= diff) + { + me->InterruptNonMeleeSpells(false); + DoCast(me->getVictim(), SPELL_DEADEN); + DeadenTimer = 25000 + rand()%10000; + if (!(rand()%2)) + { + DoScriptText(DESI_SAY_SPEC, me); + } + } else DeadenTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct boss_essence_of_angerAI : public ScriptedAI +{ + boss_essence_of_angerAI(Creature *c) : ScriptedAI(c) {} + + uint64 AggroTargetGUID; + + uint32 CheckTankTimer; + uint32 SoulScreamTimer; + uint32 SpiteTimer; + + std::list SpiteTargetGUID; + + bool CheckedAggro; + + void Reset() + { + AggroTargetGUID = 0; + + CheckTankTimer = 5000; + SoulScreamTimer = 10000; + SpiteTimer = 30000; + + SpiteTargetGUID.clear(); + + CheckedAggro = false; + } + + void EnterCombat(Unit * /*who*/) + { + DoScriptText(RAND(ANGER_SAY_FREED,ANGER_SAY_FREED2), me); + + DoZoneInCombat(); + DoCast(me, AURA_OF_ANGER, true); + } + + void JustDied(Unit * /*victim*/) + { + DoScriptText(ANGER_SAY_DEATH, me); + } + + void KilledUnit(Unit * /*victim*/) + { + DoScriptText(RAND(ANGER_SAY_SLAY1,ANGER_SAY_SLAY2), me); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + if (!CheckedAggro) + { + AggroTargetGUID = me->getVictim()->GetGUID(); + CheckedAggro = true; + } + + if (CheckTankTimer <= diff) + { + if (me->getVictim()->GetGUID() != AggroTargetGUID) + { + DoScriptText(ANGER_SAY_BEFORE, me); + DoCast(me, SPELL_SELF_SEETHE, true); + AggroTargetGUID = me->getVictim()->GetGUID(); + } + CheckTankTimer = 2000; + } else CheckTankTimer -= diff; + + if (SoulScreamTimer <= diff) + { + DoCast(me->getVictim(), SPELL_SOUL_SCREAM); + SoulScreamTimer = 9000 + rand()%2000; + if (!(rand()%3)) + { + DoScriptText(ANGER_SAY_SPEC, me); + } + } else SoulScreamTimer -= diff; + + if (SpiteTimer <= diff) + { + DoCast(me, SPELL_SPITE_TARGET); + SpiteTimer = 30000; + DoScriptText(ANGER_SAY_SPEC, me); + } else SpiteTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +void npc_enslaved_soulAI::JustDied(Unit * /*killer*/) +{ + if (ReliquaryGUID) + if (Creature *Reliquary = (Unit::GetCreature((*me), ReliquaryGUID))) + ++(CAST_AI(boss_reliquary_of_soulsAI, Reliquary->AI())->SoulDeathCount); + + DoCast(me, SPELL_SOUL_RELEASE, true); +} + +CreatureAI* GetAI_boss_reliquary_of_souls(Creature* pCreature) +{ + return new boss_reliquary_of_soulsAI (pCreature); +} + +CreatureAI* GetAI_boss_essence_of_suffering(Creature* pCreature) +{ + return new boss_essence_of_sufferingAI (pCreature); +} + +CreatureAI* GetAI_boss_essence_of_desire(Creature* pCreature) +{ + return new boss_essence_of_desireAI (pCreature); +} + +CreatureAI* GetAI_boss_essence_of_anger(Creature* pCreature) +{ + return new boss_essence_of_angerAI (pCreature); +} + +CreatureAI* GetAI_npc_enslaved_soul(Creature* pCreature) +{ + return new npc_enslaved_soulAI (pCreature); +} + +void AddSC_boss_reliquary_of_souls() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_reliquary_of_souls"; + newscript->GetAI = &GetAI_boss_reliquary_of_souls; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_essence_of_suffering"; + newscript->GetAI = &GetAI_boss_essence_of_suffering; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_essence_of_desire"; + newscript->GetAI = &GetAI_boss_essence_of_desire; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_essence_of_anger"; + newscript->GetAI = &GetAI_boss_essence_of_anger; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_enslaved_soul"; + newscript->GetAI = &GetAI_npc_enslaved_soul; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp b/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp new file mode 100644 index 00000000000..94f88d5715c --- /dev/null +++ b/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp @@ -0,0 +1,871 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Shade_of_Akama +SD%Complete: 90 +SDComment: Seems to be complete. +SDCategory: Black Temple +EndScriptData */ + +#include "ScriptedPch.h" +#include "black_temple.h" + +#define SAY_DEATH -1564013 +#define SAY_LOW_HEALTH -1564014 +// Ending cinematic text +#define SAY_FREE -1564015 +#define SAY_BROKEN_FREE_01 -1564016 +#define SAY_BROKEN_FREE_02 -1564017 + +#define GOSSIP_ITEM "We are ready to fight alongside you, Akama" + +struct Location +{ + float x, y, o, z; +}; + +static Location ChannelerLocations[]= +{ + {463.161285, 401.219757, 3.141592}, + {457.377625, 391.227661, 2.106461}, + {446.012421, 391.227661, 1.071904}, + {439.533783, 401.219757, 0.000000}, + {446.012421, 411.211853, 5.210546}, + {457.377625, 411.211853, 4.177494} +}; + +static Location SpawnLocations[]= +{ + {498.652740, 461.728119, 0}, + {498.505003, 339.619324, 0} +}; + +static Location AkamaWP[]= +{ + {482.352448, 401.162720, 0, 112.783928}, + {469.597443, 402.264404, 0, 118.537910} +}; + +static Location BrokenCoords[]= +{ + {541.375916, 401.439575, M_PI, 112.783997}, // The place where Akama channels + {534.130005, 352.394531, 2.164150, 112.783737}, // Behind a 'pillar' which is behind the east alcove + {499.621185, 341.534729, 1.652856, 112.783730}, // East Alcove + {499.151093, 461.036438, 4.770888, 112.78370}, // West Alcove +}; + +static Location BrokenWP[]= +{ + {492.491638, 400.744690, 3.122336, 112.783737}, + {494.335724, 382.221771, 2.676230, 112.783737}, + {489.555939, 373.507202, 2.416263, 112.783737}, + {491.136353, 427.868774, 3.519748, 112.783737}, +}; + +// Locations +#define Z1 118.543144 +#define Z2 120.783768 +#define Z_SPAWN 113.537949 +#define AGGRO_X 482.793182 +#define AGGRO_Y 401.270172 +#define AGGRO_Z 112.783928 +#define AKAMA_X 514.583984 +#define AKAMA_Y 400.601013 +#define AKAMA_Z 112.783997 + +// Spells +#define SPELL_VERTEX_SHADE_BLACK 39833 +#define SPELL_SHADE_SOUL_CHANNEL 40401 +#define SPELL_DESTRUCTIVE_POISON 40874 +#define SPELL_LIGHTNING_BOLT 42024 +#define SPELL_AKAMA_SOUL_CHANNEL 40447 +#define SPELL_AKAMA_SOUL_RETRIEVE 40902 +#define AKAMA_SOUL_EXPEL 40855 +#define SPELL_SHADE_SOUL_CHANNEL_2 40520 + +// Channeler entry +#define CREATURE_CHANNELER 23421 +#define CREATURE_SORCERER 23215 +#define CREATURE_DEFENDER 23216 +#define CREATURE_BROKEN 23319 + +const uint32 spawnEntries[4]= { 23523, 23318, 23524 }; + +struct mob_ashtongue_channelerAI : public ScriptedAI +{ + mob_ashtongue_channelerAI(Creature* c) : ScriptedAI(c) {ShadeGUID = 0;} + + uint64 ShadeGUID; + + void Reset() {} + void JustDied(Unit* /*killer*/); + void EnterCombat(Unit* /*who*/) {} + void AttackStart(Unit* /*who*/) {} + void MoveInLineOfSight(Unit* /*who*/) {} + void UpdateAI(const uint32 /*diff*/) {} +}; + +struct mob_ashtongue_sorcererAI : public ScriptedAI +{ + mob_ashtongue_sorcererAI(Creature* c) : ScriptedAI(c) {ShadeGUID = 0;} + + uint64 ShadeGUID; + uint32 CheckTimer; + bool StartBanishing; + + void Reset() + { + StartBanishing = false; + CheckTimer = 5000; + } + + void JustDied(Unit* /*killer*/); + void EnterCombat(Unit* /*who*/) {} + void AttackStart(Unit* /*who*/) {} + void MoveInLineOfSight(Unit* /*who*/) {} + void UpdateAI(const uint32 diff) + { + if (StartBanishing) + return; + + if (CheckTimer <= diff) + { + Creature* Shade = Unit::GetCreature((*me), ShadeGUID); + if (Shade && Shade->isAlive() && me->isAlive()) + { + if (me->IsWithinDist(Shade, 20,false)) + { + me->GetMotionMaster()->Clear(false); + me->GetMotionMaster()->MoveIdle(); + DoCast(Shade, SPELL_SHADE_SOUL_CHANNEL, true); + DoCast(Shade, SPELL_SHADE_SOUL_CHANNEL_2, true); + + StartBanishing = true; + } + } + CheckTimer = 2000; + } else CheckTimer -= diff; + } +}; + +struct boss_shade_of_akamaAI : public ScriptedAI +{ + boss_shade_of_akamaAI(Creature* c) : ScriptedAI(c), summons(me) + { + pInstance = c->GetInstanceData(); + AkamaGUID = pInstance ? pInstance->GetData64(DATA_AKAMA_SHADE) : 0; + me->setActive(true);//if view distance is too low + me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true); + me->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true); + } + + ScriptedInstance* pInstance; + + std::list Channelers; + std::list Sorcerers; + uint64 AkamaGUID; + + uint32 SorcererCount; + uint32 DeathCount; + + uint32 ReduceHealthTimer; + uint32 SummonTimer; + uint32 ResetTimer; + uint32 DefenderTimer; // They are on a flat 15 second timer, independant of the other summon Creature timer. + + bool IsBanished; + bool HasKilledAkama; + bool reseting; + bool GridSearcherSucceeded; + bool HasKilledAkamaAndReseting; + SummonList summons; + + void Reset() + { + reseting = true; + HasKilledAkamaAndReseting = false; + + GridSearcherSucceeded = false; + + Sorcerers.clear(); + summons.DespawnAll();//despawn all adds + + if (Creature* Akama = Unit::GetCreature(*me, AkamaGUID)) + { + Akama->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);//turn gossip on so players can restart the event + if (Akama->isDead()) + { + Akama->Respawn();//respawn akama if dead + Akama->AI()->EnterEvadeMode(); + } + } + SorcererCount = 0; + DeathCount = 0; + + SummonTimer = 10000; + ReduceHealthTimer = 0; + ResetTimer = 60000; + DefenderTimer = 15000; + + IsBanished = true; + HasKilledAkama = false; + + me->SetVisibility(VISIBILITY_ON); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + //me->GetMotionMaster()->Clear(); + //me->GetMotionMaster()->MoveIdle(); + me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_STUN); + + if (pInstance) + pInstance->SetData(DATA_SHADEOFAKAMAEVENT, NOT_STARTED); + + reseting = false; + } + void JustDied(Unit* /*killer*/) + { + summons.DespawnAll(); + } + void JustSummoned(Creature *summon) + { + if (summon->GetEntry() == CREATURE_DEFENDER || summon->GetEntry() == 23523 || summon->GetEntry() == 23318 || summon->GetEntry() == 23524) + summons.Summon(summon); + } + void SummonedCreatureDespawn(Creature *summon) + { + if (summon->GetEntry() == CREATURE_DEFENDER || summon->GetEntry() == 23523 || summon->GetEntry() == 23318 || summon->GetEntry() == 23524) + summons.Despawn(summon); + } + + void MoveInLineOfSight(Unit * /*who*/) + { + if (!GridSearcherSucceeded) + { + FindChannelers(); + + if (!Channelers.empty()) + { + for (std::list::const_iterator itr = Channelers.begin(); itr != Channelers.end(); ++itr) + { + Creature* Channeler = (Unit::GetCreature(*me, *itr)); + if (Channeler) + { + if (Channeler->isDead()) + { + Channeler->RemoveCorpse(); + Channeler->Respawn(); + } + + Channeler->CastSpell(me, SPELL_SHADE_SOUL_CHANNEL, true); + Channeler->CastSpell(me, SPELL_SHADE_SOUL_CHANNEL_2, true); + Channeler->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + GridSearcherSucceeded = true; + } + } + } else error_log("SD2 ERROR: No Channelers are stored in the list. This encounter will not work properly"); + } + } + + void AttackStart(Unit* who) + { + if (!who || IsBanished) return; + + if (who->isTargetableForAttack() && who != me) + DoStartMovement(who); + } + + void IncrementDeathCount(uint64 guid = 0) // If guid is set, will remove it from list of sorcerer + { + if (reseting) + return; + + debug_log("TSCR: Increasing Death Count for Shade of Akama encounter"); + ++DeathCount; + me->RemoveAuraFromStack(SPELL_SHADE_SOUL_CHANNEL_2); + if (guid) + { + if (Sorcerers.empty()) + error_log("SD2 ERROR: Shade of Akama - attempt to remove guid %u from Sorcerers list but list is already empty", guid); + else Sorcerers.remove(guid); + } + } + + void SummonCreature() + { + uint32 random = rand()%2; + float X = SpawnLocations[random].x; + float Y = SpawnLocations[random].y; + // max of 6 sorcerers can be summoned + if ((rand()%3 == 0) && (DeathCount > 0) && (SorcererCount < 7)) + { + Creature* Sorcerer = me->SummonCreature(CREATURE_SORCERER, X, Y, Z_SPAWN, 0, TEMPSUMMON_DEAD_DESPAWN, 0); + if (Sorcerer) + { + CAST_AI(mob_ashtongue_sorcererAI, Sorcerer->AI())->ShadeGUID = me->GetGUID(); + Sorcerer->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + Sorcerer->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()); + Sorcerer->SetUInt64Value(UNIT_FIELD_TARGET, me->GetGUID()); + Sorcerers.push_back(Sorcerer->GetGUID()); + --DeathCount; + ++SorcererCount; + } + } + else + { + for (uint8 i = 0; i < 3; ++i) + { + Creature* Spawn = me->SummonCreature(spawnEntries[i], X, Y, Z_SPAWN, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 25000); + if (Spawn) + { + Spawn->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + Spawn->GetMotionMaster()->MovePoint(0, AGGRO_X, AGGRO_Y, AGGRO_Z); + Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1); + Spawn->AI()->AttackStart(pTarget); + } + } + } + } + + void FindChannelers() + { + std::list ChannelerList; + me->GetCreatureListWithEntryInGrid(ChannelerList,CREATURE_CHANNELER,50.0f); + + if (!ChannelerList.empty()) + { + for (std::list::const_iterator itr = ChannelerList.begin(); itr != ChannelerList.end(); ++itr) + { + CAST_AI(mob_ashtongue_channelerAI, (*itr)->AI())->ShadeGUID = me->GetGUID(); + Channelers.push_back((*itr)->GetGUID()); + debug_log("TSCR: Shade of Akama Grid Search found channeler %u. Adding to list", (*itr)->GetGUID()); + } + } + else error_log("SD2 ERROR: Grid Search was unable to find any channelers. Shade of Akama encounter will be buggy"); + } + + void SetSelectableChannelers() + { + if (Channelers.empty()) + { + error_log("SD2 ERROR: Channeler List is empty, Shade of Akama encounter will be buggy"); + return; + } + + for (std::list::const_iterator itr = Channelers.begin(); itr != Channelers.end(); ++itr) + if (Creature* Channeler = (Unit::GetCreature(*me, *itr))) + Channeler->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + } + + void SetAkamaGUID(uint64 guid) { AkamaGUID = guid; } + + void UpdateAI(const uint32 diff) + { + if (!me->isInCombat()) + return; + + if (IsBanished) + { + // Akama is set in the threatlist so when we reset, we make sure that he is not included in our check + if (me->getThreatManager().getThreatList().size() < 2) + { + EnterEvadeMode(); + return; + } + + if (DefenderTimer <= diff) + { + uint32 ran = rand()%2; + Creature* Defender = me->SummonCreature(CREATURE_DEFENDER, SpawnLocations[ran].x, SpawnLocations[ran].y, Z_SPAWN, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 25000); + if (Defender) + { + Defender->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + bool move = true; + if (AkamaGUID) + { + if (Creature* Akama = Unit::GetCreature(*me, AkamaGUID)) + { + float x, y, z; + Akama->GetPosition(x,y,z); + // They move towards AKama + Defender->GetMotionMaster()->MovePoint(0, x, y, z); + Defender->AI()->AttackStart(Akama); + } else move = false; + } else move = false; + if (!move) + Defender->GetMotionMaster()->MovePoint(0, AKAMA_X, AKAMA_Y, AKAMA_Z); + } + DefenderTimer = 15000; + } else DefenderTimer -= diff; + + if (SummonTimer <= diff) + { + SummonCreature(); + SummonTimer = 35000; + } else SummonTimer -= diff; + + if (DeathCount >= 6) + { + if (AkamaGUID) + { + Creature* Akama = Unit::GetCreature((*me), AkamaGUID); + if (Akama && Akama->isAlive()) + { + IsBanished = false; + me->GetMotionMaster()->Clear(false); + me->GetMotionMaster()->MoveChase(Akama); + Akama->GetMotionMaster()->Clear(); + // Shade should move to Akama, not the other way around + Akama->GetMotionMaster()->MoveIdle(); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + // Crazy amount of threat + me->AddThreat(Akama, 10000000.0f); + Akama->AddThreat(me, 10000000.0f); + me->Attack(Akama, true); + Akama->Attack(me, true); + } + } + } + } + else // No longer banished, let's fight Akama now + { + if (ReduceHealthTimer <= diff) + { + if (AkamaGUID) + { + Creature* Akama = Unit::GetCreature((*me), AkamaGUID); + if (Akama && Akama->isAlive()) + { + //10 % less health every few seconds. + me->DealDamage(Akama, Akama->GetMaxHealth()/10, NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + ReduceHealthTimer = 12000; + } + } + } else ReduceHealthTimer -= diff; + + if (HasKilledAkama) + { + if (!HasKilledAkamaAndReseting)//do not let players kill Shade if Akama is dead and Shade is waiting for ResetTimer!! event would bug + { + HasKilledAkamaAndReseting = true; + me->RemoveAllAuras(); + me->DeleteThreatList(); + me->CombatStop(); + //me->SetHealth(me->GetMaxHealth()); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->GetMotionMaster()->MoveTargetedHome(); + } + if (ResetTimer <= diff) + { + EnterEvadeMode();// Reset a little while after killing Akama, evade and respawn Akama + return; + } else ResetTimer -= diff; + } + + DoMeleeAttackIfReady(); + } + } +}; + +void mob_ashtongue_channelerAI::JustDied(Unit* /*killer*/) +{ + Creature* Shade = (Unit::GetCreature((*me), ShadeGUID)); + if (Shade && Shade->isAlive()) + CAST_AI(boss_shade_of_akamaAI, Shade->AI())->IncrementDeathCount(); + else error_log("SD2 ERROR: Channeler dead but unable to increment DeathCount for Shade of Akama."); +} + +void mob_ashtongue_sorcererAI::JustDied(Unit* /*killer*/) +{ + Creature* Shade = (Unit::GetCreature((*me), ShadeGUID)); + if (Shade && Shade->isAlive()) + CAST_AI(boss_shade_of_akamaAI, Shade->AI())->IncrementDeathCount(me->GetGUID()); + else error_log("SD2 ERROR: Sorcerer dead but unable to increment DeathCount for Shade of Akama."); +} + +struct npc_akamaAI : public ScriptedAI +{ + npc_akamaAI(Creature* c) : ScriptedAI(c), summons(me) + { + ShadeHasDied = false; + StartCombat = false; + pInstance = c->GetInstanceData(); + ShadeGUID = pInstance ? pInstance->GetData64(DATA_SHADEOFAKAMA) : NOT_STARTED; + me->setActive(true); + EventBegun = false; + CastSoulRetrieveTimer = 0; + SoulRetrieveTimer = 0; + SummonBrokenTimer = 0; + EndingTalkCount = 0; + WayPointId = 0; + BrokenSummonIndex = 0; + BrokenList.clear(); + HasYelledOnce = false; + } + + ScriptedInstance* pInstance; + + uint64 ShadeGUID; + + uint32 DestructivePoisonTimer; + uint32 LightningBoltTimer; + uint32 CheckTimer; + uint32 CastSoulRetrieveTimer; + uint32 SoulRetrieveTimer; + uint32 SummonBrokenTimer; + uint32 EndingTalkCount; + uint32 WayPointId; + uint32 BrokenSummonIndex; + + std::list BrokenList; + + bool EventBegun; + bool ShadeHasDied; + bool StartCombat; + bool HasYelledOnce; + SummonList summons; + + void Reset() + { + DestructivePoisonTimer = 15000; + LightningBoltTimer = 10000; + CheckTimer = 2000; + + if (!EventBegun) + { + me->SetUInt32Value(UNIT_NPC_FLAGS, 0); // Database sometimes has very very strange values + me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + } + summons.DespawnAll(); + } + + void JustSummoned(Creature *summon) + { + if (summon->GetEntry() == CREATURE_BROKEN) + summons.Summon(summon); + } + void SummonedCreatureDespawn(Creature *summon) + { + if (summon->GetEntry() == CREATURE_BROKEN) + summons.Despawn(summon); + } + + void EnterCombat(Unit* /*who*/) {} + + void BeginEvent(Player* pl) + { + if (!pInstance) + return; + + ShadeGUID = pInstance->GetData64(DATA_SHADEOFAKAMA); + if (!ShadeGUID) + return; + + Creature* Shade = (Unit::GetCreature((*me), ShadeGUID)); + if (Shade) + { + pInstance->SetData(DATA_SHADEOFAKAMAEVENT, IN_PROGRESS); + // Prevent players from trying to restart event + me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + CAST_AI(boss_shade_of_akamaAI, Shade->AI())->SetAkamaGUID(me->GetGUID()); + CAST_AI(boss_shade_of_akamaAI, Shade->AI())->SetSelectableChannelers(); + Shade->AddThreat(me, 1000000.0f); + me->CombatStart(Shade); + Shade->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE); + Shade->SetUInt64Value(UNIT_FIELD_TARGET, me->GetGUID()); + if (pl) Shade->AddThreat(pl, 1.0f); + DoZoneInCombat(Shade); + EventBegun = true; + } + } + + void MovementInform(uint32 type, uint32 id) + { + if (type != POINT_MOTION_TYPE) + return; + + switch(id) + { + case 0: ++WayPointId; break; + + case 1: + if (Creature* Shade = Unit::GetCreature(*me, ShadeGUID)) + { + me->SetUInt64Value(UNIT_FIELD_TARGET, ShadeGUID); + DoCast(Shade, SPELL_AKAMA_SOUL_RETRIEVE); + EndingTalkCount = 0; + SoulRetrieveTimer = 16000; + } + break; + } + } + + void JustDied(Unit* /*killer*/) + { + DoScriptText(SAY_DEATH, me); + EventBegun = false; + ShadeHasDied = false; + StartCombat = false; + CastSoulRetrieveTimer = 0; + SoulRetrieveTimer = 0; + SummonBrokenTimer = 0; + EndingTalkCount = 0; + WayPointId = 0; + BrokenSummonIndex = 0; + BrokenList.clear(); + HasYelledOnce = false; + Creature* Shade = Unit::GetCreature((*me), ShadeGUID); + if (Shade && Shade->isAlive()) + CAST_AI(boss_shade_of_akamaAI, Shade->AI())->HasKilledAkama = true; + summons.DespawnAll(); + } + + void UpdateAI(const uint32 diff) + { + if (!EventBegun) + return; + + if ((me->GetHealth()*100 / me->GetMaxHealth()) < 15 && !HasYelledOnce) + { + DoScriptText(SAY_LOW_HEALTH, me); + HasYelledOnce = true; + } + + if (ShadeGUID && !StartCombat) + { + Creature* Shade = (Unit::GetCreature((*me), ShadeGUID)); + if (Shade && Shade->isAlive()) + { + if (CAST_AI(boss_shade_of_akamaAI, Shade->AI())->IsBanished) + { + if (CastSoulRetrieveTimer <= diff) + { + DoCast(Shade, SPELL_AKAMA_SOUL_CHANNEL); + CastSoulRetrieveTimer = 500; + } else CastSoulRetrieveTimer -= diff; + } + else + { + me->InterruptNonMeleeSpells(false); + StartCombat = true; + } + } + } + + if (ShadeHasDied && (WayPointId == 1)) + { + if (pInstance) + pInstance->SetData(DATA_SHADEOFAKAMAEVENT, DONE); + me->GetMotionMaster()->MovePoint(WayPointId, AkamaWP[1].x, AkamaWP[1].y, AkamaWP[1].z); + ++WayPointId; + } + + if (!ShadeHasDied && StartCombat) + { + if (CheckTimer <= diff) + { + if (ShadeGUID) + { + Creature* Shade = Unit::GetCreature((*me), ShadeGUID); + if (Shade && !Shade->isAlive()) + { + ShadeHasDied = true; + WayPointId = 0; + me->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + me->GetMotionMaster()->MovePoint(WayPointId, AkamaWP[0].x, AkamaWP[0].y, AkamaWP[0].z); + } + if (Shade && Shade->isAlive()) + { + if (Shade->getThreatManager().getThreatList().size() < 2) + Shade->AI()->EnterEvadeMode(); + } + } + CheckTimer = 5000; + } else CheckTimer -= diff; + } + + if (SummonBrokenTimer && BrokenSummonIndex < 4) + { + if (SummonBrokenTimer <= diff) + { + for (uint8 i = 0; i < 4; ++i) + { + float x = BrokenCoords[BrokenSummonIndex].x + (i*5); + float y = BrokenCoords[BrokenSummonIndex].y + (1*5); + float z = BrokenCoords[BrokenSummonIndex].z; + float o = BrokenCoords[BrokenSummonIndex].o; + Creature* Broken = me->SummonCreature(CREATURE_BROKEN, x, y, z, o, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 360000); + if (Broken) + { + float wx = BrokenWP[BrokenSummonIndex].x + (i*5); + float wy = BrokenWP[BrokenSummonIndex].y + (i*5); + float wz = BrokenWP[BrokenSummonIndex].z; + Broken->GetMotionMaster()->MovePoint(0, wx, wy, wz); + Broken->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + BrokenList.push_back(Broken->GetGUID()); + } + } + ++BrokenSummonIndex; + SummonBrokenTimer = 1000; + } else SummonBrokenTimer -= diff; + } + + if (SoulRetrieveTimer) + if (SoulRetrieveTimer <= diff) + { + switch(EndingTalkCount) + { + case 0: + me->HandleEmoteCommand(EMOTE_ONESHOT_ROAR); + ++EndingTalkCount; + SoulRetrieveTimer = 2000; + SummonBrokenTimer = 1; + break; + case 1: + DoScriptText(SAY_FREE, me); + ++EndingTalkCount; + SoulRetrieveTimer = 25000; + break; + case 2: + if (!BrokenList.empty()) + { + bool Yelled = false; + for (std::list::const_iterator itr = BrokenList.begin(); itr != BrokenList.end(); ++itr) + if (Creature* pUnit = Unit::GetCreature(*me, *itr)) + { + if (!Yelled) + { + DoScriptText(SAY_BROKEN_FREE_01, pUnit); + Yelled = true; + } + pUnit->HandleEmoteCommand(EMOTE_ONESHOT_KNEEL); + } + } + ++EndingTalkCount; + SoulRetrieveTimer = 1500; + break; + case 3: + if (!BrokenList.empty()) + { + for (std::list::const_iterator itr = BrokenList.begin(); itr != BrokenList.end(); ++itr) + if (Creature* pUnit = Unit::GetCreature(*me, *itr)) + // This is the incorrect spell, but can't seem to find the right one. + pUnit->CastSpell(pUnit, 39656, true); + } + ++EndingTalkCount; + SoulRetrieveTimer = 5000; + break; + case 4: + if (!BrokenList.empty()) + { + for (std::list::const_iterator itr = BrokenList.begin(); itr != BrokenList.end(); ++itr) + if (Creature* pUnit = Unit::GetCreature((*me), *itr)) + pUnit->MonsterYell(SAY_BROKEN_FREE_02, LANG_UNIVERSAL, 0); + } + SoulRetrieveTimer = 0; + break; + } + } else SoulRetrieveTimer -= diff; + + if (!UpdateVictim()) + return; + + if (DestructivePoisonTimer <= diff) + { + Creature* Shade = Unit::GetCreature((*me), ShadeGUID); + if (Shade && Shade->isAlive()) + DoCast(Shade, SPELL_DESTRUCTIVE_POISON); + DestructivePoisonTimer = 15000; + } else DestructivePoisonTimer -= diff; + + if (LightningBoltTimer <= diff) + { + DoCast(me->getVictim(), SPELL_LIGHTNING_BOLT); + LightningBoltTimer = 10000; + } else LightningBoltTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_shade_of_akama(Creature* pCreature) +{ + return new boss_shade_of_akamaAI (pCreature); +} + +CreatureAI* GetAI_mob_ashtongue_channeler(Creature* pCreature) +{ + return new mob_ashtongue_channelerAI (pCreature); +} + +CreatureAI* GetAI_mob_ashtongue_sorcerer(Creature* pCreature) +{ + return new mob_ashtongue_sorcererAI (pCreature); +} + +CreatureAI* GetAI_npc_akama_shade(Creature* pCreature) +{ + return new npc_akamaAI (pCreature); +} + +bool GossipSelect_npc_akama(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) //Fight time + { + pPlayer->CLOSE_GOSSIP_MENU(); + CAST_AI(npc_akamaAI, pCreature->AI())->BeginEvent(pPlayer); + } + + return true; +} + +bool GossipHello_npc_akama(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->isAlive()) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + pPlayer->SEND_GOSSIP_MENU(907, pCreature->GetGUID()); + } + + return true; +} + +void AddSC_boss_shade_of_akama() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_shade_of_akama"; + newscript->GetAI = &GetAI_boss_shade_of_akama; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_ashtongue_channeler"; + newscript->GetAI = &GetAI_mob_ashtongue_channeler; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_ashtongue_sorcerer"; + newscript->GetAI = &GetAI_mob_ashtongue_sorcerer; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_akama_shade"; + newscript->GetAI = &GetAI_npc_akama_shade; + newscript->pGossipHello = &GossipHello_npc_akama; + newscript->pGossipSelect = &GossipSelect_npc_akama; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp b/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp new file mode 100644 index 00000000000..bc1ea3ec673 --- /dev/null +++ b/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp @@ -0,0 +1,296 @@ +/* Copyright (C) 2006 - 2008 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Supremus +SD%Complete: 95 +SDComment: Need to implement molten punch +SDCategory: Black Temple +EndScriptData */ + +#include "ScriptedPch.h" +#include "black_temple.h" + +#define EMOTE_NEW_TARGET -1564010 +#define EMOTE_PUNCH_GROUND -1564011 //DoScriptText(EMOTE_PUNCH_GROUND, me); +#define EMOTE_GROUND_CRACK -1564012 + +//Spells +#define SPELL_MOLTEN_PUNCH 40126 +#define SPELL_HATEFUL_STRIKE 41926 +#define SPELL_MOLTEN_FLAME 40980 +#define SPELL_VOLCANIC_ERUPTION 40117 +#define SPELL_VOLCANIC_SUMMON 40276 +#define SPELL_BERSERK 45078 + +#define CREATURE_VOLCANO 23085 +#define CREATURE_STALKER 23095 + +#define PHASE_STRIKE 1 +#define PHASE_CHASE 2 + +#define EVENT_BERSERK 1 +#define EVENT_SWITCH_PHASE 2 +#define EVENT_FLAME 3 +#define EVENT_VOLCANO 4 +#define EVENT_SWITCH_TARGET 5 +#define EVENT_HATEFUL_STRIKE 6 + +#define GCD_CAST 1 + +struct molten_flameAI : public NullCreatureAI +{ + molten_flameAI(Creature *c) : NullCreatureAI(c) {} + + void InitializeAI() + { + float x, y, z; + me->GetNearPoint(me, x, y, z, 1, 100, M_PI*2*rand_norm()); + me->GetMotionMaster()->MovePoint(0, x, y, z); + me->SetVisibility(VISIBILITY_OFF); + me->CastSpell(me,SPELL_MOLTEN_FLAME,true); + } +}; + +struct boss_supremusAI : public ScriptedAI +{ + boss_supremusAI(Creature *c) : ScriptedAI(c), summons(me) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + EventMap events; + SummonList summons; + uint32 phase; + + void Reset() + { + if (pInstance) + { + if (me->isAlive()) + { + pInstance->SetData(DATA_SUPREMUSEVENT, NOT_STARTED); + //ToggleDoors(true); + } + //else ToggleDoors(false); + } + + phase = 0; + + events.Reset(); + summons.DespawnAll(); + } + + void EnterCombat(Unit * /*who*/) + { + if (pInstance) + pInstance->SetData(DATA_SUPREMUSEVENT, IN_PROGRESS); + + ChangePhase(); + events.ScheduleEvent(EVENT_BERSERK, 900000, GCD_CAST); + events.ScheduleEvent(EVENT_FLAME, 20000, GCD_CAST); + } + + void ChangePhase() + { + if (!phase || phase == PHASE_CHASE) + { + phase = PHASE_STRIKE; + summons.DoAction(EVENT_VOLCANO, 0); + events.ScheduleEvent(EVENT_HATEFUL_STRIKE, 5000, GCD_CAST, PHASE_STRIKE); + me->SetSpeed(MOVE_RUN, 1.2f); + me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, false); + me->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, false); + } + else + { + phase = PHASE_CHASE; + events.ScheduleEvent(EVENT_VOLCANO, 5000, GCD_CAST, PHASE_CHASE); + events.ScheduleEvent(EVENT_SWITCH_TARGET, 10000, 0, PHASE_CHASE); + me->SetSpeed(MOVE_RUN, 0.9f); + me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true); + me->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true); + } + DoResetThreat(); + DoZoneInCombat(); + events.SetPhase(phase); + events.ScheduleEvent(EVENT_SWITCH_PHASE, 60000, GCD_CAST); + } + + void JustDied(Unit * /*killer*/) + { + if (pInstance) + { + pInstance->SetData(DATA_SUPREMUSEVENT, DONE); + pInstance->HandleGameObject(pInstance->GetData64(DATA_GAMEOBJECT_SUPREMUS_DOORS), true); + } + summons.DespawnAll(); + } + + void JustSummoned(Creature *summon) {summons.Summon(summon);} + void SummonedCreatureDespawn(Creature *summon) {summons.Despawn(summon);} + + Unit* CalculateHatefulStrikeTarget() + { + uint32 health = 0; + Unit *pTarget = NULL; + + std::list& m_threatlist = me->getThreatManager().getThreatList(); + std::list::const_iterator i = m_threatlist.begin(); + for (i = m_threatlist.begin(); i!= m_threatlist.end(); ++i) + { + Unit* pUnit = Unit::GetUnit((*me), (*i)->getUnitGuid()); + if (pUnit && me->IsWithinMeleeRange(pUnit)) + { + if (pUnit->GetHealth() > health) + { + health = pUnit->GetHealth(); + pTarget = pUnit; + } + } + } + + return pTarget; + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + events.Update(diff); + + while (uint32 eventId = events.ExecuteEvent()) + { + switch(eventId) + { + case EVENT_BERSERK: + DoCast(me, SPELL_BERSERK, true); + break; + case EVENT_FLAME: + DoCast(me, SPELL_MOLTEN_PUNCH); + events.DelayEvents(1500, GCD_CAST); + events.ScheduleEvent(EVENT_FLAME, 20000, GCD_CAST); + break; + case EVENT_HATEFUL_STRIKE: + if (Unit *pTarget = CalculateHatefulStrikeTarget()) + DoCast(pTarget, SPELL_HATEFUL_STRIKE); + events.DelayEvents(1000, GCD_CAST); + events.ScheduleEvent(EVENT_HATEFUL_STRIKE, 5000, GCD_CAST, PHASE_STRIKE); + break; + case EVENT_SWITCH_TARGET: + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true)) + { + DoResetThreat(); + me->AddThreat(pTarget, 5000000.0f); + DoScriptText(EMOTE_NEW_TARGET, me); + } + events.ScheduleEvent(EVENT_SWITCH_TARGET, 10000, 0, PHASE_CHASE); + break; + case EVENT_VOLCANO: + { + Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 999, true); + if (!pTarget) pTarget = me->getVictim(); + if (pTarget) + { + //DoCast(pTarget, SPELL_VOLCANIC_SUMMON);//movement bugged + me->SummonCreature(CREATURE_VOLCANO,pTarget->GetPositionX(),pTarget->GetPositionY(),pTarget->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,30000); + DoScriptText(EMOTE_GROUND_CRACK, me); + events.DelayEvents(1500, GCD_CAST); + } + events.ScheduleEvent(EVENT_VOLCANO, 10000, GCD_CAST, PHASE_CHASE); + return; + } + case EVENT_SWITCH_PHASE: + ChangePhase(); + break; + } + } + + DoMeleeAttackIfReady(); + } +}; + +struct npc_volcanoAI : public Scripted_NoMovementAI +{ + npc_volcanoAI(Creature *c) : Scripted_NoMovementAI(c) {} + + void Reset() + { + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + //DoCast(me, SPELL_VOLCANIC_ERUPTION); + me->SetReactState(REACT_PASSIVE); + wait = 3000; + } + uint32 wait; + + void EnterCombat(Unit * /*who*/) {} + + void MoveInLineOfSight(Unit * /*who*/) {} + + void DoAction(const uint32 /*info*/) + { + me->RemoveAura(SPELL_VOLCANIC_ERUPTION); + } + + void UpdateAI(const uint32 diff) + { + if (wait <= diff)//wait 3secs before casting + { + DoCast(me, SPELL_VOLCANIC_ERUPTION); + wait = 60000; + } + else wait -= diff; + } + +}; + +CreatureAI* GetAI_boss_supremus(Creature* pCreature) +{ + return new boss_supremusAI (pCreature); +} + +CreatureAI* GetAI_molten_flame(Creature* pCreature) +{ + return new molten_flameAI (pCreature); +} + +CreatureAI* GetAI_npc_volcano(Creature* pCreature) +{ + return new npc_volcanoAI (pCreature); +} + +void AddSC_boss_supremus() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_supremus"; + newscript->GetAI = &GetAI_boss_supremus; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "molten_flame"; + newscript->GetAI = &GetAI_molten_flame; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_volcano"; + newscript->GetAI = &GetAI_npc_volcano; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp b/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp new file mode 100644 index 00000000000..670edc4d869 --- /dev/null +++ b/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp @@ -0,0 +1,508 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Teron_Gorefiend +SD%Complete: 60 +SDComment: Requires Mind Control support for Ghosts. +SDCategory: Black Temple +EndScriptData */ + +#include "ScriptedPch.h" +#include "black_temple.h" + + //Speech'n'sound +#define SAY_INTRO -1564037 +#define SAY_AGGRO -1564038 +#define SAY_SLAY1 -1564039 +#define SAY_SLAY2 -1564040 +#define SAY_SPELL1 -1564041 +#define SAY_SPELL2 -1564042 +#define SAY_SPECIAL1 -1564043 +#define SAY_SPECIAL2 -1564044 +#define SAY_ENRAGE -1564045 +#define SAY_DEATH -1564046 + +//Spells +#define SPELL_INCINERATE 40239 +#define SPELL_CRUSHING_SHADOWS 40243 +#define SPELL_SHADOWBOLT 40185 +#define SPELL_PASSIVE_SHADOWFORM 40326 +#define SPELL_SHADOW_OF_DEATH 40251 +#define SPELL_BERSERK 45078 + +#define SPELL_ATROPHY 40327 // Shadowy Constructs use this when they get within melee range of a player + +#define CREATURE_DOOM_BLOSSOM 23123 +#define CREATURE_SHADOWY_CONSTRUCT 23111 + +struct mob_doom_blossomAI : public ScriptedAI +{ + mob_doom_blossomAI(Creature *c) : ScriptedAI(c) {} + + uint32 CheckTeronTimer; + uint32 ShadowBoltTimer; + uint64 TeronGUID; + + void Reset() + { + CheckTeronTimer = 5000; + ShadowBoltTimer = 12000; + TeronGUID = 0; + } + + void EnterCombat(Unit * /*who*/) { } + void AttackStart(Unit* /*who*/) {} + void MoveInLineOfSight(Unit* /*who*/) {} + + void Despawn() + { + me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + me->RemoveCorpse(); + } + + void UpdateAI(const uint32 diff) + { + if (CheckTeronTimer <= diff) + { + if (TeronGUID) + { + DoZoneInCombat(); + + Creature* Teron = (Unit::GetCreature((*me), TeronGUID)); + if ((Teron) && (!Teron->isAlive() || Teron->IsInEvadeMode())) + Despawn(); + } + else + Despawn(); + + CheckTeronTimer = 5000; + } else CheckTeronTimer -= diff; + + if (ShadowBoltTimer < diff && me->isInCombat()) + { + DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_SHADOWBOLT); + ShadowBoltTimer = 10000; + } else ShadowBoltTimer -= diff; + return; + } + + void SetTeronGUID(uint64 guid){ TeronGUID = guid; } +}; + +struct mob_shadowy_constructAI : public ScriptedAI +{ + mob_shadowy_constructAI(Creature* c) : ScriptedAI(c) {} + + uint64 GhostGUID; + uint64 TeronGUID; + + uint32 CheckPlayerTimer; + uint32 CheckTeronTimer; + + void Reset() + { + GhostGUID = 0; + TeronGUID = 0; + + CheckPlayerTimer = 2000; + CheckTeronTimer = 5000; + } + + void EnterCombat(Unit* /*who*/) {} + + void MoveInLineOfSight(Unit *who) + { + if (!who || (!who->isAlive()) || (who->GetGUID() == GhostGUID)) + return; + + ScriptedAI::MoveInLineOfSight(who); + } + +/* Comment it out for now. NOTE TO FUTURE DEV: UNCOMMENT THIS OUT ONLY AFTER MIND CONTROL IS IMPLEMENTED + void DamageTaken(Unit* done_by, uint32 &damage) + { + if (done_by->GetGUID() != GhostGUID) + damage = 0; // Only the ghost can deal damage. + } + */ + + void CheckPlayers() + { + std::list& m_threatlist = me->getThreatManager().getThreatList(); + if (m_threatlist.empty()) + return; // No threat list. Don't continue. + std::list::const_iterator itr = m_threatlist.begin(); + std::list targets; + for (; itr != m_threatlist.end(); ++itr) + { + Unit* pUnit = Unit::GetUnit((*me), (*itr)->getUnitGuid()); + if (pUnit && pUnit->isAlive()) + targets.push_back(pUnit); + } + targets.sort(Trinity::ObjectDistanceOrderPred(me)); + Unit *pTarget = targets.front(); + if (pTarget && me->IsWithinDistInMap(pTarget, me->GetAttackDistance(pTarget))) + { + DoCast(pTarget, SPELL_ATROPHY); + me->AI()->AttackStart(pTarget); + } + } + + void UpdateAI(const uint32 diff) + { + if (CheckPlayerTimer <= diff) + { + CheckPlayers(); + CheckPlayerTimer = 3000; + } else CheckPlayerTimer -= diff; + + if (CheckTeronTimer <= diff) + { + Creature* Teron = (Unit::GetCreature((*me), TeronGUID)); + if (!Teron || !Teron->isAlive() || Teron->IsInEvadeMode()) + me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + + CheckTeronTimer = 5000; + } else CheckTeronTimer -= diff; + } +}; + +struct boss_teron_gorefiendAI : public ScriptedAI +{ + boss_teron_gorefiendAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint32 IncinerateTimer; + uint32 SummonDoomBlossomTimer; + uint32 EnrageTimer; + uint32 CrushingShadowsTimer; + uint32 ShadowOfDeathTimer; + uint32 SummonShadowsTimer; + uint32 RandomYellTimer; + uint32 AggroTimer; + + uint64 AggroTargetGUID; + uint64 GhostGUID; // Player that gets killed by Shadow of Death and gets turned into a ghost + + bool Intro; + bool Done; + + void Reset() + { + if (pInstance) + pInstance->SetData(DATA_TERONGOREFIENDEVENT, NOT_STARTED); + + IncinerateTimer = 20000 + rand()%11000; + SummonDoomBlossomTimer = 12000; + EnrageTimer = 600000; + CrushingShadowsTimer = 22000; + SummonShadowsTimer = 60000; + RandomYellTimer = 50000; + + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + // Start off unattackable so that the intro is done properly + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + AggroTimer = 20000; + AggroTargetGUID = 0; + Intro = false; + Done = false; + } + + void EnterCombat(Unit * /*who*/) {} + + void MoveInLineOfSight(Unit* pWho) + { + if (!Intro && pWho->GetTypeId() == TYPEID_PLAYER && pWho->isTargetableForAttack() && me->IsHostileTo(pWho) && pWho->isInAccessiblePlaceFor(me)) + { + if (me->IsWithinDistInMap(pWho, VISIBLE_RANGE) && me->IsWithinLOSInMap(pWho)) + { + if (pInstance) + pInstance->SetData(DATA_TERONGOREFIENDEVENT, IN_PROGRESS); + + me->GetMotionMaster()->Clear(false); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + DoScriptText(SAY_INTRO, me); + me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_TALK); + AggroTargetGUID = pWho->GetGUID(); + Intro = true; + } + } + if (Done) + ScriptedAI::MoveInLineOfSight(pWho); + } + + void KilledUnit(Unit * /*victim*/) + { + DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me); + } + + void JustDied(Unit * /*victim*/) + { + if (pInstance) + pInstance->SetData(DATA_TERONGOREFIENDEVENT, DONE); + + DoScriptText(SAY_DEATH, me); + } + + float CalculateRandomLocation(float Loc, uint32 radius) + { + float coord = Loc; + switch (urand(0,1)) + { + case 0: + coord += rand()%radius; + break; + case 1: + coord -= rand()%radius; + break; + } + return coord; + } + + void SetThreatList(Creature* Blossom) + { + if (!Blossom) return; + + std::list& m_threatlist = me->getThreatManager().getThreatList(); + std::list::const_iterator i = m_threatlist.begin(); + for (i = m_threatlist.begin(); i != m_threatlist.end(); ++i) + { + Unit* pUnit = Unit::GetUnit((*me), (*i)->getUnitGuid()); + if (pUnit && pUnit->isAlive()) + { + float threat = DoGetThreat(pUnit); + Blossom->AddThreat(pUnit, threat); + } + } + } + + void MindControlGhost() + { + /************************************************************************/ + /** NOTE FOR FUTURE DEVELOPER: PROPERLY IMPLEMENT THE GHOST PORTION *****/ + /** ONLY AFTER TrinIty FULLY IMPLEMENTS MIND CONTROL ABILITIES *****/ + /** THE CURRENT CODE IN THIS FUNCTION IS ONLY THE BEGINNING OF *****/ + /** WHAT IS FULLY NECESSARY FOR GOREFIEND TO BE 100% COMPLETE *****/ + /************************************************************************/ + + Unit* Ghost = NULL; + if (GhostGUID) + Ghost = Unit::GetUnit((*me), GhostGUID); + if (Ghost && Ghost->isAlive() && Ghost->HasAura(SPELL_SHADOW_OF_DEATH)) + { + /*float x,y,z; + Ghost->GetPosition(x,y,z); + Creature* control = me->SummonCreature(CREATURE_GHOST, x, y, z, 0, TEMPSUMMON_TIMED_DESAWN, 30000); + if (control) + { + CAST_PLR(Ghost)->Possess(control); + Ghost->DealDamage(Ghost, Ghost->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, + false); + }*/ + for (uint8 i = 0; i < 4; ++i) + { + Creature* Construct = NULL; + float X = CalculateRandomLocation(Ghost->GetPositionX(), 10); + float Y = CalculateRandomLocation(Ghost->GetPositionY(), 10); + Construct = me->SummonCreature(CREATURE_SHADOWY_CONSTRUCT, X, Y, Ghost->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000); + if (Construct) + { + Construct->CastSpell(Construct, SPELL_PASSIVE_SHADOWFORM, true); + SetThreatList(Construct); // Use same function as Doom Blossom to set Threat List. + CAST_AI(mob_shadowy_constructAI, Construct->AI())->GhostGUID = GhostGUID; + Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1); + if (!pTarget) // someone's trying to solo. + pTarget = me->getVictim(); + + if (pTarget) + Construct->GetMotionMaster()->MoveChase(pTarget); + } + } + } + } + + void UpdateAI(const uint32 diff) + { + if (Intro && !Done) + { + if (AggroTimer <= diff) + { + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + DoScriptText(SAY_AGGRO, me); + me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE); + Done = true; + if (AggroTargetGUID) + { + Unit* pUnit = Unit::GetUnit((*me), AggroTargetGUID); + if (pUnit) + AttackStart(pUnit); + + DoZoneInCombat(); + } + else + { + EnterEvadeMode(); + return; + } + } else AggroTimer -= diff; + } + + if (!UpdateVictim() || !Done) + return; + + if (SummonShadowsTimer <= diff) + { + //MindControlGhost(); + + for (uint8 i = 0; i < 2; ++i) + { + Creature* Shadow = NULL; + float X = CalculateRandomLocation(me->GetPositionX(), 10); + Shadow = me->SummonCreature(CREATURE_SHADOWY_CONSTRUCT, X, me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 0); + if (Shadow) + { + Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1); + if (!pTarget) + pTarget = me->getVictim(); + + if (pTarget) + Shadow->AI()->AttackStart(pTarget); + } + } + SummonShadowsTimer = 60000; + } else SummonShadowsTimer -= diff; + + if (SummonDoomBlossomTimer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + float X = CalculateRandomLocation(pTarget->GetPositionX(), 20); + float Y = CalculateRandomLocation(pTarget->GetPositionY(), 20); + float Z = pTarget->GetPositionZ(); + Z = me->GetMap()->GetHeight(X, Y, Z); + Creature* DoomBlossom = me->SummonCreature(CREATURE_DOOM_BLOSSOM, X, Y, Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 20000); + if (DoomBlossom) + { + DoomBlossom->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + DoomBlossom->setFaction(me->getFaction()); + DoomBlossom->AddThreat(pTarget, 1.0f); + CAST_AI(mob_doom_blossomAI, DoomBlossom->AI())->SetTeronGUID(me->GetGUID()); + pTarget->CombatStart(DoomBlossom); + SetThreatList(DoomBlossom); + SummonDoomBlossomTimer = 35000; + } + } + } else SummonDoomBlossomTimer -= diff; + + if (IncinerateTimer <= diff) + { + Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1); + if (!pTarget) + pTarget = me->getVictim(); + + if (pTarget) + { + DoScriptText(RAND(SAY_SPECIAL1,SAY_SPECIAL2), me); + DoCast(pTarget, SPELL_INCINERATE); + IncinerateTimer = 20000 + rand()%31 * 1000; + } + } else IncinerateTimer -= diff; + + if (CrushingShadowsTimer <= diff) + { + Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (pTarget && pTarget->isAlive()) + DoCast(pTarget, SPELL_CRUSHING_SHADOWS); + CrushingShadowsTimer = 10000 + rand()%16 * 1000; + } else CrushingShadowsTimer -= diff; + + /*** NOTE FOR FUTURE DEV: UNCOMMENT BELOW ONLY IF MIND CONTROL IS FULLY IMPLEMENTED **/ + /*if (ShadowOfDeathTimer <= diff) + { + Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1); + + if (!pTarget) + pTarget = me->getVictim(); + + if (pTarget && pTarget->isAlive() && pTarget->GetTypeId() == TYPEID_PLAYER) + { + DoCast(pTarget, SPELL_SHADOW_OF_DEATH); + GhostGUID = pTarget->GetGUID(); + ShadowOfDeathTimer = 30000; + SummonShadowsTimer = 53000; // Make it VERY close but slightly less so that we can check if the aura is still on the player + } + } else ShadowOfDeathTimer -= diff;*/ + + if (RandomYellTimer <= diff) + { + DoScriptText(RAND(SAY_SPELL1,SAY_SPELL2), me); + RandomYellTimer = 50000 + rand()%51 * 1000; + } else RandomYellTimer -= diff; + + if (!me->HasAura(SPELL_BERSERK)) + { + if (EnrageTimer <= diff) + { + DoCast(me, SPELL_BERSERK); + DoScriptText(SAY_ENRAGE, me); + } else EnrageTimer -= diff; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_doom_blossom(Creature* pCreature) +{ + return new mob_doom_blossomAI(pCreature); +} + +CreatureAI* GetAI_mob_shadowy_construct(Creature* pCreature) +{ + return new mob_shadowy_constructAI(pCreature); +} + +CreatureAI* GetAI_boss_teron_gorefiend(Creature* pCreature) +{ + return new boss_teron_gorefiendAI (pCreature); +} + +void AddSC_boss_teron_gorefiend() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "mob_doom_blossom"; + newscript->GetAI = &GetAI_mob_doom_blossom; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_shadowy_construct"; + newscript->GetAI = &GetAI_mob_shadowy_construct; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_teron_gorefiend"; + newscript->GetAI = &GetAI_boss_teron_gorefiend; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp b/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp new file mode 100644 index 00000000000..7d94b4b36a0 --- /dev/null +++ b/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp @@ -0,0 +1,226 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Warlord_Najentus +SD%Complete: 95 +SDComment: +SDCategory: Black Temple +EndScriptData */ + +#include "ScriptedPch.h" +#include "black_temple.h" + +enum eEnums +{ + SAY_AGGRO = -1564000, + SAY_NEEDLE1 = -1564001, + SAY_NEEDLE2 = -1564002, + SAY_SLAY1 = -1564003, + SAY_SLAY2 = -1564004, + SAY_SPECIAL1 = -1564005, + SAY_SPECIAL2 = -1564006, + SAY_ENRAGE1 = -1564007, //is this text actually in use? + SAY_ENRAGE2 = -1564008, + SAY_DEATH = -1564009, + + //Spells + SPELL_NEEDLE_SPINE = 39992, + SPELL_TIDAL_BURST = 39878, + SPELL_TIDAL_SHIELD = 39872, + SPELL_IMPALING_SPINE = 39837, + SPELL_CREATE_NAJENTUS_SPINE = 39956, + SPELL_HURL_SPINE = 39948, + SPELL_BERSERK = 26662, + + GOBJECT_SPINE = 185584, + + EVENT_BERSERK = 1, + EVENT_YELL = 2, + EVENT_NEEDLE = 3, + EVENT_SPINE = 4, + EVENT_SHIELD = 5, + + GCD_CAST = 1, + GCD_YELL = 2 +}; + +struct boss_najentusAI : public ScriptedAI +{ + boss_najentusAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + EventMap events; + + uint64 SpineTargetGUID; + + void Reset() + { + events.Reset(); + + SpineTargetGUID = 0; + + if (pInstance) + pInstance->SetData(DATA_HIGHWARLORDNAJENTUSEVENT, NOT_STARTED); + } + + void KilledUnit(Unit * /*victim*/) + { + DoScriptText(rand()%2 ? SAY_SLAY1 : SAY_SLAY2, me); + events.DelayEvents(5000, GCD_YELL); + } + + void JustDied(Unit * /*victim*/) + { + if (pInstance) + pInstance->SetData(DATA_HIGHWARLORDNAJENTUSEVENT, DONE); + + DoScriptText(SAY_DEATH, me); + } + + void SpellHit(Unit * /*caster*/, const SpellEntry *spell) + { + if (spell->Id == SPELL_HURL_SPINE && me->HasAura(SPELL_TIDAL_SHIELD)) + { + me->RemoveAurasDueToSpell(SPELL_TIDAL_SHIELD); + DoCast(me, SPELL_TIDAL_BURST, true); + ResetTimer(); + } + } + + void EnterCombat(Unit * /*who*/) + { + if (pInstance) + pInstance->SetData(DATA_HIGHWARLORDNAJENTUSEVENT, IN_PROGRESS); + + DoScriptText(SAY_AGGRO, me); + DoZoneInCombat(); + events.ScheduleEvent(EVENT_BERSERK, 480000, GCD_CAST); + events.ScheduleEvent(EVENT_YELL, 45000 + (rand()%76)*1000, GCD_YELL); + ResetTimer(); + } + + bool RemoveImpalingSpine() + { + if (!SpineTargetGUID) return false; + Unit *pTarget = Unit::GetUnit(*me, SpineTargetGUID); + if (pTarget && pTarget->HasAura(SPELL_IMPALING_SPINE)) + pTarget->RemoveAurasDueToSpell(SPELL_IMPALING_SPINE); + SpineTargetGUID=0; + return true; + } + + void ResetTimer(uint32 inc = 0) + { + events.RescheduleEvent(EVENT_NEEDLE, 10000 + inc, GCD_CAST); + events.RescheduleEvent(EVENT_SPINE, 20000 + inc, GCD_CAST); + events.RescheduleEvent(EVENT_SHIELD, 60000 + inc); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + events.Update(diff); + + while (uint32 eventId = events.ExecuteEvent()) + { + switch(eventId) + { + case EVENT_SHIELD: + DoCast(me, SPELL_TIDAL_SHIELD, true); + ResetTimer(45000); + break; + case EVENT_BERSERK: + DoScriptText(SAY_ENRAGE2, me); + DoCast(me, SPELL_BERSERK, true); + events.DelayEvents(15000, GCD_YELL); + break; + case EVENT_SPINE: + { + Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1); + if (!pTarget) pTarget = me->getVictim(); + if (pTarget) + { + DoCast(pTarget, SPELL_IMPALING_SPINE, true); + SpineTargetGUID = pTarget->GetGUID(); + //must let target summon, otherwise you cannot click the spine + pTarget->SummonGameObject(GOBJECT_SPINE, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), me->GetOrientation(), 0, 0, 0, 0, 30); + DoScriptText(rand()%2 ? SAY_NEEDLE1 : SAY_NEEDLE2, me); + events.DelayEvents(1500, GCD_CAST); + events.DelayEvents(15000, GCD_YELL); + } + events.ScheduleEvent(EVENT_SPINE, 21000, GCD_CAST); + return; + } + case EVENT_NEEDLE: + { + //DoCast(me, SPELL_NEEDLE_SPINE, true); + std::list pTargets; + SelectTargetList(pTargets, 3, SELECT_TARGET_RANDOM, 80, true); + for (std::list::const_iterator i = pTargets.begin(); i != pTargets.end(); ++i) + DoCast(*i, 39835, true); + events.ScheduleEvent(EVENT_NEEDLE, urand(15000,25000), GCD_CAST); + events.DelayEvents(1500, GCD_CAST); + return; + } + case EVENT_YELL: + DoScriptText(RAND(SAY_SPECIAL1, SAY_SPECIAL2), me); + events.ScheduleEvent(EVENT_YELL, urand(25000,100000), GCD_YELL); + events.DelayEvents(15000, GCD_YELL); + break; + } + } + + DoMeleeAttackIfReady(); + } +}; + +bool GOHello_go_najentus_spine(Player* pPlayer, GameObject* pGo) +{ + if (ScriptedInstance* pInstance = pGo->GetInstanceData()) + if (Creature* Najentus = Unit::GetCreature(*pGo, pInstance->GetData64(DATA_HIGHWARLORDNAJENTUS))) + if (CAST_AI(boss_najentusAI, Najentus->AI())->RemoveImpalingSpine()) + { + pPlayer->CastSpell(pPlayer, SPELL_CREATE_NAJENTUS_SPINE, true); + pGo->Delete(); + } + return true; +} + +CreatureAI* GetAI_boss_najentus(Creature* pCreature) +{ + return new boss_najentusAI (pCreature); +} + +void AddSC_boss_najentus() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_najentus"; + newscript->GetAI = &GetAI_boss_najentus; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "go_najentus_spine"; + newscript->pGOHello = &GOHello_go_najentus_spine; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/Outland/BlackTemple/illidari_council.cpp b/src/server/scripts/Outland/BlackTemple/illidari_council.cpp new file mode 100644 index 00000000000..82cc2876b5a --- /dev/null +++ b/src/server/scripts/Outland/BlackTemple/illidari_council.cpp @@ -0,0 +1,874 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Illidari_Council +SD%Complete: 95 +SDComment: Circle of Healing not working properly. +SDCategory: Black Temple +EndScriptData */ + +#include "ScriptedPch.h" +#include "black_temple.h" + +//Speech'n'Sounds +#define SAY_GATH_SLAY -1564085 +#define SAY_GATH_SLAY_COMNT -1564089 +#define SAY_GATH_DEATH -1564093 +#define SAY_GATH_SPECIAL1 -1564077 +#define SAY_GATH_SPECIAL2 -1564081 + +#define SAY_VERA_SLAY -1564086 +#define SAY_VERA_COMNT -1564089 //signed for 22949 +#define SAY_VERA_DEATH -1564094 +#define SAY_VERA_SPECIAL1 -1564078 +#define SAY_VERA_SPECIAL2 -1564082 + +#define SAY_MALA_SLAY -1564087 +#define SAY_MALA_COMNT -1564090 +#define SAY_MALA_DEATH -1564095 +#define SAY_MALA_SPECIAL1 -1564079 +#define SAY_MALA_SPECIAL2 -1564083 + +#define SAY_ZERE_SLAY -1564088 +#define SAY_ZERE_COMNT -1564091 +#define SAY_ZERE_DEATH -1564096 +#define SAY_ZERE_SPECIAL1 -1564080 +#define SAY_ZERE_SPECIAL2 -1564084 + +#define ERROR_INST_DATA "SD2 ERROR: Instance Data for Black Temple not set properly; Illidari Council event will not function properly." + +#define AKAMAID 23089 + +struct CouncilYells +{ + int32 entry; + uint32 timer; +}; + +static CouncilYells CouncilAggro[]= +{ + {-1564069, 5000}, // Gathios + {-1564070, 5500}, // Veras + {-1564071, 5000}, // Malande + {-1564072, 0}, // Zerevor +}; + +// Need to get proper timers for this later +static CouncilYells CouncilEnrage[]= +{ + {-1564073, 2000}, // Gathios + {-1564074, 6000}, // Veras + {-1564075, 5000}, // Malande + {-1564076, 0}, // Zerevor +}; + +// High Nethermancer Zerevor's spells +#define SPELL_FLAMESTRIKE 41481 +#define SPELL_BLIZZARD 41482 +#define SPELL_ARCANE_BOLT 41483 +#define SPELL_ARCANE_EXPLOSION 41524 +#define SPELL_DAMPEN_MAGIC 41478 + +// Lady Malande's spells +#define SPELL_EMPOWERED_SMITE 41471 +#define SPELL_CIRCLE_OF_HEALING 41455 +#define SPELL_REFLECTIVE_SHIELD 41475 +#define SPELL_DIVINE_WRATH 41472 +#define SPELL_HEAL_VISUAL 24171 + +// Gathios the Shatterer's spells +#define SPELL_BLESS_PROTECTION 41450 +#define SPELL_BLESS_SPELLWARD 41451 +#define SPELL_CONSECRATION 41541 +#define SPELL_HAMMER_OF_JUSTICE 41468 +#define SPELL_SEAL_OF_COMMAND 41469 +#define SPELL_SEAL_OF_BLOOD 41459 +#define SPELL_CHROMATIC_AURA 41453 +#define SPELL_DEVOTION_AURA 41452 + +// Veras Darkshadow's spells +#define SPELL_DEADLY_POISON 41485 +#define SPELL_ENVENOM 41487 +#define SPELL_VANISH 41479 + +#define SPELL_BERSERK 45078 + +struct mob_blood_elf_council_voice_triggerAI : public ScriptedAI +{ + mob_blood_elf_council_voice_triggerAI(Creature* c) : ScriptedAI(c) + { + for (uint8 i = 0; i < 4; ++i) + Council[i] = 0; + } + + uint64 Council[4]; + + uint32 EnrageTimer; + uint32 AggroYellTimer; + + uint8 YellCounter; // Serves as the counter for both the aggro and enrage yells + + bool EventStarted; + + void Reset() + { + EnrageTimer = 900000; // 15 minutes + AggroYellTimer = 500; + + YellCounter = 0; + + EventStarted = false; + } + + // finds and stores the GUIDs for each Council member using instance data system. + void LoadCouncilGUIDs() + { + if (ScriptedInstance* pInstance = me->GetInstanceData()) + { + Council[0] = pInstance->GetData64(DATA_GATHIOSTHESHATTERER); + Council[1] = pInstance->GetData64(DATA_VERASDARKSHADOW); + Council[2] = pInstance->GetData64(DATA_LADYMALANDE); + Council[3] = pInstance->GetData64(DATA_HIGHNETHERMANCERZEREVOR); + } else error_log(ERROR_INST_DATA); + } + + void EnterCombat(Unit* /*who*/) {} + + void AttackStart(Unit* /*who*/) {} + void MoveInLineOfSight(Unit* /*who*/) {} + + void UpdateAI(const uint32 diff) + { + if (!EventStarted) + return; + + if (YellCounter > 3) + return; + + if (AggroYellTimer) + { + if (AggroYellTimer <= diff) + { + if (Unit* pMember = Unit::GetUnit(*me, Council[YellCounter])) + { + DoScriptText(CouncilAggro[YellCounter].entry, pMember); + AggroYellTimer = CouncilAggro[YellCounter].timer; + } + ++YellCounter; + if (YellCounter > 3) + YellCounter = 0; // Reuse for Enrage Yells + } else AggroYellTimer -= diff; + } + + if (EnrageTimer) + { + if (EnrageTimer <= diff) + { + if (Unit* pMember = Unit::GetUnit(*me, Council[YellCounter])) + { + pMember->CastSpell(pMember, SPELL_BERSERK, true); + DoScriptText(CouncilEnrage[YellCounter].entry, pMember); + EnrageTimer = CouncilEnrage[YellCounter].timer; + } + ++YellCounter; + } else EnrageTimer -= diff; + } + } +}; + +struct mob_illidari_councilAI : public ScriptedAI +{ + mob_illidari_councilAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + for (uint8 i = 0; i < 4; ++i) + Council[i] = 0; + } + + ScriptedInstance* pInstance; + + uint64 Council[4]; + + uint32 CheckTimer; + uint32 EndEventTimer; + + uint8 DeathCount; + + bool EventBegun; + + void Reset() + { + CheckTimer = 2000; + EndEventTimer = 0; + + DeathCount = 0; + + Creature* pMember = NULL; + for (uint8 i = 0; i < 4; ++i) + { + pMember = Unit::GetCreature((*me), Council[i]); + if (!pMember) + continue; + + if (!pMember->isAlive()) + { + pMember->RemoveCorpse(); + pMember->Respawn(); + } + pMember->AI()->EnterEvadeMode(); + } + + if (pInstance) + { + pInstance->SetData(DATA_ILLIDARICOUNCILEVENT, NOT_STARTED); + if (Creature* VoiceTrigger = (Unit::GetCreature(*me, pInstance->GetData64(DATA_BLOOD_ELF_COUNCIL_VOICE)))) + VoiceTrigger->AI()->EnterEvadeMode(); + } + + EventBegun = false; + + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetDisplayId(11686); + } + + void EnterCombat(Unit * /*who*/) {} + void AttackStart(Unit* /*who*/) {} + void MoveInLineOfSight(Unit* /*who*/) {} + + void StartEvent(Unit *pTarget) + { + if (!pInstance) + return; + + if (pTarget && pTarget->isAlive()) + { + Council[0] = pInstance->GetData64(DATA_GATHIOSTHESHATTERER); + Council[1] = pInstance->GetData64(DATA_HIGHNETHERMANCERZEREVOR); + Council[2] = pInstance->GetData64(DATA_LADYMALANDE); + Council[3] = pInstance->GetData64(DATA_VERASDARKSHADOW); + + // Start the event for the Voice Trigger + if (Creature* VoiceTrigger = (Unit::GetCreature(*me, pInstance->GetData64(DATA_BLOOD_ELF_COUNCIL_VOICE)))) + { + CAST_AI(mob_blood_elf_council_voice_triggerAI, VoiceTrigger->AI())->LoadCouncilGUIDs(); + CAST_AI(mob_blood_elf_council_voice_triggerAI, VoiceTrigger->AI())->EventStarted = true; + } + + for (uint8 i = 0; i < 4; ++i) + { + Unit* Member = NULL; + if (Council[i]) + { + Member = Unit::GetUnit((*me), Council[i]); + if (Member && Member->isAlive()) + CAST_CRE(Member)->AI()->AttackStart(pTarget); + } + } + + pInstance->SetData(DATA_ILLIDARICOUNCILEVENT, IN_PROGRESS); + + EventBegun = true; + } + } + + void UpdateAI(const uint32 diff) + { + if (!EventBegun) return; + + if (EndEventTimer) + { + if (EndEventTimer <= diff) + { + if (DeathCount > 3) + { + if (pInstance) + { + if (Creature* VoiceTrigger = (Unit::GetCreature(*me, pInstance->GetData64(DATA_BLOOD_ELF_COUNCIL_VOICE)))) + VoiceTrigger->DealDamage(VoiceTrigger, VoiceTrigger->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + pInstance->SetData(DATA_ILLIDARICOUNCILEVENT, DONE); + //me->SummonCreature(AKAMAID,746.466980f,304.394989f,311.90208f,6.272870f,TEMPSUMMON_DEAD_DESPAWN,0); + } + me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + return; + } + + Creature* pMember = (Unit::GetCreature(*me, Council[DeathCount])); + if (pMember && pMember->isAlive()) + pMember->DealDamage(pMember, pMember->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + ++DeathCount; + EndEventTimer = 1500; + } else EndEventTimer -= diff; + } + + if (CheckTimer) + { + if (CheckTimer <= diff) + { + uint8 EvadeCheck = 0; + for (uint8 i = 0; i < 4; ++i) + { + if (Council[i]) + { + if (Creature* Member = (Unit::GetCreature((*me), Council[i]))) + { + // This is the evade/death check. + if (Member->isAlive() && !Member->getVictim()) + ++EvadeCheck; //If all members evade, we reset so that players can properly reset the event + else if (!Member->isAlive()) // If even one member dies, kill the rest, set instance data, and kill self. + { + EndEventTimer = 1000; + CheckTimer = 0; + return; + } + } + } + } + + if (EvadeCheck > 3) + Reset(); + + CheckTimer = 2000; + } else CheckTimer -= diff; + } + + } +}; + +struct boss_illidari_councilAI : public ScriptedAI +{ + boss_illidari_councilAI(Creature* c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + for (uint8 i = 0; i < 4; ++i) + Council[i] = 0; + LoadedGUIDs = false; + } + + uint64 Council[4]; + + ScriptedInstance* pInstance; + + bool LoadedGUIDs; + + void EnterCombat(Unit* who) + { + if (pInstance) + { + Creature* Controller = (Unit::GetCreature(*me, pInstance->GetData64(DATA_ILLIDARICOUNCIL))); + if (Controller) + CAST_AI(mob_illidari_councilAI, Controller->AI())->StartEvent(who); + } + else + { + error_log(ERROR_INST_DATA); + EnterEvadeMode(); + return; + } + DoZoneInCombat(); + // Load GUIDs on first aggro because the Creature guids are only set as the creatures are created in world- + // this means that for each pCreature, it will attempt to LoadGUIDs even though some of the other creatures are + // not in world, and thus have no GUID set in the instance data system. Putting it in aggro ensures that all the creatures + // have been loaded and have their GUIDs set in the instance data system. + if (!LoadedGUIDs) + LoadGUIDs(); + } + + void EnterEvadeMode() + { + for (uint8 i = 0; i < 4; ++i) + { + if (Unit* pUnit = Unit::GetUnit(*me, Council[i])) + if (pUnit != me && pUnit->getVictim()) + { + AttackStart(pUnit->getVictim()); + return; + } + } + ScriptedAI::EnterEvadeMode(); + } + + void DamageTaken(Unit* done_by, uint32 &damage) + { + if (done_by == me) + return; + + damage /= 4; + for (uint8 i = 0; i < 4; ++i) + { + if (Creature* pUnit = Unit::GetCreature(*me, Council[i])) + if (pUnit != me && damage < pUnit->GetHealth()) + { + pUnit->SetHealth(pUnit->GetHealth() - damage); + pUnit->LowerPlayerDamageReq(damage); + } + } + } + + void LoadGUIDs() + { + if (!pInstance) + { + error_log(ERROR_INST_DATA); + return; + } + + Council[0] = pInstance->GetData64(DATA_LADYMALANDE); + Council[1] = pInstance->GetData64(DATA_HIGHNETHERMANCERZEREVOR); + Council[2] = pInstance->GetData64(DATA_GATHIOSTHESHATTERER); + Council[3] = pInstance->GetData64(DATA_VERASDARKSHADOW); + + LoadedGUIDs = true; + } +}; + +struct boss_gathios_the_shattererAI : public boss_illidari_councilAI +{ + boss_gathios_the_shattererAI(Creature *c) : boss_illidari_councilAI(c) {} + + uint32 ConsecrationTimer; + uint32 HammerOfJusticeTimer; + uint32 SealTimer; + uint32 AuraTimer; + uint32 BlessingTimer; + + void Reset() + { + ConsecrationTimer = 40000; + HammerOfJusticeTimer = 10000; + SealTimer = 40000; + AuraTimer = 90000; + BlessingTimer = 60000; + } + + void KilledUnit(Unit * /*victim*/) + { + DoScriptText(SAY_GATH_SLAY, me); + } + + void JustDied(Unit * /*victim*/) + { + DoScriptText(SAY_GATH_DEATH, me); + } + + Unit* SelectCouncilMember() + { + Unit* pUnit = me; + uint32 member = 0; // He chooses Lady Malande most often + + if (rand()%10 == 0) // But there is a chance he picks someone else. + member = urand(1, 3); + + if (member != 2) // No need to create another pointer to us using Unit::GetUnit + pUnit = Unit::GetUnit((*me), Council[member]); + return pUnit; + } + + void CastAuraOnCouncil() + { + uint32 spellid = 0; + switch (urand(0,1)) + { + case 0: spellid = SPELL_DEVOTION_AURA; break; + case 1: spellid = SPELL_CHROMATIC_AURA; break; + } + for (uint8 i = 0; i < 4; ++i) + { + Unit* pUnit = Unit::GetUnit((*me), Council[i]); + if (pUnit) + pUnit->CastSpell(pUnit, spellid, true, 0, 0, me->GetGUID()); + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (BlessingTimer <= diff) + { + if (Unit* pUnit = SelectCouncilMember()) + { + switch (urand(0,1)) + { + case 0: DoCast(pUnit, SPELL_BLESS_SPELLWARD); break; + case 1: DoCast(pUnit, SPELL_BLESS_PROTECTION); break; + } + } + BlessingTimer = 60000; + } else BlessingTimer -= diff; + + if (ConsecrationTimer <= diff) + { + DoCast(me, SPELL_CONSECRATION); + ConsecrationTimer = 40000; + } else ConsecrationTimer -= diff; + + if (HammerOfJusticeTimer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + // is in ~10-40 yd range + if (me->IsInRange(pTarget, 10.0f, 40.0f, false)) + { + DoCast(pTarget, SPELL_HAMMER_OF_JUSTICE); + HammerOfJusticeTimer = 20000; + } + } + } else HammerOfJusticeTimer -= diff; + + if (SealTimer <= diff) + { + switch (urand(0,1)) + { + case 0: DoCast(me, SPELL_SEAL_OF_COMMAND); break; + case 1: DoCast(me, SPELL_SEAL_OF_BLOOD); break; + } + SealTimer = 40000; + } else SealTimer -= diff; + + if (AuraTimer <= diff) + { + CastAuraOnCouncil(); + AuraTimer = 90000; + } else AuraTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct boss_high_nethermancer_zerevorAI : public boss_illidari_councilAI +{ + boss_high_nethermancer_zerevorAI(Creature *c) : boss_illidari_councilAI(c) {} + + uint32 BlizzardTimer; + uint32 FlamestrikeTimer; + uint32 ArcaneBoltTimer; + uint32 DampenMagicTimer; + uint32 Cooldown; + uint32 ArcaneExplosionTimer; + + void Reset() + { + BlizzardTimer = 30000 + rand()%61 * 1000; + FlamestrikeTimer = 30000 + rand()%61 * 1000; + ArcaneBoltTimer = 10000; + DampenMagicTimer = 2000; + ArcaneExplosionTimer = 14000; + Cooldown = 0; + } + + void KilledUnit(Unit * /*victim*/) + { + DoScriptText(SAY_ZERE_SLAY, me); + } + + void JustDied(Unit * /*victim*/) + { + DoScriptText(SAY_ZERE_DEATH, me); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (Cooldown) + { + if (Cooldown <= diff) Cooldown = 0; + else + { + Cooldown -= diff; + return; // Don't cast any other spells if global cooldown is still ticking + } + } + + if (DampenMagicTimer <= diff) + { + DoCast(me, SPELL_DAMPEN_MAGIC); + Cooldown = 1000; + DampenMagicTimer = 67200; // almost 1,12 minutes + ArcaneBoltTimer += 1000; // Give the Mage some time to spellsteal Dampen. + } else DampenMagicTimer -= diff; + + if (ArcaneExplosionTimer <= diff) + { + DoCast(me->getVictim(), SPELL_ARCANE_EXPLOSION); + Cooldown = 1000; + ArcaneExplosionTimer = 14000; + } else ArcaneExplosionTimer -= diff; + + if (ArcaneBoltTimer <= diff) + { + DoCast(me->getVictim(), SPELL_ARCANE_BOLT); + ArcaneBoltTimer = 3000; + Cooldown = 2000; + } else ArcaneBoltTimer -= diff; + + if (BlizzardTimer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + DoCast(pTarget, SPELL_BLIZZARD); + BlizzardTimer = 45000 + rand()%46 * 1000; + FlamestrikeTimer += 10000; + Cooldown = 1000; + } + } else BlizzardTimer -= diff; + + if (FlamestrikeTimer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + DoCast(pTarget, SPELL_FLAMESTRIKE); + FlamestrikeTimer = 55000 + rand()%46 * 1000; + BlizzardTimer += 10000; + Cooldown = 2000; + } + } else FlamestrikeTimer -= diff; + } +}; + +struct boss_lady_malandeAI : public boss_illidari_councilAI +{ + boss_lady_malandeAI(Creature *c) : boss_illidari_councilAI(c) {} + + uint32 EmpoweredSmiteTimer; + uint32 CircleOfHealingTimer; + uint32 DivineWrathTimer; + uint32 ReflectiveShieldTimer; + + void Reset() + { + EmpoweredSmiteTimer = 38000; + CircleOfHealingTimer = 20000; + DivineWrathTimer = 40000; + ReflectiveShieldTimer = 0; + } + + void KilledUnit(Unit * /*victim*/) + { + DoScriptText(SAY_MALA_SLAY, me); + } + + void JustDied(Unit * /*victim*/) + { + DoScriptText(SAY_MALA_DEATH, me); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (EmpoweredSmiteTimer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + DoCast(pTarget, SPELL_EMPOWERED_SMITE); + EmpoweredSmiteTimer = 38000; + } + } else EmpoweredSmiteTimer -= diff; + + if (CircleOfHealingTimer <= diff) + { + DoCast(me, SPELL_CIRCLE_OF_HEALING); + CircleOfHealingTimer = 60000; + } else CircleOfHealingTimer -= diff; + + if (DivineWrathTimer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + DoCast(pTarget, SPELL_DIVINE_WRATH); + DivineWrathTimer = 40000 + rand()%41 * 1000; + } + } else DivineWrathTimer -= diff; + + if (ReflectiveShieldTimer <= diff) + { + DoCast(me, SPELL_REFLECTIVE_SHIELD); + ReflectiveShieldTimer = 65000; + } else ReflectiveShieldTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct boss_veras_darkshadowAI : public boss_illidari_councilAI +{ + boss_veras_darkshadowAI(Creature *c) : boss_illidari_councilAI(c) {} + + uint64 EnvenomTargetGUID; + + uint32 DeadlyPoisonTimer; + uint32 VanishTimer; + uint32 AppearEnvenomTimer; + + bool HasVanished; + + void Reset() + { + EnvenomTargetGUID = 0; + + DeadlyPoisonTimer = 20000; + VanishTimer = 60000 + rand()%61 * 1000; + AppearEnvenomTimer = 150000; + + HasVanished = false; + me->SetVisibility(VISIBILITY_ON); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + } + + void KilledUnit(Unit * /*victim*/) + { + DoScriptText(SAY_VERA_SLAY, me); + } + + void JustDied(Unit * /*victim*/) + { + DoScriptText(SAY_VERA_DEATH, me); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (!HasVanished) + { + if (DeadlyPoisonTimer <= diff) + { + DoCast(me->getVictim(), SPELL_DEADLY_POISON); + DeadlyPoisonTimer = 15000 + rand()%31 * 1000; + } else DeadlyPoisonTimer -= diff; + + if (AppearEnvenomTimer <= diff) // Cast Envenom. This is cast 4 seconds after Vanish is over + { + DoCast(me->getVictim(), SPELL_ENVENOM); + AppearEnvenomTimer = 90000; + } else AppearEnvenomTimer -= diff; + + if (VanishTimer <= diff) // Disappear and stop attacking, but follow a random unit + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + VanishTimer = 30000; + AppearEnvenomTimer= 28000; + HasVanished = true; + me->SetVisibility(VISIBILITY_OFF); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + DoResetThreat(); + // Chase a unit. Check before DoMeleeAttackIfReady prevents from attacking + me->AddThreat(pTarget, 500000.0f); + me->GetMotionMaster()->MoveChase(pTarget); + } + } else VanishTimer -= diff; + + DoMeleeAttackIfReady(); + } + else + { + if (VanishTimer <= diff) // Become attackable and poison current target + { + Unit *pTarget = me->getVictim(); + DoCast(pTarget, SPELL_DEADLY_POISON); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + DoResetThreat(); + me->AddThreat(pTarget, 3000.0f); // Make Veras attack his target for a while, he will cast Envenom 4 seconds after. + DeadlyPoisonTimer += 6000; + VanishTimer = 90000; + AppearEnvenomTimer = 4000; + HasVanished = false; + } else VanishTimer -= diff; + + if (AppearEnvenomTimer <= diff) // Appear 2 seconds before becoming attackable (Shifting out of vanish) + { + me->GetMotionMaster()->Clear(); + me->GetMotionMaster()->MoveChase(me->getVictim()); + me->SetVisibility(VISIBILITY_ON); + AppearEnvenomTimer = 6000; + } else AppearEnvenomTimer -= diff; + } + } +}; + +CreatureAI* GetAI_mob_blood_elf_council_voice_trigger(Creature* c) +{ + return new mob_blood_elf_council_voice_triggerAI(c); +} + +CreatureAI* GetAI_mob_illidari_council(Creature* pCreature) +{ + return new mob_illidari_councilAI (pCreature); +} + +CreatureAI* GetAI_boss_gathios_the_shatterer(Creature* pCreature) +{ + return new boss_gathios_the_shattererAI (pCreature); +} + +CreatureAI* GetAI_boss_lady_malande(Creature* pCreature) +{ + return new boss_lady_malandeAI (pCreature); +} + +CreatureAI* GetAI_boss_veras_darkshadow(Creature* pCreature) +{ + return new boss_veras_darkshadowAI (pCreature); +} + +CreatureAI* GetAI_boss_high_nethermancer_zerevor(Creature* pCreature) +{ + return new boss_high_nethermancer_zerevorAI (pCreature); +} + +void AddSC_boss_illidari_council() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "mob_illidari_council"; + newscript->GetAI = &GetAI_mob_illidari_council; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_blood_elf_council_voice_trigger"; + newscript->GetAI = &GetAI_mob_blood_elf_council_voice_trigger; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_gathios_the_shatterer"; + newscript->GetAI = &GetAI_boss_gathios_the_shatterer; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_lady_malande"; + newscript->GetAI = &GetAI_boss_lady_malande; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_veras_darkshadow"; + newscript->GetAI = &GetAI_boss_veras_darkshadow; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_high_nethermancer_zerevor"; + newscript->GetAI = &GetAI_boss_high_nethermancer_zerevor; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp b/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp new file mode 100644 index 00000000000..88e25026a13 --- /dev/null +++ b/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp @@ -0,0 +1,346 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/* ScriptData +SDName: Instance_Black_Temple +SD%Complete: 100 +SDComment: Instance Data Scripts and functions to acquire mobs and set encounter status for use in various Black Temple Scripts +SDCategory: Black Temple +EndScriptData */ + +#include "ScriptedPch.h" +#include "black_temple.h" + +#define MAX_ENCOUNTER 9 + +/* Black Temple encounters: +0 - High Warlord Naj'entus event +1 - Supremus Event +2 - Shade of Akama Event +3 - Teron Gorefiend Event +4 - Gurtogg Bloodboil Event +5 - Reliquary Of Souls Event +6 - Mother Shahraz Event +7 - Illidari Council Event +8 - Illidan Stormrage Event +*/ + +struct instance_black_temple : public ScriptedInstance +{ + instance_black_temple(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + std::string str_data; + + uint64 Najentus; + uint64 Akama; // This is the Akama that starts the Illidan encounter. + uint64 Akama_Shade; // This is the Akama that starts the Shade of Akama encounter. + uint64 ShadeOfAkama; + uint64 Supremus; + uint64 LadyMalande; + uint64 GathiosTheShatterer; + uint64 HighNethermancerZerevor; + uint64 VerasDarkshadow; + uint64 IllidariCouncil; + uint64 BloodElfCouncilVoice; + uint64 IllidanStormrage; + + uint64 NajentusGate; + uint64 MainTempleDoors; + uint64 ShadeOfAkamaDoor; + uint64 CommonDoor;//Teron + uint64 TeronDoor; + uint64 GuurtogDoor; + uint64 MotherDoor; + uint64 TempleDoor;//Befor mother + uint64 CouncilDoor; + uint64 SimpleDoor;//council + uint64 IllidanGate; + uint64 IllidanDoor[2]; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + Najentus = 0; + Akama = 0; + Akama_Shade = 0; + ShadeOfAkama = 0; + Supremus = 0; + LadyMalande = 0; + GathiosTheShatterer = 0; + HighNethermancerZerevor = 0; + VerasDarkshadow = 0; + IllidariCouncil = 0; + BloodElfCouncilVoice = 0; + IllidanStormrage = 0; + + NajentusGate = 0; + MainTempleDoors = 0; + ShadeOfAkamaDoor= 0; + CommonDoor = 0;//teron + TeronDoor = 0; + GuurtogDoor = 0; + MotherDoor = 0; + TempleDoor = 0; + SimpleDoor = 0;//Bycouncil + CouncilDoor = 0; + IllidanGate = 0; + IllidanDoor[0] = 0; + IllidanDoor[1] = 0; + } + + bool IsEncounterInProgress() const + { + for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) return true; + + return false; + } + + Player* GetPlayerInMap() + { + Map::PlayerList const& players = instance->GetPlayers(); + + if (!players.isEmpty()) + { + for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + { + if (Player* plr = itr->getSource()) + return plr; + } + } + + debug_log("TSCR: Instance Black Temple: GetPlayerInMap, but PlayerList is empty!"); + return NULL; + } + + void OnCreatureCreate(Creature* pCreature, bool /*add*/) + { + switch(pCreature->GetEntry()) + { + case 22887: Najentus = pCreature->GetGUID(); break; + case 23089: Akama = pCreature->GetGUID(); break; + case 22990: Akama_Shade = pCreature->GetGUID(); break; + case 22841: ShadeOfAkama = pCreature->GetGUID(); break; + case 22898: Supremus = pCreature->GetGUID(); break; + case 22917: IllidanStormrage = pCreature->GetGUID(); break; + case 22949: GathiosTheShatterer = pCreature->GetGUID(); break; + case 22950: HighNethermancerZerevor = pCreature->GetGUID(); break; + case 22951: LadyMalande = pCreature->GetGUID(); break; + case 22952: VerasDarkshadow = pCreature->GetGUID(); break; + case 23426: IllidariCouncil = pCreature->GetGUID(); break; + case 23499: BloodElfCouncilVoice = pCreature->GetGUID(); break; + } + } + + void OnGameObjectCreate(GameObject* pGo, bool /*add*/) + { + switch(pGo->GetEntry()) + { + case 185483: NajentusGate = pGo->GetGUID();// Gate past Naj'entus (at the entrance to Supermoose's courtyards) + if (m_auiEncounter[0] == DONE)HandleGameObject(NULL,true,pGo);break; + case 185882: MainTempleDoors = pGo->GetGUID();// Main Temple Doors - right past Supermoose (Supremus) + if (m_auiEncounter[1] == DONE)HandleGameObject(NULL,true,pGo);break; + case 185478: ShadeOfAkamaDoor = pGo->GetGUID();break; + case 185480: CommonDoor = pGo->GetGUID(); + if (m_auiEncounter[3] == DONE)HandleGameObject(NULL,true,pGo);break; + case 186153: TeronDoor = pGo->GetGUID(); + if (m_auiEncounter[3] == DONE)HandleGameObject(NULL,true,pGo);break; + case 185892: GuurtogDoor = pGo->GetGUID(); + if (m_auiEncounter[4] == DONE)HandleGameObject(NULL,true,pGo);break; + case 185479: TempleDoor = pGo->GetGUID(); + if (m_auiEncounter[5] == DONE)HandleGameObject(NULL,true,pGo);break; + case 185482: MotherDoor = pGo->GetGUID(); + if (m_auiEncounter[6] == DONE)HandleGameObject(NULL,true,pGo);break; + case 185481: CouncilDoor = pGo->GetGUID(); + if (m_auiEncounter[7] == DONE)HandleGameObject(NULL,true,pGo);break; + case 186152: SimpleDoor = pGo->GetGUID(); + if (m_auiEncounter[7] == DONE)HandleGameObject(NULL,true,pGo);break; + case 185905: IllidanGate = pGo->GetGUID(); break; // Gate leading to Temple Summit + case 186261: IllidanDoor[0] = pGo->GetGUID(); break; // Right door at Temple Summit + case 186262: IllidanDoor[1] = pGo->GetGUID(); break; // Left door at Temple Summit + } + } + + uint64 GetData64(uint32 identifier) + { + switch(identifier) + { + case DATA_HIGHWARLORDNAJENTUS: return Najentus; + case DATA_AKAMA: return Akama; + case DATA_AKAMA_SHADE: return Akama_Shade; + case DATA_SHADEOFAKAMA: return ShadeOfAkama; + case DATA_SUPREMUS: return Supremus; + case DATA_ILLIDANSTORMRAGE: return IllidanStormrage; + case DATA_GATHIOSTHESHATTERER: return GathiosTheShatterer; + case DATA_HIGHNETHERMANCERZEREVOR: return HighNethermancerZerevor; + case DATA_LADYMALANDE: return LadyMalande; + case DATA_VERASDARKSHADOW: return VerasDarkshadow; + case DATA_ILLIDARICOUNCIL: return IllidariCouncil; + case DATA_GAMEOBJECT_NAJENTUS_GATE: return NajentusGate; + case DATA_GAMEOBJECT_ILLIDAN_GATE: return IllidanGate; + case DATA_GAMEOBJECT_ILLIDAN_DOOR_R: return IllidanDoor[0]; + case DATA_GAMEOBJECT_ILLIDAN_DOOR_L: return IllidanDoor[1]; + case DATA_GAMEOBJECT_SUPREMUS_DOORS: return MainTempleDoors; + case DATA_BLOOD_ELF_COUNCIL_VOICE: return BloodElfCouncilVoice; + } + + return 0; + } + + void SetData(uint32 type, uint32 data) + { + switch(type) + { + case DATA_HIGHWARLORDNAJENTUSEVENT: + if (data == DONE) + { + HandleGameObject(NajentusGate, true); + } + m_auiEncounter[0] = data;break; + case DATA_SUPREMUSEVENT: + if (data == DONE) + { + HandleGameObject(NajentusGate, true); + } + m_auiEncounter[1] = data; break; + case DATA_SHADEOFAKAMAEVENT: + if (data == IN_PROGRESS) + { + HandleGameObject(ShadeOfAkamaDoor, false); + } else HandleGameObject(ShadeOfAkamaDoor, true); + m_auiEncounter[2] = data; break; + case DATA_TERONGOREFIENDEVENT: + if (data == IN_PROGRESS) + { + HandleGameObject(TeronDoor, false); + HandleGameObject(CommonDoor, false); + }else + { + HandleGameObject(TeronDoor, true); + HandleGameObject(CommonDoor, true); + } + m_auiEncounter[3] = data; break; + case DATA_GURTOGGBLOODBOILEVENT: + if (data == DONE) + { + HandleGameObject(GuurtogDoor, true); + } + m_auiEncounter[4] = data; break; + case DATA_RELIQUARYOFSOULSEVENT: + if (data == DONE) + { + HandleGameObject(TempleDoor, true); + } + m_auiEncounter[5] = data; break; + case DATA_MOTHERSHAHRAZEVENT: + if (data == DONE) + { + HandleGameObject(MotherDoor, true); + } + m_auiEncounter[6] = data; break; + case DATA_ILLIDARICOUNCILEVENT: + if (data == IN_PROGRESS) + { + HandleGameObject(CouncilDoor, false); + HandleGameObject(SimpleDoor, false); + }else + { + HandleGameObject(CouncilDoor, true); + HandleGameObject(SimpleDoor, true); + } + m_auiEncounter[7] = data; break; + case DATA_ILLIDANSTORMRAGEEVENT: m_auiEncounter[8] = data; break; + } + + if (data == DONE) + { + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " + << m_auiEncounter[2] << " " << m_auiEncounter[3] << " " << m_auiEncounter[4] + << " " << m_auiEncounter[5] << " " << m_auiEncounter[6] << " " << m_auiEncounter[7] + << " " << m_auiEncounter[8]; + + str_data = saveStream.str(); + + SaveToDB(); + OUT_SAVE_INST_DATA_COMPLETE; + } + } + + uint32 GetData(uint32 type) + { + switch(type) + { + case DATA_HIGHWARLORDNAJENTUSEVENT: return m_auiEncounter[0]; + case DATA_SUPREMUSEVENT: return m_auiEncounter[1]; + case DATA_SHADEOFAKAMAEVENT: return m_auiEncounter[2]; + case DATA_TERONGOREFIENDEVENT: return m_auiEncounter[3]; + case DATA_GURTOGGBLOODBOILEVENT: return m_auiEncounter[4]; + case DATA_RELIQUARYOFSOULSEVENT: return m_auiEncounter[5]; + case DATA_MOTHERSHAHRAZEVENT: return m_auiEncounter[6]; + case DATA_ILLIDARICOUNCILEVENT: return m_auiEncounter[7]; + case DATA_ILLIDANSTORMRAGEEVENT: return m_auiEncounter[8]; + } + + return 0; + } + + std::string GetSaveData() + { + return str_data; + } + + void Load(const char* in) + { + if (!in) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(in); + + std::istringstream loadStream(in); + loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] + >> m_auiEncounter[3] >> m_auiEncounter[4] >> m_auiEncounter[5] >> m_auiEncounter[6] + >> m_auiEncounter[7] >> m_auiEncounter[8]; + + for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) + m_auiEncounter[i] = NOT_STARTED; + + OUT_LOAD_INST_DATA_COMPLETE; + } +}; + +InstanceData* GetInstanceData_instance_black_temple(Map* pMap) +{ + return new instance_black_temple(pMap); +} + +void AddSC_instance_black_temple() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_black_temple"; + newscript->GetInstanceData = &GetInstanceData_instance_black_temple; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/Outland/CoilfangReservoir/serpent_shrine/boss_fathomlord_karathress.cpp b/src/server/scripts/Outland/CoilfangReservoir/serpent_shrine/boss_fathomlord_karathress.cpp new file mode 100644 index 00000000000..69a969adda0 --- /dev/null +++ b/src/server/scripts/Outland/CoilfangReservoir/serpent_shrine/boss_fathomlord_karathress.cpp @@ -0,0 +1,746 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Fathomlord_Karathress +SD%Complete: 70 +SDComment: Cyclone workaround +SDCategory: Coilfang Resevoir, Serpent Shrine Cavern +EndScriptData */ + +#include "ScriptedPch.h" +#include "serpent_shrine.h" +#include "ScriptedEscortAI.h" + +#define SAY_AGGRO -1548021 +#define SAY_GAIN_BLESSING -1548022 +#define SAY_GAIN_ABILITY1 -1548023 +#define SAY_GAIN_ABILITY2 -1548024 +#define SAY_GAIN_ABILITY3 -1548025 +#define SAY_SLAY1 -1548026 +#define SAY_SLAY2 -1548027 +#define SAY_SLAY3 -1548028 +#define SAY_DEATH -1548029 + +//Karathress spells +#define SPELL_CATACLYSMIC_BOLT 38441 +#define SPELL_POWER_OF_SHARKKIS 38455 +#define SPELL_POWER_OF_TIDALVESS 38452 +#define SPELL_POWER_OF_CARIBDIS 38451 +#define SPELL_ENRAGE 24318 +#define SPELL_SEAR_NOVA 38445 +#define SPELL_BLESSING_OF_THE_TIDES 38449 + +//Sharkkis spells +#define SPELL_LEECHING_THROW 29436 +#define SPELL_THE_BEAST_WITHIN 38373 +#define SPELL_MULTISHOT 38366 +#define SPELL_SUMMON_FATHOM_LURKER 38433 +#define SPELL_SUMMON_FATHOM_SPOREBAT 38431 +#define SPELL_PET_ENRAGE 19574 + +//Tidalvess spells +#define SPELL_FROST_SHOCK 38234 +#define SPELL_SPITFIRE_TOTEM 38236 +#define SPELL_POISON_CLEANSING_TOTEM 38306 +// Spell obsolete +// #define SPELL_POISON_CLEANSING_EFFECT 8167 +#define SPELL_EARTHBIND_TOTEM 38304 +#define SPELL_EARTHBIND_TOTEM_EFFECT 6474 +#define SPELL_WINDFURY_WEAPON 38184 + +//Caribdis Spells +#define SPELL_WATER_BOLT_VOLLEY 38335 +#define SPELL_TIDAL_SURGE 38358 +#define SPELL_TIDAL_SURGE_FREEZE 38357 +#define SPELL_HEAL 38330 +#define SPELL_SUMMON_CYCLONE 38337 +#define SPELL_CYCLONE_CYCLONE 29538 + +//Yells and Quotes +#define SAY_GAIN_BLESSING_OF_TIDES "Your overconfidence will be your undoing! Guards, lend me your strength!" +#define SOUND_GAIN_BLESSING_OF_TIDES 11278 +#define SAY_MISC "Alana be'lendor!" //don't know what use this +#define SOUND_MISC 11283 + +//Summoned Unit GUIDs +#define CREATURE_CYCLONE 22104 +#define CREATURE_FATHOM_SPOREBAT 22120 +#define CREATURE_FATHOM_LURKER 22119 +#define CREATURE_SPITFIRE_TOTEM 22091 +#define CREATURE_EARTHBIND_TOTEM 22486 +#define CREATURE_POISON_CLEANSING_TOTEM 22487 + +//entry and position for Seer Olum +#define SEER_OLUM 22820 +#define OLUM_X 446.78f +#define OLUM_Y -542.76f +#define OLUM_Z -7.54773f +#define OLUM_O 0.401581f + +//Fathom-Lord Karathress AI +struct boss_fathomlord_karathressAI : public ScriptedAI +{ + boss_fathomlord_karathressAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + Advisors[0] = 0; + Advisors[1] = 0; + Advisors[2] = 0; + } + + ScriptedInstance* pInstance; + + uint32 CataclysmicBolt_Timer; + uint32 Enrage_Timer; + uint32 SearNova_Timer; + + bool BlessingOfTides; + + uint64 Advisors[3]; + + void Reset() + { + CataclysmicBolt_Timer = 10000; + Enrage_Timer = 600000; //10 minutes + SearNova_Timer = 20000+rand()%40000; // 20 - 60 seconds + + BlessingOfTides = false; + + if (pInstance) + { + uint64 RAdvisors[3]; + RAdvisors[0] = pInstance->GetData64(DATA_SHARKKIS); + RAdvisors[1] = pInstance->GetData64(DATA_TIDALVESS); + RAdvisors[2] = pInstance->GetData64(DATA_CARIBDIS); + //Respawn of the 3 Advisors + Creature* pAdvisor = NULL; + for (int i=0; i<3; ++i) + + if (RAdvisors[i]) + { + pAdvisor = (Unit::GetCreature((*me), RAdvisors[i])); + if (pAdvisor && !pAdvisor->isAlive()) + { + pAdvisor->Respawn(); + pAdvisor->AI()->EnterEvadeMode(); + pAdvisor->GetMotionMaster()->MoveTargetedHome(); + } + } + pInstance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED); + } + + } + + void EventSharkkisDeath() + { + DoScriptText(SAY_GAIN_ABILITY1, me); + DoCast(me, SPELL_POWER_OF_SHARKKIS); + } + + void EventTidalvessDeath() + { + DoScriptText(SAY_GAIN_ABILITY2, me); + DoCast(me, SPELL_POWER_OF_TIDALVESS); + } + + void EventCaribdisDeath() + { + DoScriptText(SAY_GAIN_ABILITY3, me); + DoCast(me, SPELL_POWER_OF_CARIBDIS); + } + + void GetAdvisors() + { + if (!pInstance) + return; + + Advisors[0] = pInstance->GetData64(DATA_SHARKKIS); + Advisors[1] = pInstance->GetData64(DATA_TIDALVESS); + Advisors[2] = pInstance->GetData64(DATA_CARIBDIS); + } + + void StartEvent(Unit *who) + { + if (!pInstance) + return; + + GetAdvisors(); + + DoScriptText(SAY_AGGRO, me); + DoZoneInCombat(); + + pInstance->SetData64(DATA_KARATHRESSEVENT_STARTER, who->GetGUID()); + pInstance->SetData(DATA_KARATHRESSEVENT, IN_PROGRESS); + } + + void KilledUnit(Unit * /*victim*/) + { + DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), me); + } + + void JustDied(Unit * /*killer*/) + { + DoScriptText(SAY_DEATH, me); + + if (pInstance) + pInstance->SetData(DATA_FATHOMLORDKARATHRESSEVENT, DONE); + + //support for quest 10944 + me->SummonCreature(SEER_OLUM, OLUM_X, OLUM_Y, OLUM_Z, OLUM_O, TEMPSUMMON_TIMED_DESPAWN, 3600000); + } + + void EnterCombat(Unit * who) + { + StartEvent(who); + } + + void UpdateAI(const uint32 diff) + { + //Only if not incombat check if the event is started + if (!me->isInCombat() && pInstance && pInstance->GetData(DATA_KARATHRESSEVENT)) + { + Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_KARATHRESSEVENT_STARTER)); + + if (pTarget) + { + AttackStart(pTarget); + GetAdvisors(); + } + } + + //Return since we have no target + if (!UpdateVictim()) + return; + + //someone evaded! + if (pInstance && !pInstance->GetData(DATA_KARATHRESSEVENT)) + { + EnterEvadeMode(); + return; + } + + //CataclysmicBolt_Timer + if (CataclysmicBolt_Timer <= diff) + { + //select a random unit other than the main tank + Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1); + + //if there aren't other units, cast on the tank + if (!pTarget) + pTarget = me->getVictim(); + + if (pTarget) + DoCast(pTarget, SPELL_CATACLYSMIC_BOLT); + CataclysmicBolt_Timer = 10000; + } else CataclysmicBolt_Timer -= diff; + + //SearNova_Timer + if (SearNova_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_SEAR_NOVA); + SearNova_Timer = 20000+rand()%40000; + } else SearNova_Timer -= diff; + + //Enrage_Timer + if (Enrage_Timer <= diff) + { + DoCast(me, SPELL_ENRAGE); + Enrage_Timer = 90000; + } else Enrage_Timer -= diff; + + //Blessing of Tides Trigger + if ((me->GetHealth()*100 / me->GetMaxHealth()) <= 75 && !BlessingOfTides) + { + BlessingOfTides = true; + bool continueTriggering = false; + Creature* Advisor; + for (uint8 i = 0; i < 4; ++i) + if (Advisors[i]) + { + Advisor = (Unit::GetCreature(*me, Advisors[i])); + if (Advisor && Advisor->isAlive()) + { + continueTriggering = true; + break; + } + } + if (continueTriggering) + { + DoCast(me, SPELL_BLESSING_OF_THE_TIDES); + me->MonsterYell(SAY_GAIN_BLESSING_OF_TIDES, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_GAIN_BLESSING_OF_TIDES); + } + } + + DoMeleeAttackIfReady(); + } +}; + +//Fathom-Guard Sharkkis AI +struct boss_fathomguard_sharkkisAI : public ScriptedAI +{ + boss_fathomguard_sharkkisAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint32 LeechingThrow_Timer; + uint32 TheBeastWithin_Timer; + uint32 Multishot_Timer; + uint32 Pet_Timer; + + bool pet; + + uint64 SummonedPet; + + void Reset() + { + LeechingThrow_Timer = 20000; + TheBeastWithin_Timer = 30000; + Multishot_Timer = 15000; + Pet_Timer = 10000; + + pet = false; + + Creature *Pet = Unit::GetCreature(*me, SummonedPet); + if (Pet && Pet->isAlive()) + { + Pet->DealDamage(Pet, Pet->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + + SummonedPet = 0; + + if (pInstance) + pInstance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED); + } + + void JustDied(Unit * /*victim*/) + { + if (pInstance) + { + Creature *Karathress = NULL; + Karathress = (Unit::GetCreature((*me), pInstance->GetData64(DATA_KARATHRESS))); + + if (Karathress) + CAST_AI(boss_fathomlord_karathressAI, Karathress->AI())->EventSharkkisDeath(); + CAST_AI(boss_fathomlord_karathressAI, Karathress->AI())->EventSharkkisDeath(); + } + } + + void EnterCombat(Unit * who) + { + if (pInstance) + { + pInstance->SetData64(DATA_KARATHRESSEVENT_STARTER, who->GetGUID()); + pInstance->SetData(DATA_KARATHRESSEVENT, IN_PROGRESS); + } + } + + void UpdateAI(const uint32 diff) + { + //Only if not incombat check if the event is started + if (!me->isInCombat() && pInstance && pInstance->GetData(DATA_KARATHRESSEVENT)) + { + Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_KARATHRESSEVENT_STARTER)); + + if (pTarget) + { + AttackStart(pTarget); + } + } + + //Return since we have no target + if (!UpdateVictim()) + return; + + //someone evaded! + if (pInstance && !pInstance->GetData(DATA_KARATHRESSEVENT)) + { + EnterEvadeMode(); + return; + } + + //LeechingThrow_Timer + if (LeechingThrow_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_LEECHING_THROW); + LeechingThrow_Timer = 20000; + } else LeechingThrow_Timer -= diff; + + //Multishot_Timer + if (Multishot_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_MULTISHOT); + Multishot_Timer = 20000; + } else Multishot_Timer -= diff; + + //TheBeastWithin_Timer + if (TheBeastWithin_Timer <= diff) + { + DoCast(me, SPELL_THE_BEAST_WITHIN); + Creature *Pet = Unit::GetCreature(*me, SummonedPet); + if (Pet && Pet->isAlive()) + { + Pet->CastSpell(Pet, SPELL_PET_ENRAGE, true); + } + TheBeastWithin_Timer = 30000; + } else TheBeastWithin_Timer -= diff; + + //Pet_Timer + if (Pet_Timer < diff && pet == false) + { + pet = true; + //uint32 spell_id; + uint32 pet_id; + if (!urand(0,1)) + { + //spell_id = SPELL_SUMMON_FATHOM_LURKER; + pet_id = CREATURE_FATHOM_LURKER; + } + else + { + //spell_id = SPELL_SUMMON_FATHOM_SPOREBAT; + pet_id = CREATURE_FATHOM_SPOREBAT; + } + //DoCast(me, spell_id, true); + Creature *Pet = DoSpawnCreature(pet_id,0,0,0,0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); + if (Pet && pTarget) + { + Pet->AI()->AttackStart(pTarget); + SummonedPet = Pet->GetGUID(); + } + } else Pet_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +//Fathom-Guard Tidalvess AI +struct boss_fathomguard_tidalvessAI : public ScriptedAI +{ + boss_fathomguard_tidalvessAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint32 FrostShock_Timer; + uint32 Spitfire_Timer; + uint32 PoisonCleansing_Timer; + uint32 Earthbind_Timer; + + void Reset() + { + FrostShock_Timer = 25000; + Spitfire_Timer = 60000; + PoisonCleansing_Timer = 30000; + Earthbind_Timer = 45000; + + if (pInstance) + pInstance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED); + } + + void JustDied(Unit * /*victim*/) + { + if (pInstance) + { + Creature *Karathress = NULL; + Karathress = (Unit::GetCreature((*me), pInstance->GetData64(DATA_KARATHRESS))); + + if (Karathress) + if (!me->isAlive() && Karathress) + CAST_AI(boss_fathomlord_karathressAI, Karathress->AI())->EventTidalvessDeath(); + } + } + + void EnterCombat(Unit * who) + { + if (pInstance) + { + pInstance->SetData64(DATA_KARATHRESSEVENT_STARTER, who->GetGUID()); + pInstance->SetData(DATA_KARATHRESSEVENT, IN_PROGRESS); + } + DoCast(me, SPELL_WINDFURY_WEAPON); + } + + void UpdateAI(const uint32 diff) + { + //Only if not incombat check if the event is started + if (!me->isInCombat() && pInstance && pInstance->GetData(DATA_KARATHRESSEVENT)) + { + Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_KARATHRESSEVENT_STARTER)); + + if (pTarget) + { + AttackStart(pTarget); + } + } + + //Return since we have no target + if (!UpdateVictim()) + return; + + //someone evaded! + if (pInstance && !pInstance->GetData(DATA_KARATHRESSEVENT)) + { + EnterEvadeMode(); + return; + } + + if (!me->HasAura(SPELL_WINDFURY_WEAPON)) + { + DoCast(me, SPELL_WINDFURY_WEAPON); + } + + //FrostShock_Timer + if (FrostShock_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_FROST_SHOCK); + FrostShock_Timer = 25000+rand()%5000; + } else FrostShock_Timer -= diff; + + //Spitfire_Timer + if (Spitfire_Timer <= diff) + { + DoCast(me, SPELL_SPITFIRE_TOTEM); + Unit *SpitfireTotem = Unit::GetUnit(*me, CREATURE_SPITFIRE_TOTEM); + if (SpitfireTotem) + { + CAST_CRE(SpitfireTotem)->AI()->AttackStart(me->getVictim()); + } + Spitfire_Timer = 60000; + } else Spitfire_Timer -= diff; + + //PoisonCleansing_Timer + if (PoisonCleansing_Timer <= diff) + { + DoCast(me, SPELL_POISON_CLEANSING_TOTEM); + PoisonCleansing_Timer = 30000; + } else PoisonCleansing_Timer -= diff; + + //Earthbind_Timer + if (Earthbind_Timer <= diff) + { + DoCast(me, SPELL_EARTHBIND_TOTEM); + Earthbind_Timer = 45000; + } else Earthbind_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +//Fathom-Guard Caribdis AI +struct boss_fathomguard_caribdisAI : public ScriptedAI +{ + boss_fathomguard_caribdisAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint32 WaterBoltVolley_Timer; + uint32 TidalSurge_Timer; + uint32 Heal_Timer; + uint32 Cyclone_Timer; + + void Reset() + { + WaterBoltVolley_Timer = 35000; + TidalSurge_Timer = 15000+rand()%5000; + Heal_Timer = 55000; + Cyclone_Timer = 30000+rand()%10000; + + if (pInstance) + pInstance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED); + } + + void JustDied(Unit * /*victim*/) + { + if (pInstance) + { + Creature *Karathress = NULL; + Karathress = (Unit::GetCreature((*me), pInstance->GetData64(DATA_KARATHRESS))); + + if (Karathress) + if (!me->isAlive() && Karathress) + CAST_AI(boss_fathomlord_karathressAI, Karathress->AI())->EventCaribdisDeath(); + } + } + + void EnterCombat(Unit * who) + { + if (pInstance) + { + pInstance->SetData64(DATA_KARATHRESSEVENT_STARTER, who->GetGUID()); + pInstance->SetData(DATA_KARATHRESSEVENT, IN_PROGRESS); + } + } + + void UpdateAI(const uint32 diff) + { + //Only if not incombat check if the event is started + if (!me->isInCombat() && pInstance && pInstance->GetData(DATA_KARATHRESSEVENT)) + { + Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_KARATHRESSEVENT_STARTER)); + + if (pTarget) + { + AttackStart(pTarget); + } + } + + //Return since we have no target + if (!UpdateVictim()) + return; + + //someone evaded! + if (pInstance && !pInstance->GetData(DATA_KARATHRESSEVENT)) + { + EnterEvadeMode(); + return; + } + + //WaterBoltVolley_Timer + if (WaterBoltVolley_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_WATER_BOLT_VOLLEY); + WaterBoltVolley_Timer = 30000; + } else WaterBoltVolley_Timer -= diff; + + //TidalSurge_Timer + if (TidalSurge_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_TIDAL_SURGE); + // Hacky way to do it - won't trigger elseways + me->getVictim()->CastSpell(me->getVictim(), SPELL_TIDAL_SURGE_FREEZE, true); + TidalSurge_Timer = 15000+rand()%5000; + } else TidalSurge_Timer -= diff; + + //Cyclone_Timer + if (Cyclone_Timer <= diff) + { + //DoCast(me, SPELL_SUMMON_CYCLONE); // Doesn't work + Cyclone_Timer = 30000+rand()%10000; + Creature *Cyclone = me->SummonCreature(CREATURE_CYCLONE, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), (rand()%5), TEMPSUMMON_TIMED_DESPAWN, 15000); + if (Cyclone) + { + CAST_CRE(Cyclone)->SetFloatValue(OBJECT_FIELD_SCALE_X, 3.0f); + Cyclone->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + Cyclone->setFaction(me->getFaction()); + Cyclone->CastSpell(Cyclone, SPELL_CYCLONE_CYCLONE, true); + Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (pTarget) + { + Cyclone->AI()->AttackStart(pTarget); + } + } + } else Cyclone_Timer -= diff; + + //Heal_Timer + if (Heal_Timer <= diff) + { + // It can be cast on any of the mobs + Unit *pUnit = NULL; + + while (pUnit == NULL || !pUnit->isAlive()) + { + pUnit = selectAdvisorUnit(); + } + + if (pUnit && pUnit->isAlive()) + DoCast(pUnit, SPELL_HEAL); + Heal_Timer = 60000; + } else Heal_Timer -= diff; + + DoMeleeAttackIfReady(); + } + + Unit* selectAdvisorUnit() + { + Unit* pUnit = NULL; + if (pInstance) + { + switch(rand()%4) + { + case 0: + pUnit = Unit::GetUnit((*me), pInstance->GetData64(DATA_KARATHRESS)); + break; + case 1: + pUnit = Unit::GetUnit((*me), pInstance->GetData64(DATA_SHARKKIS)); + break; + case 2: + pUnit = Unit::GetUnit((*me), pInstance->GetData64(DATA_TIDALVESS)); + break; + case 3: + pUnit = me; + break; + } + } else pUnit = me; + + return pUnit; + } +}; + +CreatureAI* GetAI_boss_fathomlord_karathress(Creature* pCreature) +{ + return new boss_fathomlord_karathressAI (pCreature); +} + +CreatureAI* GetAI_boss_fathomguard_sharkkis(Creature* pCreature) +{ + return new boss_fathomguard_sharkkisAI (pCreature); +} + +CreatureAI* GetAI_boss_fathomguard_tidalvess(Creature* pCreature) +{ + return new boss_fathomguard_tidalvessAI (pCreature); +} + +CreatureAI* GetAI_boss_fathomguard_caribdis(Creature* pCreature) +{ + return new boss_fathomguard_caribdisAI (pCreature); +} + +void AddSC_boss_fathomlord_karathress() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_fathomlord_karathress"; + newscript->GetAI = &GetAI_boss_fathomlord_karathress; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_fathomguard_sharkkis"; + newscript->GetAI = &GetAI_boss_fathomguard_sharkkis; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_fathomguard_tidalvess"; + newscript->GetAI = &GetAI_boss_fathomguard_tidalvess; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_fathomguard_caribdis"; + newscript->GetAI = &GetAI_boss_fathomguard_caribdis; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/Outland/CoilfangReservoir/serpent_shrine/boss_hydross_the_unstable.cpp b/src/server/scripts/Outland/CoilfangReservoir/serpent_shrine/boss_hydross_the_unstable.cpp new file mode 100644 index 00000000000..923fdf55f80 --- /dev/null +++ b/src/server/scripts/Outland/CoilfangReservoir/serpent_shrine/boss_hydross_the_unstable.cpp @@ -0,0 +1,379 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Hydross_The_Unstable +SD%Complete: 90 +SDComment: Some details and adjustments left to do, probably nothing major. Spawns may be spawned in different way/location. +SDCategory: Coilfang Resevoir, Serpent Shrine Cavern +EndScriptData */ + +#include "ScriptedPch.h" +#include "serpent_shrine.h" + +#define SAY_AGGRO -1548000 +#define SAY_SWITCH_TO_CLEAN -1548001 +#define SAY_CLEAN_SLAY1 -1548002 +#define SAY_CLEAN_SLAY2 -1548003 +#define SAY_CLEAN_DEATH -1548004 +#define SAY_SWITCH_TO_CORRUPT -1548005 +#define SAY_CORRUPT_SLAY1 -1548006 +#define SAY_CORRUPT_SLAY2 -1548007 +#define SAY_CORRUPT_DEATH -1548008 + +#define SWITCH_RADIUS 18 + +#define MODEL_CORRUPT 20609 +#define MODEL_CLEAN 20162 + +#define SPELL_WATER_TOMB 38235 +#define SPELL_MARK_OF_HYDROSS1 38215 +#define SPELL_MARK_OF_HYDROSS2 38216 +#define SPELL_MARK_OF_HYDROSS3 38217 +#define SPELL_MARK_OF_HYDROSS4 38218 +#define SPELL_MARK_OF_HYDROSS5 38231 +#define SPELL_MARK_OF_HYDROSS6 40584 +#define SPELL_MARK_OF_CORRUPTION1 38219 +#define SPELL_MARK_OF_CORRUPTION2 38220 +#define SPELL_MARK_OF_CORRUPTION3 38221 +#define SPELL_MARK_OF_CORRUPTION4 38222 +#define SPELL_MARK_OF_CORRUPTION5 38230 +#define SPELL_MARK_OF_CORRUPTION6 40583 +#define SPELL_VILE_SLUDGE 38246 +#define SPELL_ENRAGE 27680 //this spell need verification +#define SPELL_SUMMON_WATER_ELEMENT 36459 //not in use yet(in use ever?) +#define SPELL_ELEMENTAL_SPAWNIN 25035 +#define SPELL_BLUE_BEAM 40227 //channeled Hydross Beam Helper (not in use yet) + +#define ENTRY_PURE_SPAWN 22035 +#define ENTRY_TAINTED_SPAWN 22036 +#define ENTRY_BEAM_DUMMY 21934 + +#define HYDROSS_X -239.439 +#define HYDROSS_Y -363.481 + +#define SPAWN_X_DIFF1 6.934003 +#define SPAWN_Y_DIFF1 -11.255012 +#define SPAWN_X_DIFF2 -6.934003 +#define SPAWN_Y_DIFF2 11.255012 +#define SPAWN_X_DIFF3 -12.577011 +#define SPAWN_Y_DIFF3 -4.72702 +#define SPAWN_X_DIFF4 12.577011 +#define SPAWN_Y_DIFF4 4.72702 + +struct boss_hydross_the_unstableAI : public ScriptedAI +{ + boss_hydross_the_unstableAI(Creature *c) : ScriptedAI(c), Summons(me) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint64 beams[2]; + uint32 PosCheck_Timer; + uint32 MarkOfHydross_Timer; + uint32 MarkOfCorruption_Timer; + uint32 WaterTomb_Timer; + uint32 VileSludge_Timer; + uint32 MarkOfHydross_Count; + uint32 MarkOfCorruption_Count; + uint32 EnrageTimer; + bool CorruptedForm; + bool beam; + SummonList Summons; + + void Reset() + { + DeSummonBeams(); + beams[0] = 0; + beams[1] = 0; + PosCheck_Timer = 2500; + MarkOfHydross_Timer = 15000; + MarkOfCorruption_Timer = 15000; + WaterTomb_Timer = 7000; + VileSludge_Timer = 7000; + MarkOfHydross_Count = 0; + MarkOfCorruption_Count = 0; + EnrageTimer = 600000; + + CorruptedForm = false; + me->SetMeleeDamageSchool(SPELL_SCHOOL_FROST); + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true); + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false); + + me->SetDisplayId(MODEL_CLEAN); + + if (pInstance) + pInstance->SetData(DATA_HYDROSSTHEUNSTABLEEVENT, NOT_STARTED); + beam = false; + Summons.DespawnAll(); + } + + void SummonBeams() + { + Creature* beamer = me->SummonCreature(ENTRY_BEAM_DUMMY,-258.333,-356.34,22.0499,5.90835,TEMPSUMMON_CORPSE_DESPAWN,0); + if (beamer) + { + beamer->CastSpell(me,SPELL_BLUE_BEAM,true); + beamer->SetDisplayId(11686); //invisible + beamer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + beams[0]=beamer->GetGUID(); + } + beamer = beamer = me->SummonCreature(ENTRY_BEAM_DUMMY,-219.918,-371.308,22.0042,2.73072,TEMPSUMMON_CORPSE_DESPAWN,0); + if (beamer) + { + beamer->CastSpell(me,SPELL_BLUE_BEAM,true); + beamer->SetDisplayId(11686); //invisible + beamer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + beams[1]=beamer->GetGUID(); + } + } + void DeSummonBeams() + { + for (uint8 i=0; i<2; ++i) + { + Creature* mob = Unit::GetCreature(*me,beams[i]); + if (mob) + { + mob->setDeathState(DEAD); + mob->RemoveCorpse(); + } + } + } + void EnterCombat(Unit * /*who*/) + { + DoScriptText(SAY_AGGRO, me); + + if (pInstance) + pInstance->SetData(DATA_HYDROSSTHEUNSTABLEEVENT, IN_PROGRESS); + } + + void KilledUnit(Unit * /*victim*/) + { + if (CorruptedForm) + { + DoScriptText(RAND(SAY_CORRUPT_SLAY1,SAY_CORRUPT_SLAY2), me); + } + else + { + DoScriptText(RAND(SAY_CLEAN_SLAY1,SAY_CLEAN_SLAY2), me); + } + } + + void JustSummoned(Creature* summoned) + { + if (summoned->GetEntry() == ENTRY_PURE_SPAWN) + { + summoned->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true); + summoned->CastSpell(summoned,SPELL_ELEMENTAL_SPAWNIN,true); + Summons.Summon(summoned); + } + if (summoned->GetEntry() == ENTRY_TAINTED_SPAWN) + { + summoned->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, true); + summoned->CastSpell(summoned,SPELL_ELEMENTAL_SPAWNIN,true); + Summons.Summon(summoned); + } + } + + void SummonedCreatureDespawn(Creature *summon) + { + Summons.Despawn(summon); + } + + void JustDied(Unit * /*victim*/) + { + if (CorruptedForm) + DoScriptText(SAY_CORRUPT_DEATH, me); + else + DoScriptText(SAY_CLEAN_DEATH, me); + + if (pInstance) + pInstance->SetData(DATA_HYDROSSTHEUNSTABLEEVENT, DONE); + Summons.DespawnAll(); + } + + void UpdateAI(const uint32 diff) + { + if (!beam) + { + SummonBeams(); + beam=true; + } + //Return since we have no target + if (!UpdateVictim()) + return; + + // corrupted form + if (CorruptedForm) + { + //MarkOfCorruption_Timer + if (MarkOfCorruption_Timer <= diff) + { + if (MarkOfCorruption_Count <= 5) + { + uint32 mark_spell = 0; + + switch (MarkOfCorruption_Count) + { + case 0: mark_spell = SPELL_MARK_OF_CORRUPTION1; break; + case 1: mark_spell = SPELL_MARK_OF_CORRUPTION2; break; + case 2: mark_spell = SPELL_MARK_OF_CORRUPTION3; break; + case 3: mark_spell = SPELL_MARK_OF_CORRUPTION4; break; + case 4: mark_spell = SPELL_MARK_OF_CORRUPTION5; break; + case 5: mark_spell = SPELL_MARK_OF_CORRUPTION6; break; + } + + DoCast(me->getVictim(), mark_spell); + + if (MarkOfCorruption_Count < 5) + ++MarkOfCorruption_Count; + } + + MarkOfCorruption_Timer = 15000; + } else MarkOfCorruption_Timer -= diff; + + //VileSludge_Timer + if (VileSludge_Timer <= diff) + { + Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (pTarget) + DoCast(pTarget, SPELL_VILE_SLUDGE); + + VileSludge_Timer = 15000; + } else VileSludge_Timer -= diff; + + //PosCheck_Timer + if (PosCheck_Timer <= diff) + { + if (me->IsWithinDist2d(HYDROSS_X, HYDROSS_Y, SWITCH_RADIUS)) + { + // switch to clean form + me->SetDisplayId(MODEL_CLEAN); + CorruptedForm = false; + MarkOfHydross_Count = 0; + + DoScriptText(SAY_SWITCH_TO_CLEAN, me); + DoResetThreat(); + SummonBeams(); + + // spawn 4 adds + DoSpawnCreature(ENTRY_PURE_SPAWN, SPAWN_X_DIFF1, SPAWN_Y_DIFF1, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); + DoSpawnCreature(ENTRY_PURE_SPAWN, SPAWN_X_DIFF2, SPAWN_Y_DIFF2, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); + DoSpawnCreature(ENTRY_PURE_SPAWN, SPAWN_X_DIFF3, SPAWN_Y_DIFF3, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); + DoSpawnCreature(ENTRY_PURE_SPAWN, SPAWN_X_DIFF4, SPAWN_Y_DIFF4, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); + + me->SetMeleeDamageSchool(SPELL_SCHOOL_FROST); + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true); + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false); + } + + PosCheck_Timer = 2500; + } else PosCheck_Timer -=diff; + } + // clean form + else + { + //MarkOfHydross_Timer + if (MarkOfHydross_Timer <= diff) + { + if (MarkOfHydross_Count <= 5) + { + uint32 mark_spell = NULL; + + switch(MarkOfHydross_Count) + { + case 0: mark_spell = SPELL_MARK_OF_HYDROSS1; break; + case 1: mark_spell = SPELL_MARK_OF_HYDROSS2; break; + case 2: mark_spell = SPELL_MARK_OF_HYDROSS3; break; + case 3: mark_spell = SPELL_MARK_OF_HYDROSS4; break; + case 4: mark_spell = SPELL_MARK_OF_HYDROSS5; break; + case 5: mark_spell = SPELL_MARK_OF_HYDROSS6; break; + } + + DoCast(me->getVictim(), mark_spell); + + if (MarkOfHydross_Count < 5) + ++MarkOfHydross_Count; + } + + MarkOfHydross_Timer = 15000; + } else MarkOfHydross_Timer -= diff; + + //WaterTomb_Timer + if (WaterTomb_Timer <= diff) + { + Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); + if (pTarget) + DoCast(pTarget, SPELL_WATER_TOMB); + + WaterTomb_Timer = 7000; + } else WaterTomb_Timer -= diff; + + //PosCheck_Timer + if (PosCheck_Timer <= diff) + { + if (!me->IsWithinDist2d(HYDROSS_X, HYDROSS_Y, SWITCH_RADIUS)) + { + // switch to corrupted form + me->SetDisplayId(MODEL_CORRUPT); + MarkOfCorruption_Count = 0; + CorruptedForm = true; + + DoScriptText(SAY_SWITCH_TO_CORRUPT, me); + DoResetThreat(); + DeSummonBeams(); + + // spawn 4 adds + DoSpawnCreature(ENTRY_TAINTED_SPAWN, SPAWN_X_DIFF1, SPAWN_Y_DIFF1, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); + DoSpawnCreature(ENTRY_TAINTED_SPAWN, SPAWN_X_DIFF2, SPAWN_Y_DIFF2, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); + DoSpawnCreature(ENTRY_TAINTED_SPAWN, SPAWN_X_DIFF3, SPAWN_Y_DIFF3, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); + DoSpawnCreature(ENTRY_TAINTED_SPAWN, SPAWN_X_DIFF4, SPAWN_Y_DIFF4, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); + + me->SetMeleeDamageSchool(SPELL_SCHOOL_NATURE); + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, true); + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false); + } + + PosCheck_Timer = 2500; + } else PosCheck_Timer -=diff; + } + + //EnrageTimer + if (EnrageTimer <= diff) + { + DoCast(me, SPELL_ENRAGE); + EnrageTimer = 60000; + } else EnrageTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_hydross_the_unstable(Creature* pCreature) +{ + return new boss_hydross_the_unstableAI (pCreature); +} + +void AddSC_boss_hydross_the_unstable() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_hydross_the_unstable"; + newscript->GetAI = &GetAI_boss_hydross_the_unstable; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/Outland/CoilfangReservoir/serpent_shrine/boss_lady_vashj.cpp b/src/server/scripts/Outland/CoilfangReservoir/serpent_shrine/boss_lady_vashj.cpp new file mode 100644 index 00000000000..2f0485d0e6c --- /dev/null +++ b/src/server/scripts/Outland/CoilfangReservoir/serpent_shrine/boss_lady_vashj.cpp @@ -0,0 +1,1039 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA02111-1307USA + */ + +/* ScriptData +SDName: Boss_Lady_Vashj +SD%Complete: 99 +SDComment: Missing blizzlike Shield Generators coords +SDCategory: Coilfang Resevoir, Serpent Shrine Cavern +EndScriptData */ + +#include "ScriptedPch.h" +#include "serpent_shrine.h" +#include "ScriptedSimpleAI.h" +#include "Spell.h" + +#define SAY_INTRO -1548042 +#define SAY_AGGRO1 -1548043 +#define SAY_AGGRO2 -1548044 +#define SAY_AGGRO3 -1548045 +#define SAY_AGGRO4 -1548046 +#define SAY_PHASE1 -1548047 +#define SAY_PHASE2 -1548048 +#define SAY_PHASE3 -1548049 +#define SAY_BOWSHOT1 -1548050 +#define SAY_BOWSHOT2 -1548051 +#define SAY_SLAY1 -1548052 +#define SAY_SLAY2 -1548053 +#define SAY_SLAY3 -1548054 +#define SAY_DEATH -1548055 + +#define SPELL_SURGE 38044 +#define SPELL_MULTI_SHOT 38310 +#define SPELL_SHOCK_BLAST 38509 +#define SPELL_ENTANGLE 38316 +#define SPELL_STATIC_CHARGE_TRIGGER 38280 +#define SPELL_FORKED_LIGHTNING 40088 +#define SPELL_SHOOT 40873 +#define SPELL_POISON_BOLT 40095 +#define SPELL_TOXIC_SPORES 38575 +#define SPELL_MAGIC_BARRIER 38112 + +#define MIDDLE_X 30.134 +#define MIDDLE_Y -923.65 +#define MIDDLE_Z 42.9 + +#define SPOREBAT_X 30.977156 +#define SPOREBAT_Y -925.297761 +#define SPOREBAT_Z 77.176567 +#define SPOREBAT_O 5.223932 + +#define SHIED_GENERATOR_CHANNEL 19870 +#define ENCHANTED_ELEMENTAL 21958 +#define TAINTED_ELEMENTAL 22009 +#define COILFANG_STRIDER 22056 +#define COILFANG_ELITE 22055 +#define TOXIC_SPOREBAT 22140 +#define TOXIC_SPORES_TRIGGER 22207 + +#define TEXT_NOT_INITIALIZED "Instance script not initialized" +#define TEXT_ALREADY_DEACTIVATED "Already deactivated" + +float ElementPos[8][4] = +{ + {8.3, -835.3, 21.9, 5}, + {53.4, -835.3, 21.9, 4.5}, + {96, -861.9, 21.8, 4}, + {96, -986.4, 21.4, 2.5}, + {54.4, -1010.6, 22, 1.8}, + {9.8, -1012, 21.7, 1.4}, + {-35, -987.6, 21.5, 0.8}, + {-58.9, -901.6, 21.5, 6} +}; + +float ElementWPPos[8][3] = +{ + {71.700752, -883.905884, 41.097168}, + {45.039848, -868.022827, 41.097015}, + {14.585141, -867.894470, 41.097061}, + {-25.415508, -906.737732, 41.097061}, + {-11.801594, -963.405884, 41.097067}, + {14.556657, -979.051514, 41.097137}, + {43.466549, -979.406677, 41.097027}, + {69.945908, -964.663940, 41.097054} +}; + +float SporebatWPPos[8][3] = +{ + {31.6,-896.3,59.1}, + {9.1, -913.9, 56}, + {5.2, -934.4, 52.4}, + {20.7, -946.9, 49.7}, + {41, -941.9, 51}, + {47.7, -927.3, 55}, + {42.2, -912.4, 51.7}, + {27, -905.9, 50} +}; + +float CoilfangElitePos[3][4] = +{ + {28.84, -923.28, 42.9, 6}, + {31.183281, -953.502625, 41.523602, 1.640957}, + {58.895180, -923.124268, 41.545307, 3.152848} +}; + +float CoilfangStriderPos[3][4] = +{ + {66.427010, -948.778503, 41.262245, 2.584220}, + {7.513962, -959.538208, 41.300422, 1.034629}, + {-12.843201, -907.798401, 41.239620, 6.087094} +}; + +float ShieldGeneratorChannelPos[4][4] = +{ + {49.6262, -902.181, 43.0975, 3.95683}, + {10.988, -901.616, 42.5371, 5.4373}, + {10.3859, -944.036, 42.5446, 0.779888}, + {49.3126, -943.398, 42.5501, 2.40174} +}; + +//Lady Vashj AI +struct boss_lady_vashjAI : public ScriptedAI +{ + boss_lady_vashjAI (Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + Intro = false; + JustCreated = true; + c->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); //set it only once on Creature create (no need do intro if wiped) + } + + ScriptedInstance *pInstance; + + uint64 ShieldGeneratorChannel[4]; + + uint32 AggroTimer; + uint32 ShockBlast_Timer; + uint32 Entangle_Timer; + uint32 StaticCharge_Timer; + uint32 ForkedLightning_Timer; + uint32 Check_Timer; + uint32 EnchantedElemental_Timer; + uint32 TaintedElemental_Timer; + uint32 CoilfangElite_Timer; + uint32 CoilfangStrider_Timer; + uint32 SummonSporebat_Timer; + uint32 SummonSporebat_StaticTimer; + uint8 EnchantedElemental_Pos; + uint8 Phase; + + bool Entangle; + bool Intro; + bool CanAttack; + bool JustCreated; + + void Reset() + { + AggroTimer = 19000; + ShockBlast_Timer = 1+rand()%60000; + Entangle_Timer = 30000; + StaticCharge_Timer = 10000+rand()%15000; + ForkedLightning_Timer = 2000; + Check_Timer = 15000; + EnchantedElemental_Timer = 5000; + TaintedElemental_Timer = 50000; + CoilfangElite_Timer = 45000+rand()%5000; + CoilfangStrider_Timer = 60000+rand()%10000; + SummonSporebat_Timer = 10000; + SummonSporebat_StaticTimer = 30000; + EnchantedElemental_Pos = 0; + Phase = 0; + + Entangle = false; + if (JustCreated) + { + CanAttack = false; + JustCreated = false; + } else CanAttack = true; + + Unit *remo; + for (uint8 i = 0; i < 4; ++i) + { + remo = Unit::GetUnit(*me, ShieldGeneratorChannel[i]); + if (remo) + remo->setDeathState(JUST_DIED); + } + + if (pInstance) + pInstance->SetData(DATA_LADYVASHJEVENT, NOT_STARTED); + ShieldGeneratorChannel[0] = 0; + ShieldGeneratorChannel[1] = 0; + ShieldGeneratorChannel[2] = 0; + ShieldGeneratorChannel[3] = 0; + + me->SetCorpseDelay(1000*60*60); + } + + //Called when a tainted elemental dies + void EventTaintedElementalDeath() + { + //the next will spawn 50 seconds after the previous one's death + if (TaintedElemental_Timer > 50000) + TaintedElemental_Timer = 50000; + } + void KilledUnit(Unit * /*victim*/) + { + DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), me); + } + + void JustDied(Unit * /*victim*/) + { + DoScriptText(SAY_DEATH, me); + + if (pInstance) + pInstance->SetData(DATA_LADYVASHJEVENT, DONE); + } + + void StartEvent() + { + DoScriptText(RAND(SAY_AGGRO1,SAY_AGGRO2,SAY_AGGRO3,SAY_AGGRO4), me); + + Phase = 1; + + if (pInstance) + pInstance->SetData(DATA_LADYVASHJEVENT, IN_PROGRESS); + } + + void EnterCombat(Unit * who) + { + if (pInstance) + { + //remove old tainted cores to prevent cheating in phase 2 + Map* pMap = me->GetMap(); + Map::PlayerList const &PlayerList = pMap->GetPlayers(); + for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) + { + if (Player* i_pl = i->getSource()) + { + i_pl->DestroyItemCount(31088, 1, true); + } + } + } + StartEvent();//this is EnterCombat(), so were are 100% in combat, start the event + + if (Phase != 2) + AttackStart(who); + } + + void MoveInLineOfSight(Unit *who) + { + if (!Intro) + { + Intro = true; + DoScriptText(SAY_INTRO, me); + } + if (!CanAttack) + return; + if (!who || me->getVictim()) + return; + + if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(me) && me->IsHostileTo(who)) + { + float attackRadius = me->GetAttackDistance(who); + if (me->IsWithinDistInMap(who, attackRadius) && me->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && me->IsWithinLOSInMap(who)) + { + //if (who->HasStealthAura()) + // who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); + + if (!me->isInCombat())//AttackStart() sets UNIT_FLAG_IN_COMBAT, so this msut be before attacking + StartEvent(); + + if (Phase != 2) + AttackStart(who); + } + } + } + + void CastShootOrMultishot() + { + switch (urand(0,1)) + { + case 0: + //Shoot + //Used in Phases 1 and 3 after Entangle or while having nobody in melee range. A shot that hits her target for 4097-5543 Physical damage. + DoCast(me->getVictim(), SPELL_SHOOT); + break; + case 1: + //Multishot + //Used in Phases 1 and 3 after Entangle or while having nobody in melee range. A shot that hits 1 person and 4 people around him for 6475-7525 physical damage. + DoCast(me->getVictim(), SPELL_MULTI_SHOT); + break; + } + if (rand()%3) + { + DoScriptText(RAND(SAY_BOWSHOT1,SAY_BOWSHOT2), me); + } + } + + void UpdateAI(const uint32 diff) + { + if (!CanAttack && Intro) + { + if (AggroTimer <= diff) + { + CanAttack = true; + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + AggroTimer=19000; + }else + { + AggroTimer-=diff; + return; + } + } + //to prevent abuses during phase 2 + if (Phase == 2 && !me->getVictim() && me->isInCombat()) + { + EnterEvadeMode(); + return; + } + //Return since we have no target + if (!UpdateVictim()) + return; + + if (Phase == 1 || Phase == 3) + { + //ShockBlast_Timer + if (ShockBlast_Timer <= diff) + { + //Shock Burst + //Randomly used in Phases 1 and 3 on Vashj's target, it's a Shock spell doing 8325-9675 nature damage and stunning the target for 5 seconds, during which she will not attack her target but switch to the next person on the aggro list. + DoCast(me->getVictim(), SPELL_SHOCK_BLAST); + me->TauntApply(me->getVictim()); + + ShockBlast_Timer = 1000+rand()%14000; //random cooldown + } else ShockBlast_Timer -= diff; + + //StaticCharge_Timer + if (StaticCharge_Timer <= diff) + { + //Static Charge + //Used on random people (only 1 person at any given time) in Phases 1 and 3, it's a debuff doing 2775 to 3225 Nature damage to the target and everybody in about 5 yards around it, every 1 seconds for 30 seconds. It can be removed by Cloak of Shadows, Iceblock, Divine Shield, etc, but not by Cleanse or Dispel Magic. + Unit *pTarget = NULL; + pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 200, true); + + if (pTarget && !pTarget->HasAura(SPELL_STATIC_CHARGE_TRIGGER)) + //cast Static Charge every 2 seconds for 20 seconds + DoCast(pTarget, SPELL_STATIC_CHARGE_TRIGGER); + + StaticCharge_Timer = 10000+rand()%20000; //blizzlike + } else StaticCharge_Timer -= diff; + + //Entangle_Timer + if (Entangle_Timer <= diff) + { + if (!Entangle) + { + //Entangle + //Used in Phases 1 and 3, it casts Entangling Roots on everybody in a 15 yard radius of Vashj, immobilzing them for 10 seconds and dealing 500 damage every 2 seconds. It's not a magic effect so it cannot be dispelled, but is removed by various buffs such as Cloak of Shadows or Blessing of Freedom. + DoCast(me->getVictim(), SPELL_ENTANGLE); + Entangle = true; + Entangle_Timer = 10000; + } + else + { + CastShootOrMultishot(); + Entangle = false; + Entangle_Timer = 20000+rand()%5000; + } + } else Entangle_Timer -= diff; + + //Phase 1 + if (Phase == 1) + { + //Start phase 2 + if ((me->GetHealth()*100 / me->GetMaxHealth()) < 70) + { + //Phase 2 begins when Vashj hits 70%. She will run to the middle of her platform and surround herself in a shield making her invulerable. + Phase = 2; + + me->GetMotionMaster()->Clear(); + DoTeleportTo(MIDDLE_X, MIDDLE_Y, MIDDLE_Z); + + Creature *pCreature; + for (uint8 i = 0; i < 4; ++i) + { + pCreature = me->SummonCreature(SHIED_GENERATOR_CHANNEL, ShieldGeneratorChannelPos[i][0], ShieldGeneratorChannelPos[i][1], ShieldGeneratorChannelPos[i][2], ShieldGeneratorChannelPos[i][3], TEMPSUMMON_CORPSE_DESPAWN, 0); + if (pCreature) + ShieldGeneratorChannel[i] = pCreature->GetGUID(); + } + DoScriptText(SAY_PHASE2, me); + } + } + //Phase 3 + else + { + //SummonSporebat_Timer + if (SummonSporebat_Timer <= diff) + { + Creature *Sporebat = NULL; + Sporebat = me->SummonCreature(TOXIC_SPOREBAT, SPOREBAT_X, SPOREBAT_Y, SPOREBAT_Z, SPOREBAT_O, TEMPSUMMON_CORPSE_DESPAWN, 0); + + if (Sporebat) + { + Unit *pTarget = NULL; + pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (pTarget) + Sporebat->AI()->AttackStart(pTarget); + } + + //summon sporebats faster and faster + if (SummonSporebat_StaticTimer > 1000) + SummonSporebat_StaticTimer -= 1000; + + SummonSporebat_Timer = SummonSporebat_StaticTimer; + + if (SummonSporebat_Timer < 5000) + SummonSporebat_Timer = 5000; + + } else SummonSporebat_Timer -= diff; + } + + //Melee attack + DoMeleeAttackIfReady(); + + //Check_Timer - used to check if somebody is in melee range + if (Check_Timer <= diff) + { + bool InMeleeRange = false; + Unit *pTarget; + std::list t_list = me->getThreatManager().getThreatList(); + for (std::list::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) + { + pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid()); + //if in melee range + if (pTarget && pTarget->IsWithinDistInMap(me, 5)) + { + InMeleeRange = true; + break; + } + } + + //if nobody is in melee range + if (!InMeleeRange) + CastShootOrMultishot(); + + Check_Timer = 5000; + } else Check_Timer -= diff; + } + //Phase 2 + else + { + //ForkedLightning_Timer + if (ForkedLightning_Timer <= diff) + { + //Forked Lightning + //Used constantly in Phase 2, it shoots out completely randomly targeted bolts of lightning which hit everybody in a roughtly 60 degree cone in front of Vashj for 2313-2687 nature damage. + Unit *pTarget = NULL; + pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + + if (!pTarget) + pTarget = me->getVictim(); + + DoCast(pTarget, SPELL_FORKED_LIGHTNING); + + ForkedLightning_Timer = 2000+rand()%6000; //blizzlike + } else ForkedLightning_Timer -= diff; + + //EnchantedElemental_Timer + if (EnchantedElemental_Timer <= diff) + { + Creature *Elemental; + Elemental = me->SummonCreature(ENCHANTED_ELEMENTAL, ElementPos[EnchantedElemental_Pos][0], ElementPos[EnchantedElemental_Pos][1], ElementPos[EnchantedElemental_Pos][2], ElementPos[EnchantedElemental_Pos][3], TEMPSUMMON_CORPSE_DESPAWN, 0); + + if (EnchantedElemental_Pos == 7) + EnchantedElemental_Pos = 0; + else + ++EnchantedElemental_Pos; + + EnchantedElemental_Timer = 10000+rand()%5000; + } else EnchantedElemental_Timer -= diff; + + //TaintedElemental_Timer + if (TaintedElemental_Timer <= diff) + { + Creature *Tain_Elemental; + uint32 pos = rand()%8; + Tain_Elemental = me->SummonCreature(TAINTED_ELEMENTAL, ElementPos[pos][0], ElementPos[pos][1], ElementPos[pos][2], ElementPos[pos][3], TEMPSUMMON_DEAD_DESPAWN, 0); + + TaintedElemental_Timer = 120000; + } else TaintedElemental_Timer -= diff; + + //CoilfangElite_Timer + if (CoilfangElite_Timer <= diff) + { + uint32 pos = rand()%3; + Creature* CoilfangElite = NULL; + CoilfangElite = me->SummonCreature(COILFANG_ELITE, CoilfangElitePos[pos][0], CoilfangElitePos[pos][1], CoilfangElitePos[pos][2], CoilfangElitePos[pos][3], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + if (CoilfangElite) + { + Unit *pTarget = NULL; + pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (pTarget) + CoilfangElite->AI()->AttackStart(pTarget); + else if (me->getVictim()) + CoilfangElite->AI()->AttackStart(me->getVictim()); + } + CoilfangElite_Timer = 45000+rand()%5000; + } else CoilfangElite_Timer -= diff; + + //CoilfangStrider_Timer + if (CoilfangStrider_Timer <= diff) + { + uint32 pos = rand()%3; + Creature* CoilfangStrider = NULL; + CoilfangStrider = me->SummonCreature(COILFANG_STRIDER, CoilfangStriderPos[pos][0], CoilfangStriderPos[pos][1], CoilfangStriderPos[pos][2], CoilfangStriderPos[pos][3], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + if (CoilfangStrider) + { + Unit *pTarget = NULL; + pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (pTarget) + CoilfangStrider->AI()->AttackStart(pTarget); + else if (me->getVictim()) + CoilfangStrider->AI()->AttackStart(me->getVictim()); + } + CoilfangStrider_Timer = 60000+rand()%10000; + } else CoilfangStrider_Timer -= diff; + + //Check_Timer + if (Check_Timer <= diff) + { + //Start Phase 3 + if (pInstance && pInstance->GetData(DATA_CANSTARTPHASE3)) + { + //set life 50% + me->SetHealth(me->GetMaxHealth()/2); + + me->RemoveAurasDueToSpell(SPELL_MAGIC_BARRIER); + + DoScriptText(SAY_PHASE3, me); + + Phase = 3; + + //return to the tank + me->GetMotionMaster()->MoveChase(me->getVictim()); + } + Check_Timer = 1000; + } else Check_Timer -= diff; + } + } +}; + +//Enchanted Elemental +//If one of them reaches Vashj he will increase her damage done by 5%. +struct mob_enchanted_elementalAI : public ScriptedAI +{ + mob_enchanted_elementalAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance *pInstance; + uint32 move; + uint32 phase; + float x, y, z; + + uint64 VashjGUID; + + void Reset() + { + me->SetSpeed(MOVE_WALK,0.6);//walk + me->SetSpeed(MOVE_RUN,0.6);//run + move = 0; + phase = 1; + + VashjGUID = 0; + + for (int i = 0; i<8; ++i)//search for nearest waypoint (up on stairs) + { + if (!x || !y || !z) + { + x = ElementWPPos[i][0]; + y = ElementWPPos[i][1]; + z = ElementWPPos[i][2]; + } + else + { + if (me->GetDistance(ElementWPPos[i][0],ElementWPPos[i][1],ElementWPPos[i][2]) < me->GetDistance(x,y,z)) + { + x = ElementWPPos[i][0]; + y = ElementWPPos[i][1]; + z = ElementWPPos[i][2]; + } + } + } + if (pInstance) + VashjGUID = pInstance->GetData64(DATA_LADYVASHJ); + } + + void EnterCombat(Unit * /*who*/) {} + + void MoveInLineOfSight(Unit * /*who*/) {} + + void UpdateAI(const uint32 diff) + { + if (!pInstance) + return; + + if (!VashjGUID) + return; + + if (move <= diff) + { + me->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + if (phase == 1) + me->GetMotionMaster()->MovePoint(0, x, y, z); + if (phase == 1 && me->IsWithinDist3d(x,y,z, 0.1)) + phase = 2; + if (phase == 2) + { + me->GetMotionMaster()->MovePoint(0, MIDDLE_X, MIDDLE_Y, MIDDLE_Z); + phase = 3; + } + if (phase == 3) + { + me->GetMotionMaster()->MovePoint(0, MIDDLE_X, MIDDLE_Y, MIDDLE_Z); + if (me->IsWithinDist3d(MIDDLE_X, MIDDLE_Y, MIDDLE_Z, 3)) + DoCast(me, SPELL_SURGE); + } + if (Creature *Vashj = Unit::GetCreature(*me, VashjGUID)) + { + if (!Vashj->isInCombat() || CAST_AI(boss_lady_vashjAI, Vashj->AI())->Phase != 2 || Vashj->isDead()) + { + //call Unsummon() + me->Kill(me); + } + } + move = 1000; + } else move -= diff; + } +}; + +//Tainted Elemental +//This mob has 7,900 life, doesn't move, and shoots Poison Bolts at one person anywhere in the area, doing 3,000 nature damage and placing a posion doing 2,000 damage every 2 seconds. He will switch targets often, or sometimes just hang on a single player, but there is nothing you can do about it except heal the damage and kill the Tainted Elemental +struct mob_tainted_elementalAI : public ScriptedAI +{ + mob_tainted_elementalAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance *pInstance; + + uint32 PoisonBolt_Timer; + uint32 Despawn_Timer; + + void Reset() + { + PoisonBolt_Timer = 5000+rand()%5000; + Despawn_Timer = 30000; + } + + void JustDied(Unit * /*killer*/) + { + if (pInstance) + { + Creature *Vashj = NULL; + Vashj = (Unit::GetCreature((*me), pInstance->GetData64(DATA_LADYVASHJ))); + + if (Vashj) + CAST_AI(boss_lady_vashjAI, Vashj->AI())->EventTaintedElementalDeath(); + } + } + + void EnterCombat(Unit * who) + { + me->AddThreat(who, 0.1f); + } + + void UpdateAI(const uint32 diff) + { + //PoisonBolt_Timer + if (PoisonBolt_Timer <= diff) + { + Unit *pTarget = NULL; + pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + + if (pTarget && pTarget->IsWithinDistInMap(me, 30)) + DoCast(pTarget, SPELL_POISON_BOLT); + + PoisonBolt_Timer = 5000+rand()%5000; + } else PoisonBolt_Timer -= diff; + + //Despawn_Timer + if (Despawn_Timer <= diff) + { + //call Unsummon() + me->setDeathState(DEAD); + + //to prevent crashes + Despawn_Timer = 1000; + } else Despawn_Timer -= diff; + } +}; + +//Toxic Sporebat +//Toxic Spores: Used in Phase 3 by the Spore Bats, it creates a contaminated green patch of ground, dealing about 2775-3225 nature damage every second to anyone who stands in it. +struct mob_toxic_sporebatAI : public ScriptedAI +{ + mob_toxic_sporebatAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + EnterEvadeMode(); + } + + ScriptedInstance *pInstance; + + uint32 movement_timer; + uint32 ToxicSpore_Timer; + uint32 bolt_timer; + uint32 Check_Timer; + + void Reset() + { + me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->setFaction(14); + movement_timer = 0; + ToxicSpore_Timer = 5000; + bolt_timer = 5500; + Check_Timer = 1000; + } + + void EnterCombat(Unit * /*who*/) + { + + } + + void MoveInLineOfSight(Unit * /*who*/) + { + + } + + void MovementInform(uint32 type, uint32 id) + { + if (type != POINT_MOTION_TYPE) + return; + + if (id == 1) + movement_timer = 0; + } + + void UpdateAI (const uint32 diff) + { + //Random movement + if (movement_timer <= diff) + { + uint32 rndpos = rand()%8; + me->GetMotionMaster()->MovePoint(1,SporebatWPPos[rndpos][0], SporebatWPPos[rndpos][1], SporebatWPPos[rndpos][2]); + movement_timer = 6000; + } else movement_timer -= diff; + + //toxic spores + if (bolt_timer <= diff) + { + Unit *pTarget = NULL; + pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (pTarget) + { + Creature* trig = me->SummonCreature(TOXIC_SPORES_TRIGGER,pTarget->GetPositionX(),pTarget->GetPositionY(),pTarget->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,30000); + if (trig) + { + trig->setFaction(14); + trig->CastSpell(trig, SPELL_TOXIC_SPORES,true); + } + } + bolt_timer = 10000+rand()%5000; + } + else bolt_timer -= diff; + + //Check_Timer + if (Check_Timer <= diff) + { + if (pInstance) + { + //check if vashj is death + Unit *Vashj = NULL; + Vashj = Unit::GetUnit((*me), pInstance->GetData64(DATA_LADYVASHJ)); + if (!Vashj || (Vashj && !Vashj->isAlive()) || (Vashj && CAST_AI(boss_lady_vashjAI, CAST_CRE(Vashj)->AI())->Phase != 3)) + { + //remove + me->setDeathState(DEAD); + me->RemoveCorpse(); + me->setFaction(35); + } + } + + Check_Timer = 1000; + } else Check_Timer -= diff; + } +}; + +//Coilfang Elite +//It's an elite Naga mob with 170,000 HP. It does about 5000 damage on plate, and has a nasty cleave hitting for about 7500 damage +CreatureAI* GetAI_mob_coilfang_elite(Creature* pCreature) +{ + SimpleAI* ai = new SimpleAI (pCreature); + + ai->Spell[0].Enabled = true; + ai->Spell[0].Spell_Id = 31345; //Cleave + ai->Spell[0].Cooldown = 15000; + ai->Spell[0].CooldownRandomAddition = 5000; + ai->Spell[0].First_Cast = 5000; + ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_RANDOM; + + ai->EnterEvadeMode(); + + return ai; +} + +//Coilfang Strider +//It hits plate for about 8000 damage, has a Mind Blast spell doing about 3000 shadow damage, and a Psychic Scream Aura, which fears everybody in a 8 yard range of it every 2-3 seconds , for 5 seconds and increasing their movement speed by 150% during the fear. +CreatureAI* GetAI_mob_coilfang_strider(Creature* pCreature) +{ + SimpleAI* ai = new SimpleAI (pCreature); + + ai->Spell[0].Enabled = true; + ai->Spell[0].Spell_Id = 41374; //Mind Blast + ai->Spell[0].Cooldown = 30000; + ai->Spell[0].CooldownRandomAddition = 10000; + ai->Spell[0].First_Cast = 8000; + ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_TARGET; + + //Scream aura not implemented + + ai->EnterEvadeMode(); + + return ai; +} + +struct mob_shield_generator_channelAI : public ScriptedAI +{ + mob_shield_generator_channelAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance *pInstance; + uint32 Check_Timer; + bool Casted; + void Reset() + { + Check_Timer = 0; + Casted = false; + me->SetDisplayId(11686); //invisible + + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + } + + void EnterCombat(Unit * /*who*/) {} + + void MoveInLineOfSight(Unit * /*who*/) {} + + void UpdateAI (const uint32 diff) + { + if (!pInstance) + return; + + if (Check_Timer <= diff) + { + Unit *Vashj = NULL; + Vashj = Unit::GetUnit((*me), pInstance->GetData64(DATA_LADYVASHJ)); + + if (Vashj && Vashj->isAlive()) + { + //start visual channel + if (!Casted || !Vashj->HasAura(SPELL_MAGIC_BARRIER)) + { + DoCast(Vashj, SPELL_MAGIC_BARRIER, true); + Casted = true; + } + } + Check_Timer = 1000; + } else Check_Timer -= diff; + } +}; + +bool ItemUse_item_tainted_core(Player* pPlayer, Item* /*_Item*/, SpellCastTargets const& targets) +{ + ScriptedInstance *pInstance = pPlayer->GetInstanceData(); + + if (!pInstance) + { + pPlayer->GetSession()->SendNotification(TEXT_NOT_INITIALIZED); + return true; + } + + Creature *Vashj = NULL; + Vashj = (Unit::GetCreature((*pPlayer), pInstance->GetData64(DATA_LADYVASHJ))); + if (Vashj && CAST_AI(boss_lady_vashjAI, Vashj->AI())->Phase == 2) + { + if (targets.getGOTarget() && targets.getGOTarget()->GetTypeId() == TYPEID_GAMEOBJECT) + { + uint32 identifier; + uint8 channel_identifier; + switch(targets.getGOTarget()->GetEntry()) + { + case 185052: + identifier = DATA_SHIELDGENERATOR1; + channel_identifier = 0; + break; + case 185053: + identifier = DATA_SHIELDGENERATOR2; + channel_identifier = 1; + break; + case 185051: + identifier = DATA_SHIELDGENERATOR3; + channel_identifier = 2; + break; + case 185054: + identifier = DATA_SHIELDGENERATOR4; + channel_identifier = 3; + break; + default: + return true; + } + + if (pInstance->GetData(identifier)) + { + pPlayer->GetSession()->SendNotification(TEXT_ALREADY_DEACTIVATED); + return true; + } + + //get and remove channel + Unit *Channel = NULL; + Channel = Unit::GetCreature(*Vashj, CAST_AI(boss_lady_vashjAI, Vashj->AI())->ShieldGeneratorChannel[channel_identifier]); + if (Channel) + { + //call Unsummon() + Channel->setDeathState(JUST_DIED); + } + + pInstance->SetData(identifier, 1); + + //remove this item + pPlayer->DestroyItemCount(31088, 1, true); + return true; + } + else if (targets.getUnitTarget()->GetTypeId() == TYPEID_UNIT) + return false; + else if (targets.getUnitTarget()->GetTypeId() == TYPEID_PLAYER) + { + pPlayer->DestroyItemCount(31088, 1, true); + pPlayer->CastSpell(targets.getUnitTarget(), 38134, true); + return true; + } + } + return true; +} + +CreatureAI* GetAI_boss_lady_vashj(Creature* pCreature) +{ + return new boss_lady_vashjAI (pCreature); +} + +CreatureAI* GetAI_mob_enchanted_elemental(Creature* pCreature) +{ + return new mob_enchanted_elementalAI (pCreature); +} + +CreatureAI* GetAI_mob_tainted_elemental(Creature* pCreature) +{ + return new mob_tainted_elementalAI (pCreature); +} + +CreatureAI* GetAI_mob_toxic_sporebat(Creature* pCreature) +{ + return new mob_toxic_sporebatAI (pCreature); +} + +CreatureAI* GetAI_mob_shield_generator_channel(Creature* pCreature) +{ + return new mob_shield_generator_channelAI (pCreature); +} + +void AddSC_boss_lady_vashj() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_lady_vashj"; + newscript->GetAI = &GetAI_boss_lady_vashj; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_enchanted_elemental"; + newscript->GetAI = &GetAI_mob_enchanted_elemental; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_tainted_elemental"; + newscript->GetAI = &GetAI_mob_tainted_elemental; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_toxic_sporebat"; + newscript->GetAI = &GetAI_mob_toxic_sporebat; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_coilfang_elite"; + newscript->GetAI = &GetAI_mob_coilfang_elite; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_coilfang_strider"; + newscript->GetAI = &GetAI_mob_coilfang_strider; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_shield_generator_channel"; + newscript->GetAI = &GetAI_mob_shield_generator_channel; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "item_tainted_core"; + newscript->pItemUse = &ItemUse_item_tainted_core; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/Outland/CoilfangReservoir/serpent_shrine/boss_leotheras_the_blind.cpp b/src/server/scripts/Outland/CoilfangReservoir/serpent_shrine/boss_leotheras_the_blind.cpp new file mode 100644 index 00000000000..61c9ed9d527 --- /dev/null +++ b/src/server/scripts/Outland/CoilfangReservoir/serpent_shrine/boss_leotheras_the_blind.cpp @@ -0,0 +1,787 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Leotheras_The_Blind +SD%Complete: 80 +SDComment: Possesion Support +SDCategory: Coilfang Resevoir, Serpent Shrine Cavern +EndScriptData */ + +#include "ScriptedPch.h" +#include "serpent_shrine.h" + +// --- Spells used by Leotheras The Blind +#define SPELL_WHIRLWIND 37640 +#define SPELL_CHAOS_BLAST 37674 +#define SPELL_BERSERK 26662 +#define SPELL_INSIDIOUS_WHISPER 37676 +#define SPELL_DUAL_WIELD 42459 + +// --- Spells used in banish phase --- +#define BANISH_BEAM 38909 +#define AURA_BANISH 37833 + +// --- Spells used by Greyheart Spellbinders +#define SPELL_EARTHSHOCK 39076 +#define SPELL_MINDBLAST 37531 + +// --- Spells used by Inner Demons and Creature ID +#define INNER_DEMON_ID 21857 +#define AURA_DEMONIC_ALIGNMENT 37713 +#define SPELL_SHADOWBOLT 39309 +#define SPELL_SOUL_LINK 38007 +#define SPELL_CONSUMING_MADNESS 37749 //not supported by core yet + +//Misc. +#define MODEL_DEMON 20125 +#define MODEL_NIGHTELF 20514 +#define DEMON_FORM 21875 +#define MOB_SPELLBINDER 21806 + +#define SAY_AGGRO -1548009 +#define SAY_SWITCH_TO_DEMON -1548010 +#define SAY_INNER_DEMONS -1548011 +#define SAY_DEMON_SLAY1 -1548012 +#define SAY_DEMON_SLAY2 -1548013 +#define SAY_DEMON_SLAY3 -1548014 +#define SAY_NIGHTELF_SLAY1 -1548015 +#define SAY_NIGHTELF_SLAY2 -1548016 +#define SAY_NIGHTELF_SLAY3 -1548017 +#define SAY_FINAL_FORM -1548018 +#define SAY_FREE -1548019 +#define SAY_DEATH -1548020 + +struct mob_inner_demonAI : public ScriptedAI +{ + mob_inner_demonAI(Creature *c) : ScriptedAI(c) + { + victimGUID = 0; + } + + uint32 ShadowBolt_Timer; + + uint32 Link_Timer; + uint64 victimGUID; + + void Reset() + { + ShadowBolt_Timer = 10000; + Link_Timer = 1000; + } + void JustDied(Unit * /*victim*/) + { + Unit* pUnit = Unit::GetUnit((*me),victimGUID); + if (pUnit && pUnit->HasAura(SPELL_INSIDIOUS_WHISPER)) + pUnit->RemoveAurasDueToSpell(SPELL_INSIDIOUS_WHISPER); + } + + void DamageTaken(Unit *done_by, uint32 &damage) + { + if (done_by->GetGUID() != victimGUID && done_by->GetGUID() != me->GetGUID()) + { + damage = 0; + DoModifyThreatPercent(done_by, -100); + } + } + + void EnterCombat(Unit * /*who*/) + { + if (!victimGUID) return; + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + if (me->getVictim()->GetGUID() != victimGUID) + { + DoModifyThreatPercent(me->getVictim(), -100); + Unit* owner = Unit::GetUnit((*me),victimGUID); + if (owner && owner->isAlive()) + { + me->AddThreat(owner,999999); + AttackStart(owner); + } else if (owner && owner->isDead()) + { + me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + return; + } + } + + if (Link_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_SOUL_LINK, true); + Link_Timer = 1000; + } else Link_Timer -= diff; + + if (!me->HasAura(AURA_DEMONIC_ALIGNMENT)) + DoCast(me, AURA_DEMONIC_ALIGNMENT, true); + + if (ShadowBolt_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_SHADOWBOLT, false); + ShadowBolt_Timer = 10000; + } else ShadowBolt_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +//Original Leotheras the Blind AI +struct boss_leotheras_the_blindAI : public ScriptedAI +{ + boss_leotheras_the_blindAI(Creature *c) : ScriptedAI(c) + { + c->GetPosition(x,y,z); + pInstance = c->GetInstanceData(); + Demon = 0; + + for (uint8 i = 0; i < 3; ++i)//clear guids + SpellBinderGUID[i] = 0; + } + + ScriptedInstance *pInstance; + + uint32 Whirlwind_Timer; + uint32 ChaosBlast_Timer; + uint32 SwitchToDemon_Timer; + uint32 SwitchToHuman_Timer; + uint32 Berserk_Timer; + uint32 InnerDemons_Timer; + uint32 BanishTimer; + + bool DealDamage; + bool NeedThreatReset; + bool DemonForm; + bool IsFinalForm; + bool EnrageUsed; + float x,y,z; + + uint64 InnderDemon[5]; + uint32 InnerDemon_Count; + uint64 Demon; + uint64 SpellBinderGUID[3]; + + void Reset() + { + CheckChannelers(); + BanishTimer = 1000; + Whirlwind_Timer = 15000; + ChaosBlast_Timer = 1000; + SwitchToDemon_Timer = 45000; + SwitchToHuman_Timer = 60000; + Berserk_Timer = 600000; + InnerDemons_Timer = 30000; + me->SetCanDualWield(true); + DealDamage = true; + DemonForm = false; + IsFinalForm = false; + NeedThreatReset = false; + EnrageUsed = false; + InnerDemon_Count = 0; + me->SetSpeed(MOVE_RUN, 2.0f, true); + me->SetDisplayId(MODEL_NIGHTELF); + me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID , 0); + me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0); + DoCast(me, SPELL_DUAL_WIELD, true); + me->SetCorpseDelay(1000*60*60); + if (pInstance) + pInstance->SetData(DATA_LEOTHERASTHEBLINDEVENT, NOT_STARTED); + } + + void CheckChannelers(/*bool DoEvade = true*/) + { + for (uint8 i = 0; i < 3; ++i) + { + if (Creature *add = Unit::GetCreature(*me,SpellBinderGUID[i])) + add->DisappearAndDie(); + + float nx = x; + float ny = y; + float o = 2.4f; + if (i == 0) {nx += 10; ny -= 5; o=2.5f;} + if (i == 1) {nx -= 8; ny -= 7; o=0.9f;} + if (i == 2) {nx -= 3; ny += 9; o=5.0f;} + Creature* binder = me->SummonCreature(MOB_SPELLBINDER,nx,ny,z,o,TEMPSUMMON_DEAD_DESPAWN,0); + if (binder) + SpellBinderGUID[i] = binder->GetGUID(); + + } + } + void MoveInLineOfSight(Unit *who) + { + if (me->HasAura(AURA_BANISH)) + return; + + if (!me->getVictim() && who->isTargetableForAttack() && (me->IsHostileTo(who)) && who->isInAccessiblePlaceFor(me)) + { + if (me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) + return; + + float attackRadius = me->GetAttackDistance(who); + if (me->IsWithinDistInMap(who, attackRadius)) + { + // Check first that object is in an angle in front of this one before LoS check + if (me->HasInArc(M_PI/2.0f, who) && me->IsWithinLOSInMap(who)) + { + AttackStart(who); + } + } + } + } + + void StartEvent() + { + DoScriptText(SAY_AGGRO, me); + if (pInstance) + pInstance->SetData(DATA_LEOTHERASTHEBLINDEVENT, IN_PROGRESS); + } + + void CheckBanish() + { + uint8 AliveChannelers = 0; + for (uint8 i = 0; i < 3; ++i) + { + Unit *add = Unit::GetUnit(*me,SpellBinderGUID[i]); + if (add && add->isAlive()) + ++AliveChannelers; + } + + // channelers == 0 remove banish aura + if (AliveChannelers == 0 && me->HasAura(AURA_BANISH)) + { + // removing banish aura + me->RemoveAurasDueToSpell(AURA_BANISH); + + // Leotheras is getting immune again + me->ApplySpellImmune(AURA_BANISH, IMMUNITY_MECHANIC, MECHANIC_BANISH, true); + + // changing model to bloodelf + me->SetDisplayId(MODEL_NIGHTELF); + + // and reseting equipment + me->LoadEquipment(me->GetEquipmentId()); + + if (pInstance && pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER)) + { + Unit *victim = NULL; + victim = Unit::GetUnit(*me, pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER)); + if (victim) + me->getThreatManager().addThreat(victim, 1); + StartEvent(); + } + } + else if (AliveChannelers != 0 && !me->HasAura(AURA_BANISH)) + { + // channelers != 0 apply banish aura + // removing Leotheras banish immune to apply AURA_BANISH + me->ApplySpellImmune(AURA_BANISH, IMMUNITY_MECHANIC, MECHANIC_BANISH, false); + DoCast(me, AURA_BANISH); + + // changing model + me->SetDisplayId(MODEL_DEMON); + + // and removing weapons + me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID , 0); + me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0); + } + } + + //Despawn all Inner Demon summoned + void DespawnDemon() + { + for (uint8 i=0; i<5; ++i) + { + if (InnderDemon[i]) + { + //delete creature + Creature* pCreature = Unit::GetCreature((*me), InnderDemon[i]); + if (pCreature && pCreature->isAlive()) + { + pCreature->ForcedDespawn(); + } + InnderDemon[i] = 0; + } + } + + InnerDemon_Count = 0; + } + + void CastConsumingMadness() //remove this once SPELL_INSIDIOUS_WHISPER is supported by core + { + for (uint8 i=0; i<5; ++i) + { + if (InnderDemon[i] > 0) + { + Creature* pUnit = Unit::GetCreature((*me), InnderDemon[i]); + if (pUnit && pUnit->isAlive()) + { + Unit* pUnit_pTarget = Unit::GetUnit(*pUnit, CAST_AI(mob_inner_demonAI, pUnit->AI())->victimGUID); + if (pUnit_pTarget && pUnit_pTarget->isAlive()) + { + pUnit->CastSpell(pUnit_pTarget, SPELL_CONSUMING_MADNESS, true); + DoModifyThreatPercent(pUnit_pTarget, -100); + } + } + } + } + } + + void KilledUnit(Unit * victim) + { + if (victim->GetTypeId() != TYPEID_PLAYER) + return; + + if (DemonForm) + { + DoScriptText(RAND(SAY_DEMON_SLAY1,SAY_DEMON_SLAY2,SAY_DEMON_SLAY3), me); + } + else + { + DoScriptText(RAND(SAY_NIGHTELF_SLAY1,SAY_NIGHTELF_SLAY2,SAY_NIGHTELF_SLAY3), me); + } + } + + void JustDied(Unit * /*victim*/) + { + DoScriptText(SAY_DEATH, me); + + //despawn copy + if (Demon) + { + if (Creature* pDemon = Unit::GetCreature(*me, Demon)) + pDemon->ForcedDespawn(); + } + if (pInstance) + pInstance->SetData(DATA_LEOTHERASTHEBLINDEVENT, DONE); + } + + void EnterCombat(Unit * /*who*/) + { + if (me->HasAura(AURA_BANISH)) + return; + + me->LoadEquipment(me->GetEquipmentId()); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (me->HasAura(AURA_BANISH) || !UpdateVictim()) + { + if (BanishTimer <= diff) + { + CheckBanish();//no need to check every update tick + BanishTimer = 1000; + } else BanishTimer -= diff; + return; + } + if (me->HasAura(SPELL_WHIRLWIND)) + if (Whirlwind_Timer <= diff) + { + Unit *newTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (newTarget) + { + DoResetThreat(); + me->GetMotionMaster()->Clear(); + me->GetMotionMaster()->MovePoint(0,newTarget->GetPositionX(),newTarget->GetPositionY(),newTarget->GetPositionZ()); + } + Whirlwind_Timer = 2000; + } else Whirlwind_Timer -= diff; + + // reseting after changing forms and after ending whirlwind + if (NeedThreatReset && !me->HasAura(SPELL_WHIRLWIND)) + { + // when changing forms seting timers (or when ending whirlwind - to avoid adding new variable i use Whirlwind_Timer to countdown 2s while whirlwinding) + if (DemonForm) + InnerDemons_Timer = 30000; + else + Whirlwind_Timer = 15000; + + NeedThreatReset = false; + DoResetThreat(); + me->GetMotionMaster()->Clear(); + me->GetMotionMaster()->MoveChase(me->getVictim()); + } + + //Enrage_Timer (10 min) + if (Berserk_Timer < diff && !EnrageUsed) + { + me->InterruptNonMeleeSpells(false); + DoCast(me, SPELL_BERSERK); + EnrageUsed = true; + } else Berserk_Timer -= diff; + + if (!DemonForm) + { + //Whirldind Timer + if (!me->HasAura(SPELL_WHIRLWIND)) + { + if (Whirlwind_Timer <= diff) + { + DoCast(me, SPELL_WHIRLWIND); + // while whirlwinding this variable is used to countdown target's change + Whirlwind_Timer = 2000; + NeedThreatReset = true; + } else Whirlwind_Timer -= diff; + } + //Switch_Timer + + if (!IsFinalForm) + if (SwitchToDemon_Timer <= diff) + { + //switch to demon form + me->RemoveAurasDueToSpell(SPELL_WHIRLWIND,0); + me->SetDisplayId(MODEL_DEMON); + DoScriptText(SAY_SWITCH_TO_DEMON, me); + me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID , 0); + me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0); + DemonForm = true; + NeedThreatReset = true; + SwitchToDemon_Timer = 45000; + } else SwitchToDemon_Timer -= diff; + DoMeleeAttackIfReady(); + } + else + { + //ChaosBlast_Timer + if (!me->getVictim()) + return; + if (me->IsWithinDist(me->getVictim(), 30)) + me->StopMoving(); + if (ChaosBlast_Timer <= diff) + { + // will cast only when in range of spell + if (me->IsWithinDist(me->getVictim(), 30)) + { + //DoCast(me->getVictim(), SPELL_CHAOS_BLAST, true); + int damage = 100; + me->CastCustomSpell(me->getVictim(), SPELL_CHAOS_BLAST, &damage, NULL, NULL, false, NULL, NULL, me->GetGUID()); + } + ChaosBlast_Timer = 3000; + } else ChaosBlast_Timer -= diff; + //Summon Inner Demon + if (InnerDemons_Timer <= diff) + { + std::list& ThreatList = me->getThreatManager().getThreatList(); + std::vector TargetList; + for (std::list::const_iterator itr = ThreatList.begin(); itr != ThreatList.end(); ++itr) + { + Unit *tempTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid()); + if (tempTarget && tempTarget->GetTypeId() == TYPEID_PLAYER && tempTarget->GetGUID() != me->getVictim()->GetGUID() && TargetList.size()<5) + TargetList.push_back(tempTarget); + } + //SpellEntry *spell = GET_SPELL(SPELL_INSIDIOUS_WHISPER); + for (std::vector::const_iterator itr = TargetList.begin(); itr != TargetList.end(); ++itr) + { + if ((*itr) && (*itr)->isAlive()) + { + Creature * demon = me->SummonCreature(INNER_DEMON_ID, (*itr)->GetPositionX()+10, (*itr)->GetPositionY()+10, (*itr)->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + if (demon) + { + demon->AI()->AttackStart((*itr)); + CAST_AI(mob_inner_demonAI, demon->AI())->victimGUID = (*itr)->GetGUID(); + + (*itr)->AddAura(SPELL_INSIDIOUS_WHISPER, *itr); + + if (InnerDemon_Count > 4) + InnerDemon_Count = 0; + + //Safe storing of creatures + InnderDemon[InnerDemon_Count] = demon->GetGUID(); + + //Update demon count + ++InnerDemon_Count; + } + } + } + DoScriptText(SAY_INNER_DEMONS, me); + + InnerDemons_Timer = 999999; + } else InnerDemons_Timer -= diff; + + //Switch_Timer + if (SwitchToHuman_Timer <= diff) + { + //switch to nightelf form + me->SetDisplayId(MODEL_NIGHTELF); + me->LoadEquipment(me->GetEquipmentId()); + + CastConsumingMadness(); + DespawnDemon(); + + DemonForm = false; + NeedThreatReset = true; + + SwitchToHuman_Timer = 60000; + } else SwitchToHuman_Timer -= diff; + } + + if (!IsFinalForm && (me->GetHealth()*100 / me->GetMaxHealth()) < 15) + { + //at this point he divides himself in two parts + CastConsumingMadness(); + DespawnDemon(); + Creature *Copy = NULL; + Copy = DoSpawnCreature(DEMON_FORM, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 6000); + if (Copy) + { + Demon = Copy->GetGUID(); + if (me->getVictim()) + Copy->AI()->AttackStart(me->getVictim()); + } + //set nightelf final form + IsFinalForm = true; + DemonForm = false; + + DoScriptText(SAY_FINAL_FORM, me); + me->SetDisplayId(MODEL_NIGHTELF); + me->LoadEquipment(me->GetEquipmentId()); + } + } +}; + +//Leotheras the Blind Demon Form AI +struct boss_leotheras_the_blind_demonformAI : public ScriptedAI +{ + boss_leotheras_the_blind_demonformAI(Creature *c) : ScriptedAI(c) {} + + uint32 ChaosBlast_Timer; + bool DealDamage; + + void Reset() + { + ChaosBlast_Timer = 1000; + DealDamage = true; + } + + void StartEvent() + { + DoScriptText(SAY_FREE, me); + } + + void KilledUnit(Unit * victim) + { + if (victim->GetTypeId() != TYPEID_PLAYER) + return; + + DoScriptText(RAND(SAY_DEMON_SLAY1,SAY_DEMON_SLAY2,SAY_DEMON_SLAY3), me); + } + + void JustDied(Unit * /*victim*/) + { + //invisibility (blizzlike, at the end of the fight he doesn't die, he disappears) + DoCast(me, 8149, true); + } + + void EnterCombat(Unit * /*who*/) + { + StartEvent(); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + //ChaosBlast_Timer + if (me->IsWithinDist(me->getVictim(), 30)) + me->StopMoving(); + + if (ChaosBlast_Timer <= diff) + { + // will cast only when in range od spell + if (me->IsWithinDist(me->getVictim(), 30)) + { + //DoCast(me->getVictim(), SPELL_CHAOS_BLAST, true); + int damage = 100; + me->CastCustomSpell(me->getVictim(), SPELL_CHAOS_BLAST, &damage, NULL, NULL, false, NULL, NULL, me->GetGUID()); + ChaosBlast_Timer = 3000; + } + } else ChaosBlast_Timer -= diff; + + //Do NOT deal any melee damage to the target. + } +}; +struct mob_greyheart_spellbinderAI : public ScriptedAI +{ + mob_greyheart_spellbinderAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + leotherasGUID = 0; + AddedBanish = false; + } + + ScriptedInstance *pInstance; + + uint64 leotherasGUID; + + uint32 Mindblast_Timer; + uint32 Earthshock_Timer; + + bool AddedBanish; + + void Reset() + { + Mindblast_Timer = 3000 + rand()%5000; + Earthshock_Timer = 5000 + rand()%5000; + + if (pInstance) + { + pInstance->SetData64(DATA_LEOTHERAS_EVENT_STARTER, 0); + Creature *leotheras = Unit::GetCreature(*me, leotherasGUID); + if (leotheras && leotheras->isAlive()) + CAST_AI(boss_leotheras_the_blindAI, leotheras->AI())->CheckChannelers(/*false*/); + } + } + + void EnterCombat(Unit * who) + { + me->InterruptNonMeleeSpells(false); + if (pInstance) + pInstance->SetData64(DATA_LEOTHERAS_EVENT_STARTER, who->GetGUID()); + } + + void JustRespawned() + { + AddedBanish = false; + Reset(); + } + + void CastChanneling() + { + if (!me->isInCombat() && !me->GetCurrentSpell(CURRENT_CHANNELED_SPELL)) + { + if (leotherasGUID) + { + Creature *leotheras = Unit::GetCreature(*me, leotherasGUID); + if (leotheras && leotheras->isAlive()) + DoCast(leotheras, BANISH_BEAM); + } + } + } + + void UpdateAI(const uint32 diff) + { + if (pInstance) + { + if (!leotherasGUID) + leotherasGUID = pInstance->GetData64(DATA_LEOTHERAS); + + if (!me->isInCombat() && pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER)) + { + Unit *victim = NULL; + victim = Unit::GetUnit(*me, pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER)); + if (victim) + AttackStart(victim); + } + } + + if (!UpdateVictim()) + { + CastChanneling(); + return; + } + + if (pInstance && !pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER)) + { + EnterEvadeMode(); + return; + } + + if (Mindblast_Timer <= diff) + { + Unit *pTarget = NULL; + pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); + + if (pTarget)DoCast(pTarget, SPELL_MINDBLAST); + + Mindblast_Timer = 10000 + rand()%5000; + } else Mindblast_Timer -= diff; + + if (Earthshock_Timer <= diff) + { + Map* pMap = me->GetMap(); + Map::PlayerList const &PlayerList = pMap->GetPlayers(); + for (Map::PlayerList::const_iterator itr = PlayerList.begin(); itr != PlayerList.end(); ++itr) + { + if (Player* i_pl = itr->getSource()) + { + bool isCasting = false; + for (uint8 i = 0; i < CURRENT_MAX_SPELL; ++i) + if (i_pl->GetCurrentSpell(i)) + isCasting = true; + + if (isCasting) + { + DoCast(i_pl, SPELL_EARTHSHOCK); + break; + } + } + } + Earthshock_Timer = 8000 + rand()%7000; + } else Earthshock_Timer -= diff; + DoMeleeAttackIfReady(); + } + + void JustDied(Unit * /*killer*/) {} +}; +CreatureAI* GetAI_boss_leotheras_the_blind(Creature* pCreature) +{ + return new boss_leotheras_the_blindAI (pCreature); +} + +CreatureAI* GetAI_boss_leotheras_the_blind_demonform(Creature* pCreature) +{ + return new boss_leotheras_the_blind_demonformAI (pCreature); +} + +CreatureAI* GetAI_mob_greyheart_spellbinder(Creature* pCreature) +{ + return new mob_greyheart_spellbinderAI (pCreature); +} + +CreatureAI* GetAI_mob_inner_demon(Creature* pCreature) +{ + return new mob_inner_demonAI (pCreature); +} +void AddSC_boss_leotheras_the_blind() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_leotheras_the_blind"; + newscript->GetAI = &GetAI_boss_leotheras_the_blind; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_leotheras_the_blind_demonform"; + newscript->GetAI = &GetAI_boss_leotheras_the_blind_demonform; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_greyheart_spellbinder"; + newscript->GetAI = &GetAI_mob_greyheart_spellbinder; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_inner_demon"; + newscript->GetAI = &GetAI_mob_inner_demon; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/Outland/CoilfangReservoir/serpent_shrine/boss_lurker_below.cpp b/src/server/scripts/Outland/CoilfangReservoir/serpent_shrine/boss_lurker_below.cpp new file mode 100644 index 00000000000..b1c0c10bcce --- /dev/null +++ b/src/server/scripts/Outland/CoilfangReservoir/serpent_shrine/boss_lurker_below.cpp @@ -0,0 +1,458 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: boss_the_lurker_below +SD%Complete: 80 +SDComment: Coilfang Frenzy, find out how could we fishing in the strangepool +SDCategory: The Lurker Below +EndScriptData */ + +#include "ScriptedPch.h" +#include "serpent_shrine.h" +#include "ScriptedSimpleAI.h" +#include "Spell.h" + +#define SPELL_SPOUT 37433 +#define SPELL_SPOUT_ANIM 42835 +#define SPELL_SPOUT_BREATH 37431 +#define SPELL_KNOCKBACK 19813 +#define SPELL_GEYSER 37478 +#define SPELL_WHIRL 37660 +#define SPELL_WATERBOLT 37138 +#define SPELL_SUBMERGE 37550 +#define SPELL_EMERGE 20568 + +#define EMOTE_SPOUT "The Lurker Below takes a deep breath." + +#define SPOUT_DIST 100 + +#define MOB_COILFANG_GUARDIAN 21873 +#define MOB_COILFANG_AMBUSHER 21865 + +//Ambusher spells +#define SPELL_SPREAD_SHOT 37790 +#define SPELL_SHOOT 37770 + +//Guardian spells +#define SPELL_ARCINGSMASH 38761 // Wrong SpellId. Can't find the right one. +#define SPELL_HAMSTRING 26211 + +float AddPos[9][3] = +{ + {2.8553810, -459.823914, -19.182686}, //MOVE_AMBUSHER_1 X, Y, Z + {12.400000, -466.042267, -19.182686}, //MOVE_AMBUSHER_2 X, Y, Z + {51.366653, -460.836060, -19.182686}, //MOVE_AMBUSHER_3 X, Y, Z + {62.597980, -457.433044, -19.182686}, //MOVE_AMBUSHER_4 X, Y, Z + {77.607452, -384.302765, -19.182686}, //MOVE_AMBUSHER_5 X, Y, Z + {63.897900, -378.984924, -19.182686}, //MOVE_AMBUSHER_6 X, Y, Z + {34.447250, -387.333618, -19.182686}, //MOVE_GUARDIAN_1 X, Y, Z + {14.388216, -423.468018, -19.625271}, //MOVE_GUARDIAN_2 X, Y, Z + {42.471519, -445.115295, -19.769423} //MOVE_GUARDIAN_3 X, Y, Z +}; + +struct boss_the_lurker_belowAI : public Scripted_NoMovementAI +{ + boss_the_lurker_belowAI(Creature *c) : Scripted_NoMovementAI(c), Summons(me) + { + pInstance = c->GetInstanceData(); + SpellEntry *TempSpell = GET_SPELL(SPELL_SPOUT_ANIM); + if (TempSpell) + { + TempSpell->Effect[0] = 0;//remove all spell effect, only anim is needed + TempSpell->Effect[1] = 0; + TempSpell->Effect[2] = 0; + } + } + + ScriptedInstance* pInstance; + SummonList Summons; + + bool Spawned; + bool Submerged; + bool InRange; + bool CanStartEvent; + uint32 RotTimer; + uint32 SpoutAnimTimer; + uint32 WaterboltTimer; + uint32 SpoutTimer; + uint32 WhirlTimer; + uint32 PhaseTimer; + uint32 GeyserTimer; + uint32 CheckTimer; + uint32 WaitTimer; + uint32 WaitTimer2; + + bool CheckCanStart()//check if players fished + { + if (pInstance && pInstance->GetData(DATA_STRANGE_POOL) == NOT_STARTED) + return false; + return true; + } + void Reset() + { + me->AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_LEVITATING); + SpoutAnimTimer = 1000; + RotTimer = 0; + WaterboltTimer = 15000;//give time to get in range when fight starts + SpoutTimer = 45000; + WhirlTimer = 18000;//after avery spout + PhaseTimer = 120000; + GeyserTimer = rand()%5000 + 15000; + CheckTimer = 15000;//give time to get in range when fight starts + WaitTimer = 60000;//never reached + WaitTimer2 = 60000;//never reached + + Submerged = true;//will be false at combat start + Spawned = false; + InRange = false; + CanStartEvent = false; + + Summons.DespawnAll(); + + if (pInstance) + { + pInstance->SetData(DATA_THELURKERBELOWEVENT, NOT_STARTED); + pInstance->SetData(DATA_STRANGE_POOL, NOT_STARTED); + } + DoCast(me, SPELL_SUBMERGE);//submerge anim + me->SetVisibility(VISIBILITY_OFF);//we start invis under water, submerged + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + } + + void JustDied(Unit* /*Killer*/) + { + if (pInstance) + pInstance->SetData(DATA_THELURKERBELOWEVENT, DONE); + + Summons.DespawnAll(); + } + + void EnterCombat(Unit * who) + { + if (pInstance) + pInstance->SetData(DATA_THELURKERBELOWEVENT, IN_PROGRESS); + Scripted_NoMovementAI::EnterCombat(who); + } + + void MoveInLineOfSight(Unit *who) + { + if (!CanStartEvent)//boss is invisible, don't attack + return; + if (!me->getVictim() && who->isTargetableForAttack() && (me->IsHostileTo(who))) + { + float attackRadius = me->GetAttackDistance(who); + if (me->IsWithinDistInMap(who, attackRadius)) + { + AttackStart(who); + } + } + } + + void MovementInform(uint32 type, uint32 /*id*/) + { + if (type == ROTATE_MOTION_TYPE) + me->SetReactState(REACT_AGGRESSIVE); + } + + void UpdateAI(const uint32 diff) + { + if (!CanStartEvent)//boss is invisible, don't attack + { + if (CheckCanStart()) + { + if (Submerged) + { + me->SetVisibility(VISIBILITY_ON); + Submerged = false; + WaitTimer2 = 500; + } + if (!Submerged && WaitTimer2 <= diff)//wait 500ms before emerge anim + { + me->RemoveAllAuras(); + me->RemoveFlag(UNIT_NPC_EMOTESTATE,EMOTE_STATE_SUBMERGED); + DoCast(me, SPELL_EMERGE, false); + WaitTimer2 = 60000;//never reached + WaitTimer = 3000; + } else WaitTimer2 -= diff; + + if (WaitTimer <= diff)//wait 3secs for emerge anim, then attack + { + WaitTimer = 3000; + CanStartEvent=true;//fresh fished from pool + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + } else WaitTimer -= diff; + } + return; + } + + if (me->getThreatManager().getThreatList().empty())//check if should evade + { + if (me->isInCombat()) + EnterEvadeMode(); + return; + } + if (!Submerged) + { + if (PhaseTimer <= diff) + { + me->InterruptNonMeleeSpells(false); + DoCast(me, SPELL_SUBMERGE); + PhaseTimer = 60000;//60secs submerged + Submerged = true; + } else PhaseTimer-=diff; + + if (SpoutTimer <= diff) + { + me->MonsterTextEmote(EMOTE_SPOUT,0,true); + me->SetReactState(REACT_PASSIVE); + me->GetMotionMaster()->MoveRotate(20000, rand()%2 ? ROTATE_DIRECTION_LEFT : ROTATE_DIRECTION_RIGHT); + SpoutTimer = 45000; + WhirlTimer = 20000;//whirl directly after spout + RotTimer = 20000; + return; + } else SpoutTimer -= diff; + + //Whirl directly after a Spout and at random times + if (WhirlTimer <= diff) + { + WhirlTimer = 18000; + DoCast(me, SPELL_WHIRL); + } else WhirlTimer -= diff; + + if (CheckTimer <= diff)//check if there are players in melee range + { + InRange = false; + Map* pMap = me->GetMap(); + Map::PlayerList const &PlayerList = pMap->GetPlayers(); + if (!PlayerList.isEmpty()) + { + for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) + { + if (me->IsWithinMeleeRange(i->getSource())) + InRange = true; + } + } + CheckTimer = 2000; + } else CheckTimer -= diff; + + if (RotTimer) + { + Map* pMap = me->GetMap(); + if (pMap->IsDungeon()) + { + Map::PlayerList const &PlayerList = pMap->GetPlayers(); + for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) + { + if (i->getSource() && i->getSource()->isAlive() && me->HasInArc((double)diff/20000*(double)M_PI*2,i->getSource()) && me->IsWithinDist(i->getSource(), SPOUT_DIST) && !i->getSource()->IsInWater()) + DoCast(i->getSource(), SPELL_SPOUT, true);//only knock back palyers in arc, in 100yards, not in water + } + } + + if (SpoutAnimTimer <= diff) + { + DoCast(me, SPELL_SPOUT_ANIM, true); + SpoutAnimTimer = 1000; + } else SpoutAnimTimer -= diff; + + if (RotTimer <= diff) + { + RotTimer = 0; + } else RotTimer -= diff; + return; + } + + if (GeyserTimer <= diff) + { + Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1); + if (!pTarget && me->getVictim()) + pTarget = me->getVictim(); + if (pTarget) + DoCast(pTarget, SPELL_GEYSER, true); + GeyserTimer = rand()%5000 + 15000; + } else GeyserTimer -= diff; + + if (!InRange)//if on players in melee range cast Waterbolt + { + if (WaterboltTimer <= diff) + { + Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); + if (!pTarget && me->getVictim()) + pTarget = me->getVictim(); + if (pTarget) + DoCast(pTarget, SPELL_WATERBOLT, true); + WaterboltTimer = 3000; + } else WaterboltTimer -= diff; + } + + if (!UpdateCombatState()) + return; + + DoMeleeAttackIfReady(); + + }else//submerged + { + if (PhaseTimer <= diff) + { + Submerged = false; + me->InterruptNonMeleeSpells(false);//shouldn't be any + me->RemoveAllAuras(); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->RemoveFlag(UNIT_NPC_EMOTESTATE,EMOTE_STATE_SUBMERGED); + DoCast(me, SPELL_EMERGE, true); + Spawned = false; + SpoutTimer = 3000; // directly cast Spout after emerging! + PhaseTimer = 120000; + return; + } else PhaseTimer-=diff; + + if (me->getThreatManager().getThreatList().empty())//check if should evade + { + EnterEvadeMode(); + return; + } + if (!me->isInCombat()) + DoZoneInCombat(); + + if (!Spawned) + { + me->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + //spawn adds + for (uint8 i = 0; i < 9; ++i) + { + Creature* Summoned; + if (i < 6) + Summoned = me->SummonCreature(MOB_COILFANG_AMBUSHER,AddPos[i][0],AddPos[i][1],AddPos[i][2], 0, TEMPSUMMON_CORPSE_DESPAWN, 0); + else Summoned = me->SummonCreature(MOB_COILFANG_GUARDIAN,AddPos[i][0],AddPos[i][1],AddPos[i][2], 0, TEMPSUMMON_CORPSE_DESPAWN, 0); + + if (Summoned) + Summons.Summon(Summoned); + } + Spawned = true; + } + } + } + }; + +CreatureAI* GetAI_mob_coilfang_guardian(Creature* pCreature) +{ + SimpleAI* ai = new SimpleAI (pCreature); + + ai->Spell[0].Enabled = true; + ai->Spell[0].Spell_Id = SPELL_ARCINGSMASH; + ai->Spell[0].Cooldown = 15000; + ai->Spell[0].First_Cast = 5000; + ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_TARGET; + + ai->Spell[1].Enabled = true; + ai->Spell[1].Spell_Id = SPELL_HAMSTRING; + ai->Spell[1].Cooldown = 10000; + ai->Spell[1].First_Cast = 2000; + ai->Spell[1].Cast_Target_Type = CAST_HOSTILE_TARGET; + + return ai; +} + +struct mob_coilfang_ambusherAI : public Scripted_NoMovementAI +{ + mob_coilfang_ambusherAI(Creature *c) : Scripted_NoMovementAI(c) + { + SpellEntry *TempSpell = GET_SPELL(SPELL_SHOOT); + if (TempSpell) + TempSpell->Effect[0] = 2;//change spell effect from weapon % dmg to simple phisical dmg + } + + uint32 MultiShotTimer; + uint32 ShootBowTimer; + + void Reset() + { + MultiShotTimer = 10000; + ShootBowTimer = 4000; + + } + + void EnterCombat(Unit * /*who*/) + { + + } + + void MoveInLineOfSight(Unit *who) + { + if (!who || me->getVictim()) return; + + if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(me) && me->IsHostileTo(who) && me->IsWithinDistInMap(who, 45)) + { + AttackStart(who); + } + } + + void UpdateAI(const uint32 diff) + { + if (MultiShotTimer <= diff) + { + if (me->getVictim()) + DoCast(me->getVictim(), SPELL_SPREAD_SHOT, true); + + MultiShotTimer = 10000+rand()%10000; + ShootBowTimer += 1500;//add global cooldown + } else MultiShotTimer -= diff; + + if (ShootBowTimer <= diff) + { + Unit *pTarget = NULL; + pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + int bp0 = 1100; + if (pTarget) + me->CastCustomSpell(pTarget,SPELL_SHOOT,&bp0,NULL,NULL,true); + ShootBowTimer = 4000+rand()%5000; + MultiShotTimer += 1500;//add global cooldown + } else ShootBowTimer -= diff; + } +}; + +CreatureAI* GetAI_mob_coilfang_ambusher(Creature* pCreature) +{ + return new mob_coilfang_ambusherAI (pCreature); +} + +CreatureAI* GetAI_boss_the_lurker_below(Creature* pCreature) +{ + return new boss_the_lurker_belowAI (pCreature); +} + +void AddSC_boss_the_lurker_below() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_the_lurker_below"; + newscript->GetAI = &GetAI_boss_the_lurker_below; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_coilfang_guardian"; + newscript->GetAI = &GetAI_mob_coilfang_guardian; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_coilfang_ambusher"; + newscript->GetAI = &GetAI_mob_coilfang_ambusher; + newscript->RegisterSelf(); +} + + diff --git a/src/server/scripts/Outland/CoilfangReservoir/serpent_shrine/boss_morogrim_tidewalker.cpp b/src/server/scripts/Outland/CoilfangReservoir/serpent_shrine/boss_morogrim_tidewalker.cpp new file mode 100644 index 00000000000..14c87aee141 --- /dev/null +++ b/src/server/scripts/Outland/CoilfangReservoir/serpent_shrine/boss_morogrim_tidewalker.cpp @@ -0,0 +1,369 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/* ScriptData +SDName: Boss_Morogrim_Tidewalker +SD%Complete: 90 +SDComment: Water globules don't explode properly, remove hacks +SDCategory: Coilfang Resevoir, Serpent Shrine Cavern +EndScriptData */ + +#include "ScriptedPch.h" +#include "serpent_shrine.h" + +#define SAY_AGGRO -1548030 +#define SAY_SUMMON1 -1548031 +#define SAY_SUMMON2 -1548032 +#define SAY_SUMMON_BUBL1 -1548033 +#define SAY_SUMMON_BUBL2 -1548034 +#define SAY_SLAY1 -1548035 +#define SAY_SLAY2 -1548036 +#define SAY_SLAY3 -1548037 +#define SAY_DEATH -1548038 +#define EMOTE_WATERY_GRAVE -1548039 +#define EMOTE_EARTHQUAKE -1548040 +#define EMOTE_WATERY_GLOBULES -1548041 + +#define SPELL_TIDAL_WAVE 37730 +#define SPELL_WATERY_GRAVE 38049 +#define SPELL_EARTHQUAKE 37764 +#define SPELL_WATERY_GRAVE_EXPLOSION 37852 + +#define WATERY_GRAVE_X1 334.64 +#define WATERY_GRAVE_Y1 -728.89 +#define WATERY_GRAVE_Z1 -14.42 +#define WATERY_GRAVE_X2 365.51 +#define WATERY_GRAVE_Y2 -737.14 +#define WATERY_GRAVE_Z2 -14.44 +#define WATERY_GRAVE_X3 366.19 +#define WATERY_GRAVE_Y3 -709.59 +#define WATERY_GRAVE_Z3 -14.36 +#define WATERY_GRAVE_X4 372.93 +#define WATERY_GRAVE_Y4 -690.96 +#define WATERY_GRAVE_Z4 -14.44 + +#define SPELL_WATERY_GRAVE_1 38023 +#define SPELL_WATERY_GRAVE_2 38024 +#define SPELL_WATERY_GRAVE_3 38025 +#define SPELL_WATERY_GRAVE_4 37850 + +#define SPELL_SUMMON_WATER_GLOBULE_1 37854 +#define SPELL_SUMMON_WATER_GLOBULE_2 37858 +#define SPELL_SUMMON_WATER_GLOBULE_3 37860 +#define SPELL_SUMMON_WATER_GLOBULE_4 37861 + +/*#define SPELL_SUMMON_MURLOC_A6 39813 +#define SPELL_SUMMON_MURLOC_A7 39814 +#define SPELL_SUMMON_MURLOC_A8 39815 +#define SPELL_SUMMON_MURLOC_A9 39816 +#define SPELL_SUMMON_MURLOC_A10 39817 + +#define SPELL_SUMMON_MURLOC_B6 39818 +#define SPELL_SUMMON_MURLOC_B7 39819 +#define SPELL_SUMMON_MURLOC_B8 39820 +#define SPELL_SUMMON_MURLOC_B9 39821 +#define SPELL_SUMMON_MURLOC_B10 39822*/ + +float MurlocCords[10][5] = +{ + {21920, 424.36, -715.4, -7.14, 0.124}, + {21920, 425.13, -719.3, -7.14, 0.124}, + {21920, 425.05, -724.23, -7.14, 0.124}, + {21920, 424.91, -728.68, -7.14, 0.124}, + {21920, 424.84, -732.18, -7.14, 0.124}, + {21920, 321.05, -734.2, -13.15, 0.124}, + {21920, 321.05, -729.4, -13.15, 0.124}, + {21920, 321.05, -724.03, -13.15, 0.124}, + {21920, 321.05, -718.73, -13.15, 0.124}, + {21920, 321.05, -714.24, -13.15, 0.124} +}; + +//Creatures +#define WATER_GLOBULE 21913 +#define TIDEWALKER_LURKER 21920 + +//Morogrim Tidewalker AI +struct boss_morogrim_tidewalkerAI : public ScriptedAI +{ + boss_morogrim_tidewalkerAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + Map::PlayerList const *PlayerList; + + uint32 TidalWave_Timer; + uint32 WateryGrave_Timer; + uint32 Earthquake_Timer; + uint32 WateryGlobules_Timer; + uint32 globulespell[4]; + int8 Playercount; + int8 counter; + + bool Earthquake; + bool Phase2; + + void Reset() + { + TidalWave_Timer = 10000; + WateryGrave_Timer = 30000; + Earthquake_Timer = 40000; + WateryGlobules_Timer = 0; + globulespell[0] = SPELL_SUMMON_WATER_GLOBULE_1; + globulespell[1] = SPELL_SUMMON_WATER_GLOBULE_2; + globulespell[2] = SPELL_SUMMON_WATER_GLOBULE_3; + globulespell[3] = SPELL_SUMMON_WATER_GLOBULE_4; + + Earthquake = false; + Phase2 = false; + + if (pInstance) + pInstance->SetData(DATA_MOROGRIMTIDEWALKEREVENT, NOT_STARTED); + } + + void StartEvent() + { + DoScriptText(SAY_AGGRO, me); + + if (pInstance) + pInstance->SetData(DATA_MOROGRIMTIDEWALKEREVENT, IN_PROGRESS); + } + + void KilledUnit(Unit * /*victim*/) + { + DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), me); + } + + void JustDied(Unit * /*victim*/) + { + DoScriptText(SAY_DEATH, me); + + if (pInstance) + pInstance->SetData(DATA_MOROGRIMTIDEWALKEREVENT, DONE); + } + + void EnterCombat(Unit * /*who*/) + { + PlayerList = &me->GetMap()->GetPlayers(); + Playercount = PlayerList->getSize(); + StartEvent(); + } + + void ApplyWateryGrave(Unit* pPlayer, uint8 i) + { + switch(i) + { + case 0: pPlayer->CastSpell(pPlayer, SPELL_WATERY_GRAVE_1, true); break; + case 1: pPlayer->CastSpell(pPlayer, SPELL_WATERY_GRAVE_2, true); break; + case 2: pPlayer->CastSpell(pPlayer, SPELL_WATERY_GRAVE_3, true); break; + case 3: pPlayer->CastSpell(pPlayer, SPELL_WATERY_GRAVE_4, true); break; + } + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //Earthquake_Timer + if (Earthquake_Timer <= diff) + { + if (!Earthquake) + { + DoCast(me->getVictim(), SPELL_EARTHQUAKE); + Earthquake = true; + Earthquake_Timer = 10000; + } + else + { + DoScriptText(RAND(SAY_SUMMON1,SAY_SUMMON2), me); + + for (uint8 i = 0; i < 10; ++i) + { + Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + Creature* Murloc = me->SummonCreature(MurlocCords[i][0],MurlocCords[i][1],MurlocCords[i][2],MurlocCords[i][3],MurlocCords[i][4], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); + if (pTarget && Murloc) + Murloc->AI()->AttackStart(pTarget); + } + DoScriptText(EMOTE_EARTHQUAKE, me); + Earthquake = false; + Earthquake_Timer = 40000+rand()%5000; + } + } else Earthquake_Timer -= diff; + + //TidalWave_Timer + if (TidalWave_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_TIDAL_WAVE); + TidalWave_Timer = 20000; + } else TidalWave_Timer -= diff; + + if (!Phase2) + { + //WateryGrave_Timer + if (WateryGrave_Timer <= diff) + { + //Teleport 4 players under the waterfalls + Unit *pTarget; + using std::set; + setlist; + set::const_iterator itr; + for (uint8 i = 0; i < 4; ++i) + { + counter = 0; + do + { + pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 50, true); //target players only + if (counter < Playercount) + break; + if (pTarget) + itr = list.find(pTarget->GetGUID()); + ++counter; + } while (itr != list.end()); + + if (pTarget) + { + list.insert(pTarget->GetGUID()); + ApplyWateryGrave(pTarget, i); + } + } + + DoScriptText(RAND(SAY_SUMMON_BUBL1,SAY_SUMMON_BUBL2), me); + + DoScriptText(EMOTE_WATERY_GRAVE, me); + WateryGrave_Timer = 30000; + } else WateryGrave_Timer -= diff; + + //Start Phase2 + if ((me->GetHealth()*100 / me->GetMaxHealth()) < 25) + Phase2 = true; + } + else + { + //WateryGlobules_Timer + if (WateryGlobules_Timer <= diff) + { + Unit* pGlobuleTarget; + using std::set; + setglobulelist; + set::const_iterator itr; + for (uint8 g = 0; g < 4; g++) //one unit can't cast more than one spell per update, so some players have to cast for us XD + { + counter = 0; + do { + pGlobuleTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 50, true); + if (pGlobuleTarget) + itr = globulelist.find(pGlobuleTarget->GetGUID()); + if (counter > Playercount) + break; + ++counter; + } while (itr != globulelist.end()); + if (pGlobuleTarget) + globulelist.insert(pGlobuleTarget->GetGUID()); + pGlobuleTarget->CastSpell(pGlobuleTarget, globulespell[g], true); + } + DoScriptText(EMOTE_WATERY_GLOBULES, me); + WateryGlobules_Timer = 25000; + } else WateryGlobules_Timer -= diff; + } + + DoMeleeAttackIfReady(); + } +}; + +//Water Globule AI +#define SPELL_GLOBULE_EXPLOSION 37871 + +struct mob_water_globuleAI : public ScriptedAI +{ + mob_water_globuleAI(Creature *c) : ScriptedAI(c) {} + + uint32 Check_Timer; + + void Reset() + { + Check_Timer = 1000; + + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->setFaction(14); + } + + void EnterCombat(Unit * /*who*/) {} + + void MoveInLineOfSight(Unit *who) + { + if (!who || me->getVictim()) + return; + + if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(me) && me->IsHostileTo(who)) + { + //no attack radius check - it attacks the first target that moves in his los + //who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); + AttackStart(who); + } + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + if (Check_Timer <= diff) + { + if (me->IsWithinDistInMap(me->getVictim(), 5)) + { + DoCast(me->getVictim(), SPELL_GLOBULE_EXPLOSION); + + //despawn + me->ForcedDespawn(); + return; + } + Check_Timer = 500; + } else Check_Timer -= diff; + + //do NOT deal any melee damage to the target. + } +}; + +CreatureAI* GetAI_boss_morogrim_tidewalker(Creature* pCreature) +{ + return new boss_morogrim_tidewalkerAI (pCreature); +} +CreatureAI* GetAI_mob_water_globule(Creature* pCreature) +{ + return new mob_water_globuleAI (pCreature); +} + +void AddSC_boss_morogrim_tidewalker() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_morogrim_tidewalker"; + newscript->GetAI = &GetAI_boss_morogrim_tidewalker; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_water_globule"; + newscript->GetAI = &GetAI_mob_water_globule; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/Outland/CoilfangReservoir/serpent_shrine/instance_serpent_shrine.cpp b/src/server/scripts/Outland/CoilfangReservoir/serpent_shrine/instance_serpent_shrine.cpp new file mode 100644 index 00000000000..c80afae15c7 --- /dev/null +++ b/src/server/scripts/Outland/CoilfangReservoir/serpent_shrine/instance_serpent_shrine.cpp @@ -0,0 +1,398 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Serpent_Shrine +SD%Complete: 100 +SDComment: Instance Data Scripts and functions to acquire mobs and set encounter status for use in various Serpent Shrine Scripts +SDCategory: Coilfang Resevoir, Serpent Shrine Cavern +EndScriptData */ + +#include "ScriptedPch.h" +#include "serpent_shrine.h" + +#define MAX_ENCOUNTER 6 +#define SPELL_SCALDINGWATER 37284 +#define MOB_COILFANG_FRENZY 21508 +#define TRASHMOB_COILFANG_PRIESTESS 21220 //6*2 +#define TRASHMOB_COILFANG_SHATTERER 21301 //6*3 + +#define MIN_KILLS 30 + +//NOTE: there are 6 platforms +//there should be 3 shatterers and 2 priestess on all platforms, total of 30 elites, else it won't work! +//delete all other elites not on platforms! these mobs should only be on those platforms nowhere else. + +/* Serpentshrine cavern encounters: +0 - Hydross The Unstable event +1 - Leotheras The Blind Event +2 - The Lurker Below Event +3 - Fathom-Lord Karathress Event +4 - Morogrim Tidewalker Event +5 - Lady Vashj Event +*/ + +bool GOHello_go_bridge_console(Player* /*pPlayer*/, GameObject* pGo) +{ + ScriptedInstance* pInstance = pGo->GetInstanceData(); + + if (!pInstance) + return false; + + if (pInstance) + pInstance->SetData(DATA_CONTROL_CONSOLE, DONE); + + return true; +} + +struct instance_serpentshrine_cavern : public ScriptedInstance +{ + instance_serpentshrine_cavern(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint64 LurkerBelow; + uint64 Sharkkis; + uint64 Tidalvess; + uint64 Caribdis; + uint64 LadyVashj; + uint64 Karathress; + uint64 KarathressEvent_Starter; + uint64 LeotherasTheBlind; + uint64 LeotherasEventStarter; + + uint64 ControlConsole; + uint64 BridgePart[3]; + uint32 StrangePool; + uint32 FishingTimer; + uint32 LurkerSubEvent; + uint32 WaterCheckTimer; + uint32 FrenzySpawnTimer; + uint32 Water; + uint32 TrashCount; + + bool ShieldGeneratorDeactivated[4]; + uint32 m_auiEncounter[MAX_ENCOUNTER]; + bool DoSpawnFrenzy; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + LurkerBelow = 0; + Sharkkis = 0; + Tidalvess = 0; + Caribdis = 0; + LadyVashj = 0; + Karathress = 0; + KarathressEvent_Starter = 0; + LeotherasTheBlind = 0; + LeotherasEventStarter = 0; + + ControlConsole = 0; + BridgePart[0] = 0; + BridgePart[1] = 0; + BridgePart[2] = 0; + StrangePool = 0; + Water = WATERSTATE_FRENZY; + + ShieldGeneratorDeactivated[0] = false; + ShieldGeneratorDeactivated[1] = false; + ShieldGeneratorDeactivated[2] = false; + ShieldGeneratorDeactivated[3] = false; + FishingTimer = 1000; + LurkerSubEvent = 0; + WaterCheckTimer = 500; + FrenzySpawnTimer = 2000; + DoSpawnFrenzy = false; + TrashCount = 0; + + } + + bool IsEncounterInProgress() const + { + for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) return true; + + return false; + } + + void Update (uint32 diff) + { + //Lurker Fishing event + if (LurkerSubEvent == LURKER_FISHING) + { + if (FishingTimer <= diff) + { + LurkerSubEvent = LURKER_HOOKED; + SetData(DATA_STRANGE_POOL, IN_PROGRESS);//just fished, signal Lurker script to emerge and start fight, we use IN_PROGRESS so it won't get saved and lurker will be alway invis at start if server restarted + } else FishingTimer -= diff; + } + //Water checks + if (WaterCheckTimer <= diff) + { + if (TrashCount >= MIN_KILLS) + Water = WATERSTATE_SCALDING; + else + Water = WATERSTATE_FRENZY; + + Map::PlayerList const &PlayerList = instance->GetPlayers(); + if (PlayerList.isEmpty()) + return; + for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) + { + if (Player* pPlayer = i->getSource()) + { + if (pPlayer->isAlive() && /*i->getSource()->GetPositionZ() <= -21.434931f*/pPlayer->IsInWater()) + { + if (Water == WATERSTATE_SCALDING) + { + + if (!pPlayer->HasAura(SPELL_SCALDINGWATER)) + { + pPlayer->CastSpell(pPlayer, SPELL_SCALDINGWATER,true); + } + } else if (Water == WATERSTATE_FRENZY) + { + //spawn frenzy + if (DoSpawnFrenzy) + { + if (Creature* frenzy = pPlayer->SummonCreature(MOB_COILFANG_FRENZY,pPlayer->GetPositionX(),pPlayer->GetPositionY(),pPlayer->GetPositionZ(),pPlayer->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,2000)) + { + frenzy->Attack(pPlayer,false); + frenzy->AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_LEVITATING); + } + DoSpawnFrenzy = false; + } + } + } + if (!pPlayer->IsInWater()) + pPlayer->RemoveAurasDueToSpell(SPELL_SCALDINGWATER); + } + + } + WaterCheckTimer = 500;//remove stress from core + } else WaterCheckTimer -= diff; + if (FrenzySpawnTimer <= diff) + { + DoSpawnFrenzy = true; + FrenzySpawnTimer = 2000; + } else FrenzySpawnTimer -= diff; + } + + void OnGameObjectCreate(GameObject* pGo, bool /*add*/) + { + switch(pGo->GetEntry()) + { + case 184568: + ControlConsole = pGo->GetGUID(); + pGo->setActive(true); + break; + + case 184203: + BridgePart[0] = pGo->GetGUID(); + pGo->setActive(true); + break; + + case 184204: + BridgePart[1] = pGo->GetGUID(); + pGo->setActive(true); + break; + + case 184205: + BridgePart[2] = pGo->GetGUID(); + pGo->setActive(true); + break; + case GAMEOBJECT_FISHINGNODE_ENTRY://no way checking if fish is hooked, so we create a timed event + if (LurkerSubEvent == LURKER_NOT_STARTED) + { + FishingTimer = 10000+rand()%30000;//random time before lurker emerges + LurkerSubEvent = LURKER_FISHING; + } + break; + } + } + + void OnCreatureCreate(Creature* pCreature, bool /*add*/) + { + switch(pCreature->GetEntry()) + { + case 21212: LadyVashj = pCreature->GetGUID(); break; + case 21214: Karathress = pCreature->GetGUID(); break; + case 21966: Sharkkis = pCreature->GetGUID(); break; + case 21217: LurkerBelow = pCreature->GetGUID(); break; + case 21965: Tidalvess = pCreature->GetGUID(); break; + case 21964: Caribdis = pCreature->GetGUID(); break; + case 21215: LeotherasTheBlind = pCreature->GetGUID(); break; + /*case TRASHMOB_COILFANG_PRIESTESS: + case TRASHMOB_COILFANG_SHATTERER: + if (pCreature->isAlive()) + ++TrashCount; + break;*/ + } + } + + void SetData64(uint32 type, uint64 data) + { + if (type == DATA_KARATHRESSEVENT_STARTER) + KarathressEvent_Starter = data; + if (type == DATA_LEOTHERAS_EVENT_STARTER) + LeotherasEventStarter = data; + } + + uint64 GetData64(uint32 identifier) + { + switch(identifier) + { + case DATA_THELURKERBELOW: return LurkerBelow; + case DATA_SHARKKIS: return Sharkkis; + case DATA_TIDALVESS: return Tidalvess; + case DATA_CARIBDIS: return Caribdis; + case DATA_LADYVASHJ: return LadyVashj; + case DATA_KARATHRESS: return Karathress; + case DATA_KARATHRESSEVENT_STARTER: return KarathressEvent_Starter; + case DATA_LEOTHERAS: return LeotherasTheBlind; + case DATA_LEOTHERAS_EVENT_STARTER: return LeotherasEventStarter; + } + return 0; + } + + void SetData(uint32 type, uint32 data) + { + switch(type) + { + case DATA_STRANGE_POOL: + { + StrangePool = data; + if (data == NOT_STARTED) + LurkerSubEvent = LURKER_NOT_STARTED; + } + break; + case DATA_CONTROL_CONSOLE: + if (data == DONE) + { + HandleGameObject(BridgePart[0], true); + HandleGameObject(BridgePart[0], true); + HandleGameObject(BridgePart[0], true); + } + ControlConsole = data;break; + case DATA_TRASH : + { + if (data == 1 && TrashCount < MIN_KILLS) + ++TrashCount;//+1 died + SaveToDB(); + break; + } + case DATA_WATER : Water = data;break; + case DATA_HYDROSSTHEUNSTABLEEVENT: m_auiEncounter[0] = data; break; + case DATA_LEOTHERASTHEBLINDEVENT: m_auiEncounter[1] = data; break; + case DATA_THELURKERBELOWEVENT: m_auiEncounter[2] = data; break; + case DATA_KARATHRESSEVENT: m_auiEncounter[3] = data; break; + case DATA_MOROGRIMTIDEWALKEREVENT: m_auiEncounter[4] = data; break; + //Lady Vashj + case DATA_LADYVASHJEVENT: + if (data == NOT_STARTED) + { + ShieldGeneratorDeactivated[0] = false; + ShieldGeneratorDeactivated[1] = false; + ShieldGeneratorDeactivated[2] = false; + ShieldGeneratorDeactivated[3] = false; + } + m_auiEncounter[5] = data; break; + case DATA_SHIELDGENERATOR1:ShieldGeneratorDeactivated[0] = (data) ? true : false; break; + case DATA_SHIELDGENERATOR2:ShieldGeneratorDeactivated[1] = (data) ? true : false; break; + case DATA_SHIELDGENERATOR3:ShieldGeneratorDeactivated[2] = (data) ? true : false; break; + case DATA_SHIELDGENERATOR4:ShieldGeneratorDeactivated[3] = (data) ? true : false; break; + } + + if (data == DONE) + SaveToDB(); + } + + uint32 GetData(uint32 type) + { + switch(type) + { + case DATA_HYDROSSTHEUNSTABLEEVENT: return m_auiEncounter[0]; + case DATA_LEOTHERASTHEBLINDEVENT: return m_auiEncounter[1]; + case DATA_THELURKERBELOWEVENT: return m_auiEncounter[2]; + case DATA_KARATHRESSEVENT: return m_auiEncounter[3]; + case DATA_MOROGRIMTIDEWALKEREVENT: return m_auiEncounter[4]; + //Lady Vashj + case DATA_LADYVASHJEVENT: return m_auiEncounter[5]; + case DATA_SHIELDGENERATOR1: return ShieldGeneratorDeactivated[0]; + case DATA_SHIELDGENERATOR2: return ShieldGeneratorDeactivated[1]; + case DATA_SHIELDGENERATOR3: return ShieldGeneratorDeactivated[2]; + case DATA_SHIELDGENERATOR4: return ShieldGeneratorDeactivated[3]; + case DATA_CANSTARTPHASE3: + if (ShieldGeneratorDeactivated[0] && ShieldGeneratorDeactivated[1] && ShieldGeneratorDeactivated[2] && ShieldGeneratorDeactivated[3])return 1;break; + case DATA_STRANGE_POOL: return StrangePool; + case DATA_WATER: return Water; + } + return 0; + } + std::string GetSaveData() + { + OUT_SAVE_INST_DATA; + std::ostringstream stream; + stream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " + << m_auiEncounter[3] << " " << m_auiEncounter[4] << " " << m_auiEncounter[5] << " " << TrashCount; + char* out = new char[stream.str().length() + 1]; + strcpy(out, stream.str().c_str()); + if (out) + { + OUT_SAVE_INST_DATA_COMPLETE; + return out; + } + return NULL; + } + + void Load(const char* in) + { + if (!in) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + OUT_LOAD_INST_DATA(in); + std::istringstream stream(in); + stream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3] + >> m_auiEncounter[4] >> m_auiEncounter[5] >> TrashCount; + for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) // Do not load an encounter as "In Progress" - reset it instead. + m_auiEncounter[i] = NOT_STARTED; + OUT_LOAD_INST_DATA_COMPLETE; + } +}; + +InstanceData* GetInstanceData_instance_serpentshrine_cavern(Map* pMap) +{ + return new instance_serpentshrine_cavern(pMap); +} + +void AddSC_instance_serpentshrine_cavern() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "instance_serpent_shrine"; + newscript->GetInstanceData = &GetInstanceData_instance_serpentshrine_cavern; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "go_bridge_console"; + newscript->pGOHello = &GOHello_go_bridge_console; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/Outland/CoilfangReservoir/serpent_shrine/serpent_shrine.h b/src/server/scripts/Outland/CoilfangReservoir/serpent_shrine/serpent_shrine.h new file mode 100644 index 00000000000..adfa39dc7e0 --- /dev/null +++ b/src/server/scripts/Outland/CoilfangReservoir/serpent_shrine/serpent_shrine.h @@ -0,0 +1,45 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_SERPENT_SHRINE_H +#define DEF_SERPENT_SHRINE_H +enum LurkerEventState +{ + LURKER_NOT_STARTED = 0, + LURKER_FISHING = 1, + LURKER_HOOKED = 2 +}; +enum WaterEventState +{ + WATERSTATE_NONE = 0, + WATERSTATE_FRENZY = 1, + WATERSTATE_SCALDING = 2 +}; +#define DATA_CANSTARTPHASE3 1 +#define DATA_CARIBDIS 2 +#define DATA_HYDROSSTHEUNSTABLEEVENT 3 +#define DATA_KARATHRESS 4 +#define DATA_KARATHRESSEVENT 5 +#define DATA_KARATHRESSEVENT_STARTER 6 +#define DATA_LADYVASHJ 7 +#define DATA_LADYVASHJEVENT 8 +#define DATA_LEOTHERASTHEBLINDEVENT 9 +#define DATA_MOROGRIMTIDEWALKEREVENT 10 +#define DATA_SHARKKIS 11 +#define DATA_SHIELDGENERATOR1 12 +#define DATA_SHIELDGENERATOR2 13 +#define DATA_SHIELDGENERATOR3 14 +#define DATA_SHIELDGENERATOR4 15 +#define DATA_THELURKERBELOW 16 +#define DATA_THELURKERBELOWEVENT 17 +#define DATA_TIDALVESS 18 +#define DATA_FATHOMLORDKARATHRESSEVENT 19 +#define DATA_LEOTHERAS 20 +#define DATA_LEOTHERAS_EVENT_STARTER 21 +#define DATA_CONTROL_CONSOLE 22 +#define DATA_STRANGE_POOL 23 +#define DATA_WATER 24 +#define DATA_TRASH 25 +#endif + diff --git a/src/server/scripts/Outland/CoilfangReservoir/steam_vault/boss_hydromancer_thespia.cpp b/src/server/scripts/Outland/CoilfangReservoir/steam_vault/boss_hydromancer_thespia.cpp new file mode 100644 index 00000000000..8e1b438bdc5 --- /dev/null +++ b/src/server/scripts/Outland/CoilfangReservoir/steam_vault/boss_hydromancer_thespia.cpp @@ -0,0 +1,187 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Hydromancer_Thespia +SD%Complete: 80 +SDComment: Needs additional adjustments (when instance script is adjusted) +SDCategory: Coilfang Resevoir, The Steamvault +EndScriptData */ + +/* ContentData +boss_hydromancer_thespia +mob_coilfang_waterelemental +EndContentData */ + +#include "ScriptedPch.h" +#include "steam_vault.h" + +#define SAY_SUMMON -1545000 +#define SAY_AGGRO_1 -1545001 +#define SAY_AGGRO_2 -1545002 +#define SAY_AGGRO_3 -1545003 +#define SAY_SLAY_1 -1545004 +#define SAY_SLAY_2 -1545005 +#define SAY_DEAD -1545006 + +#define SPELL_LIGHTNING_CLOUD 25033 +#define SPELL_LUNG_BURST 31481 +#define SPELL_ENVELOPING_WINDS 31718 + +struct boss_thespiaAI : public ScriptedAI +{ + boss_thespiaAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance *pInstance; + + uint32 LightningCloud_Timer; + uint32 LungBurst_Timer; + uint32 EnvelopingWinds_Timer; + + void Reset() + { + LightningCloud_Timer = 15000; + LungBurst_Timer = 7000; + EnvelopingWinds_Timer = 9000; + + if (pInstance) + pInstance->SetData(TYPE_HYDROMANCER_THESPIA, NOT_STARTED); + } + + void JustDied(Unit* /*Killer*/) + { + DoScriptText(SAY_DEAD, me); + + if (pInstance) + pInstance->SetData(TYPE_HYDROMANCER_THESPIA, DONE); + } + + void KilledUnit(Unit* /*victim*/) + { + DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me); + } + + void EnterCombat(Unit * /*who*/) + { + DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3), me); + + if (pInstance) + pInstance->SetData(TYPE_HYDROMANCER_THESPIA, IN_PROGRESS); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //LightningCloud_Timer + if (LightningCloud_Timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(pTarget, SPELL_LIGHTNING_CLOUD); + + //cast twice in Heroic mode + if (IsHeroic()) + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(pTarget, SPELL_LIGHTNING_CLOUD); + + LightningCloud_Timer = 15000+rand()%10000; + } else LightningCloud_Timer -=diff; + + //LungBurst_Timer + if (LungBurst_Timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(pTarget, SPELL_LUNG_BURST); + LungBurst_Timer = 7000+rand()%5000; + } else LungBurst_Timer -=diff; + + //EnvelopingWinds_Timer + if (EnvelopingWinds_Timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(pTarget, SPELL_ENVELOPING_WINDS); + + //cast twice in Heroic mode + if (IsHeroic()) + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(pTarget, SPELL_ENVELOPING_WINDS); + EnvelopingWinds_Timer = 10000+rand()%5000; + } else EnvelopingWinds_Timer -=diff; + + DoMeleeAttackIfReady(); + } +}; + +#define SPELL_WATER_BOLT_VOLLEY 34449 +#define H_SPELL_WATER_BOLT_VOLLEY 37924 + +struct mob_coilfang_waterelementalAI : public ScriptedAI +{ + mob_coilfang_waterelementalAI(Creature *c) : ScriptedAI(c) {} + + uint32 WaterBoltVolley_Timer; + + void Reset() + { + WaterBoltVolley_Timer = 3000+rand()%3000; + } + + void EnterCombat(Unit * /*who*/) { } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (WaterBoltVolley_Timer <= diff) + { + DoCast(me, SPELL_WATER_BOLT_VOLLEY); + WaterBoltVolley_Timer = 7000+rand()%5000; + } else WaterBoltVolley_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_thespiaAI(Creature* pCreature) +{ + return new boss_thespiaAI (pCreature); +} + +CreatureAI* GetAI_mob_coilfang_waterelementalAI(Creature* pCreature) +{ + return new mob_coilfang_waterelementalAI (pCreature); +} + +void AddSC_boss_hydromancer_thespia() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_hydromancer_thespia"; + newscript->GetAI = &GetAI_boss_thespiaAI; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_coilfang_waterelemental"; + newscript->GetAI = &GetAI_mob_coilfang_waterelementalAI; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/Outland/CoilfangReservoir/steam_vault/boss_mekgineer_steamrigger.cpp b/src/server/scripts/Outland/CoilfangReservoir/steam_vault/boss_mekgineer_steamrigger.cpp new file mode 100644 index 00000000000..f2da4058e44 --- /dev/null +++ b/src/server/scripts/Outland/CoilfangReservoir/steam_vault/boss_mekgineer_steamrigger.cpp @@ -0,0 +1,264 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Mekgineer_Steamrigger +SD%Complete: 60 +SDComment: Mechanics' interrrupt heal doesn't work very well, also a proper movement needs to be implemented -> summon further away and move towards pTarget to repair. +SDCategory: Coilfang Resevoir, The Steamvault +EndScriptData */ + +/* ContentData +boss_mekgineer_steamrigger +mob_steamrigger_mechanic +EndContentData */ + +#include "ScriptedPch.h" +#include "steam_vault.h" + +#define SAY_MECHANICS -1545007 +#define SAY_AGGRO_1 -1545008 +#define SAY_AGGRO_2 -1545009 +#define SAY_AGGRO_3 -1545010 +#define SAY_AGGRO_4 -1545011 +#define SAY_SLAY_1 -1545012 +#define SAY_SLAY_2 -1545013 +#define SAY_SLAY_3 -1545014 +#define SAY_DEATH -1545015 + +#define SPELL_SUPER_SHRINK_RAY 31485 +#define SPELL_SAW_BLADE 31486 +#define SPELL_ELECTRIFIED_NET 35107 +#define H_SPELL_ENRAGE 1 //corrent enrage spell not known + +#define ENTRY_STREAMRIGGER_MECHANIC 17951 + +struct boss_mekgineer_steamriggerAI : public ScriptedAI +{ + boss_mekgineer_steamriggerAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance *pInstance; + + uint32 Shrink_Timer; + uint32 Saw_Blade_Timer; + uint32 Electrified_Net_Timer; + bool Summon75; + bool Summon50; + bool Summon25; + + void Reset() + { + Shrink_Timer = 20000; + Saw_Blade_Timer = 15000; + Electrified_Net_Timer = 10000; + + Summon75 = false; + Summon50 = false; + Summon25 = false; + + if (pInstance) + pInstance->SetData(TYPE_MEKGINEER_STEAMRIGGER, NOT_STARTED); + } + + void JustDied(Unit* /*Killer*/) + { + DoScriptText(SAY_DEATH, me); + + if (pInstance) + pInstance->SetData(TYPE_MEKGINEER_STEAMRIGGER, DONE); + } + + void KilledUnit(Unit* /*victim*/) + { + DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), me); + } + + void EnterCombat(Unit * /*who*/) + { + DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3), me); + + if (pInstance) + pInstance->SetData(TYPE_MEKGINEER_STEAMRIGGER, IN_PROGRESS); + } + + //no known summon spells exist + void SummonMechanichs() + { + DoScriptText(SAY_MECHANICS, me); + + DoSpawnCreature(ENTRY_STREAMRIGGER_MECHANIC,5,5,0,0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 240000); + DoSpawnCreature(ENTRY_STREAMRIGGER_MECHANIC,-5,5,0,0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 240000); + DoSpawnCreature(ENTRY_STREAMRIGGER_MECHANIC,-5,-5,0,0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 240000); + + if (rand()%2) + DoSpawnCreature(ENTRY_STREAMRIGGER_MECHANIC,5,-7,0,0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 240000); + if (rand()%2) + DoSpawnCreature(ENTRY_STREAMRIGGER_MECHANIC,7,-5,0,0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 240000); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (Shrink_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_SUPER_SHRINK_RAY); + Shrink_Timer = 20000; + } else Shrink_Timer -= diff; + + if (Saw_Blade_Timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1)) + DoCast(pTarget, SPELL_SAW_BLADE); + else + DoCast(me->getVictim(), SPELL_SAW_BLADE); + + Saw_Blade_Timer = 15000; + } else Saw_Blade_Timer -= diff; + + if (Electrified_Net_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_ELECTRIFIED_NET); + Electrified_Net_Timer = 10000; + } + else Electrified_Net_Timer -= diff; + + if (!Summon75) + { + if ((me->GetHealth()*100 / me->GetMaxHealth()) < 75) + { + SummonMechanichs(); + Summon75 = true; + } + } + + if (!Summon50) + { + if ((me->GetHealth()*100 / me->GetMaxHealth()) < 50) + { + SummonMechanichs(); + Summon50 = true; + } + } + + if (!Summon25) + { + if ((me->GetHealth()*100 / me->GetMaxHealth()) < 25) + { + SummonMechanichs(); + Summon25 = true; + } + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_mekgineer_steamrigger(Creature* pCreature) +{ + return new boss_mekgineer_steamriggerAI (pCreature); +} + +#define SPELL_DISPEL_MAGIC 17201 +#define SPELL_REPAIR 31532 +#define H_SPELL_REPAIR 37936 + +#define MAX_REPAIR_RANGE (13.0f) //we should be at least at this range for repair +#define MIN_REPAIR_RANGE (7.0f) //we can stop movement at this range to repair but not required + +struct mob_steamrigger_mechanicAI : public ScriptedAI +{ + mob_steamrigger_mechanicAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint32 Repair_Timer; + + void Reset() + { + Repair_Timer = 2000; + } + + void MoveInLineOfSight(Unit* /*who*/) + { + //react only if attacked + } + + void EnterCombat(Unit * /*who*/) { } + + void UpdateAI(const uint32 diff) + { + if (Repair_Timer <= diff) + { + if (pInstance && pInstance->GetData64(DATA_MEKGINEERSTEAMRIGGER) && pInstance->GetData(TYPE_MEKGINEER_STEAMRIGGER) == IN_PROGRESS) + { + if (Unit* pMekgineer = Unit::GetUnit((*me), pInstance->GetData64(DATA_MEKGINEERSTEAMRIGGER))) + { + if (me->IsWithinDistInMap(pMekgineer, MAX_REPAIR_RANGE)) + { + //are we already channeling? Doesn't work very well, find better check? + if (!me->GetUInt32Value(UNIT_CHANNEL_SPELL)) + { + //me->GetMotionMaster()->MovementExpired(); + //me->GetMotionMaster()->MoveIdle(); + + DoCast(me, SPELL_REPAIR, true); + } + Repair_Timer = 5000; + } + else + { + //me->GetMotionMaster()->MovementExpired(); + //me->GetMotionMaster()->MoveFollow(pMekgineer,0,0); + } + } + } else Repair_Timer = 5000; + } else Repair_Timer -= diff; + + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_steamrigger_mechanic(Creature* pCreature) +{ + return new mob_steamrigger_mechanicAI (pCreature); +} + +void AddSC_boss_mekgineer_steamrigger() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_mekgineer_steamrigger"; + newscript->GetAI = &GetAI_boss_mekgineer_steamrigger; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_steamrigger_mechanic"; + newscript->GetAI = &GetAI_mob_steamrigger_mechanic; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/Outland/CoilfangReservoir/steam_vault/boss_warlord_kalithresh.cpp b/src/server/scripts/Outland/CoilfangReservoir/steam_vault/boss_warlord_kalithresh.cpp new file mode 100644 index 00000000000..f46956dda81 --- /dev/null +++ b/src/server/scripts/Outland/CoilfangReservoir/steam_vault/boss_warlord_kalithresh.cpp @@ -0,0 +1,204 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Warlord_Kalithres +SD%Complete: 65 +SDComment: Contains workarounds regarding warlord's rage spells not acting as expected. Both scripts here require review and fine tuning. +SDCategory: Coilfang Resevoir, The Steamvault +EndScriptData */ + +#include "ScriptedPch.h" +#include "steam_vault.h" + +#define SAY_INTRO -1545016 +#define SAY_REGEN -1545017 +#define SAY_AGGRO1 -1545018 +#define SAY_AGGRO2 -1545019 +#define SAY_AGGRO3 -1545020 +#define SAY_SLAY1 -1545021 +#define SAY_SLAY2 -1545022 +#define SAY_DEATH -1545023 + +#define SPELL_SPELL_REFLECTION 31534 +#define SPELL_IMPALE 39061 +#define SPELL_WARLORDS_RAGE 37081 +#define SPELL_WARLORDS_RAGE_NAGA 31543 + +#define SPELL_WARLORDS_RAGE_PROC 36453 + +struct mob_naga_distillerAI : public ScriptedAI +{ + mob_naga_distillerAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance *pInstance; + + void Reset() + { + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + //hack, due to really weird spell behaviour :( + if (pInstance) + { + if (pInstance->GetData(TYPE_DISTILLER) == IN_PROGRESS) + { + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + } + } + + void EnterCombat(Unit * /*who*/) { } + + void StartRageGen(Unit * /*caster*/) + { + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + DoCast(me, SPELL_WARLORDS_RAGE_NAGA, true); + + if (pInstance) + pInstance->SetData(TYPE_DISTILLER,IN_PROGRESS); + } + + void DamageTaken(Unit * /*done_by*/, uint32 &damage) + { + if (me->GetHealth() <= damage) + if (pInstance) + pInstance->SetData(TYPE_DISTILLER,DONE); + } +}; + +struct boss_warlord_kalithreshAI : public ScriptedAI +{ + boss_warlord_kalithreshAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance *pInstance; + + uint32 Reflection_Timer; + uint32 Impale_Timer; + uint32 Rage_Timer; + bool CanRage; + + void Reset() + { + Reflection_Timer = 10000; + Impale_Timer = 7000+rand()%7000; + Rage_Timer = 45000; + CanRage = false; + + if (pInstance) + pInstance->SetData(TYPE_WARLORD_KALITHRESH, NOT_STARTED); + } + + void EnterCombat(Unit * /*who*/) + { + DoScriptText(RAND(SAY_AGGRO1,SAY_AGGRO2,SAY_AGGRO3), me); + + if (pInstance) + pInstance->SetData(TYPE_WARLORD_KALITHRESH, IN_PROGRESS); + } + + void KilledUnit(Unit* /*victim*/) + { + DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me); + } + + void SpellHit(Unit * /*caster*/, const SpellEntry *spell) + { + //hack :( + if (spell->Id == SPELL_WARLORDS_RAGE_PROC) + if (pInstance) + if (pInstance->GetData(TYPE_DISTILLER) == DONE) + me->RemoveAurasDueToSpell(SPELL_WARLORDS_RAGE_PROC); + } + + void JustDied(Unit* /*Killer*/) + { + DoScriptText(SAY_DEATH, me); + + if (pInstance) + pInstance->SetData(TYPE_WARLORD_KALITHRESH, DONE); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (Rage_Timer <= diff) + { + if (Creature* distiller = me->FindNearestCreature(17954, 100.0f)) + { + DoScriptText(SAY_REGEN, me); + DoCast(me, SPELL_WARLORDS_RAGE); + CAST_AI(mob_naga_distillerAI, distiller->AI())->StartRageGen(me); + } + Rage_Timer = 3000+rand()%15000; + } else Rage_Timer -= diff; + + //Reflection_Timer + if (Reflection_Timer <= diff) + { + DoCast(me, SPELL_SPELL_REFLECTION); + Reflection_Timer = 15000+rand()%10000; + } else Reflection_Timer -= diff; + + //Impale_Timer + if (Impale_Timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(pTarget, SPELL_IMPALE); + + Impale_Timer = 7500+rand()%5000; + } else Impale_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_naga_distiller(Creature* pCreature) +{ + return new mob_naga_distillerAI (pCreature); +} + +CreatureAI* GetAI_boss_warlord_kalithresh(Creature* pCreature) +{ + return new boss_warlord_kalithreshAI (pCreature); +} + +void AddSC_boss_warlord_kalithresh() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "mob_naga_distiller"; + newscript->GetAI = &GetAI_mob_naga_distiller; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_warlord_kalithresh"; + newscript->GetAI = &GetAI_boss_warlord_kalithresh; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/Outland/CoilfangReservoir/steam_vault/instance_steam_vault.cpp b/src/server/scripts/Outland/CoilfangReservoir/steam_vault/instance_steam_vault.cpp new file mode 100644 index 00000000000..188a23738f5 --- /dev/null +++ b/src/server/scripts/Outland/CoilfangReservoir/steam_vault/instance_steam_vault.cpp @@ -0,0 +1,231 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Steam_Vault +SD%Complete: 80 +SDComment: Instance script and access panel GO +SDCategory: Coilfang Resevoir, The Steamvault +EndScriptData */ + +#include "ScriptedPch.h" +#include "steam_vault.h" + +#define MAX_ENCOUNTER 4 + +#define MAIN_CHAMBERS_DOOR 183049 +#define ACCESS_PANEL_HYDRO 184125 +#define ACCESS_PANEL_MEK 184126 + +/* Steam Vaults encounters: +1 - Hydromancer Thespia Event +2 - Mekgineer Steamrigger Event +3 - Warlord Kalithresh Event +*/ + +bool GOHello_go_main_chambers_access_panel(Player* /*pPlayer*/, GameObject* pGo) +{ + ScriptedInstance* pInstance = pGo->GetInstanceData(); + + if (!pInstance) + return false; + + if (pGo->GetEntry() == ACCESS_PANEL_HYDRO && (pInstance->GetData(TYPE_HYDROMANCER_THESPIA) == DONE || pInstance->GetData(TYPE_HYDROMANCER_THESPIA) == SPECIAL)) + pInstance->SetData(TYPE_HYDROMANCER_THESPIA,SPECIAL); + + if (pGo->GetEntry() == ACCESS_PANEL_MEK && (pInstance->GetData(TYPE_MEKGINEER_STEAMRIGGER) == DONE || pInstance->GetData(TYPE_MEKGINEER_STEAMRIGGER) == SPECIAL)) + pInstance->SetData(TYPE_MEKGINEER_STEAMRIGGER,SPECIAL); + + return true; +} + +struct instance_steam_vault : public ScriptedInstance +{ + instance_steam_vault(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + + uint64 ThespiaGUID; + uint64 MekgineerGUID; + uint64 KalithreshGUID; + + uint64 MainChambersDoor; + uint64 AccessPanelHydro; + uint64 AccessPanelMek; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + ThespiaGUID = 0; + MekgineerGUID = 0; + KalithreshGUID = 0; + MainChambersDoor = 0; + AccessPanelHydro = 0; + AccessPanelMek = 0; + } + + bool IsEncounterInProgress() const + { + for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) + return true; + + return false; + } + + void OnCreatureCreate(Creature* pCreature, bool /*add*/) + { + switch(pCreature->GetEntry()) + { + case 17797: ThespiaGUID = pCreature->GetGUID(); break; + case 17796: MekgineerGUID = pCreature->GetGUID(); break; + case 17798: KalithreshGUID = pCreature->GetGUID(); break; + } + } + + void OnGameObjectCreate(GameObject* pGo, bool /*add*/) + { + switch(pGo->GetEntry()) + { + case MAIN_CHAMBERS_DOOR: MainChambersDoor = pGo->GetGUID(); break; + case ACCESS_PANEL_HYDRO: AccessPanelHydro = pGo->GetGUID(); break; + case ACCESS_PANEL_MEK: AccessPanelMek = pGo->GetGUID(); break; + } + } + + void SetData(uint32 type, uint32 data) + { + switch(type) + { + case TYPE_HYDROMANCER_THESPIA: + if (data == SPECIAL) + { + HandleGameObject(AccessPanelHydro, true); + + if (GetData(TYPE_MEKGINEER_STEAMRIGGER) == SPECIAL) + HandleGameObject(MainChambersDoor, true); + + debug_log("TSCR: Instance Steamvault: Access panel used."); + } + m_auiEncounter[0] = data; + break; + case TYPE_MEKGINEER_STEAMRIGGER: + if (data == SPECIAL) + { + HandleGameObject(AccessPanelMek, true); + + if (GetData(TYPE_HYDROMANCER_THESPIA) == SPECIAL) + HandleGameObject(MainChambersDoor, true); + + debug_log("TSCR: Instance Steamvault: Access panel used."); + } + m_auiEncounter[1] = data; + break; + case TYPE_WARLORD_KALITHRESH: + m_auiEncounter[2] = data; + break; + case TYPE_DISTILLER: + m_auiEncounter[3] = data; + break; + } + + if (data == DONE || data == SPECIAL) + SaveToDB(); + } + + uint32 GetData(uint32 type) + { + switch(type) + { + case TYPE_HYDROMANCER_THESPIA: + return m_auiEncounter[0]; + case TYPE_MEKGINEER_STEAMRIGGER: + return m_auiEncounter[1]; + case TYPE_WARLORD_KALITHRESH: + return m_auiEncounter[2]; + case TYPE_DISTILLER: + return m_auiEncounter[3]; + } + return 0; + } + + uint64 GetData64(uint32 data) + { + switch(data) + { + case DATA_THESPIA: + return ThespiaGUID; + case DATA_MEKGINEERSTEAMRIGGER: + return MekgineerGUID; + case DATA_KALITRESH: + return KalithreshGUID; + } + return 0; + } + + std::string GetSaveData() + { + OUT_SAVE_INST_DATA; + std::ostringstream stream; + stream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " << m_auiEncounter[3]; + char* out = new char[stream.str().length() + 1]; + strcpy(out, stream.str().c_str()); + if (out) + { + OUT_SAVE_INST_DATA_COMPLETE; + return out; + } + return NULL; + } + + void Load(const char* in) + { + if (!in) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + OUT_LOAD_INST_DATA(in); + std::istringstream stream(in); + stream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3]; + for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) + m_auiEncounter[i] = NOT_STARTED; + OUT_LOAD_INST_DATA_COMPLETE; + } +}; + +InstanceData* GetInstanceData_instance_steam_vault(Map* pMap) +{ + return new instance_steam_vault(pMap); +} + +void AddSC_instance_steam_vault() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "go_main_chambers_access_panel"; + newscript->pGOHello = &GOHello_go_main_chambers_access_panel; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "instance_steam_vault"; + newscript->GetInstanceData = &GetInstanceData_instance_steam_vault; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/Outland/CoilfangReservoir/steam_vault/steam_vault.h b/src/server/scripts/Outland/CoilfangReservoir/steam_vault/steam_vault.h new file mode 100644 index 00000000000..4b407ac4816 --- /dev/null +++ b/src/server/scripts/Outland/CoilfangReservoir/steam_vault/steam_vault.h @@ -0,0 +1,17 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_STEAM_VAULT_H +#define DEF_STEAM_VAULT_H + +#define TYPE_HYDROMANCER_THESPIA 1 +#define TYPE_MEKGINEER_STEAMRIGGER 2 +#define TYPE_WARLORD_KALITHRESH 3 +#define TYPE_DISTILLER 4 + +#define DATA_MEKGINEERSTEAMRIGGER 5 +#define DATA_KALITRESH 6 +#define DATA_THESPIA 7 +#endif + diff --git a/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_hungarfen.cpp b/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_hungarfen.cpp new file mode 100644 index 00000000000..fcfcc1b1a90 --- /dev/null +++ b/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_hungarfen.cpp @@ -0,0 +1,154 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Hungarfen +SD%Complete: 95 +SDComment: Need confirmation if spell data are same in both modes. Summons should have faster rate in heroic +SDCategory: Coilfang Resevoir, Underbog +EndScriptData */ + +#include "ScriptedPch.h" + +#define SPELL_FOUL_SPORES 31673 +#define SPELL_ACID_GEYSER 38739 + +struct boss_hungarfenAI : public ScriptedAI +{ + boss_hungarfenAI(Creature *c) : ScriptedAI(c) + { + } + + bool Root; + uint32 Mushroom_Timer; + uint32 AcidGeyser_Timer; + + void Reset() + { + Root = false; + Mushroom_Timer = 5000; // 1 mushroom after 5s, then one per 10s. This should be different in heroic mode + AcidGeyser_Timer = 10000; + } + + void EnterCombat(Unit * /*who*/) + { + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if ((me->GetHealth()*100) / me->GetMaxHealth() <= 20) + { + if (!Root) + { + DoCast(me, SPELL_FOUL_SPORES); + Root = true; + } + } + + if (Mushroom_Timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + me->SummonCreature(17990, pTarget->GetPositionX()+(rand()%8), pTarget->GetPositionY()+(rand()%8), pTarget->GetPositionZ(), (rand()%5), TEMPSUMMON_TIMED_DESPAWN, 22000); + else + me->SummonCreature(17990, me->GetPositionX()+(rand()%8), me->GetPositionY()+(rand()%8), me->GetPositionZ(), (rand()%5), TEMPSUMMON_TIMED_DESPAWN, 22000); + + Mushroom_Timer = 10000; + } else Mushroom_Timer -= diff; + + if (AcidGeyser_Timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(pTarget, SPELL_ACID_GEYSER); + AcidGeyser_Timer = 10000+rand()%7500; + } else AcidGeyser_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_hungarfen(Creature* pCreature) +{ + return new boss_hungarfenAI (pCreature); +} + +#define SPELL_SPORE_CLOUD 34168 +#define SPELL_PUTRID_MUSHROOM 31690 +#define SPELL_GROW 31698 + +struct mob_underbog_mushroomAI : public ScriptedAI +{ + mob_underbog_mushroomAI(Creature *c) : ScriptedAI(c) {} + + bool Stop; + uint32 Grow_Timer; + uint32 Shrink_Timer; + + void Reset() + { + Stop = false; + Grow_Timer = 0; + Shrink_Timer = 20000; + + DoCast(me, SPELL_PUTRID_MUSHROOM, true); + DoCast(me, SPELL_SPORE_CLOUD, true); + } + + void MoveInLineOfSight(Unit * /*who*/) {} + + void AttackStart(Unit* /*who*/) {} + + void EnterCombat(Unit* /*who*/) {} + + void UpdateAI(const uint32 diff) + { + if (Stop) + return; + + if (Grow_Timer <= diff) + { + DoCast(me, SPELL_GROW); + Grow_Timer = 3000; + } else Grow_Timer -= diff; + + if (Shrink_Timer <= diff) + { + me->RemoveAurasDueToSpell(SPELL_GROW); + Stop = true; + } else Shrink_Timer -= diff; + } +}; +CreatureAI* GetAI_mob_underbog_mushroom(Creature* pCreature) +{ + return new mob_underbog_mushroomAI (pCreature); +} + +void AddSC_boss_hungarfen() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_hungarfen"; + newscript->GetAI = &GetAI_boss_hungarfen; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_underbog_mushroom"; + newscript->GetAI = &GetAI_mob_underbog_mushroom; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_the_black_stalker.cpp b/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_the_black_stalker.cpp new file mode 100644 index 00000000000..3a78660389b --- /dev/null +++ b/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_the_black_stalker.cpp @@ -0,0 +1,185 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_the_black_stalker +SD%Complete: 95 +SDComment: Timers may be incorrect +SDCategory: Coilfang Resevoir, Underbog +EndScriptData */ + +#include "ScriptedPch.h" + +#define SPELL_LEVITATE 31704 +#define SPELL_SUSPENSION 31719 +#define SPELL_LEVITATION_PULSE 31701 +#define SPELL_MAGNETIC_PULL 31705 +#define SPELL_CHAIN_LIGHTNING 31717 +#define SPELL_STATIC_CHARGE 31715 +#define SPELL_SUMMON_SPORE_STRIDER 38755 + +#define ENTRY_SPORE_STRIDER 22299 + +struct boss_the_black_stalkerAI : public ScriptedAI +{ + boss_the_black_stalkerAI(Creature *c) : ScriptedAI(c) + { + } + + uint32 SporeStriders_Timer; + uint32 Levitate_Timer; + uint32 ChainLightning_Timer; + uint32 StaticCharge_Timer; + uint64 LevitatedTarget; + uint32 LevitatedTarget_Timer; + bool InAir; + uint32 check_Timer; + std::list Striders; + + void Reset() + { + Levitate_Timer = 12000; + ChainLightning_Timer = 6000; + StaticCharge_Timer = 10000; + SporeStriders_Timer = 10000+rand()%5000; + check_Timer = 5000; + LevitatedTarget = 0; + LevitatedTarget_Timer = 0; + Striders.clear(); + } + + void EnterCombat(Unit * /*who*/) {} + + void JustSummoned(Creature *summon) + { + if (summon && summon->GetEntry() == ENTRY_SPORE_STRIDER) + { + Striders.push_back(summon->GetGUID()); + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1)) + summon->AI()->AttackStart(pTarget); + else + if (me->getVictim()) + summon->AI()->AttackStart(me->getVictim()); + } + } + + void JustDied(Unit * /*who*/) + { + for (std::list::const_iterator i = Striders.begin(); i != Striders.end(); ++i) + if (Creature *strider = Unit::GetCreature(*me, *i)) + strider->DisappearAndDie(); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + // Evade if too far + if (check_Timer <= diff) + { + float x,y,z,o; + me->GetHomePosition(x,y,z,o); + if (!me->IsWithinDist3d(x,y,z, 60)) + { + EnterEvadeMode(); + return; + } + check_Timer = 1000; + } else check_Timer -= diff; + + // Spore Striders + if (IsHeroic() && SporeStriders_Timer <= diff) + { + DoCast(me, SPELL_SUMMON_SPORE_STRIDER); + SporeStriders_Timer = 10000+rand()%5000; + } else SporeStriders_Timer -= diff; + + // Levitate + if (LevitatedTarget) + { + if (LevitatedTarget_Timer <= diff) + { + if (Unit *pTarget = Unit::GetUnit(*me, LevitatedTarget)) + { + if (!pTarget->HasAura(SPELL_LEVITATE)) + { + LevitatedTarget = 0; + return; + } + if (InAir) + { + pTarget->AddAura(SPELL_SUSPENSION, pTarget); + LevitatedTarget = 0; + } + else + { + pTarget->CastSpell(pTarget, SPELL_MAGNETIC_PULL, true); + InAir = true; + LevitatedTarget_Timer = 1500; + } + } + else + LevitatedTarget = 0; + } else LevitatedTarget_Timer -= diff; + } + if (Levitate_Timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1)) + { + DoCast(pTarget, SPELL_LEVITATE); + LevitatedTarget = pTarget->GetGUID(); + LevitatedTarget_Timer = 2000; + InAir = false; + } + Levitate_Timer = 12000+rand()%3000; + } else Levitate_Timer -= diff; + + // Chain Lightning + if (ChainLightning_Timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(pTarget, SPELL_CHAIN_LIGHTNING); + ChainLightning_Timer = 7000; + } else ChainLightning_Timer -= diff; + + // Static Charge + if (StaticCharge_Timer <= diff) + { + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0,30,true)) + DoCast(pTarget, SPELL_STATIC_CHARGE); + StaticCharge_Timer = 10000; + } else StaticCharge_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_the_black_stalker(Creature* pCreature) +{ + return new boss_the_black_stalkerAI (pCreature); +} + +void AddSC_boss_the_black_stalker() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_the_black_stalker"; + newscript->GetAI = &GetAI_boss_the_black_stalker; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp b/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp new file mode 100644 index 00000000000..a07ac910598 --- /dev/null +++ b/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp @@ -0,0 +1,255 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Gruul +SD%Complete: 60 +SDComment: Ground Slam need further development (knock back effect and shatter effect must be added to the core) +SDCategory: Gruul's Lair +EndScriptData */ + +#include "ScriptedPch.h" +#include "gruuls_lair.h" + +enum eEnums +{ + SAY_AGGRO = -1565010, + SAY_SLAM1 = -1565011, + SAY_SLAM2 = -1565012, + SAY_SHATTER1 = -1565013, + SAY_SHATTER2 = -1565014, + SAY_SLAY1 = -1565015, + SAY_SLAY2 = -1565016, + SAY_SLAY3 = -1565017, + SAY_DEATH = -1565018, + + EMOTE_GROW = -1565019, + + SPELL_GROWTH = 36300, + SPELL_CAVE_IN = 36240, + SPELL_GROUND_SLAM = 33525, //AoE Ground Slam applying Ground Slam to everyone with a script effect (most likely the knock back, we can code it to a set knockback) + SPELL_REVERBERATION = 36297, + SPELL_SHATTER = 33654, + + SPELL_SHATTER_EFFECT = 33671, + SPELL_HURTFUL_STRIKE = 33813, + SPELL_STONED = 33652, //Spell is self cast by target + + SPELL_MAGNETIC_PULL = 28337, + SPELL_KNOCK_BACK = 24199, //Knockback spell until correct implementation is made +}; + +struct boss_gruulAI : public ScriptedAI +{ + boss_gruulAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance *pInstance; + + uint32 m_uiGrowth_Timer; + uint32 m_uiCaveIn_Timer; + uint32 m_uiCaveIn_StaticTimer; + uint32 m_uiGroundSlamTimer; + uint32 m_uiHurtfulStrike_Timer; + uint32 m_uiReverberation_Timer; + + bool m_bPerformingGroundSlam; + + void Reset() + { + m_uiGrowth_Timer= 30000; + m_uiCaveIn_Timer= 27000; + m_uiCaveIn_StaticTimer = 30000; + m_uiGroundSlamTimer= 35000; + m_bPerformingGroundSlam= false; + m_uiHurtfulStrike_Timer= 8000; + m_uiReverberation_Timer= 60000+45000; + + if (pInstance) + pInstance->SetData(DATA_GRUULEVENT, NOT_STARTED); + } + + void EnterCombat(Unit * /*who*/) + { + DoScriptText(SAY_AGGRO, me); + + if (pInstance) + pInstance->SetData(DATA_GRUULEVENT, IN_PROGRESS); + } + + void KilledUnit() + { + DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), me); + } + + void JustDied(Unit* /*Killer*/) + { + DoScriptText(SAY_DEATH, me); + + if (pInstance) + { + pInstance->SetData(DATA_GRUULEVENT, DONE); + pInstance->HandleGameObject(pInstance->GetData64(DATA_GRUULDOOR), true); // Open the encounter door + } + } + + void SpellHitTarget(Unit* pTarget, const SpellEntry* pSpell) + { + //This to emulate effect1 (77) of SPELL_GROUND_SLAM, knock back to any direction + //It's initially wrong, since this will cause fall damage, which is by comments, not intended. + if (pSpell->Id == SPELL_GROUND_SLAM) + { + if (pTarget->GetTypeId() == TYPEID_PLAYER) + { + switch (urand(0,1)) + { + case 0: pTarget->CastSpell(pTarget, SPELL_MAGNETIC_PULL, true, NULL, NULL, me->GetGUID()); break; + case 1: pTarget->CastSpell(pTarget, SPELL_KNOCK_BACK, true, NULL, NULL, me->GetGUID()); break; + } + } + } + + //this part should be in the core + if (pSpell->Id == SPELL_SHATTER) + { + //this spell must have custom handling in the core, dealing damage based on distance + pTarget->CastSpell(pTarget, SPELL_SHATTER_EFFECT, true); + + if (pTarget->HasAura(SPELL_STONED)) + pTarget->RemoveAurasDueToSpell(SPELL_STONED); + + //clear this, if we are still performing + if (m_bPerformingGroundSlam) + { + m_bPerformingGroundSlam = false; + + //and correct movement, if not already + if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != TARGETED_MOTION_TYPE) + { + if (me->getVictim()) + me->GetMotionMaster()->MoveChase(me->getVictim()); + } + } + } + } + + void UpdateAI(const uint32 uiDiff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + // Growth + // Gruul can cast this spell up to 30 times + if (m_uiGrowth_Timer <= uiDiff) + { + DoScriptText(EMOTE_GROW, me); + DoCast(me, SPELL_GROWTH); + m_uiGrowth_Timer = 30000; + } + else + m_uiGrowth_Timer -= uiDiff; + + if (m_bPerformingGroundSlam) + { + if (m_uiGroundSlamTimer <= uiDiff) + { + m_uiGroundSlamTimer =120000; + m_uiHurtfulStrike_Timer= 8000; + + if (m_uiReverberation_Timer < 10000) //Give a little time to the players to undo the damage from shatter + m_uiReverberation_Timer += 10000; + + DoCast(me, SPELL_SHATTER); + } + else + m_uiGroundSlamTimer -= uiDiff; + } + else + { + // Hurtful Strike + if (m_uiHurtfulStrike_Timer <= uiDiff) + { + Unit *pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO,1); + + if (pTarget && me->IsWithinMeleeRange(me->getVictim())) + DoCast(pTarget, SPELL_HURTFUL_STRIKE); + else + DoCast(me->getVictim(), SPELL_HURTFUL_STRIKE); + + m_uiHurtfulStrike_Timer= 8000; + } + else + m_uiHurtfulStrike_Timer -= uiDiff; + + // Reverberation + if (m_uiReverberation_Timer <= uiDiff) + { + DoCast(me->getVictim(), SPELL_REVERBERATION, true); + m_uiReverberation_Timer = 15000 + rand()%10000; + } + else + m_uiReverberation_Timer -= uiDiff; + + // Cave In + if (m_uiCaveIn_Timer <= uiDiff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(pTarget, SPELL_CAVE_IN); + + if (m_uiCaveIn_StaticTimer >= 4000) + m_uiCaveIn_StaticTimer -= 2000; + + m_uiCaveIn_Timer = m_uiCaveIn_StaticTimer; + } + else + m_uiCaveIn_Timer -= uiDiff; + + // Ground Slam, Gronn Lord's Grasp, Stoned, Shatter + if (m_uiGroundSlamTimer <= uiDiff) + { + me->GetMotionMaster()->Clear(); + me->GetMotionMaster()->MoveIdle(); + + m_bPerformingGroundSlam= true; + m_uiGroundSlamTimer = 10000; + + DoCast(me, SPELL_GROUND_SLAM); + } + else + m_uiGroundSlamTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } + } +}; + +CreatureAI* GetAI_boss_gruul(Creature* pCreature) +{ + return new boss_gruulAI (pCreature); +} + +void AddSC_boss_gruul() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_gruul"; + newscript->GetAI = &GetAI_boss_gruul; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/Outland/GruulsLair/boss_high_king_maulgar.cpp b/src/server/scripts/Outland/GruulsLair/boss_high_king_maulgar.cpp new file mode 100644 index 00000000000..482af86225c --- /dev/null +++ b/src/server/scripts/Outland/GruulsLair/boss_high_king_maulgar.cpp @@ -0,0 +1,783 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_High_King_Maulgar +SD%Complete: 90 +SDComment: Correct timers, after whirlwind melee attack bug, prayer of healing +SDCategory: Gruul's Lair +EndScriptData */ + +#include "ScriptedPch.h" +#include "gruuls_lair.h" + +#define SAY_AGGRO -1565000 +#define SAY_ENRAGE -1565001 +#define SAY_OGRE_DEATH1 -1565002 +#define SAY_OGRE_DEATH2 -1565003 +#define SAY_OGRE_DEATH3 -1565004 +#define SAY_OGRE_DEATH4 -1565005 +#define SAY_SLAY1 -1565006 +#define SAY_SLAY2 -1565007 +#define SAY_SLAY3 -1565008 +#define SAY_DEATH -1565009 + +// High King Maulgar +#define SPELL_ARCING_SMASH 39144 +#define SPELL_MIGHTY_BLOW 33230 +#define SPELL_WHIRLWIND 33238 +#define SPELL_BERSERKER_C 26561 +#define SPELL_ROAR 16508 +#define SPELL_FLURRY 33232 +#define SPELL_DUAL_WIELD 29651 //used in phase + +// Olm the Summoner +#define SPELL_DARK_DECAY 33129 +#define SPELL_DEATH_COIL 33130 +#define SPELL_SUMMON_WFH 33131 + +//Kiggler the Craed +#define SPELL_GREATER_POLYMORPH 33173 +#define SPELL_LIGHTNING_BOLT 36152 +#define SPELL_ARCANE_SHOCK 33175 +#define SPELL_ARCANE_EXPLOSION 33237 + +//Blindeye the Seer +#define SPELL_GREATER_PW_SHIELD 33147 +#define SPELL_HEAL 33144 +#define SPELL_PRAYER_OH 33152 + +//Krosh Firehand +#define SPELL_GREATER_FIREBALL 33051 +#define SPELL_SPELLSHIELD 33054 +#define SPELL_BLAST_WAVE 33061 + +bool CheckAllBossDied(ScriptedInstance* pInstance, Creature* me) +{ + if (!pInstance || !me) + return false; + + uint64 MaulgarGUID = 0; + uint64 KigglerGUID = 0; + uint64 BlindeyeGUID = 0; + uint64 OlmGUID = 0; + uint64 KroshGUID = 0; + + Creature* Maulgar = NULL; + Creature* Kiggler = NULL; + Creature* Blindeye = NULL; + Creature* Olm = NULL; + Creature* Krosh = NULL; + + MaulgarGUID = pInstance->GetData64(DATA_MAULGAR); + KigglerGUID = pInstance->GetData64(DATA_KIGGLERTHECRAZED); + BlindeyeGUID = pInstance->GetData64(DATA_BLINDEYETHESEER); + OlmGUID = pInstance->GetData64(DATA_OLMTHESUMMONER); + KroshGUID = pInstance->GetData64(DATA_KROSHFIREHAND); + + Maulgar = (Unit::GetCreature((*me), MaulgarGUID)); + Kiggler = (Unit::GetCreature((*me), KigglerGUID)); + Blindeye = (Unit::GetCreature((*me), BlindeyeGUID)); + Olm = (Unit::GetCreature((*me), OlmGUID)); + Krosh = (Unit::GetCreature((*me), KroshGUID)); + + if (!Maulgar || !Kiggler || !Blindeye || !Olm || !Krosh) + return false; + + if (!Maulgar->isAlive() && !Kiggler->isAlive() && !Blindeye->isAlive() && !Olm->isAlive() && !Krosh->isAlive()) + return true; + + return false; +} + +//High King Maulgar AI +struct boss_high_king_maulgarAI : public ScriptedAI +{ + boss_high_king_maulgarAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + for (uint8 i = 0; i < 4; ++i) + Council[i] = 0; + } + + ScriptedInstance* pInstance; + + uint32 ArcingSmash_Timer; + uint32 MightyBlow_Timer; + uint32 Whirlwind_Timer; + uint32 Charging_Timer; + uint32 Roar_Timer; + + bool Phase2; + + uint64 Council[4]; + + void Reset() + { + ArcingSmash_Timer = 10000; + MightyBlow_Timer = 40000; + Whirlwind_Timer = 30000; + Charging_Timer = 0; + Roar_Timer = 0; + + DoCast(me, SPELL_DUAL_WIELD, false); + + Phase2 = false; + + Creature *pCreature = NULL; + for (uint8 i = 0; i < 4; ++i) + { + if (Council[i]) + { + pCreature = (Unit::GetCreature((*me), Council[i])); + if (pCreature && !pCreature->isAlive()) + { + pCreature->Respawn(); + pCreature->AI()->EnterEvadeMode(); + } + } + } + + //reset encounter + if (pInstance) + pInstance->SetData(DATA_MAULGAREVENT, NOT_STARTED); + } + + void KilledUnit() + { + DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), me); + } + + void JustDied(Unit* /*Killer*/) + { + DoScriptText(SAY_DEATH, me); + + if (CheckAllBossDied(pInstance, me)) + pInstance->SetData(DATA_MAULGAREVENT, DONE); + } + + void AddDeath() + { + DoScriptText(RAND(SAY_OGRE_DEATH1,SAY_OGRE_DEATH2,SAY_OGRE_DEATH3,SAY_OGRE_DEATH4), me); + } + + void EnterCombat(Unit *who) + { + StartEvent(who); + } + + void GetCouncil() + { + if (pInstance) + { + //get council member's guid to respawn them if needed + Council[0] = pInstance->GetData64(DATA_KIGGLERTHECRAZED); + Council[1] = pInstance->GetData64(DATA_BLINDEYETHESEER); + Council[2] = pInstance->GetData64(DATA_OLMTHESUMMONER); + Council[3] = pInstance->GetData64(DATA_KROSHFIREHAND); + } + } + + void StartEvent(Unit *who) + { + if (!pInstance) + return; + + GetCouncil(); + + DoScriptText(SAY_AGGRO, me); + + pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID()); + pInstance->SetData(DATA_MAULGAREVENT, IN_PROGRESS); + + DoZoneInCombat(); + } + + void UpdateAI(const uint32 diff) + { + //Only if not incombat check if the event is started + if (!me->isInCombat() && pInstance && pInstance->GetData(DATA_MAULGAREVENT)) + { + Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_MAULGAREVENT_TANK)); + + if (pTarget) + { + AttackStart(pTarget); + GetCouncil(); + } + } + + //Return since we have no target + if (!UpdateVictim()) + return; + + //someone evaded! + if (pInstance && !pInstance->GetData(DATA_MAULGAREVENT)) + { + EnterEvadeMode(); + return; + } + + //ArcingSmash_Timer + if (ArcingSmash_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_ARCING_SMASH); + ArcingSmash_Timer = 10000; + } else ArcingSmash_Timer -= diff; + + //Whirlwind_Timer + if (Whirlwind_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_WHIRLWIND); + Whirlwind_Timer = 55000; + } else Whirlwind_Timer -= diff; + + //MightyBlow_Timer + if (MightyBlow_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_MIGHTY_BLOW); + MightyBlow_Timer = 30000+rand()%10000; + } else MightyBlow_Timer -= diff; + + //Entering Phase 2 + if (!Phase2 && (me->GetHealth()*100 / me->GetMaxHealth()) < 50) + { + Phase2 = true; + DoScriptText(SAY_ENRAGE, me); + + DoCast(me, SPELL_DUAL_WIELD, true); + me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 0); + me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0); + } + + if (Phase2) + { + //Charging_Timer + if (Charging_Timer <= diff) + { + Unit *pTarget = NULL; + pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (pTarget) + { + AttackStart(pTarget); + DoCast(pTarget, SPELL_BERSERKER_C); + } + Charging_Timer = 20000; + } else Charging_Timer -= diff; + + //Intimidating Roar + if (Roar_Timer <= diff) + { + DoCast(me, SPELL_ROAR); + Roar_Timer = 40000+(rand()%10000); + } else Roar_Timer -= diff; + } + + DoMeleeAttackIfReady(); + } +}; + +//Olm The Summoner AI +struct boss_olm_the_summonerAI : public ScriptedAI +{ + boss_olm_the_summonerAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + uint32 DarkDecay_Timer; + uint32 Summon_Timer; + uint32 DeathCoil_Timer; + + ScriptedInstance* pInstance; + + void Reset() + { + DarkDecay_Timer = 10000; + Summon_Timer = 15000; + DeathCoil_Timer = 20000; + + //reset encounter + if (pInstance) + pInstance->SetData(DATA_MAULGAREVENT, NOT_STARTED); + } + + void AttackStart(Unit* pWho) + { + if (!pWho) + return; + + if (me->Attack(pWho, true)) + { + me->AddThreat(pWho, 0.0f); + me->SetInCombatWith(pWho); + pWho->SetInCombatWith(me); + + me->GetMotionMaster()->MoveChase(pWho, 30.0f); + } + } + + void EnterCombat(Unit *who) + { + if (pInstance) + { + pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID()); + pInstance->SetData(DATA_MAULGAREVENT, IN_PROGRESS); + } + } + + void JustDied(Unit* /*Killer*/) + { + if (pInstance) + { + Creature *Maulgar = NULL; + Maulgar = (Unit::GetCreature((*me), pInstance->GetData64(DATA_MAULGAR))); + + if (Maulgar) + CAST_AI(boss_high_king_maulgarAI, Maulgar->AI())->AddDeath(); + + if (CheckAllBossDied(pInstance, me)) + pInstance->SetData(DATA_MAULGAREVENT, DONE); + } + } + + void UpdateAI(const uint32 diff) + { + //Only if not incombat check if the event is started + if (!me->isInCombat() && pInstance && pInstance->GetData(DATA_MAULGAREVENT)) + { + Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_MAULGAREVENT_TANK)); + + if (pTarget) + { + AttackStart(pTarget); + } + } + + //Return since we have no target + if (!UpdateVictim()) + return; + + //someone evaded! + if (pInstance && !pInstance->GetData(DATA_MAULGAREVENT)) + { + EnterEvadeMode(); + return; + } + + //DarkDecay_Timer + if (DarkDecay_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_DARK_DECAY); + DarkDecay_Timer = 20000; + } else DarkDecay_Timer -= diff; + + //Summon_Timer + if (Summon_Timer <= diff) + { + DoCast(me, SPELL_SUMMON_WFH); + Summon_Timer = 30000; + } else Summon_Timer -= diff; + + //DeathCoil Timer /need correct timer + if (DeathCoil_Timer <= diff) + { + Unit *pTarget = NULL; + pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (pTarget) + DoCast(pTarget, SPELL_DEATH_COIL); + DeathCoil_Timer = 20000; + } else DeathCoil_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +//Kiggler The Crazed AI +struct boss_kiggler_the_crazedAI : public ScriptedAI +{ + boss_kiggler_the_crazedAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + uint32 GreaterPolymorph_Timer; + uint32 LightningBolt_Timer; + uint32 ArcaneShock_Timer; + uint32 ArcaneExplosion_Timer; + + ScriptedInstance* pInstance; + + void Reset() + { + GreaterPolymorph_Timer = 5000; + LightningBolt_Timer = 10000; + ArcaneShock_Timer = 20000; + ArcaneExplosion_Timer = 30000; + + //reset encounter + if (pInstance) + pInstance->SetData(DATA_MAULGAREVENT, NOT_STARTED); + } + + void EnterCombat(Unit* who) + { + if (pInstance) + { + pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID()); + pInstance->SetData(DATA_MAULGAREVENT, IN_PROGRESS); + } + } + + void JustDied(Unit* /*Killer*/) + { + if (pInstance) + { + Creature *Maulgar = NULL; + Maulgar = (Unit::GetCreature((*me), pInstance->GetData64(DATA_MAULGAR))); + + if (Maulgar) + CAST_AI(boss_high_king_maulgarAI, Maulgar->AI())->AddDeath(); + + if (CheckAllBossDied(pInstance, me)) + pInstance->SetData(DATA_MAULGAREVENT, DONE); + } + } + + void UpdateAI(const uint32 diff) + { + //Only if not incombat check if the event is started + if (!me->isInCombat() && pInstance && pInstance->GetData(DATA_MAULGAREVENT)) + { + Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_MAULGAREVENT_TANK)); + + if (pTarget) + { + AttackStart(pTarget); + } + } + + //Return since we have no target + if (!UpdateVictim()) + return; + + //someone evaded! + if (pInstance && !pInstance->GetData(DATA_MAULGAREVENT)) + { + EnterEvadeMode(); + return; + } + + //GreaterPolymorph_Timer + if (GreaterPolymorph_Timer <= diff) + { + Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (pTarget) + DoCast(pTarget, SPELL_GREATER_POLYMORPH); + + GreaterPolymorph_Timer = 15000 + rand()%5000; + } else GreaterPolymorph_Timer -= diff; + + //LightningBolt_Timer + if (LightningBolt_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_LIGHTNING_BOLT); + LightningBolt_Timer = 15000; + } else LightningBolt_Timer -= diff; + + //ArcaneShock_Timer + if (ArcaneShock_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_ARCANE_SHOCK); + ArcaneShock_Timer = 20000; + } else ArcaneShock_Timer -= diff; + + //ArcaneExplosion_Timer + if (ArcaneExplosion_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_ARCANE_EXPLOSION); + ArcaneExplosion_Timer = 30000; + } else ArcaneExplosion_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +//Blindeye The Seer AI +struct boss_blindeye_the_seerAI : public ScriptedAI +{ + boss_blindeye_the_seerAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + uint32 GreaterPowerWordShield_Timer; + uint32 Heal_Timer; + uint32 PrayerofHealing_Timer; + + ScriptedInstance* pInstance; + + void Reset() + { + GreaterPowerWordShield_Timer = 5000; + Heal_Timer = 25000 + rand()%15000; + PrayerofHealing_Timer = 45000 + rand()%10000; + + //reset encounter + if (pInstance) + pInstance->SetData(DATA_MAULGAREVENT, NOT_STARTED); + } + + void EnterCombat(Unit * who) + { + if (pInstance) + { + pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID()); + pInstance->SetData(DATA_MAULGAREVENT, IN_PROGRESS); + } + } + + void JustDied(Unit* /*Killer*/) + { + if (pInstance) + { + Creature *Maulgar = NULL; + Maulgar = (Unit::GetCreature((*me), pInstance->GetData64(DATA_MAULGAR))); + + if (Maulgar) + CAST_AI(boss_high_king_maulgarAI, Maulgar->AI())->AddDeath(); + + if (CheckAllBossDied(pInstance, me)) + pInstance->SetData(DATA_MAULGAREVENT, DONE); + } + } + + void UpdateAI(const uint32 diff) + { + //Only if not incombat check if the event is started + if (!me->isInCombat() && pInstance && pInstance->GetData(DATA_MAULGAREVENT)) + { + Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_MAULGAREVENT_TANK)); + + if (pTarget) + { + AttackStart(pTarget); + } + } + + //Return since we have no target + if (!UpdateVictim()) + return; + + //someone evaded! + if (pInstance && !pInstance->GetData(DATA_MAULGAREVENT)) + { + EnterEvadeMode(); + return; + } + + //GreaterPowerWordShield_Timer + if (GreaterPowerWordShield_Timer <= diff) + { + DoCast(me, SPELL_GREATER_PW_SHIELD); + GreaterPowerWordShield_Timer = 40000; + } else GreaterPowerWordShield_Timer -= diff; + + //Heal_Timer + if (Heal_Timer <= diff) + { + DoCast(me, SPELL_HEAL); + Heal_Timer = 15000 + rand()%25000; + } else Heal_Timer -= diff; + + //PrayerofHealing_Timer + if (PrayerofHealing_Timer <= diff) + { + DoCast(me, SPELL_PRAYER_OH); + PrayerofHealing_Timer = 35000 + rand()%15000; + } else PrayerofHealing_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +//Krosh Firehand AI +struct boss_krosh_firehandAI : public ScriptedAI +{ + boss_krosh_firehandAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + uint32 GreaterFireball_Timer; + uint32 SpellShield_Timer; + uint32 BlastWave_Timer; + + ScriptedInstance* pInstance; + + void Reset() + { + GreaterFireball_Timer = 1000; + SpellShield_Timer = 5000; + BlastWave_Timer = 20000; + + //reset encounter + if (pInstance) + pInstance->SetData(DATA_MAULGAREVENT, NOT_STARTED); + } + + void EnterCombat(Unit * who) + { + if (pInstance) + { + pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID()); + pInstance->SetData(DATA_MAULGAREVENT, IN_PROGRESS); + } + } + + void JustDied(Unit* /*Killer*/) + { + if (pInstance) + { + Creature *Maulgar = NULL; + Maulgar = (Unit::GetCreature((*me), pInstance->GetData64(DATA_MAULGAR))); + + if (Maulgar) + CAST_AI(boss_high_king_maulgarAI, Maulgar->AI())->AddDeath(); + + if (CheckAllBossDied(pInstance, me)) + pInstance->SetData(DATA_MAULGAREVENT, DONE); + } + } + + void UpdateAI(const uint32 diff) + { + //Only if not incombat check if the event is started + if (!me->isInCombat() && pInstance && pInstance->GetData(DATA_MAULGAREVENT)) + { + Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_MAULGAREVENT_TANK)); + + if (pTarget) + { + AttackStart(pTarget); + } + } + + //Return since we have no target + if (!UpdateVictim()) + return; + + //someone evaded! + if (pInstance && !pInstance->GetData(DATA_MAULGAREVENT)) + { + EnterEvadeMode(); + return; + } + + //GreaterFireball_Timer + if (GreaterFireball_Timer < diff || me->IsWithinDist(me->getVictim(), 30)) + { + DoCast(me->getVictim(), SPELL_GREATER_FIREBALL); + GreaterFireball_Timer = 2000; + } else GreaterFireball_Timer -= diff; + + //SpellShield_Timer + if (SpellShield_Timer <= diff) + { + me->InterruptNonMeleeSpells(false); + DoCast(me->getVictim(), SPELL_SPELLSHIELD); + SpellShield_Timer = 30000; + } else SpellShield_Timer -= diff; + + //BlastWave_Timer + if (BlastWave_Timer <= diff) + { + Unit *pTarget = NULL; + std::list t_list = me->getThreatManager().getThreatList(); + std::vector target_list; + for (std::list::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) + { + pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid()); + //15 yard radius minimum + if (pTarget && pTarget->IsWithinDist(me, 15,false)) + target_list.push_back(pTarget); + pTarget = NULL; + } + if (target_list.size()) + pTarget = *(target_list.begin()+rand()%target_list.size()); + + me->InterruptNonMeleeSpells(false); + DoCast(pTarget, SPELL_BLAST_WAVE); + BlastWave_Timer = 60000; + } else BlastWave_Timer -= diff; + } +}; + +CreatureAI* GetAI_boss_high_king_maulgar(Creature* pCreature) +{ + return new boss_high_king_maulgarAI (pCreature); +} + +CreatureAI* GetAI_boss_olm_the_summoner(Creature* pCreature) +{ + return new boss_olm_the_summonerAI (pCreature); +} + +CreatureAI *GetAI_boss_kiggler_the_crazed(Creature* pCreature) +{ + return new boss_kiggler_the_crazedAI (pCreature); +} + +CreatureAI *GetAI_boss_blindeye_the_seer(Creature* pCreature) +{ + return new boss_blindeye_the_seerAI (pCreature); +} + +CreatureAI *GetAI_boss_krosh_firehand(Creature* pCreature) +{ + return new boss_krosh_firehandAI (pCreature); +} + +void AddSC_boss_high_king_maulgar() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_high_king_maulgar"; + newscript->GetAI = &GetAI_boss_high_king_maulgar; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_kiggler_the_crazed"; + newscript->GetAI = &GetAI_boss_kiggler_the_crazed; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_blindeye_the_seer"; + newscript->GetAI = &GetAI_boss_blindeye_the_seer; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_olm_the_summoner"; + newscript->GetAI = &GetAI_boss_olm_the_summoner; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_krosh_firehand"; + newscript->GetAI = &GetAI_boss_krosh_firehand; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/Outland/GruulsLair/gruuls_lair.h b/src/server/scripts/Outland/GruulsLair/gruuls_lair.h new file mode 100644 index 00000000000..7003dcb1e26 --- /dev/null +++ b/src/server/scripts/Outland/GruulsLair/gruuls_lair.h @@ -0,0 +1,21 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_GRUULS_LAIR_H +#define DEF_GRUULS_LAIR_H + +#define DATA_BLINDEYETHESEER 1 +#define DATA_GRUULEVENT 2 +#define DATA_KIGGLERTHECRAZED 3 +#define DATA_KROSHFIREHAND 4 +#define DATA_MAULGAREVENT 5 +#define DATA_MAULGAREVENT_TANK 6 +#define DATA_OLMTHESUMMONER 7 +#define DATA_MAULGARDOOR 8 +#define DATA_GRUULDOOR 9 +#define DATA_MAULGAR 10 + +#define ERROR_INST_DATA "TSCR Error: Instance Data not set properly for Gruul's Lair instance (map 565). Encounters will be buggy." +#endif + diff --git a/src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp b/src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp new file mode 100644 index 00000000000..bb790a5d4ea --- /dev/null +++ b/src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp @@ -0,0 +1,193 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Gruuls_Lair +SD%Complete: 100 +SDComment: +SDCategory: Gruul's Lair +EndScriptData */ + +#include "ScriptedPch.h" +#include "gruuls_lair.h" + +#define MAX_ENCOUNTER 2 + +/* Gruuls Lair encounters: +1 - High King Maulgar event +2 - Gruul event +*/ + +struct instance_gruuls_lair : public ScriptedInstance +{ + instance_gruuls_lair(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + + uint64 MaulgarEvent_Tank; + uint64 KigglerTheCrazed; + uint64 BlindeyeTheSeer; + uint64 OlmTheSummoner; + uint64 KroshFirehand; + uint64 Maulgar; + + uint64 MaulgarDoor; + uint64 GruulDoor; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + MaulgarEvent_Tank = 0; + KigglerTheCrazed = 0; + BlindeyeTheSeer = 0; + OlmTheSummoner = 0; + KroshFirehand = 0; + Maulgar = 0; + + MaulgarDoor = 0; + GruulDoor = 0; + } + + bool IsEncounterInProgress() const + { + for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) return true; + + return false; + } + + void OnCreatureCreate(Creature* pCreature, bool /*add*/) + { + switch(pCreature->GetEntry()) + { + case 18835: KigglerTheCrazed = pCreature->GetGUID(); break; + case 18836: BlindeyeTheSeer = pCreature->GetGUID(); break; + case 18834: OlmTheSummoner = pCreature->GetGUID(); break; + case 18832: KroshFirehand = pCreature->GetGUID(); break; + case 18831: Maulgar = pCreature->GetGUID(); break; + } + } + + void OnGameObjectCreate(GameObject* pGo, bool /*add*/) + { + switch(pGo->GetEntry()) + { + case 184468: + MaulgarDoor = pGo->GetGUID(); + if (m_auiEncounter[0] == DONE) HandleGameObject(NULL, true, pGo); + break; + case 184662: GruulDoor = pGo->GetGUID(); break; + } + } + + void SetData64(uint32 type, uint64 data) + { + if (type == DATA_MAULGAREVENT_TANK) + MaulgarEvent_Tank = data; + } + + uint64 GetData64(uint32 identifier) + { + switch(identifier) + { + case DATA_MAULGAREVENT_TANK: return MaulgarEvent_Tank; + case DATA_KIGGLERTHECRAZED: return KigglerTheCrazed; + case DATA_BLINDEYETHESEER: return BlindeyeTheSeer; + case DATA_OLMTHESUMMONER: return OlmTheSummoner; + case DATA_KROSHFIREHAND: return KroshFirehand; + case DATA_MAULGARDOOR: return MaulgarDoor; + case DATA_GRUULDOOR: return GruulDoor; + case DATA_MAULGAR: return Maulgar; + } + return 0; + } + + void SetData(uint32 type, uint32 data) + { + switch(type) + { + case DATA_MAULGAREVENT: + if (data == DONE) HandleGameObject(MaulgarDoor, true); + m_auiEncounter[0] = data; break; + case DATA_GRUULEVENT: + if (data == IN_PROGRESS) HandleGameObject(GruulDoor, false); + else HandleGameObject(GruulDoor, true); + m_auiEncounter[1] = data; break; + } + + if (data == DONE) + SaveToDB(); + } + + uint32 GetData(uint32 type) + { + switch(type) + { + case DATA_MAULGAREVENT: return m_auiEncounter[0]; + case DATA_GRUULEVENT: return m_auiEncounter[1]; + } + return 0; + } + + std::string GetSaveData() + { + OUT_SAVE_INST_DATA; + std::ostringstream stream; + stream << m_auiEncounter[0] << " " << m_auiEncounter[1]; + char* out = new char[stream.str().length() + 1]; + strcpy(out, stream.str().c_str()); + if (out) + { + OUT_SAVE_INST_DATA_COMPLETE; + return out; + } + + return NULL; + } + + void Load(const char* in) + { + if (!in) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(in); + std::istringstream stream(in); + stream >> m_auiEncounter[0] >> m_auiEncounter[1]; + for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) // Do not load an encounter as "In Progress" - reset it instead. + m_auiEncounter[i] = NOT_STARTED; + OUT_LOAD_INST_DATA_COMPLETE; + } +}; + +InstanceData* GetInstanceData_instance_gruuls_lair(Map* pMap) +{ + return new instance_gruuls_lair(pMap); +} + +void AddSC_instance_gruuls_lair() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_gruuls_lair"; + newscript->GetInstanceData = &GetInstanceData_instance_gruuls_lair; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/Outland/HellfireCitadel/blood_furnace/blood_furnace.h b/src/server/scripts/Outland/HellfireCitadel/blood_furnace/blood_furnace.h new file mode 100644 index 00000000000..b845c66823f --- /dev/null +++ b/src/server/scripts/Outland/HellfireCitadel/blood_furnace/blood_furnace.h @@ -0,0 +1,29 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_BLOOD_FURNACE_H +#define DEF_BLOOD_FURNACE_H + +#define DATA_THE_MAKER 1 +#define DATA_BROGGOK 2 +#define DATA_KELIDAN_THE_MAKER 3 +#define TYPE_THE_MAKER_EVENT 4 +#define TYPE_BROGGOK_EVENT 5 +#define TYPE_KELIDAN_THE_BREAKER_EVENT 6 +#define DATA_DOOR1 7 +#define DATA_DOOR2 8 +#define DATA_DOOR3 9 +#define DATA_DOOR4 10 +#define DATA_DOOR5 11 +#define DATA_DOOR6 12 +#define DATA_PRISON_CELL1 13 +#define DATA_PRISON_CELL2 14 +#define DATA_PRISON_CELL3 15 +#define DATA_PRISON_CELL4 16 +#define DATA_PRISON_CELL5 17 +#define DATA_PRISON_CELL6 18 +#define DATA_PRISON_CELL7 19 +#define DATA_PRISON_CELL8 20 +#endif + diff --git a/src/server/scripts/Outland/HellfireCitadel/blood_furnace/boss_broggok.cpp b/src/server/scripts/Outland/HellfireCitadel/blood_furnace/boss_broggok.cpp new file mode 100644 index 00000000000..d5fb9bdba49 --- /dev/null +++ b/src/server/scripts/Outland/HellfireCitadel/blood_furnace/boss_broggok.cpp @@ -0,0 +1,131 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Broggok +SD%Complete: 70 +SDComment: pre-event not made +SDCategory: Hellfire Citadel, Blood Furnace +EndScriptData */ + +#include "ScriptedPch.h" +#include "blood_furnace.h" + +enum eEnums +{ + SAY_AGGRO = -1542008, + + SPELL_SLIME_SPRAY = 30913, + SPELL_POISON_CLOUD = 30916, + SPELL_POISON_BOLT = 30917, + + SPELL_POISON = 30914 +}; + +struct boss_broggokAI : public ScriptedAI +{ + boss_broggokAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint32 AcidSpray_Timer; + uint32 PoisonSpawn_Timer; + uint32 PoisonBolt_Timer; + + void Reset() + { + AcidSpray_Timer = 10000; + PoisonSpawn_Timer = 5000; + PoisonBolt_Timer = 7000; + if (pInstance) + { + pInstance->SetData(TYPE_BROGGOK_EVENT, NOT_STARTED); + pInstance->HandleGameObject(pInstance->GetData64(DATA_DOOR4), true); + } + } + + void EnterCombat(Unit * /*who*/) + { + DoScriptText(SAY_AGGRO, me); + if (pInstance) + { + pInstance->SetData(TYPE_BROGGOK_EVENT, IN_PROGRESS); + pInstance->HandleGameObject(pInstance->GetData64(DATA_DOOR4), false); + } + } + + void JustSummoned(Creature *summoned) + { + summoned->setFaction(16); + summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + summoned->CastSpell(summoned,SPELL_POISON,false,0,0,me->GetGUID()); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (AcidSpray_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_SLIME_SPRAY); + AcidSpray_Timer = 4000+rand()%8000; + } else AcidSpray_Timer -=diff; + + if (PoisonBolt_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_POISON_BOLT); + PoisonBolt_Timer = 4000+rand()%8000; + } else PoisonBolt_Timer -=diff; + + if (PoisonSpawn_Timer <= diff) + { + DoCast(me, SPELL_POISON_CLOUD); + PoisonSpawn_Timer = 20000; + } else PoisonSpawn_Timer -=diff; + + DoMeleeAttackIfReady(); + } + + void JustDied(Unit* /*who*/) + { + if (pInstance) + { + pInstance->HandleGameObject(pInstance->GetData64(DATA_DOOR4), true); + pInstance->HandleGameObject(pInstance->GetData64(DATA_DOOR5), true); + pInstance->SetData(TYPE_BROGGOK_EVENT, DONE); + } + } + +}; + +CreatureAI* GetAI_boss_broggok(Creature* pCreature) +{ + return new boss_broggokAI (pCreature); +} + +void AddSC_boss_broggok() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_broggok"; + newscript->GetAI = &GetAI_boss_broggok; + newscript->RegisterSelf(); +} diff --git a/src/server/scripts/Outland/HellfireCitadel/blood_furnace/boss_kelidan_the_breaker.cpp b/src/server/scripts/Outland/HellfireCitadel/blood_furnace/boss_kelidan_the_breaker.cpp new file mode 100644 index 00000000000..a44ad9cc3c8 --- /dev/null +++ b/src/server/scripts/Outland/HellfireCitadel/blood_furnace/boss_kelidan_the_breaker.cpp @@ -0,0 +1,356 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Kelidan_The_Breaker +SD%Complete: 100 +SDComment: +SDCategory: Hellfire Citadel, Blood Furnace +EndScriptData */ + +/* ContentData +boss_kelidan_the_breaker +mob_shadowmoon_channeler +EndContentData */ + +#include "ScriptedPch.h" +#include "blood_furnace.h" + +enum eKelidan +{ + SAY_WAKE = -1542000, + SAY_ADD_AGGRO_1 = -1542001, + SAY_ADD_AGGRO_2 = -1542002, + SAY_ADD_AGGRO_3 = -1542003, + SAY_KILL_1 = -1542004, + SAY_KILL_2 = -1542005, + SAY_NOVA = -1542006, + SAY_DIE = -1542007, + + SPELL_CORRUPTION = 30938, + SPELL_EVOCATION = 30935, + + SPELL_FIRE_NOVA = 33132, + H_SPELL_FIRE_NOVA = 37371, + + SPELL_SHADOW_BOLT_VOLLEY = 28599, + H_SPELL_SHADOW_BOLT_VOLLEY = 40070, + + SPELL_BURNING_NOVA = 30940, + SPELL_VORTEX = 37370, + + ENTRY_KELIDAN = 17377, + ENTRY_CHANNELER = 17653 +}; + +const float ShadowmoonChannelers[5][4]= +{ + {302,-87,-24.4,0.157}, + {321,-63.5,-24.6,4.887}, + {346,-74.5,-24.6,3.595}, + {344,-103.5,-24.5,2.356}, + {316,-109,-24.6,1.257} +}; + +struct boss_kelidan_the_breakerAI : public ScriptedAI +{ + boss_kelidan_the_breakerAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + for (uint8 i=0; i<5; ++i) + Channelers[i] = 0; + } + + ScriptedInstance* pInstance; + + uint32 ShadowVolley_Timer; + uint32 BurningNova_Timer; + uint32 Firenova_Timer; + uint32 Corruption_Timer; + uint32 check_Timer; + bool Firenova; + bool addYell; + uint64 Channelers[5]; + + void Reset() + { + ShadowVolley_Timer = 1000; + BurningNova_Timer = 15000; + Corruption_Timer = 5000; + check_Timer = 0; + Firenova = false; + addYell = false; + SummonChannelers(); + if (pInstance) + pInstance->SetData(TYPE_KELIDAN_THE_BREAKER_EVENT, NOT_STARTED); + } + + void EnterCombat(Unit* who) + { + DoScriptText(SAY_WAKE, me); + if (me->IsNonMeleeSpellCasted(false)) + me->InterruptNonMeleeSpells(true); + DoStartMovement(who); + if (pInstance) + pInstance->SetData(TYPE_KELIDAN_THE_BREAKER_EVENT, IN_PROGRESS); + } + + void KilledUnit(Unit* /*victim*/) + { + if (rand()%2) + return; + + DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2), me); + } + + void ChannelerEngaged(Unit* who) + { + if (who && !addYell) + { + addYell = true; + DoScriptText(RAND(SAY_ADD_AGGRO_1,SAY_ADD_AGGRO_2,SAY_ADD_AGGRO_3), me); + } + for (uint8 i=0; i<5; ++i) + { + Creature *channeler = Unit::GetCreature(*me, Channelers[i]); + if (who && channeler && !channeler->isInCombat()) + channeler->AI()->AttackStart(who); + } + } + + void ChannelerDied(Unit* killer) + { + for (uint8 i=0; i<5; ++i) + { + Creature *channeler = Unit::GetCreature(*me, Channelers[i]); + if (channeler && channeler->isAlive()) + return; + } + + if (killer) + me->AI()->AttackStart(killer); + } + + uint64 GetChanneled(Creature *channeler1) + { + SummonChannelers(); + if (!channeler1) return NULL; + uint8 i; + for (i=0; i<5; ++i) + { + Creature *channeler = Unit::GetCreature(*me, Channelers[i]); + if (channeler && channeler->GetGUID() == channeler1->GetGUID()) + break; + } + return Channelers[(i+2)%5]; + } + + void SummonChannelers() + { + for (uint8 i=0; i<5; ++i) + { + Creature *channeler = Unit::GetCreature(*me, Channelers[i]); + if (!channeler || channeler->isDead()) + channeler = me->SummonCreature(ENTRY_CHANNELER,ShadowmoonChannelers[i][0],ShadowmoonChannelers[i][1],ShadowmoonChannelers[i][2],ShadowmoonChannelers[i][3],TEMPSUMMON_CORPSE_TIMED_DESPAWN,300000); + if (channeler) + Channelers[i] = channeler->GetGUID(); + else + Channelers[i] = 0; + } + } + + void JustDied(Unit* /*Killer*/) + { + DoScriptText(SAY_DIE, me); + + if (!pInstance) + return; + + pInstance->SetData(TYPE_KELIDAN_THE_BREAKER_EVENT, DONE); + pInstance->HandleGameObject(pInstance->GetData64(DATA_DOOR1), true); + pInstance->HandleGameObject(pInstance->GetData64(DATA_DOOR6), true); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + { + if (check_Timer <= diff) + { + if (!me->IsNonMeleeSpellCasted(false)) + DoCast(me, SPELL_EVOCATION); + check_Timer = 5000; + } else check_Timer -= diff; + return; + } + + if (Firenova) + { + if (Firenova_Timer <= diff) + { + DoCast(me, SPELL_FIRE_NOVA, true); + Firenova = false; + ShadowVolley_Timer = 2000; + } else Firenova_Timer -=diff; + + return; + } + + if (ShadowVolley_Timer <= diff) + { + DoCast(me, SPELL_SHADOW_BOLT_VOLLEY); + ShadowVolley_Timer = 5000+rand()%8000; + } else ShadowVolley_Timer -=diff; + + if (Corruption_Timer <= diff) + { + DoCast(me, SPELL_CORRUPTION); + Corruption_Timer = 30000+rand()%20000; + } else Corruption_Timer -=diff; + + if (BurningNova_Timer <= diff) + { + if (me->IsNonMeleeSpellCasted(false)) + me->InterruptNonMeleeSpells(true); + + DoScriptText(SAY_NOVA, me); + + if (SpellEntry *nova = GET_SPELL(SPELL_BURNING_NOVA)) + { + if (Aura * aura = Aura::TryCreate(nova, me, me)) + aura->ApplyForTargets(); + } + + if (IsHeroic()) + DoTeleportAll(me->GetPositionX(),me->GetPositionY(),me->GetPositionZ(),me->GetOrientation()); + + BurningNova_Timer = 20000+rand()%8000; + Firenova_Timer= 5000; + Firenova = true; + } else BurningNova_Timer -=diff; + + DoMeleeAttackIfReady(); + } + +}; + +CreatureAI* GetAI_boss_kelidan_the_breaker(Creature* pCreature) +{ + return new boss_kelidan_the_breakerAI (pCreature); +} + +/*###### +## mob_shadowmoon_channeler +######*/ + +enum eShadowmoon +{ + SPELL_SHADOW_BOLT = 12739, + H_SPELL_SHADOW_BOLT = 15472, + + SPELL_MARK_OF_SHADOW = 30937, + SPELL_CHANNELING = 39123 +}; + +struct mob_shadowmoon_channelerAI : public ScriptedAI +{ + mob_shadowmoon_channelerAI(Creature *c) : ScriptedAI(c) + { + } + + uint32 ShadowBolt_Timer; + uint32 MarkOfShadow_Timer; + uint32 check_Timer; + + void Reset() + { + ShadowBolt_Timer = 1000+rand()%1000; + MarkOfShadow_Timer = 5000+rand()%2000; + check_Timer = 0; + if (me->IsNonMeleeSpellCasted(false)) + me->InterruptNonMeleeSpells(true); + } + + void EnterCombat(Unit* who) + { + if (Creature *Kelidan = me->FindNearestCreature(ENTRY_KELIDAN, 100)) + CAST_AI(boss_kelidan_the_breakerAI, Kelidan->AI())->ChannelerEngaged(who); + if (me->IsNonMeleeSpellCasted(false)) + me->InterruptNonMeleeSpells(true); + DoStartMovement(who); + } + + void JustDied(Unit* Killer) + { + if (Creature *Kelidan = me->FindNearestCreature(ENTRY_KELIDAN, 100)) + CAST_AI(boss_kelidan_the_breakerAI, Kelidan->AI())->ChannelerDied(Killer); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + { + if (check_Timer <= diff) + { + if (!me->IsNonMeleeSpellCasted(false)) + if (Creature *Kelidan = me->FindNearestCreature(ENTRY_KELIDAN, 100)) + { + uint64 channeler = CAST_AI(boss_kelidan_the_breakerAI, Kelidan->AI())->GetChanneled(me); + if (Unit *channeled = Unit::GetUnit(*me, channeler)) + DoCast(channeled, SPELL_CHANNELING); + } + check_Timer = 5000; + } else check_Timer -= diff; + return; + } + + if (MarkOfShadow_Timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(pTarget, SPELL_MARK_OF_SHADOW); + MarkOfShadow_Timer = 15000+rand()%5000; + } else MarkOfShadow_Timer -=diff; + + if (ShadowBolt_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_SHADOW_BOLT); + ShadowBolt_Timer = 5000+rand()%1000; + } else ShadowBolt_Timer -=diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_shadowmoon_channeler(Creature* pCreature) +{ + return new mob_shadowmoon_channelerAI (pCreature); +} + +void AddSC_boss_kelidan_the_breaker() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_kelidan_the_breaker"; + newscript->GetAI = &GetAI_boss_kelidan_the_breaker; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_shadowmoon_channeler"; + newscript->GetAI = &GetAI_mob_shadowmoon_channeler; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/Outland/HellfireCitadel/blood_furnace/boss_the_maker.cpp b/src/server/scripts/Outland/HellfireCitadel/blood_furnace/boss_the_maker.cpp new file mode 100644 index 00000000000..45219b6509b --- /dev/null +++ b/src/server/scripts/Outland/HellfireCitadel/blood_furnace/boss_the_maker.cpp @@ -0,0 +1,152 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_The_Maker +SD%Complete: 80 +SDComment: Mind control no support +SDCategory: Hellfire Citadel, Blood Furnace +EndScriptData */ + +#include "ScriptedPch.h" +#include "blood_furnace.h" + +enum eEnums +{ + SAY_AGGRO_1 = -1542009, + SAY_AGGRO_2 = -1542010, + SAY_AGGRO_3 = -1542011, + SAY_KILL_1 = -1542012, + SAY_KILL_2 = -1542013, + SAY_DIE = -1542014, + + SPELL_ACID_SPRAY = 38153, // heroic 38973 ??? 38153 + SPELL_EXPLODING_BREAKER = 30925, + SPELL_KNOCKDOWN = 20276, + SPELL_DOMINATION = 25772 // ??? +}; + +struct boss_the_makerAI : public ScriptedAI +{ + boss_the_makerAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint32 AcidSpray_Timer; + uint32 ExplodingBreaker_Timer; + uint32 Domination_Timer; + uint32 Knockdown_Timer; + + void Reset() + { + AcidSpray_Timer = 15000; + ExplodingBreaker_Timer = 6000; + Domination_Timer = 120000; + Knockdown_Timer = 10000; + + if (!pInstance) + return; + + pInstance->SetData(TYPE_THE_MAKER_EVENT, NOT_STARTED); + pInstance->HandleGameObject(pInstance->GetData64(DATA_DOOR2), true); + } + + void EnterCombat(Unit * /*who*/) + { + DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3), me); + + if (!pInstance) + return; + + pInstance->SetData(TYPE_THE_MAKER_EVENT, IN_PROGRESS); + pInstance->HandleGameObject(pInstance->GetData64(DATA_DOOR2), false); + } + + void KilledUnit(Unit* /*victim*/) + { + DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2), me); + } + + void JustDied(Unit* /*Killer*/) + { + DoScriptText(SAY_DIE, me); + + if (!pInstance) + return; + + pInstance->SetData(TYPE_THE_MAKER_EVENT, DONE); + pInstance->HandleGameObject(pInstance->GetData64(DATA_DOOR2), true); + pInstance->HandleGameObject(pInstance->GetData64(DATA_DOOR3), true); + + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (AcidSpray_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_ACID_SPRAY); + AcidSpray_Timer = 15000+rand()%8000; + } else AcidSpray_Timer -=diff; + + if (ExplodingBreaker_Timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(pTarget, SPELL_EXPLODING_BREAKER); + ExplodingBreaker_Timer = 4000+rand()%8000; + } else ExplodingBreaker_Timer -=diff; + + /* // Disabled until Core Support for mind control + if (domination_timer_timer <= diff) + { + Unit *pTarget; + pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); + + DoCast(pTarget, SPELL_DOMINATION); + + domination_timer = 120000; + } else domination_timer -=diff; + */ + + if (Knockdown_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_KNOCKDOWN); + Knockdown_Timer = 4000+rand()%8000; + } else Knockdown_Timer -=diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_the_makerAI(Creature* pCreature) +{ + return new boss_the_makerAI (pCreature); +} + +void AddSC_boss_the_maker() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_the_maker"; + newscript->GetAI = &GetAI_boss_the_makerAI; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/Outland/HellfireCitadel/blood_furnace/instance_blood_furnace.cpp b/src/server/scripts/Outland/HellfireCitadel/blood_furnace/instance_blood_furnace.cpp new file mode 100644 index 00000000000..3a2eb8ba5ee --- /dev/null +++ b/src/server/scripts/Outland/HellfireCitadel/blood_furnace/instance_blood_furnace.cpp @@ -0,0 +1,232 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Blood_Furnace +SD%Complete: 85 +SDComment: +SDCategory: Hellfire Citadel, Blood Furnace +EndScriptData */ + +#include "ScriptedPch.h" +#include "blood_furnace.h" + +#define ENTRY_SEWER1 181823 +#define ENTRY_SEWER2 181766 +#define MAX_ENCOUNTER 3 + +struct instance_blood_furnace : public ScriptedInstance +{ + instance_blood_furnace(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint64 The_MakerGUID; + uint64 BroggokGUID; + uint64 Kelidan_The_BreakerGUID; + + uint64 Door1GUID; + uint64 Door2GUID; + uint64 Door3GUID; + uint64 Door4GUID; + uint64 Door5GUID; + uint64 Door6GUID; + + uint64 PrisonCell1GUID; + uint64 PrisonCell2GUID; + uint64 PrisonCell3GUID; + uint64 PrisonCell4GUID; + uint64 PrisonCell5GUID; + uint64 PrisonCell6GUID; + uint64 PrisonCell7GUID; + uint64 PrisonCell8GUID; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + std::string str_data; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + The_MakerGUID = 0; + BroggokGUID = 0; + Kelidan_The_BreakerGUID = 0; + + Door1GUID = 0; + Door2GUID = 0; + Door3GUID = 0; + Door4GUID = 0; + Door5GUID = 0; + Door6GUID = 0; + + PrisonCell1GUID = 0; + PrisonCell2GUID = 0; + PrisonCell3GUID = 0; + PrisonCell4GUID = 0; + PrisonCell5GUID = 0; + PrisonCell6GUID = 0; + PrisonCell7GUID = 0; + PrisonCell8GUID = 0; + } + + void OnCreatureCreate(Creature* pCreature, bool add) + { + if (!add) + return; + + switch(pCreature->GetEntry()) + { + case 17381: The_MakerGUID = pCreature->GetGUID(); break; + case 17380: BroggokGUID = pCreature->GetGUID(); break; + case 17377: Kelidan_The_BreakerGUID = pCreature->GetGUID(); break; + } + } + + void OnGameObjectCreate(GameObject* pGo, bool add) + { + if (!add) + return; + + if (pGo->GetEntry() == 181766) //Final exit door + Door1GUID = pGo->GetGUID(); + if (pGo->GetEntry() == 181811) //The Maker Front door + Door2GUID = pGo->GetGUID(); + if (pGo->GetEntry() == 181812) //The Maker Rear door + Door3GUID = pGo->GetGUID(); + if (pGo->GetEntry() == 181822) //Broggok Front door + Door4GUID = pGo->GetGUID(); + if (pGo->GetEntry() == 181819) //Broggok Rear door + Door5GUID = pGo->GetGUID(); + if (pGo->GetEntry() == 181823) //Kelidan exit door + Door6GUID = pGo->GetGUID(); + + if (pGo->GetEntry() == 181813) //The Maker prison cell front right + PrisonCell1GUID = pGo->GetGUID(); + if (pGo->GetEntry() == 181814) //The Maker prison cell back right + PrisonCell2GUID = pGo->GetGUID(); + if (pGo->GetEntry() == 181816) //The Maker prison cell front left + PrisonCell3GUID = pGo->GetGUID(); + if (pGo->GetEntry() == 181815) //The Maker prison cell back left + PrisonCell4GUID = pGo->GetGUID(); + if (pGo->GetEntry() == 181821) //Broggok prison cell front right + PrisonCell5GUID = pGo->GetGUID(); + if (pGo->GetEntry() == 181818) //Broggok prison cell back right + PrisonCell6GUID = pGo->GetGUID(); + if (pGo->GetEntry() == 181820) //Broggok prison cell front left + PrisonCell7GUID = pGo->GetGUID(); + if (pGo->GetEntry() == 181817) //Broggok prison cell back left + PrisonCell8GUID = pGo->GetGUID(); + } + + uint64 GetData64(uint32 data) + { + switch(data) + { + case DATA_THE_MAKER: return The_MakerGUID; + case DATA_BROGGOK: return BroggokGUID; + case DATA_KELIDAN_THE_MAKER: return Kelidan_The_BreakerGUID; + case DATA_DOOR1: return Door1GUID; + case DATA_DOOR2: return Door2GUID; + case DATA_DOOR3: return Door3GUID; + case DATA_DOOR4: return Door4GUID; + case DATA_DOOR5: return Door5GUID; + case DATA_DOOR6: return Door6GUID; + case DATA_PRISON_CELL1: return PrisonCell1GUID; + case DATA_PRISON_CELL2: return PrisonCell2GUID; + case DATA_PRISON_CELL3: return PrisonCell3GUID; + case DATA_PRISON_CELL4: return PrisonCell4GUID; + case DATA_PRISON_CELL5: return PrisonCell5GUID; + case DATA_PRISON_CELL6: return PrisonCell6GUID; + case DATA_PRISON_CELL7: return PrisonCell7GUID; + case DATA_PRISON_CELL8: return PrisonCell8GUID; + } + + return 0; + } + + void SetData(uint32 /*type*/, uint32 data) + { + switch(data) + { + case TYPE_THE_MAKER_EVENT: m_auiEncounter[0] = data; break; + case TYPE_BROGGOK_EVENT: m_auiEncounter[1] = data; break; + case TYPE_KELIDAN_THE_BREAKER_EVENT: m_auiEncounter[2] = data; break; + } + + if (data == DONE) + { + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2]; + + str_data = saveStream.str(); + + SaveToDB(); + OUT_SAVE_INST_DATA_COMPLETE; + } + } + + uint32 GetData(uint32 data) + { + switch(data) + { + case TYPE_THE_MAKER_EVENT: return m_auiEncounter[0]; + case TYPE_BROGGOK_EVENT: return m_auiEncounter[1]; + case TYPE_KELIDAN_THE_BREAKER_EVENT: return m_auiEncounter[2]; + } + + return 0; + } + + const char* Save() + { + return str_data.c_str(); + } + + void Load(const char* in) + { + if (!in) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(in); + + std::istringstream loadStream(in); + loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2]; + + for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS || m_auiEncounter[i] == FAIL) + m_auiEncounter[i] = NOT_STARTED; + + OUT_LOAD_INST_DATA_COMPLETE; + } +}; + +InstanceData* GetInstanceData_instance_blood_furnace(Map* pMap) +{ + return new instance_blood_furnace(pMap); +} + +void AddSC_instance_blood_furnace() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_blood_furnace"; + newscript->GetInstanceData = &GetInstanceData_instance_blood_furnace; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/Outland/HellfireCitadel/hellfire_ramparts/boss_omor_the_unscarred.cpp b/src/server/scripts/Outland/HellfireCitadel/hellfire_ramparts/boss_omor_the_unscarred.cpp new file mode 100644 index 00000000000..d6c0b2fd401 --- /dev/null +++ b/src/server/scripts/Outland/HellfireCitadel/hellfire_ramparts/boss_omor_the_unscarred.cpp @@ -0,0 +1,206 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Omar_The_Unscarred +SD%Complete: 90 +SDComment: Temporary solution for orbital/shadow whip-ability. Needs more core support before making it more proper. +SDCategory: Hellfire Citadel, Hellfire Ramparts +EndScriptData */ + +#include "ScriptedPch.h" + +#define SAY_AGGRO_1 -1543009 +#define SAY_AGGRO_2 -1543010 +#define SAY_AGGRO_3 -1543011 +#define SAY_SUMMON -1543012 +#define SAY_CURSE -1543013 +#define SAY_KILL_1 -1543014 +#define SAY_DIE -1543015 +#define SAY_WIPE -1543016 + +#define SPELL_ORBITAL_STRIKE 30637 +#define SPELL_SHADOW_WHIP 30638 +#define SPELL_TREACHEROUS_AURA 30695 +#define H_SPELL_BANE_OF_TREACHERY 37566 +#define SPELL_DEMONIC_SHIELD 31901 +#define SPELL_SHADOW_BOLT 30686 +#define H_SPELL_SHADOW_BOLT 39297 +#define SPELL_SUMMON_FIENDISH_HOUND 30707 + +struct boss_omor_the_unscarredAI : public ScriptedAI +{ + boss_omor_the_unscarredAI(Creature *c) : ScriptedAI(c) + { + SetCombatMovement(false); + } + + uint32 OrbitalStrike_Timer; + uint32 ShadowWhip_Timer; + uint32 Aura_Timer; + uint32 DemonicShield_Timer; + uint32 Shadowbolt_Timer; + uint32 Summon_Timer; + uint32 SummonedCount; + uint64 PlayerGUID; + bool CanPullBack; + + void Reset() + { + DoScriptText(SAY_WIPE, me); + + OrbitalStrike_Timer = 25000; + ShadowWhip_Timer = 2000; + Aura_Timer = 10000; + DemonicShield_Timer = 1000; + Shadowbolt_Timer = 2000; + Summon_Timer = 10000; + SummonedCount = 0; + PlayerGUID = 0; + CanPullBack = false; + } + + void EnterCombat(Unit * /*who*/) + { + DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3), me); + } + + void KilledUnit(Unit* /*victim*/) + { + if (rand()%2) + return; + + DoScriptText(SAY_KILL_1, me); + } + + void JustSummoned(Creature* summoned) + { + DoScriptText(SAY_SUMMON, me); + + if (Unit* random = SelectUnit(SELECT_TARGET_RANDOM,0)) + summoned->AI()->AttackStart(random); + + ++SummonedCount; + } + + void JustDied(Unit* /*Killer*/) + { + DoScriptText(SAY_DIE, me); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //only two may be wrong, perhaps increase timer and spawn periodically instead. + if (SummonedCount < 2) + { + if (Summon_Timer <= diff) + { + me->InterruptNonMeleeSpells(false); + DoCast(me, SPELL_SUMMON_FIENDISH_HOUND); + Summon_Timer = 15000+rand()%15000; + } else Summon_Timer -= diff; + } + + if (CanPullBack) + { + if (ShadowWhip_Timer <= diff) + { + if (Player* temp = Unit::GetPlayer(PlayerGUID)) + { + //if unit dosen't have this flag, then no pulling back (script will attempt cast, even if orbital strike was resisted) + if (temp->HasUnitMovementFlag(MOVEMENTFLAG_FALLING)) + { + me->InterruptNonMeleeSpells(false); + DoCast(temp, SPELL_SHADOW_WHIP); + } + } + PlayerGUID = 0; + ShadowWhip_Timer = 2000; + CanPullBack = false; + } else ShadowWhip_Timer -= diff; + } + else if (OrbitalStrike_Timer <= diff) + { + Unit* temp = NULL; + if (me->IsWithinMeleeRange(me->getVictim())) + temp = me->getVictim(); + else temp = SelectUnit(SELECT_TARGET_RANDOM,0); + + if (temp && temp->GetTypeId() == TYPEID_PLAYER) + { + DoCast(temp, SPELL_ORBITAL_STRIKE); + OrbitalStrike_Timer = 14000+rand()%2000; + PlayerGUID = temp->GetGUID(); + + if (PlayerGUID) + CanPullBack = true; + } + } else OrbitalStrike_Timer -= diff; + + if ((me->GetHealth()*100) / me->GetMaxHealth() < 20) + { + if (DemonicShield_Timer <= diff) + { + DoCast(me, SPELL_DEMONIC_SHIELD); + DemonicShield_Timer = 15000; + } else DemonicShield_Timer -= diff; + } + + if (Aura_Timer <= diff) + { + DoScriptText(SAY_CURSE, me); + + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + { + DoCast(pTarget, SPELL_TREACHEROUS_AURA); + Aura_Timer = 8000+rand()%8000; + } + } else Aura_Timer -= diff; + + if (Shadowbolt_Timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + { + if (pTarget) + pTarget = me->getVictim(); + + DoCast(pTarget, SPELL_SHADOW_BOLT); + Shadowbolt_Timer = 4000+rand()%2500; + } + } else Shadowbolt_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_omor_the_unscarredAI(Creature* pCreature) +{ + return new boss_omor_the_unscarredAI (pCreature); +} + +void AddSC_boss_omor_the_unscarred() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_omor_the_unscarred"; + newscript->GetAI = &GetAI_boss_omor_the_unscarredAI; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/Outland/HellfireCitadel/hellfire_ramparts/boss_vazruden_the_herald.cpp b/src/server/scripts/Outland/HellfireCitadel/hellfire_ramparts/boss_vazruden_the_herald.cpp new file mode 100644 index 00000000000..181911f77a4 --- /dev/null +++ b/src/server/scripts/Outland/HellfireCitadel/hellfire_ramparts/boss_vazruden_the_herald.cpp @@ -0,0 +1,467 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +Name: Boss_Vazruden_the_Herald +%Complete: 90 +Comment: +Category: Hellfire Citadel, Hellfire Ramparts +EndScriptData */ + +#include "ScriptedPch.h" + +#define SPELL_FIREBALL DUNGEON_MODE(34653, 36920) +#define SPELL_CONE_OF_FIRE DUNGEON_MODE(30926, 36921) +#define SPELL_SUMMON_LIQUID_FIRE DUNGEON_MODE(23971, 30928) +#define SPELL_BELLOWING_ROAR 39427 +#define SPELL_REVENGE DUNGEON_MODE(19130, 40392) +#define SPELL_KIDNEY_SHOT 30621 +#define SPELL_FIRE_NOVA_VISUAL 19823 + +#define ENTRY_HELLFIRE_SENTRY 17517 +#define ENTRY_VAZRUDEN_HERALD 17307 +#define ENTRY_VAZRUDEN 17537 +#define ENTRY_NAZAN 17536 +#define ENTRY_LIQUID_FIRE 22515 +#define ENTRY_REINFORCED_FEL_IRON_CHEST DUNGEON_MODE(185168, 185169) + +#define SAY_INTRO -1543017 +#define SAY_WIPE -1543018 +#define SAY_AGGRO_1 -1543019 +#define SAY_AGGRO_2 -1543020 +#define SAY_AGGRO_3 -1543021 +#define SAY_KILL_1 -1543022 +#define SAY_KILL_2 -1543023 +#define SAY_DIE -1543024 +#define EMOTE -1543025 + +#define PATH_ENTRY 2081 + +const float VazrudenMiddle[3] = {-1406.5, 1746.5, 81.2}; +const float VazrudenRing[2][3] = +{ + {-1430, 1705, 112}, + {-1377, 1760, 112} +}; + +struct boss_nazanAI : public ScriptedAI +{ + boss_nazanAI(Creature *c) : ScriptedAI(c) + { + VazrudenGUID = 0; + flight = true; + } + + uint32 Fireball_Timer; + uint32 ConeOfFire_Timer; + uint32 BellowingRoar_Timer; + uint32 Fly_Timer; + uint32 Turn_Timer; + uint32 UnsummonCheck; + bool flight; + uint64 VazrudenGUID; + SpellEntry *liquid_fire; + + void Reset() + { + Fireball_Timer = 4000; + Fly_Timer = 45000; + Turn_Timer = 0; + UnsummonCheck = 5000; + } + + void EnterCombat(Unit* /*who*/) {} + + void JustSummoned(Creature *summoned) + { + if (summoned && summoned->GetEntry() == ENTRY_LIQUID_FIRE) + { + summoned->SetLevel(me->getLevel()); + summoned->setFaction(me->getFaction()); + summoned->CastSpell(summoned,SPELL_SUMMON_LIQUID_FIRE,true); + summoned->CastSpell(summoned,SPELL_FIRE_NOVA_VISUAL,true); + } + } + + void SpellHitTarget(Unit *pTarget, const SpellEntry* entry) + { + if (pTarget && entry->Id == uint32(SPELL_FIREBALL)) + me->SummonCreature(ENTRY_LIQUID_FIRE,pTarget->GetPositionX(),pTarget->GetPositionY(),pTarget->GetPositionZ(),pTarget->GetOrientation(),TEMPSUMMON_TIMED_DESPAWN,30000); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + { + if (UnsummonCheck < diff && me->isAlive()) + me->DisappearAndDie(); + else + UnsummonCheck -= diff; + return; + } + + if (Fireball_Timer <= diff) + { + if (Unit *victim = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(victim, SPELL_FIREBALL, true); + Fireball_Timer = urand(4000,7000); + } else Fireball_Timer -= diff; + + if (flight) // phase 1 - the flight + { + Creature *Vazruden = Unit::GetCreature(*me,VazrudenGUID); + if (Fly_Timer < diff || !(Vazruden && Vazruden->isAlive() && (Vazruden->GetHealth()*5 > Vazruden->GetMaxHealth()))) + { + flight = false; + BellowingRoar_Timer = 6000; + ConeOfFire_Timer = 12000; + me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + me->GetMotionMaster()->Clear(); + if (Unit *victim = SelectUnit(SELECT_TARGET_NEAREST,0)) + me->AI()->AttackStart(victim); + DoStartMovement(me->getVictim()); + DoScriptText(EMOTE, me); + return; + } else Fly_Timer -= diff; + + if (Turn_Timer <= diff) + { + uint32 waypoint = (Fly_Timer/10000)%2; + if (me->IsWithinDist3d(VazrudenRing[waypoint][0],VazrudenRing[waypoint][1],VazrudenRing[waypoint][2], 5)) + me->GetMotionMaster()->MovePoint(0,VazrudenRing[waypoint][0],VazrudenRing[waypoint][1],VazrudenRing[waypoint][2]); + Turn_Timer = 10000; + } else Turn_Timer -= diff; + } + else // phase 2 - land fight + { + if (ConeOfFire_Timer <= diff) + { + DoCast(me, SPELL_CONE_OF_FIRE); + ConeOfFire_Timer = 12000; + Fireball_Timer = 4000; + } else ConeOfFire_Timer -= diff; + + if (IsHeroic()) + if (BellowingRoar_Timer <= diff) + { + DoCast(me, SPELL_BELLOWING_ROAR); + BellowingRoar_Timer = 45000; + } else BellowingRoar_Timer -= diff; + + DoMeleeAttackIfReady(); + } + } +}; + +struct boss_vazrudenAI : public ScriptedAI +{ + boss_vazrudenAI(Creature *c) : ScriptedAI(c) + { + } + + uint32 Revenge_Timer; + bool WipeSaid; + uint32 UnsummonCheck; + + void Reset() + { + Revenge_Timer = 4000; + UnsummonCheck = 2000; + WipeSaid = false; + } + + void EnterCombat(Unit * /*who*/) + { + DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3), me); + } + + void KilledUnit(Unit* who) + { + if (who && who->GetEntry() != ENTRY_VAZRUDEN) + DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2), me); + } + + void JustDied(Unit* who) + { + if (who && who != me) + DoScriptText(SAY_DIE, me); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + { + if (UnsummonCheck < diff && me->isAlive()) + { + if (!WipeSaid) + { + DoScriptText(SAY_WIPE, me); + WipeSaid = true; + } + me->DisappearAndDie(); + } else UnsummonCheck -= diff; + return; + } + + if (Revenge_Timer <= diff) + { + if (Unit *victim = me->getVictim()) + DoCast(victim, SPELL_REVENGE); + Revenge_Timer = 5000; + } else Revenge_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct boss_vazruden_the_heraldAI : public ScriptedAI +{ + boss_vazruden_the_heraldAI(Creature *c) : ScriptedAI(c) + { + summoned = false; + sentryDown = false; + NazanGUID = 0; + VazrudenGUID = 0; + } + + uint32 phase; + uint32 waypoint; + uint32 check; + bool sentryDown; + uint64 NazanGUID; + uint64 VazrudenGUID; + bool summoned; + + void Reset() + { + phase = 0; + waypoint = 0; + check = 0; + UnsummonAdds(); + me->GetMotionMaster()->MovePath(PATH_ENTRY, true); + } + + void UnsummonAdds() + { + if (summoned) + { + Creature *Nazan = Unit::GetCreature(*me, NazanGUID); + if (!Nazan) + Nazan = me->FindNearestCreature(ENTRY_NAZAN, 5000); + if (Nazan) + { + Nazan->DisappearAndDie(); + NazanGUID = 0; + } + + Creature *Vazruden = Unit::GetCreature(*me, VazrudenGUID); + if (!Vazruden) + Vazruden = me->FindNearestCreature(ENTRY_VAZRUDEN, 5000); + if (Vazruden) + { + Vazruden->DisappearAndDie(); + VazrudenGUID = 0; + } + summoned = false; + me->clearUnitState(UNIT_STAT_ROOT); + me->SetVisibility(VISIBILITY_ON); + } + } + + void SummonAdds() + { + if (!summoned) + { + if (Creature* Vazruden = me->SummonCreature(ENTRY_VAZRUDEN,VazrudenMiddle[0],VazrudenMiddle[1],VazrudenMiddle[2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,6000000)) + VazrudenGUID = Vazruden->GetGUID(); + if (Creature* Nazan = me->SummonCreature(ENTRY_NAZAN,VazrudenMiddle[0],VazrudenMiddle[1],VazrudenMiddle[2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,6000000)) + NazanGUID = Nazan->GetGUID(); + summoned = true; + me->SetVisibility(VISIBILITY_OFF); + me->addUnitState(UNIT_STAT_ROOT); + } + } + + void EnterCombat(Unit * /*who*/) + { + if (phase == 0) + { + phase = 1; + check = 0; + DoScriptText(SAY_INTRO, me); + } + } + + void JustSummoned(Creature *summoned) + { + if (!summoned) return; + Unit *victim = me->getVictim(); + if (summoned->GetEntry() == ENTRY_NAZAN) + { + CAST_AI(boss_nazanAI, summoned->AI())->VazrudenGUID = VazrudenGUID; + summoned->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + summoned->SetSpeed(MOVE_FLIGHT, 2.5); + if (victim) + AttackStartNoMove(victim); + } + else if (victim) + summoned->AI()->AttackStart(victim); + } + + void SentryDownBy(Unit* killer) + { + if (sentryDown) + { + AttackStartNoMove(killer); + sentryDown = false; + } + else + sentryDown = true; + } + + void UpdateAI(const uint32 diff) + { + switch(phase) + { + case 0: // circle around the platform + return; + break; + case 1: // go to the middle and begin the fight + if (check <= diff) + { + if (!me->IsWithinDist3d(VazrudenMiddle[0],VazrudenMiddle[1],VazrudenMiddle[2],5)) + { + me->GetMotionMaster()->Clear(); + me->GetMotionMaster()->MovePoint(0,VazrudenMiddle[0],VazrudenMiddle[1],VazrudenMiddle[2]); + check = 1000; + } + else + { + SummonAdds(); + phase = 2; + return; + } + } else check -= diff; + break; + default: // adds do the job now + if (check <= diff) + { + Creature *Nazan = Unit::GetCreature(*me, NazanGUID); + Creature *Vazruden = Unit::GetCreature(*me, VazrudenGUID); + if (Nazan && Nazan->isAlive() || Vazruden && Vazruden->isAlive()) + { + if (Nazan && Nazan->getVictim() || Vazruden && Vazruden->getVictim()) + return; + else + { + UnsummonAdds(); + EnterEvadeMode(); + return; + } + } + else + { + me->SummonGameObject(ENTRY_REINFORCED_FEL_IRON_CHEST,VazrudenMiddle[0],VazrudenMiddle[1],VazrudenMiddle[2],0,0,0,0,0,0); + me->SetLootRecipient(NULL); // don't think this is necessary.. + me->Kill(me); + } + check = 2000; + } else check -= diff; + break; + } + } +}; + +struct mob_hellfire_sentryAI : public ScriptedAI +{ + mob_hellfire_sentryAI(Creature *c) : ScriptedAI(c) {} + + uint32 KidneyShot_Timer; + + void Reset() + { + KidneyShot_Timer = urand(3000,7000); + } + + void EnterCombat(Unit* /*who*/) {} + + void JustDied(Unit* who) + { + if (Creature *herald = me->FindNearestCreature(ENTRY_VAZRUDEN_HERALD,150)) + CAST_AI(boss_vazruden_the_heraldAI, herald->AI())->SentryDownBy(who); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (KidneyShot_Timer <= diff) + { + if (Unit *victim = me->getVictim()) + DoCast(victim, SPELL_KIDNEY_SHOT); + KidneyShot_Timer = 20000; + } else KidneyShot_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_vazruden_the_herald(Creature* pCreature) +{ + return new boss_vazruden_the_heraldAI (pCreature); +} + +CreatureAI* GetAI_boss_vazruden(Creature* pCreature) +{ + return new boss_vazrudenAI (pCreature); +} + +CreatureAI* GetAI_boss_nazan(Creature* pCreature) +{ + return new boss_nazanAI (pCreature); +} + +CreatureAI* GetAI_mob_hellfire_sentry(Creature* pCreature) +{ + return new mob_hellfire_sentryAI (pCreature); +} + +void AddSC_boss_vazruden_the_herald() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_vazruden_the_herald"; + newscript->GetAI = &GetAI_boss_vazruden_the_herald; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_vazruden"; + newscript->GetAI = &GetAI_boss_vazruden; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_nazan"; + newscript->GetAI = &GetAI_boss_nazan; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_hellfire_sentry"; + newscript->GetAI = &GetAI_mob_hellfire_sentry; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/Outland/HellfireCitadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp b/src/server/scripts/Outland/HellfireCitadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp new file mode 100644 index 00000000000..f0e813d3890 --- /dev/null +++ b/src/server/scripts/Outland/HellfireCitadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp @@ -0,0 +1,156 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Watchkeeper_Gargolmar +SD%Complete: 80 +SDComment: Missing adds to heal him. Surge should be used on pTarget furthest away, not random. +SDCategory: Hellfire Citadel, Hellfire Ramparts +EndScriptData */ + +#include "ScriptedPch.h" + +#define SAY_TAUNT -1543000 +#define SAY_HEAL -1543001 +#define SAY_SURGE -1543002 +#define SAY_AGGRO_1 -1543003 +#define SAY_AGGRO_2 -1543004 +#define SAY_AGGRO_3 -1543005 +#define SAY_KILL_1 -1543006 +#define SAY_KILL_2 -1543007 +#define SAY_DIE -1543008 + +#define SPELL_MORTAL_WOUND 30641 +#define H_SPELL_MORTAL_WOUND 36814 +#define SPELL_SURGE 34645 +#define SPELL_RETALIATION 22857 + +struct boss_watchkeeper_gargolmarAI : public ScriptedAI +{ + boss_watchkeeper_gargolmarAI(Creature *c) : ScriptedAI(c) + { + } + + uint32 Surge_Timer; + uint32 MortalWound_Timer; + uint32 Retaliation_Timer; + + bool HasTaunted; + bool YelledForHeal; + + void Reset() + { + Surge_Timer = 5000; + MortalWound_Timer = 4000; + Retaliation_Timer = 0; + + HasTaunted = false; + YelledForHeal = false; + } + + void EnterCombat(Unit * /*who*/) + { + DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3), me); + } + + void MoveInLineOfSight(Unit* who) + { + if (!me->getVictim() && who->isTargetableForAttack() && (me->IsHostileTo(who)) && who->isInAccessiblePlaceFor(me)) + { + if (!me->canFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) + return; + + float attackRadius = me->GetAttackDistance(who); + if (me->IsWithinDistInMap(who, attackRadius) && me->IsWithinLOSInMap(who)) + { + //who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); + AttackStart(who); + } + else if (!HasTaunted && me->IsWithinDistInMap(who, 60.0f)) + { + DoScriptText(SAY_TAUNT, me); + HasTaunted = true; + } + } + } + + void KilledUnit(Unit* /*victim*/) + { + DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2), me); + } + + void JustDied(Unit* /*Killer*/) + { + DoScriptText(SAY_DIE, me); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (MortalWound_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_MORTAL_WOUND); + MortalWound_Timer = 5000+rand()%8000; + } else MortalWound_Timer -= diff; + + if (Surge_Timer <= diff) + { + DoScriptText(SAY_SURGE, me); + + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(pTarget, SPELL_SURGE); + + Surge_Timer = 5000+rand()%8000; + } else Surge_Timer -= diff; + + if ((me->GetHealth()*100) / me->GetMaxHealth() < 20) + { + if (Retaliation_Timer <= diff) + { + DoCast(me, SPELL_RETALIATION); + Retaliation_Timer = 30000; + } else Retaliation_Timer -= diff; + } + + if (!YelledForHeal) + { + if ((me->GetHealth()*100) / me->GetMaxHealth() < 40) + { + DoScriptText(SAY_HEAL, me); + YelledForHeal = true; + } + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_watchkeeper_gargolmarAI(Creature* pCreature) +{ + return new boss_watchkeeper_gargolmarAI (pCreature); +} + +void AddSC_boss_watchkeeper_gargolmar() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_watchkeeper_gargolmar"; + newscript->GetAI = &GetAI_boss_watchkeeper_gargolmarAI; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/Outland/HellfireCitadel/hellfire_ramparts/hellfire_ramparts.h b/src/server/scripts/Outland/HellfireCitadel/hellfire_ramparts/hellfire_ramparts.h new file mode 100644 index 00000000000..599aa237774 --- /dev/null +++ b/src/server/scripts/Outland/HellfireCitadel/hellfire_ramparts/hellfire_ramparts.h @@ -0,0 +1,16 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_RAMPARTS_H +#define DEF_RAMPARTS_H + +#define MAX_ENCOUNTER 2 + +enum eTypes +{ + TYPE_VAZRUDEN = 1, + TYPE_NAZAN = 2 +}; + +#endif diff --git a/src/server/scripts/Outland/HellfireCitadel/hellfire_ramparts/instance_hellfire_ramparts.cpp b/src/server/scripts/Outland/HellfireCitadel/hellfire_ramparts/instance_hellfire_ramparts.cpp new file mode 100644 index 00000000000..29c58675e9c --- /dev/null +++ b/src/server/scripts/Outland/HellfireCitadel/hellfire_ramparts/instance_hellfire_ramparts.cpp @@ -0,0 +1,84 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Hellfire_Ramparts +SD%Complete: 50 +SDComment: +SDCategory: Hellfire Ramparts +EndScriptData */ + +#include "ScriptedPch.h" +#include "hellfire_ramparts.h" + +struct instance_ramparts : public ScriptedInstance +{ + instance_ramparts(Map* pMap) : ScriptedInstance(pMap) {Initialize();} + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + uint64 m_uiChestNGUID; + uint64 m_uiChestHGUID; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + m_uiChestNGUID = 0; + m_uiChestHGUID = 0; + } + + void OnGameObjectCreate(GameObject* pGo, bool /*add*/) + { + switch(pGo->GetEntry()) + { + case 185168: m_uiChestNGUID = pGo->GetGUID(); break; + case 185169: m_uiChestHGUID = pGo->GetGUID(); break; + } + } + + void SetData(uint32 uiType, uint32 uiData) + { + debug_log("TSCR: Instance Ramparts: SetData received for type %u with data %u",uiType,uiData); + + switch(uiType) + { + case TYPE_VAZRUDEN: + if (uiData == DONE && m_auiEncounter[1] == DONE) + DoRespawnGameObject(instance->IsHeroic() ? m_uiChestHGUID : m_uiChestNGUID, HOUR*IN_MILISECONDS); + m_auiEncounter[0] = uiData; + break; + case TYPE_NAZAN: + if (uiData == DONE && m_auiEncounter[0] == DONE) + DoRespawnGameObject(instance->IsHeroic() ? m_uiChestHGUID : m_uiChestNGUID, HOUR*IN_MILISECONDS); + m_auiEncounter[1] = uiData; + break; + } + } +}; + +InstanceData* GetInstanceData_instance_ramparts(Map* pMap) +{ + return new instance_ramparts(pMap); +} + +void AddSC_instance_ramparts() +{ + Script* pNewScript; + pNewScript = new Script; + pNewScript->Name = "instance_ramparts"; + pNewScript->GetInstanceData = &GetInstanceData_instance_ramparts; + pNewScript->RegisterSelf(); +} diff --git a/src/server/scripts/Outland/HellfireCitadel/magtheridons_lair/boss_magtheridon.cpp b/src/server/scripts/Outland/HellfireCitadel/magtheridons_lair/boss_magtheridon.cpp new file mode 100644 index 00000000000..5fb381f4065 --- /dev/null +++ b/src/server/scripts/Outland/HellfireCitadel/magtheridons_lair/boss_magtheridon.cpp @@ -0,0 +1,570 @@ +/* Copyright(C) 2006 - 2008 ScriptDev2 +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +*(at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/* ScriptData +SDName: Boss_Magtheridon +SD%Complete: 60 +SDComment: In Development +SDCategory: Hellfire Citadel, Magtheridon's lair +EndScriptData */ + +#include "ScriptedPch.h" +#include "magtheridons_lair.h" + +struct Yell +{ + int32 id; +}; + +static Yell RandomTaunt[]= +{ + {-1544000}, + {-1544001}, + {-1544002}, + {-1544003}, + {-1544004}, + {-1544005}, +}; + +#define SAY_FREED -1544006 +#define SAY_AGGRO -1544007 +#define SAY_BANISH -1544008 +#define SAY_CHAMBER_DESTROY -1544009 +#define SAY_PLAYER_KILLED -1544010 +#define SAY_DEATH -1544011 + +#define EMOTE_BERSERK -1544012 +#define EMOTE_BLASTNOVA -1544013 +#define EMOTE_BEGIN -1544014 + +#define MOB_MAGTHERIDON 17257 +#define MOB_ROOM 17516 +#define MOB_CHANNELLER 17256 +#define MOB_ABYSSAL 17454 + +#define SPELL_BLASTNOVA 30616 +#define SPELL_CLEAVE 30619 +#define SPELL_QUAKE_TRIGGER 30657 // must be cast with 30561 as the proc spell +#define SPELL_QUAKE_KNOCKBACK 30571 +#define SPELL_BLAZE_TARGET 30541 // core bug, does not support target 7 +#define SPELL_BLAZE_TRAP 30542 +#define SPELL_DEBRIS_KNOCKDOWN 36449 +#define SPELL_DEBRIS_VISUAL 30632 +#define SPELL_DEBRIS_DAMAGE 30631 // core bug, does not support target 8 +#define SPELL_CAMERA_SHAKE 36455 +#define SPELL_BERSERK 27680 + +#define SPELL_SHADOW_CAGE 30168 +#define SPELL_SHADOW_GRASP 30410 +#define SPELL_SHADOW_GRASP_VISUAL 30166 +#define SPELL_MIND_EXHAUSTION 44032 //Casted by the cubes when channeling ends + +#define SPELL_SHADOW_CAGE_C 30205 +#define SPELL_SHADOW_GRASP_C 30207 + +#define SPELL_SHADOW_BOLT_VOLLEY 30510 +#define SPELL_DARK_MENDING 30528 +#define SPELL_FEAR 30530 //39176 +#define SPELL_BURNING_ABYSSAL 30511 +#define SPELL_SOUL_TRANSFER 30531 // core bug, does not support target 7 + +#define SPELL_FIRE_BLAST 37110 + +// count of clickers needed to interrupt blast nova +#define CLICKERS_COUNT 5 + +typedef std::map CubeMap; + +struct mob_abyssalAI : public ScriptedAI +{ + mob_abyssalAI(Creature *c) : ScriptedAI(c) + { + trigger = 0; + Despawn_Timer = 60000; + } + + uint32 FireBlast_Timer; + uint32 Despawn_Timer; + uint32 trigger; + + void Reset() + { + FireBlast_Timer = 6000; + } + + void SpellHit(Unit*, const SpellEntry *spell) + { + if (trigger == 2 && spell->Id == SPELL_BLAZE_TARGET) + { + DoCast(me, SPELL_BLAZE_TRAP, true); + me->SetVisibility(VISIBILITY_OFF); + Despawn_Timer = 130000; + } + } + + void SetTrigger(uint32 _trigger) + { + trigger = _trigger; + me->SetDisplayId(11686); + if (trigger == 1) //debris + { + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + DoCast(me, SPELL_DEBRIS_VISUAL, true); + FireBlast_Timer = 5000; + Despawn_Timer = 10000; + } + } + + void EnterCombat(Unit* /*who*/) {DoZoneInCombat();} + void AttackStart(Unit *who) {if (!trigger) ScriptedAI::AttackStart(who);} + void MoveInLineOfSight(Unit *who) {if (!trigger) ScriptedAI::MoveInLineOfSight(who);} + + void UpdateAI(const uint32 diff) + { + if (trigger) + { + if (trigger == 1) + { + if (FireBlast_Timer <= diff) + { + DoCast(me, SPELL_DEBRIS_DAMAGE, true); + trigger = 3; + } else FireBlast_Timer -= diff; + } + return; + } + + if (Despawn_Timer <= diff) + { + me->ForcedDespawn(); + } else Despawn_Timer -= diff; + + if (!UpdateVictim()) + return; + + if (FireBlast_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_FIRE_BLAST); + FireBlast_Timer = 5000+rand()%10000; + } else FireBlast_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct boss_magtheridonAI : public ScriptedAI +{ + boss_magtheridonAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + me->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 10); + me->SetFloatValue(UNIT_FIELD_COMBATREACH, 10); + + // target 7, random target with certain entry spell, need core fix + SpellEntry *TempSpell; + TempSpell = GET_SPELL(SPELL_BLAZE_TARGET); + if (TempSpell && TempSpell->EffectImplicitTargetA[0] != 6) + { + TempSpell->EffectImplicitTargetA[0] = 6; + TempSpell->EffectImplicitTargetB[0] = 0; + } + TempSpell = GET_SPELL(SPELL_QUAKE_TRIGGER); + if (TempSpell && TempSpell->EffectTriggerSpell[0] != SPELL_QUAKE_KNOCKBACK) + { + TempSpell->EffectTriggerSpell[0] = SPELL_QUAKE_KNOCKBACK; + } + } + + CubeMap Cube; + + ScriptedInstance* pInstance; + + uint32 Berserk_Timer; + uint32 Quake_Timer; + uint32 Cleave_Timer; + uint32 BlastNova_Timer; + uint32 Blaze_Timer; + uint32 Debris_Timer; + uint32 RandChat_Timer; + + bool Phase3; + bool NeedCheckCube; + + void Reset() + { + Berserk_Timer = 1320000; + Quake_Timer = 40000; + Debris_Timer = 10000; + Blaze_Timer = 10000+rand()%20000; + BlastNova_Timer = 60000; + Cleave_Timer = 15000; + RandChat_Timer = 90000; + + Phase3 = false; + NeedCheckCube = false; + + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->addUnitState(UNIT_STAT_STUNNED); + DoCast(me, SPELL_SHADOW_CAGE_C, true); + } + + void JustReachedHome() + { + if (pInstance) + { + pInstance->SetData(DATA_MAGTHERIDON_EVENT, NOT_STARTED); + pInstance->SetData(DATA_COLLAPSE, false); + } + } + + void SetClicker(uint64 cubeGUID, uint64 clickerGUID) + { + // to avoid multiclicks from 1 cube + if (uint64 guid = Cube[cubeGUID]) + DebuffClicker(Unit::GetUnit(*me, guid)); + Cube[cubeGUID] = clickerGUID; + NeedCheckCube = true; + } + + //function to interrupt channeling and debuff clicker with mind exh(used if second person clicks with same cube or after dispeling/ending shadow grasp DoT) + void DebuffClicker(Unit *clicker) + { + if (!clicker || !clicker->isAlive()) + return; + + clicker->RemoveAurasDueToSpell(SPELL_SHADOW_GRASP); // cannot interrupt triggered spells + clicker->InterruptNonMeleeSpells(false); + clicker->CastSpell(clicker, SPELL_MIND_EXHAUSTION, true); + } + + void NeedCheckCubeStatus() + { + uint32 ClickerNum = 0; + // now checking if every clicker has debuff from manticron(it is dispelable atm rev 6110 : S) + // if not - apply mind exhaustion and delete from clicker's list + for (CubeMap::iterator i = Cube.begin(); i != Cube.end(); ++i) + { + Unit *clicker = Unit::GetUnit(*me, (*i).second); + if (!clicker || !clicker->HasAura(SPELL_SHADOW_GRASP)) + { + DebuffClicker(clicker); + (*i).second = 0; + } else ++ClickerNum; + } + + // if 5 clickers from other cubes apply shadow cage + if (ClickerNum >= CLICKERS_COUNT && !me->HasAura(SPELL_SHADOW_CAGE)) + { + DoScriptText(SAY_BANISH, me); + DoCast(me, SPELL_SHADOW_CAGE, true); + } + else if (ClickerNum < CLICKERS_COUNT && me->HasAura(SPELL_SHADOW_CAGE)) + me->RemoveAurasDueToSpell(SPELL_SHADOW_CAGE); + + if (!ClickerNum) NeedCheckCube = false; + } + + void KilledUnit(Unit* /*victim*/) + { + DoScriptText(SAY_PLAYER_KILLED, me); + } + + void JustDied(Unit* /*Killer*/) + { + if (pInstance) + pInstance->SetData(DATA_MAGTHERIDON_EVENT, DONE); + + DoScriptText(SAY_DEATH, me); + } + + void MoveInLineOfSight(Unit* /*who*/) {} + + void AttackStart(Unit *who) + { + if (!me->hasUnitState(UNIT_STAT_STUNNED)) + ScriptedAI::AttackStart(who); + } + + void EnterCombat(Unit * /*who*/) + { + if (pInstance) + pInstance->SetData(DATA_MAGTHERIDON_EVENT, IN_PROGRESS); + DoZoneInCombat(); + + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + me->RemoveAurasDueToSpell(SPELL_SHADOW_CAGE_C); + + DoScriptText(SAY_FREED, me); + } + + void UpdateAI(const uint32 diff) + { + if (!me->isInCombat()) + { + if (RandChat_Timer <= diff) + { + DoScriptText(RandomTaunt[rand()%6].id, me); + RandChat_Timer = 90000; + } else RandChat_Timer -= diff; + } + + if (!UpdateVictim()) + return; + + if (NeedCheckCube) NeedCheckCubeStatus(); + + if (Berserk_Timer <= diff) + { + DoCast(me, SPELL_BERSERK, true); + DoScriptText(EMOTE_BERSERK, me); + Berserk_Timer = 60000; + } else Berserk_Timer -= diff; + + if (Cleave_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_CLEAVE); + Cleave_Timer = 10000; + } else Cleave_Timer -= diff; + + if (BlastNova_Timer <= diff) + { + // to avoid earthquake interruption + if (!me->hasUnitState(UNIT_STAT_STUNNED)) + { + DoScriptText(EMOTE_BLASTNOVA, me); + DoCast(me, SPELL_BLASTNOVA); + BlastNova_Timer = 60000; + } + } else BlastNova_Timer -= diff; + + if (Quake_Timer <= diff) + { + // to avoid blastnova interruption + if (!me->IsNonMeleeSpellCasted(false)) + { + DoCast(me, SPELL_QUAKE_TRIGGER, true); + Quake_Timer = 50000; + } + } else Quake_Timer -= diff; + + if (Blaze_Timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + float x, y, z; + pTarget->GetPosition(x, y, z); + Creature *summon = me->SummonCreature(MOB_ABYSSAL, x, y, z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); + if (summon) + { + CAST_AI(mob_abyssalAI, summon->AI())->SetTrigger(2); + DoCast(summon, SPELL_BLAZE_TARGET, true); + summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + } + } + Blaze_Timer = 20000 + rand()%20000; + } else Blaze_Timer -= diff; + + if (!Phase3 && me->GetHealth()*10 < me->GetMaxHealth()*3 + && !me->IsNonMeleeSpellCasted(false) // blast nova + && !me->hasUnitState(UNIT_STAT_STUNNED)) // shadow cage and earthquake + { + Phase3 = true; + DoScriptText(SAY_CHAMBER_DESTROY, me); + DoCast(me, SPELL_CAMERA_SHAKE, true); + DoCast(me, SPELL_DEBRIS_KNOCKDOWN, true); + + if (pInstance) + pInstance->SetData(DATA_COLLAPSE, true); + } + + if (Phase3) + { + if (Debris_Timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + float x, y, z; + pTarget->GetPosition(x, y, z); + Creature *summon = me->SummonCreature(MOB_ABYSSAL, x, y, z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); + if (summon) CAST_AI(mob_abyssalAI, summon->AI())->SetTrigger(1); + } + Debris_Timer = 10000; + } else Debris_Timer -= diff; + } + + DoMeleeAttackIfReady(); + } +}; + +struct mob_hellfire_channelerAI : public ScriptedAI +{ + mob_hellfire_channelerAI(Creature *c) : ScriptedAI(c) + { + pInstance =me->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint32 ShadowBoltVolley_Timer; + uint32 DarkMending_Timer; + uint32 Fear_Timer; + uint32 Infernal_Timer; + + uint32 Check_Timer; + + void Reset() + { + ShadowBoltVolley_Timer = 8000 + rand()%2000; + DarkMending_Timer = 10000; + Fear_Timer = 15000 + rand()%5000; + Infernal_Timer = 10000 + rand()%40000; + + Check_Timer = 5000; + } + + void EnterCombat(Unit * /*who*/) + { + if (pInstance) + pInstance->SetData(DATA_CHANNELER_EVENT, IN_PROGRESS); + + me->InterruptNonMeleeSpells(false); + DoZoneInCombat(); + } + + void JustReachedHome() + { + if (pInstance) + pInstance->SetData(DATA_CHANNELER_EVENT, NOT_STARTED); + + DoCast(me, SPELL_SHADOW_GRASP_C, false); + } + + void JustSummoned(Creature *summon) + { + summon->AI()->AttackStart(me->getVictim()); + } + + void DamageTaken(Unit*, uint32 &damage) + { + if (damage >= me->GetHealth()) + DoCast(me, SPELL_SOUL_TRANSFER, true); + } + + void JustDied(Unit* /*who*/) + { + if (pInstance) + pInstance->SetData(DATA_CHANNELER_EVENT, DONE); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (ShadowBoltVolley_Timer <= diff) + { + DoCast(me, SPELL_SHADOW_BOLT_VOLLEY); + ShadowBoltVolley_Timer = 10000 + rand()%10000; + } else ShadowBoltVolley_Timer -= diff; + + if (DarkMending_Timer <= diff) + { + if ((me->GetHealth()*100 / me->GetMaxHealth()) < 50) + DoCast(me, SPELL_DARK_MENDING); + DarkMending_Timer = 10000 +(rand() % 10000); + } else DarkMending_Timer -= diff; + + if (Fear_Timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1)) + DoCast(pTarget, SPELL_FEAR); + Fear_Timer = 25000 + rand()%15000; + } else Fear_Timer -= diff; + + if (Infernal_Timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(pTarget, SPELL_BURNING_ABYSSAL, true); + Infernal_Timer = 30000 + rand()%10000; + } else Infernal_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +//Manticron Cube +bool GOHello_go_Manticron_Cube(Player* pPlayer, GameObject* pGo) +{ + ScriptedInstance* pInstance = pGo->GetInstanceData(); + if (!pInstance) + return true; + if (pInstance->GetData(DATA_MAGTHERIDON_EVENT) != IN_PROGRESS) return true; + Creature *Magtheridon =Unit::GetCreature(*pGo, pInstance->GetData64(DATA_MAGTHERIDON)); + if (!Magtheridon || !Magtheridon->isAlive()) return true; + + // if exhausted or already channeling return + if (pPlayer->HasAura(SPELL_MIND_EXHAUSTION) || pPlayer->HasAura(SPELL_SHADOW_GRASP)) + return true; + + pPlayer->InterruptNonMeleeSpells(false); + pPlayer->CastSpell(pPlayer, SPELL_SHADOW_GRASP, true); + pPlayer->CastSpell(pPlayer, SPELL_SHADOW_GRASP_VISUAL, false); + CAST_AI(boss_magtheridonAI, Magtheridon->AI())->SetClicker(pGo->GetGUID(), pPlayer->GetGUID()); + return true; +} + +CreatureAI* GetAI_boss_magtheridon(Creature* pCreature) +{ + return new boss_magtheridonAI(pCreature); +} + +CreatureAI* GetAI_mob_hellfire_channeler(Creature* pCreature) +{ + return new mob_hellfire_channelerAI(pCreature); +} + +CreatureAI* GetAI_mob_abyssalAI(Creature* pCreature) +{ + return new mob_abyssalAI(pCreature); +} + +void AddSC_boss_magtheridon() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_magtheridon"; + newscript->GetAI = &GetAI_boss_magtheridon; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_hellfire_channeler"; + newscript->GetAI = &GetAI_mob_hellfire_channeler; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "go_manticron_cube"; + newscript->pGOHello = &GOHello_go_Manticron_Cube; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_abyssal"; + newscript->GetAI = &GetAI_mob_abyssalAI; + newscript->RegisterSelf(); + +} + diff --git a/src/server/scripts/Outland/HellfireCitadel/magtheridons_lair/instance_magtheridons_lair.cpp b/src/server/scripts/Outland/HellfireCitadel/magtheridons_lair/instance_magtheridons_lair.cpp new file mode 100644 index 00000000000..d5b459a1fa1 --- /dev/null +++ b/src/server/scripts/Outland/HellfireCitadel/magtheridons_lair/instance_magtheridons_lair.cpp @@ -0,0 +1,254 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Magtheridons_Lair +SD%Complete: 100 +SDComment: +SDCategory: Hellfire Citadel, Magtheridon's lair +EndScriptData */ + +#include "ScriptedPch.h" +#include "magtheridons_lair.h" + +#define SPELL_SOUL_TRANSFER 30531 // core bug, does not support target 7 +#define SPELL_BLAZE_TARGET 30541 // core bug, does not support target 7 + +#define CHAMBER_CENTER_X -15.14 +#define CHAMBER_CENTER_Y 1.8 +#define CHAMBER_CENTER_Z -0.4 + +#define MAX_ENCOUNTER 2 + +#define EMOTE_BONDS_WEAKEN "'s bonds begin to weaken!" + +struct instance_magtheridons_lair : public ScriptedInstance +{ + instance_magtheridons_lair(Map* pMap) : ScriptedInstance(pMap) + { + Initialize(); + } + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + + uint64 MagtheridonGUID; + std::set ChannelerGUID; + uint64 DoorGUID; + std::set ColumnGUID; + + uint32 CageTimer; + uint32 RespawnTimer; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + MagtheridonGUID = 0; + ChannelerGUID.clear(); + DoorGUID = 0; + ColumnGUID.clear(); + + CageTimer = 0; + RespawnTimer = 0; + } + + bool IsEncounterInProgress() const + { + for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) return true; + return false; + } + + void OnCreatureCreate(Creature* pCreature, bool /*add*/) + { + switch(pCreature->GetEntry()) + { + case 17257: + MagtheridonGUID = pCreature->GetGUID(); + break; + case 17256: + ChannelerGUID.insert(pCreature->GetGUID()); + break; + } + } + + void OnGameObjectCreate(GameObject* pGo, bool /*add*/) + { + switch(pGo->GetEntry()) + { + case 181713: + pGo->SetUInt32Value(GAMEOBJECT_FLAGS, 0); + break; + case 183847: + DoorGUID = pGo->GetGUID(); + break; + case 184653: // hall + case 184634: // six columns + case 184635: + case 184636: + case 184637: + case 184638: + case 184639: + ColumnGUID.insert(pGo->GetGUID()); + break; + } + } + + uint64 GetData64(uint32 type) + { + switch(type) + { + case DATA_MAGTHERIDON: + return MagtheridonGUID; + } + return 0; + } + + void SetData(uint32 type, uint32 data) + { + switch(type) + { + case DATA_MAGTHERIDON_EVENT: + m_auiEncounter[0] = data; + if (data == NOT_STARTED) + RespawnTimer = 10000; + if (data != IN_PROGRESS) + HandleGameObject(DoorGUID, true); + break; + case DATA_CHANNELER_EVENT: + switch(data) + { + case NOT_STARTED: // Reset all channelers once one is reset. + if (m_auiEncounter[1] != NOT_STARTED) + { + m_auiEncounter[1] = NOT_STARTED; + for (std::set::const_iterator i = ChannelerGUID.begin(); i != ChannelerGUID.end(); ++i) + { + if (Creature *Channeler = instance->GetCreature(*i)) + { + if (Channeler->isAlive()) + Channeler->AI()->EnterEvadeMode(); + else + Channeler->Respawn(); + } + } + CageTimer = 0; + HandleGameObject(DoorGUID, true); + } + break; + case IN_PROGRESS: // Event start. + if (m_auiEncounter[1] != IN_PROGRESS) + { + m_auiEncounter[1] = IN_PROGRESS; + // Let all five channelers aggro. + for (std::set::const_iterator i = ChannelerGUID.begin(); i != ChannelerGUID.end(); ++i) + { + Creature *Channeler = instance->GetCreature(*i); + if (Channeler && Channeler->isAlive()) + Channeler->AI()->AttackStart(Channeler->SelectNearestTarget(999)); + } + // Release Magtheridon after two minutes. + Creature *Magtheridon = instance->GetCreature(MagtheridonGUID); + if (Magtheridon && Magtheridon->isAlive()) + { + Magtheridon->MonsterTextEmote(EMOTE_BONDS_WEAKEN, 0); + CageTimer = 120000; + } + HandleGameObject(DoorGUID, false); + } + break; + case DONE: // Add buff and check if all channelers are dead. + for (std::set::const_iterator i = ChannelerGUID.begin(); i != ChannelerGUID.end(); ++i) + { + Creature *Channeler = instance->GetCreature(*i); + if (Channeler && Channeler->isAlive()) + { + //Channeler->CastSpell(Channeler, SPELL_SOUL_TRANSFER, true); + data = IN_PROGRESS; + break; + } + } + break; + } + m_auiEncounter[1] = data; + break; + case DATA_COLLAPSE: + // true - collapse / false - reset + for (std::set::const_iterator i = ColumnGUID.begin(); i != ColumnGUID.end(); ++i) + DoUseDoorOrButton(*i); + break; + default: + break; + } + } + + uint32 GetData(uint32 type) + { + if (type == DATA_MAGTHERIDON_EVENT) + return m_auiEncounter[0]; + return 0; + } + + void Update(uint32 diff) + { + if (CageTimer) + { + if (CageTimer <= diff) + { + Creature *Magtheridon = instance->GetCreature(MagtheridonGUID); + if (Magtheridon && Magtheridon->isAlive()) + { + Magtheridon->clearUnitState(UNIT_STAT_STUNNED); + Magtheridon->AI()->AttackStart(Magtheridon->SelectNearestTarget(999)); + } + CageTimer = 0; + } else CageTimer -= diff; + } + + if (RespawnTimer) + { + if (RespawnTimer <= diff) + { + for (std::set::const_iterator i = ChannelerGUID.begin(); i != ChannelerGUID.end(); ++i) + { + if (Creature *Channeler = instance->GetCreature(*i)) + { + if (Channeler->isAlive()) + Channeler->AI()->EnterEvadeMode(); + else + Channeler->Respawn(); + } + } + RespawnTimer = 0; + } else RespawnTimer -= diff; + } + } +}; + +InstanceData* GetInstanceData_instance_magtheridons_lair(Map* pMap) +{ + return new instance_magtheridons_lair(pMap); +} + +void AddSC_instance_magtheridons_lair() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_magtheridons_lair"; + newscript->GetInstanceData = &GetInstanceData_instance_magtheridons_lair; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/Outland/HellfireCitadel/magtheridons_lair/magtheridons_lair.h b/src/server/scripts/Outland/HellfireCitadel/magtheridons_lair/magtheridons_lair.h new file mode 100644 index 00000000000..1b3e525fc54 --- /dev/null +++ b/src/server/scripts/Outland/HellfireCitadel/magtheridons_lair/magtheridons_lair.h @@ -0,0 +1,14 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_MAGTHERIDONS_LAIR_H +#define DEF_MAGTHERIDONS_LAIR_H + +#define DATA_MAGTHERIDON_EVENT 1 +#define DATA_MAGTHERIDON 3 +#define DATA_CHANNELER_EVENT 2 +#define DATA_COLLAPSE 6 +#define DATA_CHANNELER 9 +#endif + diff --git a/src/server/scripts/Outland/HellfireCitadel/shattered_halls/boss_nethekurse.cpp b/src/server/scripts/Outland/HellfireCitadel/shattered_halls/boss_nethekurse.cpp new file mode 100644 index 00000000000..e3ded52edc9 --- /dev/null +++ b/src/server/scripts/Outland/HellfireCitadel/shattered_halls/boss_nethekurse.cpp @@ -0,0 +1,396 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Grand_Warlock_Nethekurse +SD%Complete: 75 +SDComment: encounter not fully completed. missing part where boss kill minions. +SDCategory: Hellfire Citadel, Shattered Halls +EndScriptData */ + +/* ContentData +boss_grand_warlock_nethekurse +mob_fel_orc_convert +mob_lesser_shadow_fissure +EndContentData */ + +#include "ScriptedPch.h" +#include "shattered_halls.h" + +struct Say +{ + int32 id; +}; + +static Say PeonAttacked[]= +{ + {-1540001}, + {-1540002}, + {-1540003}, + {-1540004}, +}; +static Say PeonDies[]= +{ + {-1540005}, + {-1540006}, + {-1540007}, + {-1540008}, +}; + +#define SAY_INTRO -1540000 +#define SAY_TAUNT_1 -1540009 +#define SAY_TAUNT_2 -1540010 +#define SAY_TAUNT_3 -1540011 +#define SAY_AGGRO_1 -1540012 +#define SAY_AGGRO_2 -1540013 +#define SAY_AGGRO_3 -1540014 +#define SAY_SLAY_1 -1540015 +#define SAY_SLAY_2 -1540016 +#define SAY_DIE -1540017 + +#define SPELL_DEATH_COIL 30500 +#define SPELL_DARK_SPIN 30502 // core bug spell attack caster :D +#define SPELL_SHADOW_FISSURE 30496 // Summon the ShadowFissure NPC + +#define SPELL_SHADOW_CLEAVE 30495 +#define H_SPELL_SHADOW_SLAM 35953 + +#define SPELL_HEMORRHAGE 30478 + +#define SPELL_CONSUMPTION 30497 +#define SPELL_TEMPORARY_VISUAL 39312 // this is wrong, a temporary solution. spell consumption already has the purple visual, but doesn't display as it should + +struct boss_grand_warlock_nethekurseAI : public ScriptedAI +{ + boss_grand_warlock_nethekurseAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + bool IntroOnce; + bool IsIntroEvent; + bool IsMainEvent; + bool SpinOnce; + //bool HasTaunted; + bool Phase; + + uint32 PeonEngagedCount; + uint32 PeonKilledCount; + + uint32 IntroEvent_Timer; + uint32 DeathCoil_Timer; + uint32 ShadowFissure_Timer; + uint32 Cleave_Timer; + + void Reset() + { + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + IsIntroEvent = false; + IntroOnce = false; + IsMainEvent = false; + //HasTaunted = false; + SpinOnce = false; + Phase = false; + + PeonEngagedCount = 0; + PeonKilledCount = 0; + + IntroEvent_Timer = 90000; //how long before getting bored and kills his minions? + DeathCoil_Timer = 20000; + ShadowFissure_Timer = 8000; + Cleave_Timer = 5000; + } + + void DoYellForPeonAggro() + { + if (PeonEngagedCount >= 4) + return; + + DoScriptText(PeonAttacked[PeonEngagedCount].id, me); + ++PeonEngagedCount; + } + + void DoYellForPeonDeath() + { + if (PeonKilledCount >= 4) + return; + + DoScriptText(PeonDies[PeonKilledCount].id, me); + ++PeonKilledCount; + + if (PeonKilledCount == 4) + { + IsIntroEvent = false; + IsMainEvent = true; + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + } + + void DoTauntPeons() + { + DoScriptText(RAND(SAY_TAUNT_1,SAY_TAUNT_2,SAY_TAUNT_3), me); + + //TODO: kill the peons first + IsIntroEvent = false; + PeonEngagedCount = 4; + PeonKilledCount = 4; + IsMainEvent = true; + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + + void AttackStart(Unit* who) + { + if (IsIntroEvent || !IsMainEvent) + return; + + if (me->Attack(who, true)) + { + if (Phase) + DoStartNoMovement(who); + else + DoStartMovement(who); + } + } + + void MoveInLineOfSight(Unit *who) + { + if (!IntroOnce && me->IsWithinDistInMap(who, 50.0f)) + { + if (who->GetTypeId() != TYPEID_PLAYER) + return; + + DoScriptText(SAY_INTRO, me); + IntroOnce = true; + IsIntroEvent = true; + + if (pInstance) + pInstance->SetData(TYPE_NETHEKURSE,IN_PROGRESS); + } + + if (IsIntroEvent || !IsMainEvent) + return; + + ScriptedAI::MoveInLineOfSight(who); + } + + void EnterCombat(Unit * /*who*/) + { + DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3), me); + } + + void JustSummoned(Creature *summoned) + { + summoned->setFaction(16); + summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + + //triggered spell of consumption does not properly show it's SpellVisual, wrong spellid? + summoned->CastSpell(summoned,SPELL_TEMPORARY_VISUAL,true); + summoned->CastSpell(summoned,SPELL_CONSUMPTION,false,0,0,me->GetGUID()); + } + + void KilledUnit(Unit* /*victim*/) + { + DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me); + } + + void JustDied(Unit* /*Killer*/) + { + DoScriptText(SAY_DIE, me); + + if (!pInstance) + return; + + pInstance->SetData(TYPE_NETHEKURSE,DONE); + pInstance->HandleGameObject(pInstance->GetData64(DATA_NETHEKURSE_DOOR), true); + } + + void UpdateAI(const uint32 diff) + { + if (IsIntroEvent) + { + if (!pInstance) + return; + + if (pInstance->GetData(TYPE_NETHEKURSE) == IN_PROGRESS) + { + if (IntroEvent_Timer <= diff) + DoTauntPeons(); + else + IntroEvent_Timer -= diff; + } + } + + if (!UpdateVictim()) + return; + + if (!IsMainEvent) + return; + + if (Phase) + { + if (!SpinOnce) + { + DoCast(me->getVictim(), SPELL_DARK_SPIN); + SpinOnce = true; + } + + if (Cleave_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_SHADOW_CLEAVE); + Cleave_Timer = 6000+rand()%2500; + } else Cleave_Timer -= diff; + } + else + { + if (ShadowFissure_Timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(pTarget, SPELL_SHADOW_FISSURE); + ShadowFissure_Timer = urand(7500,15000); + } else ShadowFissure_Timer -= diff; + + if (DeathCoil_Timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(pTarget, SPELL_DEATH_COIL); + DeathCoil_Timer = urand(15000,20000); + } else DeathCoil_Timer -= diff; + + if ((me->GetHealth()*100) / me->GetMaxHealth() <= 20) + Phase = true; + + DoMeleeAttackIfReady(); + } + } +}; + +struct mob_fel_orc_convertAI : public ScriptedAI +{ + mob_fel_orc_convertAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + uint32 Hemorrhage_Timer; + + void Reset() + { + me->SetNoCallAssistance(true); //we don't want any assistance (WE R HEROZ!) + Hemorrhage_Timer = 3000; + } + + void MoveInLineOfSight(Unit * /*who*/) + { + } + + void EnterCombat(Unit* /*who*/) + { + if (pInstance) + { + if (pInstance->GetData64(DATA_NETHEKURSE)) + { + Creature *pKurse = Unit::GetCreature(*me,pInstance->GetData64(DATA_NETHEKURSE)); + if (pKurse && me->IsWithinDist(pKurse, 45.0f)) + { + CAST_AI(boss_grand_warlock_nethekurseAI, pKurse->AI())->DoYellForPeonAggro(); + + if (pInstance->GetData(TYPE_NETHEKURSE) == IN_PROGRESS) + return; + else + pInstance->SetData(TYPE_NETHEKURSE,IN_PROGRESS); + } + } + } + } + + void JustDied(Unit* /*Killer*/) + { + if (pInstance) + { + if (pInstance->GetData(TYPE_NETHEKURSE) != IN_PROGRESS) + return; + if (pInstance->GetData64(DATA_NETHEKURSE)) + if (Creature *pKurse = Unit::GetCreature(*me,pInstance->GetData64(DATA_NETHEKURSE))) + CAST_AI(boss_grand_warlock_nethekurseAI, pKurse->AI())->DoYellForPeonDeath(); + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (Hemorrhage_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_HEMORRHAGE); + Hemorrhage_Timer = 15000; + } else Hemorrhage_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +//NOTE: this Creature are also summoned by other spells, for different creatures +struct mob_lesser_shadow_fissureAI : public ScriptedAI +{ + mob_lesser_shadow_fissureAI(Creature *c) : ScriptedAI(c) {} + + void Reset() { } + void MoveInLineOfSight(Unit * /*who*/) {} + void AttackStart(Unit* /*who*/) {} + void EnterCombat(Unit* /*who*/) {} +}; + +CreatureAI* GetAI_boss_grand_warlock_nethekurse(Creature* pCreature) +{ + return new boss_grand_warlock_nethekurseAI (pCreature); +} + +CreatureAI* GetAI_mob_fel_orc_convert(Creature* pCreature) +{ + return new mob_fel_orc_convertAI (pCreature); +} + +CreatureAI* GetAI_mob_lesser_shadow_fissure(Creature* pCreature) +{ + return new mob_lesser_shadow_fissureAI (pCreature); +} + +void AddSC_boss_grand_warlock_nethekurse() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_grand_warlock_nethekurse"; + newscript->GetAI = &GetAI_boss_grand_warlock_nethekurse; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_fel_orc_convert"; + newscript->GetAI = &GetAI_mob_fel_orc_convert; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_lesser_shadow_fissure"; + newscript->GetAI = &GetAI_mob_lesser_shadow_fissure; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/Outland/HellfireCitadel/shattered_halls/boss_warbringer_omrogg.cpp b/src/server/scripts/Outland/HellfireCitadel/shattered_halls/boss_warbringer_omrogg.cpp new file mode 100644 index 00000000000..6fa1c9efe33 --- /dev/null +++ b/src/server/scripts/Outland/HellfireCitadel/shattered_halls/boss_warbringer_omrogg.cpp @@ -0,0 +1,404 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Warbringer_Omrogg +SD%Complete: 85 +SDComment: Heroic enabled. Spell timing may need additional tweaks +SDCategory: Hellfire Citadel, Shattered Halls +EndScriptData */ + +/* ContentData +mob_omrogg_heads +boss_warbringer_omrogg +EndContentData */ + +#include "ScriptedPch.h" +#include "shattered_halls.h" + +enum eEnums +{ + YELL_DIE_L = -1540039, + YELL_DIE_R = -1540040, + EMOTE_ENRAGE = -1540041, + + SPELL_BLAST_WAVE = 30600, + SPELL_FEAR = 30584, + SPELL_THUNDERCLAP = 30633, + + SPELL_BURNING_MAUL = 30598, + H_SPELL_BURNING_MAUL = 36056, + + NPC_LEFT_HEAD = 19523, + NPC_RIGHT_HEAD = 19524 +}; + +struct Yell +{ + int32 id; + uint32 creature; +}; + +static Yell GoCombat[]= +{ + {-1540018, NPC_LEFT_HEAD}, + {-1540019, NPC_LEFT_HEAD}, + {-1540020, NPC_LEFT_HEAD}, +}; +static Yell GoCombatDelay[]= +{ + {-1540021, NPC_RIGHT_HEAD}, + {-1540022, NPC_RIGHT_HEAD}, + {-1540023, NPC_RIGHT_HEAD}, +}; + +static Yell Threat[]= +{ + {-1540024, NPC_LEFT_HEAD}, + {-1540025, NPC_RIGHT_HEAD}, + {-1540026, NPC_LEFT_HEAD}, + {-1540027, NPC_LEFT_HEAD}, +}; +static Yell ThreatDelay1[]= +{ + {-1540028, NPC_RIGHT_HEAD}, + {-1540029, NPC_LEFT_HEAD}, + {-1540030, NPC_RIGHT_HEAD}, + {-1540031, NPC_RIGHT_HEAD}, +}; +static Yell ThreatDelay2[]= +{ + {-1540032, NPC_LEFT_HEAD}, + {-1540033, NPC_RIGHT_HEAD}, + {-1540034, NPC_LEFT_HEAD}, + {-1540035, NPC_LEFT_HEAD}, +}; + +static Yell Killing[]= +{ + {-1540036, NPC_LEFT_HEAD}, + {-1540037, NPC_RIGHT_HEAD}, +}; +static Yell KillingDelay[]= +{ + {-1540038, NPC_RIGHT_HEAD}, + {-1000000, NPC_LEFT_HEAD}, +}; + +struct mob_omrogg_headsAI : public ScriptedAI +{ + mob_omrogg_headsAI(Creature *c) : ScriptedAI(c) {} + + bool DeathYell; + uint32 Death_Timer; + + void Reset() + { + Death_Timer = 4000; + DeathYell = false; + } + void EnterCombat(Unit* /*who*/) {} + + void DoDeathYell() + { + DeathYell = true; + } + + void UpdateAI(const uint32 diff) + { + if (!DeathYell) + return; + + if (Death_Timer <= diff) + { + DoScriptText(YELL_DIE_R, me); + Death_Timer = false; + me->setDeathState(JUST_DIED); + } else Death_Timer -= diff; + } +}; + +struct boss_warbringer_omroggAI : public ScriptedAI +{ + boss_warbringer_omroggAI(Creature *c) : ScriptedAI(c) + { + LeftHeadGUID = 0; + RightHeadGUID = 0; + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint64 LeftHeadGUID; + uint64 RightHeadGUID; + int iaggro; + int ithreat; + int ikilling; + + bool AggroYell; + bool ThreatYell; + bool ThreatYell2; + bool KillingYell; + + uint32 Delay_Timer; + uint32 BlastWave_Timer; + uint32 BlastCount; + uint32 Fear_Timer; + uint32 BurningMaul_Timer; + uint32 ThunderClap_Timer; + uint32 ResetThreat_Timer; + + void Reset() + { + if (Unit* pLeftHead = Unit::GetUnit(*me,LeftHeadGUID)) + { + pLeftHead->setDeathState(JUST_DIED); + LeftHeadGUID = 0; + } + + if (Unit* pRightHead = Unit::GetUnit(*me,RightHeadGUID)) + { + pRightHead->setDeathState(JUST_DIED); + RightHeadGUID = 0; + } + + AggroYell = false; + ThreatYell = false; + ThreatYell2 = false; + KillingYell = false; + + Delay_Timer = 4000; + BlastWave_Timer = 0; + BlastCount = 0; + Fear_Timer = 8000; + BurningMaul_Timer = 25000; + ThunderClap_Timer = 15000; + ResetThreat_Timer = 30000; + + if (pInstance) + pInstance->SetData(TYPE_OMROGG, NOT_STARTED); //End boss can use this later. O'mrogg must be defeated(DONE) or he will come to aid. + } + + void DoYellForThreat() + { + Unit *pLeftHead = Unit::GetUnit(*me,LeftHeadGUID); + Unit *pRightHead = Unit::GetUnit(*me,RightHeadGUID); + + if (!pLeftHead || !pRightHead) + return; + + ithreat = rand()%4; + + Unit *source = (pLeftHead->GetEntry() == Threat[ithreat].creature ? pLeftHead : pRightHead); + + DoScriptText(Threat[ithreat].id, source); + + Delay_Timer = 3500; + ThreatYell = true; + } + + void EnterCombat(Unit * /*who*/) + { + me->SummonCreature(NPC_LEFT_HEAD, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_DEAD_DESPAWN, 0); + me->SummonCreature(NPC_RIGHT_HEAD, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_DEAD_DESPAWN, 0); + + if (Unit *pLeftHead = Unit::GetUnit(*me,LeftHeadGUID)) + { + iaggro = rand()%3; + + DoScriptText(GoCombat[iaggro].id, pLeftHead); + + Delay_Timer = 3500; + AggroYell = true; + } + + if (pInstance) + pInstance->SetData(TYPE_OMROGG, IN_PROGRESS); + } + + void JustSummoned(Creature *summoned) + { + if (summoned->GetEntry() == NPC_LEFT_HEAD) + LeftHeadGUID = summoned->GetGUID(); + + if (summoned->GetEntry() == NPC_RIGHT_HEAD) + RightHeadGUID = summoned->GetGUID(); + + //summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + //summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + summoned->SetVisibility(VISIBILITY_OFF); + } + + void KilledUnit(Unit* /*victim*/) + { + Unit* pLeftHead = Unit::GetUnit(*me,LeftHeadGUID); + Unit* pRightHead = Unit::GetUnit(*me,RightHeadGUID); + + if (!pLeftHead || !pRightHead) + return; + + ikilling = rand()%2; + + Unit *source = (pLeftHead->GetEntry() == Killing[ikilling].creature ? pLeftHead : pRightHead); + + switch(ikilling) + { + case 0: + DoScriptText(Killing[ikilling].id, source); + Delay_Timer = 3500; + KillingYell = true; + break; + case 1: + DoScriptText(Killing[ikilling].id, source); + KillingYell = false; + break; + } + } + + void JustDied(Unit* /*Killer*/) + { + Unit* pLeftHead = Unit::GetUnit(*me,LeftHeadGUID); + Unit* pRightHead = Unit::GetUnit(*me,RightHeadGUID); + + if (!pLeftHead || !pRightHead) + return; + + DoScriptText(YELL_DIE_L, pLeftHead); + + CAST_AI(mob_omrogg_headsAI, CAST_CRE(pRightHead)->AI())->DoDeathYell(); + + if (pInstance) + pInstance->SetData(TYPE_OMROGG, DONE); + } + + void UpdateAI(const uint32 diff) + { + if (Delay_Timer <= diff) + { + Delay_Timer = 3500; + + Unit* pLeftHead = Unit::GetUnit(*me,LeftHeadGUID); + Unit* pRightHead = Unit::GetUnit(*me,RightHeadGUID); + + if (!pLeftHead || !pRightHead) + return; + + if (AggroYell) + { + DoScriptText(GoCombatDelay[iaggro].id, pRightHead); + AggroYell = false; + } + + if (ThreatYell2) + { + Unit *source = (pLeftHead->GetEntry() == ThreatDelay2[ithreat].creature ? pLeftHead : pRightHead); + + DoScriptText(ThreatDelay2[ithreat].id, source); + ThreatYell2 = false; + } + + if (ThreatYell) + { + Unit *source = (pLeftHead->GetEntry() == ThreatDelay1[ithreat].creature ? pLeftHead : pRightHead); + + DoScriptText(ThreatDelay1[ithreat].id, source); + ThreatYell = false; + ThreatYell2 = true; + } + + if (KillingYell) + { + Unit *source = (pLeftHead->GetEntry() == KillingDelay[ikilling].creature ? pLeftHead : pRightHead); + + DoScriptText(KillingDelay[ikilling].id, source); + KillingYell = false; + } + } else Delay_Timer -= diff; + + if (!UpdateVictim()) + return; + + if (BlastCount && BlastWave_Timer <= diff) + { + DoCast(me, SPELL_BLAST_WAVE); + BlastWave_Timer = 5000; + ++BlastCount; + + if (BlastCount == 3) + BlastCount = 0; + } else BlastWave_Timer -= diff; + + if (BurningMaul_Timer <= diff) + { + DoScriptText(EMOTE_ENRAGE, me); + DoCast(me, SPELL_BURNING_MAUL); + BurningMaul_Timer = 40000; + BlastWave_Timer = 16000; + BlastCount = 1; + } else BurningMaul_Timer -= diff; + + if (ResetThreat_Timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + { + DoYellForThreat(); + DoResetThreat(); + me->AddThreat(pTarget, 0.0f); + } + ResetThreat_Timer = 25000+rand()%15000; + } else ResetThreat_Timer -= diff; + + if (Fear_Timer <= diff) + { + DoCast(me, SPELL_FEAR); + Fear_Timer = 15000+rand()%20000; + } else Fear_Timer -= diff; + + if (ThunderClap_Timer <= diff) + { + DoCast(me, SPELL_THUNDERCLAP); + ThunderClap_Timer = 15000+rand()%15000; + } else ThunderClap_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_warbringer_omrogg(Creature* pCreature) +{ + return new boss_warbringer_omroggAI (pCreature); +} + +CreatureAI* GetAI_mob_omrogg_heads(Creature* pCreature) +{ + return new mob_omrogg_headsAI (pCreature); +} + +void AddSC_boss_warbringer_omrogg() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_warbringer_omrogg"; + newscript->GetAI = &GetAI_boss_warbringer_omrogg; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_omrogg_heads"; + newscript->GetAI = &GetAI_mob_omrogg_heads; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/Outland/HellfireCitadel/shattered_halls/boss_warchief_kargath_bladefist.cpp b/src/server/scripts/Outland/HellfireCitadel/shattered_halls/boss_warchief_kargath_bladefist.cpp new file mode 100644 index 00000000000..b108077518a --- /dev/null +++ b/src/server/scripts/Outland/HellfireCitadel/shattered_halls/boss_warchief_kargath_bladefist.cpp @@ -0,0 +1,288 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Warchief_Kargath_Bladefist +SD%Complete: 90 +SDComment: +SDCategory: Hellfire Citadel, Shattered Halls +EndScriptData */ + +/* ContentData +boss_warchief_kargath_bladefist +EndContentData */ + +#include "ScriptedPch.h" + +#define SAY_AGGRO1 -1540042 +#define SAY_AGGRO2 -1540043 +#define SAY_AGGRO3 -1540044 +#define SAY_SLAY1 -1540045 +#define SAY_SLAY2 -1540046 +#define SAY_DEATH -1540047 + +#define SPELL_BLADE_DANCE 30739 +#define H_SPELL_CHARGE 25821 + +#define TARGET_NUM 5 + +#define MOB_SHATTERED_ASSASSIN 17695 +#define MOB_HEARTHEN_GUARD 17621 +#define MOB_SHARPSHOOTER_GUARD 17622 +#define MOB_REAVER_GUARD 17623 + +float AssassEntrance[3] = {275.136,-84.29,2.3}; // y -8 +float AssassExit[3] = {184.233,-84.29,2.3}; // y -8 +float AddsEntrance[3] = {306.036,-84.29,1.93}; + +struct boss_warchief_kargath_bladefistAI : public ScriptedAI +{ + boss_warchief_kargath_bladefistAI(Creature *c) : ScriptedAI(c) + { + } + + std::vector adds; + std::vector assassins; + + uint32 Charge_timer; + uint32 Blade_Dance_Timer; + uint32 Summon_Assistant_Timer; + uint32 resetcheck_timer; + uint32 Wait_Timer; + + uint32 Assassins_Timer; + + uint32 summoned; + bool InBlade; + + uint32 target_num; + + void Reset() + { + removeAdds(); + + me->SetSpeed(MOVE_RUN,2); + me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + + summoned = 2; + InBlade = false; + Wait_Timer = 0; + + Charge_timer = 0; + Blade_Dance_Timer = 45000; + Summon_Assistant_Timer = 30000; + Assassins_Timer = 5000; + resetcheck_timer = 5000; + } + + void EnterCombat(Unit * /*who*/) + { + DoScriptText(RAND(SAY_AGGRO1,SAY_AGGRO2,SAY_AGGRO3), me); + } + + void JustSummoned(Creature *summoned) + { + switch(summoned->GetEntry()) + { + case MOB_HEARTHEN_GUARD: + case MOB_SHARPSHOOTER_GUARD: + case MOB_REAVER_GUARD: + summoned->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM,0)); + adds.push_back(summoned->GetGUID()); + break; + case MOB_SHATTERED_ASSASSIN: + assassins.push_back(summoned->GetGUID()); + break; + } + } + + void KilledUnit(Unit* victim) + { + if (victim->GetTypeId() == TYPEID_PLAYER) + { + DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me); + } + } + + void JustDied(Unit* /*Killer*/) + { + DoScriptText(SAY_DEATH, me); + removeAdds(); + } + + void MovementInform(uint32 type, uint32 id) + { + if (InBlade) + { + if (type != POINT_MOTION_TYPE) + return; + + if (id != 1) + return; + + if (target_num > 0) // to prevent loops + { + Wait_Timer = 1; + DoCast(me, SPELL_BLADE_DANCE, true); + target_num--; + } + } + } + + void removeAdds() + { + for (std::vector::const_iterator itr = adds.begin(); itr!= adds.end(); ++itr) + { + Unit* temp = Unit::GetUnit((*me),*itr); + if (temp && temp->isAlive()) + { + (*temp).GetMotionMaster()->Clear(true); + me->DealDamage(temp,temp->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + CAST_CRE(temp)->RemoveCorpse(); + } + } + adds.clear(); + + for (std::vector::const_iterator itr = assassins.begin(); itr!= assassins.end(); ++itr) + { + Unit* temp = Unit::GetUnit((*me),*itr); + if (temp && temp->isAlive()) + { + (*temp).GetMotionMaster()->Clear(true); + me->DealDamage(temp,temp->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + CAST_CRE(temp)->RemoveCorpse(); + } + } + assassins.clear(); + } + void SpawnAssassin() + { + me->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassEntrance[0],AssassEntrance[1]+8, AssassEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); + me->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassEntrance[0],AssassEntrance[1]-8, AssassEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); + me->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassExit[0],AssassExit[1]+8, AssassExit[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); + me->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassExit[0],AssassExit[1]-8, AssassExit[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + if (Assassins_Timer) + if (Assassins_Timer <= diff) + { + SpawnAssassin(); + Assassins_Timer = 0; + } else Assassins_Timer -= diff; + + if (InBlade) + { + if (Wait_Timer) + if (Wait_Timer <= diff) + { + if (target_num <= 0) + { + // stop bladedance + InBlade = false; + me->SetSpeed(MOVE_RUN,2); + me->GetMotionMaster()->MoveChase(me->getVictim()); + Blade_Dance_Timer = 30000; + Wait_Timer = 0; + if (IsHeroic()) + Charge_timer = 5000; + } + else + { + //move in bladedance + float x,y,randx,randy; + randx = (rand()%40); + randy = (rand()%40); + x = 210+ randx ; + y = -60- randy ; + me->GetMotionMaster()->MovePoint(1,x,y,me->GetPositionZ()); + Wait_Timer = 0; + } + } else Wait_Timer -= diff; + } + else + { + if (Blade_Dance_Timer) + if (Blade_Dance_Timer <= diff) + { + target_num = TARGET_NUM; + Wait_Timer = 1; + InBlade = true; + Blade_Dance_Timer = 0; + me->SetSpeed(MOVE_RUN,4); + return; + } else Blade_Dance_Timer -= diff; + + if (Charge_timer) + if (Charge_timer <= diff) + { + DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), H_SPELL_CHARGE); + Charge_timer = 0; + } else Charge_timer -= diff; + + if (Summon_Assistant_Timer <= diff) + { + for (uint8 i = 0; i < summoned; ++i) + { + switch (urand(0,2)) + { + case 0: me->SummonCreature(MOB_HEARTHEN_GUARD,AddsEntrance[0],AddsEntrance[1], AddsEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); break; + case 1: me->SummonCreature(MOB_SHARPSHOOTER_GUARD,AddsEntrance[0],AddsEntrance[1], AddsEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); break; + case 2: me->SummonCreature(MOB_REAVER_GUARD,AddsEntrance[0],AddsEntrance[1], AddsEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); break; + } + } + if (urand(0,9) < 2) + ++summoned; + Summon_Assistant_Timer = urand(25000,35000); + } else Summon_Assistant_Timer -= diff; + + DoMeleeAttackIfReady(); + } + + if (resetcheck_timer <= diff) + { + uint32 tempx,tempy; + tempx = uint32(me->GetPositionX()); + tempy = uint32(me->GetPositionY()); + if (tempx > 255 || tempx < 205) + { + EnterEvadeMode(); + return; + } + resetcheck_timer = 5000; + } else resetcheck_timer -= diff; + } +}; + +CreatureAI* GetAI_boss_warchief_kargath_bladefist(Creature* pCreature) +{ + return new boss_warchief_kargath_bladefistAI (pCreature); +} + +void AddSC_boss_warchief_kargath_bladefist() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_warchief_kargath_bladefist"; + newscript->GetAI = &GetAI_boss_warchief_kargath_bladefist; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/Outland/HellfireCitadel/shattered_halls/instance_shattered_halls.cpp b/src/server/scripts/Outland/HellfireCitadel/shattered_halls/instance_shattered_halls.cpp new file mode 100644 index 00000000000..c29df4d6411 --- /dev/null +++ b/src/server/scripts/Outland/HellfireCitadel/shattered_halls/instance_shattered_halls.cpp @@ -0,0 +1,114 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Shattered_Halls +SD%Complete: 50 +SDComment: currently missing info about door. instance not complete +SDCategory: Hellfire Citadel, Shattered Halls +EndScriptData */ + +#include "ScriptedPch.h" +#include "shattered_halls.h" + +#define MAX_ENCOUNTER 2 + +#define DOOR_NETHEKURSE 1 + +struct instance_shattered_halls : public ScriptedInstance +{ + instance_shattered_halls(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + uint64 nethekurseGUID; + uint64 nethekurseDoorGUID; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + nethekurseGUID = 0; + nethekurseDoorGUID = 0; + } + + void OnGameObjectCreate(GameObject* pGo, bool /*add*/) + { + switch(pGo->GetEntry()) + { + case DOOR_NETHEKURSE: nethekurseDoorGUID = pGo->GetGUID(); break; + } + } + + void OnCreatureCreate(Creature* pCreature, bool /*add*/) + { + switch(pCreature->GetEntry()) + { + case 16807: nethekurseGUID = pCreature->GetGUID(); break; + } + } + + void SetData(uint32 type, uint32 data) + { + switch(type) + { + case TYPE_NETHEKURSE: + m_auiEncounter[0] = data; + break; + case TYPE_OMROGG: + m_auiEncounter[1] = data; + break; + } + } + + uint32 GetData(uint32 type) + { + switch(type) + { + case TYPE_NETHEKURSE: + return m_auiEncounter[0]; + case TYPE_OMROGG: + return m_auiEncounter[1]; + } + return 0; + } + + uint64 GetData64(uint32 data) + { + switch(data) + { + case DATA_NETHEKURSE: + return nethekurseGUID; + case DATA_NETHEKURSE_DOOR: + return nethekurseDoorGUID; + } + return 0; + } +}; + +InstanceData* GetInstanceData_instance_shattered_halls(Map* pMap) +{ + return new instance_shattered_halls(pMap); +} + +void AddSC_instance_shattered_halls() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_shattered_halls"; + newscript->GetInstanceData = &GetInstanceData_instance_shattered_halls; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/Outland/HellfireCitadel/shattered_halls/shattered_halls.h b/src/server/scripts/Outland/HellfireCitadel/shattered_halls/shattered_halls.h new file mode 100644 index 00000000000..cbfa23ec4e0 --- /dev/null +++ b/src/server/scripts/Outland/HellfireCitadel/shattered_halls/shattered_halls.h @@ -0,0 +1,14 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_SHATTERED_H +#define DEF_SHATTERED_H + +#define TYPE_NETHEKURSE 1 +#define DATA_NETHEKURSE 2 +#define DATA_NETHEKURSE_DOOR 3 + +#define TYPE_OMROGG 4 +#endif + diff --git a/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp b/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp new file mode 100644 index 00000000000..69dbc877d89 --- /dev/null +++ b/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp @@ -0,0 +1,520 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Arcatraz +SD%Complete: 60 +SDComment: Warden Mellichar, event controller for Skyriss event. Millhouse Manastorm. TODO: make better combatAI for Millhouse. +SDCategory: Tempest Keep, The Arcatraz +EndScriptData */ + +/* ContentData +npc_millhouse_manastorm +npc_warden_mellichar +mob_zerekethvoidzone +EndContentData */ + +#include "ScriptedPch.h" +#include "arcatraz.h" + +/*##### +# npc_millhouse_manastorm +#####*/ + +#define SAY_INTRO_1 -1552010 +#define SAY_INTRO_2 -1552011 +#define SAY_WATER -1552012 +#define SAY_BUFFS -1552013 +#define SAY_DRINK -1552014 +#define SAY_READY -1552015 +#define SAY_KILL_1 -1552016 +#define SAY_KILL_2 -1552017 +#define SAY_PYRO -1552018 +#define SAY_ICEBLOCK -1552019 +#define SAY_LOWHP -1552020 +#define SAY_DEATH -1552021 +#define SAY_COMPLETE -1552022 + +#define SPELL_CONJURE_WATER 36879 +#define SPELL_ARCANE_INTELLECT 36880 +#define SPELL_ICE_ARMOR 36881 + +#define SPELL_ARCANE_MISSILES 33833 +#define SPELL_CONE_OF_COLD 12611 +#define SPELL_FIRE_BLAST 13341 +#define SPELL_FIREBALL 14034 +#define SPELL_FROSTBOLT 15497 +#define SPELL_PYROBLAST 33975 + +struct npc_millhouse_manastormAI : public ScriptedAI +{ + npc_millhouse_manastormAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint32 EventProgress_Timer; + uint32 Phase; + bool Init; + bool LowHp; + + uint32 Pyroblast_Timer; + uint32 Fireball_Timer; + + void Reset() + { + EventProgress_Timer = 2000; + LowHp = false; + Init = false; + Phase = 1; + + Pyroblast_Timer = 1000; + Fireball_Timer = 2500; + + if (pInstance) + { + if (pInstance->GetData(TYPE_WARDEN_2) == DONE) + Init = true; + + if (pInstance->GetData(TYPE_HARBINGERSKYRISS) == DONE) + { + DoScriptText(SAY_COMPLETE, me); + } + } + } + + void AttackStart(Unit* pWho) + { + if (me->Attack(pWho, true)) + { + me->AddThreat(pWho, 0.0f); + me->SetInCombatWith(pWho); + pWho->SetInCombatWith(me); + + me->GetMotionMaster()->MoveChase(pWho, 25.0f); + } + } + + void EnterCombat(Unit * /*who*/) + { + } + + void KilledUnit(Unit * /*victim*/) + { + DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2), me); + } + + void JustDied(Unit * /*victim*/) + { + DoScriptText(SAY_DEATH, me); + + /*for questId 10886 (heroic mode only) + if (pInstance && pInstance->GetData(TYPE_HARBINGERSKYRISS) != DONE) + ->FailQuest();*/ + } + + void UpdateAI(const uint32 diff) + { + if (!Init) + { + if (EventProgress_Timer <= diff) + { + if (Phase < 8) + { + switch(Phase) + { + case 1: + DoScriptText(SAY_INTRO_1, me); + EventProgress_Timer = 18000; + break; + case 2: + DoScriptText(SAY_INTRO_2, me); + EventProgress_Timer = 18000; + break; + case 3: + DoScriptText(SAY_WATER, me); + DoCast(me, SPELL_CONJURE_WATER); + EventProgress_Timer = 7000; + break; + case 4: + DoScriptText(SAY_BUFFS, me); + DoCast(me, SPELL_ICE_ARMOR); + EventProgress_Timer = 7000; + break; + case 5: + DoScriptText(SAY_DRINK, me); + DoCast(me, SPELL_ARCANE_INTELLECT); + EventProgress_Timer = 7000; + break; + case 6: + DoScriptText(SAY_READY, me); + EventProgress_Timer = 6000; + break; + case 7: + if (pInstance) + pInstance->SetData(TYPE_WARDEN_2,DONE); + Init = true; + break; + } + ++Phase; + } + } else EventProgress_Timer -= diff; + } + + if (!UpdateVictim()) + return; + + if (!LowHp && ((me->GetHealth()*100 / me->GetMaxHealth()) < 20)) + { + DoScriptText(SAY_LOWHP, me); + LowHp = true; + } + + if (Pyroblast_Timer <= diff) + { + if (me->IsNonMeleeSpellCasted(false)) + return; + + DoScriptText(SAY_PYRO, me); + + DoCast(me->getVictim(), SPELL_PYROBLAST); + Pyroblast_Timer = 40000; + } else Pyroblast_Timer -=diff; + + if (Fireball_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_FIREBALL); + Fireball_Timer = 4000; + } else Fireball_Timer -=diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_npc_millhouse_manastorm(Creature* pCreature) +{ + return new npc_millhouse_manastormAI (pCreature); +} + +/*##### +# npc_warden_mellichar +#####*/ + +#define YELL_INTRO1 -1552023 +#define YELL_INTRO2 -1552024 +#define YELL_RELEASE1 -1552025 +#define YELL_RELEASE2A -1552026 +#define YELL_RELEASE2B -1552027 +#define YELL_RELEASE3 -1552028 +#define YELL_RELEASE4 -1552029 +#define YELL_WELCOME -1552030 + +//phase 2(acid mobs) +#define ENTRY_TRICKSTER 20905 +#define ENTRY_PH_HUNTER 20906 +//phase 3 +#define ENTRY_MILLHOUSE 20977 +//phase 4(acid mobs) +#define ENTRY_AKKIRIS 20908 +#define ENTRY_SULFURON 20909 +//phase 5(acid mobs) +#define ENTRY_TW_DRAK 20910 +#define ENTRY_BL_DRAK 20911 +//phase 6 +#define ENTRY_SKYRISS 20912 + +//TARGET_SCRIPT +#define SPELL_TARGET_ALPHA 36856 +#define SPELL_TARGET_BETA 36854 +#define SPELL_TARGET_DELTA 36857 +#define SPELL_TARGET_GAMMA 36858 +#define SPELL_TARGET_OMEGA 36852 +#define SPELL_BUBBLE_VISUAL 36849 + +struct npc_warden_mellicharAI : public ScriptedAI +{ + npc_warden_mellicharAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + bool IsRunning; + bool CanSpawn; + + uint32 EventProgress_Timer; + uint32 Phase; + + void Reset() + { + IsRunning = false; + CanSpawn = false; + + EventProgress_Timer = 22000; + Phase = 1; + + me->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE); + DoCast(me, SPELL_TARGET_OMEGA); + + if (pInstance) + pInstance->SetData(TYPE_HARBINGERSKYRISS,NOT_STARTED); + } + + void AttackStart(Unit* /*who*/) {} + + void MoveInLineOfSight(Unit *who) + { + if (IsRunning) + return; + + if (!me->getVictim() && who->isTargetableForAttack() && (me->IsHostileTo(who)) && who->isInAccessiblePlaceFor(me)) + { + if (!me->canFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) + return; + if (who->GetTypeId() != TYPEID_PLAYER) + return; + + float attackRadius = me->GetAttackDistance(who)/10; + if (me->IsWithinDistInMap(who, attackRadius) && me->IsWithinLOSInMap(who)) + EnterCombat(who); + } + } + + void EnterCombat(Unit * /*who*/) + { + DoScriptText(YELL_INTRO1, me); + DoCast(me, SPELL_BUBBLE_VISUAL); + + if (pInstance) + { + pInstance->SetData(TYPE_HARBINGERSKYRISS,IN_PROGRESS); + pInstance->HandleGameObject(pInstance->GetData64(DATA_SPHERE_SHIELD), false); + IsRunning = true; + } + } + + bool CanProgress() + { + if (pInstance) + { + if (Phase == 7 && pInstance->GetData(TYPE_WARDEN_4) == DONE) + return true; + if (Phase == 6 && pInstance->GetData(TYPE_WARDEN_3) == DONE) + return true; + if (Phase == 5 && pInstance->GetData(TYPE_WARDEN_2) == DONE) + return true; + if (Phase == 4) + return true; + if (Phase == 3 && pInstance->GetData(TYPE_WARDEN_1) == DONE) + return true; + if (Phase == 2 && pInstance->GetData(TYPE_HARBINGERSKYRISS) == IN_PROGRESS) + return true; + if (Phase == 1 && pInstance->GetData(TYPE_HARBINGERSKYRISS) == IN_PROGRESS) + return true; + return false; + } + return false; + } + + void DoPrepareForPhase() + { + if (pInstance) + { + me->InterruptNonMeleeSpells(true); + me->RemoveAurasByType(SPELL_AURA_DUMMY); + + switch(Phase) + { + case 2: + DoCast(me, SPELL_TARGET_ALPHA); + pInstance->SetData(TYPE_WARDEN_1,IN_PROGRESS); + pInstance->HandleGameObject(pInstance->GetData64(DATA_SPHERE_SHIELD), false); + break; + case 3: + DoCast(me, SPELL_TARGET_BETA); + pInstance->SetData(TYPE_WARDEN_2,IN_PROGRESS); + break; + case 5: + DoCast(me, SPELL_TARGET_DELTA); + pInstance->SetData(TYPE_WARDEN_3,IN_PROGRESS); + break; + case 6: + DoCast(me, SPELL_TARGET_GAMMA); + pInstance->SetData(TYPE_WARDEN_4,IN_PROGRESS); + break; + case 7: + pInstance->SetData(TYPE_WARDEN_5,IN_PROGRESS); + break; + } + CanSpawn = true; + } + } + + void UpdateAI(const uint32 diff) + { + if (!IsRunning) + return; + + if (EventProgress_Timer <= diff) + { + if (pInstance) + { + if (pInstance->GetData(TYPE_HARBINGERSKYRISS) == FAIL) + { + Reset(); + return; + } + } + + if (CanSpawn) + { + //continue beam omega pod, unless we are about to summon skyriss + if (Phase != 7) + DoCast(me, SPELL_TARGET_OMEGA); + + switch(Phase) + { + case 2: + switch (urand(0,1)) + { + case 0: me->SummonCreature(ENTRY_TRICKSTER,478.326,-148.505,42.56,3.19,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break; + case 1: me->SummonCreature(ENTRY_PH_HUNTER,478.326,-148.505,42.56,3.19,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break; + } + break; + case 3: + me->SummonCreature(ENTRY_MILLHOUSE,413.292,-148.378,42.56,6.27,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); + break; + case 4: + DoScriptText(YELL_RELEASE2B, me); + break; + case 5: + switch (urand(0,1)) + { + case 0: me->SummonCreature(ENTRY_AKKIRIS,420.179,-174.396,42.58,0.02,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break; + case 1: me->SummonCreature(ENTRY_SULFURON,420.179,-174.396,42.58,0.02,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break; + } + break; + case 6: + switch (urand(0,1)) + { + case 0: me->SummonCreature(ENTRY_TW_DRAK,471.795,-174.58,42.58,3.06,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break; + case 1: me->SummonCreature(ENTRY_BL_DRAK,471.795,-174.58,42.58,3.06,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break; + } + break; + case 7: + me->SummonCreature(ENTRY_SKYRISS,445.763,-191.639,44.64,1.60,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); + DoScriptText(YELL_WELCOME, me); + break; + } + CanSpawn = false; + ++Phase; + } + if (CanProgress()) + { + switch(Phase) + { + case 1: + DoScriptText(YELL_INTRO2, me); + EventProgress_Timer = 10000; + ++Phase; + break; + case 2: + DoScriptText(YELL_RELEASE1, me); + DoPrepareForPhase(); + EventProgress_Timer = 7000; + break; + case 3: + DoScriptText(YELL_RELEASE2A, me); + DoPrepareForPhase(); + EventProgress_Timer = 10000; + break; + case 4: + DoPrepareForPhase(); + EventProgress_Timer = 15000; + break; + case 5: + DoScriptText(YELL_RELEASE3, me); + DoPrepareForPhase(); + EventProgress_Timer = 15000; + break; + case 6: + DoScriptText(YELL_RELEASE4, me); + DoPrepareForPhase(); + EventProgress_Timer = 15000; + break; + case 7: + DoPrepareForPhase(); + EventProgress_Timer = 15000; + break; + } + } + } else EventProgress_Timer -= diff; + } +}; +CreatureAI* GetAI_npc_warden_mellichar(Creature* pCreature) +{ + return new npc_warden_mellicharAI (pCreature); +} + +/*##### +# mob_zerekethvoidzone (this script probably not needed in future -> `creature_template_addon`.`auras`='36120 0') +#####*/ + +#define SPELL_VOID_ZONE_DAMAGE 36120 + +struct mob_zerekethvoidzoneAI : public ScriptedAI +{ + mob_zerekethvoidzoneAI(Creature *c) : ScriptedAI(c) {} + + void Reset() + { + me->SetUInt32Value(UNIT_NPC_FLAGS,0); + me->setFaction(16); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + + DoCast(me, SPELL_VOID_ZONE_DAMAGE); + } + + void EnterCombat(Unit* /*who*/) {} +}; +CreatureAI* GetAI_mob_zerekethvoidzoneAI(Creature* pCreature) +{ + return new mob_zerekethvoidzoneAI (pCreature); +} + +void AddSC_arcatraz() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_millhouse_manastorm"; + newscript->GetAI = &GetAI_npc_millhouse_manastorm; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_warden_mellichar"; + newscript->GetAI = &GetAI_npc_warden_mellichar; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_zerekethvoidzone"; + newscript->GetAI = &GetAI_mob_zerekethvoidzoneAI; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.h b/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.h new file mode 100644 index 00000000000..3f8dee8bbd0 --- /dev/null +++ b/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.h @@ -0,0 +1,21 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_ARCATRAZ_H +#define DEF_ARCATRAZ_H + +#define TYPE_ZEREKETH 1 +#define TYPE_DALLIAH 2 +#define TYPE_SOCCOTHRATES 3 +#define TYPE_HARBINGERSKYRISS 4 +#define TYPE_WARDEN_1 5 +#define TYPE_WARDEN_2 6 +#define TYPE_WARDEN_3 7 +#define TYPE_WARDEN_4 8 +#define TYPE_WARDEN_5 9 +#define DATA_MELLICHAR 10 +#define TYPE_SHIELD_OPEN 11 +#define DATA_SPHERE_SHIELD 12 +#endif + diff --git a/src/server/scripts/Outland/TempestKeep/arcatraz/boss_harbinger_skyriss.cpp b/src/server/scripts/Outland/TempestKeep/arcatraz/boss_harbinger_skyriss.cpp new file mode 100644 index 00000000000..6576974f3ff --- /dev/null +++ b/src/server/scripts/Outland/TempestKeep/arcatraz/boss_harbinger_skyriss.cpp @@ -0,0 +1,293 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Harbinger_Skyriss +SD%Complete: 45 +SDComment: CombatAI not fully implemented. Timers will need adjustments. Need more docs on how event fully work. Reset all event and force start over if fail at one point? +SDCategory: Tempest Keep, The Arcatraz +EndScriptData */ + +/* ContentData +boss_harbinger_skyriss +boss_harbinger_skyriss_illusion +EndContentData */ + +#include "ScriptedPch.h" +#include "arcatraz.h" + +#define SAY_INTRO -1552000 +#define SAY_AGGRO -1552001 +#define SAY_KILL_1 -1552002 +#define SAY_KILL_2 -1552003 +#define SAY_MIND_1 -1552004 +#define SAY_MIND_2 -1552005 +#define SAY_FEAR_1 -1552006 +#define SAY_FEAR_2 -1552007 +#define SAY_IMAGE -1552008 +#define SAY_DEATH -1552009 + +#define SPELL_FEAR 39415 + +#define SPELL_MIND_REND 36924 +#define H_SPELL_MIND_REND 39017 + +#define SPELL_DOMINATION 37162 +#define H_SPELL_DOMINATION 39019 + +#define H_SPELL_MANA_BURN 39020 + +#define SPELL_66_ILLUSION 36931 //entry 21466 +#define SPELL_33_ILLUSION 36932 //entry 21467 + +struct boss_harbinger_skyrissAI : public ScriptedAI +{ + boss_harbinger_skyrissAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + Intro = false; + } + + ScriptedInstance *pInstance; + + bool Intro; + bool IsImage33; + bool IsImage66; + + uint32 Intro_Phase; + uint32 Intro_Timer; + uint32 MindRend_Timer; + uint32 Fear_Timer; + uint32 Domination_Timer; + uint32 ManaBurn_Timer; + + void Reset() + { + if (!Intro) + me->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_OOC_NOT_ATTACKABLE); + + IsImage33 = false; + IsImage66 = false; + + Intro_Phase = 1; + Intro_Timer = 5000; + MindRend_Timer = 3000; + Fear_Timer = 15000; + Domination_Timer = 30000; + ManaBurn_Timer = 25000; + } + + void MoveInLineOfSight(Unit *who) + { + if (!Intro) + { + return; + } + ScriptedAI::MoveInLineOfSight(who); + } + + void EnterCombat(Unit * /*who*/) {} + + void JustDied(Unit* /*Killer*/) + { + DoScriptText(SAY_DEATH, me); + if (pInstance) + pInstance->SetData(TYPE_HARBINGERSKYRISS,DONE); + } + + void JustSummoned(Creature *summon) + { + if (!summon) + return; + if (IsImage66) + summon->SetHealth((summon->GetMaxHealth()*33)/100); + else + summon->SetHealth((summon->GetMaxHealth()*66)/100); + if (me->getVictim()) + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + summon->AI()->AttackStart(pTarget); + } + + void KilledUnit(Unit* victim) + { + //won't yell killing pet/other unit + if (victim->GetEntry() == 21436) + return; + + DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2), me); + } + + void DoSplit(uint32 val) + { + if (me->IsNonMeleeSpellCasted(false)) + me->InterruptNonMeleeSpells(false); + + DoScriptText(SAY_IMAGE, me); + + if (val == 66) + DoCast(me, SPELL_66_ILLUSION); + else + DoCast(me, SPELL_33_ILLUSION); + } + + void UpdateAI(const uint32 diff) + { + if (!Intro) + { + if (!pInstance) + return; + + if (Intro_Timer <= diff) + { + switch(Intro_Phase) + { + case 1: + DoScriptText(SAY_INTRO, me); + pInstance->HandleGameObject(pInstance->GetData64(DATA_SPHERE_SHIELD), true); + ++Intro_Phase; + Intro_Timer = 25000; + break; + case 2: + DoScriptText(SAY_AGGRO, me); + if (Unit *mellic = Unit::GetUnit(*me,pInstance->GetData64(DATA_MELLICHAR))) + { + //should have a better way to do this. possibly spell exist. + mellic->setDeathState(JUST_DIED); + mellic->SetHealth(0); + pInstance->SetData(TYPE_SHIELD_OPEN,IN_PROGRESS); + } + ++Intro_Phase; + Intro_Timer = 3000; + break; + case 3: + me->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_OOC_NOT_ATTACKABLE); + Intro = true; + break; + } + } else Intro_Timer -=diff; + } + + if (!UpdateVictim()) + return; + + if (!IsImage66 && ((me->GetHealth()*100) / me->GetMaxHealth() <= 66)) + { + DoSplit(66); + IsImage66 = true; + } + if (!IsImage33 && ((me->GetHealth()*100) / me->GetMaxHealth() <= 33)) + { + DoSplit(33); + IsImage33 = true; + } + + if (MindRend_Timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1)) + DoCast(pTarget, SPELL_MIND_REND); + else + DoCast(me->getVictim(), SPELL_MIND_REND); + + MindRend_Timer = 8000; + } else MindRend_Timer -=diff; + + if (Fear_Timer <= diff) + { + if (me->IsNonMeleeSpellCasted(false)) + return; + + DoScriptText(RAND(SAY_FEAR_1,SAY_FEAR_2), me); + + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1)) + DoCast(pTarget, SPELL_FEAR); + else + DoCast(me->getVictim(), SPELL_FEAR); + + Fear_Timer = 25000; + } else Fear_Timer -=diff; + + if (Domination_Timer <= diff) + { + if (me->IsNonMeleeSpellCasted(false)) + return; + + DoScriptText(RAND(SAY_MIND_1,SAY_MIND_2), me); + + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1)) + DoCast(pTarget, SPELL_DOMINATION); + else + DoCast(me->getVictim(), SPELL_DOMINATION); + + Domination_Timer = 16000+rand()%16000; + } else Domination_Timer -=diff; + + if (IsHeroic()) + { + if (ManaBurn_Timer <= diff) + { + if (me->IsNonMeleeSpellCasted(false)) + return; + + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1)) + DoCast(pTarget, H_SPELL_MANA_BURN); + + ManaBurn_Timer = 16000+rand()%16000; + } else ManaBurn_Timer -=diff; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_harbinger_skyriss(Creature* pCreature) +{ + return new boss_harbinger_skyrissAI (pCreature); +} + +#define SPELL_MIND_REND_IMAGE 36929 +#define H_SPELL_MIND_REND_IMAGE 39021 + +struct boss_harbinger_skyriss_illusionAI : public ScriptedAI +{ + boss_harbinger_skyriss_illusionAI(Creature *c) : ScriptedAI(c) + { + } + + void Reset() { } + + void EnterCombat(Unit * /*who*/) { } +}; + +CreatureAI* GetAI_boss_harbinger_skyriss_illusion(Creature* pCreature) +{ + return new boss_harbinger_skyriss_illusionAI (pCreature); +} + +void AddSC_boss_harbinger_skyriss() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_harbinger_skyriss"; + newscript->GetAI = &GetAI_boss_harbinger_skyriss; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_harbinger_skyriss_illusion"; + newscript->GetAI = &GetAI_boss_harbinger_skyriss_illusion; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/Outland/TempestKeep/arcatraz/instance_arcatraz.cpp b/src/server/scripts/Outland/TempestKeep/arcatraz/instance_arcatraz.cpp new file mode 100644 index 00000000000..d16975e2af6 --- /dev/null +++ b/src/server/scripts/Outland/TempestKeep/arcatraz/instance_arcatraz.cpp @@ -0,0 +1,240 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Arcatraz +SD%Complete: 80 +SDComment: Mainly Harbringer Skyriss event +SDCategory: Tempest Keep, The Arcatraz +EndScriptData */ + +#include "ScriptedPch.h" +#include "arcatraz.h" + +#define MAX_ENCOUNTER 9 + +#define CONTAINMENT_CORE_SECURITY_FIELD_ALPHA 184318 //door opened when Wrath-Scryer Soccothrates dies +#define CONTAINMENT_CORE_SECURITY_FIELD_BETA 184319 //door opened when Dalliah the Doomsayer dies +#define POD_ALPHA 183961 //pod first boss wave +#define POD_BETA 183963 //pod second boss wave +#define POD_DELTA 183964 //pod third boss wave +#define POD_GAMMA 183962 //pod fourth boss wave +#define POD_OMEGA 183965 //pod fifth boss wave +#define WARDENS_SHIELD 184802 // warden shield +#define SEAL_SPHERE 184802 //shield 'protecting' mellichar + +#define MELLICHAR 20904 //skyriss will kill this unit + +/* Arcatraz encounters: +1 - Zereketh the Unbound event +2 - Dalliah the Doomsayer event +3 - Wrath-Scryer Soccothrates event +4 - Harbinger Skyriss event, 5 sub-events +*/ + +struct instance_arcatraz : public ScriptedInstance +{ + instance_arcatraz(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + + uint64 Containment_Core_Security_Field_AlphaGUID; + uint64 Containment_Core_Security_Field_BetaGUID; + uint64 Pod_AlphaGUID; + uint64 Pod_GammaGUID; + uint64 Pod_BetaGUID; + uint64 Pod_DeltaGUID; + uint64 Pod_OmegaGUID; + uint64 Wardens_ShieldGUID; + uint64 GoSphereGUID; + uint64 MellicharGUID; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + Containment_Core_Security_Field_AlphaGUID = 0; + Containment_Core_Security_Field_BetaGUID = 0; + Pod_AlphaGUID = 0; + Pod_GammaGUID = 0; + Pod_BetaGUID = 0; + Pod_DeltaGUID = 0; + Pod_OmegaGUID = 0; + Wardens_ShieldGUID = 0; + GoSphereGUID = 0; + MellicharGUID = 0; + } + + bool IsEncounterInProgress() const + { + for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) return true; + + return false; + } + + void OnGameObjectCreate(GameObject* pGo, bool /*add*/) + { + switch(pGo->GetEntry()) + { + case CONTAINMENT_CORE_SECURITY_FIELD_ALPHA: Containment_Core_Security_Field_AlphaGUID = pGo->GetGUID(); break; + case CONTAINMENT_CORE_SECURITY_FIELD_BETA: Containment_Core_Security_Field_BetaGUID = pGo->GetGUID(); break; + case POD_ALPHA: Pod_AlphaGUID = pGo->GetGUID(); break; + case POD_GAMMA: Pod_GammaGUID = pGo->GetGUID(); break; + case POD_BETA: Pod_BetaGUID = pGo->GetGUID(); break; + case POD_DELTA: Pod_DeltaGUID = pGo->GetGUID(); break; + case POD_OMEGA: Pod_OmegaGUID = pGo->GetGUID(); break; + case SEAL_SPHERE: GoSphereGUID = pGo->GetGUID(); break; + //case WARDENS_SHIELD: Wardens_ShieldGUID = pGo->GetGUID(); break; + } + } + + void OnCreatureCreate(Creature* pCreature, bool /*add*/) + { + if (pCreature->GetEntry() == MELLICHAR) + MellicharGUID = pCreature->GetGUID(); + } + + void SetData(uint32 type, uint32 data) + { + switch(type) + { + case TYPE_ZEREKETH: + m_auiEncounter[0] = data; + break; + + case TYPE_DALLIAH: + if (data == DONE) + { + if (GameObject *pGo = instance->GetGameObject(Containment_Core_Security_Field_BetaGUID)) + pGo->UseDoorOrButton(); + } + m_auiEncounter[1] = data; + break; + + case TYPE_SOCCOTHRATES: + if (data == DONE) + { + if (GameObject *pGo = instance->GetGameObject(Containment_Core_Security_Field_AlphaGUID)) + pGo->UseDoorOrButton(); + } + m_auiEncounter[2] = data; + break; + + case TYPE_HARBINGERSKYRISS: + if (data == NOT_STARTED || data == FAIL) + { + m_auiEncounter[4] = NOT_STARTED; + m_auiEncounter[5] = NOT_STARTED; + m_auiEncounter[6] = NOT_STARTED; + m_auiEncounter[7] = NOT_STARTED; + m_auiEncounter[8] = NOT_STARTED; + } + m_auiEncounter[3] = data; + break; + + case TYPE_WARDEN_1: + if (data == IN_PROGRESS) + if (GameObject *pGo = instance->GetGameObject(Pod_AlphaGUID)) + pGo->UseDoorOrButton(); + m_auiEncounter[4] = data; + break; + + case TYPE_WARDEN_2: + if (data == IN_PROGRESS) + { + if (GameObject *pGo = instance->GetGameObject(Pod_BetaGUID)) + pGo->UseDoorOrButton(); + } + m_auiEncounter[5] = data; + break; + + case TYPE_WARDEN_3: + if (data == IN_PROGRESS) + { + if (GameObject *pGo = instance->GetGameObject(Pod_DeltaGUID)) + pGo->UseDoorOrButton(); + } + m_auiEncounter[6] = data; + break; + + case TYPE_WARDEN_4: + if (data == IN_PROGRESS) + { + if (GameObject *pGo = instance->GetGameObject(Pod_GammaGUID)) + pGo->UseDoorOrButton(); + } + m_auiEncounter[7] = data; + break; + + case TYPE_WARDEN_5: + if (data == IN_PROGRESS) + { + if (GameObject *pGo = instance->GetGameObject(Pod_OmegaGUID)) + pGo->UseDoorOrButton(); + } + m_auiEncounter[8] = data; + break; + + case TYPE_SHIELD_OPEN: + if (data == IN_PROGRESS) + { + if (GameObject *pGo = instance->GetGameObject(Wardens_ShieldGUID)) + pGo->UseDoorOrButton(); + } + break; + } + } + + uint32 GetData(uint32 type) + { + switch(type) + { + case TYPE_HARBINGERSKYRISS: return m_auiEncounter[3]; + case TYPE_WARDEN_1: return m_auiEncounter[4]; + case TYPE_WARDEN_2: return m_auiEncounter[5]; + case TYPE_WARDEN_3: return m_auiEncounter[6]; + case TYPE_WARDEN_4: return m_auiEncounter[7]; + case TYPE_WARDEN_5: return m_auiEncounter[8]; + } + return 0; + } + + uint64 GetData64(uint32 data) + { + switch(data) + { + case DATA_MELLICHAR: return MellicharGUID; + case DATA_SPHERE_SHIELD: return GoSphereGUID; + } + return 0; + } +}; + +InstanceData* GetInstanceData_instance_arcatraz(Map* pMap) +{ + return new instance_arcatraz(pMap); +} + +void AddSC_instance_arcatraz() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_arcatraz"; + newscript->GetInstanceData = &GetInstanceData_instance_arcatraz; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/Outland/TempestKeep/botanica/boss_high_botanist_freywinn.cpp b/src/server/scripts/Outland/TempestKeep/botanica/boss_high_botanist_freywinn.cpp new file mode 100644 index 00000000000..1a077036298 --- /dev/null +++ b/src/server/scripts/Outland/TempestKeep/botanica/boss_high_botanist_freywinn.cpp @@ -0,0 +1,191 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_High_Botanist_Freywinn +SD%Complete: 90 +SDComment: some strange visual related to tree form(if aura lost before normal duration end). possible make summon&transform -process smoother(transform after delay) +SDCategory: Tempest Keep, The Botanica +EndScriptData */ + +#include "ScriptedPch.h" + +#define SAY_AGGRO -1553000 +#define SAY_KILL_1 -1553001 +#define SAY_KILL_2 -1553002 +#define SAY_TREE_1 -1553003 +#define SAY_TREE_2 -1553004 +#define SAY_DEATH -1553005 + +#define SPELL_TRANQUILITY 34550 +#define SPELL_TREE_FORM 34551 + +#define SPELL_SUMMON_FRAYER 34557 +#define ENTRY_FRAYER 19953 + +#define SPELL_PLANT_WHITE 34759 +#define SPELL_PLANT_GREEN 34761 +#define SPELL_PLANT_BLUE 34762 +#define SPELL_PLANT_RED 34763 + +struct boss_high_botanist_freywinnAI : public ScriptedAI +{ + boss_high_botanist_freywinnAI(Creature *c) : ScriptedAI(c) {} + + std::list Adds_List; + + uint32 SummonSeedling_Timer; + uint32 TreeForm_Timer; + uint32 MoveCheck_Timer; + uint32 DeadAddsCount; + bool MoveFree; + + void Reset() + { + Adds_List.clear(); + + SummonSeedling_Timer = 6000; + TreeForm_Timer = 30000; + MoveCheck_Timer = 1000; + DeadAddsCount = 0; + MoveFree = true; + } + + void EnterCombat(Unit * /*who*/) + { + DoScriptText(SAY_AGGRO, me); + } + + void JustSummoned(Creature *summoned) + { + if (summoned->GetEntry() == ENTRY_FRAYER) + Adds_List.push_back(summoned->GetGUID()); + } + + void DoSummonSeedling() + { + switch(rand()%4) + { + case 0: DoCast(me, SPELL_PLANT_WHITE); break; + case 1: DoCast(me, SPELL_PLANT_GREEN); break; + case 2: DoCast(me, SPELL_PLANT_BLUE); break; + case 3: DoCast(me, SPELL_PLANT_RED); break; + } + } + + void KilledUnit(Unit* /*victim*/) + { + DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2), me); + } + + void JustDied(Unit* /*Killer*/) + { + DoScriptText(SAY_DEATH, me); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (TreeForm_Timer <= diff) + { + DoScriptText(RAND(SAY_TREE_1,SAY_TREE_2), me); + + if (me->IsNonMeleeSpellCasted(false)) + me->InterruptNonMeleeSpells(true); + + me->RemoveAllAuras(); + + DoCast(me, SPELL_SUMMON_FRAYER, true); + DoCast(me, SPELL_TRANQUILITY, true); + DoCast(me, SPELL_TREE_FORM, true); + + me->GetMotionMaster()->MoveIdle(); + MoveFree = false; + + TreeForm_Timer = 75000; + } else TreeForm_Timer -= diff; + + if (!MoveFree) + { + if (MoveCheck_Timer <= diff) + { + if (!Adds_List.empty()) + { + for (std::list::iterator itr = Adds_List.begin(); itr != Adds_List.end(); ++itr) + { + if (Unit *temp = Unit::GetUnit(*me,*itr)) + { + if (!temp->isAlive()) + { + Adds_List.erase(itr); + ++DeadAddsCount; + break; + } + } + } + } + + if (DeadAddsCount < 3 && TreeForm_Timer-30000 <= diff) + DeadAddsCount = 3; + + if (DeadAddsCount >= 3) + { + Adds_List.clear(); + DeadAddsCount = 0; + + me->InterruptNonMeleeSpells(true); + me->RemoveAllAuras(); + me->GetMotionMaster()->MoveChase(me->getVictim()); + MoveFree = true; + } + MoveCheck_Timer = 500; + } + else MoveCheck_Timer -= diff; + + return; + } + + /*if (me->HasAura(SPELL_TREE_FORM,0) || me->HasAura(SPELL_TRANQUILITY,0)) + return;*/ + + //one random seedling every 5 secs, but not in tree form + if (SummonSeedling_Timer <= diff) + { + DoSummonSeedling(); + SummonSeedling_Timer = 6000; + } else SummonSeedling_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_high_botanist_freywinn(Creature* pCreature) +{ + return new boss_high_botanist_freywinnAI (pCreature); +} + +void AddSC_boss_high_botanist_freywinn() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_high_botanist_freywinn"; + newscript->GetAI = &GetAI_boss_high_botanist_freywinn; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/Outland/TempestKeep/botanica/boss_laj.cpp b/src/server/scripts/Outland/TempestKeep/botanica/boss_laj.cpp new file mode 100644 index 00000000000..cbf21c2f992 --- /dev/null +++ b/src/server/scripts/Outland/TempestKeep/botanica/boss_laj.cpp @@ -0,0 +1,205 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Laj +SD%Complete: 90 +SDComment: Immunities are wrong, must be adjusted to use resistance from creature_templates. Most spells require database support. +SDCategory: Tempest Keep, The Botanica +EndScriptData */ + +#include "ScriptedPch.h" + +#define EMOTE_SUMMON -1553006 + +#define SPELL_ALLERGIC_REACTION 34697 +#define SPELL_TELEPORT_SELF 34673 + +#define SPELL_SUMMON_LASHER_1 34681 +#define SPELL_SUMMON_FLAYER_1 34682 +#define SPELL_SUMMON_LASHER_2 34684 +#define SPELL_SUMMON_FLAYER_2 34685 +#define SPELL_SUMMON_LASHER_3 34686 +#define SPELL_SUMMON_FLAYER_4 34687 +#define SPELL_SUMMON_LASHER_4 34688 +#define SPELL_SUMMON_FLAYER_3 34690 + +#define MODEL_DEFAULT 13109 +#define MODEL_ARCANE 14213 +#define MODEL_FIRE 13110 +#define MODEL_FROST 14112 +#define MODEL_NATURE 14214 + +struct boss_lajAI : public ScriptedAI +{ + boss_lajAI(Creature *c) : ScriptedAI(c) {} + + bool CanSummon; + uint32 Teleport_Timer; + uint32 Summon_Timer; + uint32 Transform_Timer; + uint32 Allergic_Timer; + + void Reset() + { + me->SetDisplayId(MODEL_DEFAULT); + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, true); + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, false); + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false); + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false); + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false); + + CanSummon = false; + Teleport_Timer = 20000; + Summon_Timer = 2500; + Transform_Timer = 30000; + Allergic_Timer = 5000; + } + + void DoTransform() + { + switch(rand()%5) + { + case 0: + me->SetDisplayId(MODEL_DEFAULT); + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, true); + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, false); + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false); + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false); + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false); + break; + case 1: + me->SetDisplayId(MODEL_ARCANE); + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, false); + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, true); + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false); + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false); + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false); + break; + case 2: + me->SetDisplayId(MODEL_FIRE); + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, false); + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, false); + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true); + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false); + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false); + break; + case 3: + me->SetDisplayId(MODEL_FROST); + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, false); + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, false); + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false); + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true); + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false); + break; + case 4: + me->SetDisplayId(MODEL_NATURE); + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, false); + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, false); + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false); + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false); + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, true); + break; + } + } + + void DoSummons() + { + switch(rand()%4) + { + case 0: + DoCast(me, SPELL_SUMMON_LASHER_1, true); + DoCast(me, SPELL_SUMMON_FLAYER_1, true); + break; + case 1: + DoCast(me, SPELL_SUMMON_LASHER_2, true); + DoCast(me, SPELL_SUMMON_FLAYER_2, true); + break; + case 2: + DoCast(me, SPELL_SUMMON_LASHER_3, true); + DoCast(me, SPELL_SUMMON_FLAYER_3, true); + break; + case 3: + DoCast(me, SPELL_SUMMON_LASHER_4, true); + DoCast(me, SPELL_SUMMON_FLAYER_4, true); + break; + } + CanSummon = false; + } + + void EnterCombat(Unit * /*who*/) + { + } + + void JustSummoned(Creature *summon) + { + if (summon && me->getVictim()) + summon->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0)); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (CanSummon) + { + if (Summon_Timer <= diff) + { + DoScriptText(EMOTE_SUMMON, me); + DoSummons(); + Summon_Timer = 2500; + } else Summon_Timer -= diff; + } + + if (Allergic_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_ALLERGIC_REACTION); + Allergic_Timer = 25000+rand()%15000; + } else Allergic_Timer -= diff; + + if (Teleport_Timer <= diff) + { + DoCast(me, SPELL_TELEPORT_SELF); + Teleport_Timer = 30000+rand()%10000; + CanSummon = true; + } else Teleport_Timer -= diff; + + if (Transform_Timer <= diff) + { + DoTransform(); + Transform_Timer = 25000+rand()%15000; + } else Transform_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_laj(Creature* pCreature) +{ + return new boss_lajAI (pCreature); +} + +void AddSC_boss_laj() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_laj"; + newscript->GetAI = &GetAI_boss_laj; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp b/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp new file mode 100644 index 00000000000..48eb03c16d3 --- /dev/null +++ b/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp @@ -0,0 +1,216 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/* ScriptData +SDName: Boss_Warp_Splinter +SD%Complete: 80 +SDComment: Includes Sapling (need some better control with these). +SDCategory: Tempest Keep, The Botanica +EndScriptData */ + +#include "ScriptedPch.h" + +/*##### +# mob_treant (Sapling) +#####*/ + +#define SPELL_HEAL_FATHER 6262 + +struct mob_treantAI : public ScriptedAI +{ + mob_treantAI (Creature *c) : ScriptedAI(c) + { + WarpGuid = 0; + } + + uint64 WarpGuid; + uint32 check_Timer; + + void Reset() + { + check_Timer = 0; + } + + void EnterCombat(Unit * /*who*/) {} + + void MoveInLineOfSight(Unit* /*who*/) {} + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + { + if (WarpGuid && check_Timer <= diff) + { + if (Unit *Warp = Unit::GetUnit(*me, WarpGuid)) + { + if (me->IsWithinMeleeRange(Warp,2.5f)) + { + int32 CurrentHP_Treant = (int32)me->GetHealth(); + Warp->CastCustomSpell(Warp,SPELL_HEAL_FATHER,&CurrentHP_Treant, 0, 0, true,0 ,0, me->GetGUID()); + me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + return; + } + me->GetMotionMaster()->MoveFollow(Warp,0,0); + } + check_Timer = 1000; + } else check_Timer -= diff; + return; + } + + if (me->getVictim()->GetGUID() != WarpGuid) + DoMeleeAttackIfReady(); + } +}; + +/*##### +# boss_warp_splinter +#####*/ + +#define SAY_AGGRO -1553007 +#define SAY_SLAY_1 -1553008 +#define SAY_SLAY_2 -1553009 +#define SAY_SUMMON_1 -1553010 +#define SAY_SUMMON_2 -1553011 +#define SAY_DEATH -1553012 + +#define WAR_STOMP 34716 +#define SUMMON_TREANTS 34727 // DBC: 34727, 34731, 34733, 34734, 34736, 34739, 34741 (with Ancestral Life spell 34742) // won't work (guardian summon) +#define ARCANE_VOLLEY DUNGEON_MODE(36705, 39133) + +#define CREATURE_TREANT 19949 + +#define TREANT_SPAWN_DIST 50 //50 yards from Warp Splinter's spawn point + +float treant_pos[6][3] = +{ + {24.301233, 427.221100, -27.060635}, + {16.795492, 359.678802, -27.355425}, + {53.493484, 345.381470, -26.196192}, + {61.867096, 439.362732, -25.921030}, + {109.861877, 423.201630, -27.356019}, + {106.780159, 355.582581, -27.593357} +}; + +struct boss_warp_splinterAI : public ScriptedAI +{ + boss_warp_splinterAI(Creature *c) : ScriptedAI(c) + { + Treant_Spawn_Pos_X = c->GetPositionX(); + Treant_Spawn_Pos_Y = c->GetPositionY(); + } + + uint32 War_Stomp_Timer; + uint32 Summon_Treants_Timer; + uint32 Arcane_Volley_Timer; + + float Treant_Spawn_Pos_X; + float Treant_Spawn_Pos_Y; + + void Reset() + { + War_Stomp_Timer = 25000 + rand()%15000; + Summon_Treants_Timer = 45000; + Arcane_Volley_Timer = 8000 + rand()%12000; + + me->SetSpeed(MOVE_RUN, 0.7f, true); + } + + void EnterCombat(Unit * /*who*/) + { + DoScriptText(SAY_AGGRO, me); + } + + void KilledUnit(Unit* /*victim*/) + { + DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me); + } + + void JustDied(Unit* /*Killer*/) + { + DoScriptText(SAY_DEATH, me); + } + + void SummonTreants() + { + for (uint8 i = 0; i < 6; ++i) + { + float angle = (M_PI / 3) * i; + + float X = Treant_Spawn_Pos_X + TREANT_SPAWN_DIST * cos(angle); + float Y = Treant_Spawn_Pos_Y + TREANT_SPAWN_DIST * sin(angle); + float O = - me->GetAngle(X,Y); + + if (Creature *pTreant = me->SummonCreature(CREATURE_TREANT,treant_pos[i][0],treant_pos[i][1],treant_pos[i][2],O,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,25000)) + CAST_AI(mob_treantAI, pTreant->AI())->WarpGuid = me->GetGUID(); + } + DoScriptText(RAND(SAY_SUMMON_1,SAY_SUMMON_2), me); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //Check for War Stomp + if (War_Stomp_Timer <= diff) + { + DoCast(me->getVictim(), WAR_STOMP); + War_Stomp_Timer = 25000 + rand()%15000; + } else War_Stomp_Timer -= diff; + + //Check for Arcane Volley + if (Arcane_Volley_Timer <= diff) + { + DoCast(me->getVictim(), ARCANE_VOLLEY); + Arcane_Volley_Timer = 20000 + rand()%15000; + } else Arcane_Volley_Timer -= diff; + + //Check for Summon Treants + if (Summon_Treants_Timer <= diff) + { + SummonTreants(); + Summon_Treants_Timer = 45000; + } else Summon_Treants_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_warp_splinter(Creature* pCreature) +{ + return new boss_warp_splinterAI (pCreature); +} + +CreatureAI* GetAI_mob_treant(Creature* pCreature) +{ + return new mob_treantAI (pCreature); +} + +void AddSC_boss_warp_splinter() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_warp_splinter"; + newscript->GetAI = &GetAI_boss_warp_splinter; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_warp_splinter_treant"; + newscript->GetAI = &GetAI_mob_treant; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/Outland/TempestKeep/the_eye/boss_alar.cpp b/src/server/scripts/Outland/TempestKeep/the_eye/boss_alar.cpp new file mode 100644 index 00000000000..af5f1bd95c1 --- /dev/null +++ b/src/server/scripts/Outland/TempestKeep/the_eye/boss_alar.cpp @@ -0,0 +1,523 @@ +/* Copyright(C) 2006 - 2008 ScriptDev2 +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +*(at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/* ScriptData +SDName: boss_alar +SD%Complete: 95 +SDComment: +SDCategory: Tempest Keep, The Eye +EndScriptData */ + +#include "ScriptedPch.h" +#include "the_eye.h" + +#define SPELL_FLAME_BUFFET 34121 // Flame Buffet - every 1,5 secs in phase 1 if there is no victim in melee range and after Dive Bomb in phase 2 with same conditions +#define SPELL_FLAME_QUILLS 34229 // Randomly after changing position in phase after watching tonns of movies, set probability 20% +#define SPELL_REBIRTH 34342 // Rebirth - beginning of second phase(after loose all health in phase 1) +#define SPELL_REBIRTH_2 35369 // Rebirth(another, without healing to full HP) - after Dive Bomb in phase 2 +#define SPELL_MELT_ARMOR 35410 // Melt Armor - every 60 sec in phase 2 +#define SPELL_CHARGE 35412 // Charge - 30 sec cooldown +#define SPELL_DIVE_BOMB_VISUAL 35367 // Bosskillers says 30 sec cooldown, wowwiki says 30 sec colldown, DBM and BigWigs addons says ~47 sec +#define SPELL_DIVE_BOMB 35181 // after watching tonns of movies, set cooldown to 40+rand()%5. +#define SPELL_BERSERK 45078 // 10 minutes after phase 2 starts(id is wrong, but proper id is unknown) + +#define CREATURE_EMBER_OF_ALAR 19551 // Al'ar summons one Ember of Al'ar every position change in phase 1 and two after Dive Bomb. Also in phase 2 when Ember of Al'ar dies, boss loose 3% health. +#define SPELL_EMBER_BLAST 34133 // When Ember of Al'ar dies, it casts Ember Blast + +#define CREATURE_FLAME_PATCH_ALAR 20602 // Flame Patch - every 30 sec in phase 2 +#define SPELL_FLAME_PATCH 35380 // + +static float waypoint[6][3] = +{ + {340.15, 58.65, 17.71}, + {388.09, 31.54, 20.18}, + {388.18, -32.85, 20.18}, + {340.29, -60.19, 17.72}, + {332, 0.01, 39}, // better not use the same xy coord + {331, 0.01, -2.39} +}; + +enum WaitEventType +{ + WE_NONE = 0, + WE_DUMMY = 1, + WE_PLATFORM = 2, + WE_QUILL = 3, + WE_DIE = 4, + WE_REVIVE = 5, + WE_CHARGE = 6, + WE_METEOR = 7, + WE_DIVE = 8, + WE_LAND = 9, + WE_SUMMON = 10 +}; + +struct boss_alarAI : public ScriptedAI +{ + boss_alarAI(Creature *c) : ScriptedAI(c) + { + pInstance =c->GetInstanceData(); + DefaultMoveSpeedRate = c->GetSpeedRate(MOVE_RUN); + } + + ScriptedInstance *pInstance; + + WaitEventType WaitEvent; + uint32 WaitTimer; + + bool AfterMoving; + + uint32 Platforms_Move_Timer; + uint32 DiveBomb_Timer; + uint32 MeltArmor_Timer; + uint32 Charge_Timer; + uint32 FlamePatch_Timer; + uint32 Berserk_Timer; + + float DefaultMoveSpeedRate; + + bool Phase1; + bool ForceMove; + uint32 ForceTimer; + + int8 cur_wp; + + void Reset() + { + if (pInstance) + pInstance->SetData(DATA_ALAREVENT, NOT_STARTED); + + Berserk_Timer = 1200000; + Platforms_Move_Timer = 0; + + Phase1 = true; + WaitEvent = WE_NONE; + WaitTimer = 0; + AfterMoving = false; + ForceMove = false; + ForceTimer = 5000; + + cur_wp = 4; + + me->SetDisplayId(me->GetNativeDisplayId()); + me->SetSpeed(MOVE_RUN, DefaultMoveSpeedRate); + //me->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 10); + //me->SetFloatValue(UNIT_FIELD_COMBATREACH, 10); + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true); + me->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + me->setActive(false); + } + + void EnterCombat(Unit * /*who*/) + { + if (pInstance) + pInstance->SetData(DATA_ALAREVENT, IN_PROGRESS); + + me->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); // after enterevademode will be set walk movement + DoZoneInCombat(); + me->setActive(true); + } + + void JustDied(Unit * /*victim*/) + { + if (pInstance) + pInstance->SetData(DATA_ALAREVENT, DONE); + } + + void JustSummoned(Creature *summon) + { + if (summon->GetEntry() == CREATURE_EMBER_OF_ALAR) + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + summon->AI()->AttackStart(pTarget); + } + + void MoveInLineOfSight(Unit * /*who*/) {} + + void AttackStart(Unit* who) + { + if (Phase1) + AttackStartNoMove(who); + else + ScriptedAI::AttackStart(who); + } + + void DamageTaken(Unit* /*pKiller*/, uint32 &damage) + { + if (damage >= me->GetHealth() && Phase1) + { + damage = 0; + if (!WaitEvent) + { + WaitEvent = WE_DIE; + WaitTimer = 0; + me->SetHealth(0); + me->InterruptNonMeleeSpells(true); + me->RemoveAllAuras(); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + me->AttackStop(); + me->SetUInt64Value(UNIT_FIELD_TARGET, 0); + me->SetSpeed(MOVE_RUN, 5.0f); + me->GetMotionMaster()->Clear(); + me->GetMotionMaster()->MovePoint(0, waypoint[5][0], waypoint[5][1], waypoint[5][2]); + } + } + } + + void SpellHit(Unit*, const SpellEntry *spell) + { + if (spell->Id == SPELL_DIVE_BOMB_VISUAL) + { + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true); + me->SetDisplayId(11686); + //me->SendUpdateObjectToAllExcept(NULL); + } + } + + void MovementInform(uint32 type, uint32 /*id*/) + { + if (type == POINT_MOTION_TYPE) + { + WaitTimer = 1; + AfterMoving = true; + ForceMove = false; + } + } + + void UpdateAI(const uint32 diff) + { + if (!me->isInCombat()) // sometimes isincombat but !incombat, faction bug? + return; + + if (Berserk_Timer <= diff) + { + DoCast(me, SPELL_BERSERK, true); + Berserk_Timer = 60000; + } else Berserk_Timer -= diff; + + if (ForceMove) + { + if (ForceTimer <= diff) + { + me->GetMotionMaster()->MovePoint(0, waypoint[cur_wp][0], waypoint[cur_wp][1], waypoint[cur_wp][2]); + ForceTimer = 5000; + } else ForceTimer -= diff; + + } + if (WaitEvent) + { + if (WaitTimer) + { + if (WaitTimer <= diff) + { + if (AfterMoving) + { + me->GetMotionMaster()->MoveIdle(); + AfterMoving = false; + } + + switch(WaitEvent) + { + case WE_PLATFORM: + Platforms_Move_Timer = 30000+rand()%5000; + break; + case WE_QUILL: + DoCast(me, SPELL_FLAME_QUILLS, true); + Platforms_Move_Timer = 1; + WaitTimer = 10000; + WaitEvent = WE_DUMMY; + return; + case WE_DIE: + ForceMove = false; + me->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_DEAD); + WaitTimer = 5000; + WaitEvent = WE_REVIVE; + return; + case WE_REVIVE: + me->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_STAND); + me->SetHealth(me->GetMaxHealth()); + me->SetSpeed(MOVE_RUN, DefaultMoveSpeedRate); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + DoZoneInCombat(); + DoCast(me, SPELL_REBIRTH, true); + MeltArmor_Timer = 60000; + Charge_Timer = 7000; + DiveBomb_Timer = 40000+rand()%5000; + FlamePatch_Timer = 30000; + Phase1 = false; + break; + case WE_METEOR: + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false); + DoCast(me, SPELL_DIVE_BOMB_VISUAL, false); + WaitEvent = WE_DIVE; + WaitTimer = 4000; + return; + case WE_DIVE: + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + me->RemoveAurasDueToSpell(SPELL_DIVE_BOMB_VISUAL); + DoCast(pTarget, SPELL_DIVE_BOMB, true); + float dist = 3.0f; + if (me->IsWithinDist3d(pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 5.0f)) + dist = 5.0f; + WaitTimer = 1000 + floor(dist / 80 * 1000.0f); + me->GetMap()->CreatureRelocation(me, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0.0f); + me->StopMoving(); + WaitEvent = WE_LAND; + } + else + { + EnterEvadeMode(); + return; + } + case WE_LAND: + WaitEvent = WE_SUMMON; + WaitTimer = 2000; + return; + case WE_SUMMON: + for (uint8 i = 0; i < 2; ++i) + DoSpawnCreature(CREATURE_EMBER_OF_ALAR, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + me->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 10); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetDisplayId(me->GetNativeDisplayId()); + DoCast(me, SPELL_REBIRTH_2, true); + break; + case WE_DUMMY: + default: + break; + } + + WaitEvent = WE_NONE; + WaitTimer = 0; + } else WaitTimer -= diff; + } + return; + } + + if (Phase1) + { + if (me->getThreatManager().getThreatList().empty()) + { + EnterEvadeMode(); + return; + } + + if (Platforms_Move_Timer <= diff) + { + if (cur_wp == 4) + { + cur_wp = 0; + WaitEvent = WE_PLATFORM; + } + else + { + if (urand(0,4)) // next platform + { + DoSpawnCreature(CREATURE_EMBER_OF_ALAR, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + if (cur_wp == 3) + cur_wp = 0; + else + ++cur_wp; + WaitEvent = WE_PLATFORM; + } + else // flame quill + { + cur_wp = 4; + WaitEvent = WE_QUILL; + } + } + ForceMove = true; + ForceTimer = 5000; + me->GetMotionMaster()->MovePoint(0, waypoint[cur_wp][0], waypoint[cur_wp][1], waypoint[cur_wp][2]); + WaitTimer = 0; + return; + } else Platforms_Move_Timer -= diff; + } + else + { + if (Charge_Timer <= diff) + { + Unit *pTarget= SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true); + if (pTarget) + DoCast(pTarget, SPELL_CHARGE); + Charge_Timer = 30000; + } else Charge_Timer -= diff; + + if (MeltArmor_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_MELT_ARMOR); + MeltArmor_Timer = 60000; + } else MeltArmor_Timer -= diff; + + if (DiveBomb_Timer <= diff) + { + me->AttackStop(); + me->GetMotionMaster()->MovePoint(6, waypoint[4][0], waypoint[4][1], waypoint[4][2]); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 50); + WaitEvent = WE_METEOR; + WaitTimer = 0; + DiveBomb_Timer = 40000+rand()%5000; + return; + } else DiveBomb_Timer -= diff; + + if (FlamePatch_Timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + Creature* Summoned = me->SummonCreature(CREATURE_FLAME_PATCH_ALAR, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 120000); + if (Summoned) + { + Summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + Summoned->SetFloatValue(OBJECT_FIELD_SCALE_X, Summoned->GetFloatValue(OBJECT_FIELD_SCALE_X)*2.5f); + Summoned->SetDisplayId(11686); + Summoned->setFaction(me->getFaction()); + Summoned->SetLevel(me->getLevel()); + Summoned->CastSpell(Summoned, SPELL_FLAME_PATCH, false); + } + } + FlamePatch_Timer = 30000; + } else FlamePatch_Timer -= diff; + } + + DoMeleeAttackIfReady(); + } + + void DoMeleeAttackIfReady() + { + if (me->isAttackReady() && !me->IsNonMeleeSpellCasted(false)) + { + if (me->IsWithinMeleeRange(me->getVictim())) + { + me->AttackerStateUpdate(me->getVictim()); + me->resetAttackTimer(); + } + else + { + Unit *pTarget = NULL; + pTarget = me->SelectNearestTargetInAttackDistance(5); + if (pTarget) + me->AI()->AttackStart(pTarget); + else + { + DoCast(me, SPELL_FLAME_BUFFET, true); + me->setAttackTimer(BASE_ATTACK, 1500); + } + } + } + } +}; + +CreatureAI* GetAI_boss_alar(Creature* pCreature) +{ + return new boss_alarAI(pCreature); +} + +struct mob_ember_of_alarAI : public ScriptedAI +{ + mob_ember_of_alarAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + c->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); + c->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true); + } + + ScriptedInstance *pInstance; + bool toDie; + + void Reset() {toDie = false;} + void EnterCombat(Unit * /*who*/) {DoZoneInCombat();} + void EnterEvadeMode() {me->setDeathState(JUST_DIED);} + + void DamageTaken(Unit* pKiller, uint32 &damage) + { + if (damage >= me->GetHealth() && pKiller != me && !toDie) + { + damage = 0; + DoCast(me, SPELL_EMBER_BLAST, true); + me->SetDisplayId(11686); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + if (pInstance && pInstance->GetData(DATA_ALAREVENT) == 2) + { + if (Unit* Alar = Unit::GetUnit((*me), pInstance->GetData64(DATA_ALAR))) + { + int AlarHealth = Alar->GetHealth() - Alar->GetMaxHealth()*0.03; + if (AlarHealth > 0) + Alar->SetHealth(AlarHealth); + else + Alar->SetHealth(1); + } + } + toDie = true; + } + } + + void UpdateAI(const uint32 /*diff*/) + { + if (!UpdateVictim()) + return; + + if (toDie) + { + me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + //me->SetVisibility(VISIBILITY_OFF); + } + + DoMeleeAttackIfReady(); + } + +}; + +CreatureAI* GetAI_mob_ember_of_alar(Creature* pCreature) +{ + return new mob_ember_of_alarAI(pCreature); +} + +struct mob_flame_patch_alarAI : public ScriptedAI +{ + mob_flame_patch_alarAI(Creature *c) : ScriptedAI(c) {} + void Reset() {} + void EnterCombat(Unit * /*who*/) {} + void AttackStart(Unit* /*who*/) {} + void MoveInLineOfSight(Unit* /*who*/) {} + void UpdateAI(const uint32 /*diff*/) {} +}; + +CreatureAI* GetAI_mob_flame_patch_alar(Creature* pCreature) +{ + return new mob_flame_patch_alarAI(pCreature); +} + +void AddSC_boss_alar() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_alar"; + newscript->GetAI = &GetAI_boss_alar; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_ember_of_alar"; + newscript->GetAI = &GetAI_mob_ember_of_alar; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_flame_patch_alar"; + newscript->GetAI = &GetAI_mob_flame_patch_alar; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/Outland/TempestKeep/the_eye/boss_astromancer.cpp b/src/server/scripts/Outland/TempestKeep/the_eye/boss_astromancer.cpp new file mode 100644 index 00000000000..e9e217a5c62 --- /dev/null +++ b/src/server/scripts/Outland/TempestKeep/the_eye/boss_astromancer.cpp @@ -0,0 +1,466 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Astromancer +SD%Complete: 80 +SDComment: +SDCategory: Tempest Keep, The Eye +EndScriptData */ + +#include "ScriptedPch.h" +#include "the_eye.h" + +enum eEnums +{ + SAY_AGGRO = -1550007, + SAY_SUMMON1 = -1550008, + SAY_SUMMON2 = -1550009, + SAY_KILL1 = -1550010, + SAY_KILL2 = -1550011, + SAY_KILL3 = -1550012, + SAY_DEATH = -1550013, + SAY_VOIDA = -1550014, + SAY_VOIDB = -1550015, + + SPELL_ARCANE_MISSILES = 33031, + SPELL_WRATH_OF_THE_ASTROMANCER = 42783, + SPELL_BLINDING_LIGHT = 33009, + SPELL_FEAR = 34322, + SPELL_VOID_BOLT = 39329, + + SPELL_SPOTLIGHT = 25824, + NPC_ASTROMANCER_SOLARIAN_SPOTLIGHT = 18928, + + NPC_SOLARIUM_AGENT = 18925, + NPC_SOLARIUM_PRIEST = 18806, + + MODEL_HUMAN = 18239, + MODEL_VOIDWALKER = 18988, + + SPELL_SOLARIUM_GREAT_HEAL = 33387, + SPELL_SOLARIUM_HOLY_SMITE = 25054, + SPELL_SOLARIUM_ARCANE_TORRENT = 33390, + + WV_ARMOR = 31000 +}; + +const float CENTER_X = 432.909f; +const float CENTER_Y = -373.424f; +const float CENTER_Z = 17.9608f; +const float CENTER_O = 1.06421f; +const float SMALL_PORTAL_RADIUS = 12.6f; +const float LARGE_PORTAL_RADIUS = 26.0f; +const float PORTAL_Z = 17.005f; + + // x, y, z, o +static float SolarianPos[4] = {432.909, -373.424, 17.9608, 1.06421}; + +struct boss_high_astromancer_solarianAI : public ScriptedAI +{ + boss_high_astromancer_solarianAI(Creature *c) : ScriptedAI(c), Summons(me) + { + pInstance = c->GetInstanceData(); + + defaultarmor = c->GetArmor(); + defaultsize = c->GetFloatValue(OBJECT_FIELD_SCALE_X); + } + + ScriptedInstance *pInstance; + SummonList Summons; + + uint8 Phase; + + uint32 ArcaneMissiles_Timer; + uint32 m_uiWrathOfTheAstromancer_Timer; + uint32 BlindingLight_Timer; + uint32 Fear_Timer; + uint32 VoidBolt_Timer; + uint32 Phase1_Timer; + uint32 Phase2_Timer; + uint32 Phase3_Timer; + uint32 AppearDelay_Timer; + uint32 defaultarmor; + uint32 Wrath_Timer; + + float defaultsize; + float Portals[3][3]; + + bool AppearDelay; + bool BlindingLight; + + void Reset() + { + ArcaneMissiles_Timer = 2000; + m_uiWrathOfTheAstromancer_Timer = 15000; + BlindingLight_Timer = 41000; + Fear_Timer = 20000; + VoidBolt_Timer = 10000; + Phase1_Timer = 50000; + Phase2_Timer = 10000; + Phase3_Timer = 15000; + AppearDelay_Timer = 2000; + BlindingLight = false; + AppearDelay = false; + Wrath_Timer = 20000+rand()%5000;//twice in phase one + Phase = 1; + Wrath_Timer = 20000+rand()%5000;//twice in phase one + + if (pInstance) + pInstance->SetData(DATA_HIGHASTROMANCERSOLARIANEVENT, NOT_STARTED); + + me->SetArmor(defaultarmor); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetVisibility(VISIBILITY_ON); + me->SetFloatValue(OBJECT_FIELD_SCALE_X, defaultsize); + me->SetDisplayId(MODEL_HUMAN); + + Summons.DespawnAll(); + } + + void KilledUnit(Unit * /*victim*/) + { + DoScriptText(RAND(SAY_KILL1,SAY_KILL2,SAY_KILL3), me); + } + + void JustDied(Unit * /*victim*/) + { + me->SetFloatValue(OBJECT_FIELD_SCALE_X, defaultsize); + me->SetDisplayId(MODEL_HUMAN); + DoScriptText(SAY_DEATH, me); + + if (pInstance) + pInstance->SetData(DATA_HIGHASTROMANCERSOLARIANEVENT, DONE); + } + + void EnterCombat(Unit * /*who*/) + { + DoScriptText(SAY_AGGRO, me); + DoZoneInCombat(); + + if (pInstance) + pInstance->SetData(DATA_HIGHASTROMANCERSOLARIANEVENT, IN_PROGRESS); + } + + void SummonMinion(uint32 entry, float x, float y, float z) + { + Creature* Summoned = me->SummonCreature(entry, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + if (Summoned) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + Summoned->AI()->AttackStart(pTarget); + + Summons.Summon(Summoned); + } + } + + float Portal_X(float radius) + { + if (urand(0,1)) + radius = -radius; + + return radius * (float)(rand()%100)/100.0f + CENTER_X; + } + + float Portal_Y(float x, float radius) + { + float z = RAND(1, -1); + + return (z*sqrt(radius*radius - (x - CENTER_X)*(x - CENTER_X)) + CENTER_Y); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (AppearDelay) + { + me->StopMoving(); + me->AttackStop(); + if (AppearDelay_Timer <= diff) + { + AppearDelay = false; + if (Phase == 2) + { + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetVisibility(VISIBILITY_OFF); + } + AppearDelay_Timer = 2000; + } else AppearDelay_Timer -= diff; + } + + if (Phase == 1) + { + if (BlindingLight_Timer <= diff) + { + BlindingLight = true; + BlindingLight_Timer = 45000; + } else BlindingLight_Timer -= diff; + + if (Wrath_Timer <= diff) + { + me->InterruptNonMeleeSpells(false); + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true)) + DoCast(pTarget, SPELL_WRATH_OF_THE_ASTROMANCER, true); + Wrath_Timer = 20000+rand()%5000; + } else Wrath_Timer -= diff; + + if (ArcaneMissiles_Timer <= diff) + { + if (BlindingLight) + { + DoCast(me->getVictim(), SPELL_BLINDING_LIGHT); + BlindingLight = false; + }else{ + Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + + if (!me->HasInArc(2.5f, pTarget)) + pTarget = me->getVictim(); + + if (pTarget) + DoCast(pTarget, SPELL_ARCANE_MISSILES); + } + ArcaneMissiles_Timer = 3000; + } else ArcaneMissiles_Timer -= diff; + + if (m_uiWrathOfTheAstromancer_Timer <= diff) + { + me->InterruptNonMeleeSpells(false); + + //Target the tank ? + if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1)) + if (pTarget->GetTypeId() == TYPEID_PLAYER) + { + DoCast(pTarget, SPELL_WRATH_OF_THE_ASTROMANCER); + m_uiWrathOfTheAstromancer_Timer = 25000; + } + else + m_uiWrathOfTheAstromancer_Timer = 1000; + } else m_uiWrathOfTheAstromancer_Timer -= diff; + + //Phase1_Timer + if (Phase1_Timer <= diff) + { + Phase = 2; + Phase1_Timer = 50000; + //After these 50 seconds she portals to the middle of the room and disappears, leaving 3 light portals behind. + me->GetMotionMaster()->Clear(); + me->GetMap()->CreatureRelocation(me, CENTER_X, CENTER_Y, CENTER_Z, CENTER_O); + for (uint8 i=0; i <= 2; ++i) + { + if (!i) + { + Portals[i][0] = Portal_X(SMALL_PORTAL_RADIUS); + Portals[i][1] = Portal_Y(Portals[i][0], SMALL_PORTAL_RADIUS); + Portals[i][2] = CENTER_Z; + } + else + { + Portals[i][0] = Portal_X(LARGE_PORTAL_RADIUS); + Portals[i][1] = Portal_Y(Portals[i][0], LARGE_PORTAL_RADIUS); + Portals[i][2] = PORTAL_Z; + } + } + if ((abs(Portals[2][0] - Portals[1][0]) < 7) && (abs(Portals[2][1] - Portals[1][1]) < 7)) + { + int i=1; + if (abs(CENTER_X + 26.0f - Portals[2][0]) < 7) + i = -1; + Portals[2][0] = Portals[2][0]+7*i; + Portals[2][1] = Portal_Y(Portals[2][0], LARGE_PORTAL_RADIUS); + } + for (int i=0; i <= 2; ++i) + { + if (Creature* Summoned = me->SummonCreature(NPC_ASTROMANCER_SOLARIAN_SPOTLIGHT, Portals[i][0], Portals[i][1], Portals[i][2], CENTER_O, TEMPSUMMON_TIMED_DESPAWN, Phase2_Timer+Phase3_Timer+AppearDelay_Timer+1700)) + { + Summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + Summoned->CastSpell(Summoned, SPELL_SPOTLIGHT, false); + } + } + AppearDelay = true; + } else Phase1_Timer-=diff; + } + else if (Phase == 2) + { + //10 seconds after Solarian disappears, 12 mobs spawn out of the three portals. + me->AttackStop(); + me->StopMoving(); + if (Phase2_Timer <= diff) + { + Phase = 3; + for (int i=0; i <= 2; ++i) + for (int j=1; j <= 4; j++) + SummonMinion(NPC_SOLARIUM_AGENT, Portals[i][0], Portals[i][1], Portals[i][2]); + + DoScriptText(SAY_SUMMON1, me); + Phase2_Timer = 10000; + } else Phase2_Timer -= diff; + } + else if (Phase == 3) + { + me->AttackStop(); + me->StopMoving(); + + //Check Phase3_Timer + if (Phase3_Timer <= diff) + { + Phase = 1; + + //15 seconds later Solarian reappears out of one of the 3 portals. Simultaneously, 2 healers appear in the two other portals. + int i = rand()%3; + me->GetMotionMaster()->Clear(); + me->GetMap()->CreatureRelocation(me, Portals[i][0], Portals[i][1], Portals[i][2], CENTER_O); + + for (int j=0; j <= 2; j++) + if (j != i) + SummonMinion(NPC_SOLARIUM_PRIEST, Portals[j][0], Portals[j][1], Portals[j][2]); + + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetVisibility(VISIBILITY_ON); + + DoScriptText(SAY_SUMMON2, me); + AppearDelay = true; + Phase3_Timer = 15000; + } else Phase3_Timer -= diff; + } + else if (Phase == 4) + { + //Fear_Timer + if (Fear_Timer <= diff) + { + DoCast(me, SPELL_FEAR); + Fear_Timer = 20000; + } else Fear_Timer -= diff; + + //VoidBolt_Timer + if (VoidBolt_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_VOID_BOLT); + VoidBolt_Timer = 10000; + } else VoidBolt_Timer -= diff; + } + + //When Solarian reaches 20% she will transform into a huge void walker. + if (Phase != 4 && ((me->GetHealth()*100 / me->GetMaxHealth())<20)) + { + Phase = 4; + + //To make sure she wont be invisible or not selecatble + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetVisibility(VISIBILITY_ON); + DoScriptText(SAY_VOIDA, me); + DoScriptText(SAY_VOIDB, me); + me->SetArmor(WV_ARMOR); + me->SetDisplayId(MODEL_VOIDWALKER); + me->SetFloatValue(OBJECT_FIELD_SCALE_X, defaultsize*2.5f); + } + + DoMeleeAttackIfReady(); + } +}; + +struct mob_solarium_priestAI : public ScriptedAI +{ + mob_solarium_priestAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance *pInstance; + + uint32 healTimer; + uint32 holysmiteTimer; + uint32 aoesilenceTimer; + + void Reset() + { + healTimer = 9000; + holysmiteTimer = 1; + aoesilenceTimer = 15000; + } + + void EnterCombat(Unit * /*who*/) + { + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (healTimer <= diff) + { + Unit *pTarget = NULL; + + switch (urand(0,1)) + { + case 0: + if (pInstance) + pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_ASTROMANCER)); + break; + case 1: + pTarget = me; + break; + } + + if (pTarget) + { + DoCast(pTarget, SPELL_SOLARIUM_GREAT_HEAL); + healTimer = 9000; + } + } else healTimer -= diff; + + if (holysmiteTimer <= diff) + { + DoCast(me->getVictim(), SPELL_SOLARIUM_HOLY_SMITE); + holysmiteTimer = 4000; + } else holysmiteTimer -= diff; + + if (aoesilenceTimer <= diff) + { + DoCast(me->getVictim(), SPELL_SOLARIUM_ARCANE_TORRENT); + aoesilenceTimer = 13000; + } else aoesilenceTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_solarium_priest(Creature* pCreature) +{ + return new mob_solarium_priestAI (pCreature); +} + +CreatureAI* GetAI_boss_high_astromancer_solarian(Creature* pCreature) +{ + return new boss_high_astromancer_solarianAI (pCreature); +} + +void AddSC_boss_high_astromancer_solarian() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_high_astromancer_solarian"; + newscript->GetAI = &GetAI_boss_high_astromancer_solarian; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_solarium_priest"; + newscript->GetAI = &GetAI_mob_solarium_priest; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/Outland/TempestKeep/the_eye/boss_kaelthas.cpp b/src/server/scripts/Outland/TempestKeep/the_eye/boss_kaelthas.cpp new file mode 100644 index 00000000000..05681fb7539 --- /dev/null +++ b/src/server/scripts/Outland/TempestKeep/the_eye/boss_kaelthas.cpp @@ -0,0 +1,1498 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Kaelthas +SD%Complete: 60 +SDComment: SQL, weapon scripts, mind control, need correct spells(interruptible/uninterruptible), phoenix spawn location & animation, phoenix behaviour & spawn during gravity lapse +SDCategory: Tempest Keep, The Eye +EndScriptData */ + +#include "ScriptedPch.h" +#include "the_eye.h" +#include "WorldPacket.h" + +enum eEnums +{ + //kael'thas Speech + SAY_INTRO = -1550016, + SAY_INTRO_CAPERNIAN = -1550017, + SAY_INTRO_TELONICUS = -1550018, + SAY_INTRO_THALADRED = -1550019, + SAY_INTRO_SANGUINAR = -1550020, + SAY_PHASE2_WEAPON = -1550021, + SAY_PHASE3_ADVANCE = -1550022, + SAY_PHASE4_INTRO2 = -1550023, + SAY_PHASE5_NUTS = -1550024, + SAY_SLAY1 = -1550025, + SAY_SLAY2 = -1550026, + SAY_SLAY3 = -1550027, + SAY_MINDCONTROL1 = -1550028, + SAY_MINDCONTROL2 = -1550029, + SAY_GRAVITYLAPSE1 = -1550030, + SAY_GRAVITYLAPSE2 = -1550031, + SAY_SUMMON_PHOENIX1 = -1550032, + SAY_SUMMON_PHOENIX2 = -1550033, + SAY_DEATH = -1550034, + + //Thaladred the Darkener speech + SAY_THALADRED_AGGRO = -1550035, + SAY_THALADRED_DEATH = -1550036, + EMOTE_THALADRED_GAZE = -1550037, + + //Lord Sanguinar speech + SAY_SANGUINAR_AGGRO = -1550038, + SAY_SANGUINAR_DEATH = -1550039, + + //Grand Astromancer Capernian speech + SAY_CAPERNIAN_AGGRO = -1550040, + SAY_CAPERNIAN_DEATH = -1550041, + + //Master Engineer Telonicus speech + SAY_TELONICUS_AGGRO = -1550042, + SAY_TELONICUS_DEATH = -1550043, + + //Phase 2 spells + SPELL_SUMMON_WEAPONS = 36976, + SPELL_SUMMON_WEAPONA = 36958, + SPELL_SUMMON_WEAPONB = 36959, + SPELL_SUMMON_WEAPONC = 36960, + SPELL_SUMMON_WEAPOND = 36961, + SPELL_SUMMON_WEAPONE = 36962, + SPELL_SUMMON_WEAPONF = 36963, + SPELL_SUMMON_WEAPONG = 36964, + SPELL_RES_VISUAL = 24171, + + //Phase 4 spells + SPELL_FIREBALL = 22088, //wrong but works with CastCustomSpell + SPELL_PYROBLAST = 36819, + SPELL_FLAME_STRIKE = 36735, + SPELL_FLAME_STRIKE_VIS = 36730, + SPELL_FLAME_STRIKE_DMG = 36731, + SPELL_ARCANE_DISRUPTION = 36834, + SPELL_SHOCK_BARRIER = 36815, + SPELL_PHOENIX_ANIMATION = 36723, + SPELL_MIND_CONTROL = 32830, + + //Phase 5 spells + SPELL_EXPLODE = 36092, + SPELL_FULLPOWER = 36187, + SPELL_KNOCKBACK = 11027, + SPELL_GRAVITY_LAPSE = 34480, + SPELL_GRAVITY_LAPSE_AURA = 39432, + SPELL_NETHER_BEAM = 35873, + + //Thaladred the Darkener spells + SPELL_PSYCHIC_BLOW = 10689, + SPELL_SILENCE = 30225, + //Lord Sanguinar spells + SPELL_BELLOWING_ROAR = 40636, + //Grand Astromancer Capernian spells + + SPELL_CAPERNIAN_FIREBALL = 36971, + SPELL_CONFLAGRATION = 37018, + SPELL_ARCANE_EXPLOSION = 36970, + //Master Engineer Telonicus spells + SPELL_BOMB = 37036, + SPELL_REMOTE_TOY = 37027, + //Nether Vapor spell + SPELL_NETHER_VAPOR = 35859, + //Phoenix spell + SPELL_BURN = 36720, + SPELL_EMBER_BLAST = 34341, + SPELL_REBIRTH = 41587, + + //Creature IDs + NPC_PHOENIX = 21362, + NPC_PHOENIX_EGG = 21364, + + //Phoenix egg and phoenix model + MODEL_ID_PHOENIX = 19682, + MODEL_ID_PHOENIX_EGG = 20245, + + MAX_ADVISORS = 4 +}; + +uint32 m_auiSpellSummonWeapon[]= +{ + SPELL_SUMMON_WEAPONA, SPELL_SUMMON_WEAPONB, SPELL_SUMMON_WEAPONC, SPELL_SUMMON_WEAPOND, + SPELL_SUMMON_WEAPONE, SPELL_SUMMON_WEAPONF, SPELL_SUMMON_WEAPONG +}; + +const float CAPERNIAN_DISTANCE = 20.0f; //she casts away from the target +const float KAEL_VISIBLE_RANGE = 50.0f; + +const float afGravityPos[3] = {795.0f, 0.0f, 70.0f}; + +#define TIME_PHASE_2_3 120000 +#define TIME_PHASE_3_4 180000 + +//Base AI for Advisors +struct advisorbase_ai : public ScriptedAI +{ + advisorbase_ai(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = pCreature->GetInstanceData(); + m_bDoubled_Health = false; + } + + ScriptedInstance* m_pInstance; + bool FakeDeath; + bool m_bDoubled_Health; + uint32 DelayRes_Timer; + uint64 DelayRes_Target; + + void Reset() + { + if (m_bDoubled_Health) + { + me->SetMaxHealth(me->GetMaxHealth() / 2); + m_bDoubled_Health = false; + } + + FakeDeath = false; + DelayRes_Timer = 0; + DelayRes_Target = 0; + + me->SetStandState(UNIT_STAND_STATE_STAND); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + + //reset encounter + if (m_pInstance && (m_pInstance->GetData(DATA_KAELTHASEVENT) == 1 || m_pInstance->GetData(DATA_KAELTHASEVENT) == 3)) + if (Creature *Kaelthas = Unit::GetCreature((*me), m_pInstance->GetData64(DATA_KAELTHAS))) + Kaelthas->AI()->EnterEvadeMode(); + } + + void MoveInLineOfSight(Unit *who) + { + if (!who || FakeDeath || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + ScriptedAI::MoveInLineOfSight(who); + } + + void AttackStart(Unit* who) + { + if (!who || FakeDeath || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + ScriptedAI::AttackStart(who); + } + + void Revive(Unit* /*Target*/) + { + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + // double health for phase 3 + me->SetMaxHealth(me->GetMaxHealth() * 2); + m_bDoubled_Health = true; + me->SetHealth(me->GetMaxHealth()); + me->SetStandState(UNIT_STAND_STATE_STAND); + + DoCast(me, SPELL_RES_VISUAL, false); + DelayRes_Timer = 2000; + } + + void DamageTaken(Unit* pKiller, uint32 &damage) + { + if (damage < me->GetHealth()) + return; + + //Prevent glitch if in fake death + if (FakeDeath && m_pInstance && m_pInstance->GetData(DATA_KAELTHASEVENT) != 0) + { + damage = 0; + return; + } + + //Don't really die in phase 1 & 3, only die after that + if (m_pInstance && m_pInstance->GetData(DATA_KAELTHASEVENT) != 0) + { + //prevent death + damage = 0; + FakeDeath = true; + + me->InterruptNonMeleeSpells(false); + me->SetHealth(0); + me->StopMoving(); + me->ClearComboPointHolders(); + me->RemoveAllAurasOnDeath(); + me->ModifyAuraState(AURA_STATE_HEALTHLESS_20_PERCENT, false); + me->ModifyAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, false); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->ClearAllReactives(); + me->SetUInt64Value(UNIT_FIELD_TARGET,0); + me->GetMotionMaster()->Clear(); + me->GetMotionMaster()->MoveIdle(); + me->SetStandState(UNIT_STAND_STATE_DEAD); + JustDied(pKiller); + } + } + + void UpdateAI(const uint32 diff) + { + if (DelayRes_Timer) + { + if (DelayRes_Timer <= diff) + { + DelayRes_Timer = 0; + FakeDeath = false; + + Unit* Target = Unit::GetUnit((*me), DelayRes_Target); + if (!Target) + Target = me->getVictim(); + + DoResetThreat(); + AttackStart(Target); + me->GetMotionMaster()->Clear(); + me->GetMotionMaster()->MoveChase(Target); + me->AddThreat(Target, 0.0f); + } else DelayRes_Timer -= diff; + } + } + +}; + +//Kael'thas AI +struct boss_kaelthasAI : public ScriptedAI +{ + boss_kaelthasAI(Creature* pCreature) : ScriptedAI(pCreature), summons(me) + { + m_pInstance = pCreature->GetInstanceData(); + memset(&m_auiAdvisorGuid, 0, sizeof(m_auiAdvisorGuid)); + } + + ScriptedInstance* m_pInstance; + + uint32 Fireball_Timer; + uint32 ArcaneDisruption_Timer; + uint32 Phoenix_Timer; + uint32 ShockBarrier_Timer; + uint32 GravityLapse_Timer; + uint32 GravityLapse_Phase; + uint32 NetherBeam_Timer; + uint32 NetherVapor_Timer; + uint32 FlameStrike_Timer; + uint32 MindControl_Timer; + uint32 Phase; + uint32 PhaseSubphase; //generic + uint32 Phase_Timer; //generic timer + uint32 PyrosCasted; + + bool InGravityLapse; + bool IsCastingFireball; + bool ChainPyros; + + SummonList summons; + + uint64 m_auiAdvisorGuid[MAX_ADVISORS]; + + void Reset() + { + Fireball_Timer = 5000+rand()%10000; + ArcaneDisruption_Timer = 45000; + MindControl_Timer = 40000; + Phoenix_Timer = 50000; + ShockBarrier_Timer = 60000; + FlameStrike_Timer = 30000; + GravityLapse_Timer = 20000; + GravityLapse_Phase = 0; + NetherBeam_Timer = 8000; + NetherVapor_Timer = 10000; + PyrosCasted = 0; + Phase = 0; + InGravityLapse = false; + IsCastingFireball = false; + ChainPyros = false; + + if (me->isInCombat()) + PrepareAdvisors(); + + summons.DespawnAll(); + + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + if (m_pInstance) + m_pInstance->SetData(DATA_KAELTHASEVENT, 0); + } + + void PrepareAdvisors() + { + for (uint8 i = 0; i < MAX_ADVISORS; ++i) + { + if (Creature *pCreature = Unit::GetCreature((*me), m_auiAdvisorGuid[i])) + { + pCreature->Respawn(); + pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + pCreature->setFaction(me->getFaction()); + pCreature->AI()->EnterEvadeMode(); + } + } + } + + void StartEvent() + { + if (!m_pInstance) + return; + + m_auiAdvisorGuid[0] = m_pInstance->GetData64(DATA_THALADREDTHEDARKENER); + m_auiAdvisorGuid[1] = m_pInstance->GetData64(DATA_LORDSANGUINAR); + m_auiAdvisorGuid[2] = m_pInstance->GetData64(DATA_GRANDASTROMANCERCAPERNIAN); + m_auiAdvisorGuid[3] = m_pInstance->GetData64(DATA_MASTERENGINEERTELONICUS); + + if (!m_auiAdvisorGuid[0] || !m_auiAdvisorGuid[1] || !m_auiAdvisorGuid[2] || !m_auiAdvisorGuid[3]) + { + error_log("TSCR: Kael'Thas One or more advisors missing, Skipping Phases 1-3"); + + DoScriptText(SAY_PHASE4_INTRO2, me); + + Phase = 4; + + m_pInstance->SetData(DATA_KAELTHASEVENT, 4); + + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + AttackStart(pTarget); + + } + else + { + PrepareAdvisors(); + + DoScriptText(SAY_INTRO, me); + + m_pInstance->SetData(DATA_KAELTHASEVENT, 1); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + PhaseSubphase = 0; + Phase_Timer = 23000; + Phase = 1; + } + } + + void MoveInLineOfSight(Unit *who) + { + if (!me->hasUnitState(UNIT_STAT_STUNNED) && who->isTargetableForAttack() && + me->IsHostileTo(who) && who->isInAccessiblePlaceFor(me)) + { + if (!me->canFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) + return; + + float attackRadius = me->GetAttackDistance(who); + if (me->IsWithinDistInMap(who, attackRadius) && me->IsWithinLOSInMap(who)) + { + if (!me->getVictim() && Phase >= 4) + { + who->RemoveAurasDueToSpell(SPELL_AURA_MOD_STEALTH); + AttackStart(who); + } + else if (me->GetMap()->IsDungeon()) + { + if (m_pInstance && !m_pInstance->GetData(DATA_KAELTHASEVENT) && !Phase) + StartEvent(); + + who->SetInCombatWith(me); + me->AddThreat(who, 0.0f); + } + } + } + } + + void Aggro(Unit * /*who*/) + { + if (m_pInstance && !m_pInstance->GetData(DATA_KAELTHASEVENT) && !Phase) + StartEvent(); + } + + void KilledUnit() + { + DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), me); + } + + void JustSummoned(Creature* pSummoned) + { + // if not phoenix, then it's one of the 7 weapons + if (pSummoned->GetEntry() != NPC_PHOENIX) + { + if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + pSummoned->AI()->AttackStart(pTarget); + + summons.Summon(pSummoned); + } + } + + void SummonedCreatureDespawn(Creature *summon) {summons.Despawn(summon);} + + void JustDied(Unit* /*Killer*/) + { + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + DoScriptText(SAY_DEATH, me); + + summons.DespawnAll(); + + if (m_pInstance) + m_pInstance->SetData(DATA_KAELTHASEVENT, 0); + + for (uint8 i = 0; i < MAX_ADVISORS; ++i) + { + if (Unit* pAdvisor = Unit::GetUnit((*me), m_auiAdvisorGuid[i])) + pAdvisor->Kill(pAdvisor); + } + } + + void UpdateAI(const uint32 diff) + { + //Phase 1 + switch (Phase) + { + case 1: + { + Unit *pTarget = NULL; + Creature* Advisor = NULL; + + //Subphase switch + switch(PhaseSubphase) + { + //Subphase 1 - Start + case 0: + if (Phase_Timer <= diff) + { + DoScriptText(SAY_INTRO_THALADRED, me); + + //start advisor within 7 seconds + Phase_Timer = 7000; + ++PhaseSubphase; + } else Phase_Timer -= diff; + break; + + //Subphase 1 - Unlock advisor + case 1: + if (Phase_Timer <= diff) + { + Advisor = (Unit::GetCreature((*me), m_auiAdvisorGuid[0])); + + if (Advisor) + { + Advisor->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + Advisor->setFaction(me->getFaction()); + + pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (pTarget) + Advisor->AI()->AttackStart(pTarget); + } + + ++PhaseSubphase; + } else Phase_Timer -= diff; + break; + + //Subphase 2 - Start + case 2: + Advisor = (Unit::GetCreature((*me), m_auiAdvisorGuid[0])); + + if (Advisor && (Advisor->getStandState() == UNIT_STAND_STATE_DEAD)) + { + DoScriptText(SAY_INTRO_SANGUINAR, me); + + //start advisor within 12.5 seconds + Phase_Timer = 12500; + ++PhaseSubphase; + } + break; + + //Subphase 2 - Unlock advisor + case 3: + if (Phase_Timer <= diff) + { + Advisor = (Unit::GetCreature((*me), m_auiAdvisorGuid[1])); + + if (Advisor) + { + Advisor->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + Advisor->setFaction(me->getFaction()); + + pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (pTarget) + Advisor->AI()->AttackStart(pTarget); + } + + ++PhaseSubphase; + } else Phase_Timer -= diff; + break; + + //Subphase 3 - Start + case 4: + Advisor = (Unit::GetCreature((*me), m_auiAdvisorGuid[1])); + + if (Advisor && (Advisor->getStandState() == UNIT_STAND_STATE_DEAD)) + { + DoScriptText(SAY_INTRO_CAPERNIAN, me); + + //start advisor within 7 seconds + Phase_Timer = 7000; + ++PhaseSubphase; + } + break; + + //Subphase 3 - Unlock advisor + case 5: + if (Phase_Timer <= diff) + { + Advisor = (Unit::GetCreature((*me), m_auiAdvisorGuid[2])); + + if (Advisor) + { + Advisor->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + Advisor->setFaction(me->getFaction()); + + pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (pTarget) + Advisor->AI()->AttackStart(pTarget); + } + + ++PhaseSubphase; + } else Phase_Timer -= diff; + break; + + //Subphase 4 - Start + case 6: + Advisor = (Unit::GetCreature((*me), m_auiAdvisorGuid[2])); + + if (Advisor && (Advisor->getStandState() == UNIT_STAND_STATE_DEAD)) + { + DoScriptText(SAY_INTRO_TELONICUS, me); + + //start advisor within 8.4 seconds + Phase_Timer = 8400; + ++PhaseSubphase; + } + break; + + //Subphase 4 - Unlock advisor + case 7: + if (Phase_Timer <= diff) + { + Advisor = (Unit::GetCreature((*me), m_auiAdvisorGuid[3])); + + if (Advisor) + { + Advisor->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + Advisor->setFaction(me->getFaction()); + + pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (pTarget) + Advisor->AI()->AttackStart(pTarget); + } + + Phase_Timer = 3000; + ++PhaseSubphase; + } else Phase_Timer -= diff; + break; + + //End of phase 1 + case 8: + Advisor = (Unit::GetCreature((*me), m_auiAdvisorGuid[3])); + + if (Advisor && (Advisor->getStandState() == UNIT_STAND_STATE_DEAD)) + { + Phase = 2; + if (m_pInstance) + m_pInstance->SetData(DATA_KAELTHASEVENT, 2); + + DoScriptText(SAY_PHASE2_WEAPON, me); + + PhaseSubphase = 0; + Phase_Timer = 3500; + DoCast(me, SPELL_SUMMON_WEAPONS); + } + break; + } + } + break; + + case 2: + { + if (PhaseSubphase == 0) + { + if (Phase_Timer <= diff) + { + PhaseSubphase = 1; + } else Phase_Timer -= diff; + } + + //Spawn weapons + if (PhaseSubphase == 1) + { + DoCast(me, SPELL_SUMMON_WEAPONS, false); + + uint8 uiMaxWeapon = sizeof(m_auiSpellSummonWeapon)/sizeof(uint32); + + for (uint32 i = 0; i < uiMaxWeapon; ++i) + DoCast(me, m_auiSpellSummonWeapon[i], true); + + PhaseSubphase = 2; + Phase_Timer = TIME_PHASE_2_3; + } + + if (PhaseSubphase == 2) + { + if (Phase_Timer <= diff) + { + DoScriptText(SAY_PHASE3_ADVANCE, me); + if (m_pInstance) + m_pInstance->SetData(DATA_KAELTHASEVENT, 3); + Phase = 3; + PhaseSubphase = 0; + } else Phase_Timer -= diff; + } + } + break; + + case 3: + { + if (PhaseSubphase == 0) + { + //Respawn advisors + Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + + Creature *Advisor; + for (uint8 i = 0; i < MAX_ADVISORS; ++i) + { + Advisor = Unit::GetCreature((*me), m_auiAdvisorGuid[i]); + + if (!Advisor) + error_log("SD2: Kael'Thas Advisor %u does not exist. Possibly despawned? Incorrectly Killed?", i); + else + CAST_AI(advisorbase_ai, Advisor->AI())->Revive(pTarget); + } + + PhaseSubphase = 1; + Phase_Timer = TIME_PHASE_3_4; + } + + if (Phase_Timer <= diff) + { + DoScriptText(SAY_PHASE4_INTRO2, me); + Phase = 4; + + if (m_pInstance) + m_pInstance->SetData(DATA_KAELTHASEVENT, 4); + + // Sometimes people can collect Aggro in Phase 1-3. Reset threat before releasing Kael. + DoResetThreat(); + + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + AttackStart(pTarget); + + Phase_Timer = 30000; + } else Phase_Timer -= diff; + } + break; + + case 4: + case 5: + case 6: + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //Fireball_Timer + if (!InGravityLapse && !ChainPyros && Phase != 5) + { + if (Fireball_Timer <= diff) + { + if (!IsCastingFireball) + { + if (!me->IsNonMeleeSpellCasted(false)) + { + //interruptable + me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, false); + int32 dmg = 20000+rand()%5000; + me->CastCustomSpell(me->getVictim(), SPELL_FIREBALL, &dmg, 0, 0, false); + IsCastingFireball = true; + Fireball_Timer = 2500; + } + } + else + { + //apply resistance + me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, true); + IsCastingFireball = false; + Fireball_Timer = 5000+rand()%10000; + } + } else Fireball_Timer -= diff; + + //ArcaneDisruption_Timer + if (ArcaneDisruption_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_ARCANE_DISRUPTION, true); + ArcaneDisruption_Timer = 60000; + } else ArcaneDisruption_Timer -= diff; + + if (FlameStrike_Timer <= diff) + { + if (Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(pUnit, SPELL_FLAME_STRIKE); + + FlameStrike_Timer = 30000; + } else FlameStrike_Timer -= diff; + + if (MindControl_Timer <= diff) + { + if (me->getThreatManager().getThreatList().size() >= 2) + for (uint32 i = 0; i < 3; ++i) + { + debug_log("SD2: Kael'Thas mind control not supported."); + //DoCast(pUnit, SPELL_MIND_CONTROL); + } + + MindControl_Timer = 60000; + } else MindControl_Timer -= diff; + } + + //Phoenix_Timer + if (Phoenix_Timer <= diff) + { + DoCast(me, SPELL_PHOENIX_ANIMATION); + DoScriptText(RAND(SAY_SUMMON_PHOENIX1,SAY_SUMMON_PHOENIX2), me); + + Phoenix_Timer = 60000; + } else Phoenix_Timer -= diff; + + //Phase 4 specific spells + if (Phase == 4) + { + if (me->GetHealth()*100 / me->GetMaxHealth() < 50) + { + if (m_pInstance) + m_pInstance->SetData(DATA_KAELTHASEVENT, 4); + Phase = 5; + Phase_Timer = 10000; + + DoScriptText(SAY_PHASE5_NUTS, me); + + me->StopMoving(); + me->GetMotionMaster()->Clear(); + me->GetMotionMaster()->MoveIdle(); + me->GetMap()->CreatureRelocation(me, afGravityPos[0], afGravityPos[1], afGravityPos[2], 0); + me->SendMonsterMove(afGravityPos[0], afGravityPos[1], afGravityPos[2], 0, 0, 0); + + me->InterruptNonMeleeSpells(false); + DoCast(me, SPELL_FULLPOWER); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + + //ShockBarrier_Timer + if (ShockBarrier_Timer <= diff) + { + DoCast(me, SPELL_SHOCK_BARRIER); + ChainPyros = true; + PyrosCasted = 0; + ShockBarrier_Timer = 60000; + } else ShockBarrier_Timer -= diff; + + //Chain Pyros (3 of them max) + if (ChainPyros && !me->IsNonMeleeSpellCasted(false)) + { + if (PyrosCasted < 3) + { + DoCast(me->getVictim(), SPELL_PYROBLAST); + ++PyrosCasted; + } + else + { + ChainPyros = false; + Fireball_Timer = 2500; + ArcaneDisruption_Timer = 60000; + } + } + } + + if (Phase == 5) + { + if (Phase_Timer <= diff) + { + me->InterruptNonMeleeSpells(false); + me->RemoveAurasDueToSpell(SPELL_FULLPOWER); + + DoCast(me, SPELL_EXPLODE); + + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + Phase = 6; + AttackStart(me->getVictim()); + } else Phase_Timer -= diff; + } + + //Phase 5 + if (Phase == 6) + { + + //GravityLapse_Timer + if (GravityLapse_Timer <= diff) + { + std::list::const_iterator i = me->getThreatManager().getThreatList().begin(); + switch (GravityLapse_Phase) + { + case 0: + me->StopMoving(); + me->GetMotionMaster()->Clear(); + me->GetMotionMaster()->MoveIdle(); + me->GetMap()->CreatureRelocation(me, afGravityPos[0], afGravityPos[1], afGravityPos[2], 0); + me->SendMonsterMove(afGravityPos[0], afGravityPos[1], afGravityPos[2], 0, MOVEMENTFLAG_NONE, 0); + + // 1) Kael'thas will portal the whole raid right into his body + for (i = me->getThreatManager().getThreatList().begin(); i!= me->getThreatManager().getThreatList().end(); ++i) + { + Unit* pUnit = Unit::GetUnit((*me), (*i)->getUnitGuid()); + if (pUnit && (pUnit->GetTypeId() == TYPEID_PLAYER)) + { + //Use work around packet to prevent player from being dropped from combat + DoTeleportPlayer(pUnit, afGravityPos[0], afGravityPos[1], afGravityPos[2], pUnit->GetOrientation()); + } + } + + GravityLapse_Timer = 500; + ++GravityLapse_Phase; + InGravityLapse = true; + ShockBarrier_Timer = 1000; + NetherBeam_Timer = 5000; + break; + + case 1: + DoScriptText(RAND(SAY_GRAVITYLAPSE1,SAY_GRAVITYLAPSE2), me); + + // 2) At that point he will put a Gravity Lapse debuff on everyone + for (i = me->getThreatManager().getThreatList().begin(); i != me->getThreatManager().getThreatList().end(); ++i) + { + if (Unit* pUnit = Unit::GetUnit((*me), (*i)->getUnitGuid())) + { + DoCast(pUnit, SPELL_KNOCKBACK, true); + //Gravity lapse - needs an exception in Spell system to work + + pUnit->CastSpell(pUnit, SPELL_GRAVITY_LAPSE, true, 0, 0, me->GetGUID()); + pUnit->CastSpell(pUnit, SPELL_GRAVITY_LAPSE_AURA, true, 0, 0, me->GetGUID()); + + //Using packet workaround + WorldPacket data(12); + data.SetOpcode(SMSG_MOVE_SET_CAN_FLY); + data.append(pUnit->GetPackGUID()); + data << uint32(0); + pUnit->SendMessageToSet(&data, true); + } + } + GravityLapse_Timer = 10000; + ++GravityLapse_Phase; + break; + + case 2: + //Cast nether vapor aura on self + me->InterruptNonMeleeSpells(false); + DoCast(me, SPELL_NETHER_VAPOR); + + GravityLapse_Timer = 20000; + ++GravityLapse_Phase; + break; + + case 3: + //Remove flight + for (i = me->getThreatManager().getThreatList().begin(); i!= me->getThreatManager().getThreatList().end(); ++i) + { + if (Unit* pUnit = Unit::GetUnit((*me), (*i)->getUnitGuid())) + { + //Using packet workaround + WorldPacket data(12); + data.SetOpcode(SMSG_MOVE_UNSET_CAN_FLY); + data.append(pUnit->GetPackGUID()); + data << uint32(0); + pUnit->SendMessageToSet(&data, true); + } + } + + me->RemoveAurasDueToSpell(SPELL_NETHER_VAPOR); + InGravityLapse = false; + GravityLapse_Timer = 60000; + GravityLapse_Phase = 0; + AttackStart(me->getVictim()); + break; + } + } else GravityLapse_Timer -= diff; + + if (InGravityLapse) + { + //ShockBarrier_Timer + if (ShockBarrier_Timer <= diff) + { + DoCast(me, SPELL_SHOCK_BARRIER); + ShockBarrier_Timer = 20000; + } else ShockBarrier_Timer -= diff; + + //NetherBeam_Timer + if (NetherBeam_Timer <= diff) + { + if (Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(pUnit, SPELL_NETHER_BEAM); + + NetherBeam_Timer = 4000; + } else NetherBeam_Timer -= diff; + } + } + + if (!InGravityLapse) + DoMeleeAttackIfReady(); + } + } + } +}; + +//Thaladred the Darkener AI +struct boss_thaladred_the_darkenerAI : public advisorbase_ai +{ + boss_thaladred_the_darkenerAI(Creature* pCreature) : advisorbase_ai(pCreature) {} + + uint32 Gaze_Timer; + uint32 Silence_Timer; + uint32 PsychicBlow_Timer; + + void Reset() + { + Gaze_Timer = 100; + Silence_Timer = 20000; + PsychicBlow_Timer = 10000; + + advisorbase_ai::Reset(); + } + + void Aggro(Unit *who) + { + if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + if (!who || FakeDeath) + return; + + DoScriptText(SAY_THALADRED_AGGRO, me); + me->AddThreat(who, 5000000.0f); + } + + void JustDied(Unit* /*pKiller*/) + { + if (m_pInstance && m_pInstance->GetData(DATA_KAELTHASEVENT) == 3) + DoScriptText(SAY_THALADRED_DEATH, me); + } + + void UpdateAI(const uint32 diff) + { + advisorbase_ai::UpdateAI(diff); + + //Faking death, don't do anything + if (FakeDeath) + return; + + //Return since we have no target + if (!UpdateVictim()) + return; + + //Gaze_Timer + if (Gaze_Timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + DoResetThreat(); + me->AddThreat(pTarget, 5000000.0f); + DoScriptText(EMOTE_THALADRED_GAZE, me, pTarget); + Gaze_Timer = 8500; + } + } else Gaze_Timer -= diff; + + //Silence_Timer + if (Silence_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_SILENCE); + Silence_Timer = 20000; + } else Silence_Timer -= diff; + + //PsychicBlow_Timer + if (PsychicBlow_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_PSYCHIC_BLOW); + PsychicBlow_Timer = 20000+rand()%5000; + } else PsychicBlow_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +//Lord Sanguinar AI +struct boss_lord_sanguinarAI : public advisorbase_ai +{ + boss_lord_sanguinarAI(Creature* pCreature) : advisorbase_ai(pCreature) {} + + uint32 Fear_Timer; + + void Reset() + { + Fear_Timer = 20000; + advisorbase_ai::Reset(); + } + + void Aggro(Unit *who) + { + if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + if (!who || FakeDeath) + return; + + DoScriptText(SAY_SANGUINAR_AGGRO, me); + } + + void JustDied(Unit* /*Killer*/) + { + if (m_pInstance && m_pInstance->GetData(DATA_KAELTHASEVENT) == 3) + DoScriptText(SAY_SANGUINAR_DEATH, me); + } + + void UpdateAI(const uint32 diff) + { + advisorbase_ai::UpdateAI(diff); + + //Faking death, don't do anything + if (FakeDeath) + return; + + //Return since we have no target + if (!UpdateVictim()) + return; + + //Fear_Timer + if (Fear_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_BELLOWING_ROAR); + Fear_Timer = 25000+rand()%10000; //approximately every 30 seconds + } else Fear_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +//Grand Astromancer Capernian AI +struct boss_grand_astromancer_capernianAI : public advisorbase_ai +{ + boss_grand_astromancer_capernianAI(Creature* pCreature) : advisorbase_ai(pCreature) {} + + uint32 Fireball_Timer; + uint32 Conflagration_Timer; + uint32 ArcaneExplosion_Timer; + uint32 Yell_Timer; + bool Yell; + + void Reset() + { + Fireball_Timer = 2000; + Conflagration_Timer = 20000; + ArcaneExplosion_Timer = 5000; + Yell_Timer = 2000; + Yell = false; + + advisorbase_ai::Reset(); + } + + void JustDied(Unit* /*pKiller*/) + { + if (m_pInstance && m_pInstance->GetData(DATA_KAELTHASEVENT) == 3) + DoScriptText(SAY_CAPERNIAN_DEATH, me); + } + + void AttackStart(Unit* who) + { + if (!who || FakeDeath || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + if (me->Attack(who, true)) + { + me->AddThreat(who, 0.0f); + me->SetInCombatWith(who); + who->SetInCombatWith(me); + + me->GetMotionMaster()->MoveChase(who, CAPERNIAN_DISTANCE); + } + } + + void Aggro(Unit *who) + { + if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + if (!who || FakeDeath) + return; + } + + void UpdateAI(const uint32 diff) + { + advisorbase_ai::UpdateAI(diff); + + //Faking Death, don't do anything + if (FakeDeath) + return; + + //Return since we have no target + if (!UpdateVictim()) + return; + + //Yell_Timer + if (!Yell) + { + if (Yell_Timer <= diff) + { + DoScriptText(SAY_CAPERNIAN_AGGRO, me); + Yell = true; + } else Yell_Timer -= diff; + } + + //Fireball_Timer + if (Fireball_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_CAPERNIAN_FIREBALL); + Fireball_Timer = 4000; + } else Fireball_Timer -= diff; + + //Conflagration_Timer + if (Conflagration_Timer <= diff) + { + Unit *pTarget = NULL; + pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + + if (pTarget && me->IsWithinDistInMap(pTarget, 30)) + DoCast(pTarget, SPELL_CONFLAGRATION); + else + DoCast(me->getVictim(), SPELL_CONFLAGRATION); + + Conflagration_Timer = 10000+rand()%5000; + } else Conflagration_Timer -= diff; + + //ArcaneExplosion_Timer + if (ArcaneExplosion_Timer <= diff) + { + bool InMeleeRange = false; + Unit *pTarget = NULL; + std::list& m_threatlist = me->getThreatManager().getThreatList(); + for (std::list::const_iterator i = m_threatlist.begin(); i!= m_threatlist.end(); ++i) + { + Unit* pUnit = Unit::GetUnit((*me), (*i)->getUnitGuid()); + //if in melee range + if (pUnit && pUnit->IsWithinDistInMap(me, 5)) + { + InMeleeRange = true; + pTarget = pUnit; + break; + } + } + + if (InMeleeRange) + DoCast(pTarget, SPELL_ARCANE_EXPLOSION); + + ArcaneExplosion_Timer = 4000+rand()%2000; + } else ArcaneExplosion_Timer -= diff; + + //Do NOT deal any melee damage. + } +}; + +//Master Engineer Telonicus AI +struct boss_master_engineer_telonicusAI : public advisorbase_ai +{ + boss_master_engineer_telonicusAI(Creature* pCreature) : advisorbase_ai(pCreature) {} + + uint32 Bomb_Timer; + uint32 RemoteToy_Timer; + + void Reset() + { + Bomb_Timer = 10000; + RemoteToy_Timer = 5000; + + advisorbase_ai::Reset(); + } + + void JustDied(Unit* /*pKiller*/) + { + if (m_pInstance && m_pInstance->GetData(DATA_KAELTHASEVENT) == 3) + DoScriptText(SAY_TELONICUS_DEATH, me); + } + + void Aggro(Unit *who) + { + if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + if (!who || FakeDeath) + return; + + DoScriptText(SAY_TELONICUS_AGGRO, me); + } + + void UpdateAI(const uint32 diff) + { + advisorbase_ai::UpdateAI(diff); + + //Faking Death, do nothing + if (FakeDeath) + return; + + //Return since we have no target + if (!UpdateVictim()) + return; + + //Bomb_Timer + if (Bomb_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_BOMB); + Bomb_Timer = 25000; + } else Bomb_Timer -= diff; + + //RemoteToy_Timer + if (RemoteToy_Timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(pTarget, SPELL_REMOTE_TOY); + + RemoteToy_Timer = 10000+rand()%5000; + } else RemoteToy_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +//Flame Strike AI +struct mob_kael_flamestrikeAI : public Scripted_NoMovementAI +{ + mob_kael_flamestrikeAI(Creature* pCreature) : Scripted_NoMovementAI(pCreature) {} + + uint32 Timer; + bool Casting; + bool KillSelf; + + void Reset() + { + Timer = 5000; + Casting = false; + KillSelf = false; + + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->setFaction(14); + } + + void MoveInLineOfSight(Unit * /*who*/) {} + + void EnterCombat(Unit * /*who*/) {} + + void UpdateAI(const uint32 diff) + { + if (!Casting) + { + DoCast(me, SPELL_FLAME_STRIKE_VIS); + Casting = true; + } + + //Timer + if (Timer <= diff) + { + if (!KillSelf) + { + me->InterruptNonMeleeSpells(false); + DoCast(me, SPELL_FLAME_STRIKE_DMG); + } else me->Kill(me); + + KillSelf = true; + Timer = 1000; + } else Timer -= diff; + } +}; + +//Phoenix AI +struct mob_phoenix_tkAI : public ScriptedAI +{ + mob_phoenix_tkAI(Creature* pCreature) : ScriptedAI(pCreature) {} + + uint32 Cycle_Timer; + + void Reset() + { + Cycle_Timer = 2000; + DoCast(me, SPELL_BURN, true); + } + + void JustDied(Unit* /*killer*/) + { + //is this spell in use anylonger? + //DoCast(me, SPELL_EMBER_BLAST, true); + me->SummonCreature(NPC_PHOENIX_EGG,me->GetPositionX(),me->GetPositionY(),me->GetPositionZ(),me->GetOrientation(),TEMPSUMMON_TIMED_DESPAWN,16000); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (Cycle_Timer <= diff) + { + //spell Burn should possible do this, but it doesn't, so do this for now. + uint32 dmg = urand(4500,5500); + if (me->GetHealth() > dmg) + me->SetHealth(uint32(me->GetHealth()-dmg)); + Cycle_Timer = 2000; + } else Cycle_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +//Phoenix Egg AI +struct mob_phoenix_egg_tkAI : public ScriptedAI +{ + mob_phoenix_egg_tkAI(Creature* pCreature) : ScriptedAI(pCreature) {} + + uint32 Rebirth_Timer; + + void Reset() + { + Rebirth_Timer = 15000; + } + + //ignore any + void MoveInLineOfSight(Unit* /*who*/) {} + + void AttackStart(Unit* who) + { + if (me->Attack(who, false)) + { + me->SetInCombatWith(who); + who->SetInCombatWith(me); + + DoStartNoMovement(who); + } + } + + void JustSummoned(Creature* summoned) + { + summoned->AddThreat(me->getVictim(), 0.0f); + summoned->CastSpell(summoned,SPELL_REBIRTH,false); + } + + void UpdateAI(const uint32 diff) + { + if (!Rebirth_Timer) + return; + + if (Rebirth_Timer <= diff) + { + me->SummonCreature(NPC_PHOENIX,me->GetPositionX(),me->GetPositionY(),me->GetPositionZ(),me->GetOrientation(),TEMPSUMMON_CORPSE_DESPAWN,5000); + Rebirth_Timer = 0; + } else Rebirth_Timer -= diff; + } +}; + +CreatureAI* GetAI_boss_kaelthas(Creature* pCreature) +{ + return new boss_kaelthasAI(pCreature); +} + +CreatureAI* GetAI_boss_thaladred_the_darkener(Creature* pCreature) +{ + return new boss_thaladred_the_darkenerAI(pCreature); +} + +CreatureAI* GetAI_boss_lord_sanguinar(Creature* pCreature) +{ + return new boss_lord_sanguinarAI(pCreature); +} + +CreatureAI* GetAI_boss_grand_astromancer_capernian(Creature* pCreature) +{ + return new boss_grand_astromancer_capernianAI(pCreature); +} + +CreatureAI* GetAI_boss_master_engineer_telonicus(Creature* pCreature) +{ + return new boss_master_engineer_telonicusAI(pCreature); +} + +CreatureAI* GetAI_mob_kael_flamestrike(Creature* pCreature) +{ + return new mob_kael_flamestrikeAI(pCreature); +} + +CreatureAI* GetAI_mob_phoenix_tk(Creature* pCreature) +{ + return new mob_phoenix_tkAI(pCreature); +} + +CreatureAI* GetAI_mob_phoenix_egg_tk(Creature* pCreature) +{ + return new mob_phoenix_egg_tkAI(pCreature); +} + +void AddSC_boss_kaelthas() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_kaelthas"; + newscript->GetAI = &GetAI_boss_kaelthas; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_thaladred_the_darkener"; + newscript->GetAI = &GetAI_boss_thaladred_the_darkener; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_lord_sanguinar"; + newscript->GetAI = &GetAI_boss_lord_sanguinar; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_grand_astromancer_capernian"; + newscript->GetAI = &GetAI_boss_grand_astromancer_capernian; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_master_engineer_telonicus"; + newscript->GetAI = &GetAI_boss_master_engineer_telonicus; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_kael_flamestrike"; + newscript->GetAI = &GetAI_mob_kael_flamestrike; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_phoenix_tk"; + newscript->GetAI = &GetAI_mob_phoenix_tk; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_phoenix_egg_tk"; + newscript->GetAI = &GetAI_mob_phoenix_egg_tk; + newscript->RegisterSelf(); +} diff --git a/src/server/scripts/Outland/TempestKeep/the_eye/boss_void_reaver.cpp b/src/server/scripts/Outland/TempestKeep/the_eye/boss_void_reaver.cpp new file mode 100644 index 00000000000..e1b60b20948 --- /dev/null +++ b/src/server/scripts/Outland/TempestKeep/the_eye/boss_void_reaver.cpp @@ -0,0 +1,179 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Void_Reaver +SD%Complete: 90 +SDComment: Should reset if raid are out of room. +SDCategory: Tempest Keep, The Eye +EndScriptData */ + +#include "ScriptedPch.h" +#include "the_eye.h" + +enum eEnums +{ + SAY_AGGRO = -1550000, + SAY_SLAY1 = -1550001, + SAY_SLAY2 = -1550002, + SAY_SLAY3 = -1550003, + SAY_DEATH = -1550004, + SAY_POUNDING1 = -1550005, + SAY_POUNDING2 = -1550006, + + SPELL_POUNDING = 34162, + SPELL_ARCANE_ORB = 34172, + SPELL_KNOCK_AWAY = 25778, + SPELL_BERSERK = 27680 +}; + +struct boss_void_reaverAI : public ScriptedAI +{ + boss_void_reaverAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint32 Pounding_Timer; + uint32 ArcaneOrb_Timer; + uint32 KnockAway_Timer; + uint32 Berserk_Timer; + + bool Enraged; + + void Reset() + { + Pounding_Timer = 15000; + ArcaneOrb_Timer = 3000; + KnockAway_Timer = 30000; + Berserk_Timer = 600000; + + Enraged = false; + + if (pInstance && me->isAlive()) + pInstance->SetData(DATA_VOIDREAVEREVENT, NOT_STARTED); + } + + void KilledUnit(Unit * /*victim*/) + { + DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), me); + } + + void JustDied(Unit * /*victim*/) + { + DoScriptText(SAY_DEATH, me); + DoZoneInCombat(); + + if (pInstance) + pInstance->SetData(DATA_VOIDREAVEREVENT, DONE); + } + + void EnterCombat(Unit * /*who*/) + { + DoScriptText(SAY_AGGRO, me); + + if (pInstance) + pInstance->SetData(DATA_VOIDREAVEREVENT, IN_PROGRESS); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + // Pounding + if (Pounding_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_POUNDING); + + DoScriptText(RAND(SAY_POUNDING1,SAY_POUNDING2), me); + Pounding_Timer = 15000; //cast time(3000) + cooldown time(12000) + } else Pounding_Timer -= diff; + + // Arcane Orb + if (ArcaneOrb_Timer <= diff) + { + Unit *pTarget = NULL; + std::list t_list = me->getThreatManager().getThreatList(); + std::vector target_list; + for (std::list::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) + { + pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid()); + if (!pTarget) + continue; + + // exclude pets & totems + if (pTarget->GetTypeId() != TYPEID_PLAYER) + continue; + + //18 yard radius minimum + if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER && pTarget->isAlive() && !pTarget->IsWithinDist(me, 18, false)) + target_list.push_back(pTarget); + pTarget = NULL; + } + + if (target_list.size()) + pTarget = *(target_list.begin()+rand()%target_list.size()); + else + pTarget = me->getVictim(); + + if (pTarget) + me->CastSpell(pTarget->GetPositionX(),pTarget->GetPositionY(),pTarget->GetPositionZ(), SPELL_ARCANE_ORB, false, NULL, NULL, NULL, pTarget); + + ArcaneOrb_Timer = 3000; + } else ArcaneOrb_Timer -= diff; + + // Single Target knock back, reduces aggro + if (KnockAway_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_KNOCK_AWAY); + + //Drop 25% aggro + if (DoGetThreat(me->getVictim())) + DoModifyThreatPercent(me->getVictim(),-25); + + KnockAway_Timer = 30000; + } else KnockAway_Timer -= diff; + + //Berserk + if (Berserk_Timer < diff && !Enraged) + { + DoCast(me, SPELL_BERSERK); + Enraged = true; + } else Berserk_Timer -= diff; + + DoMeleeAttackIfReady(); + + EnterEvadeIfOutOfCombatArea(diff); + } +}; + +CreatureAI* GetAI_boss_void_reaver(Creature* pCreature) +{ + return new boss_void_reaverAI (pCreature); +} + +void AddSC_boss_void_reaver() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_void_reaver"; + newscript->GetAI = &GetAI_boss_void_reaver; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/Outland/TempestKeep/the_eye/instance_the_eye.cpp b/src/server/scripts/Outland/TempestKeep/the_eye/instance_the_eye.cpp new file mode 100644 index 00000000000..59c72071238 --- /dev/null +++ b/src/server/scripts/Outland/TempestKeep/the_eye/instance_the_eye.cpp @@ -0,0 +1,176 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_The_Eye +SD%Complete: 100 +SDComment: +SDCategory: Tempest Keep, The Eye +EndScriptData */ + +#include "ScriptedPch.h" +#include "the_eye.h" + +#define MAX_ENCOUNTER 5 + +/* The Eye encounters: +0 - Kael'thas event +1 - Al' ar event +2 - Solarian Event +3 - Void Reaver event +*/ + +struct instance_the_eye : public ScriptedInstance +{ + instance_the_eye(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint64 ThaladredTheDarkener; + uint64 LordSanguinar; + uint64 GrandAstromancerCapernian; + uint64 MasterEngineerTelonicus; + uint64 Kaelthas; + uint64 Astromancer; + uint64 Alar; + + uint8 KaelthasEventPhase; + uint8 AlarEventPhase; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + ThaladredTheDarkener = 0; + LordSanguinar = 0; + GrandAstromancerCapernian = 0; + MasterEngineerTelonicus = 0; + Kaelthas = 0; + Astromancer = 0; + Alar = 0; + + KaelthasEventPhase = 0; + AlarEventPhase = 0; + } + + bool IsEncounterInProgress() const + { + for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) return true; + + return false; + } + + void OnCreatureCreate(Creature* pCreature, bool /*add*/) + { + switch(pCreature->GetEntry()) + { + case 20064: ThaladredTheDarkener = pCreature->GetGUID(); break; + case 20063: MasterEngineerTelonicus = pCreature->GetGUID(); break; + case 20062: GrandAstromancerCapernian = pCreature->GetGUID(); break; + case 20060: LordSanguinar = pCreature->GetGUID(); break; + case 19622: Kaelthas = pCreature->GetGUID(); break; + case 18805: Astromancer = pCreature->GetGUID(); break; + case 19514: Alar = pCreature->GetGUID(); break; + } + } + + uint64 GetData64(uint32 identifier) + { + switch(identifier) + { + case DATA_THALADREDTHEDARKENER: return ThaladredTheDarkener; + case DATA_LORDSANGUINAR: return LordSanguinar; + case DATA_GRANDASTROMANCERCAPERNIAN: return GrandAstromancerCapernian; + case DATA_MASTERENGINEERTELONICUS: return MasterEngineerTelonicus; + case DATA_KAELTHAS: return Kaelthas; + case DATA_ASTROMANCER: return Astromancer; + case DATA_ALAR: return Alar; + } + return 0; + } + + void SetData(uint32 type, uint32 data) + { + switch(type) + { + case DATA_ALAREVENT: AlarEventPhase = data; m_auiEncounter[0] = data; break; + case DATA_HIGHASTROMANCERSOLARIANEVENT: m_auiEncounter[1] = data; break; + case DATA_VOIDREAVEREVENT: m_auiEncounter[2] = data; break; + case DATA_KAELTHASEVENT: KaelthasEventPhase = data; m_auiEncounter[3] = data; break; + } + if (data == DONE) + SaveToDB(); + } + + uint32 GetData(uint32 type) + { + switch(type) + { + case DATA_ALAREVENT: return AlarEventPhase; + case DATA_HIGHASTROMANCERSOLARIANEVENT: return m_auiEncounter[1]; + case DATA_VOIDREAVEREVENT: return m_auiEncounter[2]; + case DATA_KAELTHASEVENT: return KaelthasEventPhase; + } + return 0; + } + + std::string GetSaveData() + { + OUT_SAVE_INST_DATA; + std::ostringstream stream; + stream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " << m_auiEncounter[3]; + char* out = new char[stream.str().length() + 1]; + strcpy(out, stream.str().c_str()); + if (out) + { + OUT_SAVE_INST_DATA_COMPLETE; + return out; + } + return NULL; + } + + void Load(const char* in) + { + if (!in) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + OUT_LOAD_INST_DATA(in); + std::istringstream stream(in); + stream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3]; + for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) // Do not load an encounter as "In Progress" - reset it instead. + m_auiEncounter[i] = NOT_STARTED; + OUT_LOAD_INST_DATA_COMPLETE; + } +}; + +InstanceData* GetInstanceData_instance_the_eye(Map* pMap) +{ + return new instance_the_eye(pMap); +} + +void AddSC_instance_the_eye() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_the_eye"; + newscript->GetInstanceData = &GetInstanceData_instance_the_eye; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/Outland/TempestKeep/the_eye/the_eye.cpp b/src/server/scripts/Outland/TempestKeep/the_eye/the_eye.cpp new file mode 100644 index 00000000000..97021fdc031 --- /dev/null +++ b/src/server/scripts/Outland/TempestKeep/the_eye/the_eye.cpp @@ -0,0 +1,98 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: The_Eye +SD%Complete: 100 +SDComment: +SDCategory: Tempest Keep, The Eye +EndScriptData */ + +/* ContentData +mob_crystalcore_devastator +EndContentData */ + +#include "ScriptedPch.h" +#include "the_eye.h" + +#define SPELL_COUNTERCHARGE 35035 +#define SPELL_KNOCKAWAY 22893 + +struct mob_crystalcore_devastatorAI : public ScriptedAI +{ + mob_crystalcore_devastatorAI(Creature *c) : ScriptedAI(c) {} + + uint32 Knockaway_Timer; + uint32 Countercharge_Timer; + + void Reset() + { + Countercharge_Timer = 9000; + Knockaway_Timer = 25000; + } + + void EnterCombat(Unit * /*who*/) + { + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //Check if we have a current target + //Knockaway_Timer + if (Knockaway_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_KNOCKAWAY, true); + + // current aggro target is knocked away pick new target + Unit* pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO, 0); + + if (!pTarget || pTarget == me->getVictim()) + pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO, 1); + + if (pTarget) + me->TauntApply(pTarget); + + Knockaway_Timer = 23000; + } else Knockaway_Timer -= diff; + + //Countercharge_Timer + if (Countercharge_Timer <= diff) + { + DoCast(me, SPELL_COUNTERCHARGE); + Countercharge_Timer = 45000; + } else Countercharge_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_crystalcore_devastator(Creature* pCreature) +{ + return new mob_crystalcore_devastatorAI (pCreature); +} + +void AddSC_the_eye() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "mob_crystalcore_devastator"; + newscript->GetAI = &GetAI_mob_crystalcore_devastator; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/Outland/TempestKeep/the_eye/the_eye.h b/src/server/scripts/Outland/TempestKeep/the_eye/the_eye.h new file mode 100644 index 00000000000..d0d3ea09061 --- /dev/null +++ b/src/server/scripts/Outland/TempestKeep/the_eye/the_eye.h @@ -0,0 +1,20 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_THE_EYE_H +#define DEF_THE_EYE_H + +#define DATA_ALAREVENT 1 +#define DATA_ASTROMANCER 2 +#define DATA_GRANDASTROMANCERCAPERNIAN 3 +#define DATA_HIGHASTROMANCERSOLARIANEVENT 4 +#define DATA_KAELTHAS 5 +#define DATA_KAELTHASEVENT 6 +#define DATA_LORDSANGUINAR 7 +#define DATA_MASTERENGINEERTELONICUS 8 +#define DATA_THALADREDTHEDARKENER 10 +#define DATA_VOIDREAVEREVENT 11 +#define DATA_ALAR 12 +#endif + diff --git a/src/server/scripts/Outland/TempestKeep/the_mechanar/boss_gatewatcher_gyrokill.cpp b/src/server/scripts/Outland/TempestKeep/the_mechanar/boss_gatewatcher_gyrokill.cpp new file mode 100644 index 00000000000..b9c365eda65 --- /dev/null +++ b/src/server/scripts/Outland/TempestKeep/the_mechanar/boss_gatewatcher_gyrokill.cpp @@ -0,0 +1,39 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Gatewatcher_Gyrokill +SD%Complete: 0 +SDComment: Place Holder +SDCategory: Tempest Keep, The Mechanar +EndScriptData */ + +#include "ScriptedPch.h" + +//not used +#define SAY_AGGRO -1554000 +#define SAY_SAW_ATTACK1 -1554001 +#define SAY_SAW_ATTACK2 -1554002 +#define SAY_SLAY1 -1554003 +#define SAY_SLAY2 -1554004 +#define SAY_DEATH -1554005 + +#define SPELL_STREAM_OF_MACHINE_FLUID 35311 +#define SPELL_SAW_BLADE 35318 +#define H_SPELL_SAW_BLADE 39192 +#define SPELL_SHADOW_POWER 35322 +#define H_SPELL_SHADOW_POWER 39193 + diff --git a/src/server/scripts/Outland/TempestKeep/the_mechanar/boss_gatewatcher_ironhand.cpp b/src/server/scripts/Outland/TempestKeep/the_mechanar/boss_gatewatcher_ironhand.cpp new file mode 100644 index 00000000000..50c3a6171ce --- /dev/null +++ b/src/server/scripts/Outland/TempestKeep/the_mechanar/boss_gatewatcher_ironhand.cpp @@ -0,0 +1,130 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/* ScriptData +SDName: Boss_Gatewatcher_Ironhand +SD%Complete: 75 +SDComment: +SDCategory: Tempest Keep, The Mechanar +EndScriptData */ + +#include "ScriptedPch.h" + +#define SAY_AGGRO_1 -1554006 +#define SAY_HAMMER_1 -1554007 +#define SAY_HAMMER_2 -1554008 +#define SAY_SLAY_1 -1554009 +#define SAY_SLAY_2 -1554010 +#define SAY_DEATH_1 -1554011 +#define EMOTE_HAMMER -1554012 + +// Spells to be casted +#define SPELL_SHADOW_POWER 35322 +#define H_SPELL_SHADOW_POWER 39193 +#define SPELL_HAMMER_PUNCH 35326 +#define SPELL_JACKHAMMER 35327 +#define H_SPELL_JACKHAMMER 39194 +#define SPELL_STREAM_OF_MACHINE_FLUID 35311 + +// Gatewatcher Iron-Hand AI +struct boss_gatewatcher_iron_handAI : public ScriptedAI +{ + boss_gatewatcher_iron_handAI(Creature *c) : ScriptedAI(c) + { + } + + uint32 Shadow_Power_Timer; + uint32 Jackhammer_Timer; + uint32 Stream_of_Machine_Fluid_Timer; + + void Reset() + { + Shadow_Power_Timer = 25000; + Jackhammer_Timer = 45000; + Stream_of_Machine_Fluid_Timer = 55000; + + } + void EnterCombat(Unit * /*who*/) + { + DoScriptText(SAY_AGGRO_1, me); + } + + void KilledUnit(Unit* /*victim*/) + { + if (rand()%2) + return; + + DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me); + } + + void JustDied(Unit* /*Killer*/) + { + DoScriptText(SAY_DEATH_1, me); + //TODO: Add door check/open code + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //Shadow Power + if (Shadow_Power_Timer <= diff) + { + DoCast(me, SPELL_SHADOW_POWER); + Shadow_Power_Timer = 20000 + rand()%8000; + } else Shadow_Power_Timer -= diff; + + //Jack Hammer + if (Jackhammer_Timer <= diff) + { + //TODO: expect cast this about 5 times in a row (?), announce it by emote only once + DoScriptText(EMOTE_HAMMER, me); + DoCast(me->getVictim(), SPELL_JACKHAMMER); + + //chance to yell, but not same time as emote (after spell in fact casted) + if (rand()%2) + return; + + DoScriptText(RAND(SAY_HAMMER_1,SAY_HAMMER_2), me); + Jackhammer_Timer = 30000; + } else Jackhammer_Timer -= diff; + + //Stream of Machine Fluid + if (Stream_of_Machine_Fluid_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_STREAM_OF_MACHINE_FLUID); + Stream_of_Machine_Fluid_Timer = 35000 + rand()%15000; + } else Stream_of_Machine_Fluid_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_gatewatcher_iron_hand(Creature* pCreature) +{ + return new boss_gatewatcher_iron_handAI (pCreature); +} + +void AddSC_boss_gatewatcher_iron_hand() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_gatewatcher_iron_hand"; + newscript->GetAI = &GetAI_boss_gatewatcher_iron_hand; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/Outland/TempestKeep/the_mechanar/boss_nethermancer_sepethrea.cpp b/src/server/scripts/Outland/TempestKeep/the_mechanar/boss_nethermancer_sepethrea.cpp new file mode 100644 index 00000000000..ededec0196d --- /dev/null +++ b/src/server/scripts/Outland/TempestKeep/the_mechanar/boss_nethermancer_sepethrea.cpp @@ -0,0 +1,245 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/* ScriptData +SDName: Boss_Nethermancer_Sepethrea +SD%Complete: 90 +SDComment: Need adjustments to initial summons +SDCategory: Tempest Keep, The Mechanar +EndScriptData */ + +#include "ScriptedPch.h" +#include "mechanar.h" + +#define SAY_AGGRO -1554013 +#define SAY_SUMMON -1554014 +#define SAY_DRAGONS_BREATH_1 -1554015 +#define SAY_DRAGONS_BREATH_2 -1554016 +#define SAY_SLAY1 -1554017 +#define SAY_SLAY2 -1554018 +#define SAY_DEATH -1554019 + +#define SPELL_SUMMON_RAGIN_FLAMES 35275 +#define H_SPELL_SUMMON_RAGIN_FLAMES 39084 + +#define SPELL_FROST_ATTACK 35263 +#define SPELL_ARCANE_BLAST 35314 +#define SPELL_DRAGONS_BREATH 35250 +#define SPELL_KNOCKBACK 37317 +#define SPELL_SOLARBURN 35267 + +struct boss_nethermancer_sepethreaAI : public ScriptedAI +{ + boss_nethermancer_sepethreaAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance *pInstance; + + uint32 frost_attack_Timer; + uint32 arcane_blast_Timer; + uint32 dragons_breath_Timer; + uint32 knockback_Timer; + uint32 solarburn_Timer; + + void Reset() + { + frost_attack_Timer = 7000 + rand()%3000; + arcane_blast_Timer = 12000 + rand()%6000; + dragons_breath_Timer = 18000 + rand()%4000; + knockback_Timer = 22000 + rand()%6000; + solarburn_Timer = 30000; + + if (pInstance) + pInstance->SetData(DATA_NETHERMANCER_EVENT, NOT_STARTED); + } + + void EnterCombat(Unit* who) + { + if (pInstance) + pInstance->SetData(DATA_NETHERMANCER_EVENT, IN_PROGRESS); + + DoScriptText(SAY_AGGRO, me); + DoCast(who, SPELL_SUMMON_RAGIN_FLAMES); + DoScriptText(SAY_SUMMON, me); + } + + void KilledUnit(Unit* /*victim*/) + { + DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me); + } + + void JustDied(Unit* /*Killer*/) + { + DoScriptText(SAY_DEATH, me); + + if (pInstance) + pInstance->SetData(DATA_NETHERMANCER_EVENT, DONE); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //Frost Attack + if (frost_attack_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_FROST_ATTACK); + frost_attack_Timer = 7000 + rand()%3000; + } else frost_attack_Timer -= diff; + + //Arcane Blast + if (arcane_blast_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_ARCANE_BLAST); + arcane_blast_Timer = 15000; + } else arcane_blast_Timer -= diff; + + //Dragons Breath + if (dragons_breath_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_DRAGONS_BREATH); + { + if (rand()%2) + return; + + DoScriptText(RAND(SAY_DRAGONS_BREATH_1,SAY_DRAGONS_BREATH_2), me); + } + dragons_breath_Timer = 12000 + rand()%10000; + } else dragons_breath_Timer -= diff; + + //Knockback + if (knockback_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_KNOCKBACK); + knockback_Timer = 15000 + rand()%10000; + } else knockback_Timer -= diff; + + //Solarburn + if (solarburn_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_SOLARBURN); + solarburn_Timer = 30000; + } else solarburn_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_nethermancer_sepethrea(Creature* pCreature) +{ + return new boss_nethermancer_sepethreaAI (pCreature); +} + +#define SPELL_INFERNO 35268 +#define H_SPELL_INFERNO 39346 +#define SPELL_FIRE_TAIL 35278 + +struct mob_ragin_flamesAI : public ScriptedAI +{ + mob_ragin_flamesAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance *pInstance; + + uint32 inferno_Timer; + uint32 flame_timer; + uint32 Check_Timer; + + bool onlyonce; + + void Reset() + { + inferno_Timer = 10000; + flame_timer = 500; + Check_Timer = 2000; + onlyonce = false; + me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, true); + me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, true); + me->SetSpeed(MOVE_RUN, DUNGEON_MODE(0.5f, 0.7f)); + } + + void EnterCombat(Unit* /*who*/) + { + } + + void UpdateAI(const uint32 diff) + { + //Check_Timer + if (Check_Timer <= diff) + { + if (pInstance) + { + if (pInstance->GetData(DATA_NETHERMANCER_EVENT) != IN_PROGRESS) + { + //remove + me->setDeathState(JUST_DIED); + me->RemoveCorpse(); + } + } + Check_Timer = 1000; + } else Check_Timer -= diff; + + if (!UpdateVictim()) + return; + + if (!onlyonce) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + me->GetMotionMaster()->MoveChase(pTarget); + onlyonce = true; + } + + if (inferno_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_INFERNO); + me->TauntApply(me->getVictim()); + inferno_Timer = 10000; + } else inferno_Timer -= diff; + + if (flame_timer <= diff) + { + DoCast(me, SPELL_FIRE_TAIL); + flame_timer = 500; + } else flame_timer -=diff; + + DoMeleeAttackIfReady(); + } + +}; +CreatureAI* GetAI_mob_ragin_flames(Creature* pCreature) +{ + return new mob_ragin_flamesAI (pCreature); +} +void AddSC_boss_nethermancer_sepethrea() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_nethermancer_sepethrea"; + newscript->GetAI = &GetAI_boss_nethermancer_sepethrea; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_ragin_flames"; + newscript->GetAI = &GetAI_mob_ragin_flames; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/Outland/TempestKeep/the_mechanar/boss_pathaleon_the_calculator.cpp b/src/server/scripts/Outland/TempestKeep/the_mechanar/boss_pathaleon_the_calculator.cpp new file mode 100644 index 00000000000..c0c06704db7 --- /dev/null +++ b/src/server/scripts/Outland/TempestKeep/the_mechanar/boss_pathaleon_the_calculator.cpp @@ -0,0 +1,246 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/* ScriptData +SDName: Boss Pathaleon the Calculator +SD%Complete: 50 +SDComment: Event missing. Script for himself 99% blizzlike. +SDCategory: Tempest Keep, The Mechanar +EndScriptData */ + +#include "ScriptedPch.h" + +#define SAY_AGGRO -1554020 +#define SAY_DOMINATION_1 -1554021 +#define SAY_DOMINATION_2 -1554022 +#define SAY_SUMMON -1554023 +#define SAY_ENRAGE -1554024 +#define SAY_SLAY_1 -1554025 +#define SAY_SLAY_2 -1554026 +#define SAY_DEATH -1554027 + +// Spells to be casted +#define SPELL_MANA_TAP 36021 +#define SPELL_ARCANE_TORRENT 36022 +#define SPELL_DOMINATION 35280 +#define H_SPELL_ARCANE_EXPLOSION 15453 +#define SPELL_FRENZY 36992 + +#define SPELL_SUMMON_NETHER_WRAITH_1 35285 //Spells work, but not implemented +#define SPELL_SUMMON_NETHER_WRAITH_2 35286 +#define SPELL_SUMMON_NETHER_WRAITH_3 35287 +#define SPELL_SUMMON_NETHER_WRAITH_4 35288 + +// Add Spells +#define SPELL_DETONATION 35058 +#define SPELL_ARCANE_MISSILES 35034 + +struct boss_pathaleon_the_calculatorAI : public ScriptedAI +{ + boss_pathaleon_the_calculatorAI(Creature *c) : ScriptedAI(c), summons(me) + { + } + + uint32 Summon_Timer; + SummonList summons; + uint32 ManaTap_Timer; + uint32 ArcaneTorrent_Timer; + uint32 Domination_Timer; + uint32 ArcaneExplosion_Timer; + + bool Enraged; + + uint32 Counter; + + void Reset() + { + Summon_Timer = 30000; + ManaTap_Timer = 12000 + rand()%8000; + ArcaneTorrent_Timer = 16000 + rand()%9000; + Domination_Timer = 25000 + rand()%15000; + ArcaneExplosion_Timer = 8000 + rand()%5000; + + Enraged = false; + + Counter = 0; + summons.DespawnAll(); + } + void EnterCombat(Unit * /*who*/) + { + DoScriptText(SAY_AGGRO, me); + } + + void KilledUnit(Unit* /*victim*/) + { + DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me); + } + + void JustDied(Unit* /*Killer*/) + { + DoScriptText(SAY_DEATH, me); + + summons.DespawnAll(); + } + + void JustSummoned(Creature *summon) {summons.Summon(summon);} + void SummonedCreatureDespawn(Creature *summon) {summons.Despawn(summon);} + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + if (Summon_Timer <= diff) + { + for (uint8 i = 0; i < 3; ++i) + { + Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); + Creature* Wraith = me->SummonCreature(21062,me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + if (pTarget && Wraith) + Wraith->AI()->AttackStart(pTarget); + } + DoScriptText(SAY_SUMMON, me); + Summon_Timer = 30000 + rand()%15000; + } else Summon_Timer -= diff; + + if (ManaTap_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_MANA_TAP); + ManaTap_Timer = 14000 + rand()%8000; + } else ManaTap_Timer -= diff; + + if (ArcaneTorrent_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_ARCANE_TORRENT); + ArcaneTorrent_Timer = 12000 + rand()%6000; + } else ArcaneTorrent_Timer -= diff; + + if (Domination_Timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1)) + { + DoScriptText(RAND(SAY_DOMINATION_1,SAY_DOMINATION_2), me); + + DoCast(pTarget, SPELL_DOMINATION); + } + Domination_Timer = 25000 + rand()%5000; + } else Domination_Timer -= diff; + + //Only casting if Heroic Mode is used + if (IsHeroic()) + { + if (ArcaneExplosion_Timer <= diff) + { + DoCast(me->getVictim(), H_SPELL_ARCANE_EXPLOSION); + ArcaneExplosion_Timer = 10000 + rand()%4000; + } else ArcaneExplosion_Timer -= diff; + } + + if (!Enraged && me->GetHealth()*100 / me->GetMaxHealth() < 21) + { + DoCast(me, SPELL_FRENZY); + DoScriptText(SAY_ENRAGE, me); + Enraged = true; + + } + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_pathaleon_the_calculator(Creature* pCreature) +{ + return new boss_pathaleon_the_calculatorAI (pCreature); +} + +struct mob_nether_wraithAI : public ScriptedAI +{ + mob_nether_wraithAI(Creature *c) : ScriptedAI(c) {} + + uint32 ArcaneMissiles_Timer; + uint32 Detonation_Timer; + uint32 Die_Timer; + bool Detonation; + + void Reset() + { + ArcaneMissiles_Timer = 1000 + rand()%3000; + Detonation_Timer = 20000; + Die_Timer = 2200; + Detonation = false; + + } + + void EnterCombat(Unit* /*who*/) + { + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (ArcaneMissiles_Timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1)) + DoCast(pTarget, SPELL_ARCANE_MISSILES); + else + DoCast(me->getVictim(), SPELL_ARCANE_MISSILES); + + ArcaneMissiles_Timer = 5000 + rand()%5000; + } else ArcaneMissiles_Timer -=diff; + + if (!Detonation) + { + if (Detonation_Timer <= diff) + { + DoCast(me, SPELL_DETONATION); + Detonation = true; + } else Detonation_Timer -= diff; + } + + if (Detonation) + { + if (Die_Timer <= diff) + { + me->setDeathState(JUST_DIED); + me->RemoveCorpse(); + } else Die_Timer -= diff; + } + + DoMeleeAttackIfReady(); + } + +}; +CreatureAI* GetAI_mob_nether_wraith(Creature* pCreature) +{ + return new mob_nether_wraithAI (pCreature); +} + +void AddSC_boss_pathaleon_the_calculator() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_pathaleon_the_calculator"; + newscript->GetAI = &GetAI_boss_pathaleon_the_calculator; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_nether_wraith"; + newscript->GetAI = &GetAI_mob_nether_wraith; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/Outland/TempestKeep/the_mechanar/instance_mechanar.cpp b/src/server/scripts/Outland/TempestKeep/the_mechanar/instance_mechanar.cpp new file mode 100644 index 00000000000..c70da24ea3f --- /dev/null +++ b/src/server/scripts/Outland/TempestKeep/the_mechanar/instance_mechanar.cpp @@ -0,0 +1,86 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Mechanar +SD%Complete: 100 +SDComment: +SDCategory: Mechanar +EndScriptData */ + +#include "ScriptedPch.h" +#include "mechanar.h" + +#define MAX_ENCOUNTER 1 + +struct instance_mechanar : public ScriptedInstance +{ + instance_mechanar(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + } + + bool IsEncounterInProgress() const + { + for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) + return true; + + return false; + } + + uint32 GetData(uint32 type) + { + switch(type) + { + case DATA_NETHERMANCER_EVENT: return m_auiEncounter[0]; + } + + return false; + } + + uint64 GetData64 (uint32 /*identifier*/) + { + return 0; + } + + void SetData(uint32 type, uint32 data) + { + switch(type) + { + case DATA_NETHERMANCER_EVENT: m_auiEncounter[0] = data; break; + } + } +}; + +InstanceData* GetInstanceData_instance_mechanar(Map* pMap) +{ + return new instance_mechanar(pMap); +} + +void AddSC_instance_mechanar() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_mechanar"; + newscript->GetInstanceData = &GetInstanceData_instance_mechanar; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/Outland/TempestKeep/the_mechanar/mechanar.h b/src/server/scripts/Outland/TempestKeep/the_mechanar/mechanar.h new file mode 100644 index 00000000000..d1b53eebf53 --- /dev/null +++ b/src/server/scripts/Outland/TempestKeep/the_mechanar/mechanar.h @@ -0,0 +1,6 @@ +#ifndef DEF_MECHANAR_H +#define DEF_MECHANAR_H + +#define DATA_NETHERMANCER_EVENT 1 +#endif + diff --git a/src/server/scripts/Outland/auchindoun/auchenai_crypts/boss_exarch_maladaar.cpp b/src/server/scripts/Outland/auchindoun/auchenai_crypts/boss_exarch_maladaar.cpp deleted file mode 100644 index bfde95ffcb0..00000000000 --- a/src/server/scripts/Outland/auchindoun/auchenai_crypts/boss_exarch_maladaar.cpp +++ /dev/null @@ -1,348 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Exarch_Maladaar -SD%Complete: 95 -SDComment: Most of event implemented, some adjustments to timers remain and possibly make some better code for switching his dark side in to better "images" of player. -SDCategory: Auchindoun, Auchenai Crypts -EndScriptData */ - -/* ContentData -mob_stolen_soul -boss_exarch_maladaar -mob_avatar_of_martyred -EndContentData */ - -#include "ScriptedPch.h" - -#define SPELL_MOONFIRE 37328 -#define SPELL_FIREBALL 37329 -#define SPELL_MIND_FLAY 37330 -#define SPELL_HEMORRHAGE 37331 -#define SPELL_FROSTSHOCK 37332 -#define SPELL_CURSE_OF_AGONY 37334 -#define SPELL_MORTAL_STRIKE 37335 -#define SPELL_FREEZING_TRAP 37368 -#define SPELL_HAMMER_OF_JUSTICE 37369 - -struct mob_stolen_soulAI : public ScriptedAI -{ - mob_stolen_soulAI(Creature *c) : ScriptedAI(c) {} - - uint8 myClass; - uint32 Class_Timer; - - void Reset() - { - Class_Timer = 1000; - } - - void EnterCombat(Unit * /*who*/) - { } - - void SetMyClass(uint8 myclass) - { - myClass = myclass; - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (Class_Timer <= diff) - { - switch (myClass) - { - case CLASS_WARRIOR: - DoCast(me->getVictim(), SPELL_MORTAL_STRIKE); - Class_Timer = 6000; - break; - case CLASS_PALADIN: - DoCast(me->getVictim(), SPELL_HAMMER_OF_JUSTICE); - Class_Timer = 6000; - break; - case CLASS_HUNTER: - DoCast(me->getVictim(), SPELL_FREEZING_TRAP); - Class_Timer = 20000; - break; - case CLASS_ROGUE: - DoCast(me->getVictim(), SPELL_HEMORRHAGE); - Class_Timer = 10000; - break; - case CLASS_PRIEST: - DoCast(me->getVictim(), SPELL_MIND_FLAY); - Class_Timer = 5000; - break; - case CLASS_SHAMAN: - DoCast(me->getVictim(), SPELL_FROSTSHOCK); - Class_Timer = 8000; - break; - case CLASS_MAGE: - DoCast(me->getVictim(), SPELL_FIREBALL); - Class_Timer = 5000; - break; - case CLASS_WARLOCK: - DoCast(me->getVictim(), SPELL_CURSE_OF_AGONY); - Class_Timer = 20000; - break; - case CLASS_DRUID: - DoCast(me->getVictim(), SPELL_MOONFIRE); - Class_Timer = 10000; - break; - } - } else Class_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_stolen_soul(Creature* pCreature) -{ - return new mob_stolen_soulAI (pCreature); -} - -#define SAY_INTRO -1558000 -#define SAY_SUMMON -1558001 - -#define SAY_AGGRO_1 -1558002 -#define SAY_AGGRO_2 -1558003 -#define SAY_AGGRO_3 -1558004 - -#define SAY_ROAR -1558005 -#define SAY_SOUL_CLEAVE -1558006 - -#define SAY_SLAY_1 -1558007 -#define SAY_SLAY_2 -1558008 - -#define SAY_DEATH -1558009 - -#define SPELL_RIBBON_OF_SOULS 32422 -#define SPELL_SOUL_SCREAM 32421 - -#define SPELL_STOLEN_SOUL 32346 -#define SPELL_STOLEN_SOUL_VISUAL 32395 - -#define SPELL_SUMMON_AVATAR 32424 - -#define ENTRY_STOLEN_SOUL 18441 - -struct boss_exarch_maladaarAI : public ScriptedAI -{ - boss_exarch_maladaarAI(Creature *c) : ScriptedAI(c) - { - HasTaunted = false; - } - - uint32 soulmodel; - uint64 soulholder; - uint8 soulclass; - - uint32 Fear_timer; - uint32 Ribbon_of_Souls_timer; - uint32 StolenSoul_Timer; - - bool HasTaunted; - bool Avatar_summoned; - - void Reset() - { - soulmodel = 0; - soulholder = 0; - soulclass = 0; - - Fear_timer = 15000 + rand()% 5000; - Ribbon_of_Souls_timer = 5000; - StolenSoul_Timer = 25000 + rand()% 10000; - - Avatar_summoned = false; - } - - void MoveInLineOfSight(Unit *who) - { - if (!HasTaunted && me->IsWithinDistInMap(who, 150.0)) - { - DoScriptText(SAY_INTRO, me); - HasTaunted = true; - } - - ScriptedAI::MoveInLineOfSight(who); - } - - void EnterCombat(Unit * /*who*/) - { - DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3), me); - } - - void JustSummoned(Creature *summoned) - { - if (summoned->GetEntry() == ENTRY_STOLEN_SOUL) - { - //SPELL_STOLEN_SOUL_VISUAL has shapeshift effect, but not implemented feature in Trinity for this spell. - summoned->CastSpell(summoned,SPELL_STOLEN_SOUL_VISUAL,false); - summoned->SetDisplayId(soulmodel); - summoned->setFaction(me->getFaction()); - - if (Unit *pTarget = Unit::GetUnit(*me,soulholder)) - { - - CAST_AI(mob_stolen_soulAI, summoned->AI())->SetMyClass(soulclass); - summoned->AI()->AttackStart(pTarget); - } - } - } - - void KilledUnit(Unit* /*victim*/) - { - if (rand()%2) - return; - - DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me); - } - - void JustDied(Unit* /*Killer*/) - { - DoScriptText(SAY_DEATH, me); - //When Exarch Maladar is defeated D'ore appear. - me->SummonCreature(19412, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 600000); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (!Avatar_summoned && ((me->GetHealth()*100) / me->GetMaxHealth() < 25)) - { - if (me->IsNonMeleeSpellCasted(false)) - me->InterruptNonMeleeSpells(true); - - DoScriptText(SAY_SUMMON, me); - - DoCast(me, SPELL_SUMMON_AVATAR); - Avatar_summoned = true; - StolenSoul_Timer = 15000 + rand()% 15000; - } - - if (StolenSoul_Timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) - { - if (pTarget->GetTypeId() == TYPEID_PLAYER) - { - if (me->IsNonMeleeSpellCasted(false)) - me->InterruptNonMeleeSpells(true); - - uint32 i = urand(1,2); - if (i == 1) - DoScriptText(SAY_ROAR, me); - else - DoScriptText(SAY_SOUL_CLEAVE, me); - - soulmodel = pTarget->GetDisplayId(); - soulholder = pTarget->GetGUID(); - soulclass = pTarget->getClass(); - - DoCast(pTarget, SPELL_STOLEN_SOUL); - me->SummonCreature(ENTRY_STOLEN_SOUL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); - - StolenSoul_Timer = 20000 + rand()% 10000; - } else StolenSoul_Timer = 1000; - } - } else StolenSoul_Timer -= diff; - - if (Ribbon_of_Souls_timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(pTarget, SPELL_RIBBON_OF_SOULS); - - Ribbon_of_Souls_timer = 5000 + (rand()%20 * 1000); - } else Ribbon_of_Souls_timer -= diff; - - if (Fear_timer <= diff) - { - DoCast(me, SPELL_SOUL_SCREAM); - Fear_timer = 15000 + rand()% 15000; - } else Fear_timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_exarch_maladaar(Creature* pCreature) -{ - return new boss_exarch_maladaarAI (pCreature); -} - -#define SPELL_AV_MORTAL_STRIKE 16856 -#define SPELL_AV_SUNDER_ARMOR 16145 - -struct mob_avatar_of_martyredAI : public ScriptedAI -{ - mob_avatar_of_martyredAI(Creature *c) : ScriptedAI(c) {} - - uint32 Mortal_Strike_timer; - - void Reset() - { - Mortal_Strike_timer = 10000; - } - - void EnterCombat(Unit * /*who*/) - { - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (Mortal_Strike_timer <= diff) - { - DoCast(me->getVictim(), SPELL_AV_MORTAL_STRIKE); - Mortal_Strike_timer = 10000 + rand()%20 * 1000; - } else Mortal_Strike_timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_avatar_of_martyred(Creature* pCreature) -{ - return new mob_avatar_of_martyredAI (pCreature); -} - -void AddSC_boss_exarch_maladaar() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "boss_exarch_maladaar"; - newscript->GetAI = &GetAI_boss_exarch_maladaar; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_avatar_of_martyred"; - newscript->GetAI = &GetAI_mob_avatar_of_martyred; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_stolen_soul"; - newscript->GetAI = &GetAI_mob_stolen_soul; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Outland/auchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp b/src/server/scripts/Outland/auchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp deleted file mode 100644 index c13e2905171..00000000000 --- a/src/server/scripts/Outland/auchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp +++ /dev/null @@ -1,211 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -Name: Boss_Shirrak_the_dead_watcher -%Complete: 80 -Comment: InhibitMagic should stack slower far from the boss, proper Visual for Focus Fire, heroic implemented -Category: Auchindoun, Auchenai Crypts -EndScriptData */ - -#include "ScriptedPch.h" - -#define SPELL_INHIBITMAGIC 32264 -#define SPELL_ATTRACTMAGIC 32265 -#define N_SPELL_CARNIVOROUSBITE 36383 -#define H_SPELL_CARNIVOROUSBITE 39382 -#define SPELL_CARNIVOROUSBITE DUNGEON_MODE(N_SPELL_CARNIVOROUSBITE, H_SPELL_CARNIVOROUSBITE) - -#define ENTRY_FOCUS_FIRE 18374 - -#define N_SPELL_FIERY_BLAST 32302 -#define H_SPELL_FIERY_BLAST 38382 -#define SPELL_FIERY_BLAST DUNGEON_MODE(N_SPELL_FIERY_BLAST, H_SPELL_FIERY_BLAST) -#define SPELL_FOCUS_FIRE_VISUAL 42075 //need to find better visual - -#define EMOTE_FOCUSES_ON "focuses on " - -struct boss_shirrak_the_dead_watcherAI : public ScriptedAI -{ - boss_shirrak_the_dead_watcherAI(Creature *c) : ScriptedAI(c) - { - } - - uint32 Inhibitmagic_Timer; - uint32 Attractmagic_Timer; - uint32 Carnivorousbite_Timer; - uint32 FocusFire_Timer; - - uint64 FocusedTargetGUID; - - void Reset() - { - Inhibitmagic_Timer = 0; - Attractmagic_Timer = 28000; - Carnivorousbite_Timer = 10000; - FocusFire_Timer = 17000; - FocusedTargetGUID = 0; - } - - void EnterCombat(Unit * /*who*/) - { } - - void JustSummoned(Creature *summoned) - { - if (summoned && summoned->GetEntry() == ENTRY_FOCUS_FIRE) - { - summoned->CastSpell(summoned,SPELL_FOCUS_FIRE_VISUAL,false); - summoned->setFaction(me->getFaction()); - summoned->SetLevel(me->getLevel()); - summoned->addUnitState(UNIT_STAT_ROOT); - - if (Unit *pFocusedTarget = Unit::GetUnit(*me, FocusedTargetGUID)) - summoned->AI()->AttackStart(pFocusedTarget); - } - } - - void UpdateAI(const uint32 diff) - { - //Inhibitmagic_Timer - if (Inhibitmagic_Timer <= diff) - { - float dist; - Map* pMap = me->GetMap(); - Map::PlayerList const &PlayerList = pMap->GetPlayers(); - for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) - if (Player* i_pl = i->getSource()) - if (i_pl->isAlive() && (dist = i_pl->IsWithinDist(me, 45))) - { - i_pl->RemoveAurasDueToSpell(SPELL_INHIBITMAGIC); - me->AddAura(SPELL_INHIBITMAGIC, i_pl); - if (dist < 35) - me->AddAura(SPELL_INHIBITMAGIC, i_pl); - if (dist < 25) - me->AddAura(SPELL_INHIBITMAGIC, i_pl); - if (dist < 15) - me->AddAura(SPELL_INHIBITMAGIC, i_pl); - } - Inhibitmagic_Timer = 3000+(rand()%1000); - } else Inhibitmagic_Timer -= diff; - - //Return since we have no target - if (!UpdateVictim()) - return; - - //Attractmagic_Timer - if (Attractmagic_Timer <= diff) - { - DoCast(me, SPELL_ATTRACTMAGIC); - Attractmagic_Timer = 30000; - Carnivorousbite_Timer = 1500; - } else Attractmagic_Timer -= diff; - - //Carnivorousbite_Timer - if (Carnivorousbite_Timer <= diff) - { - DoCast(me, SPELL_CARNIVOROUSBITE); - Carnivorousbite_Timer = 10000; - } else Carnivorousbite_Timer -= diff; - - //FocusFire_Timer - if (FocusFire_Timer <= diff) - { - // Summon Focus Fire & Emote - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1); - if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER && pTarget->isAlive()) - { - FocusedTargetGUID = pTarget->GetGUID(); - me->SummonCreature(ENTRY_FOCUS_FIRE,pTarget->GetPositionX(),pTarget->GetPositionY(),pTarget->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,5500); - - // TODO: Find better way to handle emote - // Emote - std::string *emote = new std::string(EMOTE_FOCUSES_ON); - emote->append(pTarget->GetName()); - emote->append("!"); - const char* text = emote->c_str(); - me->MonsterTextEmote(text, 0, true); - delete emote; - } - FocusFire_Timer = 15000+(rand()%5000); - } else FocusFire_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_shirrak_the_dead_watcher(Creature* pCreature) -{ - return new boss_shirrak_the_dead_watcherAI (pCreature); -} - -struct mob_focus_fireAI : public ScriptedAI -{ - mob_focus_fireAI(Creature *c) : ScriptedAI(c) - { - } - - uint32 FieryBlast_Timer; - bool fiery1, fiery2; - - void Reset() - { - FieryBlast_Timer = 3000+(rand()%1000); - fiery1 = fiery2 = true; - } - - void EnterCombat(Unit * /*who*/) - { } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //FieryBlast_Timer - if (fiery2 && FieryBlast_Timer <= diff) - { - DoCast(me, SPELL_FIERY_BLAST); - - if (fiery1) fiery1 = false; - else if (fiery2) fiery2 = false; - - FieryBlast_Timer = 1000; - } else FieryBlast_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_focus_fire(Creature* pCreature) -{ - return new mob_focus_fireAI (pCreature); -} - -void AddSC_boss_shirrak_the_dead_watcher() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_shirrak_the_dead_watcher"; - newscript->GetAI = &GetAI_boss_shirrak_the_dead_watcher; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_focus_fire"; - newscript->GetAI = &GetAI_mob_focus_fire; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Outland/auchindoun/mana_tombs/boss_nexusprince_shaffar.cpp b/src/server/scripts/Outland/auchindoun/mana_tombs/boss_nexusprince_shaffar.cpp deleted file mode 100644 index 5b15178c33e..00000000000 --- a/src/server/scripts/Outland/auchindoun/mana_tombs/boss_nexusprince_shaffar.cpp +++ /dev/null @@ -1,358 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_NexusPrince_Shaffar -SD%Complete: 80 -SDComment: Need more tuning of spell timers, it should not be as linear fight as current. Also should possibly find a better way to deal with his three initial beacons to make sure all aggro. -SDCategory: Auchindoun, Mana Tombs -EndScriptData */ - -/* ContentData -boss_nexusprince_shaffar -mob_ethereal_beacon -EndContentData */ - -#include "ScriptedPch.h" - -enum ePrince -{ - SAY_INTRO = -1557000, - SAY_AGGRO_1 = -1557001, - SAY_AGGRO_2 = -1557002, - SAY_AGGRO_3 = -1557003, - SAY_SLAY_1 = -1557004, - SAY_SLAY_2 = -1557005, - SAY_SUMMON = -1557006, - SAY_DEAD = -1557007, - - SPELL_BLINK = 34605, - SPELL_FROSTBOLT = 32364, - SPELL_FIREBALL = 32363, - SPELL_FROSTNOVA = 32365, - - SPELL_ETHEREAL_BEACON = 32371, // Summons NPC_BEACON - SPELL_ETHEREAL_BEACON_VISUAL = 32368, - - NPC_BEACON = 18431, - NPC_SHAFFAR = 18344, - - NR_INITIAL_BEACONS = 3 -}; - -struct boss_nexusprince_shaffarAI : public ScriptedAI -{ - boss_nexusprince_shaffarAI(Creature *c) : ScriptedAI(c), summons(me) { HasTaunted = false; } - - uint32 Blink_Timer; - uint32 Beacon_Timer; - uint32 FireBall_Timer; - uint32 Frostbolt_Timer; - uint32 FrostNova_Timer; - - SummonList summons; - - bool HasTaunted; - bool CanBlink; - - void Reset() - { - Blink_Timer = 1500; - Beacon_Timer = 10000; - FireBall_Timer = 8000; - Frostbolt_Timer = 4000; - FrostNova_Timer = 15000; - - CanBlink = false; - - float dist = 8.0f; - float posX, posY, posZ, angle; - me->GetHomePosition(posX, posY, posZ, angle); - - me->SummonCreature(NPC_BEACON, posX - dist, posY - dist, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200000); - me->SummonCreature(NPC_BEACON, posX - dist, posY + dist, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200000); - me->SummonCreature(NPC_BEACON, posX + dist, posY, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200000); - } - - void EnterEvadeMode() - { - summons.DespawnAll(); - ScriptedAI::EnterEvadeMode(); - } - - void MoveInLineOfSight(Unit *who) - { - if (!HasTaunted && who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 100.0f)) - { - DoScriptText(SAY_INTRO, me); - HasTaunted = true; - } - } - - void EnterCombat(Unit * /*who*/) - { - DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3), me); - - DoZoneInCombat(); - summons.DoZoneInCombat(); - } - - void JustSummoned(Creature *summoned) - { - if (summoned->GetEntry() == NPC_BEACON) - { - summoned->CastSpell(summoned,SPELL_ETHEREAL_BEACON_VISUAL,false); - - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) - summoned->AI()->AttackStart(pTarget); - } - - summons.Summon(summoned); - } - - void SummonedCreatureDespawn(Creature *summon) - { - summons.Despawn(summon); - } - - void KilledUnit(Unit* /*victim*/) - { - DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me); - } - - void JustDied(Unit* /*Killer*/) - { - DoScriptText(SAY_DEAD, me); - summons.DespawnAll(); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (FrostNova_Timer <= diff) - { - if (me->IsNonMeleeSpellCasted(false)) - me->InterruptNonMeleeSpells(true); - - DoCast(me, SPELL_FROSTNOVA); - FrostNova_Timer = 17500 + rand()%7500; - CanBlink = true; - } else FrostNova_Timer -= diff; - - if (Frostbolt_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_FROSTBOLT); - Frostbolt_Timer = 4500 + rand()%1500; - } else Frostbolt_Timer -= diff; - - if (FireBall_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_FIREBALL); - FireBall_Timer = 4500 + rand()%1500; - } else FireBall_Timer -= diff; - - if (CanBlink) - { - if (Blink_Timer <= diff) - { - if (me->IsNonMeleeSpellCasted(false)) - me->InterruptNonMeleeSpells(true); - - //expire movement, will prevent from running right back to victim after cast - //(but should MoveChase be used again at a certain time or should he not move?) - if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE) - me->GetMotionMaster()->MovementExpired(); - - DoCast(me, SPELL_BLINK); - Blink_Timer = 1000 + rand()%1500; - CanBlink = false; - } else Blink_Timer -= diff; - } - - if (Beacon_Timer <= diff) - { - if (me->IsNonMeleeSpellCasted(false)) - me->InterruptNonMeleeSpells(true); - - if (!urand(0,3)) - DoScriptText(SAY_SUMMON, me); - - DoCast(me, SPELL_ETHEREAL_BEACON, true); - - Beacon_Timer = 10000; - } else Beacon_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_nexusprince_shaffar(Creature* pCreature) -{ - return new boss_nexusprince_shaffarAI (pCreature); -} - -enum eEnums -{ - SPELL_ARCANE_BOLT = 15254, - SPELL_ETHEREAL_APPRENTICE = 32372 // Summon 18430 -}; - -struct mob_ethereal_beaconAI : public ScriptedAI -{ - mob_ethereal_beaconAI(Creature *c) : ScriptedAI(c) - { - } - - uint32 Apprentice_Timer; - uint32 ArcaneBolt_Timer; - uint32 Check_Timer; - - void KillSelf() - { - me->Kill(me); - } - - void Reset() - { - Apprentice_Timer = DUNGEON_MODE(20000, 10000); - ArcaneBolt_Timer = 1000; - Check_Timer = 1000; - } - - void EnterCombat(Unit * who) - { - // Send Shaffar to fight - Creature* Shaffar = me->FindNearestCreature(NPC_SHAFFAR, 100); - if (!Shaffar || Shaffar->isDead()) - { - KillSelf(); - return; - } - if (!Shaffar->isInCombat()) - Shaffar->AI()->AttackStart(who); - } - - void JustSummoned(Creature *summoned) - { - summoned->AI()->AttackStart(me->getVictim()); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (Check_Timer <= diff) - { - Creature *Shaffar = me->FindNearestCreature(NPC_SHAFFAR, 100); - if (!Shaffar || Shaffar->isDead() || !Shaffar->isInCombat()) - { - KillSelf(); - return; - } - Check_Timer = 1000; - } else Check_Timer -= diff; - - if (ArcaneBolt_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_ARCANE_BOLT); - ArcaneBolt_Timer = 2000 + rand()%2500; - } else ArcaneBolt_Timer -= diff; - - if (Apprentice_Timer <= diff) - { - if (me->IsNonMeleeSpellCasted(false)) - me->InterruptNonMeleeSpells(true); - - DoCast(me, SPELL_ETHEREAL_APPRENTICE, true); - me->ForcedDespawn(); - return; - } else Apprentice_Timer -= diff; - } -}; - -CreatureAI* GetAI_mob_ethereal_beacon(Creature* pCreature) -{ - return new mob_ethereal_beaconAI (pCreature); -} - -enum eEthereal -{ - SPELL_ETHEREAL_APPRENTICE_FIREBOLT = 32369, - SPELL_ETHEREAL_APPRENTICE_FROSTBOLT = 32370 -}; - -struct mob_ethereal_apprenticeAI : public ScriptedAI -{ - mob_ethereal_apprenticeAI(Creature *c) : ScriptedAI(c) {} - - uint32 Cast_Timer; - - bool isFireboltTurn; - - void Reset() - { - Cast_Timer = 3000; - isFireboltTurn = true; - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (Cast_Timer <= diff) - { - if (isFireboltTurn) - { - DoCast(me->getVictim(), SPELL_ETHEREAL_APPRENTICE_FIREBOLT, true); - isFireboltTurn = false; - }else{ - DoCast(me->getVictim(), SPELL_ETHEREAL_APPRENTICE_FROSTBOLT, true); - isFireboltTurn = true; - } - Cast_Timer = 3000; - } else Cast_Timer -= diff; - } -}; - -CreatureAI* GetAI_mob_ethereal_apprentice(Creature* pCreature) -{ - return new mob_ethereal_apprenticeAI (pCreature); -} - -void AddSC_boss_nexusprince_shaffar() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "boss_nexusprince_shaffar"; - newscript->GetAI = &GetAI_boss_nexusprince_shaffar; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_ethereal_beacon"; - newscript->GetAI = &GetAI_mob_ethereal_beacon; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_ethereal_apprentice"; - newscript->GetAI = &GetAI_mob_ethereal_apprentice; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Outland/auchindoun/mana_tombs/boss_pandemonius.cpp b/src/server/scripts/Outland/auchindoun/mana_tombs/boss_pandemonius.cpp deleted file mode 100644 index 51ec2e83b46..00000000000 --- a/src/server/scripts/Outland/auchindoun/mana_tombs/boss_pandemonius.cpp +++ /dev/null @@ -1,126 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Pandemonius -SD%Complete: 75 -SDComment: Not known how void blast is done (amount of rapid cast seems to be related to players in party). All mobs remaining in surrounding area should aggro when engaged. -SDCategory: Auchindoun, Mana Tombs -EndScriptData */ - -#include "ScriptedPch.h" - -#define SAY_AGGRO_1 -1557008 -#define SAY_AGGRO_2 -1557009 -#define SAY_AGGRO_3 -1557010 - -#define SAY_KILL_1 -1557011 -#define SAY_KILL_2 -1557012 - -#define SAY_DEATH -1557013 - -#define EMOTE_DARK_SHELL -1557014 - -#define SPELL_VOID_BLAST 32325 -#define H_SPELL_VOID_BLAST 38760 -#define SPELL_DARK_SHELL 32358 -#define H_SPELL_DARK_SHELL 38759 - -struct boss_pandemoniusAI : public ScriptedAI -{ - boss_pandemoniusAI(Creature *c) : ScriptedAI(c) - { - } - - uint32 VoidBlast_Timer; - uint32 DarkShell_Timer; - uint32 VoidBlast_Counter; - - void Reset() - { - VoidBlast_Timer = 8000+rand()%15000; - DarkShell_Timer = 20000; - VoidBlast_Counter = 0; - } - - void JustDied(Unit* /*Killer*/) - { - DoScriptText(SAY_DEATH, me); - } - - void KilledUnit(Unit* /*victim*/) - { - DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2), me); - } - - void EnterCombat(Unit * /*who*/) - { - DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3), me); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (VoidBlast_Timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - DoCast(pTarget, SPELL_VOID_BLAST); - VoidBlast_Timer = 500; - ++VoidBlast_Counter; - } - - if (VoidBlast_Counter == 5) - { - VoidBlast_Timer = 15000+rand()%10000; - VoidBlast_Counter = 0; - } - } else VoidBlast_Timer -= diff; - - if (!VoidBlast_Counter) - { - if (DarkShell_Timer <= diff) - { - if (me->IsNonMeleeSpellCasted(false)) - me->InterruptNonMeleeSpells(true); - - DoScriptText(EMOTE_DARK_SHELL, me); - - DoCast(me, SPELL_DARK_SHELL); - DarkShell_Timer = 20000; - } else DarkShell_Timer -= diff; - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_pandemonius(Creature* pCreature) -{ - return new boss_pandemoniusAI (pCreature); -} - -void AddSC_boss_pandemonius() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_pandemonius"; - newscript->GetAI = &GetAI_boss_pandemonius; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Outland/auchindoun/sethekk_halls/boss_darkweaver_syth.cpp b/src/server/scripts/Outland/auchindoun/sethekk_halls/boss_darkweaver_syth.cpp deleted file mode 100644 index 9628fa1a98f..00000000000 --- a/src/server/scripts/Outland/auchindoun/sethekk_halls/boss_darkweaver_syth.cpp +++ /dev/null @@ -1,414 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Darkweaver_Syth -SD%Complete: 85 -SDComment: Shock spells/times need more work. Heroic partly implemented. -SDCategory: Auchindoun, Sethekk Halls -EndScriptData */ - -#include "ScriptedPch.h" - -#define SAY_SUMMON -1556000 - -#define SAY_AGGRO_1 -1556001 -#define SAY_AGGRO_2 -1556002 -#define SAY_AGGRO_3 -1556003 - -#define SAY_SLAY_1 -1556004 -#define SAY_SLAY_2 -1556005 - -#define SAY_DEATH -1556006 - -#define SPELL_FROST_SHOCK 21401 //37865 -#define SPELL_FLAME_SHOCK 34354 -#define SPELL_SHADOW_SHOCK 30138 -#define SPELL_ARCANE_SHOCK 37132 - -#define SPELL_CHAIN_LIGHTNING 15659 //15305 - -#define SPELL_SUMMON_SYTH_FIRE 33537 // Spawns 19203 -#define SPELL_SUMMON_SYTH_ARCANE 33538 // Spawns 19205 -#define SPELL_SUMMON_SYTH_FROST 33539 // Spawns 19204 -#define SPELL_SUMMON_SYTH_SHADOW 33540 // Spawns 19206 - -#define SPELL_FLAME_BUFFET DUNGEON_MODE(33526, 38141) -#define SPELL_ARCANE_BUFFET DUNGEON_MODE(33527, 38138) -#define SPELL_FROST_BUFFET DUNGEON_MODE(33528, 38142) -#define SPELL_SHADOW_BUFFET DUNGEON_MODE(33529, 38143) - -struct boss_darkweaver_sythAI : public ScriptedAI -{ - boss_darkweaver_sythAI(Creature *c) : ScriptedAI(c) - { - } - - uint32 flameshock_timer; - uint32 arcaneshock_timer; - uint32 frostshock_timer; - uint32 shadowshock_timer; - uint32 chainlightning_timer; - - bool summon90; - bool summon50; - bool summon10; - - void Reset() - { - flameshock_timer = 2000; - arcaneshock_timer = 4000; - frostshock_timer = 6000; - shadowshock_timer = 8000; - chainlightning_timer = 15000; - - summon90 = false; - summon50 = false; - summon10 = false; - } - - void EnterCombat(Unit * /*who*/) - { - DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3), me); - } - - void JustDied(Unit* /*Killer*/) - { - DoScriptText(SAY_DEATH, me); - } - - void KilledUnit(Unit* /*victim*/) - { - if (rand()%2) - return; - - DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me); - } - - void JustSummoned(Creature *summoned) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) - summoned->AI()->AttackStart(pTarget); - } - - void SythSummoning() - { - DoScriptText(SAY_SUMMON, me); - - if (me->IsNonMeleeSpellCasted(false)) - me->InterruptNonMeleeSpells(false); - - DoCast(me, SPELL_SUMMON_SYTH_ARCANE, true); //front - DoCast(me, SPELL_SUMMON_SYTH_FIRE, true); //back - DoCast(me, SPELL_SUMMON_SYTH_FROST, true); //left - DoCast(me, SPELL_SUMMON_SYTH_SHADOW, true); //right - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (((me->GetHealth()*100) / me->GetMaxHealth() < 90) && !summon90) - { - SythSummoning(); - summon90 = true; - } - - if (((me->GetHealth()*100) / me->GetMaxHealth() < 50) && !summon50) - { - SythSummoning(); - summon50 = true; - } - - if (((me->GetHealth()*100) / me->GetMaxHealth() < 10) && !summon10) - { - SythSummoning(); - summon10 = true; - } - - if (flameshock_timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(pTarget, SPELL_FLAME_SHOCK); - - flameshock_timer = 10000 + rand()%5000; - } else flameshock_timer -= diff; - - if (arcaneshock_timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(pTarget, SPELL_ARCANE_SHOCK); - - arcaneshock_timer = 10000 + rand()%5000; - } else arcaneshock_timer -= diff; - - if (frostshock_timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(pTarget, SPELL_FROST_SHOCK); - - frostshock_timer = 10000 + rand()%5000; - } else frostshock_timer -= diff; - - if (shadowshock_timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(pTarget, SPELL_SHADOW_SHOCK); - - shadowshock_timer = 10000 + rand()%5000; - } else shadowshock_timer -= diff; - - if (chainlightning_timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(pTarget, SPELL_CHAIN_LIGHTNING); - - chainlightning_timer = 25000; - } else chainlightning_timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_darkweaver_syth(Creature* pCreature) -{ - return new boss_darkweaver_sythAI (pCreature); -} - -/* ELEMENTALS */ - -struct mob_syth_fireAI : public ScriptedAI -{ - mob_syth_fireAI(Creature *c) : ScriptedAI(c) - { - } - - uint32 flameshock_timer; - uint32 flamebuffet_timer; - - void Reset() - { - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true); - flameshock_timer = 2500; - flamebuffet_timer = 5000; - } - - void EnterCombat(Unit * /*who*/) { } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (flameshock_timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(pTarget, SPELL_FLAME_SHOCK); - - flameshock_timer = 5000; - } else flameshock_timer -= diff; - - if (flamebuffet_timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(pTarget, SPELL_FLAME_BUFFET); - - flamebuffet_timer = 5000; - } else flamebuffet_timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_syth_fire(Creature* pCreature) -{ - return new mob_syth_fireAI (pCreature); -} - -struct mob_syth_arcaneAI : public ScriptedAI -{ - mob_syth_arcaneAI(Creature *c) : ScriptedAI(c) - { - } - - uint32 arcaneshock_timer; - uint32 arcanebuffet_timer; - - void Reset() - { - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, true); - arcaneshock_timer = 2500; - arcanebuffet_timer = 5000; - } - - void EnterCombat(Unit * /*who*/) { } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (arcaneshock_timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(pTarget, SPELL_ARCANE_SHOCK); - - arcaneshock_timer = 5000; - } else arcaneshock_timer -= diff; - - if (arcanebuffet_timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(pTarget, SPELL_ARCANE_BUFFET); - - arcanebuffet_timer = 5000; - } else arcanebuffet_timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_syth_arcane(Creature* pCreature) -{ - return new mob_syth_arcaneAI (pCreature); -} - -struct mob_syth_frostAI : public ScriptedAI -{ - mob_syth_frostAI(Creature *c) : ScriptedAI(c) - { - } - - uint32 frostshock_timer; - uint32 frostbuffet_timer; - - void Reset() - { - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true); - frostshock_timer = 2500; - frostbuffet_timer = 5000; - } - - void EnterCombat(Unit * /*who*/) { } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (frostshock_timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(pTarget, SPELL_FROST_SHOCK); - - frostshock_timer = 5000; - } else frostshock_timer -= diff; - - if (frostbuffet_timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(pTarget, SPELL_FROST_BUFFET); - - frostbuffet_timer = 5000; - } else frostbuffet_timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_syth_frost(Creature* pCreature) -{ - return new mob_syth_frostAI (pCreature); -} - -struct mob_syth_shadowAI : public ScriptedAI -{ - mob_syth_shadowAI(Creature *c) : ScriptedAI(c) - { - } - - uint32 shadowshock_timer; - uint32 shadowbuffet_timer; - - void Reset() - { - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, true); - shadowshock_timer = 2500; - shadowbuffet_timer = 5000; - } - - void EnterCombat(Unit * /*who*/) { } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (shadowshock_timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(pTarget, SPELL_SHADOW_SHOCK); - - shadowshock_timer = 5000; - } else shadowshock_timer -= diff; - - if (shadowbuffet_timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(pTarget, SPELL_SHADOW_BUFFET); - - shadowbuffet_timer = 5000; - } else shadowbuffet_timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_syth_shadow(Creature* pCreature) -{ - return new mob_syth_shadowAI (pCreature); -} - -void AddSC_boss_darkweaver_syth() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_darkweaver_syth"; - newscript->GetAI = &GetAI_boss_darkweaver_syth; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_syth_fire"; - newscript->GetAI = &GetAI_mob_syth_arcane; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_syth_arcane"; - newscript->GetAI = &GetAI_mob_syth_arcane; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_syth_frost"; - newscript->GetAI = &GetAI_mob_syth_frost; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_syth_shadow"; - newscript->GetAI = &GetAI_mob_syth_shadow; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Outland/auchindoun/sethekk_halls/boss_tailonking_ikiss.cpp b/src/server/scripts/Outland/auchindoun/sethekk_halls/boss_tailonking_ikiss.cpp deleted file mode 100644 index 32b97293ca3..00000000000 --- a/src/server/scripts/Outland/auchindoun/sethekk_halls/boss_tailonking_ikiss.cpp +++ /dev/null @@ -1,213 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Talon_King_Ikiss -SD%Complete: 80 -SDComment: Heroic supported. Some details missing, but most are spell related. -SDCategory: Auchindoun, Sethekk Halls -EndScriptData */ - -#include "ScriptedPch.h" -#include "sethekk_halls.h" - -#define SAY_INTRO -1556007 - -#define SAY_AGGRO_1 -1556008 -#define SAY_AGGRO_2 -1556009 -#define SAY_AGGRO_3 -1556010 - -#define SAY_SLAY_1 -1556011 -#define SAY_SLAY_2 -1556012 -#define SAY_DEATH -1556013 -#define EMOTE_ARCANE_EXP -1556015 - -#define SPELL_BLINK 38194 -#define SPELL_BLINK_TELEPORT 38203 -#define SPELL_MANA_SHIELD 38151 -#define SPELL_ARCANE_BUBBLE 9438 -#define H_SPELL_SLOW 35032 - -#define SPELL_POLYMORPH 38245 -#define H_SPELL_POLYMORPH 43309 - -#define SPELL_ARCANE_VOLLEY 35059 -#define H_SPELL_ARCANE_VOLLEY 40424 - -#define SPELL_ARCANE_EXPLOSION 38197 -#define H_SPELL_ARCANE_EXPLOSION 40425 - -struct boss_talon_king_ikissAI : public ScriptedAI -{ - boss_talon_king_ikissAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint32 ArcaneVolley_Timer; - uint32 Sheep_Timer; - uint32 Blink_Timer; - uint32 Slow_Timer; - - bool ManaShield; - bool Blink; - bool Intro; - - void Reset() - { - ArcaneVolley_Timer = 5000; - Sheep_Timer = 8000; - Blink_Timer = 35000; - Slow_Timer = 15000+rand()%15000; - Blink = false; - Intro = false; - ManaShield = false; - } - - void MoveInLineOfSight(Unit *who) - { - if (!me->getVictim() && who->isTargetableForAttack() && (me->IsHostileTo(who)) && who->isInAccessiblePlaceFor(me)) - { - if (!Intro && me->IsWithinDistInMap(who, 100)) - { - Intro = true; - DoScriptText(SAY_INTRO, me); - } - - if (!me->canFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) - return; - - float attackRadius = me->GetAttackDistance(who); - if (me->IsWithinDistInMap(who, attackRadius) && me->IsWithinLOSInMap(who)) - { - //who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); - AttackStart(who); - } - } - } - - void EnterCombat(Unit * /*who*/) - { - DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3), me); - } - - void JustDied(Unit* /*Killer*/) - { - DoScriptText(SAY_DEATH, me); - - if (pInstance) - pInstance->SetData(DATA_IKISSDOOREVENT, DONE); - } - - void KilledUnit(Unit* /*victim*/) - { - DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (Blink) - { - DoCast(me, SPELL_ARCANE_EXPLOSION); - DoCast(me, SPELL_ARCANE_BUBBLE, true); - Blink = false; - } - - if (ArcaneVolley_Timer <= diff) - { - DoCast(me, SPELL_ARCANE_VOLLEY); - ArcaneVolley_Timer = 7000+rand()%5000; - } else ArcaneVolley_Timer -= diff; - - if (Sheep_Timer <= diff) - { - Unit *pTarget; - - //second top aggro target in normal, random target in heroic correct? - if (IsHeroic()) - pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); - else - pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO,1); - - if (pTarget) - DoCast(pTarget, SPELL_POLYMORPH); - Sheep_Timer = 15000+rand()%2500; - } else Sheep_Timer -= diff; - - //may not be correct time to cast - if (!ManaShield && ((me->GetHealth()*100) / me->GetMaxHealth() < 20)) - { - DoCast(me, SPELL_MANA_SHIELD); - ManaShield = true; - } - - if (IsHeroic()) - { - if (Slow_Timer <= diff) - { - DoCast(me, H_SPELL_SLOW); - Slow_Timer = 15000+rand()%25000; - } else Slow_Timer -= diff; - } - - if (Blink_Timer <= diff) - { - DoScriptText(EMOTE_ARCANE_EXP, me); - - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) - { - if (me->IsNonMeleeSpellCasted(false)) - me->InterruptNonMeleeSpells(false); - - //Spell doesn't work, but we use for visual effect at least - DoCast(pTarget, SPELL_BLINK); - - float X = pTarget->GetPositionX(); - float Y = pTarget->GetPositionY(); - float Z = pTarget->GetPositionZ(); - - DoTeleportTo(X,Y,Z); - - DoCast(pTarget, SPELL_BLINK_TELEPORT); - Blink = true; - } - Blink_Timer = 35000+rand()%5000; - } else Blink_Timer -= diff; - - if (!Blink) - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_talon_king_ikiss(Creature* pCreature) -{ - return new boss_talon_king_ikissAI (pCreature); -} - -void AddSC_boss_talon_king_ikiss() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_talon_king_ikiss"; - newscript->GetAI = &GetAI_boss_talon_king_ikiss; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Outland/auchindoun/sethekk_halls/instance_sethekk_halls.cpp b/src/server/scripts/Outland/auchindoun/sethekk_halls/instance_sethekk_halls.cpp deleted file mode 100644 index ee27da3cff5..00000000000 --- a/src/server/scripts/Outland/auchindoun/sethekk_halls/instance_sethekk_halls.cpp +++ /dev/null @@ -1,91 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Instance - Sethekk Halls -SD%Complete: 50 -SDComment: Instance Data for Sethekk Halls instance -SDCategory: Auchindoun, Sethekk Halls -EndScriptData */ - -#include "ScriptedPch.h" -#include "sethekk_halls.h" - -enum eEnums -{ - NPC_ANZU = 23035, - IKISS_DOOR = 177203, -}; - -struct instance_sethekk_halls : public ScriptedInstance -{ - instance_sethekk_halls(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint32 AnzuEncounter; - uint64 m_uiIkissDoorGUID; - - void Initialize() - { - AnzuEncounter = NOT_STARTED; - m_uiIkissDoorGUID = 0; - } - - void OnCreatureCreate(Creature* pCreature, bool /*add*/) - { - if (pCreature->GetEntry() == NPC_ANZU) - { - if (AnzuEncounter >= IN_PROGRESS) - pCreature->DisappearAndDie(); - else - AnzuEncounter = IN_PROGRESS; - } - } - - void OnGameObjectCreate(GameObject* pGo, bool /*add*/) - { - if (pGo->GetEntry() == IKISS_DOOR) - m_uiIkissDoorGUID = pGo->GetGUID(); - } - - void SetData(uint32 type, uint32 data) - { - switch(type) - { - case DATA_IKISSDOOREVENT: - if (data == DONE) - DoUseDoorOrButton(m_uiIkissDoorGUID,DAY*IN_MILISECONDS); - break; - case TYPE_ANZU_ENCOUNTER: - AnzuEncounter = data; - break; - } - } -}; - -InstanceData* GetInstanceData_instance_sethekk_halls(Map* pMap) -{ - return new instance_sethekk_halls(pMap); -} - -void AddSC_instance_sethekk_halls() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_sethekk_halls"; - newscript->GetInstanceData = &GetInstanceData_instance_sethekk_halls; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Outland/auchindoun/sethekk_halls/sethekk_halls.h b/src/server/scripts/Outland/auchindoun/sethekk_halls/sethekk_halls.h deleted file mode 100644 index 79a6cd4952d..00000000000 --- a/src/server/scripts/Outland/auchindoun/sethekk_halls/sethekk_halls.h +++ /dev/null @@ -1,14 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ - -#ifndef DEF_SETHEKK_HALLS_H -#define DEF_SETHEKK_HALLS_H - -enum eTypes -{ - DATA_IKISSDOOREVENT = 1, - TYPE_ANZU_ENCOUNTER = 2, -}; -#endif - diff --git a/src/server/scripts/Outland/auchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp b/src/server/scripts/Outland/auchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp deleted file mode 100644 index 2bb6a717a5a..00000000000 --- a/src/server/scripts/Outland/auchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp +++ /dev/null @@ -1,206 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Ambassador_Hellmaw -SD%Complete: 80 -SDComment: Enrage spell missing/not known -SDCategory: Auchindoun, Shadow Labyrinth -EndScriptData */ - -#include "ScriptedPch.h" -#include "ScriptedEscortAI.h" -#include "shadow_labyrinth.h" - -enum eEnums -{ - SAY_INTRO = -1555000, - SAY_AGGRO1 = -1555001, - SAY_AGGRO2 = -1555002, - SAY_AGGRO3 = -1555003, - SAY_HELP = -1555004, - SAY_SLAY1 = -1555005, - SAY_SLAY2 = -1555006, - SAY_DEATH = -1555007, - - SPELL_BANISH = 30231, - SPELL_CORROSIVE_ACID = 33551, - SPELL_FEAR = 33547, - SPELL_ENRAGE = 34970 -}; - -struct boss_ambassador_hellmawAI : public npc_escortAI -{ - boss_ambassador_hellmawAI(Creature* pCreature) : npc_escortAI(pCreature) - { - m_pInstance = pCreature->GetInstanceData(); - } - - ScriptedInstance* m_pInstance; - - uint32 EventCheck_Timer; - uint32 CorrosiveAcid_Timer; - uint32 Fear_Timer; - uint32 Enrage_Timer; - bool Intro; - bool IsBanished; - bool Enraged; - - void Reset() - { - EventCheck_Timer = 5000; - CorrosiveAcid_Timer = 5000 + rand()%5000; - Fear_Timer = 25000 + rand()%5000; - Enrage_Timer = 180000; - Intro = false; - IsBanished = true; - Enraged = false; - - if (m_pInstance && me->isAlive()) - { - if (m_pInstance->GetData(TYPE_OVERSEER) != DONE) - DoCast(me, SPELL_BANISH, true); - } - } - - void JustReachedHome() - { - if (m_pInstance) - m_pInstance->SetData(TYPE_HELLMAW, FAIL); - } - - void MoveInLineOfSight(Unit* pWho) - { - if (me->HasAura(SPELL_BANISH)) - return; - - npc_escortAI::MoveInLineOfSight(pWho); - } - - void WaypointReached(uint32 /*i*/) - { - } - - void DoIntro() - { - if (me->HasAura(SPELL_BANISH)) - me->RemoveAurasDueToSpell(SPELL_BANISH); - - IsBanished = false; - Intro = true; - - if (m_pInstance) - { - if (m_pInstance->GetData(TYPE_HELLMAW) != FAIL) - { - DoScriptText(SAY_INTRO, me); - Start(true, false, 0, NULL, false, true); - } - - m_pInstance->SetData(TYPE_HELLMAW, IN_PROGRESS); - } - } - - void EnterCombat(Unit * /*who*/) - { - DoScriptText(RAND(SAY_AGGRO1,SAY_AGGRO2,SAY_AGGRO3), me); - } - - void KilledUnit(Unit * /*victim*/) - { - DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me); - } - - void JustDied(Unit * /*victim*/) - { - DoScriptText(SAY_DEATH, me); - - if (m_pInstance) - m_pInstance->SetData(TYPE_HELLMAW, DONE); - } - - void UpdateAI(const uint32 diff) - { - if (!Intro && !HasEscortState(STATE_ESCORT_ESCORTING)) - { - if (EventCheck_Timer <= diff) - { - if (m_pInstance) - { - if (m_pInstance->GetData(TYPE_OVERSEER) == DONE) - { - DoIntro(); - return; - } - } - EventCheck_Timer = 5000; - return; - } - else - { - EventCheck_Timer -= diff; - return; - } - } - - npc_escortAI::UpdateAI(diff); - - if (!UpdateVictim()) - return; - - if (me->HasAura(SPELL_BANISH, 0)) - { - EnterEvadeMode(); - return; - } - - if (CorrosiveAcid_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_CORROSIVE_ACID); - CorrosiveAcid_Timer = 15000 + rand()%10000; - } else CorrosiveAcid_Timer -= diff; - - if (Fear_Timer <= diff) - { - DoCast(me, SPELL_FEAR); - Fear_Timer = 20000 + rand()%15000; - } else Fear_Timer -= diff; - - if (IsHeroic()) - { - if (!Enraged && Enrage_Timer <= diff) - { - DoCast(me, SPELL_ENRAGE); - Enraged = true; - } else Enrage_Timer -= diff; - } - } -}; - -CreatureAI* GetAI_boss_ambassador_hellmaw(Creature* pCreature) -{ - return new boss_ambassador_hellmawAI(pCreature); -} - -void AddSC_boss_ambassador_hellmaw() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_ambassador_hellmaw"; - newscript->GetAI = &GetAI_boss_ambassador_hellmaw; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Outland/auchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp b/src/server/scripts/Outland/auchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp deleted file mode 100644 index 52c60ae0d0e..00000000000 --- a/src/server/scripts/Outland/auchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp +++ /dev/null @@ -1,169 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Blackheart_the_Inciter -SD%Complete: 75 -SDComment: Incite Chaos not functional since core lacks Mind Control support -SDCategory: Auchindoun, Shadow Labyrinth -EndScriptData */ - -#include "ScriptedPch.h" -#include "shadow_labyrinth.h" - -#define SPELL_INCITE_CHAOS 33676 -#define SPELL_INCITE_CHAOS_B 33684 //debuff applied to each member of party -#define SPELL_CHARGE 33709 -#define SPELL_WAR_STOMP 33707 - -#define SAY_INTRO1 -1555008 //not used -#define SAY_INTRO2 -1555009 //not used -#define SAY_INTRO3 -1555010 //not used -#define SAY_AGGRO1 -1555011 -#define SAY_AGGRO2 -1555012 -#define SAY_AGGRO3 -1555013 -#define SAY_SLAY1 -1555014 -#define SAY_SLAY2 -1555015 -#define SAY_HELP -1555016 //not used -#define SAY_DEATH -1555017 - -//below, not used -#define SAY2_INTRO1 -1555018 -#define SAY2_INTRO2 -1555019 -#define SAY2_INTRO3 -1555020 -#define SAY2_AGGRO1 -1555021 -#define SAY2_AGGRO2 -1555022 -#define SAY2_AGGRO3 -1555023 -#define SAY2_SLAY1 -1555024 -#define SAY2_SLAY2 -1555025 -#define SAY2_HELP -1555026 -#define SAY2_DEATH -1555027 - -struct boss_blackheart_the_inciterAI : public ScriptedAI -{ - boss_blackheart_the_inciterAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance *pInstance; - - bool InciteChaos; - uint32 InciteChaos_Timer; - uint32 InciteChaosWait_Timer; - uint32 Charge_Timer; - uint32 Knockback_Timer; - - void Reset() - { - InciteChaos = false; - InciteChaos_Timer = 20000; - InciteChaosWait_Timer = 15000; - Charge_Timer = 5000; - Knockback_Timer = 15000; - - if (pInstance) - pInstance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, NOT_STARTED); - } - - void KilledUnit(Unit * /*victim*/) - { - DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me); - } - - void JustDied(Unit * /*victim*/) - { - DoScriptText(SAY_DEATH, me); - - if (pInstance) - pInstance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, DONE); - } - - void EnterCombat(Unit * /*who*/) - { - DoScriptText(RAND(SAY_AGGRO1,SAY_AGGRO2,SAY_AGGRO3), me); - - if (pInstance) - pInstance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, IN_PROGRESS); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - if (InciteChaos) - { - if (InciteChaosWait_Timer <= diff) - { - InciteChaos = false; - InciteChaosWait_Timer = 15000; - } else InciteChaosWait_Timer -= diff; - - return; - } - - if (InciteChaos_Timer <= diff) - { - DoCast(me, SPELL_INCITE_CHAOS); - - std::list t_list = me->getThreatManager().getThreatList(); - for (std::list::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) - { - Unit *pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid()); - if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER) - pTarget->CastSpell(pTarget,SPELL_INCITE_CHAOS_B,true); - } - - DoResetThreat(); - InciteChaos = true; - InciteChaos_Timer = 40000; - return; - } else InciteChaos_Timer -= diff; - - //Charge_Timer - if (Charge_Timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(pTarget, SPELL_CHARGE); - Charge_Timer = 15000 + rand()%10000; - } else Charge_Timer -= diff; - - //Knockback_Timer - if (Knockback_Timer <= diff) - { - DoCast(me, SPELL_WAR_STOMP); - Knockback_Timer = 18000 + rand()%6000; - } else Knockback_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_blackheart_the_inciter(Creature* pCreature) -{ - return new boss_blackheart_the_inciterAI (pCreature); -} - -void AddSC_boss_blackheart_the_inciter() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_blackheart_the_inciter"; - newscript->GetAI = &GetAI_boss_blackheart_the_inciter; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Outland/auchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp b/src/server/scripts/Outland/auchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp deleted file mode 100644 index 8b63b765b47..00000000000 --- a/src/server/scripts/Outland/auchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp +++ /dev/null @@ -1,313 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Grandmaster_Vorpil -SD%Complete: 100 -SDComment: -SDCategory: Auchindoun, Shadow Labyrinth -EndScriptData */ - -#include "ScriptedPch.h" -#include "shadow_labyrinth.h" - -#define SAY_INTRO -1555028 -#define SAY_AGGRO1 -1555029 -#define SAY_AGGRO2 -1555030 -#define SAY_AGGRO3 -1555031 -#define SAY_HELP -1555032 -#define SAY_SLAY1 -1555033 -#define SAY_SLAY2 -1555034 -#define SAY_DEATH -1555035 - -#define SPELL_RAIN_OF_FIRE 33617 -#define H_SPELL_RAIN_OF_FIRE 39363 - -#define SPELL_DRAW_SHADOWS 33563 -#define SPELL_SHADOWBOLT_VOLLEY 33841 -#define SPELL_BANISH 38791 - -#define MOB_VOID_TRAVELER 19226 -#define SPELL_SACRIFICE 33587 -#define SPELL_SHADOW_NOVA 33846 -#define SPELL_EMPOWERING_SHADOWS 33783 -#define H_SPELL_EMPOWERING_SHADOWS 39364 - -#define MOB_VOID_PORTAL 19224 -#define SPELL_VOID_PORTAL_VISUAL 33569 - -float VorpilPosition[3] = {-252.8820,-264.3030,17.1}; - -float VoidPortalCoords[5][3] = -{ - {-283.5894, -239.5718, 12.7}, - {-306.5853, -258.4539, 12.7}, - {-295.8789, -269.0899, 12.7}, - {-209.3401, -262.7564, 17.1}, - {-261.4533, -297.3298, 17.1} -}; - -struct mob_voidtravelerAI : public ScriptedAI -{ - mob_voidtravelerAI(Creature *c) : ScriptedAI(c) - { - } - - uint64 VorpilGUID; - uint32 move; - bool sacrificed; - - void Reset() - { - VorpilGUID = 0; - move = 0; - sacrificed = false; - } - - void EnterCombat(Unit * /*who*/){} - - void UpdateAI(const uint32 diff) - { - if (!VorpilGUID) - { - me->Kill(me); - return; - } - if (move <= diff) - { - Creature *Vorpil = Unit::GetCreature(*me, VorpilGUID); - if (!Vorpil) - { - VorpilGUID = 0; - return; - } - - if (sacrificed) - { - me->AddAura(DUNGEON_MODE(SPELL_EMPOWERING_SHADOWS, H_SPELL_EMPOWERING_SHADOWS), Vorpil); - Vorpil->SetHealth(Vorpil->GetHealth() + Vorpil->GetMaxHealth()/25); - DoCast(me, SPELL_SHADOW_NOVA, true); - me->Kill(me); - return; - } - me->GetMotionMaster()->MoveFollow(Vorpil,0,0); - if (me->IsWithinDist(Vorpil, 3)) - { - DoCast(me, SPELL_SACRIFICE, false); - sacrificed = true; - move = 500; - return; - } - if (!Vorpil->isInCombat() || Vorpil->isDead()) - { - me->Kill(me); - return; - } - move = 1000; - } else move -= diff; - } -}; -CreatureAI* GetAI_mob_voidtraveler(Creature* pCreature) -{ - return new mob_voidtravelerAI (pCreature); -} - -struct boss_grandmaster_vorpilAI : public ScriptedAI -{ - boss_grandmaster_vorpilAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - Intro = false; - } - - ScriptedInstance *pInstance; - bool Intro, HelpYell; - bool sumportals; - - uint32 ShadowBoltVolley_Timer; - uint32 DrawShadows_Timer; - uint32 summonTraveler_Timer; - uint32 banish_Timer; - uint64 PortalsGuid[5]; - - void Reset() - { - ShadowBoltVolley_Timer = 7000 + rand()%7000; - DrawShadows_Timer = 45000; - summonTraveler_Timer = 90000; - banish_Timer = 17000; - HelpYell = false; - destroyPortals(); - - if (pInstance) - pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, NOT_STARTED); - } - - void summonPortals() - { - if (!sumportals) - { - for (uint8 i = 0; i < 5; ++i) - { - Creature *Portal = NULL; - Portal = me->SummonCreature(MOB_VOID_PORTAL,VoidPortalCoords[i][0],VoidPortalCoords[i][1],VoidPortalCoords[i][2],0,TEMPSUMMON_CORPSE_DESPAWN,3000000); - if (Portal) - { - PortalsGuid[i] = Portal->GetGUID(); - Portal->CastSpell(Portal,SPELL_VOID_PORTAL_VISUAL,false); - } - } - sumportals = true; - summonTraveler_Timer = 5000; - } - } - - void destroyPortals() - { - if (sumportals) - { - for (uint8 i = 0; i < 5; ++i) - { - Unit *Portal = Unit::GetUnit((*me), PortalsGuid[i]); - if (Portal && Portal->isAlive()) - Portal->DealDamage(Portal, Portal->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - PortalsGuid[i] = 0; - } - sumportals = false; - } - } - - void spawnVoidTraveler() - { - int pos = urand(0,4); - me->SummonCreature(MOB_VOID_TRAVELER,VoidPortalCoords[pos][0],VoidPortalCoords[pos][1],VoidPortalCoords[pos][2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,5000); - if (!HelpYell) - { - DoScriptText(SAY_HELP, me); - HelpYell = true; - } - } - - void JustSummoned(Creature *summoned) - { - if (summoned && summoned->GetEntry() == MOB_VOID_TRAVELER) - CAST_AI(mob_voidtravelerAI, summoned->AI())->VorpilGUID = me->GetGUID(); - } - - void KilledUnit(Unit * /*victim*/) - { - DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me); - } - - void JustDied(Unit * /*victim*/) - { - DoScriptText(SAY_DEATH, me); - destroyPortals(); - - if (pInstance) - pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, DONE); - } - - void EnterCombat(Unit * /*who*/) - { - DoScriptText(RAND(SAY_AGGRO1,SAY_AGGRO2,SAY_AGGRO3), me); - summonPortals(); - - if (pInstance) - pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, IN_PROGRESS); - } - - void MoveInLineOfSight(Unit *who) - { - ScriptedAI::MoveInLineOfSight(who); - - if (!Intro && me->IsWithinLOSInMap(who)&& me->IsWithinDistInMap(who, 100) && me->IsHostileTo(who)) - { - DoScriptText(SAY_INTRO, me); - Intro = true; - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (ShadowBoltVolley_Timer <= diff) - { - DoCast(me, SPELL_SHADOWBOLT_VOLLEY); - ShadowBoltVolley_Timer = 15000 + rand()%15000; - } else ShadowBoltVolley_Timer -= diff; - - if (IsHeroic() && banish_Timer <= diff) - { - Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0,30,false); - if (pTarget) - { - DoCast(pTarget, SPELL_BANISH); - banish_Timer = 16000; - } - } else banish_Timer -= diff; - - if (DrawShadows_Timer <= diff) - { - Map* pMap = me->GetMap(); - Map::PlayerList const &PlayerList = pMap->GetPlayers(); - for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) - if (Player* i_pl = i->getSource()) - if (i_pl->isAlive() && !i_pl->HasAura(SPELL_BANISH)) - i_pl->TeleportTo(me->GetMapId(), VorpilPosition[0],VorpilPosition[1],VorpilPosition[2], 0, TELE_TO_NOT_LEAVE_COMBAT); - - me->GetMap()->CreatureRelocation(me, VorpilPosition[0],VorpilPosition[1],VorpilPosition[2],0.0f); - DoCast(me, SPELL_DRAW_SHADOWS, true); - - DoCast(me, SPELL_RAIN_OF_FIRE); - - ShadowBoltVolley_Timer = 6000; - DrawShadows_Timer = 30000; - } else DrawShadows_Timer -= diff; - - if (summonTraveler_Timer <= diff) - { - spawnVoidTraveler(); - summonTraveler_Timer = 10000; - //enrage at 20% - if ((me->GetHealth()*5) < me->GetMaxHealth()) - summonTraveler_Timer = 5000; - } else summonTraveler_Timer -=diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_grandmaster_vorpil(Creature* pCreature) -{ - return new boss_grandmaster_vorpilAI (pCreature); -} - -void AddSC_boss_grandmaster_vorpil() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_grandmaster_vorpil"; - newscript->GetAI = &GetAI_boss_grandmaster_vorpil; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_voidtraveler"; - newscript->GetAI = &GetAI_mob_voidtraveler; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Outland/auchindoun/shadow_labyrinth/boss_murmur.cpp b/src/server/scripts/Outland/auchindoun/shadow_labyrinth/boss_murmur.cpp deleted file mode 100644 index 14bf249c3b5..00000000000 --- a/src/server/scripts/Outland/auchindoun/shadow_labyrinth/boss_murmur.cpp +++ /dev/null @@ -1,205 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Murmur -SD%Complete: 90 -SDComment: Timers may be incorrect -SDCategory: Auchindoun, Shadow Labyrinth -EndScriptData */ - -#include "ScriptedPch.h" -#include "shadow_labyrinth.h" - -#define EMOTE_SONIC_BOOM -1555036 - -#define SPELL_SONIC_BOOM_CAST DUNGEON_MODE(33923, 38796) -#define SPELL_SONIC_BOOM_EFFECT DUNGEON_MODE(33666, 38795) -#define SPELL_RESONANCE 33657 -#define SPELL_MURMURS_TOUCH DUNGEON_MODE(33711, 38794) -#define SPELL_MAGNETIC_PULL 33689 -#define SPELL_SONIC_SHOCK 38797 -#define SPELL_THUNDERING_STORM 39365 - -struct boss_murmurAI : public ScriptedAI -{ - boss_murmurAI(Creature *c) : ScriptedAI(c) - { - SetCombatMovement(false); - } - - uint32 SonicBoom_Timer; - uint32 MurmursTouch_Timer; - uint32 Resonance_Timer; - uint32 MagneticPull_Timer; - uint32 SonicShock_Timer; - uint32 ThunderingStorm_Timer; - bool SonicBoom; - - void Reset() - { - SonicBoom_Timer = 30000; - MurmursTouch_Timer = 8000 + rand()%12000; - Resonance_Timer = 5000; - MagneticPull_Timer = 15000 + rand()%15000; - ThunderingStorm_Timer = 15000; - SonicShock_Timer = 10000; - SonicBoom = false; - - //database should have `RegenHealth`=0 to prevent regen - uint32 hp = (me->GetMaxHealth()*40)/100; - if (hp) me->SetHealth(hp); - me->ResetPlayerDamageReq(); - } - - void SonicBoomEffect() - { - std::list t_list = me->getThreatManager().getThreatList(); - for (std::list::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) - { - Unit *pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid()); - if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER) - { - //Not do anything without aura, spell can be resisted! - if (pTarget->HasAura(SPELL_SONIC_BOOM_CAST) && me->IsWithinDistInMap(pTarget, 34.0f)) - { - //This will be wrong calculation. Also, comments suggest it must deal damage - pTarget->SetHealth(uint32(pTarget->GetMaxHealth() - pTarget->GetMaxHealth() * 0.8)); - } - } - } - } - - void EnterCombat(Unit * /*who*/) { } - - // Sonic Boom instant damage (needs core fix instead of this) - void SpellHitTarget(Unit *pTarget, const SpellEntry *spell) - { - if (pTarget && pTarget->isAlive() && spell && spell->Id == uint32(SPELL_SONIC_BOOM_EFFECT)) - me->DealDamage(pTarget,(pTarget->GetHealth()*90)/100,NULL,SPELL_DIRECT_DAMAGE,SPELL_SCHOOL_MASK_NATURE,spell); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target or casting - if (!UpdateVictim() || me->IsNonMeleeSpellCasted(false)) - return; - - // Sonic Boom - if (SonicBoom) - { - DoCast(me, SPELL_SONIC_BOOM_EFFECT, true); - SonicBoomEffect(); - - SonicBoom = false; - Resonance_Timer = 1500; - } - if (SonicBoom_Timer <= diff) - { - DoScriptText(EMOTE_SONIC_BOOM, me); - DoCast(me, SPELL_SONIC_BOOM_CAST); - SonicBoom_Timer = 30000; - SonicBoom = true; - return; - } else SonicBoom_Timer -= diff; - - // Murmur's Touch - if (MurmursTouch_Timer <= diff) - { - if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0,80,true)) - DoCast(pTarget, SPELL_MURMURS_TOUCH); - MurmursTouch_Timer = 25000 + rand()%10000; - } else MurmursTouch_Timer -= diff; - - // Resonance - if (!SonicBoom && !(me->IsWithinMeleeRange(me->getVictim()))) - { - if (Resonance_Timer <= diff) - { - DoCast(me, SPELL_RESONANCE); - Resonance_Timer = 5000; - } else Resonance_Timer -= diff; - } - - // Magnetic Pull - if (MagneticPull_Timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) - if (pTarget->GetTypeId() == TYPEID_PLAYER && pTarget->isAlive()) - { - DoCast(pTarget, SPELL_MAGNETIC_PULL); - MagneticPull_Timer = 15000+rand()%15000; - return; - } - MagneticPull_Timer = 500; - } else MagneticPull_Timer -= diff; - - if (IsHeroic()) - { - // Thundering Storm - if (ThunderingStorm_Timer <= diff) - { - std::list& m_threatlist = me->getThreatManager().getThreatList(); - for (std::list::const_iterator i = m_threatlist.begin(); i != m_threatlist.end(); ++i) - if (Unit *pTarget = Unit::GetUnit((*me),(*i)->getUnitGuid())) - if (pTarget->isAlive() && !me->IsWithinDist(pTarget, 35, false)) - DoCast(pTarget, SPELL_THUNDERING_STORM, true); - ThunderingStorm_Timer = 15000; - } else ThunderingStorm_Timer -= diff; - - // Sonic Shock - if (SonicShock_Timer <= diff) - { - if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0,20,false)) - if (pTarget->isAlive()) - DoCast(pTarget, SPELL_SONIC_SHOCK); - SonicShock_Timer = 10000+rand()%10000; - } else SonicShock_Timer -= diff; - } - - // Select nearest most aggro target if top aggro too far - if (!me->isAttackReady()) - return; - if (!me->IsWithinMeleeRange(me->getVictim())) - { - std::list& m_threatlist = me->getThreatManager().getThreatList(); - for (std::list::const_iterator i = m_threatlist.begin(); i != m_threatlist.end(); ++i) - if (Unit *pTarget = Unit::GetUnit((*me),(*i)->getUnitGuid())) - if (pTarget->isAlive() && me->IsWithinMeleeRange(pTarget)) - { - me->TauntApply(pTarget); - break; - } - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_murmur(Creature* pCreature) -{ - return new boss_murmurAI (pCreature); -} - -void AddSC_boss_murmur() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_murmur"; - newscript->GetAI = &GetAI_boss_murmur; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Outland/auchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp b/src/server/scripts/Outland/auchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp deleted file mode 100644 index 78340e5e132..00000000000 --- a/src/server/scripts/Outland/auchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp +++ /dev/null @@ -1,227 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Instance_Shadow_Labyrinth -SD%Complete: 85 -SDComment: Some cleanup left along with save -SDCategory: Auchindoun, Shadow Labyrinth -EndScriptData */ - -#include "ScriptedPch.h" -#include "shadow_labyrinth.h" - -#define MAX_ENCOUNTER 5 - -#define REFECTORY_DOOR 183296 //door opened when blackheart the inciter dies -#define SCREAMING_HALL_DOOR 183295 //door opened when grandmaster vorpil dies - -/* Shadow Labyrinth encounters: -1 - Ambassador Hellmaw event -2 - Blackheart the Inciter event -3 - Grandmaster Vorpil event -4 - Murmur event -*/ - -struct instance_shadow_labyrinth : public ScriptedInstance -{ - instance_shadow_labyrinth(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - std::string str_data; - - uint64 m_uiRefectoryDoorGUID; - uint64 m_uiScreamingHallDoorGUID; - - uint64 m_uiGrandmasterVorpil; - uint32 m_uiFelOverseerCount; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - m_uiRefectoryDoorGUID = 0; - m_uiScreamingHallDoorGUID = 0; - - m_uiGrandmasterVorpil = 0; - m_uiFelOverseerCount = 0; - } - - bool IsEncounterInProgress() const - { - for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) return true; - - return false; - } - - void OnGameObjectCreate(GameObject* pGo, bool /*add*/) - { - switch(pGo->GetEntry()) - { - case REFECTORY_DOOR: - m_uiRefectoryDoorGUID = pGo->GetGUID(); - if (m_auiEncounter[2] == DONE) - pGo->SetGoState(GO_STATE_ACTIVE); - break; - case SCREAMING_HALL_DOOR: - m_uiScreamingHallDoorGUID = pGo->GetGUID(); - if (m_auiEncounter[3] == DONE) - pGo->SetGoState(GO_STATE_ACTIVE); - break; - } - } - - void OnCreatureCreate(Creature* pCreature, bool /*add*/) - { - switch(pCreature->GetEntry()) - { - case 18732: - m_uiGrandmasterVorpil = pCreature->GetGUID(); - break; - case 18796: - if (pCreature->isAlive()) - { - ++m_uiFelOverseerCount; - debug_log("TSCR: Shadow Labyrinth: counting %u Fel Overseers.",m_uiFelOverseerCount); - } - break; - } - } - - void SetData(uint32 type, uint32 uiData) - { - switch(type) - { - case TYPE_HELLMAW: - m_auiEncounter[0] = uiData; - break; - - case TYPE_OVERSEER: - if (uiData != DONE) - { - error_log("TSCR: Shadow Labyrinth: TYPE_OVERSEER did not expect other data than DONE"); - return; - } - if (m_uiFelOverseerCount) - { - --m_uiFelOverseerCount; - - if (m_uiFelOverseerCount) - debug_log("TSCR: Shadow Labyrinth: %u Fel Overseers left to kill.",m_uiFelOverseerCount); - else - { - m_auiEncounter[1] = DONE; - debug_log("TSCR: Shadow Labyrinth: TYPE_OVERSEER == DONE"); - } - } - break; - - case DATA_BLACKHEARTTHEINCITEREVENT: - if (uiData == DONE) - DoUseDoorOrButton(m_uiRefectoryDoorGUID); - m_auiEncounter[2] = uiData; - break; - - case DATA_GRANDMASTERVORPILEVENT: - if (uiData == DONE) - DoUseDoorOrButton(m_uiScreamingHallDoorGUID); - m_auiEncounter[3] = uiData; - break; - - case DATA_MURMUREVENT: - m_auiEncounter[4] = uiData; - break; - } - - if (uiData == DONE) - { - if (type == TYPE_OVERSEER && m_uiFelOverseerCount != 0) - return; - - OUT_SAVE_INST_DATA; - - std::ostringstream saveStream; - saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " - << m_auiEncounter[2] << " " << m_auiEncounter[3] << " " << m_auiEncounter[4]; - - str_data = saveStream.str(); - - SaveToDB(); - OUT_SAVE_INST_DATA_COMPLETE; - } - } - - uint32 GetData(uint32 type) - { - switch(type) - { - case TYPE_HELLMAW: return m_auiEncounter[0]; - case TYPE_OVERSEER: return m_auiEncounter[1]; - case DATA_GRANDMASTERVORPILEVENT: return m_auiEncounter[3]; - case DATA_MURMUREVENT: return m_auiEncounter[4]; - } - return false; - } - - uint64 GetData64(uint32 identifier) - { - if (identifier == DATA_GRANDMASTERVORPIL) - return m_uiGrandmasterVorpil; - - return 0; - } - - std::string GetSaveData() - { - return str_data; - } - - void Load(const char* in) - { - if (!in) - { - OUT_LOAD_INST_DATA_FAIL; - return; - } - - OUT_LOAD_INST_DATA(in); - - std::istringstream loadStream(in); - loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3] >> m_auiEncounter[4]; - - for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) - m_auiEncounter[i] = NOT_STARTED; - - OUT_LOAD_INST_DATA_COMPLETE; - } -}; - -InstanceData* GetInstanceData_instance_shadow_labyrinth(Map* pMap) -{ - return new instance_shadow_labyrinth(pMap); -} - -void AddSC_instance_shadow_labyrinth() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_shadow_labyrinth"; - newscript->GetInstanceData = &GetInstanceData_instance_shadow_labyrinth; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Outland/auchindoun/shadow_labyrinth/shadow_labyrinth.h b/src/server/scripts/Outland/auchindoun/shadow_labyrinth/shadow_labyrinth.h deleted file mode 100644 index a78955368bf..00000000000 --- a/src/server/scripts/Outland/auchindoun/shadow_labyrinth/shadow_labyrinth.h +++ /dev/null @@ -1,15 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ - -#ifndef DEF_SHADOW_LABYRINTH_H -#define DEF_SHADOW_LABYRINTH_H - -#define TYPE_HELLMAW 1 -#define TYPE_OVERSEER 2 -#define DATA_BLACKHEARTTHEINCITEREVENT 3 -#define DATA_GRANDMASTERVORPILEVENT 4 -#define DATA_MURMUREVENT 5 -#define DATA_GRANDMASTERVORPIL 6 -#endif - diff --git a/src/server/scripts/Outland/black_temple/black_temple.cpp b/src/server/scripts/Outland/black_temple/black_temple.cpp deleted file mode 100644 index c1e7f19fbb1..00000000000 --- a/src/server/scripts/Outland/black_temple/black_temple.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Black_Temple -SD%Complete: 95 -SDComment: Spirit of Olum: Player Teleporter to Seer Kanai Teleport after defeating Naj'entus and Supremus. TODO: Find proper gossip. -SDCategory: Black Temple -EndScriptData */ - -/* ContentData -npc_spirit_of_olum -EndContentData */ - -#include "ScriptedPch.h" -#include "black_temple.h" - -/*### -# npc_spirit_of_olum -####*/ - -#define SPELL_TELEPORT 41566 // s41566 - Teleport to Ashtongue NPC's -#define GOSSIP_OLUM1 "Teleport me to the other Ashtongue Deathsworn" - -bool GossipHello_npc_spirit_of_olum(Player* pPlayer, Creature* pCreature) -{ - ScriptedInstance* pInstance = pCreature->GetInstanceData(); - - if (pInstance && (pInstance->GetData(DATA_SUPREMUSEVENT) >= DONE) && (pInstance->GetData(DATA_HIGHWARLORDNAJENTUSEVENT) >= DONE)) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_OLUM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - - pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); - return true; -} - -bool GossipSelect_npc_spirit_of_olum(Player* pPlayer, Creature* /*pCreature*/, uint32 /*uiSender*/, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) - pPlayer->CLOSE_GOSSIP_MENU(); - - pPlayer->InterruptNonMeleeSpells(false); - pPlayer->CastSpell(pPlayer, SPELL_TELEPORT, false); - return true; -} - -void AddSC_black_temple() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "npc_spirit_of_olum"; - newscript->pGossipHello = &GossipHello_npc_spirit_of_olum; - newscript->pGossipSelect = &GossipSelect_npc_spirit_of_olum; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Outland/black_temple/black_temple.h b/src/server/scripts/Outland/black_temple/black_temple.h deleted file mode 100644 index b7432cd5b20..00000000000 --- a/src/server/scripts/Outland/black_temple/black_temple.h +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ - -#ifndef DEF_BLACK_TEMPLE_H -#define DEF_BLACK_TEMPLE_H - -enum eTypes -{ - DATA_AKAMA = 1, - DATA_AKAMA_SHADE = 2, - DATA_GURTOGGBLOODBOILEVENT = 3, - DATA_HIGHWARLORDNAJENTUS = 4, - DATA_HIGHWARLORDNAJENTUSEVENT = 5, - DATA_ILLIDANSTORMRAGE = 6, - DATA_ILLIDANSTORMRAGEEVENT = 7, - DATA_ILLIDARICOUNCILEVENT = 8, - DATA_ILLIDARICOUNCIL = 9, - DATA_LADYMALANDE = 10, - DATA_HIGHNETHERMANCERZEREVOR = 11, - DATA_GATHIOSTHESHATTERER = 12, - DATA_VERASDARKSHADOW = 13, - DATA_MOTHERSHAHRAZEVENT = 14, - DATA_RELIQUARYOFSOULSEVENT = 15, - DATA_SHADEOFAKAMA = 16, - DATA_SHADEOFAKAMAEVENT = 17, - DATA_SUPREMUS = 18, - DATA_SUPREMUSEVENT = 19, - DATA_TERONGOREFIENDEVENT = 20, - DATA_GAMEOBJECT_NAJENTUS_GATE = 21, - DATA_GAMEOBJECT_ILLIDAN_GATE = 22, - DATA_GAMEOBJECT_ILLIDAN_DOOR_R = 23, - DATA_GAMEOBJECT_ILLIDAN_DOOR_L = 24, - DATA_GAMEOBJECT_SUPREMUS_DOORS = 25, - DATA_BLOOD_ELF_COUNCIL_VOICE = 26 -}; - -#endif - diff --git a/src/server/scripts/Outland/black_temple/boss_bloodboil.cpp b/src/server/scripts/Outland/black_temple/boss_bloodboil.cpp deleted file mode 100644 index 1093ce06cb8..00000000000 --- a/src/server/scripts/Outland/black_temple/boss_bloodboil.cpp +++ /dev/null @@ -1,332 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Bloodboil -SD%Complete: 80 -SDComment: Bloodboil not working correctly, missing enrage -SDCategory: Black Temple -EndScriptData */ - -#include "ScriptedPch.h" -#include "black_temple.h" - -//Speech'n'Sound -#define SAY_AGGRO -1564029 -#define SAY_SLAY1 -1564030 -#define SAY_SLAY2 -1564031 -#define SAY_SPECIAL1 -1564032 -#define SAY_SPECIAL2 -1564033 -#define SAY_ENRAGE1 -1564034 -#define SAY_ENRAGE2 -1564035 -#define SAY_DEATH -1564036 - -//Spells -#define SPELL_ACID_GEYSER 40630 -#define SPELL_ACIDIC_WOUND 40481 -#define SPELL_ARCING_SMASH 40599 -#define SPELL_BLOODBOIL 42005 // This spell is AoE whereas it shouldn't be -#define SPELL_FEL_ACID 40508 -#define SPELL_FEL_RAGE_SELF 40594 -#define SPELL_FEL_RAGE_TARGET 40604 -#define SPELL_FEL_RAGE_2 40616 -#define SPELL_FEL_RAGE_3 41625 -#define SPELL_BEWILDERING_STRIKE 40491 -#define SPELL_EJECT1 40486 // 1000 Physical damage + knockback + script effect (should handle threat reduction I think) -#define SPELL_EJECT2 40597 // 1000 Physical damage + Stun (used in phase 2?) -#define SPELL_TAUNT_GURTOGG 40603 -#define SPELL_INSIGNIFIGANCE 40618 -#define SPELL_BERSERK 45078 - -//This is used to sort the players by distance in preparation for the Bloodboil cast. - -struct boss_gurtogg_bloodboilAI : public ScriptedAI -{ - boss_gurtogg_bloodboilAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint64 TargetGUID; - - float TargetThreat; - - uint32 BloodboilTimer; - uint32 BloodboilCount; - uint32 AcidGeyserTimer; - uint32 AcidicWoundTimer; - uint32 ArcingSmashTimer; - uint32 EnrageTimer; - uint32 FelAcidTimer; - uint32 EjectTimer; - uint32 BewilderingStrikeTimer; - uint32 PhaseChangeTimer; - - bool Phase1; - - void Reset() - { - if (pInstance) - pInstance->SetData(DATA_GURTOGGBLOODBOILEVENT, NOT_STARTED); - - TargetGUID = 0; - - TargetThreat = 0; - - BloodboilTimer = 10000; - BloodboilCount = 0; - AcidGeyserTimer = 1000; - AcidicWoundTimer = 6000; - ArcingSmashTimer = 19000; - EnrageTimer = 600000; - FelAcidTimer = 25000; - EjectTimer = 10000; - BewilderingStrikeTimer = 15000; - PhaseChangeTimer = 60000; - - Phase1 = true; - - me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, false); - me->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, false); - } - - void EnterCombat(Unit * /*who*/) - { - DoZoneInCombat(); - DoScriptText(SAY_AGGRO, me); - if (pInstance) - pInstance->SetData(DATA_GURTOGGBLOODBOILEVENT, IN_PROGRESS); - } - - void KilledUnit(Unit * /*victim*/) - { - DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me); - } - - void JustDied(Unit * /*victim*/) - { - if (pInstance) - pInstance->SetData(DATA_GURTOGGBLOODBOILEVENT, DONE); - - DoScriptText(SAY_DEATH, me); - } - - // Note: This seems like a very complicated fix. The fix needs to be handled by the core, as implementation of limited-target AoE spells are still not limited. - void CastBloodboil() - { - // Get the Threat List - std::list m_threatlist = me->getThreatManager().getThreatList(); - - if (!m_threatlist.size()) // He doesn't have anyone in his threatlist, useless to continue - return; - - std::list targets; - std::list::const_iterator itr = m_threatlist.begin(); - for (; itr!= m_threatlist.end(); ++itr) //store the threat list in a different container - { - Unit *pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid()); - //only on alive players - if (pTarget && pTarget->isAlive() && pTarget->GetTypeId() == TYPEID_PLAYER) - targets.push_back(pTarget); - } - - //Sort the list of players - targets.sort(Trinity::ObjectDistanceOrderPred(me, false)); - //Resize so we only get top 5 - targets.resize(5); - - //Aura each player in the targets list with Bloodboil. Aura code copied+pasted from Aura command in Level3.cpp - /*SpellEntry const *spellInfo = GetSpellStore()->LookupEntry(SPELL_BLOODBOIL); - if (spellInfo) - { - for (std::list::const_iterator itr = targets.begin(); itr != targets.end(); ++itr) - { - Unit *pTarget = *itr; - if (!pTarget) return; - for (uint32 i = 0; i<3; ++i) - { - uint8 eff = spellInfo->Effect[i]; - if (eff >= TOTAL_SPELL_EFFECTS) - continue; - - Aura *Aur = new Aura(spellInfo, i, pTarget, pTarget, pTarget); - pTarget->AddAura(Aur); - } - } - }*/ - } - - void RevertThreatOnTarget(uint64 guid) - { - Unit* pUnit = NULL; - pUnit = Unit::GetUnit((*me), guid); - if (pUnit) - { - if (DoGetThreat(pUnit)) - DoModifyThreatPercent(pUnit, -100); - if (TargetThreat) - me->AddThreat(pUnit, TargetThreat); - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (ArcingSmashTimer <= diff) - { - DoCast(me->getVictim(), SPELL_ARCING_SMASH); - ArcingSmashTimer = 10000; - } else ArcingSmashTimer -= diff; - - if (FelAcidTimer <= diff) - { - DoCast(me->getVictim(), SPELL_FEL_ACID); - FelAcidTimer = 25000; - } else FelAcidTimer -= diff; - - if (!me->HasAura(SPELL_BERSERK)) - { - if (EnrageTimer <= diff) - { - DoCast(me, SPELL_BERSERK); - DoScriptText(RAND(SAY_ENRAGE1,SAY_ENRAGE2), me); - } else EnrageTimer -= diff; - } - - if (Phase1) - { - if (BewilderingStrikeTimer <= diff) - { - DoCast(me->getVictim(), SPELL_BEWILDERING_STRIKE); - float mt_threat = DoGetThreat(me->getVictim()); - if (Unit *pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO, 1)) - me->AddThreat(pTarget, mt_threat); - BewilderingStrikeTimer = 20000; - } else BewilderingStrikeTimer -= diff; - - if (EjectTimer <= diff) - { - DoCast(me->getVictim(), SPELL_EJECT1); - DoModifyThreatPercent(me->getVictim(), -40); - EjectTimer = 15000; - } else EjectTimer -= diff; - - if (AcidicWoundTimer <= diff) - { - DoCast(me->getVictim(), SPELL_ACIDIC_WOUND); - AcidicWoundTimer = 10000; - } else AcidicWoundTimer -= diff; - - if (BloodboilTimer <= diff) - { - if (BloodboilCount < 5) // Only cast it five times. - { - //CastBloodboil(); // Causes issues on windows, so is commented out. - DoCast(me->getVictim(), SPELL_BLOODBOIL); - ++BloodboilCount; - BloodboilTimer = 10000*BloodboilCount; - } - } else BloodboilTimer -= diff; - } - - if (!Phase1) - { - if (AcidGeyserTimer <= diff) - { - DoCast(me->getVictim(), SPELL_ACID_GEYSER); - AcidGeyserTimer = 30000; - } else AcidGeyserTimer -= diff; - - if (EjectTimer <= diff) - { - DoCast(me->getVictim(), SPELL_EJECT2); - EjectTimer = 15000; - } else EjectTimer -= diff; - } - - if (PhaseChangeTimer <= diff) - { - if (Phase1) - { - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (pTarget && pTarget->isAlive()) - { - Phase1 = false; - - TargetThreat = DoGetThreat(pTarget); - TargetGUID = pTarget->GetGUID(); - pTarget->CastSpell(me, SPELL_TAUNT_GURTOGG, true); - if (DoGetThreat(pTarget)) - DoModifyThreatPercent(pTarget, -100); - me->AddThreat(pTarget, 50000000.0f); - me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true); - me->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true); - // If VMaps are disabled, this spell can call the whole instance - DoCast(me, SPELL_INSIGNIFIGANCE, true); - DoCast(pTarget, SPELL_FEL_RAGE_TARGET, true); - DoCast(pTarget, SPELL_FEL_RAGE_2, true); - /* These spells do not work, comment them out for now. - DoCast(pTarget, SPELL_FEL_RAGE_2, true); - DoCast(pTarget, SPELL_FEL_RAGE_3, true);*/ - - //Cast this without triggered so that it appears in combat logs and shows visual. - DoCast(me, SPELL_FEL_RAGE_SELF); - - DoScriptText(RAND(SAY_SPECIAL1,SAY_SPECIAL2), me); - - AcidGeyserTimer = 1000; - PhaseChangeTimer = 30000; - } - } else // Encounter is a loop pretty much. Phase 1 -> Phase 2 -> Phase 1 -> Phase 2 till death or enrage - { - if (TargetGUID) - RevertThreatOnTarget(TargetGUID); - TargetGUID = 0; - Phase1 = true; - BloodboilTimer = 10000; - BloodboilCount = 0; - AcidicWoundTimer += 2000; - ArcingSmashTimer += 2000; - FelAcidTimer += 2000; - EjectTimer += 2000; - PhaseChangeTimer = 60000; - me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, false); - me->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, false); - } - } else PhaseChangeTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_gurtogg_bloodboil(Creature* pCreature) -{ - return new boss_gurtogg_bloodboilAI (pCreature); -} - -void AddSC_boss_gurtogg_bloodboil() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_gurtogg_bloodboil"; - newscript->GetAI = &GetAI_boss_gurtogg_bloodboil; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Outland/black_temple/boss_illidan.cpp b/src/server/scripts/Outland/black_temple/boss_illidan.cpp deleted file mode 100644 index b8e09c0e08e..00000000000 --- a/src/server/scripts/Outland/black_temple/boss_illidan.cpp +++ /dev/null @@ -1,2248 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -/* ScriptData -SDName: boss_illidan_stormrage -SD%Complete: 90 -SDComment: Somewhat of a workaround for Parasitic Shadowfiend, unable to summon GOs for Cage Trap. -SDCategory: Black Temple -EndScriptData */ - -#include "ScriptedPch.h" -#include "black_temple.h" - -#define GETGO(obj, guid) GameObject* obj = pInstance->instance->GetGameObject(guid) -#define GETUNIT(unit, guid) Unit* unit = Unit::GetUnit(*me, guid) -#define GETCRE(cre, guid) Creature* cre = Unit::GetCreature(*me, guid) -#define HPPCT(unit) unit->GetHealth()*100 / unit->GetMaxHealth() - -/************* Quotes and Sounds ***********************/ -// Gossip for when a player clicks Akama -#define GOSSIP_ITEM "We are ready to face Illidan" - -// Yells for/by Akama -#define SAY_AKAMA_BEWARE "Be wary friends, The Betrayer meditates in the court just beyond." -#define SOUND_AKAMA_BEWARE 11388 -#define SAY_AKAMA_MINION "Come, my minions. Deal with this traitor as he deserves!" -#define SOUND_AKAMA_MINION 11465 -#define SAY_AKAMA_LEAVE "I'll deal with these mongrels. Strike now, friends! Strike at the betrayer!" -#define SOUND_AKAMA_LEAVE 11390 - -// Self explanatory -const char* SAY_KILL1 = "Who shall be next to taste my blades?!"; -#define SOUND_KILL1 11473 -const char* SAY_KILL2 = "This is too easy!"; -#define SOUND_KILL2 11472 - -// I think I'll fly now and let my subordinates take you on -#define SAY_TAKEOFF "I will not be touched by rabble such as you!" -#define SOUND_TAKEOFF 11479 -#define SAY_SUMMONFLAMES "Behold the flames of Azzinoth!" -#define SOUND_SUMMONFLAMES 11480 - -// When casting Eye Blast. Demon Fire will be appear on places that he casts this -#define SAY_EYE_BLAST "Stare into the eyes of the Betrayer!" -#define SOUND_EYE_BLAST 11481 - -// kk, I go big, dark and demon on you. -#define SAY_MORPH "Behold the power... of the demon within!" -#define SOUND_MORPH 11475 - -// I KILL! -#define SAY_ENRAGE "You've wasted too much time mortals, now you shall fall!" -#define SOUND_ENRAGE 11474 - -/************** Spells *************/ -// Normal Form -#define SPELL_SHEAR 37335 // 41032 is bugged, cannot be block/dodge/parry// Reduces Max. Health by 60% for 7 seconds. Can stack 19 times. 1.5 second cast -#define SPELL_FLAME_CRASH 40832 // Summons an invis/unselect passive mob that has an aura of flame in a circle around him. -#define SPELL_DRAW_SOUL 40904 // 5k Shadow Damage in front of him. Heals Illidan for 100k health (script effect) -#define SPELL_PARASITIC_SHADOWFIEND 41917 // DoT of 3k Shadow every 2 seconds. Lasts 10 seconds. (Script effect: Summon 2 parasites once the debuff has ticked off) -#define SPELL_PARASITIC_SHADOWFIEND2 41914 // Used by Parasitic -#define SPELL_SUMMON_PARASITICS 41915 // Summons 2 Parasitic Shadowfiends on the target. It's supposed to be cast as soon as the Parasitic Shadowfiend debuff is gone, but the spells aren't linked :( -#define SPELL_AGONIZING_FLAMES 40932 // 4k fire damage initial to target and anyone w/i 5 yards. PHASE 3 ONLY -#define SPELL_ENRAGE 40683 // Increases damage by 50% and attack speed by 30%. 20 seconds, PHASE 5 ONLY -// Flying (Phase 2) -#define SPELL_THROW_GLAIVE 39635 // Throws a glaive on the ground -#define SPELL_THROW_GLAIVE2 39849 // Animation for the above spell -#define SPELL_GLAIVE_RETURNS 39873 // Glaive flies back to Illidan -#define SPELL_FIREBALL 40598 // 2.5k-3.5k damage in 10 yard radius. 2 second cast time. -#define SPELL_DARK_BARRAGE 40585 // 10 second channeled spell, 3k shadow damage per second. -// Demon Form -#define SPELL_DEMON_TRANSFORM_1 40511 // First phase of animations for transforming into Dark Illidan (fall to ground) -#define SPELL_DEMON_TRANSFORM_2 40398 // Second phase of animations (kneel) -#define SPELL_DEMON_TRANSFORM_3 40510 // Final phase of animations (stand up and roar) -#define SPELL_DEMON_FORM 40506 // Transforms into Demon Illidan. Has an Aura of Dread on him. -#define SPELL_SHADOW_BLAST 41078 // 8k - 11k Shadow Damage. Targets highest threat. Has a splash effect, damaging anyone in 20 yards of the target. -#define SPELL_FLAME_BURST 41126 // Hurls fire at entire raid for ~3.5k damage every 10 seconds. Resistable. (Does not work: Script effect) -#define SPELL_FLAME_BURST_EFFECT 41131 // The actual damage. Have each player cast it on itself (workaround) -// Other Illidan spells -#define SPELL_KNEEL 39656 // Before beginning encounter, this is how he appears (talking to skully). -#define SPELL_SHADOW_PRISON 40647 // Illidan casts this spell to immobilize entire raid when he summons Maiev. -#define SPELL_DEATH 41220 // This spell doesn't do anything except stun Illidan and set him on his knees. -#define SPELL_BERSERK 45078 // Damage increased by 500%, attack speed by 150% -#define SPELL_DUAL_WIELD 42459 -//Phase Normal spells -#define SPELL_FLAME_CRASH_EFFECT 40836 // Firey blue ring of circle that the other flame crash summons -#define SPELL_SUMMON_SHADOWDEMON 41117 // Summon four shadowfiends -#define SPELL_SHADOWFIEND_PASSIVE 41913 // Passive aura for shadowfiends -#define SPELL_SHADOW_DEMON_PASSIVE 41079 // Adds the "shadowform" aura to Shadow Demons. -#define SPELL_CONSUME_SOUL 41080 // Once the Shadow Demons reach their target, they use this to kill them -#define SPELL_PARALYZE 41083 // Shadow Demons cast this on their target -#define SPELL_PURPLE_BEAM 39123 // Purple Beam connecting Shadow Demon to their target -//Phase Flight spells -#define SPELL_AZZINOTH_CHANNEL 39857 // Glaives cast it on Flames. Not sure if this is the right spell. -#define SPELL_EYE_BLAST_TRIGGER 40017 // This summons Demon Form every few seconds and deals ~20k damage in its radius -#define SPELL_EYE_BLAST 39908 // This does the blue flamey animation. -#define SPELL_BLAZE_EFFECT 40610 // Green flame on the ground, triggers damage (5k) every few seconds -#define SPELL_BLAZE_SUMMON 40637 // Summons the Blaze creature -#define SPELL_DEMON_FIRE 40029 // Blue fire trail left by Eye Blast. Deals 2k per second if players stand on it. -#define SPELL_FLAME_BLAST 40631 // Flames of Azzinoth use this. Frontal cone AoE 7k-9k damage. -#define SPELL_CHARGE 41581 //40602 // Flames of Azzinoth charges whoever is too far from them. They enrage after this. For simplicity, we'll use the same enrage as Illidan. -#define SPELL_FLAME_ENRAGE 45078 -//Akama spells -#define SPELL_AKAMA_DOOR_CHANNEL 41268 // Akama's channel spell on the door before the Temple Summit -#define SPELL_DEATHSWORN_DOOR_CHANNEL 41269 // Olum and Udalo's channel spell on the door before the Temple Summit -#define SPELL_AKAMA_DOOR_FAIL 41271 // Not sure where this is really used... -#define SPELL_HEALING_POTION 40535 // Akama uses this to heal himself to full. -#define SPELL_CHAIN_LIGHTNING 40536 // 6938 to 8062 for 5 targets -//Maiev spells -#define SPELL_CAGE_TRAP_DUMMY 40761 // Put this in DB for cage trap GO. -#define SPELL_CAGED 40695 // Caged Trap triggers will cast this on Illidan if he is within 3 yards -#define SPELL_CAGE_TRAP_SUMMON 40694 // Summons a Cage Trap GO (bugged) on the ground along with a Cage Trap Disturb Trigger mob (working) -#define SPELL_CAGE_TRAP_BEAM 40713 // 8 Triggers on the ground in an octagon cast spells like this on Illidan 'caging him' -#define SPELL_TELEPORT_VISUAL 41232 // Teleport visual for Maiev -#define SPELL_SHADOW_STRIKE 40685 // 4375 to 5625 every 3 seconds for 12 seconds -#define SPELL_THROW_DAGGER 41152 // 5400 to 6600 damage, need dagger -#define SPELL_FAN_BLADES 39954 // bugged visual - -// Other defines -#define CENTER_X 676.740 -#define CENTER_Y 305.297 -#define CENTER_Z 353.192 - -#define FLAME_ENRAGE_DISTANCE 30 -#define FLAME_CHARGE_DISTANCE 50 - -#define EQUIP_ID_MAIN_HAND 32837 -#define EQUIP_ID_OFF_HAND 32838 - -/**** Creature Summon and Recognition IDs ****/ -enum CreatureEntry -{ - EMPTY = 0, - AKAMA = 22990, - ILLIDAN_STORMRAGE = 22917, - BLADE_OF_AZZINOTH = 22996, - FLAME_OF_AZZINOTH = 22997, - MAIEV_SHADOWSONG = 23197, - SHADOW_DEMON = 23375, - DEMON_FIRE = 23069, - FLAME_CRASH = 23336, - ILLIDAN_DOOR_TRIGGER = 23412, - SPIRIT_OF_OLUM = 23411, - SPIRIT_OF_UDALO = 23410, - ILLIDARI_ELITE = 23226, - PARASITIC_SHADOWFIEND = 23498, - CAGE_TRAP_TRIGGER = 23292, -}; - -/*** Phase Names ***/ -enum PhaseIllidan -{ - PHASE_ILLIDAN_NULL = 0, - PHASE_NORMAL = 1, - PHASE_FLIGHT = 2, - PHASE_NORMAL_2 = 3, - PHASE_DEMON = 4, - PHASE_NORMAL_MAIEV = 5, - PHASE_TALK_SEQUENCE = 6, - PHASE_FLIGHT_SEQUENCE = 7, - PHASE_TRANSFORM_SEQUENCE = 8, - PHASE_ILLIDAN_MAX = 9, -};//Maiev uses the same phase - -enum PhaseAkama -{ - PHASE_AKAMA_NULL = 0, - PHASE_CHANNEL = 1, - PHASE_WALK = 2, - PHASE_TALK = 3, - PHASE_FIGHT_ILLIDAN = 4, - PHASE_FIGHT_MINIONS = 5, - PHASE_RETURN = 6, -}; - -enum EventIllidan -{ - EVENT_NULL = 0, - EVENT_BERSERK = 1, - //normal phase - EVENT_TAUNT = 2, - EVENT_SHEAR = 3, - EVENT_FLAME_CRASH = 4, - EVENT_PARASITIC_SHADOWFIEND = 5, - EVENT_PARASITE_CHECK = 6, - EVENT_DRAW_SOUL = 7, - EVENT_AGONIZING_FLAMES = 8, - EVENT_TRANSFORM_NORMAL = 9, - EVENT_ENRAGE = 10, - //flight phase - EVENT_FIREBALL = 2, - EVENT_DARK_BARRAGE = 3, - EVENT_EYE_BLAST = 4, - EVENT_MOVE_POINT = 5, - //demon phase - EVENT_SHADOW_BLAST = 2, - EVENT_FLAME_BURST = 3, - EVENT_SHADOWDEMON = 4, - EVENT_TRANSFORM_DEMON = 5, - //sequence phase - EVENT_TALK_SEQUENCE = 2, - EVENT_FLIGHT_SEQUENCE = 2, - EVENT_TRANSFORM_SEQUENCE = 2, -}; - -enum EventMaiev -{ - EVENT_MAIEV_NULL = 0, - EVENT_MAIEV_STEALTH = 1, - EVENT_MAIEV_TAUNT = 2, - EVENT_MAIEV_SHADOW_STRIKE = 3, - EVENT_MAIEV_THROW_DAGGER = 4, - EVENT_MAIEV_TRAP = 4, -}; - -static EventIllidan MaxTimer[]= -{ - EVENT_NULL, - EVENT_DRAW_SOUL, - EVENT_MOVE_POINT, - EVENT_TRANSFORM_NORMAL, - EVENT_TRANSFORM_DEMON, - EVENT_ENRAGE, - EVENT_TALK_SEQUENCE, - EVENT_FLIGHT_SEQUENCE, - EVENT_TRANSFORM_SEQUENCE -}; - -struct Yells -{ - uint32 sound; - char* text; - uint32 pCreature, timer, emote; - bool Talk; -}; - -static Yells Conversation[]= -{ - {11463, "Akama... your duplicity is hardly surprising. I should have slaughtered you and your malformed brethren long ago.", ILLIDAN_STORMRAGE, 8000, 0, true}, - {0, NULL, ILLIDAN_STORMRAGE, 5000, 396, true}, - {11389, "We've come to end your reign, Illidan. My people and all of Outland shall be free!", AKAMA, 7000, 25, true}, - {0, NULL, AKAMA, 5000, 66, true}, - {11464, "Boldly said. But I remain unconvinced.", ILLIDAN_STORMRAGE, 8000, 396, true}, - {11380, "The time has come! The moment is at hand!", AKAMA, 3000, 22, true}, - {0, NULL, AKAMA, 2000, 15, true}, - {11466, "You are not prepared!", ILLIDAN_STORMRAGE, 3000, 406, true}, - {0, NULL, EMPTY, 1000, 0, true}, - {0, NULL, EMPTY, 0, 0, false},//9 - {11476, "Is this it, mortals? Is this all the fury you can muster?", ILLIDAN_STORMRAGE, 8000, 0, true}, - {11491, "Their fury pales before mine, Illidan. We have some unsettled business between us.", MAIEV_SHADOWSONG, 8000, 5, true}, - {11477, "Maiev... How is this even possible?", ILLIDAN_STORMRAGE, 5000, 1, true}, - {11492, "Ah... my long hunt is finally over. Today, Justice will be done!", MAIEV_SHADOWSONG, 8000, 15, true}, - {11470, "Feel the hatred of ten thousand years!", ILLIDAN_STORMRAGE, 1000, 0, false},//14 - {11496, "Ahh... It is finished. You are beaten.", MAIEV_SHADOWSONG, 6000, 0, true},//15 - {11478, "You have won... Maiev...but the huntress... is nothing...without the hunt... you... are nothing... without me..", ILLIDAN_STORMRAGE, 30000, 65, true}, // Emote dead for now. Kill him later - {11497, "He is right. I feel nothing... I am nothing... Farewell, champions.", MAIEV_SHADOWSONG, 9000, 0, true}, - {11498, NULL, MAIEV_SHADOWSONG, 5000, 0, true}, - {11498, NULL, EMPTY, 1000, 0, true},//19 Maiev disappear - {11387, "The Light will fill these dismal halls once again. I swear it.", AKAMA, 8000, 0, true}, - {0, NULL, EMPTY, 1000, 0, false}//21 -}; - -static Yells RandomTaunts[]= -{ - {11467, "I can feel your hatred.", ILLIDAN_STORMRAGE, 0, 0, false}, - {11468, "Give in to your fear!", ILLIDAN_STORMRAGE, 0, 0, false}, - {11469, "You know nothing of power!", ILLIDAN_STORMRAGE, 0, 0, false}, - {11471, "Such... arrogance!", ILLIDAN_STORMRAGE, 0, 0, false} -}; - -static Yells MaievTaunts[]= -{ - {11493, "That is for Naisha!", MAIEV_SHADOWSONG, 0, false}, - {11494, "Bleed as I have bled!", MAIEV_SHADOWSONG, 0, 0, false}, - {11495, "There shall be no prison for you this time!", MAIEV_SHADOWSONG, 0, 0, false}, - {11500, "Meet your end, demon!", MAIEV_SHADOWSONG, 0, 0, false} -}; - -struct Locations -{ - float x, y, z; -}; - -static Locations HoverPosition[]= -{ - {657, 340, 355}, - {657, 275, 355}, - {705, 275, 355}, - {705, 340, 355} -}; - -static Locations GlaivePosition[]= -{ - {695.105, 305.303, 354.256}, - {659.338, 305.303, 354.256},//the distance between two glaives is 36 - {700.105, 305.303, 354.256}, - {664.338, 305.303, 354.256} -}; - -static Locations EyeBlast[]= -{ - {677, 350, 354},//start point, pass through glaive point - {677, 260, 354} -}; - -static Locations AkamaWP[]= -{ - {770.01, 304.50, 312.29}, // Bottom of the first stairs, at the doors - {780.66, 304.50, 319.74}, // Top of the first stairs - {790.13, 319.68, 319.76}, // Bottom of the second stairs (left from the entrance) - {787.17, 347.38, 341.42}, // Top of the second stairs - {781.34, 350.31, 341.44}, // Bottom of the third stairs - {762.60, 361.06, 353.60}, // Top of the third stairs - {756.35, 360.52, 353.27}, // Before the door-thingy - {743.82, 342.21, 353.00}, // Somewhere further - {732.69, 305.13, 353.00}, // In front of Illidan - (8) - {738.11, 365.44, 353.00}, // in front of the door-thingy (the other one!) - {792.18, 366.62, 341.42}, // Down the first flight of stairs - {796.84, 304.89, 319.76}, // Down the second flight of stairs - {782.01, 304.55, 319.76} // Final location - back at the initial gates. This is where he will fight the minions! (12) -}; -// 755.762, 304.0747, 312.1769 -- This is where Akama should be spawned -static Locations SpiritSpawns[]= -{ - {755.5426, 309.9156, 312.2129}, - {755.5426, 298.7923, 312.0834} -}; - -struct Animation // For the demon transformation -{ - uint32 aura, unaura, timer, size, displayid, phase; - bool equip; -}; - -static Animation DemonTransformation[]= -{ - {SPELL_DEMON_TRANSFORM_1, 0, 1000, 0, 0, 6, true}, - {SPELL_DEMON_TRANSFORM_2, SPELL_DEMON_TRANSFORM_1, 4000, 0, 0, 6, true}, - {0, 0, 3000, 1073741824, 21322, 6, false},//stunned, cannot cast demon form - {SPELL_DEMON_TRANSFORM_3, SPELL_DEMON_TRANSFORM_2, 3500, 0, 0, 6, false}, - {SPELL_DEMON_FORM, SPELL_DEMON_TRANSFORM_3, 0, 0, 0, 4, false}, - {SPELL_DEMON_TRANSFORM_1, 0, 1000, 0, 0, 6, false}, - {SPELL_DEMON_TRANSFORM_2, SPELL_DEMON_TRANSFORM_1, 4000, 0, 0, 6, false}, - {0, SPELL_DEMON_FORM, 3000, 1069547520, 21135, 6, false}, - {SPELL_DEMON_TRANSFORM_3, SPELL_DEMON_TRANSFORM_2, 3500, 0, 0, 6, true}, - {0, SPELL_DEMON_TRANSFORM_3, 0, 0, 0, 8, true} -}; - -#define EMOTE_SETS_GAZE_ON "sets its gaze on $N!" -#define EMOTE_UNABLE_TO_SUMMON "is unable to summon Maiev Shadowsong and enter Phase 4. Resetting Encounter." - -/************************************** Illidan's AI ***************************************/ -struct boss_illidan_stormrageAI : public ScriptedAI -{ - boss_illidan_stormrageAI(Creature* c) : ScriptedAI(c), Summons(me) - { - pInstance = c->GetInstanceData(); - DoCast(me, SPELL_DUAL_WIELD, true); - - SpellEntry *TempSpell = GET_SPELL(SPELL_SHADOWFIEND_PASSIVE); - if (TempSpell) - TempSpell->EffectApplyAuraName[0] = 4; // proc debuff, and summon infinite fiends - } - - ScriptedInstance* pInstance; - - PhaseIllidan Phase; - EventIllidan Event; - uint32 Timer[EVENT_ENRAGE + 1]; - - uint32 TalkCount; - uint32 TransformCount; - uint32 FlightCount; - - uint32 HoverPoint; - - uint64 AkamaGUID; - uint64 MaievGUID; - uint64 FlameGUID[2]; - uint64 GlaiveGUID[2]; - - SummonList Summons; - - void Reset(); - - void JustSummoned(Creature* summon); - - void SummonedCreatureDespawn(Creature* summon) - { - if (summon->GetCreatureInfo()->Entry == FLAME_OF_AZZINOTH) - { - for (uint8 i = 0; i < 2; ++i) - if (summon->GetGUID() == FlameGUID[i]) - FlameGUID[i] = 0; - - if (!FlameGUID[0] && !FlameGUID[1] && Phase != PHASE_ILLIDAN_NULL) - { - me->InterruptNonMeleeSpells(true); - EnterPhase(PHASE_FLIGHT_SEQUENCE); - } - } - Summons.Despawn(summon); - } - - void MovementInform(uint32 /*MovementType*/, uint32 /*Data*/) - { - if (FlightCount == 7) //change hover point - { - if (me->getVictim()) - { - me->SetInFront(me->getVictim()); - me->StopMoving(); - } - EnterPhase(PHASE_FLIGHT); - } - else // handle flight sequence - Timer[EVENT_FLIGHT_SEQUENCE] = 1000; - } - - void EnterCombat(Unit * /*who*/) - { - me->setActive(true); - DoZoneInCombat(); - } - - void AttackStart(Unit *who) - { - if (!who || Phase >= PHASE_TALK_SEQUENCE) - return; - - if (Phase == PHASE_FLIGHT || Phase == PHASE_DEMON) - AttackStartNoMove(who); - else - ScriptedAI::AttackStart(who); - } - - void MoveInLineOfSight(Unit *) {} - - void JustDied(Unit * /*killer*/) - { - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - - if (!pInstance) - return; - - pInstance->SetData(DATA_ILLIDANSTORMRAGEEVENT, DONE); // Completed - - for (uint8 i = DATA_GAMEOBJECT_ILLIDAN_DOOR_R; i < DATA_GAMEOBJECT_ILLIDAN_DOOR_L + 1; ++i) - pInstance->HandleGameObject(pInstance->GetData64(i), true); - } - - void KilledUnit(Unit * victim) - { - if (victim == me) return; - // TODO: Find better way to handle emote - switch (urand(0,1)) - { - case 0: - me->MonsterYell(SAY_KILL1, LANG_UNIVERSAL, victim->GetGUID()); - DoPlaySoundToSet(me, SOUND_KILL1); - break; - case 1: - me->MonsterYell(SAY_KILL2, LANG_UNIVERSAL, victim->GetGUID()); - DoPlaySoundToSet(me, SOUND_KILL2); - break; - } - } - - void DamageTaken(Unit *done_by, uint32 &damage) - { - if (damage >= me->GetHealth() && done_by != me) - damage = 0; - if (done_by->GetGUID() == MaievGUID) - done_by->AddThreat(me, -(3*(float)damage)/4); // do not let maiev tank him - } - - void SpellHit(Unit * /*caster*/, const SpellEntry *spell) - { - if (spell->Id == SPELL_GLAIVE_RETURNS) // Re-equip our warblades! - { - if (!me->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID)) - SetEquipmentSlots(false, EQUIP_ID_MAIN_HAND, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); - else - SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_ID_OFF_HAND, EQUIP_NO_CHANGE); - me->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE); - } - } - - void DeleteFromThreatList(uint64 TargetGUID) - { - for (std::list::const_iterator itr = me->getThreatManager().getThreatList().begin(); itr != me->getThreatManager().getThreatList().end(); ++itr) - { - if ((*itr)->getUnitGuid() == TargetGUID) - { - (*itr)->removeReference(); - break; - } - } - } - - void Talk(uint32 count) - { - Timer[EVENT_TALK_SEQUENCE] = Conversation[count].timer; - - Creature* pCreature = NULL; - if (Conversation[count].pCreature == ILLIDAN_STORMRAGE) - pCreature = me; - else if (Conversation[count].pCreature == AKAMA) - pCreature = (Unit::GetCreature((*me), AkamaGUID)); - else if (Conversation[count].pCreature == MAIEV_SHADOWSONG) - pCreature = (Unit::GetCreature((*me), MaievGUID)); - - if (pCreature) - { - if (Conversation[count].emote) - pCreature->HandleEmoteCommand(Conversation[count].emote); // Make the Creature do some animation! - if (Conversation[count].text) - pCreature->MonsterYell(Conversation[count].text, LANG_UNIVERSAL, 0); // Have the Creature yell out some text - if (Conversation[count].sound) - DoPlaySoundToSet(pCreature, Conversation[count].sound); // Play some sound on the creature - } - } - - void EnterPhase(PhaseIllidan NextPhase); - void CastEyeBlast(); - void SummonFlamesOfAzzinoth(); - void SummonMaiev(); - void HandleTalkSequence(); - void HandleFlightSequence() - { - switch(FlightCount) - { - case 1://lift off - me->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); - me->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); - me->StopMoving(); - me->MonsterYell(SAY_TAKEOFF, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(me, SOUND_TAKEOFF); - Timer[EVENT_FLIGHT_SEQUENCE] = 3000; - break; - case 2://move to center - me->GetMotionMaster()->MovePoint(0, CENTER_X + 5, CENTER_Y, CENTER_Z); //+5, for SPELL_THROW_GLAIVE bug - Timer[EVENT_FLIGHT_SEQUENCE] = 0; - break; - case 3://throw one glaive - { - uint8 i=1; - Creature* Glaive = me->SummonCreature(BLADE_OF_AZZINOTH, GlaivePosition[i].x, GlaivePosition[i].y, GlaivePosition[i].z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); - if (Glaive) - { - GlaiveGUID[i] = Glaive->GetGUID(); - Glaive->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - Glaive->SetDisplayId(11686); - Glaive->setFaction(me->getFaction()); - DoCast(Glaive, SPELL_THROW_GLAIVE2); - } - } - Timer[EVENT_FLIGHT_SEQUENCE] = 700; - break; - case 4://throw another - SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); - { - uint8 i=0; - Creature* Glaive = me->SummonCreature(BLADE_OF_AZZINOTH, GlaivePosition[i].x, GlaivePosition[i].y, GlaivePosition[i].z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); - if (Glaive) - { - GlaiveGUID[i] = Glaive->GetGUID(); - Glaive->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - Glaive->SetDisplayId(11686); - Glaive->setFaction(me->getFaction()); - DoCast(Glaive, SPELL_THROW_GLAIVE, true); - } - } - Timer[EVENT_FLIGHT_SEQUENCE] = 5000; - break; - case 5://summon flames - SummonFlamesOfAzzinoth(); - Timer[EVENT_FLIGHT_SEQUENCE] = 3000; - break; - case 6://fly to hover point - me->GetMotionMaster()->MovePoint(0, HoverPosition[HoverPoint].x, HoverPosition[HoverPoint].y, HoverPosition[HoverPoint].z); - Timer[EVENT_FLIGHT_SEQUENCE] = 0; - break; - case 7://return to center - me->GetMotionMaster()->MovePoint(0, CENTER_X, CENTER_Y, CENTER_Z); - Timer[EVENT_FLIGHT_SEQUENCE] = 0; - break; - case 8://glaive return - for (uint8 i = 0; i < 2; ++i) - { - if (GlaiveGUID[i]) - { - Unit* Glaive = Unit::GetUnit((*me), GlaiveGUID[i]); - if (Glaive) - { - Glaive->CastSpell(me, SPELL_GLAIVE_RETURNS, false); // Make it look like the Glaive flies back up to us - Glaive->SetDisplayId(11686); // disappear but not die for now - } - } - } - Timer[EVENT_FLIGHT_SEQUENCE] = 2000; - break; - case 9://land - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - me->StopMoving(); - me->HandleEmoteCommand(EMOTE_ONESHOT_LAND); - for (uint8 i = 0; i < 2; ++i) - { - if (GlaiveGUID[i]) - { - if (GETUNIT(Glaive, GlaiveGUID[i])) - { - Glaive->SetVisibility(VISIBILITY_OFF); - Glaive->setDeathState(JUST_DIED); // Despawn the Glaive - } - GlaiveGUID[i] = 0; - } - } - Timer[EVENT_FLIGHT_SEQUENCE] = 2000; - break; - case 10://attack - DoResetThreat(); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE); - me->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE); - EnterPhase(PHASE_NORMAL_2); - break; - default: - break; - } - ++FlightCount; - } - - void HandleTransformSequence() - { - if (DemonTransformation[TransformCount].unaura) - me->RemoveAurasDueToSpell(DemonTransformation[TransformCount].unaura); - - if (DemonTransformation[TransformCount].aura) - DoCast(me, DemonTransformation[TransformCount].aura, true); - - if (DemonTransformation[TransformCount].displayid) - me->SetDisplayId(DemonTransformation[TransformCount].displayid); // It's morphin time! - - if (DemonTransformation[TransformCount].equip) - { - // Requip warglaives if needed - SetEquipmentSlots(false, EQUIP_ID_MAIN_HAND, EQUIP_ID_OFF_HAND, EQUIP_NO_CHANGE); - me->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE); - } - else - { - // Unequip warglaives if needed - SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); - } - - switch(TransformCount) - { - case 2: - DoResetThreat(); - break; - case 4: - EnterPhase(PHASE_DEMON); - break; - case 7: - DoResetThreat(); - break; - case 9: - if (MaievGUID) - EnterPhase(PHASE_NORMAL_MAIEV); // Depending on whether we summoned Maiev, we switch to either phase 5 or 3 - else - EnterPhase(PHASE_NORMAL_2); - break; - default: - break; - } - if (Phase == PHASE_TRANSFORM_SEQUENCE) - Timer[EVENT_TRANSFORM_SEQUENCE] = DemonTransformation[TransformCount].timer; - ++TransformCount; - } - - void UpdateAI(const uint32 diff) - { - if ((!UpdateVictim()) && Phase < PHASE_TALK_SEQUENCE) - return; - - Event = EVENT_NULL; - for (uint32 i = 1; i <= MaxTimer[Phase]; ++i) - { - if (Timer[i]) // Event is enabled - if (Timer[i] <= diff) - { - if (!Event) // No event with higher priority - Event = (EventIllidan)i; - } - else Timer[i] -= diff; - } - - switch(Phase) - { - case PHASE_NORMAL: - if (HPPCT(me) < 65) - EnterPhase(PHASE_FLIGHT_SEQUENCE); - break; - - case PHASE_NORMAL_2: - if (HPPCT(me) < 30) - EnterPhase(PHASE_TALK_SEQUENCE); - break; - - case PHASE_NORMAL_MAIEV: - if (HPPCT(me) < 1) - EnterPhase(PHASE_TALK_SEQUENCE); - break; - - case PHASE_TALK_SEQUENCE: - if (Event == EVENT_TALK_SEQUENCE) - HandleTalkSequence(); - break; - - case PHASE_FLIGHT_SEQUENCE: - if (Event == EVENT_FLIGHT_SEQUENCE) - HandleFlightSequence(); - break; - - case PHASE_TRANSFORM_SEQUENCE: - if (Event == EVENT_TRANSFORM_SEQUENCE) - HandleTransformSequence(); - break; - } - - if (me->IsNonMeleeSpellCasted(false)) - return; - - if (Phase == PHASE_NORMAL || Phase == PHASE_NORMAL_2 || Phase == PHASE_NORMAL_MAIEV && !me->HasAura(SPELL_CAGED)) - { - switch(Event) - { - //PHASE_NORMAL - case EVENT_BERSERK: - me->MonsterYell(SAY_ENRAGE, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(me, SOUND_ENRAGE); - DoCast(me, SPELL_BERSERK, true); - Timer[EVENT_BERSERK] = 5000;//The buff actually lasts forever. - break; - - case EVENT_TAUNT: - { - uint32 random = rand()%4; - char* yell = RandomTaunts[random].text; - uint32 soundid = RandomTaunts[random].sound; - if (yell) - me->MonsterYell(yell, LANG_UNIVERSAL, 0); - if (soundid) - DoPlaySoundToSet(me, soundid); - } - Timer[EVENT_TAUNT] = 25000 + rand()%10000; - break; - - case EVENT_SHEAR: - // no longer exists in 3.0.2 - //DoCast(me->getVictim(), SPELL_SHEAR); - Timer[EVENT_SHEAR] = 25000 + (rand()%16 * 1000); - break; - - case EVENT_FLAME_CRASH: - DoCast(me->getVictim(), SPELL_FLAME_CRASH); - Timer[EVENT_FLAME_CRASH] = 30000 + rand()%10000; - break; - - case EVENT_PARASITIC_SHADOWFIEND: - { - if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 200, true)) - DoCast(pTarget, SPELL_PARASITIC_SHADOWFIEND, true); - Timer[EVENT_PARASITIC_SHADOWFIEND] = 35000 + rand()%10000; - } - break; - - case EVENT_PARASITE_CHECK: - Timer[EVENT_PARASITE_CHECK] = 0; - break; - - case EVENT_DRAW_SOUL: - DoCast(me->getVictim(), SPELL_DRAW_SOUL); - Timer[EVENT_DRAW_SOUL] = 50000 + rand()%10000; - break; - - //PHASE_NORMAL_2 - case EVENT_AGONIZING_FLAMES: - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_AGONIZING_FLAMES); - Timer[EVENT_AGONIZING_FLAMES] = 0; - break; - - case EVENT_TRANSFORM_NORMAL: - EnterPhase(PHASE_TRANSFORM_SEQUENCE); - break; - - //PHASE_NORMAL_MAIEV - case EVENT_ENRAGE: - DoCast(me, SPELL_ENRAGE); - Timer[EVENT_ENRAGE] = 0; - break; - - default: - break; - } - DoMeleeAttackIfReady(); - } - - if (Phase == PHASE_FLIGHT) - { - switch(Event) - { - case EVENT_FIREBALL: - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_FIREBALL); - Timer[EVENT_FIREBALL] = 3000; - break; - - case EVENT_DARK_BARRAGE: - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_DARK_BARRAGE); - Timer[EVENT_DARK_BARRAGE] = 0; - break; - - case EVENT_EYE_BLAST: - CastEyeBlast(); - Timer[EVENT_EYE_BLAST] = 0; - break; - - case EVENT_MOVE_POINT: - Phase = PHASE_FLIGHT_SEQUENCE; - Timer[EVENT_FLIGHT_SEQUENCE] = 0;//do not start Event when changing hover point - HoverPoint += (rand()%3 + 1); - if (HoverPoint > 3) - HoverPoint -= 4; - me->GetMotionMaster()->MovePoint(0, HoverPosition[HoverPoint].x, HoverPosition[HoverPoint].y, HoverPosition[HoverPoint].z); - break; - - default: - break; - } - } - - if (Phase == PHASE_DEMON) - { - switch(Event) - { - case EVENT_SHADOW_BLAST: - me->GetMotionMaster()->Clear(false); - if (!me->IsWithinDistInMap(me->getVictim(), 50)||!me->IsWithinLOSInMap(me->getVictim())) - me->GetMotionMaster()->MoveChase(me->getVictim(), 30); - else - me->GetMotionMaster()->MoveIdle(); - DoCast(me->getVictim(), SPELL_SHADOW_BLAST); - Timer[EVENT_SHADOW_BLAST] = 4000; - break; - case EVENT_SHADOWDEMON: - DoCast(me, SPELL_SUMMON_SHADOWDEMON); - Timer[EVENT_SHADOWDEMON] = 0; - Timer[EVENT_FLAME_BURST] += 10000; - break; - case EVENT_FLAME_BURST: - DoCast(me, SPELL_FLAME_BURST); - Timer[EVENT_FLAME_BURST] = 15000; - break; - case EVENT_TRANSFORM_DEMON: - EnterPhase(PHASE_TRANSFORM_SEQUENCE); - break; - default: - break; - } - } - } -}; - -/********************************** End of Illidan AI ******************************************/ - -struct flame_of_azzinothAI : public ScriptedAI -{ - flame_of_azzinothAI(Creature *c) : ScriptedAI(c) {} - - uint32 FlameBlastTimer; - uint32 CheckTimer; - uint64 GlaiveGUID; - - void Reset() - { - FlameBlastTimer = 15000; - CheckTimer = 5000; - GlaiveGUID = 0; - } - - void EnterCombat(Unit * /*who*/) {DoZoneInCombat();} - - void ChargeCheck() - { - Unit *pTarget = SelectTarget(SELECT_TARGET_FARTHEST, 0, 200, false); - if (pTarget && (!me->IsWithinCombatRange(pTarget, FLAME_CHARGE_DISTANCE))) - { - me->AddThreat(pTarget, 5000000.0f); - AttackStart(pTarget); - DoCast(pTarget, SPELL_CHARGE); - me->MonsterTextEmote(EMOTE_SETS_GAZE_ON, pTarget->GetGUID()); - } - } - - void EnrageCheck() - { - if (GETUNIT(Glaive, GlaiveGUID)) - { - if (!me->IsWithinDistInMap(Glaive, FLAME_ENRAGE_DISTANCE)) - { - Glaive->InterruptNonMeleeSpells(true); - DoCast(me, SPELL_FLAME_ENRAGE, true); - DoResetThreat(); - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (pTarget && pTarget->isAlive()) - { - me->AddThreat(me->getVictim(), 5000000.0f); - AttackStart(me->getVictim()); - } - } - else if (!me->HasAura(SPELL_AZZINOTH_CHANNEL)) - { - Glaive->CastSpell(me, SPELL_AZZINOTH_CHANNEL, false); - me->RemoveAurasDueToSpell(SPELL_FLAME_ENRAGE); - } - } - } - - void SetGlaiveGUID(uint64 guid){ GlaiveGUID = guid; } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (FlameBlastTimer <= diff) - { - DoCast(me->getVictim(), SPELL_BLAZE_SUMMON, true); //appear at victim - DoCast(me->getVictim(), SPELL_FLAME_BLAST); - FlameBlastTimer = 15000; //10000 is official-like? - DoZoneInCombat(); //in case someone is revived - } else FlameBlastTimer -= diff; - - if (CheckTimer <= diff) - { - ChargeCheck(); - EnrageCheck(); - CheckTimer = 1000; - } else CheckTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -/******* Functions and vars for Akama's AI ******/ -struct npc_akama_illidanAI : public ScriptedAI -{ - npc_akama_illidanAI(Creature* c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - JustCreated = true; - } - bool JustCreated; - ScriptedInstance* pInstance; - - PhaseAkama Phase; - bool Event; - uint32 Timer; - - uint64 IllidanGUID; - uint64 ChannelGUID; - uint64 SpiritGUID[2]; - uint64 GateGUID; - uint64 DoorGUID[2]; - - uint32 ChannelCount; - uint32 WalkCount; - uint32 TalkCount; - uint32 Check_Timer; - - void Reset() - { - WalkCount = 0; - if (pInstance) - { - pInstance->SetData(DATA_ILLIDANSTORMRAGEEVENT, NOT_STARTED); - - IllidanGUID = pInstance->GetData64(DATA_ILLIDANSTORMRAGE); - GateGUID = pInstance->GetData64(DATA_GAMEOBJECT_ILLIDAN_GATE); - DoorGUID[0] = pInstance->GetData64(DATA_GAMEOBJECT_ILLIDAN_DOOR_R); - DoorGUID[1] = pInstance->GetData64(DATA_GAMEOBJECT_ILLIDAN_DOOR_L); - - if (JustCreated)//close all doors at create - { - pInstance->HandleGameObject(GateGUID, false); - - for (uint8 i = 0; i < 2; ++i) - pInstance->HandleGameObject(DoorGUID[i], false); - //JustCreated = false; - }else - {//open all doors, raid wiped - pInstance->HandleGameObject(GateGUID, true); - WalkCount = 1;//skip first wp - for (uint8 i = 0; i < 2; ++i) - pInstance->HandleGameObject(DoorGUID[i], true); - } - } - else - { - IllidanGUID = 0; - GateGUID = 0; - DoorGUID[0] = 0; - DoorGUID[1] = 0; - } - - ChannelGUID = 0; - SpiritGUID[0] = 0; - SpiritGUID[1] = 0; - - Phase = PHASE_AKAMA_NULL; - Timer = 0; - - ChannelCount = 0; - TalkCount = 0; - Check_Timer = 5000; - - KillAllElites(); - - me->SetUInt32Value(UNIT_NPC_FLAGS, 0); // Database sometimes has strange values.. - me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - me->setActive(false); - me->SetVisibility(VISIBILITY_OFF); - } - - // Do not call reset in Akama's evade mode, as this will stop him from summoning minions after he kills the first bit - void EnterEvadeMode() - { - me->RemoveAllAuras(); - me->DeleteThreatList(); - me->CombatStop(true); - } - - void EnterCombat(Unit * /*who*/) {} - void MoveInLineOfSight(Unit* /*who*/) {} - - void MovementInform(uint32 MovementType, uint32 /*Data*/) - { - if (MovementType == POINT_MOTION_TYPE) - Timer = 1; - } - - void DamageTaken(Unit *done_by, uint32 &damage) - { - if (damage > me->GetHealth() || done_by->GetGUID() != IllidanGUID) - damage = 0; - } - - void KillAllElites() - { - std::list& threatList = me->getThreatManager().getThreatList(); - std::vector eliteList; - for (std::list::const_iterator itr = threatList.begin(); itr != threatList.end(); ++itr) - { - Unit* pUnit = Unit::GetUnit((*me), (*itr)->getUnitGuid()); - if (pUnit && pUnit->GetEntry() == ILLIDARI_ELITE) - eliteList.push_back(pUnit); - } - for (std::vector::const_iterator itr = eliteList.begin(); itr != eliteList.end(); ++itr) - (*itr)->setDeathState(JUST_DIED); - EnterEvadeMode(); - } - - void BeginTalk() - { - if (!pInstance) - return; - - pInstance->SetData(DATA_ILLIDANSTORMRAGEEVENT, IN_PROGRESS); - for (uint8 i = 0; i < 2; ++i) - pInstance->HandleGameObject(DoorGUID[i], false); - if (GETCRE(Illidan, IllidanGUID)) - { - Illidan->RemoveAurasDueToSpell(SPELL_KNEEL); - me->SetInFront(Illidan); - Illidan->SetInFront(me); - me->GetMotionMaster()->MoveIdle(); - Illidan->GetMotionMaster()->MoveIdle(); - CAST_AI(boss_illidan_stormrageAI, Illidan->AI())->AkamaGUID = me->GetGUID(); - CAST_AI(boss_illidan_stormrageAI, Illidan->AI())->EnterPhase(PHASE_TALK_SEQUENCE); - } - } - - void BeginChannel() - { - me->setActive(true); - me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - if (!JustCreated) - return; - float x, y, z; - if (GETGO(Gate, GateGUID)) - Gate->GetPosition(x, y, z); - else - return;//if door not spawned, don't crash server - - if (Creature* Channel = me->SummonCreature(ILLIDAN_DOOR_TRIGGER, x, y, z+5, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 360000)) - { - ChannelGUID = Channel->GetGUID(); - Channel->SetDisplayId(11686); // Invisible but spell visuals can still be seen. - DoCast(Channel, SPELL_AKAMA_DOOR_FAIL); - } - - for (uint8 i = 0; i < 2; ++i) - if (Creature* Spirit = me->SummonCreature(i ? SPIRIT_OF_OLUM : SPIRIT_OF_UDALO, SpiritSpawns[i].x, SpiritSpawns[i].y, SpiritSpawns[i].z, 0, TEMPSUMMON_TIMED_DESPAWN, 20000)) - { - Spirit->SetVisibility(VISIBILITY_OFF); - SpiritGUID[i] = Spirit->GetGUID(); - } - } - - void BeginWalk() - { - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - me->SetSpeed(MOVE_RUN, 1.0f); - me->GetMotionMaster()->MovePoint(0, AkamaWP[WalkCount].x, AkamaWP[WalkCount].y, AkamaWP[WalkCount].z); - } - - void EnterPhase(PhaseAkama NextPhase) - { - if (!pInstance) - return; - switch(NextPhase) - { - case PHASE_CHANNEL: - BeginChannel(); - Timer = 5000; - ChannelCount = 0; - break; - case PHASE_WALK: - if (Phase == PHASE_CHANNEL) - WalkCount = 0; - else if (Phase == PHASE_TALK) - { - if (GETCRE(Illidan, IllidanGUID)) - CAST_AI(boss_illidan_stormrageAI, Illidan->AI())->DeleteFromThreatList(me->GetGUID()); - EnterEvadeMode(); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - ++WalkCount; - } - JustCreated = false; - BeginWalk(); - Timer = 0; - break; - case PHASE_TALK: - if (Phase == PHASE_WALK) - { - BeginTalk(); - Timer = 0; - } - else if (Phase == PHASE_FIGHT_ILLIDAN) - { - Timer = 1; - TalkCount = 0; - } - break; - case PHASE_FIGHT_ILLIDAN: - if (GETUNIT(Illidan, IllidanGUID)) - { - me->AddThreat(Illidan, 10000000.0f); - me->GetMotionMaster()->MoveChase(Illidan); - } - Timer = 30000; //chain lightning - break; - case PHASE_FIGHT_MINIONS: - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - Timer = 10000 + rand()%6000;//summon minion - break; - case PHASE_RETURN: - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - KillAllElites(); - WalkCount = 0; - BeginWalk(); - Timer = 1; - break; - default: - break; - } - Phase = NextPhase; - Event = false; - } - - void HandleTalkSequence() - { - switch(TalkCount) - { - case 0: - if (GETCRE(Illidan, IllidanGUID)) - { - CAST_AI(boss_illidan_stormrageAI, Illidan->AI())->Timer[EVENT_TAUNT] += 30000; - Illidan->MonsterYell(SAY_AKAMA_MINION, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(Illidan, SOUND_AKAMA_MINION); - } - Timer = 8000; - break; - case 1: - me->MonsterYell(SAY_AKAMA_LEAVE, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(me, SOUND_AKAMA_LEAVE); - Timer = 3000; - break; - case 2: - EnterPhase(PHASE_WALK); - break; - } - ++TalkCount; - } - - void HandleChannelSequence() - { - Unit* Channel = NULL, *Spirit[2]; - if (ChannelCount <= 5) - { - Channel = Unit::GetUnit((*me), ChannelGUID); - Spirit[0] = Unit::GetUnit((*me), SpiritGUID[0]); - Spirit[1] = Unit::GetUnit((*me), SpiritGUID[1]); - if (!Channel || !Spirit[0] || !Spirit[1]) - return; - } - - switch(ChannelCount) - { - case 0: // channel failed - me->InterruptNonMeleeSpells(true); - Timer = 2000; - break; - case 1: // spirit appear - Spirit[0]->SetVisibility(VISIBILITY_ON); - Spirit[1]->SetVisibility(VISIBILITY_ON); - Timer = 2000; - break; - case 2: // spirit help - DoCast(Channel, SPELL_AKAMA_DOOR_CHANNEL); - Spirit[0]->CastSpell(Channel, SPELL_DEATHSWORN_DOOR_CHANNEL,false); - Spirit[1]->CastSpell(Channel, SPELL_DEATHSWORN_DOOR_CHANNEL,false); - Timer = 5000; - break; - case 3: //open the gate - me->InterruptNonMeleeSpells(true); - Spirit[0]->InterruptNonMeleeSpells(true); - Spirit[1]->InterruptNonMeleeSpells(true); - if (pInstance) - pInstance->HandleGameObject(GateGUID, true); - Timer = 2000; - break; - case 4: - me->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE); - Timer = 2000; - break; - case 5: - me->MonsterYell(SAY_AKAMA_BEWARE, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(me, SOUND_AKAMA_BEWARE); - Channel->setDeathState(JUST_DIED); - Spirit[0]->SetVisibility(VISIBILITY_OFF); - Spirit[1]->SetVisibility(VISIBILITY_OFF); - Timer = 3000; - break; - case 6: - EnterPhase(PHASE_WALK); - break; - default: - break; - } - ++ChannelCount; - } - - void HandleWalkSequence() - { - switch(WalkCount) - { - case 6: - for (uint8 i = 0; i < 2; ++i) - if (pInstance) - pInstance->HandleGameObject(DoorGUID[i], true); - break; - case 8: - if (Phase == PHASE_WALK) - EnterPhase(PHASE_TALK); - else - EnterPhase(PHASE_FIGHT_ILLIDAN); - break; - case 12: - EnterPhase(PHASE_FIGHT_MINIONS); - break; - } - - if (Phase == PHASE_WALK) - { - Timer = 0; - ++WalkCount; - me->GetMotionMaster()->MovePoint(WalkCount, AkamaWP[WalkCount].x, AkamaWP[WalkCount].y, AkamaWP[WalkCount].z); - } - } - - void UpdateAI(const uint32 diff) - { - if (me->GetVisibility() == VISIBILITY_OFF) - { - if (Check_Timer <= diff) - { - if (pInstance && pInstance->GetData(DATA_ILLIDARICOUNCILEVENT) == DONE) - me->SetVisibility(VISIBILITY_ON); - - Check_Timer = 5000; - } else Check_Timer -= diff; - } - Event = false; - if (Timer) - { - if (Timer <= diff) - Event = true; - else Timer -= diff; - } - - if (Event) - { - switch(Phase) - { - case PHASE_CHANNEL: - if (JustCreated) - HandleChannelSequence(); - else{ - EnterPhase(PHASE_WALK); - } - break; - case PHASE_TALK: - HandleTalkSequence(); - break; - case PHASE_WALK: - case PHASE_RETURN: - HandleWalkSequence(); - break; - case PHASE_FIGHT_ILLIDAN: - { - GETUNIT(Illidan, IllidanGUID); - if (Illidan && HPPCT(Illidan) < 90) - EnterPhase(PHASE_TALK); - else - { - DoCast(me->getVictim(), SPELL_CHAIN_LIGHTNING); - Timer = 30000; - } - } - break; - case PHASE_FIGHT_MINIONS: - { - float x, y, z; - me->GetPosition(x, y, z); - Creature* Elite = me->SummonCreature(ILLIDARI_ELITE, x+rand()%10, y+rand()%10, z, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30000); - //Creature* Elite = me->SummonCreature(ILLIDARI_ELITE, x, y, z, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30000); - if (Elite) - { - Elite->AI()->AttackStart(me); - Elite->AddThreat(me, 1000000.0f); - AttackStart(Elite); - me->AddThreat(Elite, 1000000.0f); - } - Timer = 10000 + rand()%6000; - GETUNIT(Illidan, IllidanGUID); - if (Illidan && HPPCT(Illidan) < 10) - EnterPhase(PHASE_RETURN); - } - break; - default: - break; - } - } - - if (!UpdateVictim()) - return; - - if (me->GetHealth()*100 / me->GetMaxHealth() < 20) - DoCast(me, SPELL_HEALING_POTION); - - DoMeleeAttackIfReady(); - } -}; - -struct boss_maievAI : public ScriptedAI -{ - boss_maievAI(Creature *c) : ScriptedAI(c) {}; - - uint64 IllidanGUID; - - PhaseIllidan Phase; - EventMaiev Event; - uint32 Timer[5]; - uint32 MaxTimer; - - void Reset() - { - MaxTimer = 0; - Phase = PHASE_NORMAL_MAIEV; - IllidanGUID = 0; - Timer[EVENT_MAIEV_STEALTH] = 0; - Timer[EVENT_MAIEV_TAUNT] = 22000 + rand()%21 * 1000; - Timer[EVENT_MAIEV_SHADOW_STRIKE] = 30000; - SetEquipmentSlots(false, 44850, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); - me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2, 45738); - } - - void EnterCombat(Unit * /*who*/) {} - void MoveInLineOfSight(Unit * /*who*/) {} - void EnterEvadeMode() {} - void GetIllidanGUID(uint64 guid) { IllidanGUID = guid; } - - void DamageTaken(Unit *done_by, uint32 &damage) - { - if (done_by->GetGUID() != IllidanGUID) - damage = 0; - else - { - GETUNIT(Illidan, IllidanGUID); - if (Illidan && Illidan->getVictim() == me) - damage = me->GetMaxHealth()/10; - if (damage >= me->GetHealth()) - damage = 0; - } - } - - void AttackStart(Unit *who) - { - if (!who || Timer[EVENT_MAIEV_STEALTH]) - return; - - if (Phase == PHASE_TALK_SEQUENCE) - AttackStartNoMove(who); - else if (Phase == PHASE_DEMON || Phase == PHASE_TRANSFORM_SEQUENCE) - { - GETUNIT(Illidan, IllidanGUID); - if (Illidan && me->IsWithinDistInMap(Illidan, 25)) - BlinkToPlayer();//Do not let dread aura hurt her. - AttackStartNoMove(who); - } - else - ScriptedAI::AttackStart(who); - } - - void DoAction(const int32 param) - { - if (param > PHASE_ILLIDAN_NULL && param < PHASE_ILLIDAN_MAX) - EnterPhase(PhaseIllidan(param)); - } - - void EnterPhase(PhaseIllidan NextPhase)//This is in fact Illidan's phase. - { - switch(NextPhase) - { - case PHASE_TALK_SEQUENCE: - if (Timer[EVENT_MAIEV_STEALTH]) - { - me->SetHealth(me->GetMaxHealth()); - me->SetVisibility(VISIBILITY_ON); - Timer[EVENT_MAIEV_STEALTH] = 0; - } - me->InterruptNonMeleeSpells(false); - me->GetMotionMaster()->Clear(false); - me->AttackStop(); - me->SetUInt64Value(UNIT_FIELD_TARGET, IllidanGUID); - MaxTimer = 0; - break; - case PHASE_TRANSFORM_SEQUENCE: - MaxTimer = 4; - Timer[EVENT_MAIEV_TAUNT] += 10000; - Timer[EVENT_MAIEV_THROW_DAGGER] = 2000; - break; - case PHASE_DEMON: - break; - case PHASE_NORMAL_MAIEV: - MaxTimer = 4; - Timer[EVENT_MAIEV_TAUNT] += 10000; - Timer[EVENT_MAIEV_TRAP] = 22000; - break; - default: - break; - } - if (Timer[EVENT_MAIEV_STEALTH]) - MaxTimer = 1; - Phase = NextPhase; - } - - void BlinkTo(float x, float y, float z) - { - me->AttackStop(); - me->InterruptNonMeleeSpells(false); - me->GetMotionMaster()->Clear(false); - DoTeleportTo(x, y, z); - DoCast(me, SPELL_TELEPORT_VISUAL, true); - } - - void BlinkToPlayer() - { - if (GETCRE(Illidan, IllidanGUID)) - { - Unit *pTarget = CAST_AI(boss_illidan_stormrageAI, Illidan->AI())->SelectUnit(SELECT_TARGET_RANDOM, 0); - - if (!pTarget || !me->IsWithinDistInMap(pTarget, 80) || Illidan->IsWithinDistInMap(pTarget, 20)) - { - uint8 pos = rand()%4; - BlinkTo(HoverPosition[pos].x, HoverPosition[pos].y, HoverPosition[pos].z); - } - else - { - float x, y, z; - pTarget->GetPosition(x, y, z); - BlinkTo(x, y, z); - } - } - } - - void UpdateAI(const uint32 diff) - { - if ((!UpdateVictim()) - && !Timer[EVENT_MAIEV_STEALTH]) - return; - - Event = EVENT_MAIEV_NULL; - for (uint8 i = 1; i <= MaxTimer; ++i) - if (Timer[i]) - { - if (Timer[i] <= diff) - Event = (EventMaiev)i; - else Timer[i] -= diff; - } - - switch(Event) - { - case EVENT_MAIEV_STEALTH: - { - me->SetHealth(me->GetMaxHealth()); - me->SetVisibility(VISIBILITY_ON); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - Timer[EVENT_MAIEV_STEALTH] = 0; - BlinkToPlayer(); - EnterPhase(Phase); - } - break; - case EVENT_MAIEV_TAUNT: - { - uint32 random = rand()%4; - char* text = MaievTaunts[random].text; - uint32 sound = MaievTaunts[random].sound; - me->MonsterYell(text, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(me, sound); - Timer[EVENT_MAIEV_TAUNT] = 22000 + rand()%21 * 1000; - } - break; - case EVENT_MAIEV_SHADOW_STRIKE: - DoCast(me->getVictim(), SPELL_SHADOW_STRIKE); - Timer[EVENT_MAIEV_SHADOW_STRIKE] = 60000; - break; - case EVENT_MAIEV_TRAP: - if (Phase == PHASE_NORMAL_MAIEV) - { - BlinkToPlayer(); - DoCast(me, SPELL_CAGE_TRAP_SUMMON); - Timer[EVENT_MAIEV_TRAP] = 22000; - } - else - { - if (!me->IsWithinDistInMap(me->getVictim(), 40)) - me->GetMotionMaster()->MoveChase(me->getVictim(), 30); - DoCast(me->getVictim(), SPELL_THROW_DAGGER); - Timer[EVENT_MAIEV_THROW_DAGGER] = 2000; - } - break; - default: - break; - } - - if (me->GetHealth()*100 / me->GetMaxHealth() < 50) - { - me->SetVisibility(VISIBILITY_OFF); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - if (GETCRE(Illidan, IllidanGUID)) - CAST_AI(boss_illidan_stormrageAI, Illidan->AI())->DeleteFromThreatList(me->GetGUID()); - me->AttackStop(); - Timer[EVENT_MAIEV_STEALTH] = 60000; //reappear after 1 minute - MaxTimer = 1; - } - - if (Phase == PHASE_NORMAL_MAIEV) - DoMeleeAttackIfReady(); - } -}; - -bool GossipSelect_npc_akama_at_illidan(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_INFO_DEF) // Time to begin the Event - { - pPlayer->CLOSE_GOSSIP_MENU(); - CAST_AI(npc_akama_illidanAI, pCreature->AI())->EnterPhase(PHASE_CHANNEL); - } - return true; -} - -bool GossipHello_npc_akama_at_illidan(Player* pPlayer, Creature* pCreature) -{ - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - pPlayer->SEND_GOSSIP_MENU(10465, pCreature->GetGUID()); - - return true; -} - -struct cage_trap_triggerAI : public ScriptedAI -{ - cage_trap_triggerAI(Creature *c) : ScriptedAI(c) {} - - uint64 IllidanGUID; - uint32 DespawnTimer; - - bool Active; - bool SummonedBeams; - - void Reset() - { - IllidanGUID = 0; - - Active = false; - SummonedBeams = false; - - DespawnTimer = 0; - - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - } - - void EnterCombat(Unit * /*who*/){} - - void MoveInLineOfSight(Unit *who) - { - if (!Active) - return; - - if (who && (who->GetTypeId() != TYPEID_PLAYER)) - { - if (who->GetEntry() == ILLIDAN_STORMRAGE) // Check if who is Illidan - { - if (!IllidanGUID && me->IsWithinDistInMap(who, 3) && (!who->HasAura(SPELL_CAGED))) - { - IllidanGUID = who->GetGUID(); - who->CastSpell(who, SPELL_CAGED, true); - DespawnTimer = 5000; - if (who->HasAura(SPELL_ENRAGE)) - who->RemoveAurasDueToSpell(SPELL_ENRAGE); // Dispel his enrage - //if (GameObject* CageTrap = pInstance->instance->GetGameObject(pInstance->GetData64(CageTrapGUID))) - // CageTrap->SetLootState(GO_JUST_DEACTIVATED); - } - } - } - } - - void UpdateAI(const uint32 diff) - { - if (DespawnTimer) - if (DespawnTimer <= diff) - me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - else DespawnTimer -= diff; - - //if (IllidanGUID && !SummonedBeams) - //{ - // if (Unit* Illidan = Unit::GetUnit(*me, IllidanGUID) - // { - // //TODO: Find proper spells and properly apply 'caged' Illidan effect - // } - //} - } -}; - -bool GOHello_cage_trap(Player* pPlayer, GameObject* pGo) -{ - float x, y, z; - pPlayer->GetPosition(x, y, z); - - // Grid search for nearest live Creature of entry 23304 within 10 yards - if (Creature* pTrigger = pGo->FindNearestCreature(23304, 10.0f)) - CAST_AI(cage_trap_triggerAI, pTrigger->AI())->Active = true; - pGo->SetGoState(GO_STATE_ACTIVE); - return true; -} - -struct shadow_demonAI : public ScriptedAI -{ - shadow_demonAI(Creature *c) : ScriptedAI(c) {} - - uint64 TargetGUID; - - void EnterCombat(Unit * /*who*/) {DoZoneInCombat();} - - void Reset() - { - TargetGUID = 0; - DoCast(me, SPELL_SHADOW_DEMON_PASSIVE, true); - } - - void JustDied(Unit * /*killer*/) - { - if (Unit *pTarget = Unit::GetUnit((*me), TargetGUID)) - pTarget->RemoveAurasDueToSpell(SPELL_PARALYZE); - } - - void UpdateAI(const uint32 /*diff*/) - { - if (!UpdateVictim()) return; - - if (me->getVictim()->GetTypeId() != TYPEID_PLAYER) return; // Only cast the below on players. - - if (!me->getVictim()->HasAura(SPELL_PARALYZE)) - { - TargetGUID = me->getVictim()->GetGUID(); - me->AddThreat(me->getVictim(), 10000000.0f); - DoCast(me->getVictim(), SPELL_PURPLE_BEAM, true); - DoCast(me->getVictim(), SPELL_PARALYZE, true); - } - // Kill our target if we're very close. - if (me->IsWithinDistInMap(me->getVictim(), 3)) - DoCast(me->getVictim(), SPELL_CONSUME_SOUL); - } -}; - -// Shadowfiends interact with Illidan, setting more targets in Illidan's hashmap -struct mob_parasitic_shadowfiendAI : public ScriptedAI -{ - mob_parasitic_shadowfiendAI(Creature* c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - uint64 IllidanGUID; - uint32 CheckTimer; - - void Reset() - { - if (pInstance) - IllidanGUID = pInstance->GetData64(DATA_ILLIDANSTORMRAGE); - else - IllidanGUID = 0; - - CheckTimer = 5000; - DoCast(me, SPELL_SHADOWFIEND_PASSIVE, true); - } - - void EnterCombat(Unit* /*who*/) { DoZoneInCombat(); } - - void DoMeleeAttackIfReady() - { - if (me->isAttackReady() && me->IsWithinMeleeRange(me->getVictim())) - { - if (!me->getVictim()->HasAura(SPELL_PARASITIC_SHADOWFIEND) - && !me->getVictim()->HasAura(SPELL_PARASITIC_SHADOWFIEND2)) - { - if (Creature* illidan = Unit::GetCreature((*me),IllidanGUID))//summon only in 1. phase - if (CAST_AI(boss_illidan_stormrageAI, illidan->AI())->Phase == PHASE_NORMAL) - me->CastSpell(me->getVictim(), SPELL_PARASITIC_SHADOWFIEND2, true, 0, 0, IllidanGUID); //do not stack - } - me->AttackerStateUpdate(me->getVictim()); - me->resetAttackTimer(); - } - } - - void UpdateAI(const uint32 diff) - { - if (!me->getVictim()) - { - if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 999, true)) - AttackStart(pTarget); - else - { - me->SetVisibility(VISIBILITY_OFF); - me->setDeathState(JUST_DIED); - return; - } - } - - if (CheckTimer <= diff) - { - GETUNIT(Illidan, IllidanGUID); - if (!Illidan || CAST_CRE(Illidan)->IsInEvadeMode()) - { - me->SetVisibility(VISIBILITY_OFF); - me->setDeathState(JUST_DIED); - return; - } else CheckTimer = 5000; - } else CheckTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -struct blade_of_azzinothAI : public NullCreatureAI -{ - blade_of_azzinothAI(Creature* c) : NullCreatureAI(c) {} - - void SpellHit(Unit * /*caster*/, const SpellEntry *spell) - { - if (spell->Id == SPELL_THROW_GLAIVE2 || spell->Id == SPELL_THROW_GLAIVE) - me->SetDisplayId(21431);//appear when hit by Illidan's glaive - } -}; - -void boss_illidan_stormrageAI::Reset() -{ - if (pInstance) - pInstance->SetData(DATA_ILLIDANSTORMRAGEEVENT, NOT_STARTED); - - if (AkamaGUID) - { - if (GETCRE(Akama, AkamaGUID)) - { - if (!Akama->isAlive()) - Akama->Respawn(); - else - { - CAST_AI(npc_akama_illidanAI, Akama->AI())->EnterEvadeMode(); - Akama->GetMotionMaster()->MoveTargetedHome(); - CAST_AI(npc_akama_illidanAI, Akama->AI())->Reset(); - } - } - AkamaGUID = 0; - } - - MaievGUID = 0; - for (uint8 i = 0; i < 2; ++i) - { - FlameGUID[i] = 0; - GlaiveGUID[i] = 0; - } - - Phase = PHASE_ILLIDAN_NULL; - Event = EVENT_NULL; - Timer[EVENT_BERSERK] = 1500000; - - HoverPoint = 0; - TalkCount = 0; - FlightCount = 0; - TransformCount = 0; - - me->SetDisplayId(21135); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - me->setActive(false); - Summons.DespawnAll(); -} - -void boss_illidan_stormrageAI::JustSummoned(Creature* summon) -{ - Summons.Summon(summon); - switch(summon->GetEntry()) - { - case PARASITIC_SHADOWFIEND: - { - if (Phase == PHASE_TALK_SEQUENCE) - { - summon->SetVisibility(VISIBILITY_OFF); - summon->setDeathState(JUST_DIED); - return; - } - Unit *pTarget = SelectTarget(SELECT_TARGET_TOPAGGRO, 0, 999, true); - if (!pTarget || pTarget->HasAura(SPELL_PARASITIC_SHADOWFIEND) - || pTarget->HasAura(SPELL_PARASITIC_SHADOWFIEND2)) - pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 999, true); - if (pTarget) - summon->AI()->AttackStart(pTarget); - } - break; - case SHADOW_DEMON: - if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 999, true)) // only on players. - { - summon->AddThreat(pTarget, 5000000.0f); - summon->AI()->AttackStart(pTarget); - } - break; - case MAIEV_SHADOWSONG: - { - summon->SetVisibility(VISIBILITY_OFF); // Leave her invisible until she has to talk - summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - MaievGUID = summon->GetGUID(); - CAST_AI(boss_maievAI, summon->AI())->GetIllidanGUID(me->GetGUID()); - summon->AI()->DoAction(PHASE_TALK_SEQUENCE); - } - break; - case FLAME_OF_AZZINOTH: - { - summon->AI()->AttackStart(summon->SelectNearestTarget(999)); - } - break; - default: - break; - } -} - -void boss_illidan_stormrageAI::HandleTalkSequence() -{ - switch(TalkCount) - { - case 0: - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - break; - case 8: - // Equip our warglaives! - SetEquipmentSlots(false, EQUIP_ID_MAIN_HAND, EQUIP_ID_OFF_HAND, EQUIP_NO_CHANGE); - me->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - break; - case 9: - if (GETCRE(Akama, AkamaGUID)) - { - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE); - me->AddThreat(Akama, 100.0f); - CAST_AI(npc_akama_illidanAI, Akama->AI())->EnterPhase(PHASE_FIGHT_ILLIDAN); - EnterPhase(PHASE_NORMAL); - } - break; - case 10: - SummonMaiev(); - break; - case 11: - if (GETUNIT(Maiev, MaievGUID)) - { - Maiev->SetVisibility(VISIBILITY_ON); // Maiev is now visible - Maiev->CastSpell(Maiev, SPELL_TELEPORT_VISUAL, true); // onoz she looks like she teleported! - Maiev->SetInFront(me); // Have her face us - me->SetInFront(Maiev); // Face her, so it's not rude =P - Maiev->GetMotionMaster()->MoveIdle(); - me->GetMotionMaster()->MoveIdle(); - } - break; - case 14: - if (GETCRE(Maiev, MaievGUID)) - { - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE); - Maiev->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE); - Maiev->AddThreat(me, 10000000.0f); // Have Maiev add a lot of threat on us so that players don't pull her off if they damage her via AOE - Maiev->AI()->AttackStart(me); // Force Maiev to attack us. - EnterPhase(PHASE_NORMAL_MAIEV); - } - break; - case 15: - DoCast(me, SPELL_DEATH); // Animate his kneeling + stun him - Summons.DespawnAll(); - break; - case 17: - if (GETUNIT(Akama, AkamaGUID)) - { - if (!me->IsWithinDistInMap(Akama, 15)) - { - float x, y, z; - me->GetPosition(x, y, z); - x += 10; y += 10; - Akama->GetMotionMaster()->Clear(false); - //Akama->GetMotionMaster()->MoveIdle(); - Akama->GetMap()->CreatureRelocation(me, x, y, z, 0.0f); - Akama->SendMonsterMove(x, y, z, 0, MOVEMENTFLAG_NONE, 0);//Illidan must not die until Akama arrives. - Akama->GetMotionMaster()->MoveChase(me); - } - } - break; - case 19: // Make Maiev leave - if (GETUNIT(Maiev, MaievGUID)) - { - Maiev->CastSpell(Maiev, SPELL_TELEPORT_VISUAL, true); - Maiev->setDeathState(JUST_DIED); - me->SetUInt32Value(UNIT_FIELD_BYTES_1,UNIT_STAND_STATE_DEAD); - } - break; - case 21: // Kill ourself. - me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - break; - default: - break; - } - if (Phase == PHASE_TALK_SEQUENCE) - Talk(TalkCount); // This function does most of the talking - ++TalkCount; -} - -void boss_illidan_stormrageAI::CastEyeBlast() -{ - me->InterruptNonMeleeSpells(false); - - me->MonsterYell(SAY_EYE_BLAST, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(me, SOUND_EYE_BLAST); - - float distx, disty, dist[2]; - for (uint8 i = 0; i < 2; ++i) - { - distx = EyeBlast[i].x - HoverPosition[HoverPoint].x; - disty = EyeBlast[i].y - HoverPosition[HoverPoint].y; - dist[i] = distx * distx + disty * disty; - } - Locations initial = EyeBlast[dist[0] < dist[1] ? 0 : 1]; - for (uint8 i = 0; i < 2; ++i) - { - distx = GlaivePosition[i].x - HoverPosition[HoverPoint].x; - disty = GlaivePosition[i].y - HoverPosition[HoverPoint].y; - dist[i] = distx * distx + disty * disty; - } - Locations final = GlaivePosition[dist[0] < dist[1] ? 0 : 1]; - - final.x = 2 * final.x - initial.x; - final.y = 2 * final.y - initial.y; - - Creature* Trigger = me->SummonCreature(23069, initial.x, initial.y, initial.z, 0, TEMPSUMMON_TIMED_DESPAWN, 13000); - if (!Trigger) return; - - Trigger->SetSpeed(MOVE_WALK, 3); - Trigger->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - Trigger->GetMotionMaster()->MovePoint(0, final.x, final.y, final.z); - - //Trigger->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetUInt64Value(UNIT_FIELD_TARGET, Trigger->GetGUID()); - DoCast(Trigger, SPELL_EYE_BLAST); -} - -void boss_illidan_stormrageAI::SummonFlamesOfAzzinoth() -{ - me->MonsterYell(SAY_SUMMONFLAMES, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(me, SOUND_SUMMONFLAMES); - - for (uint8 i = 0; i < 2; ++i) - { - if (GETUNIT(Glaive, GlaiveGUID[i])) - { - Creature* Flame = me->SummonCreature(FLAME_OF_AZZINOTH, GlaivePosition[i+2].x, GlaivePosition[i+2].y, GlaivePosition[i+2].z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000); - if (Flame) - { - Flame->setFaction(me->getFaction()); // Just in case the database has it as a different faction - Flame->SetMeleeDamageSchool(SPELL_SCHOOL_FIRE); - FlameGUID[i] = Flame->GetGUID(); // Record GUID in order to check if they're dead later on to move to the next phase - CAST_AI(flame_of_azzinothAI, Flame->AI())->SetGlaiveGUID(GlaiveGUID[i]); - Glaive->CastSpell(Flame, SPELL_AZZINOTH_CHANNEL, false); // Glaives do some random Beam type channel on it. - } - } - } -} - -void boss_illidan_stormrageAI::SummonMaiev() -{ - DoCast(me, SPELL_SHADOW_PRISON, true); - DoCast(me, 40403, true); - if (!MaievGUID) // If Maiev cannot be summoned, reset the encounter and post some errors to the console. - { - EnterEvadeMode(); - me->MonsterTextEmote(EMOTE_UNABLE_TO_SUMMON, 0); - error_log("SD2 ERROR: Unable to summon Maiev Shadowsong (entry: 23197). Check your database to see if you have the proper SQL for Maiev Shadowsong (entry: 23197)"); - } -} - -void boss_illidan_stormrageAI::EnterPhase(PhaseIllidan NextPhase) -{ - DoZoneInCombat(); - switch(NextPhase) - { - case PHASE_NORMAL: - case PHASE_NORMAL_2: - case PHASE_NORMAL_MAIEV: - AttackStart(me->getVictim()); - Timer[EVENT_TAUNT] = 32000; - Timer[EVENT_SHEAR] = 10000 + rand()%15 * 1000; - Timer[EVENT_FLAME_CRASH] = 20000; - Timer[EVENT_PARASITIC_SHADOWFIEND] = 25000; - Timer[EVENT_PARASITE_CHECK] = 0; - Timer[EVENT_DRAW_SOUL] = 30000; - if (NextPhase == PHASE_NORMAL) - break; - Timer[EVENT_AGONIZING_FLAMES] = 35000; - Timer[EVENT_TRANSFORM_NORMAL] = 60000; - if (NextPhase == PHASE_NORMAL_2) - break; - Timer[EVENT_ENRAGE] = 30000 + rand()%10 * 1000; - break; - case PHASE_FLIGHT: - Timer[EVENT_FIREBALL] = 1000; - if (!(rand()%4)) - Timer[EVENT_DARK_BARRAGE] = 10000; - Timer[EVENT_EYE_BLAST] = 10000 + rand()%15 * 1000; - Timer[EVENT_MOVE_POINT] = 20000 + rand()%20 * 1000; - break; - case PHASE_DEMON: - Timer[EVENT_SHADOW_BLAST] = 1000; - Timer[EVENT_FLAME_BURST] = 10000; - Timer[EVENT_SHADOWDEMON] = 30000; - Timer[EVENT_TRANSFORM_DEMON] = 60000; - AttackStart(me->getVictim()); - break; - case PHASE_TALK_SEQUENCE: - Timer[EVENT_TALK_SEQUENCE] = 100; - me->RemoveAllAuras(); - me->InterruptNonMeleeSpells(false); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE); - me->GetMotionMaster()->Clear(false); - me->AttackStop(); - break; - case PHASE_FLIGHT_SEQUENCE: - if (Phase == PHASE_NORMAL) //lift off - { - FlightCount = 1; - Timer[EVENT_FLIGHT_SEQUENCE] = 1; - me->RemoveAllAuras(); - me->InterruptNonMeleeSpells(false); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->GetMotionMaster()->Clear(false); - me->AttackStop(); - } - else //land - Timer[EVENT_FLIGHT_SEQUENCE] = 2000; - break; - case PHASE_TRANSFORM_SEQUENCE: - if (Phase == PHASE_DEMON) - Timer[EVENT_TRANSFORM_SEQUENCE] = 500; - else - { - TransformCount = 0; - Timer[EVENT_TRANSFORM_SEQUENCE] = 500; - me->MonsterYell(SAY_MORPH, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(me, SOUND_MORPH); - } - me->GetMotionMaster()->Clear(); - me->AttackStop(); - break; - default: - break; - } - if (MaievGUID) - { - GETCRE(Maiev, MaievGUID); - if (Maiev && Maiev->isAlive()) - Maiev->AI()->DoAction(NextPhase); - } - Phase = NextPhase; - Event = EVENT_NULL; -} - -CreatureAI* GetAI_boss_illidan_stormrage(Creature* pCreature) -{ - return new boss_illidan_stormrageAI (pCreature); -} - -CreatureAI* GetAI_npc_akama_at_illidan(Creature* pCreature) -{ - return new npc_akama_illidanAI(pCreature); -} - -CreatureAI* GetAI_boss_maiev(Creature* pCreature) -{ - return new boss_maievAI (pCreature); -} - -CreatureAI* GetAI_mob_flame_of_azzinoth(Creature* pCreature) -{ - return new flame_of_azzinothAI (pCreature); -} - -CreatureAI* GetAI_cage_trap_trigger(Creature* pCreature) -{ - return new cage_trap_triggerAI (pCreature); -} - -CreatureAI* GetAI_shadow_demon(Creature* pCreature) -{ - return new shadow_demonAI (pCreature); -} - -CreatureAI* GetAI_blade_of_azzinoth(Creature* pCreature) -{ - return new blade_of_azzinothAI (pCreature); -} - -CreatureAI* GetAI_parasitic_shadowfiend(Creature* pCreature) -{ - return new mob_parasitic_shadowfiendAI (pCreature); -} - -void AddSC_boss_illidan() -{ - Script* newscript; - - newscript = new Script; - newscript->Name = "boss_illidan_stormrage"; - newscript->GetAI = &GetAI_boss_illidan_stormrage; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_akama_illidan"; - newscript->GetAI = &GetAI_npc_akama_at_illidan; - newscript->pGossipHello = &GossipHello_npc_akama_at_illidan; - newscript->pGossipSelect = &GossipSelect_npc_akama_at_illidan; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_maiev_shadowsong"; - newscript->GetAI = &GetAI_boss_maiev; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_flame_of_azzinoth"; - newscript->GetAI = &GetAI_mob_flame_of_azzinoth; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_blade_of_azzinoth"; - newscript->GetAI = &GetAI_blade_of_azzinoth; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "gameobject_cage_trap"; - newscript->pGOHello = &GOHello_cage_trap; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_cage_trap_trigger"; - newscript->GetAI = &GetAI_cage_trap_trigger; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_shadow_demon"; - newscript->GetAI = &GetAI_shadow_demon; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_parasitic_shadowfiend"; - newscript->GetAI = &GetAI_parasitic_shadowfiend; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Outland/black_temple/boss_mother_shahraz.cpp b/src/server/scripts/Outland/black_temple/boss_mother_shahraz.cpp deleted file mode 100644 index 5949fc46511..00000000000 --- a/src/server/scripts/Outland/black_temple/boss_mother_shahraz.cpp +++ /dev/null @@ -1,302 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Mother_Shahraz -SD%Complete: 80 -SDComment: Saber Lash missing, Fatal Attraction slightly incorrect; need to damage only if affected players are within range of each other -SDCategory: Black Temple -EndScriptData */ - -#include "ScriptedPch.h" -#include "black_temple.h" - -//Speech'n'Sounds -#define SAY_TAUNT1 -1564018 -#define SAY_TAUNT2 -1564019 -#define SAY_TAUNT3 -1564020 -#define SAY_AGGRO -1564021 -#define SAY_SPELL1 -1564022 -#define SAY_SPELL2 -1564023 -#define SAY_SPELL3 -1564024 -#define SAY_SLAY1 -1564025 -#define SAY_SLAY2 -1564026 -#define SAY_ENRAGE -1564027 -#define SAY_DEATH -1564028 - -//Spells -#define SPELL_BEAM_SINISTER 40859 -#define SPELL_BEAM_VILE 40860 -#define SPELL_BEAM_WICKED 40861 -#define SPELL_BEAM_SINFUL 40827 -#define SPELL_ATTRACTION 40871 -#define SPELL_SILENCING_SHRIEK 40823 -#define SPELL_ENRAGE 23537 -#define SPELL_SABER_LASH 40810//43267 -#define SPELL_SABER_LASH_IMM 43690 -#define SPELL_TELEPORT_VISUAL 40869 -#define SPELL_BERSERK 45078 - -uint32 PrismaticAuras[]= -{ - 40880, // Shadow - 40882, // Fire - 40883, // Nature - 40891, // Arcane - 40896, // Frost - 40897, // Holy -}; - -struct Locations -{ - float x,y,z; -}; - -static Locations TeleportPoint[]= -{ - {959.996, 212.576, 193.843}, - {932.537, 231.813, 193.838}, - {958.675, 254.767, 193.822}, - {946.955, 201.316, 192.535}, - {944.294, 149.676, 197.551}, - {930.548, 284.888, 193.367}, - {965.997, 278.398, 195.777} -}; - -struct boss_shahrazAI : public ScriptedAI -{ - boss_shahrazAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint64 TargetGUID[3]; - uint32 BeamTimer; - uint32 BeamCount; - uint32 CurrentBeam; - uint32 PrismaticShieldTimer; - uint32 FatalAttractionTimer; - uint32 FatalAttractionExplodeTimer; - uint32 ShriekTimer; - uint32 SaberTimer; - uint32 RandomYellTimer; - uint32 EnrageTimer; - uint32 ExplosionCount; - - bool Enraged; - - void Reset() - { - if (pInstance) - pInstance->SetData(DATA_MOTHERSHAHRAZEVENT, NOT_STARTED); - - for (uint8 i = 0; i<3; ++i) - TargetGUID[i] = 0; - - BeamTimer = 20000; // Timers may be incorrect - BeamCount = 0; - CurrentBeam = 0; // 0 - Sinister, 1 - Vile, 2 - Wicked, 3 - Sinful - PrismaticShieldTimer = 0; - FatalAttractionTimer = 60000; - FatalAttractionExplodeTimer = 70000; - ShriekTimer = 30000; - SaberTimer = 35000; - RandomYellTimer = 70000 + rand()%41 * 1000; - EnrageTimer = 600000; - ExplosionCount = 0; - - Enraged = false; - } - - void EnterCombat(Unit * /*who*/) - { - if (pInstance) - pInstance->SetData(DATA_MOTHERSHAHRAZEVENT, IN_PROGRESS); - - DoZoneInCombat(); - DoScriptText(SAY_AGGRO, me); - } - - void KilledUnit(Unit * /*victim*/) - { - DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me); - } - - void JustDied(Unit * /*victim*/) - { - if (pInstance) - pInstance->SetData(DATA_MOTHERSHAHRAZEVENT, DONE); - - DoScriptText(SAY_DEATH, me); - } - - void TeleportPlayers() - { - uint32 random = rand()%7; - float X = TeleportPoint[random].x; - float Y = TeleportPoint[random].y; - float Z = TeleportPoint[random].z; - for (uint8 i = 0; i < 3; ++i) - { - Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 1); - if (pUnit && pUnit->isAlive() && (pUnit->GetTypeId() == TYPEID_PLAYER)) - { - TargetGUID[i] = pUnit->GetGUID(); - pUnit->CastSpell(pUnit, SPELL_TELEPORT_VISUAL, true); - DoTeleportPlayer(pUnit, X, Y, Z, pUnit->GetOrientation()); - } - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (((me->GetHealth()*100 / me->GetMaxHealth()) < 10) && !Enraged) - { - Enraged = true; - DoCast(me, SPELL_ENRAGE, true); - DoScriptText(SAY_ENRAGE, me); - } - - //Randomly cast one beam. - if (BeamTimer <= diff) - { - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (!pTarget || !pTarget->isAlive()) - return; - - BeamTimer = 9000; - - switch(CurrentBeam) - { - case 0: - DoCast(pTarget, SPELL_BEAM_SINISTER); - break; - case 1: - DoCast(pTarget, SPELL_BEAM_VILE); - break; - case 2: - DoCast(pTarget, SPELL_BEAM_WICKED); - break; - case 3: - DoCast(pTarget, SPELL_BEAM_SINFUL); - break; - } - ++BeamCount; - uint32 Beam = CurrentBeam; - if (BeamCount > 3) - while (CurrentBeam == Beam) - CurrentBeam = rand()%3; - - } else BeamTimer -= diff; - - // Random Prismatic Shield every 15 seconds. - if (PrismaticShieldTimer <= diff) - { - uint32 random = rand()%6; - if (PrismaticAuras[random]) - DoCast(me, PrismaticAuras[random]); - PrismaticShieldTimer = 15000; - } else PrismaticShieldTimer -= diff; - - // Select 3 random targets (can select same target more than once), teleport to a random location then make them cast explosions until they get away from each other. - if (FatalAttractionTimer <= diff) - { - ExplosionCount = 0; - - TeleportPlayers(); - - DoScriptText(RAND(SAY_SPELL2,SAY_SPELL3), me); - FatalAttractionExplodeTimer = 2000; - FatalAttractionTimer = 40000 + rand()%31 * 1000; - } else FatalAttractionTimer -= diff; - - if (FatalAttractionExplodeTimer <= diff) - { - // Just make them explode three times... they're supposed to keep exploding while they are in range, but it'll take too much code. I'll try to think of an efficient way for it later. - if (ExplosionCount < 3) - { - for (uint8 i = 0; i < 3; ++i) - { - Unit* pUnit = NULL; - if (TargetGUID[i]) - { - pUnit = Unit::GetUnit((*me), TargetGUID[i]); - if (pUnit) - pUnit->CastSpell(pUnit, SPELL_ATTRACTION, true); - TargetGUID[i] = 0; - } - } - - ++ExplosionCount; - FatalAttractionExplodeTimer = 1000; - } - else - { - FatalAttractionExplodeTimer = FatalAttractionTimer + 2000; - ExplosionCount = 0; - } - } else FatalAttractionExplodeTimer -= diff; - - if (ShriekTimer <= diff) - { - DoCast(me->getVictim(), SPELL_SILENCING_SHRIEK); - ShriekTimer = 25000+rand()%10 * 1000; - } else ShriekTimer -= diff; - - if (SaberTimer <= diff) - { - DoCast(me->getVictim(), SPELL_SABER_LASH); - SaberTimer = 25000+rand()%10 * 1000; - } else SaberTimer -= diff; - - //Enrage - if (!me->HasAura(SPELL_BERSERK)) - if (EnrageTimer <= diff) - { - DoCast(me, SPELL_BERSERK); - DoScriptText(SAY_ENRAGE, me); - } else EnrageTimer -= diff; - - //Random taunts - if (RandomYellTimer <= diff) - { - DoScriptText(RAND(SAY_TAUNT1,SAY_TAUNT2,SAY_TAUNT3), me); - RandomYellTimer = 60000 + rand()%91 * 1000; - } else RandomYellTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_shahraz(Creature* pCreature) -{ - return new boss_shahrazAI (pCreature); -} - -void AddSC_boss_mother_shahraz() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_mother_shahraz"; - newscript->GetAI = &GetAI_boss_shahraz; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Outland/black_temple/boss_reliquary_of_souls.cpp b/src/server/scripts/Outland/black_temple/boss_reliquary_of_souls.cpp deleted file mode 100644 index 3e019a8dc35..00000000000 --- a/src/server/scripts/Outland/black_temple/boss_reliquary_of_souls.cpp +++ /dev/null @@ -1,690 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -/* ScriptData -SDName: Boss_Reliquary_of_Souls -SD%Complete: 90 -SDComment: -SDCategory: Black Temple -EndScriptData */ - -#include "ScriptedPch.h" -#include "black_temple.h" -#include "Spell.h" - -//Sound'n'speech -//Suffering -#define SUFF_SAY_FREED -1564047 -#define SUFF_SAY_AGGRO -1564048 -#define SUFF_SAY_SLAY1 -1564049 -#define SUFF_SAY_SLAY2 -1564050 -#define SUFF_SAY_SLAY3 -1564051 -#define SUFF_SAY_RECAP -1564052 -#define SUFF_SAY_AFTER -1564053 -#define SUFF_EMOTE_ENRAGE -1564054 - -//Desire -#define DESI_SAY_FREED -1564055 -#define DESI_SAY_SLAY1 -1564056 -#define DESI_SAY_SLAY2 -1564057 -#define DESI_SAY_SLAY3 -1564058 -#define DESI_SAY_SPEC -1564059 -#define DESI_SAY_RECAP -1564060 -#define DESI_SAY_AFTER -1564061 - -//Anger -#define ANGER_SAY_FREED -1564062 -#define ANGER_SAY_FREED2 -1564063 -#define ANGER_SAY_SLAY1 -1564064 -#define ANGER_SAY_SLAY2 -1564065 -#define ANGER_SAY_SPEC -1564066 -#define ANGER_SAY_BEFORE -1564067 -#define ANGER_SAY_DEATH -1564068 - -//Spells -#define AURA_OF_SUFFERING 41292 -#define AURA_OF_SUFFERING_ARMOR 42017 // linked aura, need core support -#define ESSENCE_OF_SUFFERING_PASSIVE 41296 // periodic trigger 41294 -#define ESSENCE_OF_SUFFERING_PASSIVE2 41623 -#define SPELL_FIXATE_TARGET 41294 // dummy, select target -#define SPELL_FIXATE_TAUNT 41295 // force taunt -#define SPELL_ENRAGE 41305 -#define SPELL_SOUL_DRAIN 41303 - -#define AURA_OF_DESIRE 41350 -#define AURA_OF_DESIRE_DAMAGE 41352 -#define SPELL_RUNE_SHIELD 41431 -#define SPELL_DEADEN 41410 -#define SPELL_SOUL_SHOCK 41426 - -#define AURA_OF_ANGER 41337 -#define SPELL_SELF_SEETHE 41364 // force cast 41520 -#define SPELL_ENEMY_SEETHE 41520 -#define SPELL_SOUL_SCREAM 41545 -#define SPELL_SPITE_TARGET 41376 // cast 41377 after 6 sec -#define SPELL_SPITE_DAMAGE 41377 - -#define ENSLAVED_SOUL_PASSIVE 41535 -#define SPELL_SOUL_RELEASE 41542 -#define SPELL_SUBMERGE 37550 //dropout 'head' - -#define CREATURE_ENSLAVED_SOUL 23469 -#define NUMBER_ENSLAVED_SOUL 8 - -struct Position2d -{ - float x,y; -}; - -static Position2d Coords[]= -{ - {450.4, 212.3}, - {542.1, 212.3}, - {542.1, 168.3}, - {542.1, 137.4}, - {450.4, 137.4}, - {450.4, 168.3} -}; - -struct npc_enslaved_soulAI : public ScriptedAI -{ - npc_enslaved_soulAI(Creature *c) : ScriptedAI(c) {} - - uint64 ReliquaryGUID; - - void Reset() {ReliquaryGUID = 0;} - - void EnterCombat(Unit* /*who*/) - { - DoCast(me, ENSLAVED_SOUL_PASSIVE, true); - DoZoneInCombat(); - } - - void JustDied(Unit *killer); -}; - -struct boss_reliquary_of_soulsAI : public ScriptedAI -{ - boss_reliquary_of_soulsAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - EssenceGUID = 0; - } - - ScriptedInstance* pInstance; - - uint64 EssenceGUID; - - uint32 Phase; - uint32 Counter; - uint32 Timer; - - uint32 SoulCount; - uint32 SoulDeathCount; - - void Reset() - { - if (pInstance) - pInstance->SetData(DATA_RELIQUARYOFSOULSEVENT, NOT_STARTED); - - if (EssenceGUID) - { - if (Creature* Essence = Unit::GetCreature(*me, EssenceGUID)) - { - Essence->ForcedDespawn(); - } - EssenceGUID = 0; - } - - Phase = 0; - - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE); - me->RemoveAurasDueToSpell(SPELL_SUBMERGE); - } - - void EnterCombat(Unit* who) - { - me->AddThreat(who, 10000.0f); - DoZoneInCombat(); - if (pInstance) - pInstance->SetData(DATA_RELIQUARYOFSOULSEVENT, IN_PROGRESS); - - Phase = 1; - Counter = 0; - Timer = 0; - } - - bool SummonSoul() - { - uint32 random = rand()%6; - float x = Coords[random].x; - float y = Coords[random].y; - Creature* Soul = me->SummonCreature(CREATURE_ENSLAVED_SOUL, x, y, me->GetPositionZ(), me->GetOrientation(), TEMPSUMMON_CORPSE_DESPAWN, 0); - if (!Soul) return false; - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - CAST_AI(npc_enslaved_soulAI, Soul->AI())->ReliquaryGUID = me->GetGUID(); - Soul->AI()->AttackStart(pTarget); - } else EnterEvadeMode(); - return true; - } - - void MergeThreatList(Creature *pTarget) - { - if (!pTarget) - return; - - std::list& m_threatlist = pTarget->getThreatManager().getThreatList(); - std::list::const_iterator itr = m_threatlist.begin(); - for (; itr != m_threatlist.end(); ++itr) - { - Unit* pUnit = Unit::GetUnit((*me), (*itr)->getUnitGuid()); - if (pUnit) - { - DoModifyThreatPercent(pUnit, -100); - float threat = pTarget->getThreatManager().getThreat(pUnit); - me->AddThreat(pUnit, threat); // This makes it so that the unit has the same amount of threat in Reliquary's threatlist as in the target creature's (One of the Essences). - } - } - } - - void JustDied(Unit* /*killer*/) - { - if (pInstance) - pInstance->SetData(DATA_RELIQUARYOFSOULSEVENT, DONE); - } - - void UpdateAI(const uint32 diff) - { - if (!Phase) - return; - - if (me->getThreatManager().getThreatList().empty()) // Reset if event is begun and we don't have a threatlist - { - EnterEvadeMode(); - return; - } - - Creature* Essence = NULL; - if (EssenceGUID) - { - Essence = Unit::GetCreature(*me, EssenceGUID); - if (!Essence) - { - EnterEvadeMode(); - return; - } - } - - if (Timer <= diff) - { - switch(Counter) - { - case 0: - me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY2H); // I R ANNNGRRRY! - DoStartNoMovement(me); - Timer = 3000; - break; - case 1: - Timer = 2800; - me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_SUBMERGE); // Release the cube - DoCast(me, SPELL_SUBMERGE); - DoStartNoMovement(me); - break; - case 2: - Timer = 5000; - if (Creature* Summon = DoSpawnCreature(23417+Phase, 0, 0, 0, 0, TEMPSUMMON_DEAD_DESPAWN, 0)) - { - me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_SUBMERGED); // Ribs: open - Summon->AI()->AttackStart(SelectUnit(SELECT_TARGET_TOPAGGRO, 0)); - EssenceGUID = Summon->GetGUID(); - DoStartNoMovement(me); - } else EnterEvadeMode(); - break; - case 3: - Timer = 1000; - if (Phase == 3) - { - if (!Essence->isAlive()) - DoCast(me, 7, true); - else return; - } - else - { - if (Essence->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE)) - { - MergeThreatList(Essence); - Essence->RemoveAllAuras(); - Essence->DeleteThreatList(); - Essence->GetMotionMaster()->MoveFollow(me,0.0f,0.0f); - } else return; - } - break; - case 4: - Timer = 1500; - if (Essence->IsWithinDistInMap(me, 10)) - { - Essence->SetUInt32Value(UNIT_NPC_EMOTESTATE,374); //rotate and disappear - Timer = 2000; - me->RemoveAurasDueToSpell(SPELL_SUBMERGE); - } - else - { - MergeThreatList(Essence); - Essence->RemoveAllAuras(); - Essence->DeleteThreatList(); - Essence->GetMotionMaster()->MoveFollow(me, 0, 0); - return; - } - break; - case 5: - if (Phase == 1) - { - DoScriptText(SUFF_SAY_AFTER, Essence); - } - else - { - DoScriptText(DESI_SAY_AFTER, Essence); - } - Essence->ForcedDespawn(); - me->SetUInt32Value(UNIT_NPC_EMOTESTATE,0); - EssenceGUID = 0; - SoulCount = 0; - SoulDeathCount = 0; - Timer = 3000; - break; - case 6: - if (SoulCount < NUMBER_ENSLAVED_SOUL) - { - if (SummonSoul()) - ++SoulCount; - Timer = 500; - return; - } - break; - case 7: - if (SoulDeathCount >= SoulCount) - { - Counter = 1; - ++Phase; - Timer = 5000; - } - return; - default: - break; - } - ++Counter; - } else Timer -= diff; - } -}; - -struct boss_essence_of_sufferingAI : public ScriptedAI -{ - boss_essence_of_sufferingAI(Creature *c) : ScriptedAI(c) {} - - uint64 StatAuraGUID; - - uint32 AggroYellTimer; - uint32 FixateTimer; - uint32 EnrageTimer; - uint32 SoulDrainTimer; - uint32 AuraTimer; - - void Reset() - { - StatAuraGUID = 0; - - AggroYellTimer = 5000; - FixateTimer = 8000; - EnrageTimer = 30000; - SoulDrainTimer = 45000; - AuraTimer = 5000; - } - - void DamageTaken(Unit * /*done_by*/, uint32 &damage) - { - if (damage >= me->GetHealth()) - { - damage = 0; - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->Yell(SUFF_SAY_RECAP,LANG_UNIVERSAL,0); - DoScriptText(SUFF_SAY_RECAP, me); - } - } - - void EnterCombat(Unit * /*who*/) - { - if (!me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE)) - { - DoScriptText(SUFF_SAY_FREED, me); - DoZoneInCombat(); - DoCast(me, AURA_OF_SUFFERING, true); // linked aura need core support - DoCast(me, ESSENCE_OF_SUFFERING_PASSIVE, true); - DoCast(me, ESSENCE_OF_SUFFERING_PASSIVE2, true); - } - else return; - } - - void KilledUnit(Unit * /*victim*/) - { - DoScriptText(RAND(SUFF_SAY_SLAY1,SUFF_SAY_SLAY2,SUFF_SAY_SLAY3), me); - } - - void CastFixate() - { - std::list& m_threatlist = me->getThreatManager().getThreatList(); - if (m_threatlist.empty()) - return; // No point continuing if empty threatlist. - std::list targets; - std::list::const_iterator itr = m_threatlist.begin(); - for (; itr != m_threatlist.end(); ++itr) - { - Unit* pUnit = Unit::GetUnit((*me), (*itr)->getUnitGuid()); - if (pUnit && pUnit->isAlive() && (pUnit->GetTypeId() == TYPEID_PLAYER)) // Only alive players - targets.push_back(pUnit); - } - if (targets.empty()) - return; // No targets added for some reason. No point continuing. - targets.sort(Trinity::ObjectDistanceOrderPred(me)); // Sort players by distance. - targets.resize(1); // Only need closest target. - Unit *pTarget = targets.front(); // Get the first target. - if (pTarget) - pTarget->CastSpell(me, SPELL_FIXATE_TAUNT, true); - DoResetThreat(); - me->AddThreat(pTarget,1000000); - } - - void UpdateAI(const uint32 diff) - { - if (me->isInCombat()) - { - //Supposed to be cast on nearest target - if (FixateTimer <= diff) - { - CastFixate(); - FixateTimer = 5000; - if (!(rand()%16)) - { - DoScriptText(SUFF_SAY_AGGRO, me); - } - } else FixateTimer -= diff; - } - - //Return since we have no target - if (!UpdateVictim()) - return; - - if (EnrageTimer <= diff) - { - DoCast(me, SPELL_ENRAGE); - EnrageTimer = 60000; - DoScriptText(SUFF_EMOTE_ENRAGE, me); - } else EnrageTimer -= diff; - - if (SoulDrainTimer <= diff) - { - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_SOUL_DRAIN); - SoulDrainTimer = 60000; - } else SoulDrainTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -struct boss_essence_of_desireAI : public ScriptedAI -{ - boss_essence_of_desireAI(Creature *c) : ScriptedAI(c) {} - - uint32 RuneShieldTimer; - uint32 DeadenTimer; - uint32 SoulShockTimer; - - void Reset() - { - RuneShieldTimer = 60000; - DeadenTimer = 30000; - SoulShockTimer = 5000; - me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_CONFUSE, true); - } - - void DamageTaken(Unit *done_by, uint32 &damage) - { - if (done_by == me) - return; - - if (damage >= me->GetHealth()) - { - damage = 0; - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - DoScriptText(SUFF_SAY_RECAP, me); - } - else - { - int32 bp0 = damage / 2; - me->CastCustomSpell(done_by, AURA_OF_DESIRE_DAMAGE, &bp0, NULL, NULL, true); - } - } - - void SpellHit(Unit * /*caster*/, const SpellEntry *spell) - { - if (me->GetCurrentSpell(CURRENT_GENERIC_SPELL)) - for (uint8 i = 0; i < 3; ++i) - if (spell->Effect[i] == SPELL_EFFECT_INTERRUPT_CAST) - if (me->GetCurrentSpell(CURRENT_GENERIC_SPELL)->m_spellInfo->Id == SPELL_SOUL_SHOCK - || me->GetCurrentSpell(CURRENT_GENERIC_SPELL)->m_spellInfo->Id == SPELL_DEADEN) - me->InterruptSpell(CURRENT_GENERIC_SPELL, false); - } - - void EnterCombat(Unit * /*who*/) - { - DoScriptText(DESI_SAY_FREED, me); - DoZoneInCombat(); - DoCast(me, AURA_OF_DESIRE, true); - } - - void KilledUnit(Unit * /*victim*/) - { - DoScriptText(RAND(DESI_SAY_SLAY1,DESI_SAY_SLAY2,DESI_SAY_SLAY3), me); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (RuneShieldTimer <= diff) - { - me->InterruptNonMeleeSpells(false); - DoCast(me, SPELL_RUNE_SHIELD, true); - SoulShockTimer += 2000; - DeadenTimer += 2000; - RuneShieldTimer = 60000; - } else RuneShieldTimer -= diff; - - if (SoulShockTimer <= diff) - { - DoCast(me->getVictim(), SPELL_SOUL_SHOCK); - SoulShockTimer = 5000; - } else SoulShockTimer -= diff; - - if (DeadenTimer <= diff) - { - me->InterruptNonMeleeSpells(false); - DoCast(me->getVictim(), SPELL_DEADEN); - DeadenTimer = 25000 + rand()%10000; - if (!(rand()%2)) - { - DoScriptText(DESI_SAY_SPEC, me); - } - } else DeadenTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -struct boss_essence_of_angerAI : public ScriptedAI -{ - boss_essence_of_angerAI(Creature *c) : ScriptedAI(c) {} - - uint64 AggroTargetGUID; - - uint32 CheckTankTimer; - uint32 SoulScreamTimer; - uint32 SpiteTimer; - - std::list SpiteTargetGUID; - - bool CheckedAggro; - - void Reset() - { - AggroTargetGUID = 0; - - CheckTankTimer = 5000; - SoulScreamTimer = 10000; - SpiteTimer = 30000; - - SpiteTargetGUID.clear(); - - CheckedAggro = false; - } - - void EnterCombat(Unit * /*who*/) - { - DoScriptText(RAND(ANGER_SAY_FREED,ANGER_SAY_FREED2), me); - - DoZoneInCombat(); - DoCast(me, AURA_OF_ANGER, true); - } - - void JustDied(Unit * /*victim*/) - { - DoScriptText(ANGER_SAY_DEATH, me); - } - - void KilledUnit(Unit * /*victim*/) - { - DoScriptText(RAND(ANGER_SAY_SLAY1,ANGER_SAY_SLAY2), me); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - if (!CheckedAggro) - { - AggroTargetGUID = me->getVictim()->GetGUID(); - CheckedAggro = true; - } - - if (CheckTankTimer <= diff) - { - if (me->getVictim()->GetGUID() != AggroTargetGUID) - { - DoScriptText(ANGER_SAY_BEFORE, me); - DoCast(me, SPELL_SELF_SEETHE, true); - AggroTargetGUID = me->getVictim()->GetGUID(); - } - CheckTankTimer = 2000; - } else CheckTankTimer -= diff; - - if (SoulScreamTimer <= diff) - { - DoCast(me->getVictim(), SPELL_SOUL_SCREAM); - SoulScreamTimer = 9000 + rand()%2000; - if (!(rand()%3)) - { - DoScriptText(ANGER_SAY_SPEC, me); - } - } else SoulScreamTimer -= diff; - - if (SpiteTimer <= diff) - { - DoCast(me, SPELL_SPITE_TARGET); - SpiteTimer = 30000; - DoScriptText(ANGER_SAY_SPEC, me); - } else SpiteTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -void npc_enslaved_soulAI::JustDied(Unit * /*killer*/) -{ - if (ReliquaryGUID) - if (Creature *Reliquary = (Unit::GetCreature((*me), ReliquaryGUID))) - ++(CAST_AI(boss_reliquary_of_soulsAI, Reliquary->AI())->SoulDeathCount); - - DoCast(me, SPELL_SOUL_RELEASE, true); -} - -CreatureAI* GetAI_boss_reliquary_of_souls(Creature* pCreature) -{ - return new boss_reliquary_of_soulsAI (pCreature); -} - -CreatureAI* GetAI_boss_essence_of_suffering(Creature* pCreature) -{ - return new boss_essence_of_sufferingAI (pCreature); -} - -CreatureAI* GetAI_boss_essence_of_desire(Creature* pCreature) -{ - return new boss_essence_of_desireAI (pCreature); -} - -CreatureAI* GetAI_boss_essence_of_anger(Creature* pCreature) -{ - return new boss_essence_of_angerAI (pCreature); -} - -CreatureAI* GetAI_npc_enslaved_soul(Creature* pCreature) -{ - return new npc_enslaved_soulAI (pCreature); -} - -void AddSC_boss_reliquary_of_souls() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_reliquary_of_souls"; - newscript->GetAI = &GetAI_boss_reliquary_of_souls; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_essence_of_suffering"; - newscript->GetAI = &GetAI_boss_essence_of_suffering; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_essence_of_desire"; - newscript->GetAI = &GetAI_boss_essence_of_desire; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_essence_of_anger"; - newscript->GetAI = &GetAI_boss_essence_of_anger; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_enslaved_soul"; - newscript->GetAI = &GetAI_npc_enslaved_soul; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Outland/black_temple/boss_shade_of_akama.cpp b/src/server/scripts/Outland/black_temple/boss_shade_of_akama.cpp deleted file mode 100644 index 94f88d5715c..00000000000 --- a/src/server/scripts/Outland/black_temple/boss_shade_of_akama.cpp +++ /dev/null @@ -1,871 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Shade_of_Akama -SD%Complete: 90 -SDComment: Seems to be complete. -SDCategory: Black Temple -EndScriptData */ - -#include "ScriptedPch.h" -#include "black_temple.h" - -#define SAY_DEATH -1564013 -#define SAY_LOW_HEALTH -1564014 -// Ending cinematic text -#define SAY_FREE -1564015 -#define SAY_BROKEN_FREE_01 -1564016 -#define SAY_BROKEN_FREE_02 -1564017 - -#define GOSSIP_ITEM "We are ready to fight alongside you, Akama" - -struct Location -{ - float x, y, o, z; -}; - -static Location ChannelerLocations[]= -{ - {463.161285, 401.219757, 3.141592}, - {457.377625, 391.227661, 2.106461}, - {446.012421, 391.227661, 1.071904}, - {439.533783, 401.219757, 0.000000}, - {446.012421, 411.211853, 5.210546}, - {457.377625, 411.211853, 4.177494} -}; - -static Location SpawnLocations[]= -{ - {498.652740, 461.728119, 0}, - {498.505003, 339.619324, 0} -}; - -static Location AkamaWP[]= -{ - {482.352448, 401.162720, 0, 112.783928}, - {469.597443, 402.264404, 0, 118.537910} -}; - -static Location BrokenCoords[]= -{ - {541.375916, 401.439575, M_PI, 112.783997}, // The place where Akama channels - {534.130005, 352.394531, 2.164150, 112.783737}, // Behind a 'pillar' which is behind the east alcove - {499.621185, 341.534729, 1.652856, 112.783730}, // East Alcove - {499.151093, 461.036438, 4.770888, 112.78370}, // West Alcove -}; - -static Location BrokenWP[]= -{ - {492.491638, 400.744690, 3.122336, 112.783737}, - {494.335724, 382.221771, 2.676230, 112.783737}, - {489.555939, 373.507202, 2.416263, 112.783737}, - {491.136353, 427.868774, 3.519748, 112.783737}, -}; - -// Locations -#define Z1 118.543144 -#define Z2 120.783768 -#define Z_SPAWN 113.537949 -#define AGGRO_X 482.793182 -#define AGGRO_Y 401.270172 -#define AGGRO_Z 112.783928 -#define AKAMA_X 514.583984 -#define AKAMA_Y 400.601013 -#define AKAMA_Z 112.783997 - -// Spells -#define SPELL_VERTEX_SHADE_BLACK 39833 -#define SPELL_SHADE_SOUL_CHANNEL 40401 -#define SPELL_DESTRUCTIVE_POISON 40874 -#define SPELL_LIGHTNING_BOLT 42024 -#define SPELL_AKAMA_SOUL_CHANNEL 40447 -#define SPELL_AKAMA_SOUL_RETRIEVE 40902 -#define AKAMA_SOUL_EXPEL 40855 -#define SPELL_SHADE_SOUL_CHANNEL_2 40520 - -// Channeler entry -#define CREATURE_CHANNELER 23421 -#define CREATURE_SORCERER 23215 -#define CREATURE_DEFENDER 23216 -#define CREATURE_BROKEN 23319 - -const uint32 spawnEntries[4]= { 23523, 23318, 23524 }; - -struct mob_ashtongue_channelerAI : public ScriptedAI -{ - mob_ashtongue_channelerAI(Creature* c) : ScriptedAI(c) {ShadeGUID = 0;} - - uint64 ShadeGUID; - - void Reset() {} - void JustDied(Unit* /*killer*/); - void EnterCombat(Unit* /*who*/) {} - void AttackStart(Unit* /*who*/) {} - void MoveInLineOfSight(Unit* /*who*/) {} - void UpdateAI(const uint32 /*diff*/) {} -}; - -struct mob_ashtongue_sorcererAI : public ScriptedAI -{ - mob_ashtongue_sorcererAI(Creature* c) : ScriptedAI(c) {ShadeGUID = 0;} - - uint64 ShadeGUID; - uint32 CheckTimer; - bool StartBanishing; - - void Reset() - { - StartBanishing = false; - CheckTimer = 5000; - } - - void JustDied(Unit* /*killer*/); - void EnterCombat(Unit* /*who*/) {} - void AttackStart(Unit* /*who*/) {} - void MoveInLineOfSight(Unit* /*who*/) {} - void UpdateAI(const uint32 diff) - { - if (StartBanishing) - return; - - if (CheckTimer <= diff) - { - Creature* Shade = Unit::GetCreature((*me), ShadeGUID); - if (Shade && Shade->isAlive() && me->isAlive()) - { - if (me->IsWithinDist(Shade, 20,false)) - { - me->GetMotionMaster()->Clear(false); - me->GetMotionMaster()->MoveIdle(); - DoCast(Shade, SPELL_SHADE_SOUL_CHANNEL, true); - DoCast(Shade, SPELL_SHADE_SOUL_CHANNEL_2, true); - - StartBanishing = true; - } - } - CheckTimer = 2000; - } else CheckTimer -= diff; - } -}; - -struct boss_shade_of_akamaAI : public ScriptedAI -{ - boss_shade_of_akamaAI(Creature* c) : ScriptedAI(c), summons(me) - { - pInstance = c->GetInstanceData(); - AkamaGUID = pInstance ? pInstance->GetData64(DATA_AKAMA_SHADE) : 0; - me->setActive(true);//if view distance is too low - me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true); - me->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true); - } - - ScriptedInstance* pInstance; - - std::list Channelers; - std::list Sorcerers; - uint64 AkamaGUID; - - uint32 SorcererCount; - uint32 DeathCount; - - uint32 ReduceHealthTimer; - uint32 SummonTimer; - uint32 ResetTimer; - uint32 DefenderTimer; // They are on a flat 15 second timer, independant of the other summon Creature timer. - - bool IsBanished; - bool HasKilledAkama; - bool reseting; - bool GridSearcherSucceeded; - bool HasKilledAkamaAndReseting; - SummonList summons; - - void Reset() - { - reseting = true; - HasKilledAkamaAndReseting = false; - - GridSearcherSucceeded = false; - - Sorcerers.clear(); - summons.DespawnAll();//despawn all adds - - if (Creature* Akama = Unit::GetCreature(*me, AkamaGUID)) - { - Akama->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);//turn gossip on so players can restart the event - if (Akama->isDead()) - { - Akama->Respawn();//respawn akama if dead - Akama->AI()->EnterEvadeMode(); - } - } - SorcererCount = 0; - DeathCount = 0; - - SummonTimer = 10000; - ReduceHealthTimer = 0; - ResetTimer = 60000; - DefenderTimer = 15000; - - IsBanished = true; - HasKilledAkama = false; - - me->SetVisibility(VISIBILITY_ON); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - //me->GetMotionMaster()->Clear(); - //me->GetMotionMaster()->MoveIdle(); - me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_STUN); - - if (pInstance) - pInstance->SetData(DATA_SHADEOFAKAMAEVENT, NOT_STARTED); - - reseting = false; - } - void JustDied(Unit* /*killer*/) - { - summons.DespawnAll(); - } - void JustSummoned(Creature *summon) - { - if (summon->GetEntry() == CREATURE_DEFENDER || summon->GetEntry() == 23523 || summon->GetEntry() == 23318 || summon->GetEntry() == 23524) - summons.Summon(summon); - } - void SummonedCreatureDespawn(Creature *summon) - { - if (summon->GetEntry() == CREATURE_DEFENDER || summon->GetEntry() == 23523 || summon->GetEntry() == 23318 || summon->GetEntry() == 23524) - summons.Despawn(summon); - } - - void MoveInLineOfSight(Unit * /*who*/) - { - if (!GridSearcherSucceeded) - { - FindChannelers(); - - if (!Channelers.empty()) - { - for (std::list::const_iterator itr = Channelers.begin(); itr != Channelers.end(); ++itr) - { - Creature* Channeler = (Unit::GetCreature(*me, *itr)); - if (Channeler) - { - if (Channeler->isDead()) - { - Channeler->RemoveCorpse(); - Channeler->Respawn(); - } - - Channeler->CastSpell(me, SPELL_SHADE_SOUL_CHANNEL, true); - Channeler->CastSpell(me, SPELL_SHADE_SOUL_CHANNEL_2, true); - Channeler->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - GridSearcherSucceeded = true; - } - } - } else error_log("SD2 ERROR: No Channelers are stored in the list. This encounter will not work properly"); - } - } - - void AttackStart(Unit* who) - { - if (!who || IsBanished) return; - - if (who->isTargetableForAttack() && who != me) - DoStartMovement(who); - } - - void IncrementDeathCount(uint64 guid = 0) // If guid is set, will remove it from list of sorcerer - { - if (reseting) - return; - - debug_log("TSCR: Increasing Death Count for Shade of Akama encounter"); - ++DeathCount; - me->RemoveAuraFromStack(SPELL_SHADE_SOUL_CHANNEL_2); - if (guid) - { - if (Sorcerers.empty()) - error_log("SD2 ERROR: Shade of Akama - attempt to remove guid %u from Sorcerers list but list is already empty", guid); - else Sorcerers.remove(guid); - } - } - - void SummonCreature() - { - uint32 random = rand()%2; - float X = SpawnLocations[random].x; - float Y = SpawnLocations[random].y; - // max of 6 sorcerers can be summoned - if ((rand()%3 == 0) && (DeathCount > 0) && (SorcererCount < 7)) - { - Creature* Sorcerer = me->SummonCreature(CREATURE_SORCERER, X, Y, Z_SPAWN, 0, TEMPSUMMON_DEAD_DESPAWN, 0); - if (Sorcerer) - { - CAST_AI(mob_ashtongue_sorcererAI, Sorcerer->AI())->ShadeGUID = me->GetGUID(); - Sorcerer->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - Sorcerer->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()); - Sorcerer->SetUInt64Value(UNIT_FIELD_TARGET, me->GetGUID()); - Sorcerers.push_back(Sorcerer->GetGUID()); - --DeathCount; - ++SorcererCount; - } - } - else - { - for (uint8 i = 0; i < 3; ++i) - { - Creature* Spawn = me->SummonCreature(spawnEntries[i], X, Y, Z_SPAWN, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 25000); - if (Spawn) - { - Spawn->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - Spawn->GetMotionMaster()->MovePoint(0, AGGRO_X, AGGRO_Y, AGGRO_Z); - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1); - Spawn->AI()->AttackStart(pTarget); - } - } - } - } - - void FindChannelers() - { - std::list ChannelerList; - me->GetCreatureListWithEntryInGrid(ChannelerList,CREATURE_CHANNELER,50.0f); - - if (!ChannelerList.empty()) - { - for (std::list::const_iterator itr = ChannelerList.begin(); itr != ChannelerList.end(); ++itr) - { - CAST_AI(mob_ashtongue_channelerAI, (*itr)->AI())->ShadeGUID = me->GetGUID(); - Channelers.push_back((*itr)->GetGUID()); - debug_log("TSCR: Shade of Akama Grid Search found channeler %u. Adding to list", (*itr)->GetGUID()); - } - } - else error_log("SD2 ERROR: Grid Search was unable to find any channelers. Shade of Akama encounter will be buggy"); - } - - void SetSelectableChannelers() - { - if (Channelers.empty()) - { - error_log("SD2 ERROR: Channeler List is empty, Shade of Akama encounter will be buggy"); - return; - } - - for (std::list::const_iterator itr = Channelers.begin(); itr != Channelers.end(); ++itr) - if (Creature* Channeler = (Unit::GetCreature(*me, *itr))) - Channeler->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - } - - void SetAkamaGUID(uint64 guid) { AkamaGUID = guid; } - - void UpdateAI(const uint32 diff) - { - if (!me->isInCombat()) - return; - - if (IsBanished) - { - // Akama is set in the threatlist so when we reset, we make sure that he is not included in our check - if (me->getThreatManager().getThreatList().size() < 2) - { - EnterEvadeMode(); - return; - } - - if (DefenderTimer <= diff) - { - uint32 ran = rand()%2; - Creature* Defender = me->SummonCreature(CREATURE_DEFENDER, SpawnLocations[ran].x, SpawnLocations[ran].y, Z_SPAWN, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 25000); - if (Defender) - { - Defender->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - bool move = true; - if (AkamaGUID) - { - if (Creature* Akama = Unit::GetCreature(*me, AkamaGUID)) - { - float x, y, z; - Akama->GetPosition(x,y,z); - // They move towards AKama - Defender->GetMotionMaster()->MovePoint(0, x, y, z); - Defender->AI()->AttackStart(Akama); - } else move = false; - } else move = false; - if (!move) - Defender->GetMotionMaster()->MovePoint(0, AKAMA_X, AKAMA_Y, AKAMA_Z); - } - DefenderTimer = 15000; - } else DefenderTimer -= diff; - - if (SummonTimer <= diff) - { - SummonCreature(); - SummonTimer = 35000; - } else SummonTimer -= diff; - - if (DeathCount >= 6) - { - if (AkamaGUID) - { - Creature* Akama = Unit::GetCreature((*me), AkamaGUID); - if (Akama && Akama->isAlive()) - { - IsBanished = false; - me->GetMotionMaster()->Clear(false); - me->GetMotionMaster()->MoveChase(Akama); - Akama->GetMotionMaster()->Clear(); - // Shade should move to Akama, not the other way around - Akama->GetMotionMaster()->MoveIdle(); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - // Crazy amount of threat - me->AddThreat(Akama, 10000000.0f); - Akama->AddThreat(me, 10000000.0f); - me->Attack(Akama, true); - Akama->Attack(me, true); - } - } - } - } - else // No longer banished, let's fight Akama now - { - if (ReduceHealthTimer <= diff) - { - if (AkamaGUID) - { - Creature* Akama = Unit::GetCreature((*me), AkamaGUID); - if (Akama && Akama->isAlive()) - { - //10 % less health every few seconds. - me->DealDamage(Akama, Akama->GetMaxHealth()/10, NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - ReduceHealthTimer = 12000; - } - } - } else ReduceHealthTimer -= diff; - - if (HasKilledAkama) - { - if (!HasKilledAkamaAndReseting)//do not let players kill Shade if Akama is dead and Shade is waiting for ResetTimer!! event would bug - { - HasKilledAkamaAndReseting = true; - me->RemoveAllAuras(); - me->DeleteThreatList(); - me->CombatStop(); - //me->SetHealth(me->GetMaxHealth()); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->GetMotionMaster()->MoveTargetedHome(); - } - if (ResetTimer <= diff) - { - EnterEvadeMode();// Reset a little while after killing Akama, evade and respawn Akama - return; - } else ResetTimer -= diff; - } - - DoMeleeAttackIfReady(); - } - } -}; - -void mob_ashtongue_channelerAI::JustDied(Unit* /*killer*/) -{ - Creature* Shade = (Unit::GetCreature((*me), ShadeGUID)); - if (Shade && Shade->isAlive()) - CAST_AI(boss_shade_of_akamaAI, Shade->AI())->IncrementDeathCount(); - else error_log("SD2 ERROR: Channeler dead but unable to increment DeathCount for Shade of Akama."); -} - -void mob_ashtongue_sorcererAI::JustDied(Unit* /*killer*/) -{ - Creature* Shade = (Unit::GetCreature((*me), ShadeGUID)); - if (Shade && Shade->isAlive()) - CAST_AI(boss_shade_of_akamaAI, Shade->AI())->IncrementDeathCount(me->GetGUID()); - else error_log("SD2 ERROR: Sorcerer dead but unable to increment DeathCount for Shade of Akama."); -} - -struct npc_akamaAI : public ScriptedAI -{ - npc_akamaAI(Creature* c) : ScriptedAI(c), summons(me) - { - ShadeHasDied = false; - StartCombat = false; - pInstance = c->GetInstanceData(); - ShadeGUID = pInstance ? pInstance->GetData64(DATA_SHADEOFAKAMA) : NOT_STARTED; - me->setActive(true); - EventBegun = false; - CastSoulRetrieveTimer = 0; - SoulRetrieveTimer = 0; - SummonBrokenTimer = 0; - EndingTalkCount = 0; - WayPointId = 0; - BrokenSummonIndex = 0; - BrokenList.clear(); - HasYelledOnce = false; - } - - ScriptedInstance* pInstance; - - uint64 ShadeGUID; - - uint32 DestructivePoisonTimer; - uint32 LightningBoltTimer; - uint32 CheckTimer; - uint32 CastSoulRetrieveTimer; - uint32 SoulRetrieveTimer; - uint32 SummonBrokenTimer; - uint32 EndingTalkCount; - uint32 WayPointId; - uint32 BrokenSummonIndex; - - std::list BrokenList; - - bool EventBegun; - bool ShadeHasDied; - bool StartCombat; - bool HasYelledOnce; - SummonList summons; - - void Reset() - { - DestructivePoisonTimer = 15000; - LightningBoltTimer = 10000; - CheckTimer = 2000; - - if (!EventBegun) - { - me->SetUInt32Value(UNIT_NPC_FLAGS, 0); // Database sometimes has very very strange values - me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - } - summons.DespawnAll(); - } - - void JustSummoned(Creature *summon) - { - if (summon->GetEntry() == CREATURE_BROKEN) - summons.Summon(summon); - } - void SummonedCreatureDespawn(Creature *summon) - { - if (summon->GetEntry() == CREATURE_BROKEN) - summons.Despawn(summon); - } - - void EnterCombat(Unit* /*who*/) {} - - void BeginEvent(Player* pl) - { - if (!pInstance) - return; - - ShadeGUID = pInstance->GetData64(DATA_SHADEOFAKAMA); - if (!ShadeGUID) - return; - - Creature* Shade = (Unit::GetCreature((*me), ShadeGUID)); - if (Shade) - { - pInstance->SetData(DATA_SHADEOFAKAMAEVENT, IN_PROGRESS); - // Prevent players from trying to restart event - me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - CAST_AI(boss_shade_of_akamaAI, Shade->AI())->SetAkamaGUID(me->GetGUID()); - CAST_AI(boss_shade_of_akamaAI, Shade->AI())->SetSelectableChannelers(); - Shade->AddThreat(me, 1000000.0f); - me->CombatStart(Shade); - Shade->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE); - Shade->SetUInt64Value(UNIT_FIELD_TARGET, me->GetGUID()); - if (pl) Shade->AddThreat(pl, 1.0f); - DoZoneInCombat(Shade); - EventBegun = true; - } - } - - void MovementInform(uint32 type, uint32 id) - { - if (type != POINT_MOTION_TYPE) - return; - - switch(id) - { - case 0: ++WayPointId; break; - - case 1: - if (Creature* Shade = Unit::GetCreature(*me, ShadeGUID)) - { - me->SetUInt64Value(UNIT_FIELD_TARGET, ShadeGUID); - DoCast(Shade, SPELL_AKAMA_SOUL_RETRIEVE); - EndingTalkCount = 0; - SoulRetrieveTimer = 16000; - } - break; - } - } - - void JustDied(Unit* /*killer*/) - { - DoScriptText(SAY_DEATH, me); - EventBegun = false; - ShadeHasDied = false; - StartCombat = false; - CastSoulRetrieveTimer = 0; - SoulRetrieveTimer = 0; - SummonBrokenTimer = 0; - EndingTalkCount = 0; - WayPointId = 0; - BrokenSummonIndex = 0; - BrokenList.clear(); - HasYelledOnce = false; - Creature* Shade = Unit::GetCreature((*me), ShadeGUID); - if (Shade && Shade->isAlive()) - CAST_AI(boss_shade_of_akamaAI, Shade->AI())->HasKilledAkama = true; - summons.DespawnAll(); - } - - void UpdateAI(const uint32 diff) - { - if (!EventBegun) - return; - - if ((me->GetHealth()*100 / me->GetMaxHealth()) < 15 && !HasYelledOnce) - { - DoScriptText(SAY_LOW_HEALTH, me); - HasYelledOnce = true; - } - - if (ShadeGUID && !StartCombat) - { - Creature* Shade = (Unit::GetCreature((*me), ShadeGUID)); - if (Shade && Shade->isAlive()) - { - if (CAST_AI(boss_shade_of_akamaAI, Shade->AI())->IsBanished) - { - if (CastSoulRetrieveTimer <= diff) - { - DoCast(Shade, SPELL_AKAMA_SOUL_CHANNEL); - CastSoulRetrieveTimer = 500; - } else CastSoulRetrieveTimer -= diff; - } - else - { - me->InterruptNonMeleeSpells(false); - StartCombat = true; - } - } - } - - if (ShadeHasDied && (WayPointId == 1)) - { - if (pInstance) - pInstance->SetData(DATA_SHADEOFAKAMAEVENT, DONE); - me->GetMotionMaster()->MovePoint(WayPointId, AkamaWP[1].x, AkamaWP[1].y, AkamaWP[1].z); - ++WayPointId; - } - - if (!ShadeHasDied && StartCombat) - { - if (CheckTimer <= diff) - { - if (ShadeGUID) - { - Creature* Shade = Unit::GetCreature((*me), ShadeGUID); - if (Shade && !Shade->isAlive()) - { - ShadeHasDied = true; - WayPointId = 0; - me->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - me->GetMotionMaster()->MovePoint(WayPointId, AkamaWP[0].x, AkamaWP[0].y, AkamaWP[0].z); - } - if (Shade && Shade->isAlive()) - { - if (Shade->getThreatManager().getThreatList().size() < 2) - Shade->AI()->EnterEvadeMode(); - } - } - CheckTimer = 5000; - } else CheckTimer -= diff; - } - - if (SummonBrokenTimer && BrokenSummonIndex < 4) - { - if (SummonBrokenTimer <= diff) - { - for (uint8 i = 0; i < 4; ++i) - { - float x = BrokenCoords[BrokenSummonIndex].x + (i*5); - float y = BrokenCoords[BrokenSummonIndex].y + (1*5); - float z = BrokenCoords[BrokenSummonIndex].z; - float o = BrokenCoords[BrokenSummonIndex].o; - Creature* Broken = me->SummonCreature(CREATURE_BROKEN, x, y, z, o, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 360000); - if (Broken) - { - float wx = BrokenWP[BrokenSummonIndex].x + (i*5); - float wy = BrokenWP[BrokenSummonIndex].y + (i*5); - float wz = BrokenWP[BrokenSummonIndex].z; - Broken->GetMotionMaster()->MovePoint(0, wx, wy, wz); - Broken->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - BrokenList.push_back(Broken->GetGUID()); - } - } - ++BrokenSummonIndex; - SummonBrokenTimer = 1000; - } else SummonBrokenTimer -= diff; - } - - if (SoulRetrieveTimer) - if (SoulRetrieveTimer <= diff) - { - switch(EndingTalkCount) - { - case 0: - me->HandleEmoteCommand(EMOTE_ONESHOT_ROAR); - ++EndingTalkCount; - SoulRetrieveTimer = 2000; - SummonBrokenTimer = 1; - break; - case 1: - DoScriptText(SAY_FREE, me); - ++EndingTalkCount; - SoulRetrieveTimer = 25000; - break; - case 2: - if (!BrokenList.empty()) - { - bool Yelled = false; - for (std::list::const_iterator itr = BrokenList.begin(); itr != BrokenList.end(); ++itr) - if (Creature* pUnit = Unit::GetCreature(*me, *itr)) - { - if (!Yelled) - { - DoScriptText(SAY_BROKEN_FREE_01, pUnit); - Yelled = true; - } - pUnit->HandleEmoteCommand(EMOTE_ONESHOT_KNEEL); - } - } - ++EndingTalkCount; - SoulRetrieveTimer = 1500; - break; - case 3: - if (!BrokenList.empty()) - { - for (std::list::const_iterator itr = BrokenList.begin(); itr != BrokenList.end(); ++itr) - if (Creature* pUnit = Unit::GetCreature(*me, *itr)) - // This is the incorrect spell, but can't seem to find the right one. - pUnit->CastSpell(pUnit, 39656, true); - } - ++EndingTalkCount; - SoulRetrieveTimer = 5000; - break; - case 4: - if (!BrokenList.empty()) - { - for (std::list::const_iterator itr = BrokenList.begin(); itr != BrokenList.end(); ++itr) - if (Creature* pUnit = Unit::GetCreature((*me), *itr)) - pUnit->MonsterYell(SAY_BROKEN_FREE_02, LANG_UNIVERSAL, 0); - } - SoulRetrieveTimer = 0; - break; - } - } else SoulRetrieveTimer -= diff; - - if (!UpdateVictim()) - return; - - if (DestructivePoisonTimer <= diff) - { - Creature* Shade = Unit::GetCreature((*me), ShadeGUID); - if (Shade && Shade->isAlive()) - DoCast(Shade, SPELL_DESTRUCTIVE_POISON); - DestructivePoisonTimer = 15000; - } else DestructivePoisonTimer -= diff; - - if (LightningBoltTimer <= diff) - { - DoCast(me->getVictim(), SPELL_LIGHTNING_BOLT); - LightningBoltTimer = 10000; - } else LightningBoltTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_shade_of_akama(Creature* pCreature) -{ - return new boss_shade_of_akamaAI (pCreature); -} - -CreatureAI* GetAI_mob_ashtongue_channeler(Creature* pCreature) -{ - return new mob_ashtongue_channelerAI (pCreature); -} - -CreatureAI* GetAI_mob_ashtongue_sorcerer(Creature* pCreature) -{ - return new mob_ashtongue_sorcererAI (pCreature); -} - -CreatureAI* GetAI_npc_akama_shade(Creature* pCreature) -{ - return new npc_akamaAI (pCreature); -} - -bool GossipSelect_npc_akama(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) //Fight time - { - pPlayer->CLOSE_GOSSIP_MENU(); - CAST_AI(npc_akamaAI, pCreature->AI())->BeginEvent(pPlayer); - } - - return true; -} - -bool GossipHello_npc_akama(Player* pPlayer, Creature* pCreature) -{ - if (pPlayer->isAlive()) - { - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - pPlayer->SEND_GOSSIP_MENU(907, pCreature->GetGUID()); - } - - return true; -} - -void AddSC_boss_shade_of_akama() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_shade_of_akama"; - newscript->GetAI = &GetAI_boss_shade_of_akama; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_ashtongue_channeler"; - newscript->GetAI = &GetAI_mob_ashtongue_channeler; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_ashtongue_sorcerer"; - newscript->GetAI = &GetAI_mob_ashtongue_sorcerer; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_akama_shade"; - newscript->GetAI = &GetAI_npc_akama_shade; - newscript->pGossipHello = &GossipHello_npc_akama; - newscript->pGossipSelect = &GossipSelect_npc_akama; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Outland/black_temple/boss_supremus.cpp b/src/server/scripts/Outland/black_temple/boss_supremus.cpp deleted file mode 100644 index bc1ea3ec673..00000000000 --- a/src/server/scripts/Outland/black_temple/boss_supremus.cpp +++ /dev/null @@ -1,296 +0,0 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Supremus -SD%Complete: 95 -SDComment: Need to implement molten punch -SDCategory: Black Temple -EndScriptData */ - -#include "ScriptedPch.h" -#include "black_temple.h" - -#define EMOTE_NEW_TARGET -1564010 -#define EMOTE_PUNCH_GROUND -1564011 //DoScriptText(EMOTE_PUNCH_GROUND, me); -#define EMOTE_GROUND_CRACK -1564012 - -//Spells -#define SPELL_MOLTEN_PUNCH 40126 -#define SPELL_HATEFUL_STRIKE 41926 -#define SPELL_MOLTEN_FLAME 40980 -#define SPELL_VOLCANIC_ERUPTION 40117 -#define SPELL_VOLCANIC_SUMMON 40276 -#define SPELL_BERSERK 45078 - -#define CREATURE_VOLCANO 23085 -#define CREATURE_STALKER 23095 - -#define PHASE_STRIKE 1 -#define PHASE_CHASE 2 - -#define EVENT_BERSERK 1 -#define EVENT_SWITCH_PHASE 2 -#define EVENT_FLAME 3 -#define EVENT_VOLCANO 4 -#define EVENT_SWITCH_TARGET 5 -#define EVENT_HATEFUL_STRIKE 6 - -#define GCD_CAST 1 - -struct molten_flameAI : public NullCreatureAI -{ - molten_flameAI(Creature *c) : NullCreatureAI(c) {} - - void InitializeAI() - { - float x, y, z; - me->GetNearPoint(me, x, y, z, 1, 100, M_PI*2*rand_norm()); - me->GetMotionMaster()->MovePoint(0, x, y, z); - me->SetVisibility(VISIBILITY_OFF); - me->CastSpell(me,SPELL_MOLTEN_FLAME,true); - } -}; - -struct boss_supremusAI : public ScriptedAI -{ - boss_supremusAI(Creature *c) : ScriptedAI(c), summons(me) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - EventMap events; - SummonList summons; - uint32 phase; - - void Reset() - { - if (pInstance) - { - if (me->isAlive()) - { - pInstance->SetData(DATA_SUPREMUSEVENT, NOT_STARTED); - //ToggleDoors(true); - } - //else ToggleDoors(false); - } - - phase = 0; - - events.Reset(); - summons.DespawnAll(); - } - - void EnterCombat(Unit * /*who*/) - { - if (pInstance) - pInstance->SetData(DATA_SUPREMUSEVENT, IN_PROGRESS); - - ChangePhase(); - events.ScheduleEvent(EVENT_BERSERK, 900000, GCD_CAST); - events.ScheduleEvent(EVENT_FLAME, 20000, GCD_CAST); - } - - void ChangePhase() - { - if (!phase || phase == PHASE_CHASE) - { - phase = PHASE_STRIKE; - summons.DoAction(EVENT_VOLCANO, 0); - events.ScheduleEvent(EVENT_HATEFUL_STRIKE, 5000, GCD_CAST, PHASE_STRIKE); - me->SetSpeed(MOVE_RUN, 1.2f); - me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, false); - me->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, false); - } - else - { - phase = PHASE_CHASE; - events.ScheduleEvent(EVENT_VOLCANO, 5000, GCD_CAST, PHASE_CHASE); - events.ScheduleEvent(EVENT_SWITCH_TARGET, 10000, 0, PHASE_CHASE); - me->SetSpeed(MOVE_RUN, 0.9f); - me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true); - me->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true); - } - DoResetThreat(); - DoZoneInCombat(); - events.SetPhase(phase); - events.ScheduleEvent(EVENT_SWITCH_PHASE, 60000, GCD_CAST); - } - - void JustDied(Unit * /*killer*/) - { - if (pInstance) - { - pInstance->SetData(DATA_SUPREMUSEVENT, DONE); - pInstance->HandleGameObject(pInstance->GetData64(DATA_GAMEOBJECT_SUPREMUS_DOORS), true); - } - summons.DespawnAll(); - } - - void JustSummoned(Creature *summon) {summons.Summon(summon);} - void SummonedCreatureDespawn(Creature *summon) {summons.Despawn(summon);} - - Unit* CalculateHatefulStrikeTarget() - { - uint32 health = 0; - Unit *pTarget = NULL; - - std::list& m_threatlist = me->getThreatManager().getThreatList(); - std::list::const_iterator i = m_threatlist.begin(); - for (i = m_threatlist.begin(); i!= m_threatlist.end(); ++i) - { - Unit* pUnit = Unit::GetUnit((*me), (*i)->getUnitGuid()); - if (pUnit && me->IsWithinMeleeRange(pUnit)) - { - if (pUnit->GetHealth() > health) - { - health = pUnit->GetHealth(); - pTarget = pUnit; - } - } - } - - return pTarget; - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - events.Update(diff); - - while (uint32 eventId = events.ExecuteEvent()) - { - switch(eventId) - { - case EVENT_BERSERK: - DoCast(me, SPELL_BERSERK, true); - break; - case EVENT_FLAME: - DoCast(me, SPELL_MOLTEN_PUNCH); - events.DelayEvents(1500, GCD_CAST); - events.ScheduleEvent(EVENT_FLAME, 20000, GCD_CAST); - break; - case EVENT_HATEFUL_STRIKE: - if (Unit *pTarget = CalculateHatefulStrikeTarget()) - DoCast(pTarget, SPELL_HATEFUL_STRIKE); - events.DelayEvents(1000, GCD_CAST); - events.ScheduleEvent(EVENT_HATEFUL_STRIKE, 5000, GCD_CAST, PHASE_STRIKE); - break; - case EVENT_SWITCH_TARGET: - if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true)) - { - DoResetThreat(); - me->AddThreat(pTarget, 5000000.0f); - DoScriptText(EMOTE_NEW_TARGET, me); - } - events.ScheduleEvent(EVENT_SWITCH_TARGET, 10000, 0, PHASE_CHASE); - break; - case EVENT_VOLCANO: - { - Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 999, true); - if (!pTarget) pTarget = me->getVictim(); - if (pTarget) - { - //DoCast(pTarget, SPELL_VOLCANIC_SUMMON);//movement bugged - me->SummonCreature(CREATURE_VOLCANO,pTarget->GetPositionX(),pTarget->GetPositionY(),pTarget->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,30000); - DoScriptText(EMOTE_GROUND_CRACK, me); - events.DelayEvents(1500, GCD_CAST); - } - events.ScheduleEvent(EVENT_VOLCANO, 10000, GCD_CAST, PHASE_CHASE); - return; - } - case EVENT_SWITCH_PHASE: - ChangePhase(); - break; - } - } - - DoMeleeAttackIfReady(); - } -}; - -struct npc_volcanoAI : public Scripted_NoMovementAI -{ - npc_volcanoAI(Creature *c) : Scripted_NoMovementAI(c) {} - - void Reset() - { - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - //DoCast(me, SPELL_VOLCANIC_ERUPTION); - me->SetReactState(REACT_PASSIVE); - wait = 3000; - } - uint32 wait; - - void EnterCombat(Unit * /*who*/) {} - - void MoveInLineOfSight(Unit * /*who*/) {} - - void DoAction(const uint32 /*info*/) - { - me->RemoveAura(SPELL_VOLCANIC_ERUPTION); - } - - void UpdateAI(const uint32 diff) - { - if (wait <= diff)//wait 3secs before casting - { - DoCast(me, SPELL_VOLCANIC_ERUPTION); - wait = 60000; - } - else wait -= diff; - } - -}; - -CreatureAI* GetAI_boss_supremus(Creature* pCreature) -{ - return new boss_supremusAI (pCreature); -} - -CreatureAI* GetAI_molten_flame(Creature* pCreature) -{ - return new molten_flameAI (pCreature); -} - -CreatureAI* GetAI_npc_volcano(Creature* pCreature) -{ - return new npc_volcanoAI (pCreature); -} - -void AddSC_boss_supremus() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_supremus"; - newscript->GetAI = &GetAI_boss_supremus; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "molten_flame"; - newscript->GetAI = &GetAI_molten_flame; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_volcano"; - newscript->GetAI = &GetAI_npc_volcano; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Outland/black_temple/boss_teron_gorefiend.cpp b/src/server/scripts/Outland/black_temple/boss_teron_gorefiend.cpp deleted file mode 100644 index 670edc4d869..00000000000 --- a/src/server/scripts/Outland/black_temple/boss_teron_gorefiend.cpp +++ /dev/null @@ -1,508 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Teron_Gorefiend -SD%Complete: 60 -SDComment: Requires Mind Control support for Ghosts. -SDCategory: Black Temple -EndScriptData */ - -#include "ScriptedPch.h" -#include "black_temple.h" - - //Speech'n'sound -#define SAY_INTRO -1564037 -#define SAY_AGGRO -1564038 -#define SAY_SLAY1 -1564039 -#define SAY_SLAY2 -1564040 -#define SAY_SPELL1 -1564041 -#define SAY_SPELL2 -1564042 -#define SAY_SPECIAL1 -1564043 -#define SAY_SPECIAL2 -1564044 -#define SAY_ENRAGE -1564045 -#define SAY_DEATH -1564046 - -//Spells -#define SPELL_INCINERATE 40239 -#define SPELL_CRUSHING_SHADOWS 40243 -#define SPELL_SHADOWBOLT 40185 -#define SPELL_PASSIVE_SHADOWFORM 40326 -#define SPELL_SHADOW_OF_DEATH 40251 -#define SPELL_BERSERK 45078 - -#define SPELL_ATROPHY 40327 // Shadowy Constructs use this when they get within melee range of a player - -#define CREATURE_DOOM_BLOSSOM 23123 -#define CREATURE_SHADOWY_CONSTRUCT 23111 - -struct mob_doom_blossomAI : public ScriptedAI -{ - mob_doom_blossomAI(Creature *c) : ScriptedAI(c) {} - - uint32 CheckTeronTimer; - uint32 ShadowBoltTimer; - uint64 TeronGUID; - - void Reset() - { - CheckTeronTimer = 5000; - ShadowBoltTimer = 12000; - TeronGUID = 0; - } - - void EnterCombat(Unit * /*who*/) { } - void AttackStart(Unit* /*who*/) {} - void MoveInLineOfSight(Unit* /*who*/) {} - - void Despawn() - { - me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - me->RemoveCorpse(); - } - - void UpdateAI(const uint32 diff) - { - if (CheckTeronTimer <= diff) - { - if (TeronGUID) - { - DoZoneInCombat(); - - Creature* Teron = (Unit::GetCreature((*me), TeronGUID)); - if ((Teron) && (!Teron->isAlive() || Teron->IsInEvadeMode())) - Despawn(); - } - else - Despawn(); - - CheckTeronTimer = 5000; - } else CheckTeronTimer -= diff; - - if (ShadowBoltTimer < diff && me->isInCombat()) - { - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_SHADOWBOLT); - ShadowBoltTimer = 10000; - } else ShadowBoltTimer -= diff; - return; - } - - void SetTeronGUID(uint64 guid){ TeronGUID = guid; } -}; - -struct mob_shadowy_constructAI : public ScriptedAI -{ - mob_shadowy_constructAI(Creature* c) : ScriptedAI(c) {} - - uint64 GhostGUID; - uint64 TeronGUID; - - uint32 CheckPlayerTimer; - uint32 CheckTeronTimer; - - void Reset() - { - GhostGUID = 0; - TeronGUID = 0; - - CheckPlayerTimer = 2000; - CheckTeronTimer = 5000; - } - - void EnterCombat(Unit* /*who*/) {} - - void MoveInLineOfSight(Unit *who) - { - if (!who || (!who->isAlive()) || (who->GetGUID() == GhostGUID)) - return; - - ScriptedAI::MoveInLineOfSight(who); - } - -/* Comment it out for now. NOTE TO FUTURE DEV: UNCOMMENT THIS OUT ONLY AFTER MIND CONTROL IS IMPLEMENTED - void DamageTaken(Unit* done_by, uint32 &damage) - { - if (done_by->GetGUID() != GhostGUID) - damage = 0; // Only the ghost can deal damage. - } - */ - - void CheckPlayers() - { - std::list& m_threatlist = me->getThreatManager().getThreatList(); - if (m_threatlist.empty()) - return; // No threat list. Don't continue. - std::list::const_iterator itr = m_threatlist.begin(); - std::list targets; - for (; itr != m_threatlist.end(); ++itr) - { - Unit* pUnit = Unit::GetUnit((*me), (*itr)->getUnitGuid()); - if (pUnit && pUnit->isAlive()) - targets.push_back(pUnit); - } - targets.sort(Trinity::ObjectDistanceOrderPred(me)); - Unit *pTarget = targets.front(); - if (pTarget && me->IsWithinDistInMap(pTarget, me->GetAttackDistance(pTarget))) - { - DoCast(pTarget, SPELL_ATROPHY); - me->AI()->AttackStart(pTarget); - } - } - - void UpdateAI(const uint32 diff) - { - if (CheckPlayerTimer <= diff) - { - CheckPlayers(); - CheckPlayerTimer = 3000; - } else CheckPlayerTimer -= diff; - - if (CheckTeronTimer <= diff) - { - Creature* Teron = (Unit::GetCreature((*me), TeronGUID)); - if (!Teron || !Teron->isAlive() || Teron->IsInEvadeMode()) - me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - - CheckTeronTimer = 5000; - } else CheckTeronTimer -= diff; - } -}; - -struct boss_teron_gorefiendAI : public ScriptedAI -{ - boss_teron_gorefiendAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint32 IncinerateTimer; - uint32 SummonDoomBlossomTimer; - uint32 EnrageTimer; - uint32 CrushingShadowsTimer; - uint32 ShadowOfDeathTimer; - uint32 SummonShadowsTimer; - uint32 RandomYellTimer; - uint32 AggroTimer; - - uint64 AggroTargetGUID; - uint64 GhostGUID; // Player that gets killed by Shadow of Death and gets turned into a ghost - - bool Intro; - bool Done; - - void Reset() - { - if (pInstance) - pInstance->SetData(DATA_TERONGOREFIENDEVENT, NOT_STARTED); - - IncinerateTimer = 20000 + rand()%11000; - SummonDoomBlossomTimer = 12000; - EnrageTimer = 600000; - CrushingShadowsTimer = 22000; - SummonShadowsTimer = 60000; - RandomYellTimer = 50000; - - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - // Start off unattackable so that the intro is done properly - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - - AggroTimer = 20000; - AggroTargetGUID = 0; - Intro = false; - Done = false; - } - - void EnterCombat(Unit * /*who*/) {} - - void MoveInLineOfSight(Unit* pWho) - { - if (!Intro && pWho->GetTypeId() == TYPEID_PLAYER && pWho->isTargetableForAttack() && me->IsHostileTo(pWho) && pWho->isInAccessiblePlaceFor(me)) - { - if (me->IsWithinDistInMap(pWho, VISIBLE_RANGE) && me->IsWithinLOSInMap(pWho)) - { - if (pInstance) - pInstance->SetData(DATA_TERONGOREFIENDEVENT, IN_PROGRESS); - - me->GetMotionMaster()->Clear(false); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - DoScriptText(SAY_INTRO, me); - me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_TALK); - AggroTargetGUID = pWho->GetGUID(); - Intro = true; - } - } - if (Done) - ScriptedAI::MoveInLineOfSight(pWho); - } - - void KilledUnit(Unit * /*victim*/) - { - DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me); - } - - void JustDied(Unit * /*victim*/) - { - if (pInstance) - pInstance->SetData(DATA_TERONGOREFIENDEVENT, DONE); - - DoScriptText(SAY_DEATH, me); - } - - float CalculateRandomLocation(float Loc, uint32 radius) - { - float coord = Loc; - switch (urand(0,1)) - { - case 0: - coord += rand()%radius; - break; - case 1: - coord -= rand()%radius; - break; - } - return coord; - } - - void SetThreatList(Creature* Blossom) - { - if (!Blossom) return; - - std::list& m_threatlist = me->getThreatManager().getThreatList(); - std::list::const_iterator i = m_threatlist.begin(); - for (i = m_threatlist.begin(); i != m_threatlist.end(); ++i) - { - Unit* pUnit = Unit::GetUnit((*me), (*i)->getUnitGuid()); - if (pUnit && pUnit->isAlive()) - { - float threat = DoGetThreat(pUnit); - Blossom->AddThreat(pUnit, threat); - } - } - } - - void MindControlGhost() - { - /************************************************************************/ - /** NOTE FOR FUTURE DEVELOPER: PROPERLY IMPLEMENT THE GHOST PORTION *****/ - /** ONLY AFTER TrinIty FULLY IMPLEMENTS MIND CONTROL ABILITIES *****/ - /** THE CURRENT CODE IN THIS FUNCTION IS ONLY THE BEGINNING OF *****/ - /** WHAT IS FULLY NECESSARY FOR GOREFIEND TO BE 100% COMPLETE *****/ - /************************************************************************/ - - Unit* Ghost = NULL; - if (GhostGUID) - Ghost = Unit::GetUnit((*me), GhostGUID); - if (Ghost && Ghost->isAlive() && Ghost->HasAura(SPELL_SHADOW_OF_DEATH)) - { - /*float x,y,z; - Ghost->GetPosition(x,y,z); - Creature* control = me->SummonCreature(CREATURE_GHOST, x, y, z, 0, TEMPSUMMON_TIMED_DESAWN, 30000); - if (control) - { - CAST_PLR(Ghost)->Possess(control); - Ghost->DealDamage(Ghost, Ghost->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, - false); - }*/ - for (uint8 i = 0; i < 4; ++i) - { - Creature* Construct = NULL; - float X = CalculateRandomLocation(Ghost->GetPositionX(), 10); - float Y = CalculateRandomLocation(Ghost->GetPositionY(), 10); - Construct = me->SummonCreature(CREATURE_SHADOWY_CONSTRUCT, X, Y, Ghost->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000); - if (Construct) - { - Construct->CastSpell(Construct, SPELL_PASSIVE_SHADOWFORM, true); - SetThreatList(Construct); // Use same function as Doom Blossom to set Threat List. - CAST_AI(mob_shadowy_constructAI, Construct->AI())->GhostGUID = GhostGUID; - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1); - if (!pTarget) // someone's trying to solo. - pTarget = me->getVictim(); - - if (pTarget) - Construct->GetMotionMaster()->MoveChase(pTarget); - } - } - } - } - - void UpdateAI(const uint32 diff) - { - if (Intro && !Done) - { - if (AggroTimer <= diff) - { - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - DoScriptText(SAY_AGGRO, me); - me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE); - Done = true; - if (AggroTargetGUID) - { - Unit* pUnit = Unit::GetUnit((*me), AggroTargetGUID); - if (pUnit) - AttackStart(pUnit); - - DoZoneInCombat(); - } - else - { - EnterEvadeMode(); - return; - } - } else AggroTimer -= diff; - } - - if (!UpdateVictim() || !Done) - return; - - if (SummonShadowsTimer <= diff) - { - //MindControlGhost(); - - for (uint8 i = 0; i < 2; ++i) - { - Creature* Shadow = NULL; - float X = CalculateRandomLocation(me->GetPositionX(), 10); - Shadow = me->SummonCreature(CREATURE_SHADOWY_CONSTRUCT, X, me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 0); - if (Shadow) - { - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1); - if (!pTarget) - pTarget = me->getVictim(); - - if (pTarget) - Shadow->AI()->AttackStart(pTarget); - } - } - SummonShadowsTimer = 60000; - } else SummonShadowsTimer -= diff; - - if (SummonDoomBlossomTimer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - float X = CalculateRandomLocation(pTarget->GetPositionX(), 20); - float Y = CalculateRandomLocation(pTarget->GetPositionY(), 20); - float Z = pTarget->GetPositionZ(); - Z = me->GetMap()->GetHeight(X, Y, Z); - Creature* DoomBlossom = me->SummonCreature(CREATURE_DOOM_BLOSSOM, X, Y, Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 20000); - if (DoomBlossom) - { - DoomBlossom->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - DoomBlossom->setFaction(me->getFaction()); - DoomBlossom->AddThreat(pTarget, 1.0f); - CAST_AI(mob_doom_blossomAI, DoomBlossom->AI())->SetTeronGUID(me->GetGUID()); - pTarget->CombatStart(DoomBlossom); - SetThreatList(DoomBlossom); - SummonDoomBlossomTimer = 35000; - } - } - } else SummonDoomBlossomTimer -= diff; - - if (IncinerateTimer <= diff) - { - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1); - if (!pTarget) - pTarget = me->getVictim(); - - if (pTarget) - { - DoScriptText(RAND(SAY_SPECIAL1,SAY_SPECIAL2), me); - DoCast(pTarget, SPELL_INCINERATE); - IncinerateTimer = 20000 + rand()%31 * 1000; - } - } else IncinerateTimer -= diff; - - if (CrushingShadowsTimer <= diff) - { - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (pTarget && pTarget->isAlive()) - DoCast(pTarget, SPELL_CRUSHING_SHADOWS); - CrushingShadowsTimer = 10000 + rand()%16 * 1000; - } else CrushingShadowsTimer -= diff; - - /*** NOTE FOR FUTURE DEV: UNCOMMENT BELOW ONLY IF MIND CONTROL IS FULLY IMPLEMENTED **/ - /*if (ShadowOfDeathTimer <= diff) - { - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1); - - if (!pTarget) - pTarget = me->getVictim(); - - if (pTarget && pTarget->isAlive() && pTarget->GetTypeId() == TYPEID_PLAYER) - { - DoCast(pTarget, SPELL_SHADOW_OF_DEATH); - GhostGUID = pTarget->GetGUID(); - ShadowOfDeathTimer = 30000; - SummonShadowsTimer = 53000; // Make it VERY close but slightly less so that we can check if the aura is still on the player - } - } else ShadowOfDeathTimer -= diff;*/ - - if (RandomYellTimer <= diff) - { - DoScriptText(RAND(SAY_SPELL1,SAY_SPELL2), me); - RandomYellTimer = 50000 + rand()%51 * 1000; - } else RandomYellTimer -= diff; - - if (!me->HasAura(SPELL_BERSERK)) - { - if (EnrageTimer <= diff) - { - DoCast(me, SPELL_BERSERK); - DoScriptText(SAY_ENRAGE, me); - } else EnrageTimer -= diff; - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_doom_blossom(Creature* pCreature) -{ - return new mob_doom_blossomAI(pCreature); -} - -CreatureAI* GetAI_mob_shadowy_construct(Creature* pCreature) -{ - return new mob_shadowy_constructAI(pCreature); -} - -CreatureAI* GetAI_boss_teron_gorefiend(Creature* pCreature) -{ - return new boss_teron_gorefiendAI (pCreature); -} - -void AddSC_boss_teron_gorefiend() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "mob_doom_blossom"; - newscript->GetAI = &GetAI_mob_doom_blossom; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_shadowy_construct"; - newscript->GetAI = &GetAI_mob_shadowy_construct; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_teron_gorefiend"; - newscript->GetAI = &GetAI_boss_teron_gorefiend; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Outland/black_temple/boss_warlord_najentus.cpp b/src/server/scripts/Outland/black_temple/boss_warlord_najentus.cpp deleted file mode 100644 index 7d94b4b36a0..00000000000 --- a/src/server/scripts/Outland/black_temple/boss_warlord_najentus.cpp +++ /dev/null @@ -1,226 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Warlord_Najentus -SD%Complete: 95 -SDComment: -SDCategory: Black Temple -EndScriptData */ - -#include "ScriptedPch.h" -#include "black_temple.h" - -enum eEnums -{ - SAY_AGGRO = -1564000, - SAY_NEEDLE1 = -1564001, - SAY_NEEDLE2 = -1564002, - SAY_SLAY1 = -1564003, - SAY_SLAY2 = -1564004, - SAY_SPECIAL1 = -1564005, - SAY_SPECIAL2 = -1564006, - SAY_ENRAGE1 = -1564007, //is this text actually in use? - SAY_ENRAGE2 = -1564008, - SAY_DEATH = -1564009, - - //Spells - SPELL_NEEDLE_SPINE = 39992, - SPELL_TIDAL_BURST = 39878, - SPELL_TIDAL_SHIELD = 39872, - SPELL_IMPALING_SPINE = 39837, - SPELL_CREATE_NAJENTUS_SPINE = 39956, - SPELL_HURL_SPINE = 39948, - SPELL_BERSERK = 26662, - - GOBJECT_SPINE = 185584, - - EVENT_BERSERK = 1, - EVENT_YELL = 2, - EVENT_NEEDLE = 3, - EVENT_SPINE = 4, - EVENT_SHIELD = 5, - - GCD_CAST = 1, - GCD_YELL = 2 -}; - -struct boss_najentusAI : public ScriptedAI -{ - boss_najentusAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - EventMap events; - - uint64 SpineTargetGUID; - - void Reset() - { - events.Reset(); - - SpineTargetGUID = 0; - - if (pInstance) - pInstance->SetData(DATA_HIGHWARLORDNAJENTUSEVENT, NOT_STARTED); - } - - void KilledUnit(Unit * /*victim*/) - { - DoScriptText(rand()%2 ? SAY_SLAY1 : SAY_SLAY2, me); - events.DelayEvents(5000, GCD_YELL); - } - - void JustDied(Unit * /*victim*/) - { - if (pInstance) - pInstance->SetData(DATA_HIGHWARLORDNAJENTUSEVENT, DONE); - - DoScriptText(SAY_DEATH, me); - } - - void SpellHit(Unit * /*caster*/, const SpellEntry *spell) - { - if (spell->Id == SPELL_HURL_SPINE && me->HasAura(SPELL_TIDAL_SHIELD)) - { - me->RemoveAurasDueToSpell(SPELL_TIDAL_SHIELD); - DoCast(me, SPELL_TIDAL_BURST, true); - ResetTimer(); - } - } - - void EnterCombat(Unit * /*who*/) - { - if (pInstance) - pInstance->SetData(DATA_HIGHWARLORDNAJENTUSEVENT, IN_PROGRESS); - - DoScriptText(SAY_AGGRO, me); - DoZoneInCombat(); - events.ScheduleEvent(EVENT_BERSERK, 480000, GCD_CAST); - events.ScheduleEvent(EVENT_YELL, 45000 + (rand()%76)*1000, GCD_YELL); - ResetTimer(); - } - - bool RemoveImpalingSpine() - { - if (!SpineTargetGUID) return false; - Unit *pTarget = Unit::GetUnit(*me, SpineTargetGUID); - if (pTarget && pTarget->HasAura(SPELL_IMPALING_SPINE)) - pTarget->RemoveAurasDueToSpell(SPELL_IMPALING_SPINE); - SpineTargetGUID=0; - return true; - } - - void ResetTimer(uint32 inc = 0) - { - events.RescheduleEvent(EVENT_NEEDLE, 10000 + inc, GCD_CAST); - events.RescheduleEvent(EVENT_SPINE, 20000 + inc, GCD_CAST); - events.RescheduleEvent(EVENT_SHIELD, 60000 + inc); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - events.Update(diff); - - while (uint32 eventId = events.ExecuteEvent()) - { - switch(eventId) - { - case EVENT_SHIELD: - DoCast(me, SPELL_TIDAL_SHIELD, true); - ResetTimer(45000); - break; - case EVENT_BERSERK: - DoScriptText(SAY_ENRAGE2, me); - DoCast(me, SPELL_BERSERK, true); - events.DelayEvents(15000, GCD_YELL); - break; - case EVENT_SPINE: - { - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1); - if (!pTarget) pTarget = me->getVictim(); - if (pTarget) - { - DoCast(pTarget, SPELL_IMPALING_SPINE, true); - SpineTargetGUID = pTarget->GetGUID(); - //must let target summon, otherwise you cannot click the spine - pTarget->SummonGameObject(GOBJECT_SPINE, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), me->GetOrientation(), 0, 0, 0, 0, 30); - DoScriptText(rand()%2 ? SAY_NEEDLE1 : SAY_NEEDLE2, me); - events.DelayEvents(1500, GCD_CAST); - events.DelayEvents(15000, GCD_YELL); - } - events.ScheduleEvent(EVENT_SPINE, 21000, GCD_CAST); - return; - } - case EVENT_NEEDLE: - { - //DoCast(me, SPELL_NEEDLE_SPINE, true); - std::list pTargets; - SelectTargetList(pTargets, 3, SELECT_TARGET_RANDOM, 80, true); - for (std::list::const_iterator i = pTargets.begin(); i != pTargets.end(); ++i) - DoCast(*i, 39835, true); - events.ScheduleEvent(EVENT_NEEDLE, urand(15000,25000), GCD_CAST); - events.DelayEvents(1500, GCD_CAST); - return; - } - case EVENT_YELL: - DoScriptText(RAND(SAY_SPECIAL1, SAY_SPECIAL2), me); - events.ScheduleEvent(EVENT_YELL, urand(25000,100000), GCD_YELL); - events.DelayEvents(15000, GCD_YELL); - break; - } - } - - DoMeleeAttackIfReady(); - } -}; - -bool GOHello_go_najentus_spine(Player* pPlayer, GameObject* pGo) -{ - if (ScriptedInstance* pInstance = pGo->GetInstanceData()) - if (Creature* Najentus = Unit::GetCreature(*pGo, pInstance->GetData64(DATA_HIGHWARLORDNAJENTUS))) - if (CAST_AI(boss_najentusAI, Najentus->AI())->RemoveImpalingSpine()) - { - pPlayer->CastSpell(pPlayer, SPELL_CREATE_NAJENTUS_SPINE, true); - pGo->Delete(); - } - return true; -} - -CreatureAI* GetAI_boss_najentus(Creature* pCreature) -{ - return new boss_najentusAI (pCreature); -} - -void AddSC_boss_najentus() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_najentus"; - newscript->GetAI = &GetAI_boss_najentus; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "go_najentus_spine"; - newscript->pGOHello = &GOHello_go_najentus_spine; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Outland/black_temple/illidari_council.cpp b/src/server/scripts/Outland/black_temple/illidari_council.cpp deleted file mode 100644 index 82cc2876b5a..00000000000 --- a/src/server/scripts/Outland/black_temple/illidari_council.cpp +++ /dev/null @@ -1,874 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Illidari_Council -SD%Complete: 95 -SDComment: Circle of Healing not working properly. -SDCategory: Black Temple -EndScriptData */ - -#include "ScriptedPch.h" -#include "black_temple.h" - -//Speech'n'Sounds -#define SAY_GATH_SLAY -1564085 -#define SAY_GATH_SLAY_COMNT -1564089 -#define SAY_GATH_DEATH -1564093 -#define SAY_GATH_SPECIAL1 -1564077 -#define SAY_GATH_SPECIAL2 -1564081 - -#define SAY_VERA_SLAY -1564086 -#define SAY_VERA_COMNT -1564089 //signed for 22949 -#define SAY_VERA_DEATH -1564094 -#define SAY_VERA_SPECIAL1 -1564078 -#define SAY_VERA_SPECIAL2 -1564082 - -#define SAY_MALA_SLAY -1564087 -#define SAY_MALA_COMNT -1564090 -#define SAY_MALA_DEATH -1564095 -#define SAY_MALA_SPECIAL1 -1564079 -#define SAY_MALA_SPECIAL2 -1564083 - -#define SAY_ZERE_SLAY -1564088 -#define SAY_ZERE_COMNT -1564091 -#define SAY_ZERE_DEATH -1564096 -#define SAY_ZERE_SPECIAL1 -1564080 -#define SAY_ZERE_SPECIAL2 -1564084 - -#define ERROR_INST_DATA "SD2 ERROR: Instance Data for Black Temple not set properly; Illidari Council event will not function properly." - -#define AKAMAID 23089 - -struct CouncilYells -{ - int32 entry; - uint32 timer; -}; - -static CouncilYells CouncilAggro[]= -{ - {-1564069, 5000}, // Gathios - {-1564070, 5500}, // Veras - {-1564071, 5000}, // Malande - {-1564072, 0}, // Zerevor -}; - -// Need to get proper timers for this later -static CouncilYells CouncilEnrage[]= -{ - {-1564073, 2000}, // Gathios - {-1564074, 6000}, // Veras - {-1564075, 5000}, // Malande - {-1564076, 0}, // Zerevor -}; - -// High Nethermancer Zerevor's spells -#define SPELL_FLAMESTRIKE 41481 -#define SPELL_BLIZZARD 41482 -#define SPELL_ARCANE_BOLT 41483 -#define SPELL_ARCANE_EXPLOSION 41524 -#define SPELL_DAMPEN_MAGIC 41478 - -// Lady Malande's spells -#define SPELL_EMPOWERED_SMITE 41471 -#define SPELL_CIRCLE_OF_HEALING 41455 -#define SPELL_REFLECTIVE_SHIELD 41475 -#define SPELL_DIVINE_WRATH 41472 -#define SPELL_HEAL_VISUAL 24171 - -// Gathios the Shatterer's spells -#define SPELL_BLESS_PROTECTION 41450 -#define SPELL_BLESS_SPELLWARD 41451 -#define SPELL_CONSECRATION 41541 -#define SPELL_HAMMER_OF_JUSTICE 41468 -#define SPELL_SEAL_OF_COMMAND 41469 -#define SPELL_SEAL_OF_BLOOD 41459 -#define SPELL_CHROMATIC_AURA 41453 -#define SPELL_DEVOTION_AURA 41452 - -// Veras Darkshadow's spells -#define SPELL_DEADLY_POISON 41485 -#define SPELL_ENVENOM 41487 -#define SPELL_VANISH 41479 - -#define SPELL_BERSERK 45078 - -struct mob_blood_elf_council_voice_triggerAI : public ScriptedAI -{ - mob_blood_elf_council_voice_triggerAI(Creature* c) : ScriptedAI(c) - { - for (uint8 i = 0; i < 4; ++i) - Council[i] = 0; - } - - uint64 Council[4]; - - uint32 EnrageTimer; - uint32 AggroYellTimer; - - uint8 YellCounter; // Serves as the counter for both the aggro and enrage yells - - bool EventStarted; - - void Reset() - { - EnrageTimer = 900000; // 15 minutes - AggroYellTimer = 500; - - YellCounter = 0; - - EventStarted = false; - } - - // finds and stores the GUIDs for each Council member using instance data system. - void LoadCouncilGUIDs() - { - if (ScriptedInstance* pInstance = me->GetInstanceData()) - { - Council[0] = pInstance->GetData64(DATA_GATHIOSTHESHATTERER); - Council[1] = pInstance->GetData64(DATA_VERASDARKSHADOW); - Council[2] = pInstance->GetData64(DATA_LADYMALANDE); - Council[3] = pInstance->GetData64(DATA_HIGHNETHERMANCERZEREVOR); - } else error_log(ERROR_INST_DATA); - } - - void EnterCombat(Unit* /*who*/) {} - - void AttackStart(Unit* /*who*/) {} - void MoveInLineOfSight(Unit* /*who*/) {} - - void UpdateAI(const uint32 diff) - { - if (!EventStarted) - return; - - if (YellCounter > 3) - return; - - if (AggroYellTimer) - { - if (AggroYellTimer <= diff) - { - if (Unit* pMember = Unit::GetUnit(*me, Council[YellCounter])) - { - DoScriptText(CouncilAggro[YellCounter].entry, pMember); - AggroYellTimer = CouncilAggro[YellCounter].timer; - } - ++YellCounter; - if (YellCounter > 3) - YellCounter = 0; // Reuse for Enrage Yells - } else AggroYellTimer -= diff; - } - - if (EnrageTimer) - { - if (EnrageTimer <= diff) - { - if (Unit* pMember = Unit::GetUnit(*me, Council[YellCounter])) - { - pMember->CastSpell(pMember, SPELL_BERSERK, true); - DoScriptText(CouncilEnrage[YellCounter].entry, pMember); - EnrageTimer = CouncilEnrage[YellCounter].timer; - } - ++YellCounter; - } else EnrageTimer -= diff; - } - } -}; - -struct mob_illidari_councilAI : public ScriptedAI -{ - mob_illidari_councilAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - for (uint8 i = 0; i < 4; ++i) - Council[i] = 0; - } - - ScriptedInstance* pInstance; - - uint64 Council[4]; - - uint32 CheckTimer; - uint32 EndEventTimer; - - uint8 DeathCount; - - bool EventBegun; - - void Reset() - { - CheckTimer = 2000; - EndEventTimer = 0; - - DeathCount = 0; - - Creature* pMember = NULL; - for (uint8 i = 0; i < 4; ++i) - { - pMember = Unit::GetCreature((*me), Council[i]); - if (!pMember) - continue; - - if (!pMember->isAlive()) - { - pMember->RemoveCorpse(); - pMember->Respawn(); - } - pMember->AI()->EnterEvadeMode(); - } - - if (pInstance) - { - pInstance->SetData(DATA_ILLIDARICOUNCILEVENT, NOT_STARTED); - if (Creature* VoiceTrigger = (Unit::GetCreature(*me, pInstance->GetData64(DATA_BLOOD_ELF_COUNCIL_VOICE)))) - VoiceTrigger->AI()->EnterEvadeMode(); - } - - EventBegun = false; - - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetDisplayId(11686); - } - - void EnterCombat(Unit * /*who*/) {} - void AttackStart(Unit* /*who*/) {} - void MoveInLineOfSight(Unit* /*who*/) {} - - void StartEvent(Unit *pTarget) - { - if (!pInstance) - return; - - if (pTarget && pTarget->isAlive()) - { - Council[0] = pInstance->GetData64(DATA_GATHIOSTHESHATTERER); - Council[1] = pInstance->GetData64(DATA_HIGHNETHERMANCERZEREVOR); - Council[2] = pInstance->GetData64(DATA_LADYMALANDE); - Council[3] = pInstance->GetData64(DATA_VERASDARKSHADOW); - - // Start the event for the Voice Trigger - if (Creature* VoiceTrigger = (Unit::GetCreature(*me, pInstance->GetData64(DATA_BLOOD_ELF_COUNCIL_VOICE)))) - { - CAST_AI(mob_blood_elf_council_voice_triggerAI, VoiceTrigger->AI())->LoadCouncilGUIDs(); - CAST_AI(mob_blood_elf_council_voice_triggerAI, VoiceTrigger->AI())->EventStarted = true; - } - - for (uint8 i = 0; i < 4; ++i) - { - Unit* Member = NULL; - if (Council[i]) - { - Member = Unit::GetUnit((*me), Council[i]); - if (Member && Member->isAlive()) - CAST_CRE(Member)->AI()->AttackStart(pTarget); - } - } - - pInstance->SetData(DATA_ILLIDARICOUNCILEVENT, IN_PROGRESS); - - EventBegun = true; - } - } - - void UpdateAI(const uint32 diff) - { - if (!EventBegun) return; - - if (EndEventTimer) - { - if (EndEventTimer <= diff) - { - if (DeathCount > 3) - { - if (pInstance) - { - if (Creature* VoiceTrigger = (Unit::GetCreature(*me, pInstance->GetData64(DATA_BLOOD_ELF_COUNCIL_VOICE)))) - VoiceTrigger->DealDamage(VoiceTrigger, VoiceTrigger->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - pInstance->SetData(DATA_ILLIDARICOUNCILEVENT, DONE); - //me->SummonCreature(AKAMAID,746.466980f,304.394989f,311.90208f,6.272870f,TEMPSUMMON_DEAD_DESPAWN,0); - } - me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - return; - } - - Creature* pMember = (Unit::GetCreature(*me, Council[DeathCount])); - if (pMember && pMember->isAlive()) - pMember->DealDamage(pMember, pMember->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - ++DeathCount; - EndEventTimer = 1500; - } else EndEventTimer -= diff; - } - - if (CheckTimer) - { - if (CheckTimer <= diff) - { - uint8 EvadeCheck = 0; - for (uint8 i = 0; i < 4; ++i) - { - if (Council[i]) - { - if (Creature* Member = (Unit::GetCreature((*me), Council[i]))) - { - // This is the evade/death check. - if (Member->isAlive() && !Member->getVictim()) - ++EvadeCheck; //If all members evade, we reset so that players can properly reset the event - else if (!Member->isAlive()) // If even one member dies, kill the rest, set instance data, and kill self. - { - EndEventTimer = 1000; - CheckTimer = 0; - return; - } - } - } - } - - if (EvadeCheck > 3) - Reset(); - - CheckTimer = 2000; - } else CheckTimer -= diff; - } - - } -}; - -struct boss_illidari_councilAI : public ScriptedAI -{ - boss_illidari_councilAI(Creature* c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - for (uint8 i = 0; i < 4; ++i) - Council[i] = 0; - LoadedGUIDs = false; - } - - uint64 Council[4]; - - ScriptedInstance* pInstance; - - bool LoadedGUIDs; - - void EnterCombat(Unit* who) - { - if (pInstance) - { - Creature* Controller = (Unit::GetCreature(*me, pInstance->GetData64(DATA_ILLIDARICOUNCIL))); - if (Controller) - CAST_AI(mob_illidari_councilAI, Controller->AI())->StartEvent(who); - } - else - { - error_log(ERROR_INST_DATA); - EnterEvadeMode(); - return; - } - DoZoneInCombat(); - // Load GUIDs on first aggro because the Creature guids are only set as the creatures are created in world- - // this means that for each pCreature, it will attempt to LoadGUIDs even though some of the other creatures are - // not in world, and thus have no GUID set in the instance data system. Putting it in aggro ensures that all the creatures - // have been loaded and have their GUIDs set in the instance data system. - if (!LoadedGUIDs) - LoadGUIDs(); - } - - void EnterEvadeMode() - { - for (uint8 i = 0; i < 4; ++i) - { - if (Unit* pUnit = Unit::GetUnit(*me, Council[i])) - if (pUnit != me && pUnit->getVictim()) - { - AttackStart(pUnit->getVictim()); - return; - } - } - ScriptedAI::EnterEvadeMode(); - } - - void DamageTaken(Unit* done_by, uint32 &damage) - { - if (done_by == me) - return; - - damage /= 4; - for (uint8 i = 0; i < 4; ++i) - { - if (Creature* pUnit = Unit::GetCreature(*me, Council[i])) - if (pUnit != me && damage < pUnit->GetHealth()) - { - pUnit->SetHealth(pUnit->GetHealth() - damage); - pUnit->LowerPlayerDamageReq(damage); - } - } - } - - void LoadGUIDs() - { - if (!pInstance) - { - error_log(ERROR_INST_DATA); - return; - } - - Council[0] = pInstance->GetData64(DATA_LADYMALANDE); - Council[1] = pInstance->GetData64(DATA_HIGHNETHERMANCERZEREVOR); - Council[2] = pInstance->GetData64(DATA_GATHIOSTHESHATTERER); - Council[3] = pInstance->GetData64(DATA_VERASDARKSHADOW); - - LoadedGUIDs = true; - } -}; - -struct boss_gathios_the_shattererAI : public boss_illidari_councilAI -{ - boss_gathios_the_shattererAI(Creature *c) : boss_illidari_councilAI(c) {} - - uint32 ConsecrationTimer; - uint32 HammerOfJusticeTimer; - uint32 SealTimer; - uint32 AuraTimer; - uint32 BlessingTimer; - - void Reset() - { - ConsecrationTimer = 40000; - HammerOfJusticeTimer = 10000; - SealTimer = 40000; - AuraTimer = 90000; - BlessingTimer = 60000; - } - - void KilledUnit(Unit * /*victim*/) - { - DoScriptText(SAY_GATH_SLAY, me); - } - - void JustDied(Unit * /*victim*/) - { - DoScriptText(SAY_GATH_DEATH, me); - } - - Unit* SelectCouncilMember() - { - Unit* pUnit = me; - uint32 member = 0; // He chooses Lady Malande most often - - if (rand()%10 == 0) // But there is a chance he picks someone else. - member = urand(1, 3); - - if (member != 2) // No need to create another pointer to us using Unit::GetUnit - pUnit = Unit::GetUnit((*me), Council[member]); - return pUnit; - } - - void CastAuraOnCouncil() - { - uint32 spellid = 0; - switch (urand(0,1)) - { - case 0: spellid = SPELL_DEVOTION_AURA; break; - case 1: spellid = SPELL_CHROMATIC_AURA; break; - } - for (uint8 i = 0; i < 4; ++i) - { - Unit* pUnit = Unit::GetUnit((*me), Council[i]); - if (pUnit) - pUnit->CastSpell(pUnit, spellid, true, 0, 0, me->GetGUID()); - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (BlessingTimer <= diff) - { - if (Unit* pUnit = SelectCouncilMember()) - { - switch (urand(0,1)) - { - case 0: DoCast(pUnit, SPELL_BLESS_SPELLWARD); break; - case 1: DoCast(pUnit, SPELL_BLESS_PROTECTION); break; - } - } - BlessingTimer = 60000; - } else BlessingTimer -= diff; - - if (ConsecrationTimer <= diff) - { - DoCast(me, SPELL_CONSECRATION); - ConsecrationTimer = 40000; - } else ConsecrationTimer -= diff; - - if (HammerOfJusticeTimer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - // is in ~10-40 yd range - if (me->IsInRange(pTarget, 10.0f, 40.0f, false)) - { - DoCast(pTarget, SPELL_HAMMER_OF_JUSTICE); - HammerOfJusticeTimer = 20000; - } - } - } else HammerOfJusticeTimer -= diff; - - if (SealTimer <= diff) - { - switch (urand(0,1)) - { - case 0: DoCast(me, SPELL_SEAL_OF_COMMAND); break; - case 1: DoCast(me, SPELL_SEAL_OF_BLOOD); break; - } - SealTimer = 40000; - } else SealTimer -= diff; - - if (AuraTimer <= diff) - { - CastAuraOnCouncil(); - AuraTimer = 90000; - } else AuraTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -struct boss_high_nethermancer_zerevorAI : public boss_illidari_councilAI -{ - boss_high_nethermancer_zerevorAI(Creature *c) : boss_illidari_councilAI(c) {} - - uint32 BlizzardTimer; - uint32 FlamestrikeTimer; - uint32 ArcaneBoltTimer; - uint32 DampenMagicTimer; - uint32 Cooldown; - uint32 ArcaneExplosionTimer; - - void Reset() - { - BlizzardTimer = 30000 + rand()%61 * 1000; - FlamestrikeTimer = 30000 + rand()%61 * 1000; - ArcaneBoltTimer = 10000; - DampenMagicTimer = 2000; - ArcaneExplosionTimer = 14000; - Cooldown = 0; - } - - void KilledUnit(Unit * /*victim*/) - { - DoScriptText(SAY_ZERE_SLAY, me); - } - - void JustDied(Unit * /*victim*/) - { - DoScriptText(SAY_ZERE_DEATH, me); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (Cooldown) - { - if (Cooldown <= diff) Cooldown = 0; - else - { - Cooldown -= diff; - return; // Don't cast any other spells if global cooldown is still ticking - } - } - - if (DampenMagicTimer <= diff) - { - DoCast(me, SPELL_DAMPEN_MAGIC); - Cooldown = 1000; - DampenMagicTimer = 67200; // almost 1,12 minutes - ArcaneBoltTimer += 1000; // Give the Mage some time to spellsteal Dampen. - } else DampenMagicTimer -= diff; - - if (ArcaneExplosionTimer <= diff) - { - DoCast(me->getVictim(), SPELL_ARCANE_EXPLOSION); - Cooldown = 1000; - ArcaneExplosionTimer = 14000; - } else ArcaneExplosionTimer -= diff; - - if (ArcaneBoltTimer <= diff) - { - DoCast(me->getVictim(), SPELL_ARCANE_BOLT); - ArcaneBoltTimer = 3000; - Cooldown = 2000; - } else ArcaneBoltTimer -= diff; - - if (BlizzardTimer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - DoCast(pTarget, SPELL_BLIZZARD); - BlizzardTimer = 45000 + rand()%46 * 1000; - FlamestrikeTimer += 10000; - Cooldown = 1000; - } - } else BlizzardTimer -= diff; - - if (FlamestrikeTimer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - DoCast(pTarget, SPELL_FLAMESTRIKE); - FlamestrikeTimer = 55000 + rand()%46 * 1000; - BlizzardTimer += 10000; - Cooldown = 2000; - } - } else FlamestrikeTimer -= diff; - } -}; - -struct boss_lady_malandeAI : public boss_illidari_councilAI -{ - boss_lady_malandeAI(Creature *c) : boss_illidari_councilAI(c) {} - - uint32 EmpoweredSmiteTimer; - uint32 CircleOfHealingTimer; - uint32 DivineWrathTimer; - uint32 ReflectiveShieldTimer; - - void Reset() - { - EmpoweredSmiteTimer = 38000; - CircleOfHealingTimer = 20000; - DivineWrathTimer = 40000; - ReflectiveShieldTimer = 0; - } - - void KilledUnit(Unit * /*victim*/) - { - DoScriptText(SAY_MALA_SLAY, me); - } - - void JustDied(Unit * /*victim*/) - { - DoScriptText(SAY_MALA_DEATH, me); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (EmpoweredSmiteTimer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - DoCast(pTarget, SPELL_EMPOWERED_SMITE); - EmpoweredSmiteTimer = 38000; - } - } else EmpoweredSmiteTimer -= diff; - - if (CircleOfHealingTimer <= diff) - { - DoCast(me, SPELL_CIRCLE_OF_HEALING); - CircleOfHealingTimer = 60000; - } else CircleOfHealingTimer -= diff; - - if (DivineWrathTimer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - DoCast(pTarget, SPELL_DIVINE_WRATH); - DivineWrathTimer = 40000 + rand()%41 * 1000; - } - } else DivineWrathTimer -= diff; - - if (ReflectiveShieldTimer <= diff) - { - DoCast(me, SPELL_REFLECTIVE_SHIELD); - ReflectiveShieldTimer = 65000; - } else ReflectiveShieldTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -struct boss_veras_darkshadowAI : public boss_illidari_councilAI -{ - boss_veras_darkshadowAI(Creature *c) : boss_illidari_councilAI(c) {} - - uint64 EnvenomTargetGUID; - - uint32 DeadlyPoisonTimer; - uint32 VanishTimer; - uint32 AppearEnvenomTimer; - - bool HasVanished; - - void Reset() - { - EnvenomTargetGUID = 0; - - DeadlyPoisonTimer = 20000; - VanishTimer = 60000 + rand()%61 * 1000; - AppearEnvenomTimer = 150000; - - HasVanished = false; - me->SetVisibility(VISIBILITY_ON); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - } - - void KilledUnit(Unit * /*victim*/) - { - DoScriptText(SAY_VERA_SLAY, me); - } - - void JustDied(Unit * /*victim*/) - { - DoScriptText(SAY_VERA_DEATH, me); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (!HasVanished) - { - if (DeadlyPoisonTimer <= diff) - { - DoCast(me->getVictim(), SPELL_DEADLY_POISON); - DeadlyPoisonTimer = 15000 + rand()%31 * 1000; - } else DeadlyPoisonTimer -= diff; - - if (AppearEnvenomTimer <= diff) // Cast Envenom. This is cast 4 seconds after Vanish is over - { - DoCast(me->getVictim(), SPELL_ENVENOM); - AppearEnvenomTimer = 90000; - } else AppearEnvenomTimer -= diff; - - if (VanishTimer <= diff) // Disappear and stop attacking, but follow a random unit - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - VanishTimer = 30000; - AppearEnvenomTimer= 28000; - HasVanished = true; - me->SetVisibility(VISIBILITY_OFF); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - DoResetThreat(); - // Chase a unit. Check before DoMeleeAttackIfReady prevents from attacking - me->AddThreat(pTarget, 500000.0f); - me->GetMotionMaster()->MoveChase(pTarget); - } - } else VanishTimer -= diff; - - DoMeleeAttackIfReady(); - } - else - { - if (VanishTimer <= diff) // Become attackable and poison current target - { - Unit *pTarget = me->getVictim(); - DoCast(pTarget, SPELL_DEADLY_POISON); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - DoResetThreat(); - me->AddThreat(pTarget, 3000.0f); // Make Veras attack his target for a while, he will cast Envenom 4 seconds after. - DeadlyPoisonTimer += 6000; - VanishTimer = 90000; - AppearEnvenomTimer = 4000; - HasVanished = false; - } else VanishTimer -= diff; - - if (AppearEnvenomTimer <= diff) // Appear 2 seconds before becoming attackable (Shifting out of vanish) - { - me->GetMotionMaster()->Clear(); - me->GetMotionMaster()->MoveChase(me->getVictim()); - me->SetVisibility(VISIBILITY_ON); - AppearEnvenomTimer = 6000; - } else AppearEnvenomTimer -= diff; - } - } -}; - -CreatureAI* GetAI_mob_blood_elf_council_voice_trigger(Creature* c) -{ - return new mob_blood_elf_council_voice_triggerAI(c); -} - -CreatureAI* GetAI_mob_illidari_council(Creature* pCreature) -{ - return new mob_illidari_councilAI (pCreature); -} - -CreatureAI* GetAI_boss_gathios_the_shatterer(Creature* pCreature) -{ - return new boss_gathios_the_shattererAI (pCreature); -} - -CreatureAI* GetAI_boss_lady_malande(Creature* pCreature) -{ - return new boss_lady_malandeAI (pCreature); -} - -CreatureAI* GetAI_boss_veras_darkshadow(Creature* pCreature) -{ - return new boss_veras_darkshadowAI (pCreature); -} - -CreatureAI* GetAI_boss_high_nethermancer_zerevor(Creature* pCreature) -{ - return new boss_high_nethermancer_zerevorAI (pCreature); -} - -void AddSC_boss_illidari_council() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "mob_illidari_council"; - newscript->GetAI = &GetAI_mob_illidari_council; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_blood_elf_council_voice_trigger"; - newscript->GetAI = &GetAI_mob_blood_elf_council_voice_trigger; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_gathios_the_shatterer"; - newscript->GetAI = &GetAI_boss_gathios_the_shatterer; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_lady_malande"; - newscript->GetAI = &GetAI_boss_lady_malande; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_veras_darkshadow"; - newscript->GetAI = &GetAI_boss_veras_darkshadow; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_high_nethermancer_zerevor"; - newscript->GetAI = &GetAI_boss_high_nethermancer_zerevor; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Outland/black_temple/instance_black_temple.cpp b/src/server/scripts/Outland/black_temple/instance_black_temple.cpp deleted file mode 100644 index 88e25026a13..00000000000 --- a/src/server/scripts/Outland/black_temple/instance_black_temple.cpp +++ /dev/null @@ -1,346 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -/* ScriptData -SDName: Instance_Black_Temple -SD%Complete: 100 -SDComment: Instance Data Scripts and functions to acquire mobs and set encounter status for use in various Black Temple Scripts -SDCategory: Black Temple -EndScriptData */ - -#include "ScriptedPch.h" -#include "black_temple.h" - -#define MAX_ENCOUNTER 9 - -/* Black Temple encounters: -0 - High Warlord Naj'entus event -1 - Supremus Event -2 - Shade of Akama Event -3 - Teron Gorefiend Event -4 - Gurtogg Bloodboil Event -5 - Reliquary Of Souls Event -6 - Mother Shahraz Event -7 - Illidari Council Event -8 - Illidan Stormrage Event -*/ - -struct instance_black_temple : public ScriptedInstance -{ - instance_black_temple(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - std::string str_data; - - uint64 Najentus; - uint64 Akama; // This is the Akama that starts the Illidan encounter. - uint64 Akama_Shade; // This is the Akama that starts the Shade of Akama encounter. - uint64 ShadeOfAkama; - uint64 Supremus; - uint64 LadyMalande; - uint64 GathiosTheShatterer; - uint64 HighNethermancerZerevor; - uint64 VerasDarkshadow; - uint64 IllidariCouncil; - uint64 BloodElfCouncilVoice; - uint64 IllidanStormrage; - - uint64 NajentusGate; - uint64 MainTempleDoors; - uint64 ShadeOfAkamaDoor; - uint64 CommonDoor;//Teron - uint64 TeronDoor; - uint64 GuurtogDoor; - uint64 MotherDoor; - uint64 TempleDoor;//Befor mother - uint64 CouncilDoor; - uint64 SimpleDoor;//council - uint64 IllidanGate; - uint64 IllidanDoor[2]; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - Najentus = 0; - Akama = 0; - Akama_Shade = 0; - ShadeOfAkama = 0; - Supremus = 0; - LadyMalande = 0; - GathiosTheShatterer = 0; - HighNethermancerZerevor = 0; - VerasDarkshadow = 0; - IllidariCouncil = 0; - BloodElfCouncilVoice = 0; - IllidanStormrage = 0; - - NajentusGate = 0; - MainTempleDoors = 0; - ShadeOfAkamaDoor= 0; - CommonDoor = 0;//teron - TeronDoor = 0; - GuurtogDoor = 0; - MotherDoor = 0; - TempleDoor = 0; - SimpleDoor = 0;//Bycouncil - CouncilDoor = 0; - IllidanGate = 0; - IllidanDoor[0] = 0; - IllidanDoor[1] = 0; - } - - bool IsEncounterInProgress() const - { - for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) return true; - - return false; - } - - Player* GetPlayerInMap() - { - Map::PlayerList const& players = instance->GetPlayers(); - - if (!players.isEmpty()) - { - for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) - { - if (Player* plr = itr->getSource()) - return plr; - } - } - - debug_log("TSCR: Instance Black Temple: GetPlayerInMap, but PlayerList is empty!"); - return NULL; - } - - void OnCreatureCreate(Creature* pCreature, bool /*add*/) - { - switch(pCreature->GetEntry()) - { - case 22887: Najentus = pCreature->GetGUID(); break; - case 23089: Akama = pCreature->GetGUID(); break; - case 22990: Akama_Shade = pCreature->GetGUID(); break; - case 22841: ShadeOfAkama = pCreature->GetGUID(); break; - case 22898: Supremus = pCreature->GetGUID(); break; - case 22917: IllidanStormrage = pCreature->GetGUID(); break; - case 22949: GathiosTheShatterer = pCreature->GetGUID(); break; - case 22950: HighNethermancerZerevor = pCreature->GetGUID(); break; - case 22951: LadyMalande = pCreature->GetGUID(); break; - case 22952: VerasDarkshadow = pCreature->GetGUID(); break; - case 23426: IllidariCouncil = pCreature->GetGUID(); break; - case 23499: BloodElfCouncilVoice = pCreature->GetGUID(); break; - } - } - - void OnGameObjectCreate(GameObject* pGo, bool /*add*/) - { - switch(pGo->GetEntry()) - { - case 185483: NajentusGate = pGo->GetGUID();// Gate past Naj'entus (at the entrance to Supermoose's courtyards) - if (m_auiEncounter[0] == DONE)HandleGameObject(NULL,true,pGo);break; - case 185882: MainTempleDoors = pGo->GetGUID();// Main Temple Doors - right past Supermoose (Supremus) - if (m_auiEncounter[1] == DONE)HandleGameObject(NULL,true,pGo);break; - case 185478: ShadeOfAkamaDoor = pGo->GetGUID();break; - case 185480: CommonDoor = pGo->GetGUID(); - if (m_auiEncounter[3] == DONE)HandleGameObject(NULL,true,pGo);break; - case 186153: TeronDoor = pGo->GetGUID(); - if (m_auiEncounter[3] == DONE)HandleGameObject(NULL,true,pGo);break; - case 185892: GuurtogDoor = pGo->GetGUID(); - if (m_auiEncounter[4] == DONE)HandleGameObject(NULL,true,pGo);break; - case 185479: TempleDoor = pGo->GetGUID(); - if (m_auiEncounter[5] == DONE)HandleGameObject(NULL,true,pGo);break; - case 185482: MotherDoor = pGo->GetGUID(); - if (m_auiEncounter[6] == DONE)HandleGameObject(NULL,true,pGo);break; - case 185481: CouncilDoor = pGo->GetGUID(); - if (m_auiEncounter[7] == DONE)HandleGameObject(NULL,true,pGo);break; - case 186152: SimpleDoor = pGo->GetGUID(); - if (m_auiEncounter[7] == DONE)HandleGameObject(NULL,true,pGo);break; - case 185905: IllidanGate = pGo->GetGUID(); break; // Gate leading to Temple Summit - case 186261: IllidanDoor[0] = pGo->GetGUID(); break; // Right door at Temple Summit - case 186262: IllidanDoor[1] = pGo->GetGUID(); break; // Left door at Temple Summit - } - } - - uint64 GetData64(uint32 identifier) - { - switch(identifier) - { - case DATA_HIGHWARLORDNAJENTUS: return Najentus; - case DATA_AKAMA: return Akama; - case DATA_AKAMA_SHADE: return Akama_Shade; - case DATA_SHADEOFAKAMA: return ShadeOfAkama; - case DATA_SUPREMUS: return Supremus; - case DATA_ILLIDANSTORMRAGE: return IllidanStormrage; - case DATA_GATHIOSTHESHATTERER: return GathiosTheShatterer; - case DATA_HIGHNETHERMANCERZEREVOR: return HighNethermancerZerevor; - case DATA_LADYMALANDE: return LadyMalande; - case DATA_VERASDARKSHADOW: return VerasDarkshadow; - case DATA_ILLIDARICOUNCIL: return IllidariCouncil; - case DATA_GAMEOBJECT_NAJENTUS_GATE: return NajentusGate; - case DATA_GAMEOBJECT_ILLIDAN_GATE: return IllidanGate; - case DATA_GAMEOBJECT_ILLIDAN_DOOR_R: return IllidanDoor[0]; - case DATA_GAMEOBJECT_ILLIDAN_DOOR_L: return IllidanDoor[1]; - case DATA_GAMEOBJECT_SUPREMUS_DOORS: return MainTempleDoors; - case DATA_BLOOD_ELF_COUNCIL_VOICE: return BloodElfCouncilVoice; - } - - return 0; - } - - void SetData(uint32 type, uint32 data) - { - switch(type) - { - case DATA_HIGHWARLORDNAJENTUSEVENT: - if (data == DONE) - { - HandleGameObject(NajentusGate, true); - } - m_auiEncounter[0] = data;break; - case DATA_SUPREMUSEVENT: - if (data == DONE) - { - HandleGameObject(NajentusGate, true); - } - m_auiEncounter[1] = data; break; - case DATA_SHADEOFAKAMAEVENT: - if (data == IN_PROGRESS) - { - HandleGameObject(ShadeOfAkamaDoor, false); - } else HandleGameObject(ShadeOfAkamaDoor, true); - m_auiEncounter[2] = data; break; - case DATA_TERONGOREFIENDEVENT: - if (data == IN_PROGRESS) - { - HandleGameObject(TeronDoor, false); - HandleGameObject(CommonDoor, false); - }else - { - HandleGameObject(TeronDoor, true); - HandleGameObject(CommonDoor, true); - } - m_auiEncounter[3] = data; break; - case DATA_GURTOGGBLOODBOILEVENT: - if (data == DONE) - { - HandleGameObject(GuurtogDoor, true); - } - m_auiEncounter[4] = data; break; - case DATA_RELIQUARYOFSOULSEVENT: - if (data == DONE) - { - HandleGameObject(TempleDoor, true); - } - m_auiEncounter[5] = data; break; - case DATA_MOTHERSHAHRAZEVENT: - if (data == DONE) - { - HandleGameObject(MotherDoor, true); - } - m_auiEncounter[6] = data; break; - case DATA_ILLIDARICOUNCILEVENT: - if (data == IN_PROGRESS) - { - HandleGameObject(CouncilDoor, false); - HandleGameObject(SimpleDoor, false); - }else - { - HandleGameObject(CouncilDoor, true); - HandleGameObject(SimpleDoor, true); - } - m_auiEncounter[7] = data; break; - case DATA_ILLIDANSTORMRAGEEVENT: m_auiEncounter[8] = data; break; - } - - if (data == DONE) - { - OUT_SAVE_INST_DATA; - - std::ostringstream saveStream; - saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " - << m_auiEncounter[2] << " " << m_auiEncounter[3] << " " << m_auiEncounter[4] - << " " << m_auiEncounter[5] << " " << m_auiEncounter[6] << " " << m_auiEncounter[7] - << " " << m_auiEncounter[8]; - - str_data = saveStream.str(); - - SaveToDB(); - OUT_SAVE_INST_DATA_COMPLETE; - } - } - - uint32 GetData(uint32 type) - { - switch(type) - { - case DATA_HIGHWARLORDNAJENTUSEVENT: return m_auiEncounter[0]; - case DATA_SUPREMUSEVENT: return m_auiEncounter[1]; - case DATA_SHADEOFAKAMAEVENT: return m_auiEncounter[2]; - case DATA_TERONGOREFIENDEVENT: return m_auiEncounter[3]; - case DATA_GURTOGGBLOODBOILEVENT: return m_auiEncounter[4]; - case DATA_RELIQUARYOFSOULSEVENT: return m_auiEncounter[5]; - case DATA_MOTHERSHAHRAZEVENT: return m_auiEncounter[6]; - case DATA_ILLIDARICOUNCILEVENT: return m_auiEncounter[7]; - case DATA_ILLIDANSTORMRAGEEVENT: return m_auiEncounter[8]; - } - - return 0; - } - - std::string GetSaveData() - { - return str_data; - } - - void Load(const char* in) - { - if (!in) - { - OUT_LOAD_INST_DATA_FAIL; - return; - } - - OUT_LOAD_INST_DATA(in); - - std::istringstream loadStream(in); - loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] - >> m_auiEncounter[3] >> m_auiEncounter[4] >> m_auiEncounter[5] >> m_auiEncounter[6] - >> m_auiEncounter[7] >> m_auiEncounter[8]; - - for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) - m_auiEncounter[i] = NOT_STARTED; - - OUT_LOAD_INST_DATA_COMPLETE; - } -}; - -InstanceData* GetInstanceData_instance_black_temple(Map* pMap) -{ - return new instance_black_temple(pMap); -} - -void AddSC_instance_black_temple() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_black_temple"; - newscript->GetInstanceData = &GetInstanceData_instance_black_temple; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Outland/coilfang_resevoir/serpent_shrine/boss_fathomlord_karathress.cpp b/src/server/scripts/Outland/coilfang_resevoir/serpent_shrine/boss_fathomlord_karathress.cpp deleted file mode 100644 index 69a969adda0..00000000000 --- a/src/server/scripts/Outland/coilfang_resevoir/serpent_shrine/boss_fathomlord_karathress.cpp +++ /dev/null @@ -1,746 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Fathomlord_Karathress -SD%Complete: 70 -SDComment: Cyclone workaround -SDCategory: Coilfang Resevoir, Serpent Shrine Cavern -EndScriptData */ - -#include "ScriptedPch.h" -#include "serpent_shrine.h" -#include "ScriptedEscortAI.h" - -#define SAY_AGGRO -1548021 -#define SAY_GAIN_BLESSING -1548022 -#define SAY_GAIN_ABILITY1 -1548023 -#define SAY_GAIN_ABILITY2 -1548024 -#define SAY_GAIN_ABILITY3 -1548025 -#define SAY_SLAY1 -1548026 -#define SAY_SLAY2 -1548027 -#define SAY_SLAY3 -1548028 -#define SAY_DEATH -1548029 - -//Karathress spells -#define SPELL_CATACLYSMIC_BOLT 38441 -#define SPELL_POWER_OF_SHARKKIS 38455 -#define SPELL_POWER_OF_TIDALVESS 38452 -#define SPELL_POWER_OF_CARIBDIS 38451 -#define SPELL_ENRAGE 24318 -#define SPELL_SEAR_NOVA 38445 -#define SPELL_BLESSING_OF_THE_TIDES 38449 - -//Sharkkis spells -#define SPELL_LEECHING_THROW 29436 -#define SPELL_THE_BEAST_WITHIN 38373 -#define SPELL_MULTISHOT 38366 -#define SPELL_SUMMON_FATHOM_LURKER 38433 -#define SPELL_SUMMON_FATHOM_SPOREBAT 38431 -#define SPELL_PET_ENRAGE 19574 - -//Tidalvess spells -#define SPELL_FROST_SHOCK 38234 -#define SPELL_SPITFIRE_TOTEM 38236 -#define SPELL_POISON_CLEANSING_TOTEM 38306 -// Spell obsolete -// #define SPELL_POISON_CLEANSING_EFFECT 8167 -#define SPELL_EARTHBIND_TOTEM 38304 -#define SPELL_EARTHBIND_TOTEM_EFFECT 6474 -#define SPELL_WINDFURY_WEAPON 38184 - -//Caribdis Spells -#define SPELL_WATER_BOLT_VOLLEY 38335 -#define SPELL_TIDAL_SURGE 38358 -#define SPELL_TIDAL_SURGE_FREEZE 38357 -#define SPELL_HEAL 38330 -#define SPELL_SUMMON_CYCLONE 38337 -#define SPELL_CYCLONE_CYCLONE 29538 - -//Yells and Quotes -#define SAY_GAIN_BLESSING_OF_TIDES "Your overconfidence will be your undoing! Guards, lend me your strength!" -#define SOUND_GAIN_BLESSING_OF_TIDES 11278 -#define SAY_MISC "Alana be'lendor!" //don't know what use this -#define SOUND_MISC 11283 - -//Summoned Unit GUIDs -#define CREATURE_CYCLONE 22104 -#define CREATURE_FATHOM_SPOREBAT 22120 -#define CREATURE_FATHOM_LURKER 22119 -#define CREATURE_SPITFIRE_TOTEM 22091 -#define CREATURE_EARTHBIND_TOTEM 22486 -#define CREATURE_POISON_CLEANSING_TOTEM 22487 - -//entry and position for Seer Olum -#define SEER_OLUM 22820 -#define OLUM_X 446.78f -#define OLUM_Y -542.76f -#define OLUM_Z -7.54773f -#define OLUM_O 0.401581f - -//Fathom-Lord Karathress AI -struct boss_fathomlord_karathressAI : public ScriptedAI -{ - boss_fathomlord_karathressAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - Advisors[0] = 0; - Advisors[1] = 0; - Advisors[2] = 0; - } - - ScriptedInstance* pInstance; - - uint32 CataclysmicBolt_Timer; - uint32 Enrage_Timer; - uint32 SearNova_Timer; - - bool BlessingOfTides; - - uint64 Advisors[3]; - - void Reset() - { - CataclysmicBolt_Timer = 10000; - Enrage_Timer = 600000; //10 minutes - SearNova_Timer = 20000+rand()%40000; // 20 - 60 seconds - - BlessingOfTides = false; - - if (pInstance) - { - uint64 RAdvisors[3]; - RAdvisors[0] = pInstance->GetData64(DATA_SHARKKIS); - RAdvisors[1] = pInstance->GetData64(DATA_TIDALVESS); - RAdvisors[2] = pInstance->GetData64(DATA_CARIBDIS); - //Respawn of the 3 Advisors - Creature* pAdvisor = NULL; - for (int i=0; i<3; ++i) - - if (RAdvisors[i]) - { - pAdvisor = (Unit::GetCreature((*me), RAdvisors[i])); - if (pAdvisor && !pAdvisor->isAlive()) - { - pAdvisor->Respawn(); - pAdvisor->AI()->EnterEvadeMode(); - pAdvisor->GetMotionMaster()->MoveTargetedHome(); - } - } - pInstance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED); - } - - } - - void EventSharkkisDeath() - { - DoScriptText(SAY_GAIN_ABILITY1, me); - DoCast(me, SPELL_POWER_OF_SHARKKIS); - } - - void EventTidalvessDeath() - { - DoScriptText(SAY_GAIN_ABILITY2, me); - DoCast(me, SPELL_POWER_OF_TIDALVESS); - } - - void EventCaribdisDeath() - { - DoScriptText(SAY_GAIN_ABILITY3, me); - DoCast(me, SPELL_POWER_OF_CARIBDIS); - } - - void GetAdvisors() - { - if (!pInstance) - return; - - Advisors[0] = pInstance->GetData64(DATA_SHARKKIS); - Advisors[1] = pInstance->GetData64(DATA_TIDALVESS); - Advisors[2] = pInstance->GetData64(DATA_CARIBDIS); - } - - void StartEvent(Unit *who) - { - if (!pInstance) - return; - - GetAdvisors(); - - DoScriptText(SAY_AGGRO, me); - DoZoneInCombat(); - - pInstance->SetData64(DATA_KARATHRESSEVENT_STARTER, who->GetGUID()); - pInstance->SetData(DATA_KARATHRESSEVENT, IN_PROGRESS); - } - - void KilledUnit(Unit * /*victim*/) - { - DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), me); - } - - void JustDied(Unit * /*killer*/) - { - DoScriptText(SAY_DEATH, me); - - if (pInstance) - pInstance->SetData(DATA_FATHOMLORDKARATHRESSEVENT, DONE); - - //support for quest 10944 - me->SummonCreature(SEER_OLUM, OLUM_X, OLUM_Y, OLUM_Z, OLUM_O, TEMPSUMMON_TIMED_DESPAWN, 3600000); - } - - void EnterCombat(Unit * who) - { - StartEvent(who); - } - - void UpdateAI(const uint32 diff) - { - //Only if not incombat check if the event is started - if (!me->isInCombat() && pInstance && pInstance->GetData(DATA_KARATHRESSEVENT)) - { - Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_KARATHRESSEVENT_STARTER)); - - if (pTarget) - { - AttackStart(pTarget); - GetAdvisors(); - } - } - - //Return since we have no target - if (!UpdateVictim()) - return; - - //someone evaded! - if (pInstance && !pInstance->GetData(DATA_KARATHRESSEVENT)) - { - EnterEvadeMode(); - return; - } - - //CataclysmicBolt_Timer - if (CataclysmicBolt_Timer <= diff) - { - //select a random unit other than the main tank - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1); - - //if there aren't other units, cast on the tank - if (!pTarget) - pTarget = me->getVictim(); - - if (pTarget) - DoCast(pTarget, SPELL_CATACLYSMIC_BOLT); - CataclysmicBolt_Timer = 10000; - } else CataclysmicBolt_Timer -= diff; - - //SearNova_Timer - if (SearNova_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SEAR_NOVA); - SearNova_Timer = 20000+rand()%40000; - } else SearNova_Timer -= diff; - - //Enrage_Timer - if (Enrage_Timer <= diff) - { - DoCast(me, SPELL_ENRAGE); - Enrage_Timer = 90000; - } else Enrage_Timer -= diff; - - //Blessing of Tides Trigger - if ((me->GetHealth()*100 / me->GetMaxHealth()) <= 75 && !BlessingOfTides) - { - BlessingOfTides = true; - bool continueTriggering = false; - Creature* Advisor; - for (uint8 i = 0; i < 4; ++i) - if (Advisors[i]) - { - Advisor = (Unit::GetCreature(*me, Advisors[i])); - if (Advisor && Advisor->isAlive()) - { - continueTriggering = true; - break; - } - } - if (continueTriggering) - { - DoCast(me, SPELL_BLESSING_OF_THE_TIDES); - me->MonsterYell(SAY_GAIN_BLESSING_OF_TIDES, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(me, SOUND_GAIN_BLESSING_OF_TIDES); - } - } - - DoMeleeAttackIfReady(); - } -}; - -//Fathom-Guard Sharkkis AI -struct boss_fathomguard_sharkkisAI : public ScriptedAI -{ - boss_fathomguard_sharkkisAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint32 LeechingThrow_Timer; - uint32 TheBeastWithin_Timer; - uint32 Multishot_Timer; - uint32 Pet_Timer; - - bool pet; - - uint64 SummonedPet; - - void Reset() - { - LeechingThrow_Timer = 20000; - TheBeastWithin_Timer = 30000; - Multishot_Timer = 15000; - Pet_Timer = 10000; - - pet = false; - - Creature *Pet = Unit::GetCreature(*me, SummonedPet); - if (Pet && Pet->isAlive()) - { - Pet->DealDamage(Pet, Pet->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - } - - SummonedPet = 0; - - if (pInstance) - pInstance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED); - } - - void JustDied(Unit * /*victim*/) - { - if (pInstance) - { - Creature *Karathress = NULL; - Karathress = (Unit::GetCreature((*me), pInstance->GetData64(DATA_KARATHRESS))); - - if (Karathress) - CAST_AI(boss_fathomlord_karathressAI, Karathress->AI())->EventSharkkisDeath(); - CAST_AI(boss_fathomlord_karathressAI, Karathress->AI())->EventSharkkisDeath(); - } - } - - void EnterCombat(Unit * who) - { - if (pInstance) - { - pInstance->SetData64(DATA_KARATHRESSEVENT_STARTER, who->GetGUID()); - pInstance->SetData(DATA_KARATHRESSEVENT, IN_PROGRESS); - } - } - - void UpdateAI(const uint32 diff) - { - //Only if not incombat check if the event is started - if (!me->isInCombat() && pInstance && pInstance->GetData(DATA_KARATHRESSEVENT)) - { - Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_KARATHRESSEVENT_STARTER)); - - if (pTarget) - { - AttackStart(pTarget); - } - } - - //Return since we have no target - if (!UpdateVictim()) - return; - - //someone evaded! - if (pInstance && !pInstance->GetData(DATA_KARATHRESSEVENT)) - { - EnterEvadeMode(); - return; - } - - //LeechingThrow_Timer - if (LeechingThrow_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_LEECHING_THROW); - LeechingThrow_Timer = 20000; - } else LeechingThrow_Timer -= diff; - - //Multishot_Timer - if (Multishot_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_MULTISHOT); - Multishot_Timer = 20000; - } else Multishot_Timer -= diff; - - //TheBeastWithin_Timer - if (TheBeastWithin_Timer <= diff) - { - DoCast(me, SPELL_THE_BEAST_WITHIN); - Creature *Pet = Unit::GetCreature(*me, SummonedPet); - if (Pet && Pet->isAlive()) - { - Pet->CastSpell(Pet, SPELL_PET_ENRAGE, true); - } - TheBeastWithin_Timer = 30000; - } else TheBeastWithin_Timer -= diff; - - //Pet_Timer - if (Pet_Timer < diff && pet == false) - { - pet = true; - //uint32 spell_id; - uint32 pet_id; - if (!urand(0,1)) - { - //spell_id = SPELL_SUMMON_FATHOM_LURKER; - pet_id = CREATURE_FATHOM_LURKER; - } - else - { - //spell_id = SPELL_SUMMON_FATHOM_SPOREBAT; - pet_id = CREATURE_FATHOM_SPOREBAT; - } - //DoCast(me, spell_id, true); - Creature *Pet = DoSpawnCreature(pet_id,0,0,0,0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); - if (Pet && pTarget) - { - Pet->AI()->AttackStart(pTarget); - SummonedPet = Pet->GetGUID(); - } - } else Pet_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -//Fathom-Guard Tidalvess AI -struct boss_fathomguard_tidalvessAI : public ScriptedAI -{ - boss_fathomguard_tidalvessAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint32 FrostShock_Timer; - uint32 Spitfire_Timer; - uint32 PoisonCleansing_Timer; - uint32 Earthbind_Timer; - - void Reset() - { - FrostShock_Timer = 25000; - Spitfire_Timer = 60000; - PoisonCleansing_Timer = 30000; - Earthbind_Timer = 45000; - - if (pInstance) - pInstance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED); - } - - void JustDied(Unit * /*victim*/) - { - if (pInstance) - { - Creature *Karathress = NULL; - Karathress = (Unit::GetCreature((*me), pInstance->GetData64(DATA_KARATHRESS))); - - if (Karathress) - if (!me->isAlive() && Karathress) - CAST_AI(boss_fathomlord_karathressAI, Karathress->AI())->EventTidalvessDeath(); - } - } - - void EnterCombat(Unit * who) - { - if (pInstance) - { - pInstance->SetData64(DATA_KARATHRESSEVENT_STARTER, who->GetGUID()); - pInstance->SetData(DATA_KARATHRESSEVENT, IN_PROGRESS); - } - DoCast(me, SPELL_WINDFURY_WEAPON); - } - - void UpdateAI(const uint32 diff) - { - //Only if not incombat check if the event is started - if (!me->isInCombat() && pInstance && pInstance->GetData(DATA_KARATHRESSEVENT)) - { - Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_KARATHRESSEVENT_STARTER)); - - if (pTarget) - { - AttackStart(pTarget); - } - } - - //Return since we have no target - if (!UpdateVictim()) - return; - - //someone evaded! - if (pInstance && !pInstance->GetData(DATA_KARATHRESSEVENT)) - { - EnterEvadeMode(); - return; - } - - if (!me->HasAura(SPELL_WINDFURY_WEAPON)) - { - DoCast(me, SPELL_WINDFURY_WEAPON); - } - - //FrostShock_Timer - if (FrostShock_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_FROST_SHOCK); - FrostShock_Timer = 25000+rand()%5000; - } else FrostShock_Timer -= diff; - - //Spitfire_Timer - if (Spitfire_Timer <= diff) - { - DoCast(me, SPELL_SPITFIRE_TOTEM); - Unit *SpitfireTotem = Unit::GetUnit(*me, CREATURE_SPITFIRE_TOTEM); - if (SpitfireTotem) - { - CAST_CRE(SpitfireTotem)->AI()->AttackStart(me->getVictim()); - } - Spitfire_Timer = 60000; - } else Spitfire_Timer -= diff; - - //PoisonCleansing_Timer - if (PoisonCleansing_Timer <= diff) - { - DoCast(me, SPELL_POISON_CLEANSING_TOTEM); - PoisonCleansing_Timer = 30000; - } else PoisonCleansing_Timer -= diff; - - //Earthbind_Timer - if (Earthbind_Timer <= diff) - { - DoCast(me, SPELL_EARTHBIND_TOTEM); - Earthbind_Timer = 45000; - } else Earthbind_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -//Fathom-Guard Caribdis AI -struct boss_fathomguard_caribdisAI : public ScriptedAI -{ - boss_fathomguard_caribdisAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint32 WaterBoltVolley_Timer; - uint32 TidalSurge_Timer; - uint32 Heal_Timer; - uint32 Cyclone_Timer; - - void Reset() - { - WaterBoltVolley_Timer = 35000; - TidalSurge_Timer = 15000+rand()%5000; - Heal_Timer = 55000; - Cyclone_Timer = 30000+rand()%10000; - - if (pInstance) - pInstance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED); - } - - void JustDied(Unit * /*victim*/) - { - if (pInstance) - { - Creature *Karathress = NULL; - Karathress = (Unit::GetCreature((*me), pInstance->GetData64(DATA_KARATHRESS))); - - if (Karathress) - if (!me->isAlive() && Karathress) - CAST_AI(boss_fathomlord_karathressAI, Karathress->AI())->EventCaribdisDeath(); - } - } - - void EnterCombat(Unit * who) - { - if (pInstance) - { - pInstance->SetData64(DATA_KARATHRESSEVENT_STARTER, who->GetGUID()); - pInstance->SetData(DATA_KARATHRESSEVENT, IN_PROGRESS); - } - } - - void UpdateAI(const uint32 diff) - { - //Only if not incombat check if the event is started - if (!me->isInCombat() && pInstance && pInstance->GetData(DATA_KARATHRESSEVENT)) - { - Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_KARATHRESSEVENT_STARTER)); - - if (pTarget) - { - AttackStart(pTarget); - } - } - - //Return since we have no target - if (!UpdateVictim()) - return; - - //someone evaded! - if (pInstance && !pInstance->GetData(DATA_KARATHRESSEVENT)) - { - EnterEvadeMode(); - return; - } - - //WaterBoltVolley_Timer - if (WaterBoltVolley_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_WATER_BOLT_VOLLEY); - WaterBoltVolley_Timer = 30000; - } else WaterBoltVolley_Timer -= diff; - - //TidalSurge_Timer - if (TidalSurge_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_TIDAL_SURGE); - // Hacky way to do it - won't trigger elseways - me->getVictim()->CastSpell(me->getVictim(), SPELL_TIDAL_SURGE_FREEZE, true); - TidalSurge_Timer = 15000+rand()%5000; - } else TidalSurge_Timer -= diff; - - //Cyclone_Timer - if (Cyclone_Timer <= diff) - { - //DoCast(me, SPELL_SUMMON_CYCLONE); // Doesn't work - Cyclone_Timer = 30000+rand()%10000; - Creature *Cyclone = me->SummonCreature(CREATURE_CYCLONE, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), (rand()%5), TEMPSUMMON_TIMED_DESPAWN, 15000); - if (Cyclone) - { - CAST_CRE(Cyclone)->SetFloatValue(OBJECT_FIELD_SCALE_X, 3.0f); - Cyclone->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - Cyclone->setFaction(me->getFaction()); - Cyclone->CastSpell(Cyclone, SPELL_CYCLONE_CYCLONE, true); - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (pTarget) - { - Cyclone->AI()->AttackStart(pTarget); - } - } - } else Cyclone_Timer -= diff; - - //Heal_Timer - if (Heal_Timer <= diff) - { - // It can be cast on any of the mobs - Unit *pUnit = NULL; - - while (pUnit == NULL || !pUnit->isAlive()) - { - pUnit = selectAdvisorUnit(); - } - - if (pUnit && pUnit->isAlive()) - DoCast(pUnit, SPELL_HEAL); - Heal_Timer = 60000; - } else Heal_Timer -= diff; - - DoMeleeAttackIfReady(); - } - - Unit* selectAdvisorUnit() - { - Unit* pUnit = NULL; - if (pInstance) - { - switch(rand()%4) - { - case 0: - pUnit = Unit::GetUnit((*me), pInstance->GetData64(DATA_KARATHRESS)); - break; - case 1: - pUnit = Unit::GetUnit((*me), pInstance->GetData64(DATA_SHARKKIS)); - break; - case 2: - pUnit = Unit::GetUnit((*me), pInstance->GetData64(DATA_TIDALVESS)); - break; - case 3: - pUnit = me; - break; - } - } else pUnit = me; - - return pUnit; - } -}; - -CreatureAI* GetAI_boss_fathomlord_karathress(Creature* pCreature) -{ - return new boss_fathomlord_karathressAI (pCreature); -} - -CreatureAI* GetAI_boss_fathomguard_sharkkis(Creature* pCreature) -{ - return new boss_fathomguard_sharkkisAI (pCreature); -} - -CreatureAI* GetAI_boss_fathomguard_tidalvess(Creature* pCreature) -{ - return new boss_fathomguard_tidalvessAI (pCreature); -} - -CreatureAI* GetAI_boss_fathomguard_caribdis(Creature* pCreature) -{ - return new boss_fathomguard_caribdisAI (pCreature); -} - -void AddSC_boss_fathomlord_karathress() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_fathomlord_karathress"; - newscript->GetAI = &GetAI_boss_fathomlord_karathress; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_fathomguard_sharkkis"; - newscript->GetAI = &GetAI_boss_fathomguard_sharkkis; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_fathomguard_tidalvess"; - newscript->GetAI = &GetAI_boss_fathomguard_tidalvess; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_fathomguard_caribdis"; - newscript->GetAI = &GetAI_boss_fathomguard_caribdis; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Outland/coilfang_resevoir/serpent_shrine/boss_hydross_the_unstable.cpp b/src/server/scripts/Outland/coilfang_resevoir/serpent_shrine/boss_hydross_the_unstable.cpp deleted file mode 100644 index 923fdf55f80..00000000000 --- a/src/server/scripts/Outland/coilfang_resevoir/serpent_shrine/boss_hydross_the_unstable.cpp +++ /dev/null @@ -1,379 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Hydross_The_Unstable -SD%Complete: 90 -SDComment: Some details and adjustments left to do, probably nothing major. Spawns may be spawned in different way/location. -SDCategory: Coilfang Resevoir, Serpent Shrine Cavern -EndScriptData */ - -#include "ScriptedPch.h" -#include "serpent_shrine.h" - -#define SAY_AGGRO -1548000 -#define SAY_SWITCH_TO_CLEAN -1548001 -#define SAY_CLEAN_SLAY1 -1548002 -#define SAY_CLEAN_SLAY2 -1548003 -#define SAY_CLEAN_DEATH -1548004 -#define SAY_SWITCH_TO_CORRUPT -1548005 -#define SAY_CORRUPT_SLAY1 -1548006 -#define SAY_CORRUPT_SLAY2 -1548007 -#define SAY_CORRUPT_DEATH -1548008 - -#define SWITCH_RADIUS 18 - -#define MODEL_CORRUPT 20609 -#define MODEL_CLEAN 20162 - -#define SPELL_WATER_TOMB 38235 -#define SPELL_MARK_OF_HYDROSS1 38215 -#define SPELL_MARK_OF_HYDROSS2 38216 -#define SPELL_MARK_OF_HYDROSS3 38217 -#define SPELL_MARK_OF_HYDROSS4 38218 -#define SPELL_MARK_OF_HYDROSS5 38231 -#define SPELL_MARK_OF_HYDROSS6 40584 -#define SPELL_MARK_OF_CORRUPTION1 38219 -#define SPELL_MARK_OF_CORRUPTION2 38220 -#define SPELL_MARK_OF_CORRUPTION3 38221 -#define SPELL_MARK_OF_CORRUPTION4 38222 -#define SPELL_MARK_OF_CORRUPTION5 38230 -#define SPELL_MARK_OF_CORRUPTION6 40583 -#define SPELL_VILE_SLUDGE 38246 -#define SPELL_ENRAGE 27680 //this spell need verification -#define SPELL_SUMMON_WATER_ELEMENT 36459 //not in use yet(in use ever?) -#define SPELL_ELEMENTAL_SPAWNIN 25035 -#define SPELL_BLUE_BEAM 40227 //channeled Hydross Beam Helper (not in use yet) - -#define ENTRY_PURE_SPAWN 22035 -#define ENTRY_TAINTED_SPAWN 22036 -#define ENTRY_BEAM_DUMMY 21934 - -#define HYDROSS_X -239.439 -#define HYDROSS_Y -363.481 - -#define SPAWN_X_DIFF1 6.934003 -#define SPAWN_Y_DIFF1 -11.255012 -#define SPAWN_X_DIFF2 -6.934003 -#define SPAWN_Y_DIFF2 11.255012 -#define SPAWN_X_DIFF3 -12.577011 -#define SPAWN_Y_DIFF3 -4.72702 -#define SPAWN_X_DIFF4 12.577011 -#define SPAWN_Y_DIFF4 4.72702 - -struct boss_hydross_the_unstableAI : public ScriptedAI -{ - boss_hydross_the_unstableAI(Creature *c) : ScriptedAI(c), Summons(me) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint64 beams[2]; - uint32 PosCheck_Timer; - uint32 MarkOfHydross_Timer; - uint32 MarkOfCorruption_Timer; - uint32 WaterTomb_Timer; - uint32 VileSludge_Timer; - uint32 MarkOfHydross_Count; - uint32 MarkOfCorruption_Count; - uint32 EnrageTimer; - bool CorruptedForm; - bool beam; - SummonList Summons; - - void Reset() - { - DeSummonBeams(); - beams[0] = 0; - beams[1] = 0; - PosCheck_Timer = 2500; - MarkOfHydross_Timer = 15000; - MarkOfCorruption_Timer = 15000; - WaterTomb_Timer = 7000; - VileSludge_Timer = 7000; - MarkOfHydross_Count = 0; - MarkOfCorruption_Count = 0; - EnrageTimer = 600000; - - CorruptedForm = false; - me->SetMeleeDamageSchool(SPELL_SCHOOL_FROST); - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true); - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false); - - me->SetDisplayId(MODEL_CLEAN); - - if (pInstance) - pInstance->SetData(DATA_HYDROSSTHEUNSTABLEEVENT, NOT_STARTED); - beam = false; - Summons.DespawnAll(); - } - - void SummonBeams() - { - Creature* beamer = me->SummonCreature(ENTRY_BEAM_DUMMY,-258.333,-356.34,22.0499,5.90835,TEMPSUMMON_CORPSE_DESPAWN,0); - if (beamer) - { - beamer->CastSpell(me,SPELL_BLUE_BEAM,true); - beamer->SetDisplayId(11686); //invisible - beamer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - beams[0]=beamer->GetGUID(); - } - beamer = beamer = me->SummonCreature(ENTRY_BEAM_DUMMY,-219.918,-371.308,22.0042,2.73072,TEMPSUMMON_CORPSE_DESPAWN,0); - if (beamer) - { - beamer->CastSpell(me,SPELL_BLUE_BEAM,true); - beamer->SetDisplayId(11686); //invisible - beamer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - beams[1]=beamer->GetGUID(); - } - } - void DeSummonBeams() - { - for (uint8 i=0; i<2; ++i) - { - Creature* mob = Unit::GetCreature(*me,beams[i]); - if (mob) - { - mob->setDeathState(DEAD); - mob->RemoveCorpse(); - } - } - } - void EnterCombat(Unit * /*who*/) - { - DoScriptText(SAY_AGGRO, me); - - if (pInstance) - pInstance->SetData(DATA_HYDROSSTHEUNSTABLEEVENT, IN_PROGRESS); - } - - void KilledUnit(Unit * /*victim*/) - { - if (CorruptedForm) - { - DoScriptText(RAND(SAY_CORRUPT_SLAY1,SAY_CORRUPT_SLAY2), me); - } - else - { - DoScriptText(RAND(SAY_CLEAN_SLAY1,SAY_CLEAN_SLAY2), me); - } - } - - void JustSummoned(Creature* summoned) - { - if (summoned->GetEntry() == ENTRY_PURE_SPAWN) - { - summoned->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true); - summoned->CastSpell(summoned,SPELL_ELEMENTAL_SPAWNIN,true); - Summons.Summon(summoned); - } - if (summoned->GetEntry() == ENTRY_TAINTED_SPAWN) - { - summoned->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, true); - summoned->CastSpell(summoned,SPELL_ELEMENTAL_SPAWNIN,true); - Summons.Summon(summoned); - } - } - - void SummonedCreatureDespawn(Creature *summon) - { - Summons.Despawn(summon); - } - - void JustDied(Unit * /*victim*/) - { - if (CorruptedForm) - DoScriptText(SAY_CORRUPT_DEATH, me); - else - DoScriptText(SAY_CLEAN_DEATH, me); - - if (pInstance) - pInstance->SetData(DATA_HYDROSSTHEUNSTABLEEVENT, DONE); - Summons.DespawnAll(); - } - - void UpdateAI(const uint32 diff) - { - if (!beam) - { - SummonBeams(); - beam=true; - } - //Return since we have no target - if (!UpdateVictim()) - return; - - // corrupted form - if (CorruptedForm) - { - //MarkOfCorruption_Timer - if (MarkOfCorruption_Timer <= diff) - { - if (MarkOfCorruption_Count <= 5) - { - uint32 mark_spell = 0; - - switch (MarkOfCorruption_Count) - { - case 0: mark_spell = SPELL_MARK_OF_CORRUPTION1; break; - case 1: mark_spell = SPELL_MARK_OF_CORRUPTION2; break; - case 2: mark_spell = SPELL_MARK_OF_CORRUPTION3; break; - case 3: mark_spell = SPELL_MARK_OF_CORRUPTION4; break; - case 4: mark_spell = SPELL_MARK_OF_CORRUPTION5; break; - case 5: mark_spell = SPELL_MARK_OF_CORRUPTION6; break; - } - - DoCast(me->getVictim(), mark_spell); - - if (MarkOfCorruption_Count < 5) - ++MarkOfCorruption_Count; - } - - MarkOfCorruption_Timer = 15000; - } else MarkOfCorruption_Timer -= diff; - - //VileSludge_Timer - if (VileSludge_Timer <= diff) - { - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (pTarget) - DoCast(pTarget, SPELL_VILE_SLUDGE); - - VileSludge_Timer = 15000; - } else VileSludge_Timer -= diff; - - //PosCheck_Timer - if (PosCheck_Timer <= diff) - { - if (me->IsWithinDist2d(HYDROSS_X, HYDROSS_Y, SWITCH_RADIUS)) - { - // switch to clean form - me->SetDisplayId(MODEL_CLEAN); - CorruptedForm = false; - MarkOfHydross_Count = 0; - - DoScriptText(SAY_SWITCH_TO_CLEAN, me); - DoResetThreat(); - SummonBeams(); - - // spawn 4 adds - DoSpawnCreature(ENTRY_PURE_SPAWN, SPAWN_X_DIFF1, SPAWN_Y_DIFF1, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); - DoSpawnCreature(ENTRY_PURE_SPAWN, SPAWN_X_DIFF2, SPAWN_Y_DIFF2, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); - DoSpawnCreature(ENTRY_PURE_SPAWN, SPAWN_X_DIFF3, SPAWN_Y_DIFF3, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); - DoSpawnCreature(ENTRY_PURE_SPAWN, SPAWN_X_DIFF4, SPAWN_Y_DIFF4, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); - - me->SetMeleeDamageSchool(SPELL_SCHOOL_FROST); - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true); - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false); - } - - PosCheck_Timer = 2500; - } else PosCheck_Timer -=diff; - } - // clean form - else - { - //MarkOfHydross_Timer - if (MarkOfHydross_Timer <= diff) - { - if (MarkOfHydross_Count <= 5) - { - uint32 mark_spell = NULL; - - switch(MarkOfHydross_Count) - { - case 0: mark_spell = SPELL_MARK_OF_HYDROSS1; break; - case 1: mark_spell = SPELL_MARK_OF_HYDROSS2; break; - case 2: mark_spell = SPELL_MARK_OF_HYDROSS3; break; - case 3: mark_spell = SPELL_MARK_OF_HYDROSS4; break; - case 4: mark_spell = SPELL_MARK_OF_HYDROSS5; break; - case 5: mark_spell = SPELL_MARK_OF_HYDROSS6; break; - } - - DoCast(me->getVictim(), mark_spell); - - if (MarkOfHydross_Count < 5) - ++MarkOfHydross_Count; - } - - MarkOfHydross_Timer = 15000; - } else MarkOfHydross_Timer -= diff; - - //WaterTomb_Timer - if (WaterTomb_Timer <= diff) - { - Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); - if (pTarget) - DoCast(pTarget, SPELL_WATER_TOMB); - - WaterTomb_Timer = 7000; - } else WaterTomb_Timer -= diff; - - //PosCheck_Timer - if (PosCheck_Timer <= diff) - { - if (!me->IsWithinDist2d(HYDROSS_X, HYDROSS_Y, SWITCH_RADIUS)) - { - // switch to corrupted form - me->SetDisplayId(MODEL_CORRUPT); - MarkOfCorruption_Count = 0; - CorruptedForm = true; - - DoScriptText(SAY_SWITCH_TO_CORRUPT, me); - DoResetThreat(); - DeSummonBeams(); - - // spawn 4 adds - DoSpawnCreature(ENTRY_TAINTED_SPAWN, SPAWN_X_DIFF1, SPAWN_Y_DIFF1, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); - DoSpawnCreature(ENTRY_TAINTED_SPAWN, SPAWN_X_DIFF2, SPAWN_Y_DIFF2, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); - DoSpawnCreature(ENTRY_TAINTED_SPAWN, SPAWN_X_DIFF3, SPAWN_Y_DIFF3, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); - DoSpawnCreature(ENTRY_TAINTED_SPAWN, SPAWN_X_DIFF4, SPAWN_Y_DIFF4, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); - - me->SetMeleeDamageSchool(SPELL_SCHOOL_NATURE); - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, true); - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false); - } - - PosCheck_Timer = 2500; - } else PosCheck_Timer -=diff; - } - - //EnrageTimer - if (EnrageTimer <= diff) - { - DoCast(me, SPELL_ENRAGE); - EnrageTimer = 60000; - } else EnrageTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_hydross_the_unstable(Creature* pCreature) -{ - return new boss_hydross_the_unstableAI (pCreature); -} - -void AddSC_boss_hydross_the_unstable() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_hydross_the_unstable"; - newscript->GetAI = &GetAI_boss_hydross_the_unstable; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Outland/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp b/src/server/scripts/Outland/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp deleted file mode 100644 index 2f0485d0e6c..00000000000 --- a/src/server/scripts/Outland/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp +++ /dev/null @@ -1,1039 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA02111-1307USA - */ - -/* ScriptData -SDName: Boss_Lady_Vashj -SD%Complete: 99 -SDComment: Missing blizzlike Shield Generators coords -SDCategory: Coilfang Resevoir, Serpent Shrine Cavern -EndScriptData */ - -#include "ScriptedPch.h" -#include "serpent_shrine.h" -#include "ScriptedSimpleAI.h" -#include "Spell.h" - -#define SAY_INTRO -1548042 -#define SAY_AGGRO1 -1548043 -#define SAY_AGGRO2 -1548044 -#define SAY_AGGRO3 -1548045 -#define SAY_AGGRO4 -1548046 -#define SAY_PHASE1 -1548047 -#define SAY_PHASE2 -1548048 -#define SAY_PHASE3 -1548049 -#define SAY_BOWSHOT1 -1548050 -#define SAY_BOWSHOT2 -1548051 -#define SAY_SLAY1 -1548052 -#define SAY_SLAY2 -1548053 -#define SAY_SLAY3 -1548054 -#define SAY_DEATH -1548055 - -#define SPELL_SURGE 38044 -#define SPELL_MULTI_SHOT 38310 -#define SPELL_SHOCK_BLAST 38509 -#define SPELL_ENTANGLE 38316 -#define SPELL_STATIC_CHARGE_TRIGGER 38280 -#define SPELL_FORKED_LIGHTNING 40088 -#define SPELL_SHOOT 40873 -#define SPELL_POISON_BOLT 40095 -#define SPELL_TOXIC_SPORES 38575 -#define SPELL_MAGIC_BARRIER 38112 - -#define MIDDLE_X 30.134 -#define MIDDLE_Y -923.65 -#define MIDDLE_Z 42.9 - -#define SPOREBAT_X 30.977156 -#define SPOREBAT_Y -925.297761 -#define SPOREBAT_Z 77.176567 -#define SPOREBAT_O 5.223932 - -#define SHIED_GENERATOR_CHANNEL 19870 -#define ENCHANTED_ELEMENTAL 21958 -#define TAINTED_ELEMENTAL 22009 -#define COILFANG_STRIDER 22056 -#define COILFANG_ELITE 22055 -#define TOXIC_SPOREBAT 22140 -#define TOXIC_SPORES_TRIGGER 22207 - -#define TEXT_NOT_INITIALIZED "Instance script not initialized" -#define TEXT_ALREADY_DEACTIVATED "Already deactivated" - -float ElementPos[8][4] = -{ - {8.3, -835.3, 21.9, 5}, - {53.4, -835.3, 21.9, 4.5}, - {96, -861.9, 21.8, 4}, - {96, -986.4, 21.4, 2.5}, - {54.4, -1010.6, 22, 1.8}, - {9.8, -1012, 21.7, 1.4}, - {-35, -987.6, 21.5, 0.8}, - {-58.9, -901.6, 21.5, 6} -}; - -float ElementWPPos[8][3] = -{ - {71.700752, -883.905884, 41.097168}, - {45.039848, -868.022827, 41.097015}, - {14.585141, -867.894470, 41.097061}, - {-25.415508, -906.737732, 41.097061}, - {-11.801594, -963.405884, 41.097067}, - {14.556657, -979.051514, 41.097137}, - {43.466549, -979.406677, 41.097027}, - {69.945908, -964.663940, 41.097054} -}; - -float SporebatWPPos[8][3] = -{ - {31.6,-896.3,59.1}, - {9.1, -913.9, 56}, - {5.2, -934.4, 52.4}, - {20.7, -946.9, 49.7}, - {41, -941.9, 51}, - {47.7, -927.3, 55}, - {42.2, -912.4, 51.7}, - {27, -905.9, 50} -}; - -float CoilfangElitePos[3][4] = -{ - {28.84, -923.28, 42.9, 6}, - {31.183281, -953.502625, 41.523602, 1.640957}, - {58.895180, -923.124268, 41.545307, 3.152848} -}; - -float CoilfangStriderPos[3][4] = -{ - {66.427010, -948.778503, 41.262245, 2.584220}, - {7.513962, -959.538208, 41.300422, 1.034629}, - {-12.843201, -907.798401, 41.239620, 6.087094} -}; - -float ShieldGeneratorChannelPos[4][4] = -{ - {49.6262, -902.181, 43.0975, 3.95683}, - {10.988, -901.616, 42.5371, 5.4373}, - {10.3859, -944.036, 42.5446, 0.779888}, - {49.3126, -943.398, 42.5501, 2.40174} -}; - -//Lady Vashj AI -struct boss_lady_vashjAI : public ScriptedAI -{ - boss_lady_vashjAI (Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - Intro = false; - JustCreated = true; - c->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); //set it only once on Creature create (no need do intro if wiped) - } - - ScriptedInstance *pInstance; - - uint64 ShieldGeneratorChannel[4]; - - uint32 AggroTimer; - uint32 ShockBlast_Timer; - uint32 Entangle_Timer; - uint32 StaticCharge_Timer; - uint32 ForkedLightning_Timer; - uint32 Check_Timer; - uint32 EnchantedElemental_Timer; - uint32 TaintedElemental_Timer; - uint32 CoilfangElite_Timer; - uint32 CoilfangStrider_Timer; - uint32 SummonSporebat_Timer; - uint32 SummonSporebat_StaticTimer; - uint8 EnchantedElemental_Pos; - uint8 Phase; - - bool Entangle; - bool Intro; - bool CanAttack; - bool JustCreated; - - void Reset() - { - AggroTimer = 19000; - ShockBlast_Timer = 1+rand()%60000; - Entangle_Timer = 30000; - StaticCharge_Timer = 10000+rand()%15000; - ForkedLightning_Timer = 2000; - Check_Timer = 15000; - EnchantedElemental_Timer = 5000; - TaintedElemental_Timer = 50000; - CoilfangElite_Timer = 45000+rand()%5000; - CoilfangStrider_Timer = 60000+rand()%10000; - SummonSporebat_Timer = 10000; - SummonSporebat_StaticTimer = 30000; - EnchantedElemental_Pos = 0; - Phase = 0; - - Entangle = false; - if (JustCreated) - { - CanAttack = false; - JustCreated = false; - } else CanAttack = true; - - Unit *remo; - for (uint8 i = 0; i < 4; ++i) - { - remo = Unit::GetUnit(*me, ShieldGeneratorChannel[i]); - if (remo) - remo->setDeathState(JUST_DIED); - } - - if (pInstance) - pInstance->SetData(DATA_LADYVASHJEVENT, NOT_STARTED); - ShieldGeneratorChannel[0] = 0; - ShieldGeneratorChannel[1] = 0; - ShieldGeneratorChannel[2] = 0; - ShieldGeneratorChannel[3] = 0; - - me->SetCorpseDelay(1000*60*60); - } - - //Called when a tainted elemental dies - void EventTaintedElementalDeath() - { - //the next will spawn 50 seconds after the previous one's death - if (TaintedElemental_Timer > 50000) - TaintedElemental_Timer = 50000; - } - void KilledUnit(Unit * /*victim*/) - { - DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), me); - } - - void JustDied(Unit * /*victim*/) - { - DoScriptText(SAY_DEATH, me); - - if (pInstance) - pInstance->SetData(DATA_LADYVASHJEVENT, DONE); - } - - void StartEvent() - { - DoScriptText(RAND(SAY_AGGRO1,SAY_AGGRO2,SAY_AGGRO3,SAY_AGGRO4), me); - - Phase = 1; - - if (pInstance) - pInstance->SetData(DATA_LADYVASHJEVENT, IN_PROGRESS); - } - - void EnterCombat(Unit * who) - { - if (pInstance) - { - //remove old tainted cores to prevent cheating in phase 2 - Map* pMap = me->GetMap(); - Map::PlayerList const &PlayerList = pMap->GetPlayers(); - for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) - { - if (Player* i_pl = i->getSource()) - { - i_pl->DestroyItemCount(31088, 1, true); - } - } - } - StartEvent();//this is EnterCombat(), so were are 100% in combat, start the event - - if (Phase != 2) - AttackStart(who); - } - - void MoveInLineOfSight(Unit *who) - { - if (!Intro) - { - Intro = true; - DoScriptText(SAY_INTRO, me); - } - if (!CanAttack) - return; - if (!who || me->getVictim()) - return; - - if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(me) && me->IsHostileTo(who)) - { - float attackRadius = me->GetAttackDistance(who); - if (me->IsWithinDistInMap(who, attackRadius) && me->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && me->IsWithinLOSInMap(who)) - { - //if (who->HasStealthAura()) - // who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); - - if (!me->isInCombat())//AttackStart() sets UNIT_FLAG_IN_COMBAT, so this msut be before attacking - StartEvent(); - - if (Phase != 2) - AttackStart(who); - } - } - } - - void CastShootOrMultishot() - { - switch (urand(0,1)) - { - case 0: - //Shoot - //Used in Phases 1 and 3 after Entangle or while having nobody in melee range. A shot that hits her target for 4097-5543 Physical damage. - DoCast(me->getVictim(), SPELL_SHOOT); - break; - case 1: - //Multishot - //Used in Phases 1 and 3 after Entangle or while having nobody in melee range. A shot that hits 1 person and 4 people around him for 6475-7525 physical damage. - DoCast(me->getVictim(), SPELL_MULTI_SHOT); - break; - } - if (rand()%3) - { - DoScriptText(RAND(SAY_BOWSHOT1,SAY_BOWSHOT2), me); - } - } - - void UpdateAI(const uint32 diff) - { - if (!CanAttack && Intro) - { - if (AggroTimer <= diff) - { - CanAttack = true; - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - AggroTimer=19000; - }else - { - AggroTimer-=diff; - return; - } - } - //to prevent abuses during phase 2 - if (Phase == 2 && !me->getVictim() && me->isInCombat()) - { - EnterEvadeMode(); - return; - } - //Return since we have no target - if (!UpdateVictim()) - return; - - if (Phase == 1 || Phase == 3) - { - //ShockBlast_Timer - if (ShockBlast_Timer <= diff) - { - //Shock Burst - //Randomly used in Phases 1 and 3 on Vashj's target, it's a Shock spell doing 8325-9675 nature damage and stunning the target for 5 seconds, during which she will not attack her target but switch to the next person on the aggro list. - DoCast(me->getVictim(), SPELL_SHOCK_BLAST); - me->TauntApply(me->getVictim()); - - ShockBlast_Timer = 1000+rand()%14000; //random cooldown - } else ShockBlast_Timer -= diff; - - //StaticCharge_Timer - if (StaticCharge_Timer <= diff) - { - //Static Charge - //Used on random people (only 1 person at any given time) in Phases 1 and 3, it's a debuff doing 2775 to 3225 Nature damage to the target and everybody in about 5 yards around it, every 1 seconds for 30 seconds. It can be removed by Cloak of Shadows, Iceblock, Divine Shield, etc, but not by Cleanse or Dispel Magic. - Unit *pTarget = NULL; - pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 200, true); - - if (pTarget && !pTarget->HasAura(SPELL_STATIC_CHARGE_TRIGGER)) - //cast Static Charge every 2 seconds for 20 seconds - DoCast(pTarget, SPELL_STATIC_CHARGE_TRIGGER); - - StaticCharge_Timer = 10000+rand()%20000; //blizzlike - } else StaticCharge_Timer -= diff; - - //Entangle_Timer - if (Entangle_Timer <= diff) - { - if (!Entangle) - { - //Entangle - //Used in Phases 1 and 3, it casts Entangling Roots on everybody in a 15 yard radius of Vashj, immobilzing them for 10 seconds and dealing 500 damage every 2 seconds. It's not a magic effect so it cannot be dispelled, but is removed by various buffs such as Cloak of Shadows or Blessing of Freedom. - DoCast(me->getVictim(), SPELL_ENTANGLE); - Entangle = true; - Entangle_Timer = 10000; - } - else - { - CastShootOrMultishot(); - Entangle = false; - Entangle_Timer = 20000+rand()%5000; - } - } else Entangle_Timer -= diff; - - //Phase 1 - if (Phase == 1) - { - //Start phase 2 - if ((me->GetHealth()*100 / me->GetMaxHealth()) < 70) - { - //Phase 2 begins when Vashj hits 70%. She will run to the middle of her platform and surround herself in a shield making her invulerable. - Phase = 2; - - me->GetMotionMaster()->Clear(); - DoTeleportTo(MIDDLE_X, MIDDLE_Y, MIDDLE_Z); - - Creature *pCreature; - for (uint8 i = 0; i < 4; ++i) - { - pCreature = me->SummonCreature(SHIED_GENERATOR_CHANNEL, ShieldGeneratorChannelPos[i][0], ShieldGeneratorChannelPos[i][1], ShieldGeneratorChannelPos[i][2], ShieldGeneratorChannelPos[i][3], TEMPSUMMON_CORPSE_DESPAWN, 0); - if (pCreature) - ShieldGeneratorChannel[i] = pCreature->GetGUID(); - } - DoScriptText(SAY_PHASE2, me); - } - } - //Phase 3 - else - { - //SummonSporebat_Timer - if (SummonSporebat_Timer <= diff) - { - Creature *Sporebat = NULL; - Sporebat = me->SummonCreature(TOXIC_SPOREBAT, SPOREBAT_X, SPOREBAT_Y, SPOREBAT_Z, SPOREBAT_O, TEMPSUMMON_CORPSE_DESPAWN, 0); - - if (Sporebat) - { - Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (pTarget) - Sporebat->AI()->AttackStart(pTarget); - } - - //summon sporebats faster and faster - if (SummonSporebat_StaticTimer > 1000) - SummonSporebat_StaticTimer -= 1000; - - SummonSporebat_Timer = SummonSporebat_StaticTimer; - - if (SummonSporebat_Timer < 5000) - SummonSporebat_Timer = 5000; - - } else SummonSporebat_Timer -= diff; - } - - //Melee attack - DoMeleeAttackIfReady(); - - //Check_Timer - used to check if somebody is in melee range - if (Check_Timer <= diff) - { - bool InMeleeRange = false; - Unit *pTarget; - std::list t_list = me->getThreatManager().getThreatList(); - for (std::list::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) - { - pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid()); - //if in melee range - if (pTarget && pTarget->IsWithinDistInMap(me, 5)) - { - InMeleeRange = true; - break; - } - } - - //if nobody is in melee range - if (!InMeleeRange) - CastShootOrMultishot(); - - Check_Timer = 5000; - } else Check_Timer -= diff; - } - //Phase 2 - else - { - //ForkedLightning_Timer - if (ForkedLightning_Timer <= diff) - { - //Forked Lightning - //Used constantly in Phase 2, it shoots out completely randomly targeted bolts of lightning which hit everybody in a roughtly 60 degree cone in front of Vashj for 2313-2687 nature damage. - Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); - - if (!pTarget) - pTarget = me->getVictim(); - - DoCast(pTarget, SPELL_FORKED_LIGHTNING); - - ForkedLightning_Timer = 2000+rand()%6000; //blizzlike - } else ForkedLightning_Timer -= diff; - - //EnchantedElemental_Timer - if (EnchantedElemental_Timer <= diff) - { - Creature *Elemental; - Elemental = me->SummonCreature(ENCHANTED_ELEMENTAL, ElementPos[EnchantedElemental_Pos][0], ElementPos[EnchantedElemental_Pos][1], ElementPos[EnchantedElemental_Pos][2], ElementPos[EnchantedElemental_Pos][3], TEMPSUMMON_CORPSE_DESPAWN, 0); - - if (EnchantedElemental_Pos == 7) - EnchantedElemental_Pos = 0; - else - ++EnchantedElemental_Pos; - - EnchantedElemental_Timer = 10000+rand()%5000; - } else EnchantedElemental_Timer -= diff; - - //TaintedElemental_Timer - if (TaintedElemental_Timer <= diff) - { - Creature *Tain_Elemental; - uint32 pos = rand()%8; - Tain_Elemental = me->SummonCreature(TAINTED_ELEMENTAL, ElementPos[pos][0], ElementPos[pos][1], ElementPos[pos][2], ElementPos[pos][3], TEMPSUMMON_DEAD_DESPAWN, 0); - - TaintedElemental_Timer = 120000; - } else TaintedElemental_Timer -= diff; - - //CoilfangElite_Timer - if (CoilfangElite_Timer <= diff) - { - uint32 pos = rand()%3; - Creature* CoilfangElite = NULL; - CoilfangElite = me->SummonCreature(COILFANG_ELITE, CoilfangElitePos[pos][0], CoilfangElitePos[pos][1], CoilfangElitePos[pos][2], CoilfangElitePos[pos][3], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); - if (CoilfangElite) - { - Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (pTarget) - CoilfangElite->AI()->AttackStart(pTarget); - else if (me->getVictim()) - CoilfangElite->AI()->AttackStart(me->getVictim()); - } - CoilfangElite_Timer = 45000+rand()%5000; - } else CoilfangElite_Timer -= diff; - - //CoilfangStrider_Timer - if (CoilfangStrider_Timer <= diff) - { - uint32 pos = rand()%3; - Creature* CoilfangStrider = NULL; - CoilfangStrider = me->SummonCreature(COILFANG_STRIDER, CoilfangStriderPos[pos][0], CoilfangStriderPos[pos][1], CoilfangStriderPos[pos][2], CoilfangStriderPos[pos][3], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); - if (CoilfangStrider) - { - Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (pTarget) - CoilfangStrider->AI()->AttackStart(pTarget); - else if (me->getVictim()) - CoilfangStrider->AI()->AttackStart(me->getVictim()); - } - CoilfangStrider_Timer = 60000+rand()%10000; - } else CoilfangStrider_Timer -= diff; - - //Check_Timer - if (Check_Timer <= diff) - { - //Start Phase 3 - if (pInstance && pInstance->GetData(DATA_CANSTARTPHASE3)) - { - //set life 50% - me->SetHealth(me->GetMaxHealth()/2); - - me->RemoveAurasDueToSpell(SPELL_MAGIC_BARRIER); - - DoScriptText(SAY_PHASE3, me); - - Phase = 3; - - //return to the tank - me->GetMotionMaster()->MoveChase(me->getVictim()); - } - Check_Timer = 1000; - } else Check_Timer -= diff; - } - } -}; - -//Enchanted Elemental -//If one of them reaches Vashj he will increase her damage done by 5%. -struct mob_enchanted_elementalAI : public ScriptedAI -{ - mob_enchanted_elementalAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance *pInstance; - uint32 move; - uint32 phase; - float x, y, z; - - uint64 VashjGUID; - - void Reset() - { - me->SetSpeed(MOVE_WALK,0.6);//walk - me->SetSpeed(MOVE_RUN,0.6);//run - move = 0; - phase = 1; - - VashjGUID = 0; - - for (int i = 0; i<8; ++i)//search for nearest waypoint (up on stairs) - { - if (!x || !y || !z) - { - x = ElementWPPos[i][0]; - y = ElementWPPos[i][1]; - z = ElementWPPos[i][2]; - } - else - { - if (me->GetDistance(ElementWPPos[i][0],ElementWPPos[i][1],ElementWPPos[i][2]) < me->GetDistance(x,y,z)) - { - x = ElementWPPos[i][0]; - y = ElementWPPos[i][1]; - z = ElementWPPos[i][2]; - } - } - } - if (pInstance) - VashjGUID = pInstance->GetData64(DATA_LADYVASHJ); - } - - void EnterCombat(Unit * /*who*/) {} - - void MoveInLineOfSight(Unit * /*who*/) {} - - void UpdateAI(const uint32 diff) - { - if (!pInstance) - return; - - if (!VashjGUID) - return; - - if (move <= diff) - { - me->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - if (phase == 1) - me->GetMotionMaster()->MovePoint(0, x, y, z); - if (phase == 1 && me->IsWithinDist3d(x,y,z, 0.1)) - phase = 2; - if (phase == 2) - { - me->GetMotionMaster()->MovePoint(0, MIDDLE_X, MIDDLE_Y, MIDDLE_Z); - phase = 3; - } - if (phase == 3) - { - me->GetMotionMaster()->MovePoint(0, MIDDLE_X, MIDDLE_Y, MIDDLE_Z); - if (me->IsWithinDist3d(MIDDLE_X, MIDDLE_Y, MIDDLE_Z, 3)) - DoCast(me, SPELL_SURGE); - } - if (Creature *Vashj = Unit::GetCreature(*me, VashjGUID)) - { - if (!Vashj->isInCombat() || CAST_AI(boss_lady_vashjAI, Vashj->AI())->Phase != 2 || Vashj->isDead()) - { - //call Unsummon() - me->Kill(me); - } - } - move = 1000; - } else move -= diff; - } -}; - -//Tainted Elemental -//This mob has 7,900 life, doesn't move, and shoots Poison Bolts at one person anywhere in the area, doing 3,000 nature damage and placing a posion doing 2,000 damage every 2 seconds. He will switch targets often, or sometimes just hang on a single player, but there is nothing you can do about it except heal the damage and kill the Tainted Elemental -struct mob_tainted_elementalAI : public ScriptedAI -{ - mob_tainted_elementalAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance *pInstance; - - uint32 PoisonBolt_Timer; - uint32 Despawn_Timer; - - void Reset() - { - PoisonBolt_Timer = 5000+rand()%5000; - Despawn_Timer = 30000; - } - - void JustDied(Unit * /*killer*/) - { - if (pInstance) - { - Creature *Vashj = NULL; - Vashj = (Unit::GetCreature((*me), pInstance->GetData64(DATA_LADYVASHJ))); - - if (Vashj) - CAST_AI(boss_lady_vashjAI, Vashj->AI())->EventTaintedElementalDeath(); - } - } - - void EnterCombat(Unit * who) - { - me->AddThreat(who, 0.1f); - } - - void UpdateAI(const uint32 diff) - { - //PoisonBolt_Timer - if (PoisonBolt_Timer <= diff) - { - Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); - - if (pTarget && pTarget->IsWithinDistInMap(me, 30)) - DoCast(pTarget, SPELL_POISON_BOLT); - - PoisonBolt_Timer = 5000+rand()%5000; - } else PoisonBolt_Timer -= diff; - - //Despawn_Timer - if (Despawn_Timer <= diff) - { - //call Unsummon() - me->setDeathState(DEAD); - - //to prevent crashes - Despawn_Timer = 1000; - } else Despawn_Timer -= diff; - } -}; - -//Toxic Sporebat -//Toxic Spores: Used in Phase 3 by the Spore Bats, it creates a contaminated green patch of ground, dealing about 2775-3225 nature damage every second to anyone who stands in it. -struct mob_toxic_sporebatAI : public ScriptedAI -{ - mob_toxic_sporebatAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - EnterEvadeMode(); - } - - ScriptedInstance *pInstance; - - uint32 movement_timer; - uint32 ToxicSpore_Timer; - uint32 bolt_timer; - uint32 Check_Timer; - - void Reset() - { - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - me->setFaction(14); - movement_timer = 0; - ToxicSpore_Timer = 5000; - bolt_timer = 5500; - Check_Timer = 1000; - } - - void EnterCombat(Unit * /*who*/) - { - - } - - void MoveInLineOfSight(Unit * /*who*/) - { - - } - - void MovementInform(uint32 type, uint32 id) - { - if (type != POINT_MOTION_TYPE) - return; - - if (id == 1) - movement_timer = 0; - } - - void UpdateAI (const uint32 diff) - { - //Random movement - if (movement_timer <= diff) - { - uint32 rndpos = rand()%8; - me->GetMotionMaster()->MovePoint(1,SporebatWPPos[rndpos][0], SporebatWPPos[rndpos][1], SporebatWPPos[rndpos][2]); - movement_timer = 6000; - } else movement_timer -= diff; - - //toxic spores - if (bolt_timer <= diff) - { - Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (pTarget) - { - Creature* trig = me->SummonCreature(TOXIC_SPORES_TRIGGER,pTarget->GetPositionX(),pTarget->GetPositionY(),pTarget->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,30000); - if (trig) - { - trig->setFaction(14); - trig->CastSpell(trig, SPELL_TOXIC_SPORES,true); - } - } - bolt_timer = 10000+rand()%5000; - } - else bolt_timer -= diff; - - //Check_Timer - if (Check_Timer <= diff) - { - if (pInstance) - { - //check if vashj is death - Unit *Vashj = NULL; - Vashj = Unit::GetUnit((*me), pInstance->GetData64(DATA_LADYVASHJ)); - if (!Vashj || (Vashj && !Vashj->isAlive()) || (Vashj && CAST_AI(boss_lady_vashjAI, CAST_CRE(Vashj)->AI())->Phase != 3)) - { - //remove - me->setDeathState(DEAD); - me->RemoveCorpse(); - me->setFaction(35); - } - } - - Check_Timer = 1000; - } else Check_Timer -= diff; - } -}; - -//Coilfang Elite -//It's an elite Naga mob with 170,000 HP. It does about 5000 damage on plate, and has a nasty cleave hitting for about 7500 damage -CreatureAI* GetAI_mob_coilfang_elite(Creature* pCreature) -{ - SimpleAI* ai = new SimpleAI (pCreature); - - ai->Spell[0].Enabled = true; - ai->Spell[0].Spell_Id = 31345; //Cleave - ai->Spell[0].Cooldown = 15000; - ai->Spell[0].CooldownRandomAddition = 5000; - ai->Spell[0].First_Cast = 5000; - ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_RANDOM; - - ai->EnterEvadeMode(); - - return ai; -} - -//Coilfang Strider -//It hits plate for about 8000 damage, has a Mind Blast spell doing about 3000 shadow damage, and a Psychic Scream Aura, which fears everybody in a 8 yard range of it every 2-3 seconds , for 5 seconds and increasing their movement speed by 150% during the fear. -CreatureAI* GetAI_mob_coilfang_strider(Creature* pCreature) -{ - SimpleAI* ai = new SimpleAI (pCreature); - - ai->Spell[0].Enabled = true; - ai->Spell[0].Spell_Id = 41374; //Mind Blast - ai->Spell[0].Cooldown = 30000; - ai->Spell[0].CooldownRandomAddition = 10000; - ai->Spell[0].First_Cast = 8000; - ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_TARGET; - - //Scream aura not implemented - - ai->EnterEvadeMode(); - - return ai; -} - -struct mob_shield_generator_channelAI : public ScriptedAI -{ - mob_shield_generator_channelAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance *pInstance; - uint32 Check_Timer; - bool Casted; - void Reset() - { - Check_Timer = 0; - Casted = false; - me->SetDisplayId(11686); //invisible - - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - } - - void EnterCombat(Unit * /*who*/) {} - - void MoveInLineOfSight(Unit * /*who*/) {} - - void UpdateAI (const uint32 diff) - { - if (!pInstance) - return; - - if (Check_Timer <= diff) - { - Unit *Vashj = NULL; - Vashj = Unit::GetUnit((*me), pInstance->GetData64(DATA_LADYVASHJ)); - - if (Vashj && Vashj->isAlive()) - { - //start visual channel - if (!Casted || !Vashj->HasAura(SPELL_MAGIC_BARRIER)) - { - DoCast(Vashj, SPELL_MAGIC_BARRIER, true); - Casted = true; - } - } - Check_Timer = 1000; - } else Check_Timer -= diff; - } -}; - -bool ItemUse_item_tainted_core(Player* pPlayer, Item* /*_Item*/, SpellCastTargets const& targets) -{ - ScriptedInstance *pInstance = pPlayer->GetInstanceData(); - - if (!pInstance) - { - pPlayer->GetSession()->SendNotification(TEXT_NOT_INITIALIZED); - return true; - } - - Creature *Vashj = NULL; - Vashj = (Unit::GetCreature((*pPlayer), pInstance->GetData64(DATA_LADYVASHJ))); - if (Vashj && CAST_AI(boss_lady_vashjAI, Vashj->AI())->Phase == 2) - { - if (targets.getGOTarget() && targets.getGOTarget()->GetTypeId() == TYPEID_GAMEOBJECT) - { - uint32 identifier; - uint8 channel_identifier; - switch(targets.getGOTarget()->GetEntry()) - { - case 185052: - identifier = DATA_SHIELDGENERATOR1; - channel_identifier = 0; - break; - case 185053: - identifier = DATA_SHIELDGENERATOR2; - channel_identifier = 1; - break; - case 185051: - identifier = DATA_SHIELDGENERATOR3; - channel_identifier = 2; - break; - case 185054: - identifier = DATA_SHIELDGENERATOR4; - channel_identifier = 3; - break; - default: - return true; - } - - if (pInstance->GetData(identifier)) - { - pPlayer->GetSession()->SendNotification(TEXT_ALREADY_DEACTIVATED); - return true; - } - - //get and remove channel - Unit *Channel = NULL; - Channel = Unit::GetCreature(*Vashj, CAST_AI(boss_lady_vashjAI, Vashj->AI())->ShieldGeneratorChannel[channel_identifier]); - if (Channel) - { - //call Unsummon() - Channel->setDeathState(JUST_DIED); - } - - pInstance->SetData(identifier, 1); - - //remove this item - pPlayer->DestroyItemCount(31088, 1, true); - return true; - } - else if (targets.getUnitTarget()->GetTypeId() == TYPEID_UNIT) - return false; - else if (targets.getUnitTarget()->GetTypeId() == TYPEID_PLAYER) - { - pPlayer->DestroyItemCount(31088, 1, true); - pPlayer->CastSpell(targets.getUnitTarget(), 38134, true); - return true; - } - } - return true; -} - -CreatureAI* GetAI_boss_lady_vashj(Creature* pCreature) -{ - return new boss_lady_vashjAI (pCreature); -} - -CreatureAI* GetAI_mob_enchanted_elemental(Creature* pCreature) -{ - return new mob_enchanted_elementalAI (pCreature); -} - -CreatureAI* GetAI_mob_tainted_elemental(Creature* pCreature) -{ - return new mob_tainted_elementalAI (pCreature); -} - -CreatureAI* GetAI_mob_toxic_sporebat(Creature* pCreature) -{ - return new mob_toxic_sporebatAI (pCreature); -} - -CreatureAI* GetAI_mob_shield_generator_channel(Creature* pCreature) -{ - return new mob_shield_generator_channelAI (pCreature); -} - -void AddSC_boss_lady_vashj() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_lady_vashj"; - newscript->GetAI = &GetAI_boss_lady_vashj; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_enchanted_elemental"; - newscript->GetAI = &GetAI_mob_enchanted_elemental; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_tainted_elemental"; - newscript->GetAI = &GetAI_mob_tainted_elemental; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_toxic_sporebat"; - newscript->GetAI = &GetAI_mob_toxic_sporebat; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_coilfang_elite"; - newscript->GetAI = &GetAI_mob_coilfang_elite; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_coilfang_strider"; - newscript->GetAI = &GetAI_mob_coilfang_strider; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_shield_generator_channel"; - newscript->GetAI = &GetAI_mob_shield_generator_channel; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "item_tainted_core"; - newscript->pItemUse = &ItemUse_item_tainted_core; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Outland/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp b/src/server/scripts/Outland/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp deleted file mode 100644 index 61c9ed9d527..00000000000 --- a/src/server/scripts/Outland/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp +++ /dev/null @@ -1,787 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Leotheras_The_Blind -SD%Complete: 80 -SDComment: Possesion Support -SDCategory: Coilfang Resevoir, Serpent Shrine Cavern -EndScriptData */ - -#include "ScriptedPch.h" -#include "serpent_shrine.h" - -// --- Spells used by Leotheras The Blind -#define SPELL_WHIRLWIND 37640 -#define SPELL_CHAOS_BLAST 37674 -#define SPELL_BERSERK 26662 -#define SPELL_INSIDIOUS_WHISPER 37676 -#define SPELL_DUAL_WIELD 42459 - -// --- Spells used in banish phase --- -#define BANISH_BEAM 38909 -#define AURA_BANISH 37833 - -// --- Spells used by Greyheart Spellbinders -#define SPELL_EARTHSHOCK 39076 -#define SPELL_MINDBLAST 37531 - -// --- Spells used by Inner Demons and Creature ID -#define INNER_DEMON_ID 21857 -#define AURA_DEMONIC_ALIGNMENT 37713 -#define SPELL_SHADOWBOLT 39309 -#define SPELL_SOUL_LINK 38007 -#define SPELL_CONSUMING_MADNESS 37749 //not supported by core yet - -//Misc. -#define MODEL_DEMON 20125 -#define MODEL_NIGHTELF 20514 -#define DEMON_FORM 21875 -#define MOB_SPELLBINDER 21806 - -#define SAY_AGGRO -1548009 -#define SAY_SWITCH_TO_DEMON -1548010 -#define SAY_INNER_DEMONS -1548011 -#define SAY_DEMON_SLAY1 -1548012 -#define SAY_DEMON_SLAY2 -1548013 -#define SAY_DEMON_SLAY3 -1548014 -#define SAY_NIGHTELF_SLAY1 -1548015 -#define SAY_NIGHTELF_SLAY2 -1548016 -#define SAY_NIGHTELF_SLAY3 -1548017 -#define SAY_FINAL_FORM -1548018 -#define SAY_FREE -1548019 -#define SAY_DEATH -1548020 - -struct mob_inner_demonAI : public ScriptedAI -{ - mob_inner_demonAI(Creature *c) : ScriptedAI(c) - { - victimGUID = 0; - } - - uint32 ShadowBolt_Timer; - - uint32 Link_Timer; - uint64 victimGUID; - - void Reset() - { - ShadowBolt_Timer = 10000; - Link_Timer = 1000; - } - void JustDied(Unit * /*victim*/) - { - Unit* pUnit = Unit::GetUnit((*me),victimGUID); - if (pUnit && pUnit->HasAura(SPELL_INSIDIOUS_WHISPER)) - pUnit->RemoveAurasDueToSpell(SPELL_INSIDIOUS_WHISPER); - } - - void DamageTaken(Unit *done_by, uint32 &damage) - { - if (done_by->GetGUID() != victimGUID && done_by->GetGUID() != me->GetGUID()) - { - damage = 0; - DoModifyThreatPercent(done_by, -100); - } - } - - void EnterCombat(Unit * /*who*/) - { - if (!victimGUID) return; - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - if (me->getVictim()->GetGUID() != victimGUID) - { - DoModifyThreatPercent(me->getVictim(), -100); - Unit* owner = Unit::GetUnit((*me),victimGUID); - if (owner && owner->isAlive()) - { - me->AddThreat(owner,999999); - AttackStart(owner); - } else if (owner && owner->isDead()) - { - me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - return; - } - } - - if (Link_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SOUL_LINK, true); - Link_Timer = 1000; - } else Link_Timer -= diff; - - if (!me->HasAura(AURA_DEMONIC_ALIGNMENT)) - DoCast(me, AURA_DEMONIC_ALIGNMENT, true); - - if (ShadowBolt_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SHADOWBOLT, false); - ShadowBolt_Timer = 10000; - } else ShadowBolt_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -//Original Leotheras the Blind AI -struct boss_leotheras_the_blindAI : public ScriptedAI -{ - boss_leotheras_the_blindAI(Creature *c) : ScriptedAI(c) - { - c->GetPosition(x,y,z); - pInstance = c->GetInstanceData(); - Demon = 0; - - for (uint8 i = 0; i < 3; ++i)//clear guids - SpellBinderGUID[i] = 0; - } - - ScriptedInstance *pInstance; - - uint32 Whirlwind_Timer; - uint32 ChaosBlast_Timer; - uint32 SwitchToDemon_Timer; - uint32 SwitchToHuman_Timer; - uint32 Berserk_Timer; - uint32 InnerDemons_Timer; - uint32 BanishTimer; - - bool DealDamage; - bool NeedThreatReset; - bool DemonForm; - bool IsFinalForm; - bool EnrageUsed; - float x,y,z; - - uint64 InnderDemon[5]; - uint32 InnerDemon_Count; - uint64 Demon; - uint64 SpellBinderGUID[3]; - - void Reset() - { - CheckChannelers(); - BanishTimer = 1000; - Whirlwind_Timer = 15000; - ChaosBlast_Timer = 1000; - SwitchToDemon_Timer = 45000; - SwitchToHuman_Timer = 60000; - Berserk_Timer = 600000; - InnerDemons_Timer = 30000; - me->SetCanDualWield(true); - DealDamage = true; - DemonForm = false; - IsFinalForm = false; - NeedThreatReset = false; - EnrageUsed = false; - InnerDemon_Count = 0; - me->SetSpeed(MOVE_RUN, 2.0f, true); - me->SetDisplayId(MODEL_NIGHTELF); - me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID , 0); - me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0); - DoCast(me, SPELL_DUAL_WIELD, true); - me->SetCorpseDelay(1000*60*60); - if (pInstance) - pInstance->SetData(DATA_LEOTHERASTHEBLINDEVENT, NOT_STARTED); - } - - void CheckChannelers(/*bool DoEvade = true*/) - { - for (uint8 i = 0; i < 3; ++i) - { - if (Creature *add = Unit::GetCreature(*me,SpellBinderGUID[i])) - add->DisappearAndDie(); - - float nx = x; - float ny = y; - float o = 2.4f; - if (i == 0) {nx += 10; ny -= 5; o=2.5f;} - if (i == 1) {nx -= 8; ny -= 7; o=0.9f;} - if (i == 2) {nx -= 3; ny += 9; o=5.0f;} - Creature* binder = me->SummonCreature(MOB_SPELLBINDER,nx,ny,z,o,TEMPSUMMON_DEAD_DESPAWN,0); - if (binder) - SpellBinderGUID[i] = binder->GetGUID(); - - } - } - void MoveInLineOfSight(Unit *who) - { - if (me->HasAura(AURA_BANISH)) - return; - - if (!me->getVictim() && who->isTargetableForAttack() && (me->IsHostileTo(who)) && who->isInAccessiblePlaceFor(me)) - { - if (me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) - return; - - float attackRadius = me->GetAttackDistance(who); - if (me->IsWithinDistInMap(who, attackRadius)) - { - // Check first that object is in an angle in front of this one before LoS check - if (me->HasInArc(M_PI/2.0f, who) && me->IsWithinLOSInMap(who)) - { - AttackStart(who); - } - } - } - } - - void StartEvent() - { - DoScriptText(SAY_AGGRO, me); - if (pInstance) - pInstance->SetData(DATA_LEOTHERASTHEBLINDEVENT, IN_PROGRESS); - } - - void CheckBanish() - { - uint8 AliveChannelers = 0; - for (uint8 i = 0; i < 3; ++i) - { - Unit *add = Unit::GetUnit(*me,SpellBinderGUID[i]); - if (add && add->isAlive()) - ++AliveChannelers; - } - - // channelers == 0 remove banish aura - if (AliveChannelers == 0 && me->HasAura(AURA_BANISH)) - { - // removing banish aura - me->RemoveAurasDueToSpell(AURA_BANISH); - - // Leotheras is getting immune again - me->ApplySpellImmune(AURA_BANISH, IMMUNITY_MECHANIC, MECHANIC_BANISH, true); - - // changing model to bloodelf - me->SetDisplayId(MODEL_NIGHTELF); - - // and reseting equipment - me->LoadEquipment(me->GetEquipmentId()); - - if (pInstance && pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER)) - { - Unit *victim = NULL; - victim = Unit::GetUnit(*me, pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER)); - if (victim) - me->getThreatManager().addThreat(victim, 1); - StartEvent(); - } - } - else if (AliveChannelers != 0 && !me->HasAura(AURA_BANISH)) - { - // channelers != 0 apply banish aura - // removing Leotheras banish immune to apply AURA_BANISH - me->ApplySpellImmune(AURA_BANISH, IMMUNITY_MECHANIC, MECHANIC_BANISH, false); - DoCast(me, AURA_BANISH); - - // changing model - me->SetDisplayId(MODEL_DEMON); - - // and removing weapons - me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID , 0); - me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0); - } - } - - //Despawn all Inner Demon summoned - void DespawnDemon() - { - for (uint8 i=0; i<5; ++i) - { - if (InnderDemon[i]) - { - //delete creature - Creature* pCreature = Unit::GetCreature((*me), InnderDemon[i]); - if (pCreature && pCreature->isAlive()) - { - pCreature->ForcedDespawn(); - } - InnderDemon[i] = 0; - } - } - - InnerDemon_Count = 0; - } - - void CastConsumingMadness() //remove this once SPELL_INSIDIOUS_WHISPER is supported by core - { - for (uint8 i=0; i<5; ++i) - { - if (InnderDemon[i] > 0) - { - Creature* pUnit = Unit::GetCreature((*me), InnderDemon[i]); - if (pUnit && pUnit->isAlive()) - { - Unit* pUnit_pTarget = Unit::GetUnit(*pUnit, CAST_AI(mob_inner_demonAI, pUnit->AI())->victimGUID); - if (pUnit_pTarget && pUnit_pTarget->isAlive()) - { - pUnit->CastSpell(pUnit_pTarget, SPELL_CONSUMING_MADNESS, true); - DoModifyThreatPercent(pUnit_pTarget, -100); - } - } - } - } - } - - void KilledUnit(Unit * victim) - { - if (victim->GetTypeId() != TYPEID_PLAYER) - return; - - if (DemonForm) - { - DoScriptText(RAND(SAY_DEMON_SLAY1,SAY_DEMON_SLAY2,SAY_DEMON_SLAY3), me); - } - else - { - DoScriptText(RAND(SAY_NIGHTELF_SLAY1,SAY_NIGHTELF_SLAY2,SAY_NIGHTELF_SLAY3), me); - } - } - - void JustDied(Unit * /*victim*/) - { - DoScriptText(SAY_DEATH, me); - - //despawn copy - if (Demon) - { - if (Creature* pDemon = Unit::GetCreature(*me, Demon)) - pDemon->ForcedDespawn(); - } - if (pInstance) - pInstance->SetData(DATA_LEOTHERASTHEBLINDEVENT, DONE); - } - - void EnterCombat(Unit * /*who*/) - { - if (me->HasAura(AURA_BANISH)) - return; - - me->LoadEquipment(me->GetEquipmentId()); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (me->HasAura(AURA_BANISH) || !UpdateVictim()) - { - if (BanishTimer <= diff) - { - CheckBanish();//no need to check every update tick - BanishTimer = 1000; - } else BanishTimer -= diff; - return; - } - if (me->HasAura(SPELL_WHIRLWIND)) - if (Whirlwind_Timer <= diff) - { - Unit *newTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (newTarget) - { - DoResetThreat(); - me->GetMotionMaster()->Clear(); - me->GetMotionMaster()->MovePoint(0,newTarget->GetPositionX(),newTarget->GetPositionY(),newTarget->GetPositionZ()); - } - Whirlwind_Timer = 2000; - } else Whirlwind_Timer -= diff; - - // reseting after changing forms and after ending whirlwind - if (NeedThreatReset && !me->HasAura(SPELL_WHIRLWIND)) - { - // when changing forms seting timers (or when ending whirlwind - to avoid adding new variable i use Whirlwind_Timer to countdown 2s while whirlwinding) - if (DemonForm) - InnerDemons_Timer = 30000; - else - Whirlwind_Timer = 15000; - - NeedThreatReset = false; - DoResetThreat(); - me->GetMotionMaster()->Clear(); - me->GetMotionMaster()->MoveChase(me->getVictim()); - } - - //Enrage_Timer (10 min) - if (Berserk_Timer < diff && !EnrageUsed) - { - me->InterruptNonMeleeSpells(false); - DoCast(me, SPELL_BERSERK); - EnrageUsed = true; - } else Berserk_Timer -= diff; - - if (!DemonForm) - { - //Whirldind Timer - if (!me->HasAura(SPELL_WHIRLWIND)) - { - if (Whirlwind_Timer <= diff) - { - DoCast(me, SPELL_WHIRLWIND); - // while whirlwinding this variable is used to countdown target's change - Whirlwind_Timer = 2000; - NeedThreatReset = true; - } else Whirlwind_Timer -= diff; - } - //Switch_Timer - - if (!IsFinalForm) - if (SwitchToDemon_Timer <= diff) - { - //switch to demon form - me->RemoveAurasDueToSpell(SPELL_WHIRLWIND,0); - me->SetDisplayId(MODEL_DEMON); - DoScriptText(SAY_SWITCH_TO_DEMON, me); - me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID , 0); - me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0); - DemonForm = true; - NeedThreatReset = true; - SwitchToDemon_Timer = 45000; - } else SwitchToDemon_Timer -= diff; - DoMeleeAttackIfReady(); - } - else - { - //ChaosBlast_Timer - if (!me->getVictim()) - return; - if (me->IsWithinDist(me->getVictim(), 30)) - me->StopMoving(); - if (ChaosBlast_Timer <= diff) - { - // will cast only when in range of spell - if (me->IsWithinDist(me->getVictim(), 30)) - { - //DoCast(me->getVictim(), SPELL_CHAOS_BLAST, true); - int damage = 100; - me->CastCustomSpell(me->getVictim(), SPELL_CHAOS_BLAST, &damage, NULL, NULL, false, NULL, NULL, me->GetGUID()); - } - ChaosBlast_Timer = 3000; - } else ChaosBlast_Timer -= diff; - //Summon Inner Demon - if (InnerDemons_Timer <= diff) - { - std::list& ThreatList = me->getThreatManager().getThreatList(); - std::vector TargetList; - for (std::list::const_iterator itr = ThreatList.begin(); itr != ThreatList.end(); ++itr) - { - Unit *tempTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid()); - if (tempTarget && tempTarget->GetTypeId() == TYPEID_PLAYER && tempTarget->GetGUID() != me->getVictim()->GetGUID() && TargetList.size()<5) - TargetList.push_back(tempTarget); - } - //SpellEntry *spell = GET_SPELL(SPELL_INSIDIOUS_WHISPER); - for (std::vector::const_iterator itr = TargetList.begin(); itr != TargetList.end(); ++itr) - { - if ((*itr) && (*itr)->isAlive()) - { - Creature * demon = me->SummonCreature(INNER_DEMON_ID, (*itr)->GetPositionX()+10, (*itr)->GetPositionY()+10, (*itr)->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); - if (demon) - { - demon->AI()->AttackStart((*itr)); - CAST_AI(mob_inner_demonAI, demon->AI())->victimGUID = (*itr)->GetGUID(); - - (*itr)->AddAura(SPELL_INSIDIOUS_WHISPER, *itr); - - if (InnerDemon_Count > 4) - InnerDemon_Count = 0; - - //Safe storing of creatures - InnderDemon[InnerDemon_Count] = demon->GetGUID(); - - //Update demon count - ++InnerDemon_Count; - } - } - } - DoScriptText(SAY_INNER_DEMONS, me); - - InnerDemons_Timer = 999999; - } else InnerDemons_Timer -= diff; - - //Switch_Timer - if (SwitchToHuman_Timer <= diff) - { - //switch to nightelf form - me->SetDisplayId(MODEL_NIGHTELF); - me->LoadEquipment(me->GetEquipmentId()); - - CastConsumingMadness(); - DespawnDemon(); - - DemonForm = false; - NeedThreatReset = true; - - SwitchToHuman_Timer = 60000; - } else SwitchToHuman_Timer -= diff; - } - - if (!IsFinalForm && (me->GetHealth()*100 / me->GetMaxHealth()) < 15) - { - //at this point he divides himself in two parts - CastConsumingMadness(); - DespawnDemon(); - Creature *Copy = NULL; - Copy = DoSpawnCreature(DEMON_FORM, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 6000); - if (Copy) - { - Demon = Copy->GetGUID(); - if (me->getVictim()) - Copy->AI()->AttackStart(me->getVictim()); - } - //set nightelf final form - IsFinalForm = true; - DemonForm = false; - - DoScriptText(SAY_FINAL_FORM, me); - me->SetDisplayId(MODEL_NIGHTELF); - me->LoadEquipment(me->GetEquipmentId()); - } - } -}; - -//Leotheras the Blind Demon Form AI -struct boss_leotheras_the_blind_demonformAI : public ScriptedAI -{ - boss_leotheras_the_blind_demonformAI(Creature *c) : ScriptedAI(c) {} - - uint32 ChaosBlast_Timer; - bool DealDamage; - - void Reset() - { - ChaosBlast_Timer = 1000; - DealDamage = true; - } - - void StartEvent() - { - DoScriptText(SAY_FREE, me); - } - - void KilledUnit(Unit * victim) - { - if (victim->GetTypeId() != TYPEID_PLAYER) - return; - - DoScriptText(RAND(SAY_DEMON_SLAY1,SAY_DEMON_SLAY2,SAY_DEMON_SLAY3), me); - } - - void JustDied(Unit * /*victim*/) - { - //invisibility (blizzlike, at the end of the fight he doesn't die, he disappears) - DoCast(me, 8149, true); - } - - void EnterCombat(Unit * /*who*/) - { - StartEvent(); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - //ChaosBlast_Timer - if (me->IsWithinDist(me->getVictim(), 30)) - me->StopMoving(); - - if (ChaosBlast_Timer <= diff) - { - // will cast only when in range od spell - if (me->IsWithinDist(me->getVictim(), 30)) - { - //DoCast(me->getVictim(), SPELL_CHAOS_BLAST, true); - int damage = 100; - me->CastCustomSpell(me->getVictim(), SPELL_CHAOS_BLAST, &damage, NULL, NULL, false, NULL, NULL, me->GetGUID()); - ChaosBlast_Timer = 3000; - } - } else ChaosBlast_Timer -= diff; - - //Do NOT deal any melee damage to the target. - } -}; -struct mob_greyheart_spellbinderAI : public ScriptedAI -{ - mob_greyheart_spellbinderAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - leotherasGUID = 0; - AddedBanish = false; - } - - ScriptedInstance *pInstance; - - uint64 leotherasGUID; - - uint32 Mindblast_Timer; - uint32 Earthshock_Timer; - - bool AddedBanish; - - void Reset() - { - Mindblast_Timer = 3000 + rand()%5000; - Earthshock_Timer = 5000 + rand()%5000; - - if (pInstance) - { - pInstance->SetData64(DATA_LEOTHERAS_EVENT_STARTER, 0); - Creature *leotheras = Unit::GetCreature(*me, leotherasGUID); - if (leotheras && leotheras->isAlive()) - CAST_AI(boss_leotheras_the_blindAI, leotheras->AI())->CheckChannelers(/*false*/); - } - } - - void EnterCombat(Unit * who) - { - me->InterruptNonMeleeSpells(false); - if (pInstance) - pInstance->SetData64(DATA_LEOTHERAS_EVENT_STARTER, who->GetGUID()); - } - - void JustRespawned() - { - AddedBanish = false; - Reset(); - } - - void CastChanneling() - { - if (!me->isInCombat() && !me->GetCurrentSpell(CURRENT_CHANNELED_SPELL)) - { - if (leotherasGUID) - { - Creature *leotheras = Unit::GetCreature(*me, leotherasGUID); - if (leotheras && leotheras->isAlive()) - DoCast(leotheras, BANISH_BEAM); - } - } - } - - void UpdateAI(const uint32 diff) - { - if (pInstance) - { - if (!leotherasGUID) - leotherasGUID = pInstance->GetData64(DATA_LEOTHERAS); - - if (!me->isInCombat() && pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER)) - { - Unit *victim = NULL; - victim = Unit::GetUnit(*me, pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER)); - if (victim) - AttackStart(victim); - } - } - - if (!UpdateVictim()) - { - CastChanneling(); - return; - } - - if (pInstance && !pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER)) - { - EnterEvadeMode(); - return; - } - - if (Mindblast_Timer <= diff) - { - Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); - - if (pTarget)DoCast(pTarget, SPELL_MINDBLAST); - - Mindblast_Timer = 10000 + rand()%5000; - } else Mindblast_Timer -= diff; - - if (Earthshock_Timer <= diff) - { - Map* pMap = me->GetMap(); - Map::PlayerList const &PlayerList = pMap->GetPlayers(); - for (Map::PlayerList::const_iterator itr = PlayerList.begin(); itr != PlayerList.end(); ++itr) - { - if (Player* i_pl = itr->getSource()) - { - bool isCasting = false; - for (uint8 i = 0; i < CURRENT_MAX_SPELL; ++i) - if (i_pl->GetCurrentSpell(i)) - isCasting = true; - - if (isCasting) - { - DoCast(i_pl, SPELL_EARTHSHOCK); - break; - } - } - } - Earthshock_Timer = 8000 + rand()%7000; - } else Earthshock_Timer -= diff; - DoMeleeAttackIfReady(); - } - - void JustDied(Unit * /*killer*/) {} -}; -CreatureAI* GetAI_boss_leotheras_the_blind(Creature* pCreature) -{ - return new boss_leotheras_the_blindAI (pCreature); -} - -CreatureAI* GetAI_boss_leotheras_the_blind_demonform(Creature* pCreature) -{ - return new boss_leotheras_the_blind_demonformAI (pCreature); -} - -CreatureAI* GetAI_mob_greyheart_spellbinder(Creature* pCreature) -{ - return new mob_greyheart_spellbinderAI (pCreature); -} - -CreatureAI* GetAI_mob_inner_demon(Creature* pCreature) -{ - return new mob_inner_demonAI (pCreature); -} -void AddSC_boss_leotheras_the_blind() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "boss_leotheras_the_blind"; - newscript->GetAI = &GetAI_boss_leotheras_the_blind; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_leotheras_the_blind_demonform"; - newscript->GetAI = &GetAI_boss_leotheras_the_blind_demonform; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_greyheart_spellbinder"; - newscript->GetAI = &GetAI_mob_greyheart_spellbinder; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_inner_demon"; - newscript->GetAI = &GetAI_mob_inner_demon; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Outland/coilfang_resevoir/serpent_shrine/boss_lurker_below.cpp b/src/server/scripts/Outland/coilfang_resevoir/serpent_shrine/boss_lurker_below.cpp deleted file mode 100644 index b1c0c10bcce..00000000000 --- a/src/server/scripts/Outland/coilfang_resevoir/serpent_shrine/boss_lurker_below.cpp +++ /dev/null @@ -1,458 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: boss_the_lurker_below -SD%Complete: 80 -SDComment: Coilfang Frenzy, find out how could we fishing in the strangepool -SDCategory: The Lurker Below -EndScriptData */ - -#include "ScriptedPch.h" -#include "serpent_shrine.h" -#include "ScriptedSimpleAI.h" -#include "Spell.h" - -#define SPELL_SPOUT 37433 -#define SPELL_SPOUT_ANIM 42835 -#define SPELL_SPOUT_BREATH 37431 -#define SPELL_KNOCKBACK 19813 -#define SPELL_GEYSER 37478 -#define SPELL_WHIRL 37660 -#define SPELL_WATERBOLT 37138 -#define SPELL_SUBMERGE 37550 -#define SPELL_EMERGE 20568 - -#define EMOTE_SPOUT "The Lurker Below takes a deep breath." - -#define SPOUT_DIST 100 - -#define MOB_COILFANG_GUARDIAN 21873 -#define MOB_COILFANG_AMBUSHER 21865 - -//Ambusher spells -#define SPELL_SPREAD_SHOT 37790 -#define SPELL_SHOOT 37770 - -//Guardian spells -#define SPELL_ARCINGSMASH 38761 // Wrong SpellId. Can't find the right one. -#define SPELL_HAMSTRING 26211 - -float AddPos[9][3] = -{ - {2.8553810, -459.823914, -19.182686}, //MOVE_AMBUSHER_1 X, Y, Z - {12.400000, -466.042267, -19.182686}, //MOVE_AMBUSHER_2 X, Y, Z - {51.366653, -460.836060, -19.182686}, //MOVE_AMBUSHER_3 X, Y, Z - {62.597980, -457.433044, -19.182686}, //MOVE_AMBUSHER_4 X, Y, Z - {77.607452, -384.302765, -19.182686}, //MOVE_AMBUSHER_5 X, Y, Z - {63.897900, -378.984924, -19.182686}, //MOVE_AMBUSHER_6 X, Y, Z - {34.447250, -387.333618, -19.182686}, //MOVE_GUARDIAN_1 X, Y, Z - {14.388216, -423.468018, -19.625271}, //MOVE_GUARDIAN_2 X, Y, Z - {42.471519, -445.115295, -19.769423} //MOVE_GUARDIAN_3 X, Y, Z -}; - -struct boss_the_lurker_belowAI : public Scripted_NoMovementAI -{ - boss_the_lurker_belowAI(Creature *c) : Scripted_NoMovementAI(c), Summons(me) - { - pInstance = c->GetInstanceData(); - SpellEntry *TempSpell = GET_SPELL(SPELL_SPOUT_ANIM); - if (TempSpell) - { - TempSpell->Effect[0] = 0;//remove all spell effect, only anim is needed - TempSpell->Effect[1] = 0; - TempSpell->Effect[2] = 0; - } - } - - ScriptedInstance* pInstance; - SummonList Summons; - - bool Spawned; - bool Submerged; - bool InRange; - bool CanStartEvent; - uint32 RotTimer; - uint32 SpoutAnimTimer; - uint32 WaterboltTimer; - uint32 SpoutTimer; - uint32 WhirlTimer; - uint32 PhaseTimer; - uint32 GeyserTimer; - uint32 CheckTimer; - uint32 WaitTimer; - uint32 WaitTimer2; - - bool CheckCanStart()//check if players fished - { - if (pInstance && pInstance->GetData(DATA_STRANGE_POOL) == NOT_STARTED) - return false; - return true; - } - void Reset() - { - me->AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_LEVITATING); - SpoutAnimTimer = 1000; - RotTimer = 0; - WaterboltTimer = 15000;//give time to get in range when fight starts - SpoutTimer = 45000; - WhirlTimer = 18000;//after avery spout - PhaseTimer = 120000; - GeyserTimer = rand()%5000 + 15000; - CheckTimer = 15000;//give time to get in range when fight starts - WaitTimer = 60000;//never reached - WaitTimer2 = 60000;//never reached - - Submerged = true;//will be false at combat start - Spawned = false; - InRange = false; - CanStartEvent = false; - - Summons.DespawnAll(); - - if (pInstance) - { - pInstance->SetData(DATA_THELURKERBELOWEVENT, NOT_STARTED); - pInstance->SetData(DATA_STRANGE_POOL, NOT_STARTED); - } - DoCast(me, SPELL_SUBMERGE);//submerge anim - me->SetVisibility(VISIBILITY_OFF);//we start invis under water, submerged - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); - } - - void JustDied(Unit* /*Killer*/) - { - if (pInstance) - pInstance->SetData(DATA_THELURKERBELOWEVENT, DONE); - - Summons.DespawnAll(); - } - - void EnterCombat(Unit * who) - { - if (pInstance) - pInstance->SetData(DATA_THELURKERBELOWEVENT, IN_PROGRESS); - Scripted_NoMovementAI::EnterCombat(who); - } - - void MoveInLineOfSight(Unit *who) - { - if (!CanStartEvent)//boss is invisible, don't attack - return; - if (!me->getVictim() && who->isTargetableForAttack() && (me->IsHostileTo(who))) - { - float attackRadius = me->GetAttackDistance(who); - if (me->IsWithinDistInMap(who, attackRadius)) - { - AttackStart(who); - } - } - } - - void MovementInform(uint32 type, uint32 /*id*/) - { - if (type == ROTATE_MOTION_TYPE) - me->SetReactState(REACT_AGGRESSIVE); - } - - void UpdateAI(const uint32 diff) - { - if (!CanStartEvent)//boss is invisible, don't attack - { - if (CheckCanStart()) - { - if (Submerged) - { - me->SetVisibility(VISIBILITY_ON); - Submerged = false; - WaitTimer2 = 500; - } - if (!Submerged && WaitTimer2 <= diff)//wait 500ms before emerge anim - { - me->RemoveAllAuras(); - me->RemoveFlag(UNIT_NPC_EMOTESTATE,EMOTE_STATE_SUBMERGED); - DoCast(me, SPELL_EMERGE, false); - WaitTimer2 = 60000;//never reached - WaitTimer = 3000; - } else WaitTimer2 -= diff; - - if (WaitTimer <= diff)//wait 3secs for emerge anim, then attack - { - WaitTimer = 3000; - CanStartEvent=true;//fresh fished from pool - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - } else WaitTimer -= diff; - } - return; - } - - if (me->getThreatManager().getThreatList().empty())//check if should evade - { - if (me->isInCombat()) - EnterEvadeMode(); - return; - } - if (!Submerged) - { - if (PhaseTimer <= diff) - { - me->InterruptNonMeleeSpells(false); - DoCast(me, SPELL_SUBMERGE); - PhaseTimer = 60000;//60secs submerged - Submerged = true; - } else PhaseTimer-=diff; - - if (SpoutTimer <= diff) - { - me->MonsterTextEmote(EMOTE_SPOUT,0,true); - me->SetReactState(REACT_PASSIVE); - me->GetMotionMaster()->MoveRotate(20000, rand()%2 ? ROTATE_DIRECTION_LEFT : ROTATE_DIRECTION_RIGHT); - SpoutTimer = 45000; - WhirlTimer = 20000;//whirl directly after spout - RotTimer = 20000; - return; - } else SpoutTimer -= diff; - - //Whirl directly after a Spout and at random times - if (WhirlTimer <= diff) - { - WhirlTimer = 18000; - DoCast(me, SPELL_WHIRL); - } else WhirlTimer -= diff; - - if (CheckTimer <= diff)//check if there are players in melee range - { - InRange = false; - Map* pMap = me->GetMap(); - Map::PlayerList const &PlayerList = pMap->GetPlayers(); - if (!PlayerList.isEmpty()) - { - for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) - { - if (me->IsWithinMeleeRange(i->getSource())) - InRange = true; - } - } - CheckTimer = 2000; - } else CheckTimer -= diff; - - if (RotTimer) - { - Map* pMap = me->GetMap(); - if (pMap->IsDungeon()) - { - Map::PlayerList const &PlayerList = pMap->GetPlayers(); - for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) - { - if (i->getSource() && i->getSource()->isAlive() && me->HasInArc((double)diff/20000*(double)M_PI*2,i->getSource()) && me->IsWithinDist(i->getSource(), SPOUT_DIST) && !i->getSource()->IsInWater()) - DoCast(i->getSource(), SPELL_SPOUT, true);//only knock back palyers in arc, in 100yards, not in water - } - } - - if (SpoutAnimTimer <= diff) - { - DoCast(me, SPELL_SPOUT_ANIM, true); - SpoutAnimTimer = 1000; - } else SpoutAnimTimer -= diff; - - if (RotTimer <= diff) - { - RotTimer = 0; - } else RotTimer -= diff; - return; - } - - if (GeyserTimer <= diff) - { - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1); - if (!pTarget && me->getVictim()) - pTarget = me->getVictim(); - if (pTarget) - DoCast(pTarget, SPELL_GEYSER, true); - GeyserTimer = rand()%5000 + 15000; - } else GeyserTimer -= diff; - - if (!InRange)//if on players in melee range cast Waterbolt - { - if (WaterboltTimer <= diff) - { - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); - if (!pTarget && me->getVictim()) - pTarget = me->getVictim(); - if (pTarget) - DoCast(pTarget, SPELL_WATERBOLT, true); - WaterboltTimer = 3000; - } else WaterboltTimer -= diff; - } - - if (!UpdateCombatState()) - return; - - DoMeleeAttackIfReady(); - - }else//submerged - { - if (PhaseTimer <= diff) - { - Submerged = false; - me->InterruptNonMeleeSpells(false);//shouldn't be any - me->RemoveAllAuras(); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); - me->RemoveFlag(UNIT_NPC_EMOTESTATE,EMOTE_STATE_SUBMERGED); - DoCast(me, SPELL_EMERGE, true); - Spawned = false; - SpoutTimer = 3000; // directly cast Spout after emerging! - PhaseTimer = 120000; - return; - } else PhaseTimer-=diff; - - if (me->getThreatManager().getThreatList().empty())//check if should evade - { - EnterEvadeMode(); - return; - } - if (!me->isInCombat()) - DoZoneInCombat(); - - if (!Spawned) - { - me->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); - //spawn adds - for (uint8 i = 0; i < 9; ++i) - { - Creature* Summoned; - if (i < 6) - Summoned = me->SummonCreature(MOB_COILFANG_AMBUSHER,AddPos[i][0],AddPos[i][1],AddPos[i][2], 0, TEMPSUMMON_CORPSE_DESPAWN, 0); - else Summoned = me->SummonCreature(MOB_COILFANG_GUARDIAN,AddPos[i][0],AddPos[i][1],AddPos[i][2], 0, TEMPSUMMON_CORPSE_DESPAWN, 0); - - if (Summoned) - Summons.Summon(Summoned); - } - Spawned = true; - } - } - } - }; - -CreatureAI* GetAI_mob_coilfang_guardian(Creature* pCreature) -{ - SimpleAI* ai = new SimpleAI (pCreature); - - ai->Spell[0].Enabled = true; - ai->Spell[0].Spell_Id = SPELL_ARCINGSMASH; - ai->Spell[0].Cooldown = 15000; - ai->Spell[0].First_Cast = 5000; - ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_TARGET; - - ai->Spell[1].Enabled = true; - ai->Spell[1].Spell_Id = SPELL_HAMSTRING; - ai->Spell[1].Cooldown = 10000; - ai->Spell[1].First_Cast = 2000; - ai->Spell[1].Cast_Target_Type = CAST_HOSTILE_TARGET; - - return ai; -} - -struct mob_coilfang_ambusherAI : public Scripted_NoMovementAI -{ - mob_coilfang_ambusherAI(Creature *c) : Scripted_NoMovementAI(c) - { - SpellEntry *TempSpell = GET_SPELL(SPELL_SHOOT); - if (TempSpell) - TempSpell->Effect[0] = 2;//change spell effect from weapon % dmg to simple phisical dmg - } - - uint32 MultiShotTimer; - uint32 ShootBowTimer; - - void Reset() - { - MultiShotTimer = 10000; - ShootBowTimer = 4000; - - } - - void EnterCombat(Unit * /*who*/) - { - - } - - void MoveInLineOfSight(Unit *who) - { - if (!who || me->getVictim()) return; - - if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(me) && me->IsHostileTo(who) && me->IsWithinDistInMap(who, 45)) - { - AttackStart(who); - } - } - - void UpdateAI(const uint32 diff) - { - if (MultiShotTimer <= diff) - { - if (me->getVictim()) - DoCast(me->getVictim(), SPELL_SPREAD_SHOT, true); - - MultiShotTimer = 10000+rand()%10000; - ShootBowTimer += 1500;//add global cooldown - } else MultiShotTimer -= diff; - - if (ShootBowTimer <= diff) - { - Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); - int bp0 = 1100; - if (pTarget) - me->CastCustomSpell(pTarget,SPELL_SHOOT,&bp0,NULL,NULL,true); - ShootBowTimer = 4000+rand()%5000; - MultiShotTimer += 1500;//add global cooldown - } else ShootBowTimer -= diff; - } -}; - -CreatureAI* GetAI_mob_coilfang_ambusher(Creature* pCreature) -{ - return new mob_coilfang_ambusherAI (pCreature); -} - -CreatureAI* GetAI_boss_the_lurker_below(Creature* pCreature) -{ - return new boss_the_lurker_belowAI (pCreature); -} - -void AddSC_boss_the_lurker_below() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_the_lurker_below"; - newscript->GetAI = &GetAI_boss_the_lurker_below; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_coilfang_guardian"; - newscript->GetAI = &GetAI_mob_coilfang_guardian; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_coilfang_ambusher"; - newscript->GetAI = &GetAI_mob_coilfang_ambusher; - newscript->RegisterSelf(); -} - - diff --git a/src/server/scripts/Outland/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp b/src/server/scripts/Outland/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp deleted file mode 100644 index 14c87aee141..00000000000 --- a/src/server/scripts/Outland/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp +++ /dev/null @@ -1,369 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -/* ScriptData -SDName: Boss_Morogrim_Tidewalker -SD%Complete: 90 -SDComment: Water globules don't explode properly, remove hacks -SDCategory: Coilfang Resevoir, Serpent Shrine Cavern -EndScriptData */ - -#include "ScriptedPch.h" -#include "serpent_shrine.h" - -#define SAY_AGGRO -1548030 -#define SAY_SUMMON1 -1548031 -#define SAY_SUMMON2 -1548032 -#define SAY_SUMMON_BUBL1 -1548033 -#define SAY_SUMMON_BUBL2 -1548034 -#define SAY_SLAY1 -1548035 -#define SAY_SLAY2 -1548036 -#define SAY_SLAY3 -1548037 -#define SAY_DEATH -1548038 -#define EMOTE_WATERY_GRAVE -1548039 -#define EMOTE_EARTHQUAKE -1548040 -#define EMOTE_WATERY_GLOBULES -1548041 - -#define SPELL_TIDAL_WAVE 37730 -#define SPELL_WATERY_GRAVE 38049 -#define SPELL_EARTHQUAKE 37764 -#define SPELL_WATERY_GRAVE_EXPLOSION 37852 - -#define WATERY_GRAVE_X1 334.64 -#define WATERY_GRAVE_Y1 -728.89 -#define WATERY_GRAVE_Z1 -14.42 -#define WATERY_GRAVE_X2 365.51 -#define WATERY_GRAVE_Y2 -737.14 -#define WATERY_GRAVE_Z2 -14.44 -#define WATERY_GRAVE_X3 366.19 -#define WATERY_GRAVE_Y3 -709.59 -#define WATERY_GRAVE_Z3 -14.36 -#define WATERY_GRAVE_X4 372.93 -#define WATERY_GRAVE_Y4 -690.96 -#define WATERY_GRAVE_Z4 -14.44 - -#define SPELL_WATERY_GRAVE_1 38023 -#define SPELL_WATERY_GRAVE_2 38024 -#define SPELL_WATERY_GRAVE_3 38025 -#define SPELL_WATERY_GRAVE_4 37850 - -#define SPELL_SUMMON_WATER_GLOBULE_1 37854 -#define SPELL_SUMMON_WATER_GLOBULE_2 37858 -#define SPELL_SUMMON_WATER_GLOBULE_3 37860 -#define SPELL_SUMMON_WATER_GLOBULE_4 37861 - -/*#define SPELL_SUMMON_MURLOC_A6 39813 -#define SPELL_SUMMON_MURLOC_A7 39814 -#define SPELL_SUMMON_MURLOC_A8 39815 -#define SPELL_SUMMON_MURLOC_A9 39816 -#define SPELL_SUMMON_MURLOC_A10 39817 - -#define SPELL_SUMMON_MURLOC_B6 39818 -#define SPELL_SUMMON_MURLOC_B7 39819 -#define SPELL_SUMMON_MURLOC_B8 39820 -#define SPELL_SUMMON_MURLOC_B9 39821 -#define SPELL_SUMMON_MURLOC_B10 39822*/ - -float MurlocCords[10][5] = -{ - {21920, 424.36, -715.4, -7.14, 0.124}, - {21920, 425.13, -719.3, -7.14, 0.124}, - {21920, 425.05, -724.23, -7.14, 0.124}, - {21920, 424.91, -728.68, -7.14, 0.124}, - {21920, 424.84, -732.18, -7.14, 0.124}, - {21920, 321.05, -734.2, -13.15, 0.124}, - {21920, 321.05, -729.4, -13.15, 0.124}, - {21920, 321.05, -724.03, -13.15, 0.124}, - {21920, 321.05, -718.73, -13.15, 0.124}, - {21920, 321.05, -714.24, -13.15, 0.124} -}; - -//Creatures -#define WATER_GLOBULE 21913 -#define TIDEWALKER_LURKER 21920 - -//Morogrim Tidewalker AI -struct boss_morogrim_tidewalkerAI : public ScriptedAI -{ - boss_morogrim_tidewalkerAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - Map::PlayerList const *PlayerList; - - uint32 TidalWave_Timer; - uint32 WateryGrave_Timer; - uint32 Earthquake_Timer; - uint32 WateryGlobules_Timer; - uint32 globulespell[4]; - int8 Playercount; - int8 counter; - - bool Earthquake; - bool Phase2; - - void Reset() - { - TidalWave_Timer = 10000; - WateryGrave_Timer = 30000; - Earthquake_Timer = 40000; - WateryGlobules_Timer = 0; - globulespell[0] = SPELL_SUMMON_WATER_GLOBULE_1; - globulespell[1] = SPELL_SUMMON_WATER_GLOBULE_2; - globulespell[2] = SPELL_SUMMON_WATER_GLOBULE_3; - globulespell[3] = SPELL_SUMMON_WATER_GLOBULE_4; - - Earthquake = false; - Phase2 = false; - - if (pInstance) - pInstance->SetData(DATA_MOROGRIMTIDEWALKEREVENT, NOT_STARTED); - } - - void StartEvent() - { - DoScriptText(SAY_AGGRO, me); - - if (pInstance) - pInstance->SetData(DATA_MOROGRIMTIDEWALKEREVENT, IN_PROGRESS); - } - - void KilledUnit(Unit * /*victim*/) - { - DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), me); - } - - void JustDied(Unit * /*victim*/) - { - DoScriptText(SAY_DEATH, me); - - if (pInstance) - pInstance->SetData(DATA_MOROGRIMTIDEWALKEREVENT, DONE); - } - - void EnterCombat(Unit * /*who*/) - { - PlayerList = &me->GetMap()->GetPlayers(); - Playercount = PlayerList->getSize(); - StartEvent(); - } - - void ApplyWateryGrave(Unit* pPlayer, uint8 i) - { - switch(i) - { - case 0: pPlayer->CastSpell(pPlayer, SPELL_WATERY_GRAVE_1, true); break; - case 1: pPlayer->CastSpell(pPlayer, SPELL_WATERY_GRAVE_2, true); break; - case 2: pPlayer->CastSpell(pPlayer, SPELL_WATERY_GRAVE_3, true); break; - case 3: pPlayer->CastSpell(pPlayer, SPELL_WATERY_GRAVE_4, true); break; - } - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //Earthquake_Timer - if (Earthquake_Timer <= diff) - { - if (!Earthquake) - { - DoCast(me->getVictim(), SPELL_EARTHQUAKE); - Earthquake = true; - Earthquake_Timer = 10000; - } - else - { - DoScriptText(RAND(SAY_SUMMON1,SAY_SUMMON2), me); - - for (uint8 i = 0; i < 10; ++i) - { - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); - Creature* Murloc = me->SummonCreature(MurlocCords[i][0],MurlocCords[i][1],MurlocCords[i][2],MurlocCords[i][3],MurlocCords[i][4], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); - if (pTarget && Murloc) - Murloc->AI()->AttackStart(pTarget); - } - DoScriptText(EMOTE_EARTHQUAKE, me); - Earthquake = false; - Earthquake_Timer = 40000+rand()%5000; - } - } else Earthquake_Timer -= diff; - - //TidalWave_Timer - if (TidalWave_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_TIDAL_WAVE); - TidalWave_Timer = 20000; - } else TidalWave_Timer -= diff; - - if (!Phase2) - { - //WateryGrave_Timer - if (WateryGrave_Timer <= diff) - { - //Teleport 4 players under the waterfalls - Unit *pTarget; - using std::set; - setlist; - set::const_iterator itr; - for (uint8 i = 0; i < 4; ++i) - { - counter = 0; - do - { - pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 50, true); //target players only - if (counter < Playercount) - break; - if (pTarget) - itr = list.find(pTarget->GetGUID()); - ++counter; - } while (itr != list.end()); - - if (pTarget) - { - list.insert(pTarget->GetGUID()); - ApplyWateryGrave(pTarget, i); - } - } - - DoScriptText(RAND(SAY_SUMMON_BUBL1,SAY_SUMMON_BUBL2), me); - - DoScriptText(EMOTE_WATERY_GRAVE, me); - WateryGrave_Timer = 30000; - } else WateryGrave_Timer -= diff; - - //Start Phase2 - if ((me->GetHealth()*100 / me->GetMaxHealth()) < 25) - Phase2 = true; - } - else - { - //WateryGlobules_Timer - if (WateryGlobules_Timer <= diff) - { - Unit* pGlobuleTarget; - using std::set; - setglobulelist; - set::const_iterator itr; - for (uint8 g = 0; g < 4; g++) //one unit can't cast more than one spell per update, so some players have to cast for us XD - { - counter = 0; - do { - pGlobuleTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 50, true); - if (pGlobuleTarget) - itr = globulelist.find(pGlobuleTarget->GetGUID()); - if (counter > Playercount) - break; - ++counter; - } while (itr != globulelist.end()); - if (pGlobuleTarget) - globulelist.insert(pGlobuleTarget->GetGUID()); - pGlobuleTarget->CastSpell(pGlobuleTarget, globulespell[g], true); - } - DoScriptText(EMOTE_WATERY_GLOBULES, me); - WateryGlobules_Timer = 25000; - } else WateryGlobules_Timer -= diff; - } - - DoMeleeAttackIfReady(); - } -}; - -//Water Globule AI -#define SPELL_GLOBULE_EXPLOSION 37871 - -struct mob_water_globuleAI : public ScriptedAI -{ - mob_water_globuleAI(Creature *c) : ScriptedAI(c) {} - - uint32 Check_Timer; - - void Reset() - { - Check_Timer = 1000; - - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->setFaction(14); - } - - void EnterCombat(Unit * /*who*/) {} - - void MoveInLineOfSight(Unit *who) - { - if (!who || me->getVictim()) - return; - - if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(me) && me->IsHostileTo(who)) - { - //no attack radius check - it attacks the first target that moves in his los - //who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); - AttackStart(who); - } - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - if (Check_Timer <= diff) - { - if (me->IsWithinDistInMap(me->getVictim(), 5)) - { - DoCast(me->getVictim(), SPELL_GLOBULE_EXPLOSION); - - //despawn - me->ForcedDespawn(); - return; - } - Check_Timer = 500; - } else Check_Timer -= diff; - - //do NOT deal any melee damage to the target. - } -}; - -CreatureAI* GetAI_boss_morogrim_tidewalker(Creature* pCreature) -{ - return new boss_morogrim_tidewalkerAI (pCreature); -} -CreatureAI* GetAI_mob_water_globule(Creature* pCreature) -{ - return new mob_water_globuleAI (pCreature); -} - -void AddSC_boss_morogrim_tidewalker() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "boss_morogrim_tidewalker"; - newscript->GetAI = &GetAI_boss_morogrim_tidewalker; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_water_globule"; - newscript->GetAI = &GetAI_mob_water_globule; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Outland/coilfang_resevoir/serpent_shrine/instance_serpent_shrine.cpp b/src/server/scripts/Outland/coilfang_resevoir/serpent_shrine/instance_serpent_shrine.cpp deleted file mode 100644 index c80afae15c7..00000000000 --- a/src/server/scripts/Outland/coilfang_resevoir/serpent_shrine/instance_serpent_shrine.cpp +++ /dev/null @@ -1,398 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Instance_Serpent_Shrine -SD%Complete: 100 -SDComment: Instance Data Scripts and functions to acquire mobs and set encounter status for use in various Serpent Shrine Scripts -SDCategory: Coilfang Resevoir, Serpent Shrine Cavern -EndScriptData */ - -#include "ScriptedPch.h" -#include "serpent_shrine.h" - -#define MAX_ENCOUNTER 6 -#define SPELL_SCALDINGWATER 37284 -#define MOB_COILFANG_FRENZY 21508 -#define TRASHMOB_COILFANG_PRIESTESS 21220 //6*2 -#define TRASHMOB_COILFANG_SHATTERER 21301 //6*3 - -#define MIN_KILLS 30 - -//NOTE: there are 6 platforms -//there should be 3 shatterers and 2 priestess on all platforms, total of 30 elites, else it won't work! -//delete all other elites not on platforms! these mobs should only be on those platforms nowhere else. - -/* Serpentshrine cavern encounters: -0 - Hydross The Unstable event -1 - Leotheras The Blind Event -2 - The Lurker Below Event -3 - Fathom-Lord Karathress Event -4 - Morogrim Tidewalker Event -5 - Lady Vashj Event -*/ - -bool GOHello_go_bridge_console(Player* /*pPlayer*/, GameObject* pGo) -{ - ScriptedInstance* pInstance = pGo->GetInstanceData(); - - if (!pInstance) - return false; - - if (pInstance) - pInstance->SetData(DATA_CONTROL_CONSOLE, DONE); - - return true; -} - -struct instance_serpentshrine_cavern : public ScriptedInstance -{ - instance_serpentshrine_cavern(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint64 LurkerBelow; - uint64 Sharkkis; - uint64 Tidalvess; - uint64 Caribdis; - uint64 LadyVashj; - uint64 Karathress; - uint64 KarathressEvent_Starter; - uint64 LeotherasTheBlind; - uint64 LeotherasEventStarter; - - uint64 ControlConsole; - uint64 BridgePart[3]; - uint32 StrangePool; - uint32 FishingTimer; - uint32 LurkerSubEvent; - uint32 WaterCheckTimer; - uint32 FrenzySpawnTimer; - uint32 Water; - uint32 TrashCount; - - bool ShieldGeneratorDeactivated[4]; - uint32 m_auiEncounter[MAX_ENCOUNTER]; - bool DoSpawnFrenzy; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - LurkerBelow = 0; - Sharkkis = 0; - Tidalvess = 0; - Caribdis = 0; - LadyVashj = 0; - Karathress = 0; - KarathressEvent_Starter = 0; - LeotherasTheBlind = 0; - LeotherasEventStarter = 0; - - ControlConsole = 0; - BridgePart[0] = 0; - BridgePart[1] = 0; - BridgePart[2] = 0; - StrangePool = 0; - Water = WATERSTATE_FRENZY; - - ShieldGeneratorDeactivated[0] = false; - ShieldGeneratorDeactivated[1] = false; - ShieldGeneratorDeactivated[2] = false; - ShieldGeneratorDeactivated[3] = false; - FishingTimer = 1000; - LurkerSubEvent = 0; - WaterCheckTimer = 500; - FrenzySpawnTimer = 2000; - DoSpawnFrenzy = false; - TrashCount = 0; - - } - - bool IsEncounterInProgress() const - { - for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) return true; - - return false; - } - - void Update (uint32 diff) - { - //Lurker Fishing event - if (LurkerSubEvent == LURKER_FISHING) - { - if (FishingTimer <= diff) - { - LurkerSubEvent = LURKER_HOOKED; - SetData(DATA_STRANGE_POOL, IN_PROGRESS);//just fished, signal Lurker script to emerge and start fight, we use IN_PROGRESS so it won't get saved and lurker will be alway invis at start if server restarted - } else FishingTimer -= diff; - } - //Water checks - if (WaterCheckTimer <= diff) - { - if (TrashCount >= MIN_KILLS) - Water = WATERSTATE_SCALDING; - else - Water = WATERSTATE_FRENZY; - - Map::PlayerList const &PlayerList = instance->GetPlayers(); - if (PlayerList.isEmpty()) - return; - for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) - { - if (Player* pPlayer = i->getSource()) - { - if (pPlayer->isAlive() && /*i->getSource()->GetPositionZ() <= -21.434931f*/pPlayer->IsInWater()) - { - if (Water == WATERSTATE_SCALDING) - { - - if (!pPlayer->HasAura(SPELL_SCALDINGWATER)) - { - pPlayer->CastSpell(pPlayer, SPELL_SCALDINGWATER,true); - } - } else if (Water == WATERSTATE_FRENZY) - { - //spawn frenzy - if (DoSpawnFrenzy) - { - if (Creature* frenzy = pPlayer->SummonCreature(MOB_COILFANG_FRENZY,pPlayer->GetPositionX(),pPlayer->GetPositionY(),pPlayer->GetPositionZ(),pPlayer->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,2000)) - { - frenzy->Attack(pPlayer,false); - frenzy->AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_LEVITATING); - } - DoSpawnFrenzy = false; - } - } - } - if (!pPlayer->IsInWater()) - pPlayer->RemoveAurasDueToSpell(SPELL_SCALDINGWATER); - } - - } - WaterCheckTimer = 500;//remove stress from core - } else WaterCheckTimer -= diff; - if (FrenzySpawnTimer <= diff) - { - DoSpawnFrenzy = true; - FrenzySpawnTimer = 2000; - } else FrenzySpawnTimer -= diff; - } - - void OnGameObjectCreate(GameObject* pGo, bool /*add*/) - { - switch(pGo->GetEntry()) - { - case 184568: - ControlConsole = pGo->GetGUID(); - pGo->setActive(true); - break; - - case 184203: - BridgePart[0] = pGo->GetGUID(); - pGo->setActive(true); - break; - - case 184204: - BridgePart[1] = pGo->GetGUID(); - pGo->setActive(true); - break; - - case 184205: - BridgePart[2] = pGo->GetGUID(); - pGo->setActive(true); - break; - case GAMEOBJECT_FISHINGNODE_ENTRY://no way checking if fish is hooked, so we create a timed event - if (LurkerSubEvent == LURKER_NOT_STARTED) - { - FishingTimer = 10000+rand()%30000;//random time before lurker emerges - LurkerSubEvent = LURKER_FISHING; - } - break; - } - } - - void OnCreatureCreate(Creature* pCreature, bool /*add*/) - { - switch(pCreature->GetEntry()) - { - case 21212: LadyVashj = pCreature->GetGUID(); break; - case 21214: Karathress = pCreature->GetGUID(); break; - case 21966: Sharkkis = pCreature->GetGUID(); break; - case 21217: LurkerBelow = pCreature->GetGUID(); break; - case 21965: Tidalvess = pCreature->GetGUID(); break; - case 21964: Caribdis = pCreature->GetGUID(); break; - case 21215: LeotherasTheBlind = pCreature->GetGUID(); break; - /*case TRASHMOB_COILFANG_PRIESTESS: - case TRASHMOB_COILFANG_SHATTERER: - if (pCreature->isAlive()) - ++TrashCount; - break;*/ - } - } - - void SetData64(uint32 type, uint64 data) - { - if (type == DATA_KARATHRESSEVENT_STARTER) - KarathressEvent_Starter = data; - if (type == DATA_LEOTHERAS_EVENT_STARTER) - LeotherasEventStarter = data; - } - - uint64 GetData64(uint32 identifier) - { - switch(identifier) - { - case DATA_THELURKERBELOW: return LurkerBelow; - case DATA_SHARKKIS: return Sharkkis; - case DATA_TIDALVESS: return Tidalvess; - case DATA_CARIBDIS: return Caribdis; - case DATA_LADYVASHJ: return LadyVashj; - case DATA_KARATHRESS: return Karathress; - case DATA_KARATHRESSEVENT_STARTER: return KarathressEvent_Starter; - case DATA_LEOTHERAS: return LeotherasTheBlind; - case DATA_LEOTHERAS_EVENT_STARTER: return LeotherasEventStarter; - } - return 0; - } - - void SetData(uint32 type, uint32 data) - { - switch(type) - { - case DATA_STRANGE_POOL: - { - StrangePool = data; - if (data == NOT_STARTED) - LurkerSubEvent = LURKER_NOT_STARTED; - } - break; - case DATA_CONTROL_CONSOLE: - if (data == DONE) - { - HandleGameObject(BridgePart[0], true); - HandleGameObject(BridgePart[0], true); - HandleGameObject(BridgePart[0], true); - } - ControlConsole = data;break; - case DATA_TRASH : - { - if (data == 1 && TrashCount < MIN_KILLS) - ++TrashCount;//+1 died - SaveToDB(); - break; - } - case DATA_WATER : Water = data;break; - case DATA_HYDROSSTHEUNSTABLEEVENT: m_auiEncounter[0] = data; break; - case DATA_LEOTHERASTHEBLINDEVENT: m_auiEncounter[1] = data; break; - case DATA_THELURKERBELOWEVENT: m_auiEncounter[2] = data; break; - case DATA_KARATHRESSEVENT: m_auiEncounter[3] = data; break; - case DATA_MOROGRIMTIDEWALKEREVENT: m_auiEncounter[4] = data; break; - //Lady Vashj - case DATA_LADYVASHJEVENT: - if (data == NOT_STARTED) - { - ShieldGeneratorDeactivated[0] = false; - ShieldGeneratorDeactivated[1] = false; - ShieldGeneratorDeactivated[2] = false; - ShieldGeneratorDeactivated[3] = false; - } - m_auiEncounter[5] = data; break; - case DATA_SHIELDGENERATOR1:ShieldGeneratorDeactivated[0] = (data) ? true : false; break; - case DATA_SHIELDGENERATOR2:ShieldGeneratorDeactivated[1] = (data) ? true : false; break; - case DATA_SHIELDGENERATOR3:ShieldGeneratorDeactivated[2] = (data) ? true : false; break; - case DATA_SHIELDGENERATOR4:ShieldGeneratorDeactivated[3] = (data) ? true : false; break; - } - - if (data == DONE) - SaveToDB(); - } - - uint32 GetData(uint32 type) - { - switch(type) - { - case DATA_HYDROSSTHEUNSTABLEEVENT: return m_auiEncounter[0]; - case DATA_LEOTHERASTHEBLINDEVENT: return m_auiEncounter[1]; - case DATA_THELURKERBELOWEVENT: return m_auiEncounter[2]; - case DATA_KARATHRESSEVENT: return m_auiEncounter[3]; - case DATA_MOROGRIMTIDEWALKEREVENT: return m_auiEncounter[4]; - //Lady Vashj - case DATA_LADYVASHJEVENT: return m_auiEncounter[5]; - case DATA_SHIELDGENERATOR1: return ShieldGeneratorDeactivated[0]; - case DATA_SHIELDGENERATOR2: return ShieldGeneratorDeactivated[1]; - case DATA_SHIELDGENERATOR3: return ShieldGeneratorDeactivated[2]; - case DATA_SHIELDGENERATOR4: return ShieldGeneratorDeactivated[3]; - case DATA_CANSTARTPHASE3: - if (ShieldGeneratorDeactivated[0] && ShieldGeneratorDeactivated[1] && ShieldGeneratorDeactivated[2] && ShieldGeneratorDeactivated[3])return 1;break; - case DATA_STRANGE_POOL: return StrangePool; - case DATA_WATER: return Water; - } - return 0; - } - std::string GetSaveData() - { - OUT_SAVE_INST_DATA; - std::ostringstream stream; - stream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " - << m_auiEncounter[3] << " " << m_auiEncounter[4] << " " << m_auiEncounter[5] << " " << TrashCount; - char* out = new char[stream.str().length() + 1]; - strcpy(out, stream.str().c_str()); - if (out) - { - OUT_SAVE_INST_DATA_COMPLETE; - return out; - } - return NULL; - } - - void Load(const char* in) - { - if (!in) - { - OUT_LOAD_INST_DATA_FAIL; - return; - } - OUT_LOAD_INST_DATA(in); - std::istringstream stream(in); - stream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3] - >> m_auiEncounter[4] >> m_auiEncounter[5] >> TrashCount; - for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) // Do not load an encounter as "In Progress" - reset it instead. - m_auiEncounter[i] = NOT_STARTED; - OUT_LOAD_INST_DATA_COMPLETE; - } -}; - -InstanceData* GetInstanceData_instance_serpentshrine_cavern(Map* pMap) -{ - return new instance_serpentshrine_cavern(pMap); -} - -void AddSC_instance_serpentshrine_cavern() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "instance_serpent_shrine"; - newscript->GetInstanceData = &GetInstanceData_instance_serpentshrine_cavern; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "go_bridge_console"; - newscript->pGOHello = &GOHello_go_bridge_console; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Outland/coilfang_resevoir/serpent_shrine/serpent_shrine.h b/src/server/scripts/Outland/coilfang_resevoir/serpent_shrine/serpent_shrine.h deleted file mode 100644 index adfa39dc7e0..00000000000 --- a/src/server/scripts/Outland/coilfang_resevoir/serpent_shrine/serpent_shrine.h +++ /dev/null @@ -1,45 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ - -#ifndef DEF_SERPENT_SHRINE_H -#define DEF_SERPENT_SHRINE_H -enum LurkerEventState -{ - LURKER_NOT_STARTED = 0, - LURKER_FISHING = 1, - LURKER_HOOKED = 2 -}; -enum WaterEventState -{ - WATERSTATE_NONE = 0, - WATERSTATE_FRENZY = 1, - WATERSTATE_SCALDING = 2 -}; -#define DATA_CANSTARTPHASE3 1 -#define DATA_CARIBDIS 2 -#define DATA_HYDROSSTHEUNSTABLEEVENT 3 -#define DATA_KARATHRESS 4 -#define DATA_KARATHRESSEVENT 5 -#define DATA_KARATHRESSEVENT_STARTER 6 -#define DATA_LADYVASHJ 7 -#define DATA_LADYVASHJEVENT 8 -#define DATA_LEOTHERASTHEBLINDEVENT 9 -#define DATA_MOROGRIMTIDEWALKEREVENT 10 -#define DATA_SHARKKIS 11 -#define DATA_SHIELDGENERATOR1 12 -#define DATA_SHIELDGENERATOR2 13 -#define DATA_SHIELDGENERATOR3 14 -#define DATA_SHIELDGENERATOR4 15 -#define DATA_THELURKERBELOW 16 -#define DATA_THELURKERBELOWEVENT 17 -#define DATA_TIDALVESS 18 -#define DATA_FATHOMLORDKARATHRESSEVENT 19 -#define DATA_LEOTHERAS 20 -#define DATA_LEOTHERAS_EVENT_STARTER 21 -#define DATA_CONTROL_CONSOLE 22 -#define DATA_STRANGE_POOL 23 -#define DATA_WATER 24 -#define DATA_TRASH 25 -#endif - diff --git a/src/server/scripts/Outland/coilfang_resevoir/steam_vault/boss_hydromancer_thespia.cpp b/src/server/scripts/Outland/coilfang_resevoir/steam_vault/boss_hydromancer_thespia.cpp deleted file mode 100644 index 8e1b438bdc5..00000000000 --- a/src/server/scripts/Outland/coilfang_resevoir/steam_vault/boss_hydromancer_thespia.cpp +++ /dev/null @@ -1,187 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Hydromancer_Thespia -SD%Complete: 80 -SDComment: Needs additional adjustments (when instance script is adjusted) -SDCategory: Coilfang Resevoir, The Steamvault -EndScriptData */ - -/* ContentData -boss_hydromancer_thespia -mob_coilfang_waterelemental -EndContentData */ - -#include "ScriptedPch.h" -#include "steam_vault.h" - -#define SAY_SUMMON -1545000 -#define SAY_AGGRO_1 -1545001 -#define SAY_AGGRO_2 -1545002 -#define SAY_AGGRO_3 -1545003 -#define SAY_SLAY_1 -1545004 -#define SAY_SLAY_2 -1545005 -#define SAY_DEAD -1545006 - -#define SPELL_LIGHTNING_CLOUD 25033 -#define SPELL_LUNG_BURST 31481 -#define SPELL_ENVELOPING_WINDS 31718 - -struct boss_thespiaAI : public ScriptedAI -{ - boss_thespiaAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance *pInstance; - - uint32 LightningCloud_Timer; - uint32 LungBurst_Timer; - uint32 EnvelopingWinds_Timer; - - void Reset() - { - LightningCloud_Timer = 15000; - LungBurst_Timer = 7000; - EnvelopingWinds_Timer = 9000; - - if (pInstance) - pInstance->SetData(TYPE_HYDROMANCER_THESPIA, NOT_STARTED); - } - - void JustDied(Unit* /*Killer*/) - { - DoScriptText(SAY_DEAD, me); - - if (pInstance) - pInstance->SetData(TYPE_HYDROMANCER_THESPIA, DONE); - } - - void KilledUnit(Unit* /*victim*/) - { - DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me); - } - - void EnterCombat(Unit * /*who*/) - { - DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3), me); - - if (pInstance) - pInstance->SetData(TYPE_HYDROMANCER_THESPIA, IN_PROGRESS); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //LightningCloud_Timer - if (LightningCloud_Timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(pTarget, SPELL_LIGHTNING_CLOUD); - - //cast twice in Heroic mode - if (IsHeroic()) - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(pTarget, SPELL_LIGHTNING_CLOUD); - - LightningCloud_Timer = 15000+rand()%10000; - } else LightningCloud_Timer -=diff; - - //LungBurst_Timer - if (LungBurst_Timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(pTarget, SPELL_LUNG_BURST); - LungBurst_Timer = 7000+rand()%5000; - } else LungBurst_Timer -=diff; - - //EnvelopingWinds_Timer - if (EnvelopingWinds_Timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(pTarget, SPELL_ENVELOPING_WINDS); - - //cast twice in Heroic mode - if (IsHeroic()) - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(pTarget, SPELL_ENVELOPING_WINDS); - EnvelopingWinds_Timer = 10000+rand()%5000; - } else EnvelopingWinds_Timer -=diff; - - DoMeleeAttackIfReady(); - } -}; - -#define SPELL_WATER_BOLT_VOLLEY 34449 -#define H_SPELL_WATER_BOLT_VOLLEY 37924 - -struct mob_coilfang_waterelementalAI : public ScriptedAI -{ - mob_coilfang_waterelementalAI(Creature *c) : ScriptedAI(c) {} - - uint32 WaterBoltVolley_Timer; - - void Reset() - { - WaterBoltVolley_Timer = 3000+rand()%3000; - } - - void EnterCombat(Unit * /*who*/) { } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (WaterBoltVolley_Timer <= diff) - { - DoCast(me, SPELL_WATER_BOLT_VOLLEY); - WaterBoltVolley_Timer = 7000+rand()%5000; - } else WaterBoltVolley_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_thespiaAI(Creature* pCreature) -{ - return new boss_thespiaAI (pCreature); -} - -CreatureAI* GetAI_mob_coilfang_waterelementalAI(Creature* pCreature) -{ - return new mob_coilfang_waterelementalAI (pCreature); -} - -void AddSC_boss_hydromancer_thespia() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "boss_hydromancer_thespia"; - newscript->GetAI = &GetAI_boss_thespiaAI; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_coilfang_waterelemental"; - newscript->GetAI = &GetAI_mob_coilfang_waterelementalAI; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Outland/coilfang_resevoir/steam_vault/boss_mekgineer_steamrigger.cpp b/src/server/scripts/Outland/coilfang_resevoir/steam_vault/boss_mekgineer_steamrigger.cpp deleted file mode 100644 index f2da4058e44..00000000000 --- a/src/server/scripts/Outland/coilfang_resevoir/steam_vault/boss_mekgineer_steamrigger.cpp +++ /dev/null @@ -1,264 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Mekgineer_Steamrigger -SD%Complete: 60 -SDComment: Mechanics' interrrupt heal doesn't work very well, also a proper movement needs to be implemented -> summon further away and move towards pTarget to repair. -SDCategory: Coilfang Resevoir, The Steamvault -EndScriptData */ - -/* ContentData -boss_mekgineer_steamrigger -mob_steamrigger_mechanic -EndContentData */ - -#include "ScriptedPch.h" -#include "steam_vault.h" - -#define SAY_MECHANICS -1545007 -#define SAY_AGGRO_1 -1545008 -#define SAY_AGGRO_2 -1545009 -#define SAY_AGGRO_3 -1545010 -#define SAY_AGGRO_4 -1545011 -#define SAY_SLAY_1 -1545012 -#define SAY_SLAY_2 -1545013 -#define SAY_SLAY_3 -1545014 -#define SAY_DEATH -1545015 - -#define SPELL_SUPER_SHRINK_RAY 31485 -#define SPELL_SAW_BLADE 31486 -#define SPELL_ELECTRIFIED_NET 35107 -#define H_SPELL_ENRAGE 1 //corrent enrage spell not known - -#define ENTRY_STREAMRIGGER_MECHANIC 17951 - -struct boss_mekgineer_steamriggerAI : public ScriptedAI -{ - boss_mekgineer_steamriggerAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance *pInstance; - - uint32 Shrink_Timer; - uint32 Saw_Blade_Timer; - uint32 Electrified_Net_Timer; - bool Summon75; - bool Summon50; - bool Summon25; - - void Reset() - { - Shrink_Timer = 20000; - Saw_Blade_Timer = 15000; - Electrified_Net_Timer = 10000; - - Summon75 = false; - Summon50 = false; - Summon25 = false; - - if (pInstance) - pInstance->SetData(TYPE_MEKGINEER_STEAMRIGGER, NOT_STARTED); - } - - void JustDied(Unit* /*Killer*/) - { - DoScriptText(SAY_DEATH, me); - - if (pInstance) - pInstance->SetData(TYPE_MEKGINEER_STEAMRIGGER, DONE); - } - - void KilledUnit(Unit* /*victim*/) - { - DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), me); - } - - void EnterCombat(Unit * /*who*/) - { - DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3), me); - - if (pInstance) - pInstance->SetData(TYPE_MEKGINEER_STEAMRIGGER, IN_PROGRESS); - } - - //no known summon spells exist - void SummonMechanichs() - { - DoScriptText(SAY_MECHANICS, me); - - DoSpawnCreature(ENTRY_STREAMRIGGER_MECHANIC,5,5,0,0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 240000); - DoSpawnCreature(ENTRY_STREAMRIGGER_MECHANIC,-5,5,0,0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 240000); - DoSpawnCreature(ENTRY_STREAMRIGGER_MECHANIC,-5,-5,0,0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 240000); - - if (rand()%2) - DoSpawnCreature(ENTRY_STREAMRIGGER_MECHANIC,5,-7,0,0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 240000); - if (rand()%2) - DoSpawnCreature(ENTRY_STREAMRIGGER_MECHANIC,7,-5,0,0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 240000); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (Shrink_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SUPER_SHRINK_RAY); - Shrink_Timer = 20000; - } else Shrink_Timer -= diff; - - if (Saw_Blade_Timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1)) - DoCast(pTarget, SPELL_SAW_BLADE); - else - DoCast(me->getVictim(), SPELL_SAW_BLADE); - - Saw_Blade_Timer = 15000; - } else Saw_Blade_Timer -= diff; - - if (Electrified_Net_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_ELECTRIFIED_NET); - Electrified_Net_Timer = 10000; - } - else Electrified_Net_Timer -= diff; - - if (!Summon75) - { - if ((me->GetHealth()*100 / me->GetMaxHealth()) < 75) - { - SummonMechanichs(); - Summon75 = true; - } - } - - if (!Summon50) - { - if ((me->GetHealth()*100 / me->GetMaxHealth()) < 50) - { - SummonMechanichs(); - Summon50 = true; - } - } - - if (!Summon25) - { - if ((me->GetHealth()*100 / me->GetMaxHealth()) < 25) - { - SummonMechanichs(); - Summon25 = true; - } - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_mekgineer_steamrigger(Creature* pCreature) -{ - return new boss_mekgineer_steamriggerAI (pCreature); -} - -#define SPELL_DISPEL_MAGIC 17201 -#define SPELL_REPAIR 31532 -#define H_SPELL_REPAIR 37936 - -#define MAX_REPAIR_RANGE (13.0f) //we should be at least at this range for repair -#define MIN_REPAIR_RANGE (7.0f) //we can stop movement at this range to repair but not required - -struct mob_steamrigger_mechanicAI : public ScriptedAI -{ - mob_steamrigger_mechanicAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint32 Repair_Timer; - - void Reset() - { - Repair_Timer = 2000; - } - - void MoveInLineOfSight(Unit* /*who*/) - { - //react only if attacked - } - - void EnterCombat(Unit * /*who*/) { } - - void UpdateAI(const uint32 diff) - { - if (Repair_Timer <= diff) - { - if (pInstance && pInstance->GetData64(DATA_MEKGINEERSTEAMRIGGER) && pInstance->GetData(TYPE_MEKGINEER_STEAMRIGGER) == IN_PROGRESS) - { - if (Unit* pMekgineer = Unit::GetUnit((*me), pInstance->GetData64(DATA_MEKGINEERSTEAMRIGGER))) - { - if (me->IsWithinDistInMap(pMekgineer, MAX_REPAIR_RANGE)) - { - //are we already channeling? Doesn't work very well, find better check? - if (!me->GetUInt32Value(UNIT_CHANNEL_SPELL)) - { - //me->GetMotionMaster()->MovementExpired(); - //me->GetMotionMaster()->MoveIdle(); - - DoCast(me, SPELL_REPAIR, true); - } - Repair_Timer = 5000; - } - else - { - //me->GetMotionMaster()->MovementExpired(); - //me->GetMotionMaster()->MoveFollow(pMekgineer,0,0); - } - } - } else Repair_Timer = 5000; - } else Repair_Timer -= diff; - - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_steamrigger_mechanic(Creature* pCreature) -{ - return new mob_steamrigger_mechanicAI (pCreature); -} - -void AddSC_boss_mekgineer_steamrigger() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "boss_mekgineer_steamrigger"; - newscript->GetAI = &GetAI_boss_mekgineer_steamrigger; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_steamrigger_mechanic"; - newscript->GetAI = &GetAI_mob_steamrigger_mechanic; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Outland/coilfang_resevoir/steam_vault/boss_warlord_kalithresh.cpp b/src/server/scripts/Outland/coilfang_resevoir/steam_vault/boss_warlord_kalithresh.cpp deleted file mode 100644 index f46956dda81..00000000000 --- a/src/server/scripts/Outland/coilfang_resevoir/steam_vault/boss_warlord_kalithresh.cpp +++ /dev/null @@ -1,204 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Warlord_Kalithres -SD%Complete: 65 -SDComment: Contains workarounds regarding warlord's rage spells not acting as expected. Both scripts here require review and fine tuning. -SDCategory: Coilfang Resevoir, The Steamvault -EndScriptData */ - -#include "ScriptedPch.h" -#include "steam_vault.h" - -#define SAY_INTRO -1545016 -#define SAY_REGEN -1545017 -#define SAY_AGGRO1 -1545018 -#define SAY_AGGRO2 -1545019 -#define SAY_AGGRO3 -1545020 -#define SAY_SLAY1 -1545021 -#define SAY_SLAY2 -1545022 -#define SAY_DEATH -1545023 - -#define SPELL_SPELL_REFLECTION 31534 -#define SPELL_IMPALE 39061 -#define SPELL_WARLORDS_RAGE 37081 -#define SPELL_WARLORDS_RAGE_NAGA 31543 - -#define SPELL_WARLORDS_RAGE_PROC 36453 - -struct mob_naga_distillerAI : public ScriptedAI -{ - mob_naga_distillerAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance *pInstance; - - void Reset() - { - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - - //hack, due to really weird spell behaviour :( - if (pInstance) - { - if (pInstance->GetData(TYPE_DISTILLER) == IN_PROGRESS) - { - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - } - } - } - - void EnterCombat(Unit * /*who*/) { } - - void StartRageGen(Unit * /*caster*/) - { - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - - DoCast(me, SPELL_WARLORDS_RAGE_NAGA, true); - - if (pInstance) - pInstance->SetData(TYPE_DISTILLER,IN_PROGRESS); - } - - void DamageTaken(Unit * /*done_by*/, uint32 &damage) - { - if (me->GetHealth() <= damage) - if (pInstance) - pInstance->SetData(TYPE_DISTILLER,DONE); - } -}; - -struct boss_warlord_kalithreshAI : public ScriptedAI -{ - boss_warlord_kalithreshAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance *pInstance; - - uint32 Reflection_Timer; - uint32 Impale_Timer; - uint32 Rage_Timer; - bool CanRage; - - void Reset() - { - Reflection_Timer = 10000; - Impale_Timer = 7000+rand()%7000; - Rage_Timer = 45000; - CanRage = false; - - if (pInstance) - pInstance->SetData(TYPE_WARLORD_KALITHRESH, NOT_STARTED); - } - - void EnterCombat(Unit * /*who*/) - { - DoScriptText(RAND(SAY_AGGRO1,SAY_AGGRO2,SAY_AGGRO3), me); - - if (pInstance) - pInstance->SetData(TYPE_WARLORD_KALITHRESH, IN_PROGRESS); - } - - void KilledUnit(Unit* /*victim*/) - { - DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me); - } - - void SpellHit(Unit * /*caster*/, const SpellEntry *spell) - { - //hack :( - if (spell->Id == SPELL_WARLORDS_RAGE_PROC) - if (pInstance) - if (pInstance->GetData(TYPE_DISTILLER) == DONE) - me->RemoveAurasDueToSpell(SPELL_WARLORDS_RAGE_PROC); - } - - void JustDied(Unit* /*Killer*/) - { - DoScriptText(SAY_DEATH, me); - - if (pInstance) - pInstance->SetData(TYPE_WARLORD_KALITHRESH, DONE); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (Rage_Timer <= diff) - { - if (Creature* distiller = me->FindNearestCreature(17954, 100.0f)) - { - DoScriptText(SAY_REGEN, me); - DoCast(me, SPELL_WARLORDS_RAGE); - CAST_AI(mob_naga_distillerAI, distiller->AI())->StartRageGen(me); - } - Rage_Timer = 3000+rand()%15000; - } else Rage_Timer -= diff; - - //Reflection_Timer - if (Reflection_Timer <= diff) - { - DoCast(me, SPELL_SPELL_REFLECTION); - Reflection_Timer = 15000+rand()%10000; - } else Reflection_Timer -= diff; - - //Impale_Timer - if (Impale_Timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(pTarget, SPELL_IMPALE); - - Impale_Timer = 7500+rand()%5000; - } else Impale_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_naga_distiller(Creature* pCreature) -{ - return new mob_naga_distillerAI (pCreature); -} - -CreatureAI* GetAI_boss_warlord_kalithresh(Creature* pCreature) -{ - return new boss_warlord_kalithreshAI (pCreature); -} - -void AddSC_boss_warlord_kalithresh() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "mob_naga_distiller"; - newscript->GetAI = &GetAI_mob_naga_distiller; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_warlord_kalithresh"; - newscript->GetAI = &GetAI_boss_warlord_kalithresh; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Outland/coilfang_resevoir/steam_vault/instance_steam_vault.cpp b/src/server/scripts/Outland/coilfang_resevoir/steam_vault/instance_steam_vault.cpp deleted file mode 100644 index 188a23738f5..00000000000 --- a/src/server/scripts/Outland/coilfang_resevoir/steam_vault/instance_steam_vault.cpp +++ /dev/null @@ -1,231 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Instance_Steam_Vault -SD%Complete: 80 -SDComment: Instance script and access panel GO -SDCategory: Coilfang Resevoir, The Steamvault -EndScriptData */ - -#include "ScriptedPch.h" -#include "steam_vault.h" - -#define MAX_ENCOUNTER 4 - -#define MAIN_CHAMBERS_DOOR 183049 -#define ACCESS_PANEL_HYDRO 184125 -#define ACCESS_PANEL_MEK 184126 - -/* Steam Vaults encounters: -1 - Hydromancer Thespia Event -2 - Mekgineer Steamrigger Event -3 - Warlord Kalithresh Event -*/ - -bool GOHello_go_main_chambers_access_panel(Player* /*pPlayer*/, GameObject* pGo) -{ - ScriptedInstance* pInstance = pGo->GetInstanceData(); - - if (!pInstance) - return false; - - if (pGo->GetEntry() == ACCESS_PANEL_HYDRO && (pInstance->GetData(TYPE_HYDROMANCER_THESPIA) == DONE || pInstance->GetData(TYPE_HYDROMANCER_THESPIA) == SPECIAL)) - pInstance->SetData(TYPE_HYDROMANCER_THESPIA,SPECIAL); - - if (pGo->GetEntry() == ACCESS_PANEL_MEK && (pInstance->GetData(TYPE_MEKGINEER_STEAMRIGGER) == DONE || pInstance->GetData(TYPE_MEKGINEER_STEAMRIGGER) == SPECIAL)) - pInstance->SetData(TYPE_MEKGINEER_STEAMRIGGER,SPECIAL); - - return true; -} - -struct instance_steam_vault : public ScriptedInstance -{ - instance_steam_vault(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - - uint64 ThespiaGUID; - uint64 MekgineerGUID; - uint64 KalithreshGUID; - - uint64 MainChambersDoor; - uint64 AccessPanelHydro; - uint64 AccessPanelMek; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - ThespiaGUID = 0; - MekgineerGUID = 0; - KalithreshGUID = 0; - MainChambersDoor = 0; - AccessPanelHydro = 0; - AccessPanelMek = 0; - } - - bool IsEncounterInProgress() const - { - for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) - return true; - - return false; - } - - void OnCreatureCreate(Creature* pCreature, bool /*add*/) - { - switch(pCreature->GetEntry()) - { - case 17797: ThespiaGUID = pCreature->GetGUID(); break; - case 17796: MekgineerGUID = pCreature->GetGUID(); break; - case 17798: KalithreshGUID = pCreature->GetGUID(); break; - } - } - - void OnGameObjectCreate(GameObject* pGo, bool /*add*/) - { - switch(pGo->GetEntry()) - { - case MAIN_CHAMBERS_DOOR: MainChambersDoor = pGo->GetGUID(); break; - case ACCESS_PANEL_HYDRO: AccessPanelHydro = pGo->GetGUID(); break; - case ACCESS_PANEL_MEK: AccessPanelMek = pGo->GetGUID(); break; - } - } - - void SetData(uint32 type, uint32 data) - { - switch(type) - { - case TYPE_HYDROMANCER_THESPIA: - if (data == SPECIAL) - { - HandleGameObject(AccessPanelHydro, true); - - if (GetData(TYPE_MEKGINEER_STEAMRIGGER) == SPECIAL) - HandleGameObject(MainChambersDoor, true); - - debug_log("TSCR: Instance Steamvault: Access panel used."); - } - m_auiEncounter[0] = data; - break; - case TYPE_MEKGINEER_STEAMRIGGER: - if (data == SPECIAL) - { - HandleGameObject(AccessPanelMek, true); - - if (GetData(TYPE_HYDROMANCER_THESPIA) == SPECIAL) - HandleGameObject(MainChambersDoor, true); - - debug_log("TSCR: Instance Steamvault: Access panel used."); - } - m_auiEncounter[1] = data; - break; - case TYPE_WARLORD_KALITHRESH: - m_auiEncounter[2] = data; - break; - case TYPE_DISTILLER: - m_auiEncounter[3] = data; - break; - } - - if (data == DONE || data == SPECIAL) - SaveToDB(); - } - - uint32 GetData(uint32 type) - { - switch(type) - { - case TYPE_HYDROMANCER_THESPIA: - return m_auiEncounter[0]; - case TYPE_MEKGINEER_STEAMRIGGER: - return m_auiEncounter[1]; - case TYPE_WARLORD_KALITHRESH: - return m_auiEncounter[2]; - case TYPE_DISTILLER: - return m_auiEncounter[3]; - } - return 0; - } - - uint64 GetData64(uint32 data) - { - switch(data) - { - case DATA_THESPIA: - return ThespiaGUID; - case DATA_MEKGINEERSTEAMRIGGER: - return MekgineerGUID; - case DATA_KALITRESH: - return KalithreshGUID; - } - return 0; - } - - std::string GetSaveData() - { - OUT_SAVE_INST_DATA; - std::ostringstream stream; - stream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " << m_auiEncounter[3]; - char* out = new char[stream.str().length() + 1]; - strcpy(out, stream.str().c_str()); - if (out) - { - OUT_SAVE_INST_DATA_COMPLETE; - return out; - } - return NULL; - } - - void Load(const char* in) - { - if (!in) - { - OUT_LOAD_INST_DATA_FAIL; - return; - } - OUT_LOAD_INST_DATA(in); - std::istringstream stream(in); - stream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3]; - for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) - m_auiEncounter[i] = NOT_STARTED; - OUT_LOAD_INST_DATA_COMPLETE; - } -}; - -InstanceData* GetInstanceData_instance_steam_vault(Map* pMap) -{ - return new instance_steam_vault(pMap); -} - -void AddSC_instance_steam_vault() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "go_main_chambers_access_panel"; - newscript->pGOHello = &GOHello_go_main_chambers_access_panel; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "instance_steam_vault"; - newscript->GetInstanceData = &GetInstanceData_instance_steam_vault; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Outland/coilfang_resevoir/steam_vault/steam_vault.h b/src/server/scripts/Outland/coilfang_resevoir/steam_vault/steam_vault.h deleted file mode 100644 index 4b407ac4816..00000000000 --- a/src/server/scripts/Outland/coilfang_resevoir/steam_vault/steam_vault.h +++ /dev/null @@ -1,17 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ - -#ifndef DEF_STEAM_VAULT_H -#define DEF_STEAM_VAULT_H - -#define TYPE_HYDROMANCER_THESPIA 1 -#define TYPE_MEKGINEER_STEAMRIGGER 2 -#define TYPE_WARLORD_KALITHRESH 3 -#define TYPE_DISTILLER 4 - -#define DATA_MEKGINEERSTEAMRIGGER 5 -#define DATA_KALITRESH 6 -#define DATA_THESPIA 7 -#endif - diff --git a/src/server/scripts/Outland/coilfang_resevoir/underbog/boss_hungarfen.cpp b/src/server/scripts/Outland/coilfang_resevoir/underbog/boss_hungarfen.cpp deleted file mode 100644 index fcfcc1b1a90..00000000000 --- a/src/server/scripts/Outland/coilfang_resevoir/underbog/boss_hungarfen.cpp +++ /dev/null @@ -1,154 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Hungarfen -SD%Complete: 95 -SDComment: Need confirmation if spell data are same in both modes. Summons should have faster rate in heroic -SDCategory: Coilfang Resevoir, Underbog -EndScriptData */ - -#include "ScriptedPch.h" - -#define SPELL_FOUL_SPORES 31673 -#define SPELL_ACID_GEYSER 38739 - -struct boss_hungarfenAI : public ScriptedAI -{ - boss_hungarfenAI(Creature *c) : ScriptedAI(c) - { - } - - bool Root; - uint32 Mushroom_Timer; - uint32 AcidGeyser_Timer; - - void Reset() - { - Root = false; - Mushroom_Timer = 5000; // 1 mushroom after 5s, then one per 10s. This should be different in heroic mode - AcidGeyser_Timer = 10000; - } - - void EnterCombat(Unit * /*who*/) - { - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if ((me->GetHealth()*100) / me->GetMaxHealth() <= 20) - { - if (!Root) - { - DoCast(me, SPELL_FOUL_SPORES); - Root = true; - } - } - - if (Mushroom_Timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) - me->SummonCreature(17990, pTarget->GetPositionX()+(rand()%8), pTarget->GetPositionY()+(rand()%8), pTarget->GetPositionZ(), (rand()%5), TEMPSUMMON_TIMED_DESPAWN, 22000); - else - me->SummonCreature(17990, me->GetPositionX()+(rand()%8), me->GetPositionY()+(rand()%8), me->GetPositionZ(), (rand()%5), TEMPSUMMON_TIMED_DESPAWN, 22000); - - Mushroom_Timer = 10000; - } else Mushroom_Timer -= diff; - - if (AcidGeyser_Timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(pTarget, SPELL_ACID_GEYSER); - AcidGeyser_Timer = 10000+rand()%7500; - } else AcidGeyser_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_hungarfen(Creature* pCreature) -{ - return new boss_hungarfenAI (pCreature); -} - -#define SPELL_SPORE_CLOUD 34168 -#define SPELL_PUTRID_MUSHROOM 31690 -#define SPELL_GROW 31698 - -struct mob_underbog_mushroomAI : public ScriptedAI -{ - mob_underbog_mushroomAI(Creature *c) : ScriptedAI(c) {} - - bool Stop; - uint32 Grow_Timer; - uint32 Shrink_Timer; - - void Reset() - { - Stop = false; - Grow_Timer = 0; - Shrink_Timer = 20000; - - DoCast(me, SPELL_PUTRID_MUSHROOM, true); - DoCast(me, SPELL_SPORE_CLOUD, true); - } - - void MoveInLineOfSight(Unit * /*who*/) {} - - void AttackStart(Unit* /*who*/) {} - - void EnterCombat(Unit* /*who*/) {} - - void UpdateAI(const uint32 diff) - { - if (Stop) - return; - - if (Grow_Timer <= diff) - { - DoCast(me, SPELL_GROW); - Grow_Timer = 3000; - } else Grow_Timer -= diff; - - if (Shrink_Timer <= diff) - { - me->RemoveAurasDueToSpell(SPELL_GROW); - Stop = true; - } else Shrink_Timer -= diff; - } -}; -CreatureAI* GetAI_mob_underbog_mushroom(Creature* pCreature) -{ - return new mob_underbog_mushroomAI (pCreature); -} - -void AddSC_boss_hungarfen() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "boss_hungarfen"; - newscript->GetAI = &GetAI_boss_hungarfen; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_underbog_mushroom"; - newscript->GetAI = &GetAI_mob_underbog_mushroom; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Outland/coilfang_resevoir/underbog/boss_the_black_stalker.cpp b/src/server/scripts/Outland/coilfang_resevoir/underbog/boss_the_black_stalker.cpp deleted file mode 100644 index 3a78660389b..00000000000 --- a/src/server/scripts/Outland/coilfang_resevoir/underbog/boss_the_black_stalker.cpp +++ /dev/null @@ -1,185 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_the_black_stalker -SD%Complete: 95 -SDComment: Timers may be incorrect -SDCategory: Coilfang Resevoir, Underbog -EndScriptData */ - -#include "ScriptedPch.h" - -#define SPELL_LEVITATE 31704 -#define SPELL_SUSPENSION 31719 -#define SPELL_LEVITATION_PULSE 31701 -#define SPELL_MAGNETIC_PULL 31705 -#define SPELL_CHAIN_LIGHTNING 31717 -#define SPELL_STATIC_CHARGE 31715 -#define SPELL_SUMMON_SPORE_STRIDER 38755 - -#define ENTRY_SPORE_STRIDER 22299 - -struct boss_the_black_stalkerAI : public ScriptedAI -{ - boss_the_black_stalkerAI(Creature *c) : ScriptedAI(c) - { - } - - uint32 SporeStriders_Timer; - uint32 Levitate_Timer; - uint32 ChainLightning_Timer; - uint32 StaticCharge_Timer; - uint64 LevitatedTarget; - uint32 LevitatedTarget_Timer; - bool InAir; - uint32 check_Timer; - std::list Striders; - - void Reset() - { - Levitate_Timer = 12000; - ChainLightning_Timer = 6000; - StaticCharge_Timer = 10000; - SporeStriders_Timer = 10000+rand()%5000; - check_Timer = 5000; - LevitatedTarget = 0; - LevitatedTarget_Timer = 0; - Striders.clear(); - } - - void EnterCombat(Unit * /*who*/) {} - - void JustSummoned(Creature *summon) - { - if (summon && summon->GetEntry() == ENTRY_SPORE_STRIDER) - { - Striders.push_back(summon->GetGUID()); - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1)) - summon->AI()->AttackStart(pTarget); - else - if (me->getVictim()) - summon->AI()->AttackStart(me->getVictim()); - } - } - - void JustDied(Unit * /*who*/) - { - for (std::list::const_iterator i = Striders.begin(); i != Striders.end(); ++i) - if (Creature *strider = Unit::GetCreature(*me, *i)) - strider->DisappearAndDie(); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - // Evade if too far - if (check_Timer <= diff) - { - float x,y,z,o; - me->GetHomePosition(x,y,z,o); - if (!me->IsWithinDist3d(x,y,z, 60)) - { - EnterEvadeMode(); - return; - } - check_Timer = 1000; - } else check_Timer -= diff; - - // Spore Striders - if (IsHeroic() && SporeStriders_Timer <= diff) - { - DoCast(me, SPELL_SUMMON_SPORE_STRIDER); - SporeStriders_Timer = 10000+rand()%5000; - } else SporeStriders_Timer -= diff; - - // Levitate - if (LevitatedTarget) - { - if (LevitatedTarget_Timer <= diff) - { - if (Unit *pTarget = Unit::GetUnit(*me, LevitatedTarget)) - { - if (!pTarget->HasAura(SPELL_LEVITATE)) - { - LevitatedTarget = 0; - return; - } - if (InAir) - { - pTarget->AddAura(SPELL_SUSPENSION, pTarget); - LevitatedTarget = 0; - } - else - { - pTarget->CastSpell(pTarget, SPELL_MAGNETIC_PULL, true); - InAir = true; - LevitatedTarget_Timer = 1500; - } - } - else - LevitatedTarget = 0; - } else LevitatedTarget_Timer -= diff; - } - if (Levitate_Timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1)) - { - DoCast(pTarget, SPELL_LEVITATE); - LevitatedTarget = pTarget->GetGUID(); - LevitatedTarget_Timer = 2000; - InAir = false; - } - Levitate_Timer = 12000+rand()%3000; - } else Levitate_Timer -= diff; - - // Chain Lightning - if (ChainLightning_Timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(pTarget, SPELL_CHAIN_LIGHTNING); - ChainLightning_Timer = 7000; - } else ChainLightning_Timer -= diff; - - // Static Charge - if (StaticCharge_Timer <= diff) - { - if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0,30,true)) - DoCast(pTarget, SPELL_STATIC_CHARGE); - StaticCharge_Timer = 10000; - } else StaticCharge_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_the_black_stalker(Creature* pCreature) -{ - return new boss_the_black_stalkerAI (pCreature); -} - -void AddSC_boss_the_black_stalker() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "boss_the_black_stalker"; - newscript->GetAI = &GetAI_boss_the_black_stalker; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Outland/gruuls_lair/boss_gruul.cpp b/src/server/scripts/Outland/gruuls_lair/boss_gruul.cpp deleted file mode 100644 index a07ac910598..00000000000 --- a/src/server/scripts/Outland/gruuls_lair/boss_gruul.cpp +++ /dev/null @@ -1,255 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Gruul -SD%Complete: 60 -SDComment: Ground Slam need further development (knock back effect and shatter effect must be added to the core) -SDCategory: Gruul's Lair -EndScriptData */ - -#include "ScriptedPch.h" -#include "gruuls_lair.h" - -enum eEnums -{ - SAY_AGGRO = -1565010, - SAY_SLAM1 = -1565011, - SAY_SLAM2 = -1565012, - SAY_SHATTER1 = -1565013, - SAY_SHATTER2 = -1565014, - SAY_SLAY1 = -1565015, - SAY_SLAY2 = -1565016, - SAY_SLAY3 = -1565017, - SAY_DEATH = -1565018, - - EMOTE_GROW = -1565019, - - SPELL_GROWTH = 36300, - SPELL_CAVE_IN = 36240, - SPELL_GROUND_SLAM = 33525, //AoE Ground Slam applying Ground Slam to everyone with a script effect (most likely the knock back, we can code it to a set knockback) - SPELL_REVERBERATION = 36297, - SPELL_SHATTER = 33654, - - SPELL_SHATTER_EFFECT = 33671, - SPELL_HURTFUL_STRIKE = 33813, - SPELL_STONED = 33652, //Spell is self cast by target - - SPELL_MAGNETIC_PULL = 28337, - SPELL_KNOCK_BACK = 24199, //Knockback spell until correct implementation is made -}; - -struct boss_gruulAI : public ScriptedAI -{ - boss_gruulAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance *pInstance; - - uint32 m_uiGrowth_Timer; - uint32 m_uiCaveIn_Timer; - uint32 m_uiCaveIn_StaticTimer; - uint32 m_uiGroundSlamTimer; - uint32 m_uiHurtfulStrike_Timer; - uint32 m_uiReverberation_Timer; - - bool m_bPerformingGroundSlam; - - void Reset() - { - m_uiGrowth_Timer= 30000; - m_uiCaveIn_Timer= 27000; - m_uiCaveIn_StaticTimer = 30000; - m_uiGroundSlamTimer= 35000; - m_bPerformingGroundSlam= false; - m_uiHurtfulStrike_Timer= 8000; - m_uiReverberation_Timer= 60000+45000; - - if (pInstance) - pInstance->SetData(DATA_GRUULEVENT, NOT_STARTED); - } - - void EnterCombat(Unit * /*who*/) - { - DoScriptText(SAY_AGGRO, me); - - if (pInstance) - pInstance->SetData(DATA_GRUULEVENT, IN_PROGRESS); - } - - void KilledUnit() - { - DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), me); - } - - void JustDied(Unit* /*Killer*/) - { - DoScriptText(SAY_DEATH, me); - - if (pInstance) - { - pInstance->SetData(DATA_GRUULEVENT, DONE); - pInstance->HandleGameObject(pInstance->GetData64(DATA_GRUULDOOR), true); // Open the encounter door - } - } - - void SpellHitTarget(Unit* pTarget, const SpellEntry* pSpell) - { - //This to emulate effect1 (77) of SPELL_GROUND_SLAM, knock back to any direction - //It's initially wrong, since this will cause fall damage, which is by comments, not intended. - if (pSpell->Id == SPELL_GROUND_SLAM) - { - if (pTarget->GetTypeId() == TYPEID_PLAYER) - { - switch (urand(0,1)) - { - case 0: pTarget->CastSpell(pTarget, SPELL_MAGNETIC_PULL, true, NULL, NULL, me->GetGUID()); break; - case 1: pTarget->CastSpell(pTarget, SPELL_KNOCK_BACK, true, NULL, NULL, me->GetGUID()); break; - } - } - } - - //this part should be in the core - if (pSpell->Id == SPELL_SHATTER) - { - //this spell must have custom handling in the core, dealing damage based on distance - pTarget->CastSpell(pTarget, SPELL_SHATTER_EFFECT, true); - - if (pTarget->HasAura(SPELL_STONED)) - pTarget->RemoveAurasDueToSpell(SPELL_STONED); - - //clear this, if we are still performing - if (m_bPerformingGroundSlam) - { - m_bPerformingGroundSlam = false; - - //and correct movement, if not already - if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != TARGETED_MOTION_TYPE) - { - if (me->getVictim()) - me->GetMotionMaster()->MoveChase(me->getVictim()); - } - } - } - } - - void UpdateAI(const uint32 uiDiff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - // Growth - // Gruul can cast this spell up to 30 times - if (m_uiGrowth_Timer <= uiDiff) - { - DoScriptText(EMOTE_GROW, me); - DoCast(me, SPELL_GROWTH); - m_uiGrowth_Timer = 30000; - } - else - m_uiGrowth_Timer -= uiDiff; - - if (m_bPerformingGroundSlam) - { - if (m_uiGroundSlamTimer <= uiDiff) - { - m_uiGroundSlamTimer =120000; - m_uiHurtfulStrike_Timer= 8000; - - if (m_uiReverberation_Timer < 10000) //Give a little time to the players to undo the damage from shatter - m_uiReverberation_Timer += 10000; - - DoCast(me, SPELL_SHATTER); - } - else - m_uiGroundSlamTimer -= uiDiff; - } - else - { - // Hurtful Strike - if (m_uiHurtfulStrike_Timer <= uiDiff) - { - Unit *pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO,1); - - if (pTarget && me->IsWithinMeleeRange(me->getVictim())) - DoCast(pTarget, SPELL_HURTFUL_STRIKE); - else - DoCast(me->getVictim(), SPELL_HURTFUL_STRIKE); - - m_uiHurtfulStrike_Timer= 8000; - } - else - m_uiHurtfulStrike_Timer -= uiDiff; - - // Reverberation - if (m_uiReverberation_Timer <= uiDiff) - { - DoCast(me->getVictim(), SPELL_REVERBERATION, true); - m_uiReverberation_Timer = 15000 + rand()%10000; - } - else - m_uiReverberation_Timer -= uiDiff; - - // Cave In - if (m_uiCaveIn_Timer <= uiDiff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(pTarget, SPELL_CAVE_IN); - - if (m_uiCaveIn_StaticTimer >= 4000) - m_uiCaveIn_StaticTimer -= 2000; - - m_uiCaveIn_Timer = m_uiCaveIn_StaticTimer; - } - else - m_uiCaveIn_Timer -= uiDiff; - - // Ground Slam, Gronn Lord's Grasp, Stoned, Shatter - if (m_uiGroundSlamTimer <= uiDiff) - { - me->GetMotionMaster()->Clear(); - me->GetMotionMaster()->MoveIdle(); - - m_bPerformingGroundSlam= true; - m_uiGroundSlamTimer = 10000; - - DoCast(me, SPELL_GROUND_SLAM); - } - else - m_uiGroundSlamTimer -= uiDiff; - - DoMeleeAttackIfReady(); - } - } -}; - -CreatureAI* GetAI_boss_gruul(Creature* pCreature) -{ - return new boss_gruulAI (pCreature); -} - -void AddSC_boss_gruul() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_gruul"; - newscript->GetAI = &GetAI_boss_gruul; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Outland/gruuls_lair/boss_high_king_maulgar.cpp b/src/server/scripts/Outland/gruuls_lair/boss_high_king_maulgar.cpp deleted file mode 100644 index 482af86225c..00000000000 --- a/src/server/scripts/Outland/gruuls_lair/boss_high_king_maulgar.cpp +++ /dev/null @@ -1,783 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_High_King_Maulgar -SD%Complete: 90 -SDComment: Correct timers, after whirlwind melee attack bug, prayer of healing -SDCategory: Gruul's Lair -EndScriptData */ - -#include "ScriptedPch.h" -#include "gruuls_lair.h" - -#define SAY_AGGRO -1565000 -#define SAY_ENRAGE -1565001 -#define SAY_OGRE_DEATH1 -1565002 -#define SAY_OGRE_DEATH2 -1565003 -#define SAY_OGRE_DEATH3 -1565004 -#define SAY_OGRE_DEATH4 -1565005 -#define SAY_SLAY1 -1565006 -#define SAY_SLAY2 -1565007 -#define SAY_SLAY3 -1565008 -#define SAY_DEATH -1565009 - -// High King Maulgar -#define SPELL_ARCING_SMASH 39144 -#define SPELL_MIGHTY_BLOW 33230 -#define SPELL_WHIRLWIND 33238 -#define SPELL_BERSERKER_C 26561 -#define SPELL_ROAR 16508 -#define SPELL_FLURRY 33232 -#define SPELL_DUAL_WIELD 29651 //used in phase - -// Olm the Summoner -#define SPELL_DARK_DECAY 33129 -#define SPELL_DEATH_COIL 33130 -#define SPELL_SUMMON_WFH 33131 - -//Kiggler the Craed -#define SPELL_GREATER_POLYMORPH 33173 -#define SPELL_LIGHTNING_BOLT 36152 -#define SPELL_ARCANE_SHOCK 33175 -#define SPELL_ARCANE_EXPLOSION 33237 - -//Blindeye the Seer -#define SPELL_GREATER_PW_SHIELD 33147 -#define SPELL_HEAL 33144 -#define SPELL_PRAYER_OH 33152 - -//Krosh Firehand -#define SPELL_GREATER_FIREBALL 33051 -#define SPELL_SPELLSHIELD 33054 -#define SPELL_BLAST_WAVE 33061 - -bool CheckAllBossDied(ScriptedInstance* pInstance, Creature* me) -{ - if (!pInstance || !me) - return false; - - uint64 MaulgarGUID = 0; - uint64 KigglerGUID = 0; - uint64 BlindeyeGUID = 0; - uint64 OlmGUID = 0; - uint64 KroshGUID = 0; - - Creature* Maulgar = NULL; - Creature* Kiggler = NULL; - Creature* Blindeye = NULL; - Creature* Olm = NULL; - Creature* Krosh = NULL; - - MaulgarGUID = pInstance->GetData64(DATA_MAULGAR); - KigglerGUID = pInstance->GetData64(DATA_KIGGLERTHECRAZED); - BlindeyeGUID = pInstance->GetData64(DATA_BLINDEYETHESEER); - OlmGUID = pInstance->GetData64(DATA_OLMTHESUMMONER); - KroshGUID = pInstance->GetData64(DATA_KROSHFIREHAND); - - Maulgar = (Unit::GetCreature((*me), MaulgarGUID)); - Kiggler = (Unit::GetCreature((*me), KigglerGUID)); - Blindeye = (Unit::GetCreature((*me), BlindeyeGUID)); - Olm = (Unit::GetCreature((*me), OlmGUID)); - Krosh = (Unit::GetCreature((*me), KroshGUID)); - - if (!Maulgar || !Kiggler || !Blindeye || !Olm || !Krosh) - return false; - - if (!Maulgar->isAlive() && !Kiggler->isAlive() && !Blindeye->isAlive() && !Olm->isAlive() && !Krosh->isAlive()) - return true; - - return false; -} - -//High King Maulgar AI -struct boss_high_king_maulgarAI : public ScriptedAI -{ - boss_high_king_maulgarAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - for (uint8 i = 0; i < 4; ++i) - Council[i] = 0; - } - - ScriptedInstance* pInstance; - - uint32 ArcingSmash_Timer; - uint32 MightyBlow_Timer; - uint32 Whirlwind_Timer; - uint32 Charging_Timer; - uint32 Roar_Timer; - - bool Phase2; - - uint64 Council[4]; - - void Reset() - { - ArcingSmash_Timer = 10000; - MightyBlow_Timer = 40000; - Whirlwind_Timer = 30000; - Charging_Timer = 0; - Roar_Timer = 0; - - DoCast(me, SPELL_DUAL_WIELD, false); - - Phase2 = false; - - Creature *pCreature = NULL; - for (uint8 i = 0; i < 4; ++i) - { - if (Council[i]) - { - pCreature = (Unit::GetCreature((*me), Council[i])); - if (pCreature && !pCreature->isAlive()) - { - pCreature->Respawn(); - pCreature->AI()->EnterEvadeMode(); - } - } - } - - //reset encounter - if (pInstance) - pInstance->SetData(DATA_MAULGAREVENT, NOT_STARTED); - } - - void KilledUnit() - { - DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), me); - } - - void JustDied(Unit* /*Killer*/) - { - DoScriptText(SAY_DEATH, me); - - if (CheckAllBossDied(pInstance, me)) - pInstance->SetData(DATA_MAULGAREVENT, DONE); - } - - void AddDeath() - { - DoScriptText(RAND(SAY_OGRE_DEATH1,SAY_OGRE_DEATH2,SAY_OGRE_DEATH3,SAY_OGRE_DEATH4), me); - } - - void EnterCombat(Unit *who) - { - StartEvent(who); - } - - void GetCouncil() - { - if (pInstance) - { - //get council member's guid to respawn them if needed - Council[0] = pInstance->GetData64(DATA_KIGGLERTHECRAZED); - Council[1] = pInstance->GetData64(DATA_BLINDEYETHESEER); - Council[2] = pInstance->GetData64(DATA_OLMTHESUMMONER); - Council[3] = pInstance->GetData64(DATA_KROSHFIREHAND); - } - } - - void StartEvent(Unit *who) - { - if (!pInstance) - return; - - GetCouncil(); - - DoScriptText(SAY_AGGRO, me); - - pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID()); - pInstance->SetData(DATA_MAULGAREVENT, IN_PROGRESS); - - DoZoneInCombat(); - } - - void UpdateAI(const uint32 diff) - { - //Only if not incombat check if the event is started - if (!me->isInCombat() && pInstance && pInstance->GetData(DATA_MAULGAREVENT)) - { - Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_MAULGAREVENT_TANK)); - - if (pTarget) - { - AttackStart(pTarget); - GetCouncil(); - } - } - - //Return since we have no target - if (!UpdateVictim()) - return; - - //someone evaded! - if (pInstance && !pInstance->GetData(DATA_MAULGAREVENT)) - { - EnterEvadeMode(); - return; - } - - //ArcingSmash_Timer - if (ArcingSmash_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_ARCING_SMASH); - ArcingSmash_Timer = 10000; - } else ArcingSmash_Timer -= diff; - - //Whirlwind_Timer - if (Whirlwind_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_WHIRLWIND); - Whirlwind_Timer = 55000; - } else Whirlwind_Timer -= diff; - - //MightyBlow_Timer - if (MightyBlow_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_MIGHTY_BLOW); - MightyBlow_Timer = 30000+rand()%10000; - } else MightyBlow_Timer -= diff; - - //Entering Phase 2 - if (!Phase2 && (me->GetHealth()*100 / me->GetMaxHealth()) < 50) - { - Phase2 = true; - DoScriptText(SAY_ENRAGE, me); - - DoCast(me, SPELL_DUAL_WIELD, true); - me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 0); - me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0); - } - - if (Phase2) - { - //Charging_Timer - if (Charging_Timer <= diff) - { - Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (pTarget) - { - AttackStart(pTarget); - DoCast(pTarget, SPELL_BERSERKER_C); - } - Charging_Timer = 20000; - } else Charging_Timer -= diff; - - //Intimidating Roar - if (Roar_Timer <= diff) - { - DoCast(me, SPELL_ROAR); - Roar_Timer = 40000+(rand()%10000); - } else Roar_Timer -= diff; - } - - DoMeleeAttackIfReady(); - } -}; - -//Olm The Summoner AI -struct boss_olm_the_summonerAI : public ScriptedAI -{ - boss_olm_the_summonerAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - uint32 DarkDecay_Timer; - uint32 Summon_Timer; - uint32 DeathCoil_Timer; - - ScriptedInstance* pInstance; - - void Reset() - { - DarkDecay_Timer = 10000; - Summon_Timer = 15000; - DeathCoil_Timer = 20000; - - //reset encounter - if (pInstance) - pInstance->SetData(DATA_MAULGAREVENT, NOT_STARTED); - } - - void AttackStart(Unit* pWho) - { - if (!pWho) - return; - - if (me->Attack(pWho, true)) - { - me->AddThreat(pWho, 0.0f); - me->SetInCombatWith(pWho); - pWho->SetInCombatWith(me); - - me->GetMotionMaster()->MoveChase(pWho, 30.0f); - } - } - - void EnterCombat(Unit *who) - { - if (pInstance) - { - pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID()); - pInstance->SetData(DATA_MAULGAREVENT, IN_PROGRESS); - } - } - - void JustDied(Unit* /*Killer*/) - { - if (pInstance) - { - Creature *Maulgar = NULL; - Maulgar = (Unit::GetCreature((*me), pInstance->GetData64(DATA_MAULGAR))); - - if (Maulgar) - CAST_AI(boss_high_king_maulgarAI, Maulgar->AI())->AddDeath(); - - if (CheckAllBossDied(pInstance, me)) - pInstance->SetData(DATA_MAULGAREVENT, DONE); - } - } - - void UpdateAI(const uint32 diff) - { - //Only if not incombat check if the event is started - if (!me->isInCombat() && pInstance && pInstance->GetData(DATA_MAULGAREVENT)) - { - Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_MAULGAREVENT_TANK)); - - if (pTarget) - { - AttackStart(pTarget); - } - } - - //Return since we have no target - if (!UpdateVictim()) - return; - - //someone evaded! - if (pInstance && !pInstance->GetData(DATA_MAULGAREVENT)) - { - EnterEvadeMode(); - return; - } - - //DarkDecay_Timer - if (DarkDecay_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_DARK_DECAY); - DarkDecay_Timer = 20000; - } else DarkDecay_Timer -= diff; - - //Summon_Timer - if (Summon_Timer <= diff) - { - DoCast(me, SPELL_SUMMON_WFH); - Summon_Timer = 30000; - } else Summon_Timer -= diff; - - //DeathCoil Timer /need correct timer - if (DeathCoil_Timer <= diff) - { - Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (pTarget) - DoCast(pTarget, SPELL_DEATH_COIL); - DeathCoil_Timer = 20000; - } else DeathCoil_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -//Kiggler The Crazed AI -struct boss_kiggler_the_crazedAI : public ScriptedAI -{ - boss_kiggler_the_crazedAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - uint32 GreaterPolymorph_Timer; - uint32 LightningBolt_Timer; - uint32 ArcaneShock_Timer; - uint32 ArcaneExplosion_Timer; - - ScriptedInstance* pInstance; - - void Reset() - { - GreaterPolymorph_Timer = 5000; - LightningBolt_Timer = 10000; - ArcaneShock_Timer = 20000; - ArcaneExplosion_Timer = 30000; - - //reset encounter - if (pInstance) - pInstance->SetData(DATA_MAULGAREVENT, NOT_STARTED); - } - - void EnterCombat(Unit* who) - { - if (pInstance) - { - pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID()); - pInstance->SetData(DATA_MAULGAREVENT, IN_PROGRESS); - } - } - - void JustDied(Unit* /*Killer*/) - { - if (pInstance) - { - Creature *Maulgar = NULL; - Maulgar = (Unit::GetCreature((*me), pInstance->GetData64(DATA_MAULGAR))); - - if (Maulgar) - CAST_AI(boss_high_king_maulgarAI, Maulgar->AI())->AddDeath(); - - if (CheckAllBossDied(pInstance, me)) - pInstance->SetData(DATA_MAULGAREVENT, DONE); - } - } - - void UpdateAI(const uint32 diff) - { - //Only if not incombat check if the event is started - if (!me->isInCombat() && pInstance && pInstance->GetData(DATA_MAULGAREVENT)) - { - Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_MAULGAREVENT_TANK)); - - if (pTarget) - { - AttackStart(pTarget); - } - } - - //Return since we have no target - if (!UpdateVictim()) - return; - - //someone evaded! - if (pInstance && !pInstance->GetData(DATA_MAULGAREVENT)) - { - EnterEvadeMode(); - return; - } - - //GreaterPolymorph_Timer - if (GreaterPolymorph_Timer <= diff) - { - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (pTarget) - DoCast(pTarget, SPELL_GREATER_POLYMORPH); - - GreaterPolymorph_Timer = 15000 + rand()%5000; - } else GreaterPolymorph_Timer -= diff; - - //LightningBolt_Timer - if (LightningBolt_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_LIGHTNING_BOLT); - LightningBolt_Timer = 15000; - } else LightningBolt_Timer -= diff; - - //ArcaneShock_Timer - if (ArcaneShock_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_ARCANE_SHOCK); - ArcaneShock_Timer = 20000; - } else ArcaneShock_Timer -= diff; - - //ArcaneExplosion_Timer - if (ArcaneExplosion_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_ARCANE_EXPLOSION); - ArcaneExplosion_Timer = 30000; - } else ArcaneExplosion_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -//Blindeye The Seer AI -struct boss_blindeye_the_seerAI : public ScriptedAI -{ - boss_blindeye_the_seerAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - uint32 GreaterPowerWordShield_Timer; - uint32 Heal_Timer; - uint32 PrayerofHealing_Timer; - - ScriptedInstance* pInstance; - - void Reset() - { - GreaterPowerWordShield_Timer = 5000; - Heal_Timer = 25000 + rand()%15000; - PrayerofHealing_Timer = 45000 + rand()%10000; - - //reset encounter - if (pInstance) - pInstance->SetData(DATA_MAULGAREVENT, NOT_STARTED); - } - - void EnterCombat(Unit * who) - { - if (pInstance) - { - pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID()); - pInstance->SetData(DATA_MAULGAREVENT, IN_PROGRESS); - } - } - - void JustDied(Unit* /*Killer*/) - { - if (pInstance) - { - Creature *Maulgar = NULL; - Maulgar = (Unit::GetCreature((*me), pInstance->GetData64(DATA_MAULGAR))); - - if (Maulgar) - CAST_AI(boss_high_king_maulgarAI, Maulgar->AI())->AddDeath(); - - if (CheckAllBossDied(pInstance, me)) - pInstance->SetData(DATA_MAULGAREVENT, DONE); - } - } - - void UpdateAI(const uint32 diff) - { - //Only if not incombat check if the event is started - if (!me->isInCombat() && pInstance && pInstance->GetData(DATA_MAULGAREVENT)) - { - Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_MAULGAREVENT_TANK)); - - if (pTarget) - { - AttackStart(pTarget); - } - } - - //Return since we have no target - if (!UpdateVictim()) - return; - - //someone evaded! - if (pInstance && !pInstance->GetData(DATA_MAULGAREVENT)) - { - EnterEvadeMode(); - return; - } - - //GreaterPowerWordShield_Timer - if (GreaterPowerWordShield_Timer <= diff) - { - DoCast(me, SPELL_GREATER_PW_SHIELD); - GreaterPowerWordShield_Timer = 40000; - } else GreaterPowerWordShield_Timer -= diff; - - //Heal_Timer - if (Heal_Timer <= diff) - { - DoCast(me, SPELL_HEAL); - Heal_Timer = 15000 + rand()%25000; - } else Heal_Timer -= diff; - - //PrayerofHealing_Timer - if (PrayerofHealing_Timer <= diff) - { - DoCast(me, SPELL_PRAYER_OH); - PrayerofHealing_Timer = 35000 + rand()%15000; - } else PrayerofHealing_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -//Krosh Firehand AI -struct boss_krosh_firehandAI : public ScriptedAI -{ - boss_krosh_firehandAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - uint32 GreaterFireball_Timer; - uint32 SpellShield_Timer; - uint32 BlastWave_Timer; - - ScriptedInstance* pInstance; - - void Reset() - { - GreaterFireball_Timer = 1000; - SpellShield_Timer = 5000; - BlastWave_Timer = 20000; - - //reset encounter - if (pInstance) - pInstance->SetData(DATA_MAULGAREVENT, NOT_STARTED); - } - - void EnterCombat(Unit * who) - { - if (pInstance) - { - pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID()); - pInstance->SetData(DATA_MAULGAREVENT, IN_PROGRESS); - } - } - - void JustDied(Unit* /*Killer*/) - { - if (pInstance) - { - Creature *Maulgar = NULL; - Maulgar = (Unit::GetCreature((*me), pInstance->GetData64(DATA_MAULGAR))); - - if (Maulgar) - CAST_AI(boss_high_king_maulgarAI, Maulgar->AI())->AddDeath(); - - if (CheckAllBossDied(pInstance, me)) - pInstance->SetData(DATA_MAULGAREVENT, DONE); - } - } - - void UpdateAI(const uint32 diff) - { - //Only if not incombat check if the event is started - if (!me->isInCombat() && pInstance && pInstance->GetData(DATA_MAULGAREVENT)) - { - Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_MAULGAREVENT_TANK)); - - if (pTarget) - { - AttackStart(pTarget); - } - } - - //Return since we have no target - if (!UpdateVictim()) - return; - - //someone evaded! - if (pInstance && !pInstance->GetData(DATA_MAULGAREVENT)) - { - EnterEvadeMode(); - return; - } - - //GreaterFireball_Timer - if (GreaterFireball_Timer < diff || me->IsWithinDist(me->getVictim(), 30)) - { - DoCast(me->getVictim(), SPELL_GREATER_FIREBALL); - GreaterFireball_Timer = 2000; - } else GreaterFireball_Timer -= diff; - - //SpellShield_Timer - if (SpellShield_Timer <= diff) - { - me->InterruptNonMeleeSpells(false); - DoCast(me->getVictim(), SPELL_SPELLSHIELD); - SpellShield_Timer = 30000; - } else SpellShield_Timer -= diff; - - //BlastWave_Timer - if (BlastWave_Timer <= diff) - { - Unit *pTarget = NULL; - std::list t_list = me->getThreatManager().getThreatList(); - std::vector target_list; - for (std::list::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) - { - pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid()); - //15 yard radius minimum - if (pTarget && pTarget->IsWithinDist(me, 15,false)) - target_list.push_back(pTarget); - pTarget = NULL; - } - if (target_list.size()) - pTarget = *(target_list.begin()+rand()%target_list.size()); - - me->InterruptNonMeleeSpells(false); - DoCast(pTarget, SPELL_BLAST_WAVE); - BlastWave_Timer = 60000; - } else BlastWave_Timer -= diff; - } -}; - -CreatureAI* GetAI_boss_high_king_maulgar(Creature* pCreature) -{ - return new boss_high_king_maulgarAI (pCreature); -} - -CreatureAI* GetAI_boss_olm_the_summoner(Creature* pCreature) -{ - return new boss_olm_the_summonerAI (pCreature); -} - -CreatureAI *GetAI_boss_kiggler_the_crazed(Creature* pCreature) -{ - return new boss_kiggler_the_crazedAI (pCreature); -} - -CreatureAI *GetAI_boss_blindeye_the_seer(Creature* pCreature) -{ - return new boss_blindeye_the_seerAI (pCreature); -} - -CreatureAI *GetAI_boss_krosh_firehand(Creature* pCreature) -{ - return new boss_krosh_firehandAI (pCreature); -} - -void AddSC_boss_high_king_maulgar() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "boss_high_king_maulgar"; - newscript->GetAI = &GetAI_boss_high_king_maulgar; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_kiggler_the_crazed"; - newscript->GetAI = &GetAI_boss_kiggler_the_crazed; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_blindeye_the_seer"; - newscript->GetAI = &GetAI_boss_blindeye_the_seer; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_olm_the_summoner"; - newscript->GetAI = &GetAI_boss_olm_the_summoner; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_krosh_firehand"; - newscript->GetAI = &GetAI_boss_krosh_firehand; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Outland/gruuls_lair/gruuls_lair.h b/src/server/scripts/Outland/gruuls_lair/gruuls_lair.h deleted file mode 100644 index 7003dcb1e26..00000000000 --- a/src/server/scripts/Outland/gruuls_lair/gruuls_lair.h +++ /dev/null @@ -1,21 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ - -#ifndef DEF_GRUULS_LAIR_H -#define DEF_GRUULS_LAIR_H - -#define DATA_BLINDEYETHESEER 1 -#define DATA_GRUULEVENT 2 -#define DATA_KIGGLERTHECRAZED 3 -#define DATA_KROSHFIREHAND 4 -#define DATA_MAULGAREVENT 5 -#define DATA_MAULGAREVENT_TANK 6 -#define DATA_OLMTHESUMMONER 7 -#define DATA_MAULGARDOOR 8 -#define DATA_GRUULDOOR 9 -#define DATA_MAULGAR 10 - -#define ERROR_INST_DATA "TSCR Error: Instance Data not set properly for Gruul's Lair instance (map 565). Encounters will be buggy." -#endif - diff --git a/src/server/scripts/Outland/gruuls_lair/instance_gruuls_lair.cpp b/src/server/scripts/Outland/gruuls_lair/instance_gruuls_lair.cpp deleted file mode 100644 index bb790a5d4ea..00000000000 --- a/src/server/scripts/Outland/gruuls_lair/instance_gruuls_lair.cpp +++ /dev/null @@ -1,193 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Instance_Gruuls_Lair -SD%Complete: 100 -SDComment: -SDCategory: Gruul's Lair -EndScriptData */ - -#include "ScriptedPch.h" -#include "gruuls_lair.h" - -#define MAX_ENCOUNTER 2 - -/* Gruuls Lair encounters: -1 - High King Maulgar event -2 - Gruul event -*/ - -struct instance_gruuls_lair : public ScriptedInstance -{ - instance_gruuls_lair(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - - uint64 MaulgarEvent_Tank; - uint64 KigglerTheCrazed; - uint64 BlindeyeTheSeer; - uint64 OlmTheSummoner; - uint64 KroshFirehand; - uint64 Maulgar; - - uint64 MaulgarDoor; - uint64 GruulDoor; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - MaulgarEvent_Tank = 0; - KigglerTheCrazed = 0; - BlindeyeTheSeer = 0; - OlmTheSummoner = 0; - KroshFirehand = 0; - Maulgar = 0; - - MaulgarDoor = 0; - GruulDoor = 0; - } - - bool IsEncounterInProgress() const - { - for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) return true; - - return false; - } - - void OnCreatureCreate(Creature* pCreature, bool /*add*/) - { - switch(pCreature->GetEntry()) - { - case 18835: KigglerTheCrazed = pCreature->GetGUID(); break; - case 18836: BlindeyeTheSeer = pCreature->GetGUID(); break; - case 18834: OlmTheSummoner = pCreature->GetGUID(); break; - case 18832: KroshFirehand = pCreature->GetGUID(); break; - case 18831: Maulgar = pCreature->GetGUID(); break; - } - } - - void OnGameObjectCreate(GameObject* pGo, bool /*add*/) - { - switch(pGo->GetEntry()) - { - case 184468: - MaulgarDoor = pGo->GetGUID(); - if (m_auiEncounter[0] == DONE) HandleGameObject(NULL, true, pGo); - break; - case 184662: GruulDoor = pGo->GetGUID(); break; - } - } - - void SetData64(uint32 type, uint64 data) - { - if (type == DATA_MAULGAREVENT_TANK) - MaulgarEvent_Tank = data; - } - - uint64 GetData64(uint32 identifier) - { - switch(identifier) - { - case DATA_MAULGAREVENT_TANK: return MaulgarEvent_Tank; - case DATA_KIGGLERTHECRAZED: return KigglerTheCrazed; - case DATA_BLINDEYETHESEER: return BlindeyeTheSeer; - case DATA_OLMTHESUMMONER: return OlmTheSummoner; - case DATA_KROSHFIREHAND: return KroshFirehand; - case DATA_MAULGARDOOR: return MaulgarDoor; - case DATA_GRUULDOOR: return GruulDoor; - case DATA_MAULGAR: return Maulgar; - } - return 0; - } - - void SetData(uint32 type, uint32 data) - { - switch(type) - { - case DATA_MAULGAREVENT: - if (data == DONE) HandleGameObject(MaulgarDoor, true); - m_auiEncounter[0] = data; break; - case DATA_GRUULEVENT: - if (data == IN_PROGRESS) HandleGameObject(GruulDoor, false); - else HandleGameObject(GruulDoor, true); - m_auiEncounter[1] = data; break; - } - - if (data == DONE) - SaveToDB(); - } - - uint32 GetData(uint32 type) - { - switch(type) - { - case DATA_MAULGAREVENT: return m_auiEncounter[0]; - case DATA_GRUULEVENT: return m_auiEncounter[1]; - } - return 0; - } - - std::string GetSaveData() - { - OUT_SAVE_INST_DATA; - std::ostringstream stream; - stream << m_auiEncounter[0] << " " << m_auiEncounter[1]; - char* out = new char[stream.str().length() + 1]; - strcpy(out, stream.str().c_str()); - if (out) - { - OUT_SAVE_INST_DATA_COMPLETE; - return out; - } - - return NULL; - } - - void Load(const char* in) - { - if (!in) - { - OUT_LOAD_INST_DATA_FAIL; - return; - } - - OUT_LOAD_INST_DATA(in); - std::istringstream stream(in); - stream >> m_auiEncounter[0] >> m_auiEncounter[1]; - for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) // Do not load an encounter as "In Progress" - reset it instead. - m_auiEncounter[i] = NOT_STARTED; - OUT_LOAD_INST_DATA_COMPLETE; - } -}; - -InstanceData* GetInstanceData_instance_gruuls_lair(Map* pMap) -{ - return new instance_gruuls_lair(pMap); -} - -void AddSC_instance_gruuls_lair() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_gruuls_lair"; - newscript->GetInstanceData = &GetInstanceData_instance_gruuls_lair; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Outland/hellfire_citadel/blood_furnace/blood_furnace.h b/src/server/scripts/Outland/hellfire_citadel/blood_furnace/blood_furnace.h deleted file mode 100644 index b845c66823f..00000000000 --- a/src/server/scripts/Outland/hellfire_citadel/blood_furnace/blood_furnace.h +++ /dev/null @@ -1,29 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ - -#ifndef DEF_BLOOD_FURNACE_H -#define DEF_BLOOD_FURNACE_H - -#define DATA_THE_MAKER 1 -#define DATA_BROGGOK 2 -#define DATA_KELIDAN_THE_MAKER 3 -#define TYPE_THE_MAKER_EVENT 4 -#define TYPE_BROGGOK_EVENT 5 -#define TYPE_KELIDAN_THE_BREAKER_EVENT 6 -#define DATA_DOOR1 7 -#define DATA_DOOR2 8 -#define DATA_DOOR3 9 -#define DATA_DOOR4 10 -#define DATA_DOOR5 11 -#define DATA_DOOR6 12 -#define DATA_PRISON_CELL1 13 -#define DATA_PRISON_CELL2 14 -#define DATA_PRISON_CELL3 15 -#define DATA_PRISON_CELL4 16 -#define DATA_PRISON_CELL5 17 -#define DATA_PRISON_CELL6 18 -#define DATA_PRISON_CELL7 19 -#define DATA_PRISON_CELL8 20 -#endif - diff --git a/src/server/scripts/Outland/hellfire_citadel/blood_furnace/boss_broggok.cpp b/src/server/scripts/Outland/hellfire_citadel/blood_furnace/boss_broggok.cpp deleted file mode 100644 index d5fb9bdba49..00000000000 --- a/src/server/scripts/Outland/hellfire_citadel/blood_furnace/boss_broggok.cpp +++ /dev/null @@ -1,131 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Broggok -SD%Complete: 70 -SDComment: pre-event not made -SDCategory: Hellfire Citadel, Blood Furnace -EndScriptData */ - -#include "ScriptedPch.h" -#include "blood_furnace.h" - -enum eEnums -{ - SAY_AGGRO = -1542008, - - SPELL_SLIME_SPRAY = 30913, - SPELL_POISON_CLOUD = 30916, - SPELL_POISON_BOLT = 30917, - - SPELL_POISON = 30914 -}; - -struct boss_broggokAI : public ScriptedAI -{ - boss_broggokAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint32 AcidSpray_Timer; - uint32 PoisonSpawn_Timer; - uint32 PoisonBolt_Timer; - - void Reset() - { - AcidSpray_Timer = 10000; - PoisonSpawn_Timer = 5000; - PoisonBolt_Timer = 7000; - if (pInstance) - { - pInstance->SetData(TYPE_BROGGOK_EVENT, NOT_STARTED); - pInstance->HandleGameObject(pInstance->GetData64(DATA_DOOR4), true); - } - } - - void EnterCombat(Unit * /*who*/) - { - DoScriptText(SAY_AGGRO, me); - if (pInstance) - { - pInstance->SetData(TYPE_BROGGOK_EVENT, IN_PROGRESS); - pInstance->HandleGameObject(pInstance->GetData64(DATA_DOOR4), false); - } - } - - void JustSummoned(Creature *summoned) - { - summoned->setFaction(16); - summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - summoned->CastSpell(summoned,SPELL_POISON,false,0,0,me->GetGUID()); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (AcidSpray_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SLIME_SPRAY); - AcidSpray_Timer = 4000+rand()%8000; - } else AcidSpray_Timer -=diff; - - if (PoisonBolt_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_POISON_BOLT); - PoisonBolt_Timer = 4000+rand()%8000; - } else PoisonBolt_Timer -=diff; - - if (PoisonSpawn_Timer <= diff) - { - DoCast(me, SPELL_POISON_CLOUD); - PoisonSpawn_Timer = 20000; - } else PoisonSpawn_Timer -=diff; - - DoMeleeAttackIfReady(); - } - - void JustDied(Unit* /*who*/) - { - if (pInstance) - { - pInstance->HandleGameObject(pInstance->GetData64(DATA_DOOR4), true); - pInstance->HandleGameObject(pInstance->GetData64(DATA_DOOR5), true); - pInstance->SetData(TYPE_BROGGOK_EVENT, DONE); - } - } - -}; - -CreatureAI* GetAI_boss_broggok(Creature* pCreature) -{ - return new boss_broggokAI (pCreature); -} - -void AddSC_boss_broggok() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_broggok"; - newscript->GetAI = &GetAI_boss_broggok; - newscript->RegisterSelf(); -} diff --git a/src/server/scripts/Outland/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp b/src/server/scripts/Outland/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp deleted file mode 100644 index a44ad9cc3c8..00000000000 --- a/src/server/scripts/Outland/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp +++ /dev/null @@ -1,356 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Kelidan_The_Breaker -SD%Complete: 100 -SDComment: -SDCategory: Hellfire Citadel, Blood Furnace -EndScriptData */ - -/* ContentData -boss_kelidan_the_breaker -mob_shadowmoon_channeler -EndContentData */ - -#include "ScriptedPch.h" -#include "blood_furnace.h" - -enum eKelidan -{ - SAY_WAKE = -1542000, - SAY_ADD_AGGRO_1 = -1542001, - SAY_ADD_AGGRO_2 = -1542002, - SAY_ADD_AGGRO_3 = -1542003, - SAY_KILL_1 = -1542004, - SAY_KILL_2 = -1542005, - SAY_NOVA = -1542006, - SAY_DIE = -1542007, - - SPELL_CORRUPTION = 30938, - SPELL_EVOCATION = 30935, - - SPELL_FIRE_NOVA = 33132, - H_SPELL_FIRE_NOVA = 37371, - - SPELL_SHADOW_BOLT_VOLLEY = 28599, - H_SPELL_SHADOW_BOLT_VOLLEY = 40070, - - SPELL_BURNING_NOVA = 30940, - SPELL_VORTEX = 37370, - - ENTRY_KELIDAN = 17377, - ENTRY_CHANNELER = 17653 -}; - -const float ShadowmoonChannelers[5][4]= -{ - {302,-87,-24.4,0.157}, - {321,-63.5,-24.6,4.887}, - {346,-74.5,-24.6,3.595}, - {344,-103.5,-24.5,2.356}, - {316,-109,-24.6,1.257} -}; - -struct boss_kelidan_the_breakerAI : public ScriptedAI -{ - boss_kelidan_the_breakerAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - for (uint8 i=0; i<5; ++i) - Channelers[i] = 0; - } - - ScriptedInstance* pInstance; - - uint32 ShadowVolley_Timer; - uint32 BurningNova_Timer; - uint32 Firenova_Timer; - uint32 Corruption_Timer; - uint32 check_Timer; - bool Firenova; - bool addYell; - uint64 Channelers[5]; - - void Reset() - { - ShadowVolley_Timer = 1000; - BurningNova_Timer = 15000; - Corruption_Timer = 5000; - check_Timer = 0; - Firenova = false; - addYell = false; - SummonChannelers(); - if (pInstance) - pInstance->SetData(TYPE_KELIDAN_THE_BREAKER_EVENT, NOT_STARTED); - } - - void EnterCombat(Unit* who) - { - DoScriptText(SAY_WAKE, me); - if (me->IsNonMeleeSpellCasted(false)) - me->InterruptNonMeleeSpells(true); - DoStartMovement(who); - if (pInstance) - pInstance->SetData(TYPE_KELIDAN_THE_BREAKER_EVENT, IN_PROGRESS); - } - - void KilledUnit(Unit* /*victim*/) - { - if (rand()%2) - return; - - DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2), me); - } - - void ChannelerEngaged(Unit* who) - { - if (who && !addYell) - { - addYell = true; - DoScriptText(RAND(SAY_ADD_AGGRO_1,SAY_ADD_AGGRO_2,SAY_ADD_AGGRO_3), me); - } - for (uint8 i=0; i<5; ++i) - { - Creature *channeler = Unit::GetCreature(*me, Channelers[i]); - if (who && channeler && !channeler->isInCombat()) - channeler->AI()->AttackStart(who); - } - } - - void ChannelerDied(Unit* killer) - { - for (uint8 i=0; i<5; ++i) - { - Creature *channeler = Unit::GetCreature(*me, Channelers[i]); - if (channeler && channeler->isAlive()) - return; - } - - if (killer) - me->AI()->AttackStart(killer); - } - - uint64 GetChanneled(Creature *channeler1) - { - SummonChannelers(); - if (!channeler1) return NULL; - uint8 i; - for (i=0; i<5; ++i) - { - Creature *channeler = Unit::GetCreature(*me, Channelers[i]); - if (channeler && channeler->GetGUID() == channeler1->GetGUID()) - break; - } - return Channelers[(i+2)%5]; - } - - void SummonChannelers() - { - for (uint8 i=0; i<5; ++i) - { - Creature *channeler = Unit::GetCreature(*me, Channelers[i]); - if (!channeler || channeler->isDead()) - channeler = me->SummonCreature(ENTRY_CHANNELER,ShadowmoonChannelers[i][0],ShadowmoonChannelers[i][1],ShadowmoonChannelers[i][2],ShadowmoonChannelers[i][3],TEMPSUMMON_CORPSE_TIMED_DESPAWN,300000); - if (channeler) - Channelers[i] = channeler->GetGUID(); - else - Channelers[i] = 0; - } - } - - void JustDied(Unit* /*Killer*/) - { - DoScriptText(SAY_DIE, me); - - if (!pInstance) - return; - - pInstance->SetData(TYPE_KELIDAN_THE_BREAKER_EVENT, DONE); - pInstance->HandleGameObject(pInstance->GetData64(DATA_DOOR1), true); - pInstance->HandleGameObject(pInstance->GetData64(DATA_DOOR6), true); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - { - if (check_Timer <= diff) - { - if (!me->IsNonMeleeSpellCasted(false)) - DoCast(me, SPELL_EVOCATION); - check_Timer = 5000; - } else check_Timer -= diff; - return; - } - - if (Firenova) - { - if (Firenova_Timer <= diff) - { - DoCast(me, SPELL_FIRE_NOVA, true); - Firenova = false; - ShadowVolley_Timer = 2000; - } else Firenova_Timer -=diff; - - return; - } - - if (ShadowVolley_Timer <= diff) - { - DoCast(me, SPELL_SHADOW_BOLT_VOLLEY); - ShadowVolley_Timer = 5000+rand()%8000; - } else ShadowVolley_Timer -=diff; - - if (Corruption_Timer <= diff) - { - DoCast(me, SPELL_CORRUPTION); - Corruption_Timer = 30000+rand()%20000; - } else Corruption_Timer -=diff; - - if (BurningNova_Timer <= diff) - { - if (me->IsNonMeleeSpellCasted(false)) - me->InterruptNonMeleeSpells(true); - - DoScriptText(SAY_NOVA, me); - - if (SpellEntry *nova = GET_SPELL(SPELL_BURNING_NOVA)) - { - if (Aura * aura = Aura::TryCreate(nova, me, me)) - aura->ApplyForTargets(); - } - - if (IsHeroic()) - DoTeleportAll(me->GetPositionX(),me->GetPositionY(),me->GetPositionZ(),me->GetOrientation()); - - BurningNova_Timer = 20000+rand()%8000; - Firenova_Timer= 5000; - Firenova = true; - } else BurningNova_Timer -=diff; - - DoMeleeAttackIfReady(); - } - -}; - -CreatureAI* GetAI_boss_kelidan_the_breaker(Creature* pCreature) -{ - return new boss_kelidan_the_breakerAI (pCreature); -} - -/*###### -## mob_shadowmoon_channeler -######*/ - -enum eShadowmoon -{ - SPELL_SHADOW_BOLT = 12739, - H_SPELL_SHADOW_BOLT = 15472, - - SPELL_MARK_OF_SHADOW = 30937, - SPELL_CHANNELING = 39123 -}; - -struct mob_shadowmoon_channelerAI : public ScriptedAI -{ - mob_shadowmoon_channelerAI(Creature *c) : ScriptedAI(c) - { - } - - uint32 ShadowBolt_Timer; - uint32 MarkOfShadow_Timer; - uint32 check_Timer; - - void Reset() - { - ShadowBolt_Timer = 1000+rand()%1000; - MarkOfShadow_Timer = 5000+rand()%2000; - check_Timer = 0; - if (me->IsNonMeleeSpellCasted(false)) - me->InterruptNonMeleeSpells(true); - } - - void EnterCombat(Unit* who) - { - if (Creature *Kelidan = me->FindNearestCreature(ENTRY_KELIDAN, 100)) - CAST_AI(boss_kelidan_the_breakerAI, Kelidan->AI())->ChannelerEngaged(who); - if (me->IsNonMeleeSpellCasted(false)) - me->InterruptNonMeleeSpells(true); - DoStartMovement(who); - } - - void JustDied(Unit* Killer) - { - if (Creature *Kelidan = me->FindNearestCreature(ENTRY_KELIDAN, 100)) - CAST_AI(boss_kelidan_the_breakerAI, Kelidan->AI())->ChannelerDied(Killer); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - { - if (check_Timer <= diff) - { - if (!me->IsNonMeleeSpellCasted(false)) - if (Creature *Kelidan = me->FindNearestCreature(ENTRY_KELIDAN, 100)) - { - uint64 channeler = CAST_AI(boss_kelidan_the_breakerAI, Kelidan->AI())->GetChanneled(me); - if (Unit *channeled = Unit::GetUnit(*me, channeler)) - DoCast(channeled, SPELL_CHANNELING); - } - check_Timer = 5000; - } else check_Timer -= diff; - return; - } - - if (MarkOfShadow_Timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(pTarget, SPELL_MARK_OF_SHADOW); - MarkOfShadow_Timer = 15000+rand()%5000; - } else MarkOfShadow_Timer -=diff; - - if (ShadowBolt_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SHADOW_BOLT); - ShadowBolt_Timer = 5000+rand()%1000; - } else ShadowBolt_Timer -=diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_shadowmoon_channeler(Creature* pCreature) -{ - return new mob_shadowmoon_channelerAI (pCreature); -} - -void AddSC_boss_kelidan_the_breaker() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "boss_kelidan_the_breaker"; - newscript->GetAI = &GetAI_boss_kelidan_the_breaker; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_shadowmoon_channeler"; - newscript->GetAI = &GetAI_mob_shadowmoon_channeler; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Outland/hellfire_citadel/blood_furnace/boss_the_maker.cpp b/src/server/scripts/Outland/hellfire_citadel/blood_furnace/boss_the_maker.cpp deleted file mode 100644 index 45219b6509b..00000000000 --- a/src/server/scripts/Outland/hellfire_citadel/blood_furnace/boss_the_maker.cpp +++ /dev/null @@ -1,152 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_The_Maker -SD%Complete: 80 -SDComment: Mind control no support -SDCategory: Hellfire Citadel, Blood Furnace -EndScriptData */ - -#include "ScriptedPch.h" -#include "blood_furnace.h" - -enum eEnums -{ - SAY_AGGRO_1 = -1542009, - SAY_AGGRO_2 = -1542010, - SAY_AGGRO_3 = -1542011, - SAY_KILL_1 = -1542012, - SAY_KILL_2 = -1542013, - SAY_DIE = -1542014, - - SPELL_ACID_SPRAY = 38153, // heroic 38973 ??? 38153 - SPELL_EXPLODING_BREAKER = 30925, - SPELL_KNOCKDOWN = 20276, - SPELL_DOMINATION = 25772 // ??? -}; - -struct boss_the_makerAI : public ScriptedAI -{ - boss_the_makerAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint32 AcidSpray_Timer; - uint32 ExplodingBreaker_Timer; - uint32 Domination_Timer; - uint32 Knockdown_Timer; - - void Reset() - { - AcidSpray_Timer = 15000; - ExplodingBreaker_Timer = 6000; - Domination_Timer = 120000; - Knockdown_Timer = 10000; - - if (!pInstance) - return; - - pInstance->SetData(TYPE_THE_MAKER_EVENT, NOT_STARTED); - pInstance->HandleGameObject(pInstance->GetData64(DATA_DOOR2), true); - } - - void EnterCombat(Unit * /*who*/) - { - DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3), me); - - if (!pInstance) - return; - - pInstance->SetData(TYPE_THE_MAKER_EVENT, IN_PROGRESS); - pInstance->HandleGameObject(pInstance->GetData64(DATA_DOOR2), false); - } - - void KilledUnit(Unit* /*victim*/) - { - DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2), me); - } - - void JustDied(Unit* /*Killer*/) - { - DoScriptText(SAY_DIE, me); - - if (!pInstance) - return; - - pInstance->SetData(TYPE_THE_MAKER_EVENT, DONE); - pInstance->HandleGameObject(pInstance->GetData64(DATA_DOOR2), true); - pInstance->HandleGameObject(pInstance->GetData64(DATA_DOOR3), true); - - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (AcidSpray_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_ACID_SPRAY); - AcidSpray_Timer = 15000+rand()%8000; - } else AcidSpray_Timer -=diff; - - if (ExplodingBreaker_Timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(pTarget, SPELL_EXPLODING_BREAKER); - ExplodingBreaker_Timer = 4000+rand()%8000; - } else ExplodingBreaker_Timer -=diff; - - /* // Disabled until Core Support for mind control - if (domination_timer_timer <= diff) - { - Unit *pTarget; - pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); - - DoCast(pTarget, SPELL_DOMINATION); - - domination_timer = 120000; - } else domination_timer -=diff; - */ - - if (Knockdown_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_KNOCKDOWN); - Knockdown_Timer = 4000+rand()%8000; - } else Knockdown_Timer -=diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_the_makerAI(Creature* pCreature) -{ - return new boss_the_makerAI (pCreature); -} - -void AddSC_boss_the_maker() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_the_maker"; - newscript->GetAI = &GetAI_boss_the_makerAI; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Outland/hellfire_citadel/blood_furnace/instance_blood_furnace.cpp b/src/server/scripts/Outland/hellfire_citadel/blood_furnace/instance_blood_furnace.cpp deleted file mode 100644 index 3a2eb8ba5ee..00000000000 --- a/src/server/scripts/Outland/hellfire_citadel/blood_furnace/instance_blood_furnace.cpp +++ /dev/null @@ -1,232 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Instance_Blood_Furnace -SD%Complete: 85 -SDComment: -SDCategory: Hellfire Citadel, Blood Furnace -EndScriptData */ - -#include "ScriptedPch.h" -#include "blood_furnace.h" - -#define ENTRY_SEWER1 181823 -#define ENTRY_SEWER2 181766 -#define MAX_ENCOUNTER 3 - -struct instance_blood_furnace : public ScriptedInstance -{ - instance_blood_furnace(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint64 The_MakerGUID; - uint64 BroggokGUID; - uint64 Kelidan_The_BreakerGUID; - - uint64 Door1GUID; - uint64 Door2GUID; - uint64 Door3GUID; - uint64 Door4GUID; - uint64 Door5GUID; - uint64 Door6GUID; - - uint64 PrisonCell1GUID; - uint64 PrisonCell2GUID; - uint64 PrisonCell3GUID; - uint64 PrisonCell4GUID; - uint64 PrisonCell5GUID; - uint64 PrisonCell6GUID; - uint64 PrisonCell7GUID; - uint64 PrisonCell8GUID; - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - std::string str_data; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - The_MakerGUID = 0; - BroggokGUID = 0; - Kelidan_The_BreakerGUID = 0; - - Door1GUID = 0; - Door2GUID = 0; - Door3GUID = 0; - Door4GUID = 0; - Door5GUID = 0; - Door6GUID = 0; - - PrisonCell1GUID = 0; - PrisonCell2GUID = 0; - PrisonCell3GUID = 0; - PrisonCell4GUID = 0; - PrisonCell5GUID = 0; - PrisonCell6GUID = 0; - PrisonCell7GUID = 0; - PrisonCell8GUID = 0; - } - - void OnCreatureCreate(Creature* pCreature, bool add) - { - if (!add) - return; - - switch(pCreature->GetEntry()) - { - case 17381: The_MakerGUID = pCreature->GetGUID(); break; - case 17380: BroggokGUID = pCreature->GetGUID(); break; - case 17377: Kelidan_The_BreakerGUID = pCreature->GetGUID(); break; - } - } - - void OnGameObjectCreate(GameObject* pGo, bool add) - { - if (!add) - return; - - if (pGo->GetEntry() == 181766) //Final exit door - Door1GUID = pGo->GetGUID(); - if (pGo->GetEntry() == 181811) //The Maker Front door - Door2GUID = pGo->GetGUID(); - if (pGo->GetEntry() == 181812) //The Maker Rear door - Door3GUID = pGo->GetGUID(); - if (pGo->GetEntry() == 181822) //Broggok Front door - Door4GUID = pGo->GetGUID(); - if (pGo->GetEntry() == 181819) //Broggok Rear door - Door5GUID = pGo->GetGUID(); - if (pGo->GetEntry() == 181823) //Kelidan exit door - Door6GUID = pGo->GetGUID(); - - if (pGo->GetEntry() == 181813) //The Maker prison cell front right - PrisonCell1GUID = pGo->GetGUID(); - if (pGo->GetEntry() == 181814) //The Maker prison cell back right - PrisonCell2GUID = pGo->GetGUID(); - if (pGo->GetEntry() == 181816) //The Maker prison cell front left - PrisonCell3GUID = pGo->GetGUID(); - if (pGo->GetEntry() == 181815) //The Maker prison cell back left - PrisonCell4GUID = pGo->GetGUID(); - if (pGo->GetEntry() == 181821) //Broggok prison cell front right - PrisonCell5GUID = pGo->GetGUID(); - if (pGo->GetEntry() == 181818) //Broggok prison cell back right - PrisonCell6GUID = pGo->GetGUID(); - if (pGo->GetEntry() == 181820) //Broggok prison cell front left - PrisonCell7GUID = pGo->GetGUID(); - if (pGo->GetEntry() == 181817) //Broggok prison cell back left - PrisonCell8GUID = pGo->GetGUID(); - } - - uint64 GetData64(uint32 data) - { - switch(data) - { - case DATA_THE_MAKER: return The_MakerGUID; - case DATA_BROGGOK: return BroggokGUID; - case DATA_KELIDAN_THE_MAKER: return Kelidan_The_BreakerGUID; - case DATA_DOOR1: return Door1GUID; - case DATA_DOOR2: return Door2GUID; - case DATA_DOOR3: return Door3GUID; - case DATA_DOOR4: return Door4GUID; - case DATA_DOOR5: return Door5GUID; - case DATA_DOOR6: return Door6GUID; - case DATA_PRISON_CELL1: return PrisonCell1GUID; - case DATA_PRISON_CELL2: return PrisonCell2GUID; - case DATA_PRISON_CELL3: return PrisonCell3GUID; - case DATA_PRISON_CELL4: return PrisonCell4GUID; - case DATA_PRISON_CELL5: return PrisonCell5GUID; - case DATA_PRISON_CELL6: return PrisonCell6GUID; - case DATA_PRISON_CELL7: return PrisonCell7GUID; - case DATA_PRISON_CELL8: return PrisonCell8GUID; - } - - return 0; - } - - void SetData(uint32 /*type*/, uint32 data) - { - switch(data) - { - case TYPE_THE_MAKER_EVENT: m_auiEncounter[0] = data; break; - case TYPE_BROGGOK_EVENT: m_auiEncounter[1] = data; break; - case TYPE_KELIDAN_THE_BREAKER_EVENT: m_auiEncounter[2] = data; break; - } - - if (data == DONE) - { - OUT_SAVE_INST_DATA; - - std::ostringstream saveStream; - saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2]; - - str_data = saveStream.str(); - - SaveToDB(); - OUT_SAVE_INST_DATA_COMPLETE; - } - } - - uint32 GetData(uint32 data) - { - switch(data) - { - case TYPE_THE_MAKER_EVENT: return m_auiEncounter[0]; - case TYPE_BROGGOK_EVENT: return m_auiEncounter[1]; - case TYPE_KELIDAN_THE_BREAKER_EVENT: return m_auiEncounter[2]; - } - - return 0; - } - - const char* Save() - { - return str_data.c_str(); - } - - void Load(const char* in) - { - if (!in) - { - OUT_LOAD_INST_DATA_FAIL; - return; - } - - OUT_LOAD_INST_DATA(in); - - std::istringstream loadStream(in); - loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2]; - - for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS || m_auiEncounter[i] == FAIL) - m_auiEncounter[i] = NOT_STARTED; - - OUT_LOAD_INST_DATA_COMPLETE; - } -}; - -InstanceData* GetInstanceData_instance_blood_furnace(Map* pMap) -{ - return new instance_blood_furnace(pMap); -} - -void AddSC_instance_blood_furnace() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_blood_furnace"; - newscript->GetInstanceData = &GetInstanceData_instance_blood_furnace; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Outland/hellfire_citadel/hellfire_ramparts/boss_omor_the_unscarred.cpp b/src/server/scripts/Outland/hellfire_citadel/hellfire_ramparts/boss_omor_the_unscarred.cpp deleted file mode 100644 index d6c0b2fd401..00000000000 --- a/src/server/scripts/Outland/hellfire_citadel/hellfire_ramparts/boss_omor_the_unscarred.cpp +++ /dev/null @@ -1,206 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Omar_The_Unscarred -SD%Complete: 90 -SDComment: Temporary solution for orbital/shadow whip-ability. Needs more core support before making it more proper. -SDCategory: Hellfire Citadel, Hellfire Ramparts -EndScriptData */ - -#include "ScriptedPch.h" - -#define SAY_AGGRO_1 -1543009 -#define SAY_AGGRO_2 -1543010 -#define SAY_AGGRO_3 -1543011 -#define SAY_SUMMON -1543012 -#define SAY_CURSE -1543013 -#define SAY_KILL_1 -1543014 -#define SAY_DIE -1543015 -#define SAY_WIPE -1543016 - -#define SPELL_ORBITAL_STRIKE 30637 -#define SPELL_SHADOW_WHIP 30638 -#define SPELL_TREACHEROUS_AURA 30695 -#define H_SPELL_BANE_OF_TREACHERY 37566 -#define SPELL_DEMONIC_SHIELD 31901 -#define SPELL_SHADOW_BOLT 30686 -#define H_SPELL_SHADOW_BOLT 39297 -#define SPELL_SUMMON_FIENDISH_HOUND 30707 - -struct boss_omor_the_unscarredAI : public ScriptedAI -{ - boss_omor_the_unscarredAI(Creature *c) : ScriptedAI(c) - { - SetCombatMovement(false); - } - - uint32 OrbitalStrike_Timer; - uint32 ShadowWhip_Timer; - uint32 Aura_Timer; - uint32 DemonicShield_Timer; - uint32 Shadowbolt_Timer; - uint32 Summon_Timer; - uint32 SummonedCount; - uint64 PlayerGUID; - bool CanPullBack; - - void Reset() - { - DoScriptText(SAY_WIPE, me); - - OrbitalStrike_Timer = 25000; - ShadowWhip_Timer = 2000; - Aura_Timer = 10000; - DemonicShield_Timer = 1000; - Shadowbolt_Timer = 2000; - Summon_Timer = 10000; - SummonedCount = 0; - PlayerGUID = 0; - CanPullBack = false; - } - - void EnterCombat(Unit * /*who*/) - { - DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3), me); - } - - void KilledUnit(Unit* /*victim*/) - { - if (rand()%2) - return; - - DoScriptText(SAY_KILL_1, me); - } - - void JustSummoned(Creature* summoned) - { - DoScriptText(SAY_SUMMON, me); - - if (Unit* random = SelectUnit(SELECT_TARGET_RANDOM,0)) - summoned->AI()->AttackStart(random); - - ++SummonedCount; - } - - void JustDied(Unit* /*Killer*/) - { - DoScriptText(SAY_DIE, me); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //only two may be wrong, perhaps increase timer and spawn periodically instead. - if (SummonedCount < 2) - { - if (Summon_Timer <= diff) - { - me->InterruptNonMeleeSpells(false); - DoCast(me, SPELL_SUMMON_FIENDISH_HOUND); - Summon_Timer = 15000+rand()%15000; - } else Summon_Timer -= diff; - } - - if (CanPullBack) - { - if (ShadowWhip_Timer <= diff) - { - if (Player* temp = Unit::GetPlayer(PlayerGUID)) - { - //if unit dosen't have this flag, then no pulling back (script will attempt cast, even if orbital strike was resisted) - if (temp->HasUnitMovementFlag(MOVEMENTFLAG_FALLING)) - { - me->InterruptNonMeleeSpells(false); - DoCast(temp, SPELL_SHADOW_WHIP); - } - } - PlayerGUID = 0; - ShadowWhip_Timer = 2000; - CanPullBack = false; - } else ShadowWhip_Timer -= diff; - } - else if (OrbitalStrike_Timer <= diff) - { - Unit* temp = NULL; - if (me->IsWithinMeleeRange(me->getVictim())) - temp = me->getVictim(); - else temp = SelectUnit(SELECT_TARGET_RANDOM,0); - - if (temp && temp->GetTypeId() == TYPEID_PLAYER) - { - DoCast(temp, SPELL_ORBITAL_STRIKE); - OrbitalStrike_Timer = 14000+rand()%2000; - PlayerGUID = temp->GetGUID(); - - if (PlayerGUID) - CanPullBack = true; - } - } else OrbitalStrike_Timer -= diff; - - if ((me->GetHealth()*100) / me->GetMaxHealth() < 20) - { - if (DemonicShield_Timer <= diff) - { - DoCast(me, SPELL_DEMONIC_SHIELD); - DemonicShield_Timer = 15000; - } else DemonicShield_Timer -= diff; - } - - if (Aura_Timer <= diff) - { - DoScriptText(SAY_CURSE, me); - - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) - { - DoCast(pTarget, SPELL_TREACHEROUS_AURA); - Aura_Timer = 8000+rand()%8000; - } - } else Aura_Timer -= diff; - - if (Shadowbolt_Timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) - { - if (pTarget) - pTarget = me->getVictim(); - - DoCast(pTarget, SPELL_SHADOW_BOLT); - Shadowbolt_Timer = 4000+rand()%2500; - } - } else Shadowbolt_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_omor_the_unscarredAI(Creature* pCreature) -{ - return new boss_omor_the_unscarredAI (pCreature); -} - -void AddSC_boss_omor_the_unscarred() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "boss_omor_the_unscarred"; - newscript->GetAI = &GetAI_boss_omor_the_unscarredAI; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Outland/hellfire_citadel/hellfire_ramparts/boss_vazruden_the_herald.cpp b/src/server/scripts/Outland/hellfire_citadel/hellfire_ramparts/boss_vazruden_the_herald.cpp deleted file mode 100644 index 181911f77a4..00000000000 --- a/src/server/scripts/Outland/hellfire_citadel/hellfire_ramparts/boss_vazruden_the_herald.cpp +++ /dev/null @@ -1,467 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -Name: Boss_Vazruden_the_Herald -%Complete: 90 -Comment: -Category: Hellfire Citadel, Hellfire Ramparts -EndScriptData */ - -#include "ScriptedPch.h" - -#define SPELL_FIREBALL DUNGEON_MODE(34653, 36920) -#define SPELL_CONE_OF_FIRE DUNGEON_MODE(30926, 36921) -#define SPELL_SUMMON_LIQUID_FIRE DUNGEON_MODE(23971, 30928) -#define SPELL_BELLOWING_ROAR 39427 -#define SPELL_REVENGE DUNGEON_MODE(19130, 40392) -#define SPELL_KIDNEY_SHOT 30621 -#define SPELL_FIRE_NOVA_VISUAL 19823 - -#define ENTRY_HELLFIRE_SENTRY 17517 -#define ENTRY_VAZRUDEN_HERALD 17307 -#define ENTRY_VAZRUDEN 17537 -#define ENTRY_NAZAN 17536 -#define ENTRY_LIQUID_FIRE 22515 -#define ENTRY_REINFORCED_FEL_IRON_CHEST DUNGEON_MODE(185168, 185169) - -#define SAY_INTRO -1543017 -#define SAY_WIPE -1543018 -#define SAY_AGGRO_1 -1543019 -#define SAY_AGGRO_2 -1543020 -#define SAY_AGGRO_3 -1543021 -#define SAY_KILL_1 -1543022 -#define SAY_KILL_2 -1543023 -#define SAY_DIE -1543024 -#define EMOTE -1543025 - -#define PATH_ENTRY 2081 - -const float VazrudenMiddle[3] = {-1406.5, 1746.5, 81.2}; -const float VazrudenRing[2][3] = -{ - {-1430, 1705, 112}, - {-1377, 1760, 112} -}; - -struct boss_nazanAI : public ScriptedAI -{ - boss_nazanAI(Creature *c) : ScriptedAI(c) - { - VazrudenGUID = 0; - flight = true; - } - - uint32 Fireball_Timer; - uint32 ConeOfFire_Timer; - uint32 BellowingRoar_Timer; - uint32 Fly_Timer; - uint32 Turn_Timer; - uint32 UnsummonCheck; - bool flight; - uint64 VazrudenGUID; - SpellEntry *liquid_fire; - - void Reset() - { - Fireball_Timer = 4000; - Fly_Timer = 45000; - Turn_Timer = 0; - UnsummonCheck = 5000; - } - - void EnterCombat(Unit* /*who*/) {} - - void JustSummoned(Creature *summoned) - { - if (summoned && summoned->GetEntry() == ENTRY_LIQUID_FIRE) - { - summoned->SetLevel(me->getLevel()); - summoned->setFaction(me->getFaction()); - summoned->CastSpell(summoned,SPELL_SUMMON_LIQUID_FIRE,true); - summoned->CastSpell(summoned,SPELL_FIRE_NOVA_VISUAL,true); - } - } - - void SpellHitTarget(Unit *pTarget, const SpellEntry* entry) - { - if (pTarget && entry->Id == uint32(SPELL_FIREBALL)) - me->SummonCreature(ENTRY_LIQUID_FIRE,pTarget->GetPositionX(),pTarget->GetPositionY(),pTarget->GetPositionZ(),pTarget->GetOrientation(),TEMPSUMMON_TIMED_DESPAWN,30000); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - { - if (UnsummonCheck < diff && me->isAlive()) - me->DisappearAndDie(); - else - UnsummonCheck -= diff; - return; - } - - if (Fireball_Timer <= diff) - { - if (Unit *victim = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(victim, SPELL_FIREBALL, true); - Fireball_Timer = urand(4000,7000); - } else Fireball_Timer -= diff; - - if (flight) // phase 1 - the flight - { - Creature *Vazruden = Unit::GetCreature(*me,VazrudenGUID); - if (Fly_Timer < diff || !(Vazruden && Vazruden->isAlive() && (Vazruden->GetHealth()*5 > Vazruden->GetMaxHealth()))) - { - flight = false; - BellowingRoar_Timer = 6000; - ConeOfFire_Timer = 12000; - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - me->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - me->GetMotionMaster()->Clear(); - if (Unit *victim = SelectUnit(SELECT_TARGET_NEAREST,0)) - me->AI()->AttackStart(victim); - DoStartMovement(me->getVictim()); - DoScriptText(EMOTE, me); - return; - } else Fly_Timer -= diff; - - if (Turn_Timer <= diff) - { - uint32 waypoint = (Fly_Timer/10000)%2; - if (me->IsWithinDist3d(VazrudenRing[waypoint][0],VazrudenRing[waypoint][1],VazrudenRing[waypoint][2], 5)) - me->GetMotionMaster()->MovePoint(0,VazrudenRing[waypoint][0],VazrudenRing[waypoint][1],VazrudenRing[waypoint][2]); - Turn_Timer = 10000; - } else Turn_Timer -= diff; - } - else // phase 2 - land fight - { - if (ConeOfFire_Timer <= diff) - { - DoCast(me, SPELL_CONE_OF_FIRE); - ConeOfFire_Timer = 12000; - Fireball_Timer = 4000; - } else ConeOfFire_Timer -= diff; - - if (IsHeroic()) - if (BellowingRoar_Timer <= diff) - { - DoCast(me, SPELL_BELLOWING_ROAR); - BellowingRoar_Timer = 45000; - } else BellowingRoar_Timer -= diff; - - DoMeleeAttackIfReady(); - } - } -}; - -struct boss_vazrudenAI : public ScriptedAI -{ - boss_vazrudenAI(Creature *c) : ScriptedAI(c) - { - } - - uint32 Revenge_Timer; - bool WipeSaid; - uint32 UnsummonCheck; - - void Reset() - { - Revenge_Timer = 4000; - UnsummonCheck = 2000; - WipeSaid = false; - } - - void EnterCombat(Unit * /*who*/) - { - DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3), me); - } - - void KilledUnit(Unit* who) - { - if (who && who->GetEntry() != ENTRY_VAZRUDEN) - DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2), me); - } - - void JustDied(Unit* who) - { - if (who && who != me) - DoScriptText(SAY_DIE, me); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - { - if (UnsummonCheck < diff && me->isAlive()) - { - if (!WipeSaid) - { - DoScriptText(SAY_WIPE, me); - WipeSaid = true; - } - me->DisappearAndDie(); - } else UnsummonCheck -= diff; - return; - } - - if (Revenge_Timer <= diff) - { - if (Unit *victim = me->getVictim()) - DoCast(victim, SPELL_REVENGE); - Revenge_Timer = 5000; - } else Revenge_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -struct boss_vazruden_the_heraldAI : public ScriptedAI -{ - boss_vazruden_the_heraldAI(Creature *c) : ScriptedAI(c) - { - summoned = false; - sentryDown = false; - NazanGUID = 0; - VazrudenGUID = 0; - } - - uint32 phase; - uint32 waypoint; - uint32 check; - bool sentryDown; - uint64 NazanGUID; - uint64 VazrudenGUID; - bool summoned; - - void Reset() - { - phase = 0; - waypoint = 0; - check = 0; - UnsummonAdds(); - me->GetMotionMaster()->MovePath(PATH_ENTRY, true); - } - - void UnsummonAdds() - { - if (summoned) - { - Creature *Nazan = Unit::GetCreature(*me, NazanGUID); - if (!Nazan) - Nazan = me->FindNearestCreature(ENTRY_NAZAN, 5000); - if (Nazan) - { - Nazan->DisappearAndDie(); - NazanGUID = 0; - } - - Creature *Vazruden = Unit::GetCreature(*me, VazrudenGUID); - if (!Vazruden) - Vazruden = me->FindNearestCreature(ENTRY_VAZRUDEN, 5000); - if (Vazruden) - { - Vazruden->DisappearAndDie(); - VazrudenGUID = 0; - } - summoned = false; - me->clearUnitState(UNIT_STAT_ROOT); - me->SetVisibility(VISIBILITY_ON); - } - } - - void SummonAdds() - { - if (!summoned) - { - if (Creature* Vazruden = me->SummonCreature(ENTRY_VAZRUDEN,VazrudenMiddle[0],VazrudenMiddle[1],VazrudenMiddle[2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,6000000)) - VazrudenGUID = Vazruden->GetGUID(); - if (Creature* Nazan = me->SummonCreature(ENTRY_NAZAN,VazrudenMiddle[0],VazrudenMiddle[1],VazrudenMiddle[2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,6000000)) - NazanGUID = Nazan->GetGUID(); - summoned = true; - me->SetVisibility(VISIBILITY_OFF); - me->addUnitState(UNIT_STAT_ROOT); - } - } - - void EnterCombat(Unit * /*who*/) - { - if (phase == 0) - { - phase = 1; - check = 0; - DoScriptText(SAY_INTRO, me); - } - } - - void JustSummoned(Creature *summoned) - { - if (!summoned) return; - Unit *victim = me->getVictim(); - if (summoned->GetEntry() == ENTRY_NAZAN) - { - CAST_AI(boss_nazanAI, summoned->AI())->VazrudenGUID = VazrudenGUID; - summoned->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - summoned->SetSpeed(MOVE_FLIGHT, 2.5); - if (victim) - AttackStartNoMove(victim); - } - else if (victim) - summoned->AI()->AttackStart(victim); - } - - void SentryDownBy(Unit* killer) - { - if (sentryDown) - { - AttackStartNoMove(killer); - sentryDown = false; - } - else - sentryDown = true; - } - - void UpdateAI(const uint32 diff) - { - switch(phase) - { - case 0: // circle around the platform - return; - break; - case 1: // go to the middle and begin the fight - if (check <= diff) - { - if (!me->IsWithinDist3d(VazrudenMiddle[0],VazrudenMiddle[1],VazrudenMiddle[2],5)) - { - me->GetMotionMaster()->Clear(); - me->GetMotionMaster()->MovePoint(0,VazrudenMiddle[0],VazrudenMiddle[1],VazrudenMiddle[2]); - check = 1000; - } - else - { - SummonAdds(); - phase = 2; - return; - } - } else check -= diff; - break; - default: // adds do the job now - if (check <= diff) - { - Creature *Nazan = Unit::GetCreature(*me, NazanGUID); - Creature *Vazruden = Unit::GetCreature(*me, VazrudenGUID); - if (Nazan && Nazan->isAlive() || Vazruden && Vazruden->isAlive()) - { - if (Nazan && Nazan->getVictim() || Vazruden && Vazruden->getVictim()) - return; - else - { - UnsummonAdds(); - EnterEvadeMode(); - return; - } - } - else - { - me->SummonGameObject(ENTRY_REINFORCED_FEL_IRON_CHEST,VazrudenMiddle[0],VazrudenMiddle[1],VazrudenMiddle[2],0,0,0,0,0,0); - me->SetLootRecipient(NULL); // don't think this is necessary.. - me->Kill(me); - } - check = 2000; - } else check -= diff; - break; - } - } -}; - -struct mob_hellfire_sentryAI : public ScriptedAI -{ - mob_hellfire_sentryAI(Creature *c) : ScriptedAI(c) {} - - uint32 KidneyShot_Timer; - - void Reset() - { - KidneyShot_Timer = urand(3000,7000); - } - - void EnterCombat(Unit* /*who*/) {} - - void JustDied(Unit* who) - { - if (Creature *herald = me->FindNearestCreature(ENTRY_VAZRUDEN_HERALD,150)) - CAST_AI(boss_vazruden_the_heraldAI, herald->AI())->SentryDownBy(who); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (KidneyShot_Timer <= diff) - { - if (Unit *victim = me->getVictim()) - DoCast(victim, SPELL_KIDNEY_SHOT); - KidneyShot_Timer = 20000; - } else KidneyShot_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_vazruden_the_herald(Creature* pCreature) -{ - return new boss_vazruden_the_heraldAI (pCreature); -} - -CreatureAI* GetAI_boss_vazruden(Creature* pCreature) -{ - return new boss_vazrudenAI (pCreature); -} - -CreatureAI* GetAI_boss_nazan(Creature* pCreature) -{ - return new boss_nazanAI (pCreature); -} - -CreatureAI* GetAI_mob_hellfire_sentry(Creature* pCreature) -{ - return new mob_hellfire_sentryAI (pCreature); -} - -void AddSC_boss_vazruden_the_herald() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_vazruden_the_herald"; - newscript->GetAI = &GetAI_boss_vazruden_the_herald; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_vazruden"; - newscript->GetAI = &GetAI_boss_vazruden; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_nazan"; - newscript->GetAI = &GetAI_boss_nazan; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_hellfire_sentry"; - newscript->GetAI = &GetAI_mob_hellfire_sentry; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Outland/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp b/src/server/scripts/Outland/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp deleted file mode 100644 index f0e813d3890..00000000000 --- a/src/server/scripts/Outland/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp +++ /dev/null @@ -1,156 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Watchkeeper_Gargolmar -SD%Complete: 80 -SDComment: Missing adds to heal him. Surge should be used on pTarget furthest away, not random. -SDCategory: Hellfire Citadel, Hellfire Ramparts -EndScriptData */ - -#include "ScriptedPch.h" - -#define SAY_TAUNT -1543000 -#define SAY_HEAL -1543001 -#define SAY_SURGE -1543002 -#define SAY_AGGRO_1 -1543003 -#define SAY_AGGRO_2 -1543004 -#define SAY_AGGRO_3 -1543005 -#define SAY_KILL_1 -1543006 -#define SAY_KILL_2 -1543007 -#define SAY_DIE -1543008 - -#define SPELL_MORTAL_WOUND 30641 -#define H_SPELL_MORTAL_WOUND 36814 -#define SPELL_SURGE 34645 -#define SPELL_RETALIATION 22857 - -struct boss_watchkeeper_gargolmarAI : public ScriptedAI -{ - boss_watchkeeper_gargolmarAI(Creature *c) : ScriptedAI(c) - { - } - - uint32 Surge_Timer; - uint32 MortalWound_Timer; - uint32 Retaliation_Timer; - - bool HasTaunted; - bool YelledForHeal; - - void Reset() - { - Surge_Timer = 5000; - MortalWound_Timer = 4000; - Retaliation_Timer = 0; - - HasTaunted = false; - YelledForHeal = false; - } - - void EnterCombat(Unit * /*who*/) - { - DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3), me); - } - - void MoveInLineOfSight(Unit* who) - { - if (!me->getVictim() && who->isTargetableForAttack() && (me->IsHostileTo(who)) && who->isInAccessiblePlaceFor(me)) - { - if (!me->canFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) - return; - - float attackRadius = me->GetAttackDistance(who); - if (me->IsWithinDistInMap(who, attackRadius) && me->IsWithinLOSInMap(who)) - { - //who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); - AttackStart(who); - } - else if (!HasTaunted && me->IsWithinDistInMap(who, 60.0f)) - { - DoScriptText(SAY_TAUNT, me); - HasTaunted = true; - } - } - } - - void KilledUnit(Unit* /*victim*/) - { - DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2), me); - } - - void JustDied(Unit* /*Killer*/) - { - DoScriptText(SAY_DIE, me); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (MortalWound_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_MORTAL_WOUND); - MortalWound_Timer = 5000+rand()%8000; - } else MortalWound_Timer -= diff; - - if (Surge_Timer <= diff) - { - DoScriptText(SAY_SURGE, me); - - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(pTarget, SPELL_SURGE); - - Surge_Timer = 5000+rand()%8000; - } else Surge_Timer -= diff; - - if ((me->GetHealth()*100) / me->GetMaxHealth() < 20) - { - if (Retaliation_Timer <= diff) - { - DoCast(me, SPELL_RETALIATION); - Retaliation_Timer = 30000; - } else Retaliation_Timer -= diff; - } - - if (!YelledForHeal) - { - if ((me->GetHealth()*100) / me->GetMaxHealth() < 40) - { - DoScriptText(SAY_HEAL, me); - YelledForHeal = true; - } - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_watchkeeper_gargolmarAI(Creature* pCreature) -{ - return new boss_watchkeeper_gargolmarAI (pCreature); -} - -void AddSC_boss_watchkeeper_gargolmar() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_watchkeeper_gargolmar"; - newscript->GetAI = &GetAI_boss_watchkeeper_gargolmarAI; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Outland/hellfire_citadel/hellfire_ramparts/hellfire_ramparts.h b/src/server/scripts/Outland/hellfire_citadel/hellfire_ramparts/hellfire_ramparts.h deleted file mode 100644 index 599aa237774..00000000000 --- a/src/server/scripts/Outland/hellfire_citadel/hellfire_ramparts/hellfire_ramparts.h +++ /dev/null @@ -1,16 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ - -#ifndef DEF_RAMPARTS_H -#define DEF_RAMPARTS_H - -#define MAX_ENCOUNTER 2 - -enum eTypes -{ - TYPE_VAZRUDEN = 1, - TYPE_NAZAN = 2 -}; - -#endif diff --git a/src/server/scripts/Outland/hellfire_citadel/hellfire_ramparts/instance_hellfire_ramparts.cpp b/src/server/scripts/Outland/hellfire_citadel/hellfire_ramparts/instance_hellfire_ramparts.cpp deleted file mode 100644 index 29c58675e9c..00000000000 --- a/src/server/scripts/Outland/hellfire_citadel/hellfire_ramparts/instance_hellfire_ramparts.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Instance_Hellfire_Ramparts -SD%Complete: 50 -SDComment: -SDCategory: Hellfire Ramparts -EndScriptData */ - -#include "ScriptedPch.h" -#include "hellfire_ramparts.h" - -struct instance_ramparts : public ScriptedInstance -{ - instance_ramparts(Map* pMap) : ScriptedInstance(pMap) {Initialize();} - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - uint64 m_uiChestNGUID; - uint64 m_uiChestHGUID; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - m_uiChestNGUID = 0; - m_uiChestHGUID = 0; - } - - void OnGameObjectCreate(GameObject* pGo, bool /*add*/) - { - switch(pGo->GetEntry()) - { - case 185168: m_uiChestNGUID = pGo->GetGUID(); break; - case 185169: m_uiChestHGUID = pGo->GetGUID(); break; - } - } - - void SetData(uint32 uiType, uint32 uiData) - { - debug_log("TSCR: Instance Ramparts: SetData received for type %u with data %u",uiType,uiData); - - switch(uiType) - { - case TYPE_VAZRUDEN: - if (uiData == DONE && m_auiEncounter[1] == DONE) - DoRespawnGameObject(instance->IsHeroic() ? m_uiChestHGUID : m_uiChestNGUID, HOUR*IN_MILISECONDS); - m_auiEncounter[0] = uiData; - break; - case TYPE_NAZAN: - if (uiData == DONE && m_auiEncounter[0] == DONE) - DoRespawnGameObject(instance->IsHeroic() ? m_uiChestHGUID : m_uiChestNGUID, HOUR*IN_MILISECONDS); - m_auiEncounter[1] = uiData; - break; - } - } -}; - -InstanceData* GetInstanceData_instance_ramparts(Map* pMap) -{ - return new instance_ramparts(pMap); -} - -void AddSC_instance_ramparts() -{ - Script* pNewScript; - pNewScript = new Script; - pNewScript->Name = "instance_ramparts"; - pNewScript->GetInstanceData = &GetInstanceData_instance_ramparts; - pNewScript->RegisterSelf(); -} diff --git a/src/server/scripts/Outland/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp b/src/server/scripts/Outland/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp deleted file mode 100644 index 5fb381f4065..00000000000 --- a/src/server/scripts/Outland/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp +++ /dev/null @@ -1,570 +0,0 @@ -/* Copyright(C) 2006 - 2008 ScriptDev2 -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -*(at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -/* ScriptData -SDName: Boss_Magtheridon -SD%Complete: 60 -SDComment: In Development -SDCategory: Hellfire Citadel, Magtheridon's lair -EndScriptData */ - -#include "ScriptedPch.h" -#include "magtheridons_lair.h" - -struct Yell -{ - int32 id; -}; - -static Yell RandomTaunt[]= -{ - {-1544000}, - {-1544001}, - {-1544002}, - {-1544003}, - {-1544004}, - {-1544005}, -}; - -#define SAY_FREED -1544006 -#define SAY_AGGRO -1544007 -#define SAY_BANISH -1544008 -#define SAY_CHAMBER_DESTROY -1544009 -#define SAY_PLAYER_KILLED -1544010 -#define SAY_DEATH -1544011 - -#define EMOTE_BERSERK -1544012 -#define EMOTE_BLASTNOVA -1544013 -#define EMOTE_BEGIN -1544014 - -#define MOB_MAGTHERIDON 17257 -#define MOB_ROOM 17516 -#define MOB_CHANNELLER 17256 -#define MOB_ABYSSAL 17454 - -#define SPELL_BLASTNOVA 30616 -#define SPELL_CLEAVE 30619 -#define SPELL_QUAKE_TRIGGER 30657 // must be cast with 30561 as the proc spell -#define SPELL_QUAKE_KNOCKBACK 30571 -#define SPELL_BLAZE_TARGET 30541 // core bug, does not support target 7 -#define SPELL_BLAZE_TRAP 30542 -#define SPELL_DEBRIS_KNOCKDOWN 36449 -#define SPELL_DEBRIS_VISUAL 30632 -#define SPELL_DEBRIS_DAMAGE 30631 // core bug, does not support target 8 -#define SPELL_CAMERA_SHAKE 36455 -#define SPELL_BERSERK 27680 - -#define SPELL_SHADOW_CAGE 30168 -#define SPELL_SHADOW_GRASP 30410 -#define SPELL_SHADOW_GRASP_VISUAL 30166 -#define SPELL_MIND_EXHAUSTION 44032 //Casted by the cubes when channeling ends - -#define SPELL_SHADOW_CAGE_C 30205 -#define SPELL_SHADOW_GRASP_C 30207 - -#define SPELL_SHADOW_BOLT_VOLLEY 30510 -#define SPELL_DARK_MENDING 30528 -#define SPELL_FEAR 30530 //39176 -#define SPELL_BURNING_ABYSSAL 30511 -#define SPELL_SOUL_TRANSFER 30531 // core bug, does not support target 7 - -#define SPELL_FIRE_BLAST 37110 - -// count of clickers needed to interrupt blast nova -#define CLICKERS_COUNT 5 - -typedef std::map CubeMap; - -struct mob_abyssalAI : public ScriptedAI -{ - mob_abyssalAI(Creature *c) : ScriptedAI(c) - { - trigger = 0; - Despawn_Timer = 60000; - } - - uint32 FireBlast_Timer; - uint32 Despawn_Timer; - uint32 trigger; - - void Reset() - { - FireBlast_Timer = 6000; - } - - void SpellHit(Unit*, const SpellEntry *spell) - { - if (trigger == 2 && spell->Id == SPELL_BLAZE_TARGET) - { - DoCast(me, SPELL_BLAZE_TRAP, true); - me->SetVisibility(VISIBILITY_OFF); - Despawn_Timer = 130000; - } - } - - void SetTrigger(uint32 _trigger) - { - trigger = _trigger; - me->SetDisplayId(11686); - if (trigger == 1) //debris - { - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - DoCast(me, SPELL_DEBRIS_VISUAL, true); - FireBlast_Timer = 5000; - Despawn_Timer = 10000; - } - } - - void EnterCombat(Unit* /*who*/) {DoZoneInCombat();} - void AttackStart(Unit *who) {if (!trigger) ScriptedAI::AttackStart(who);} - void MoveInLineOfSight(Unit *who) {if (!trigger) ScriptedAI::MoveInLineOfSight(who);} - - void UpdateAI(const uint32 diff) - { - if (trigger) - { - if (trigger == 1) - { - if (FireBlast_Timer <= diff) - { - DoCast(me, SPELL_DEBRIS_DAMAGE, true); - trigger = 3; - } else FireBlast_Timer -= diff; - } - return; - } - - if (Despawn_Timer <= diff) - { - me->ForcedDespawn(); - } else Despawn_Timer -= diff; - - if (!UpdateVictim()) - return; - - if (FireBlast_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_FIRE_BLAST); - FireBlast_Timer = 5000+rand()%10000; - } else FireBlast_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -struct boss_magtheridonAI : public ScriptedAI -{ - boss_magtheridonAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - me->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 10); - me->SetFloatValue(UNIT_FIELD_COMBATREACH, 10); - - // target 7, random target with certain entry spell, need core fix - SpellEntry *TempSpell; - TempSpell = GET_SPELL(SPELL_BLAZE_TARGET); - if (TempSpell && TempSpell->EffectImplicitTargetA[0] != 6) - { - TempSpell->EffectImplicitTargetA[0] = 6; - TempSpell->EffectImplicitTargetB[0] = 0; - } - TempSpell = GET_SPELL(SPELL_QUAKE_TRIGGER); - if (TempSpell && TempSpell->EffectTriggerSpell[0] != SPELL_QUAKE_KNOCKBACK) - { - TempSpell->EffectTriggerSpell[0] = SPELL_QUAKE_KNOCKBACK; - } - } - - CubeMap Cube; - - ScriptedInstance* pInstance; - - uint32 Berserk_Timer; - uint32 Quake_Timer; - uint32 Cleave_Timer; - uint32 BlastNova_Timer; - uint32 Blaze_Timer; - uint32 Debris_Timer; - uint32 RandChat_Timer; - - bool Phase3; - bool NeedCheckCube; - - void Reset() - { - Berserk_Timer = 1320000; - Quake_Timer = 40000; - Debris_Timer = 10000; - Blaze_Timer = 10000+rand()%20000; - BlastNova_Timer = 60000; - Cleave_Timer = 15000; - RandChat_Timer = 90000; - - Phase3 = false; - NeedCheckCube = false; - - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); - me->addUnitState(UNIT_STAT_STUNNED); - DoCast(me, SPELL_SHADOW_CAGE_C, true); - } - - void JustReachedHome() - { - if (pInstance) - { - pInstance->SetData(DATA_MAGTHERIDON_EVENT, NOT_STARTED); - pInstance->SetData(DATA_COLLAPSE, false); - } - } - - void SetClicker(uint64 cubeGUID, uint64 clickerGUID) - { - // to avoid multiclicks from 1 cube - if (uint64 guid = Cube[cubeGUID]) - DebuffClicker(Unit::GetUnit(*me, guid)); - Cube[cubeGUID] = clickerGUID; - NeedCheckCube = true; - } - - //function to interrupt channeling and debuff clicker with mind exh(used if second person clicks with same cube or after dispeling/ending shadow grasp DoT) - void DebuffClicker(Unit *clicker) - { - if (!clicker || !clicker->isAlive()) - return; - - clicker->RemoveAurasDueToSpell(SPELL_SHADOW_GRASP); // cannot interrupt triggered spells - clicker->InterruptNonMeleeSpells(false); - clicker->CastSpell(clicker, SPELL_MIND_EXHAUSTION, true); - } - - void NeedCheckCubeStatus() - { - uint32 ClickerNum = 0; - // now checking if every clicker has debuff from manticron(it is dispelable atm rev 6110 : S) - // if not - apply mind exhaustion and delete from clicker's list - for (CubeMap::iterator i = Cube.begin(); i != Cube.end(); ++i) - { - Unit *clicker = Unit::GetUnit(*me, (*i).second); - if (!clicker || !clicker->HasAura(SPELL_SHADOW_GRASP)) - { - DebuffClicker(clicker); - (*i).second = 0; - } else ++ClickerNum; - } - - // if 5 clickers from other cubes apply shadow cage - if (ClickerNum >= CLICKERS_COUNT && !me->HasAura(SPELL_SHADOW_CAGE)) - { - DoScriptText(SAY_BANISH, me); - DoCast(me, SPELL_SHADOW_CAGE, true); - } - else if (ClickerNum < CLICKERS_COUNT && me->HasAura(SPELL_SHADOW_CAGE)) - me->RemoveAurasDueToSpell(SPELL_SHADOW_CAGE); - - if (!ClickerNum) NeedCheckCube = false; - } - - void KilledUnit(Unit* /*victim*/) - { - DoScriptText(SAY_PLAYER_KILLED, me); - } - - void JustDied(Unit* /*Killer*/) - { - if (pInstance) - pInstance->SetData(DATA_MAGTHERIDON_EVENT, DONE); - - DoScriptText(SAY_DEATH, me); - } - - void MoveInLineOfSight(Unit* /*who*/) {} - - void AttackStart(Unit *who) - { - if (!me->hasUnitState(UNIT_STAT_STUNNED)) - ScriptedAI::AttackStart(who); - } - - void EnterCombat(Unit * /*who*/) - { - if (pInstance) - pInstance->SetData(DATA_MAGTHERIDON_EVENT, IN_PROGRESS); - DoZoneInCombat(); - - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->RemoveAurasDueToSpell(SPELL_SHADOW_CAGE_C); - - DoScriptText(SAY_FREED, me); - } - - void UpdateAI(const uint32 diff) - { - if (!me->isInCombat()) - { - if (RandChat_Timer <= diff) - { - DoScriptText(RandomTaunt[rand()%6].id, me); - RandChat_Timer = 90000; - } else RandChat_Timer -= diff; - } - - if (!UpdateVictim()) - return; - - if (NeedCheckCube) NeedCheckCubeStatus(); - - if (Berserk_Timer <= diff) - { - DoCast(me, SPELL_BERSERK, true); - DoScriptText(EMOTE_BERSERK, me); - Berserk_Timer = 60000; - } else Berserk_Timer -= diff; - - if (Cleave_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_CLEAVE); - Cleave_Timer = 10000; - } else Cleave_Timer -= diff; - - if (BlastNova_Timer <= diff) - { - // to avoid earthquake interruption - if (!me->hasUnitState(UNIT_STAT_STUNNED)) - { - DoScriptText(EMOTE_BLASTNOVA, me); - DoCast(me, SPELL_BLASTNOVA); - BlastNova_Timer = 60000; - } - } else BlastNova_Timer -= diff; - - if (Quake_Timer <= diff) - { - // to avoid blastnova interruption - if (!me->IsNonMeleeSpellCasted(false)) - { - DoCast(me, SPELL_QUAKE_TRIGGER, true); - Quake_Timer = 50000; - } - } else Quake_Timer -= diff; - - if (Blaze_Timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - float x, y, z; - pTarget->GetPosition(x, y, z); - Creature *summon = me->SummonCreature(MOB_ABYSSAL, x, y, z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); - if (summon) - { - CAST_AI(mob_abyssalAI, summon->AI())->SetTrigger(2); - DoCast(summon, SPELL_BLAZE_TARGET, true); - summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - } - } - Blaze_Timer = 20000 + rand()%20000; - } else Blaze_Timer -= diff; - - if (!Phase3 && me->GetHealth()*10 < me->GetMaxHealth()*3 - && !me->IsNonMeleeSpellCasted(false) // blast nova - && !me->hasUnitState(UNIT_STAT_STUNNED)) // shadow cage and earthquake - { - Phase3 = true; - DoScriptText(SAY_CHAMBER_DESTROY, me); - DoCast(me, SPELL_CAMERA_SHAKE, true); - DoCast(me, SPELL_DEBRIS_KNOCKDOWN, true); - - if (pInstance) - pInstance->SetData(DATA_COLLAPSE, true); - } - - if (Phase3) - { - if (Debris_Timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - float x, y, z; - pTarget->GetPosition(x, y, z); - Creature *summon = me->SummonCreature(MOB_ABYSSAL, x, y, z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); - if (summon) CAST_AI(mob_abyssalAI, summon->AI())->SetTrigger(1); - } - Debris_Timer = 10000; - } else Debris_Timer -= diff; - } - - DoMeleeAttackIfReady(); - } -}; - -struct mob_hellfire_channelerAI : public ScriptedAI -{ - mob_hellfire_channelerAI(Creature *c) : ScriptedAI(c) - { - pInstance =me->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint32 ShadowBoltVolley_Timer; - uint32 DarkMending_Timer; - uint32 Fear_Timer; - uint32 Infernal_Timer; - - uint32 Check_Timer; - - void Reset() - { - ShadowBoltVolley_Timer = 8000 + rand()%2000; - DarkMending_Timer = 10000; - Fear_Timer = 15000 + rand()%5000; - Infernal_Timer = 10000 + rand()%40000; - - Check_Timer = 5000; - } - - void EnterCombat(Unit * /*who*/) - { - if (pInstance) - pInstance->SetData(DATA_CHANNELER_EVENT, IN_PROGRESS); - - me->InterruptNonMeleeSpells(false); - DoZoneInCombat(); - } - - void JustReachedHome() - { - if (pInstance) - pInstance->SetData(DATA_CHANNELER_EVENT, NOT_STARTED); - - DoCast(me, SPELL_SHADOW_GRASP_C, false); - } - - void JustSummoned(Creature *summon) - { - summon->AI()->AttackStart(me->getVictim()); - } - - void DamageTaken(Unit*, uint32 &damage) - { - if (damage >= me->GetHealth()) - DoCast(me, SPELL_SOUL_TRANSFER, true); - } - - void JustDied(Unit* /*who*/) - { - if (pInstance) - pInstance->SetData(DATA_CHANNELER_EVENT, DONE); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (ShadowBoltVolley_Timer <= diff) - { - DoCast(me, SPELL_SHADOW_BOLT_VOLLEY); - ShadowBoltVolley_Timer = 10000 + rand()%10000; - } else ShadowBoltVolley_Timer -= diff; - - if (DarkMending_Timer <= diff) - { - if ((me->GetHealth()*100 / me->GetMaxHealth()) < 50) - DoCast(me, SPELL_DARK_MENDING); - DarkMending_Timer = 10000 +(rand() % 10000); - } else DarkMending_Timer -= diff; - - if (Fear_Timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1)) - DoCast(pTarget, SPELL_FEAR); - Fear_Timer = 25000 + rand()%15000; - } else Fear_Timer -= diff; - - if (Infernal_Timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(pTarget, SPELL_BURNING_ABYSSAL, true); - Infernal_Timer = 30000 + rand()%10000; - } else Infernal_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -//Manticron Cube -bool GOHello_go_Manticron_Cube(Player* pPlayer, GameObject* pGo) -{ - ScriptedInstance* pInstance = pGo->GetInstanceData(); - if (!pInstance) - return true; - if (pInstance->GetData(DATA_MAGTHERIDON_EVENT) != IN_PROGRESS) return true; - Creature *Magtheridon =Unit::GetCreature(*pGo, pInstance->GetData64(DATA_MAGTHERIDON)); - if (!Magtheridon || !Magtheridon->isAlive()) return true; - - // if exhausted or already channeling return - if (pPlayer->HasAura(SPELL_MIND_EXHAUSTION) || pPlayer->HasAura(SPELL_SHADOW_GRASP)) - return true; - - pPlayer->InterruptNonMeleeSpells(false); - pPlayer->CastSpell(pPlayer, SPELL_SHADOW_GRASP, true); - pPlayer->CastSpell(pPlayer, SPELL_SHADOW_GRASP_VISUAL, false); - CAST_AI(boss_magtheridonAI, Magtheridon->AI())->SetClicker(pGo->GetGUID(), pPlayer->GetGUID()); - return true; -} - -CreatureAI* GetAI_boss_magtheridon(Creature* pCreature) -{ - return new boss_magtheridonAI(pCreature); -} - -CreatureAI* GetAI_mob_hellfire_channeler(Creature* pCreature) -{ - return new mob_hellfire_channelerAI(pCreature); -} - -CreatureAI* GetAI_mob_abyssalAI(Creature* pCreature) -{ - return new mob_abyssalAI(pCreature); -} - -void AddSC_boss_magtheridon() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_magtheridon"; - newscript->GetAI = &GetAI_boss_magtheridon; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_hellfire_channeler"; - newscript->GetAI = &GetAI_mob_hellfire_channeler; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "go_manticron_cube"; - newscript->pGOHello = &GOHello_go_Manticron_Cube; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_abyssal"; - newscript->GetAI = &GetAI_mob_abyssalAI; - newscript->RegisterSelf(); - -} - diff --git a/src/server/scripts/Outland/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp b/src/server/scripts/Outland/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp deleted file mode 100644 index d5b459a1fa1..00000000000 --- a/src/server/scripts/Outland/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp +++ /dev/null @@ -1,254 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Instance_Magtheridons_Lair -SD%Complete: 100 -SDComment: -SDCategory: Hellfire Citadel, Magtheridon's lair -EndScriptData */ - -#include "ScriptedPch.h" -#include "magtheridons_lair.h" - -#define SPELL_SOUL_TRANSFER 30531 // core bug, does not support target 7 -#define SPELL_BLAZE_TARGET 30541 // core bug, does not support target 7 - -#define CHAMBER_CENTER_X -15.14 -#define CHAMBER_CENTER_Y 1.8 -#define CHAMBER_CENTER_Z -0.4 - -#define MAX_ENCOUNTER 2 - -#define EMOTE_BONDS_WEAKEN "'s bonds begin to weaken!" - -struct instance_magtheridons_lair : public ScriptedInstance -{ - instance_magtheridons_lair(Map* pMap) : ScriptedInstance(pMap) - { - Initialize(); - } - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - - uint64 MagtheridonGUID; - std::set ChannelerGUID; - uint64 DoorGUID; - std::set ColumnGUID; - - uint32 CageTimer; - uint32 RespawnTimer; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - MagtheridonGUID = 0; - ChannelerGUID.clear(); - DoorGUID = 0; - ColumnGUID.clear(); - - CageTimer = 0; - RespawnTimer = 0; - } - - bool IsEncounterInProgress() const - { - for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) return true; - return false; - } - - void OnCreatureCreate(Creature* pCreature, bool /*add*/) - { - switch(pCreature->GetEntry()) - { - case 17257: - MagtheridonGUID = pCreature->GetGUID(); - break; - case 17256: - ChannelerGUID.insert(pCreature->GetGUID()); - break; - } - } - - void OnGameObjectCreate(GameObject* pGo, bool /*add*/) - { - switch(pGo->GetEntry()) - { - case 181713: - pGo->SetUInt32Value(GAMEOBJECT_FLAGS, 0); - break; - case 183847: - DoorGUID = pGo->GetGUID(); - break; - case 184653: // hall - case 184634: // six columns - case 184635: - case 184636: - case 184637: - case 184638: - case 184639: - ColumnGUID.insert(pGo->GetGUID()); - break; - } - } - - uint64 GetData64(uint32 type) - { - switch(type) - { - case DATA_MAGTHERIDON: - return MagtheridonGUID; - } - return 0; - } - - void SetData(uint32 type, uint32 data) - { - switch(type) - { - case DATA_MAGTHERIDON_EVENT: - m_auiEncounter[0] = data; - if (data == NOT_STARTED) - RespawnTimer = 10000; - if (data != IN_PROGRESS) - HandleGameObject(DoorGUID, true); - break; - case DATA_CHANNELER_EVENT: - switch(data) - { - case NOT_STARTED: // Reset all channelers once one is reset. - if (m_auiEncounter[1] != NOT_STARTED) - { - m_auiEncounter[1] = NOT_STARTED; - for (std::set::const_iterator i = ChannelerGUID.begin(); i != ChannelerGUID.end(); ++i) - { - if (Creature *Channeler = instance->GetCreature(*i)) - { - if (Channeler->isAlive()) - Channeler->AI()->EnterEvadeMode(); - else - Channeler->Respawn(); - } - } - CageTimer = 0; - HandleGameObject(DoorGUID, true); - } - break; - case IN_PROGRESS: // Event start. - if (m_auiEncounter[1] != IN_PROGRESS) - { - m_auiEncounter[1] = IN_PROGRESS; - // Let all five channelers aggro. - for (std::set::const_iterator i = ChannelerGUID.begin(); i != ChannelerGUID.end(); ++i) - { - Creature *Channeler = instance->GetCreature(*i); - if (Channeler && Channeler->isAlive()) - Channeler->AI()->AttackStart(Channeler->SelectNearestTarget(999)); - } - // Release Magtheridon after two minutes. - Creature *Magtheridon = instance->GetCreature(MagtheridonGUID); - if (Magtheridon && Magtheridon->isAlive()) - { - Magtheridon->MonsterTextEmote(EMOTE_BONDS_WEAKEN, 0); - CageTimer = 120000; - } - HandleGameObject(DoorGUID, false); - } - break; - case DONE: // Add buff and check if all channelers are dead. - for (std::set::const_iterator i = ChannelerGUID.begin(); i != ChannelerGUID.end(); ++i) - { - Creature *Channeler = instance->GetCreature(*i); - if (Channeler && Channeler->isAlive()) - { - //Channeler->CastSpell(Channeler, SPELL_SOUL_TRANSFER, true); - data = IN_PROGRESS; - break; - } - } - break; - } - m_auiEncounter[1] = data; - break; - case DATA_COLLAPSE: - // true - collapse / false - reset - for (std::set::const_iterator i = ColumnGUID.begin(); i != ColumnGUID.end(); ++i) - DoUseDoorOrButton(*i); - break; - default: - break; - } - } - - uint32 GetData(uint32 type) - { - if (type == DATA_MAGTHERIDON_EVENT) - return m_auiEncounter[0]; - return 0; - } - - void Update(uint32 diff) - { - if (CageTimer) - { - if (CageTimer <= diff) - { - Creature *Magtheridon = instance->GetCreature(MagtheridonGUID); - if (Magtheridon && Magtheridon->isAlive()) - { - Magtheridon->clearUnitState(UNIT_STAT_STUNNED); - Magtheridon->AI()->AttackStart(Magtheridon->SelectNearestTarget(999)); - } - CageTimer = 0; - } else CageTimer -= diff; - } - - if (RespawnTimer) - { - if (RespawnTimer <= diff) - { - for (std::set::const_iterator i = ChannelerGUID.begin(); i != ChannelerGUID.end(); ++i) - { - if (Creature *Channeler = instance->GetCreature(*i)) - { - if (Channeler->isAlive()) - Channeler->AI()->EnterEvadeMode(); - else - Channeler->Respawn(); - } - } - RespawnTimer = 0; - } else RespawnTimer -= diff; - } - } -}; - -InstanceData* GetInstanceData_instance_magtheridons_lair(Map* pMap) -{ - return new instance_magtheridons_lair(pMap); -} - -void AddSC_instance_magtheridons_lair() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_magtheridons_lair"; - newscript->GetInstanceData = &GetInstanceData_instance_magtheridons_lair; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Outland/hellfire_citadel/magtheridons_lair/magtheridons_lair.h b/src/server/scripts/Outland/hellfire_citadel/magtheridons_lair/magtheridons_lair.h deleted file mode 100644 index 1b3e525fc54..00000000000 --- a/src/server/scripts/Outland/hellfire_citadel/magtheridons_lair/magtheridons_lair.h +++ /dev/null @@ -1,14 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ - -#ifndef DEF_MAGTHERIDONS_LAIR_H -#define DEF_MAGTHERIDONS_LAIR_H - -#define DATA_MAGTHERIDON_EVENT 1 -#define DATA_MAGTHERIDON 3 -#define DATA_CHANNELER_EVENT 2 -#define DATA_COLLAPSE 6 -#define DATA_CHANNELER 9 -#endif - diff --git a/src/server/scripts/Outland/hellfire_citadel/shattered_halls/boss_nethekurse.cpp b/src/server/scripts/Outland/hellfire_citadel/shattered_halls/boss_nethekurse.cpp deleted file mode 100644 index e3ded52edc9..00000000000 --- a/src/server/scripts/Outland/hellfire_citadel/shattered_halls/boss_nethekurse.cpp +++ /dev/null @@ -1,396 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Grand_Warlock_Nethekurse -SD%Complete: 75 -SDComment: encounter not fully completed. missing part where boss kill minions. -SDCategory: Hellfire Citadel, Shattered Halls -EndScriptData */ - -/* ContentData -boss_grand_warlock_nethekurse -mob_fel_orc_convert -mob_lesser_shadow_fissure -EndContentData */ - -#include "ScriptedPch.h" -#include "shattered_halls.h" - -struct Say -{ - int32 id; -}; - -static Say PeonAttacked[]= -{ - {-1540001}, - {-1540002}, - {-1540003}, - {-1540004}, -}; -static Say PeonDies[]= -{ - {-1540005}, - {-1540006}, - {-1540007}, - {-1540008}, -}; - -#define SAY_INTRO -1540000 -#define SAY_TAUNT_1 -1540009 -#define SAY_TAUNT_2 -1540010 -#define SAY_TAUNT_3 -1540011 -#define SAY_AGGRO_1 -1540012 -#define SAY_AGGRO_2 -1540013 -#define SAY_AGGRO_3 -1540014 -#define SAY_SLAY_1 -1540015 -#define SAY_SLAY_2 -1540016 -#define SAY_DIE -1540017 - -#define SPELL_DEATH_COIL 30500 -#define SPELL_DARK_SPIN 30502 // core bug spell attack caster :D -#define SPELL_SHADOW_FISSURE 30496 // Summon the ShadowFissure NPC - -#define SPELL_SHADOW_CLEAVE 30495 -#define H_SPELL_SHADOW_SLAM 35953 - -#define SPELL_HEMORRHAGE 30478 - -#define SPELL_CONSUMPTION 30497 -#define SPELL_TEMPORARY_VISUAL 39312 // this is wrong, a temporary solution. spell consumption already has the purple visual, but doesn't display as it should - -struct boss_grand_warlock_nethekurseAI : public ScriptedAI -{ - boss_grand_warlock_nethekurseAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - bool IntroOnce; - bool IsIntroEvent; - bool IsMainEvent; - bool SpinOnce; - //bool HasTaunted; - bool Phase; - - uint32 PeonEngagedCount; - uint32 PeonKilledCount; - - uint32 IntroEvent_Timer; - uint32 DeathCoil_Timer; - uint32 ShadowFissure_Timer; - uint32 Cleave_Timer; - - void Reset() - { - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - - IsIntroEvent = false; - IntroOnce = false; - IsMainEvent = false; - //HasTaunted = false; - SpinOnce = false; - Phase = false; - - PeonEngagedCount = 0; - PeonKilledCount = 0; - - IntroEvent_Timer = 90000; //how long before getting bored and kills his minions? - DeathCoil_Timer = 20000; - ShadowFissure_Timer = 8000; - Cleave_Timer = 5000; - } - - void DoYellForPeonAggro() - { - if (PeonEngagedCount >= 4) - return; - - DoScriptText(PeonAttacked[PeonEngagedCount].id, me); - ++PeonEngagedCount; - } - - void DoYellForPeonDeath() - { - if (PeonKilledCount >= 4) - return; - - DoScriptText(PeonDies[PeonKilledCount].id, me); - ++PeonKilledCount; - - if (PeonKilledCount == 4) - { - IsIntroEvent = false; - IsMainEvent = true; - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - } - } - - void DoTauntPeons() - { - DoScriptText(RAND(SAY_TAUNT_1,SAY_TAUNT_2,SAY_TAUNT_3), me); - - //TODO: kill the peons first - IsIntroEvent = false; - PeonEngagedCount = 4; - PeonKilledCount = 4; - IsMainEvent = true; - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - } - - void AttackStart(Unit* who) - { - if (IsIntroEvent || !IsMainEvent) - return; - - if (me->Attack(who, true)) - { - if (Phase) - DoStartNoMovement(who); - else - DoStartMovement(who); - } - } - - void MoveInLineOfSight(Unit *who) - { - if (!IntroOnce && me->IsWithinDistInMap(who, 50.0f)) - { - if (who->GetTypeId() != TYPEID_PLAYER) - return; - - DoScriptText(SAY_INTRO, me); - IntroOnce = true; - IsIntroEvent = true; - - if (pInstance) - pInstance->SetData(TYPE_NETHEKURSE,IN_PROGRESS); - } - - if (IsIntroEvent || !IsMainEvent) - return; - - ScriptedAI::MoveInLineOfSight(who); - } - - void EnterCombat(Unit * /*who*/) - { - DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2,SAY_AGGRO_3), me); - } - - void JustSummoned(Creature *summoned) - { - summoned->setFaction(16); - summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - - //triggered spell of consumption does not properly show it's SpellVisual, wrong spellid? - summoned->CastSpell(summoned,SPELL_TEMPORARY_VISUAL,true); - summoned->CastSpell(summoned,SPELL_CONSUMPTION,false,0,0,me->GetGUID()); - } - - void KilledUnit(Unit* /*victim*/) - { - DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me); - } - - void JustDied(Unit* /*Killer*/) - { - DoScriptText(SAY_DIE, me); - - if (!pInstance) - return; - - pInstance->SetData(TYPE_NETHEKURSE,DONE); - pInstance->HandleGameObject(pInstance->GetData64(DATA_NETHEKURSE_DOOR), true); - } - - void UpdateAI(const uint32 diff) - { - if (IsIntroEvent) - { - if (!pInstance) - return; - - if (pInstance->GetData(TYPE_NETHEKURSE) == IN_PROGRESS) - { - if (IntroEvent_Timer <= diff) - DoTauntPeons(); - else - IntroEvent_Timer -= diff; - } - } - - if (!UpdateVictim()) - return; - - if (!IsMainEvent) - return; - - if (Phase) - { - if (!SpinOnce) - { - DoCast(me->getVictim(), SPELL_DARK_SPIN); - SpinOnce = true; - } - - if (Cleave_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SHADOW_CLEAVE); - Cleave_Timer = 6000+rand()%2500; - } else Cleave_Timer -= diff; - } - else - { - if (ShadowFissure_Timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(pTarget, SPELL_SHADOW_FISSURE); - ShadowFissure_Timer = urand(7500,15000); - } else ShadowFissure_Timer -= diff; - - if (DeathCoil_Timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(pTarget, SPELL_DEATH_COIL); - DeathCoil_Timer = urand(15000,20000); - } else DeathCoil_Timer -= diff; - - if ((me->GetHealth()*100) / me->GetMaxHealth() <= 20) - Phase = true; - - DoMeleeAttackIfReady(); - } - } -}; - -struct mob_fel_orc_convertAI : public ScriptedAI -{ - mob_fel_orc_convertAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - uint32 Hemorrhage_Timer; - - void Reset() - { - me->SetNoCallAssistance(true); //we don't want any assistance (WE R HEROZ!) - Hemorrhage_Timer = 3000; - } - - void MoveInLineOfSight(Unit * /*who*/) - { - } - - void EnterCombat(Unit* /*who*/) - { - if (pInstance) - { - if (pInstance->GetData64(DATA_NETHEKURSE)) - { - Creature *pKurse = Unit::GetCreature(*me,pInstance->GetData64(DATA_NETHEKURSE)); - if (pKurse && me->IsWithinDist(pKurse, 45.0f)) - { - CAST_AI(boss_grand_warlock_nethekurseAI, pKurse->AI())->DoYellForPeonAggro(); - - if (pInstance->GetData(TYPE_NETHEKURSE) == IN_PROGRESS) - return; - else - pInstance->SetData(TYPE_NETHEKURSE,IN_PROGRESS); - } - } - } - } - - void JustDied(Unit* /*Killer*/) - { - if (pInstance) - { - if (pInstance->GetData(TYPE_NETHEKURSE) != IN_PROGRESS) - return; - if (pInstance->GetData64(DATA_NETHEKURSE)) - if (Creature *pKurse = Unit::GetCreature(*me,pInstance->GetData64(DATA_NETHEKURSE))) - CAST_AI(boss_grand_warlock_nethekurseAI, pKurse->AI())->DoYellForPeonDeath(); - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (Hemorrhage_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_HEMORRHAGE); - Hemorrhage_Timer = 15000; - } else Hemorrhage_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -//NOTE: this Creature are also summoned by other spells, for different creatures -struct mob_lesser_shadow_fissureAI : public ScriptedAI -{ - mob_lesser_shadow_fissureAI(Creature *c) : ScriptedAI(c) {} - - void Reset() { } - void MoveInLineOfSight(Unit * /*who*/) {} - void AttackStart(Unit* /*who*/) {} - void EnterCombat(Unit* /*who*/) {} -}; - -CreatureAI* GetAI_boss_grand_warlock_nethekurse(Creature* pCreature) -{ - return new boss_grand_warlock_nethekurseAI (pCreature); -} - -CreatureAI* GetAI_mob_fel_orc_convert(Creature* pCreature) -{ - return new mob_fel_orc_convertAI (pCreature); -} - -CreatureAI* GetAI_mob_lesser_shadow_fissure(Creature* pCreature) -{ - return new mob_lesser_shadow_fissureAI (pCreature); -} - -void AddSC_boss_grand_warlock_nethekurse() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "boss_grand_warlock_nethekurse"; - newscript->GetAI = &GetAI_boss_grand_warlock_nethekurse; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_fel_orc_convert"; - newscript->GetAI = &GetAI_mob_fel_orc_convert; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_lesser_shadow_fissure"; - newscript->GetAI = &GetAI_mob_lesser_shadow_fissure; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Outland/hellfire_citadel/shattered_halls/boss_warbringer_omrogg.cpp b/src/server/scripts/Outland/hellfire_citadel/shattered_halls/boss_warbringer_omrogg.cpp deleted file mode 100644 index 6fa1c9efe33..00000000000 --- a/src/server/scripts/Outland/hellfire_citadel/shattered_halls/boss_warbringer_omrogg.cpp +++ /dev/null @@ -1,404 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Warbringer_Omrogg -SD%Complete: 85 -SDComment: Heroic enabled. Spell timing may need additional tweaks -SDCategory: Hellfire Citadel, Shattered Halls -EndScriptData */ - -/* ContentData -mob_omrogg_heads -boss_warbringer_omrogg -EndContentData */ - -#include "ScriptedPch.h" -#include "shattered_halls.h" - -enum eEnums -{ - YELL_DIE_L = -1540039, - YELL_DIE_R = -1540040, - EMOTE_ENRAGE = -1540041, - - SPELL_BLAST_WAVE = 30600, - SPELL_FEAR = 30584, - SPELL_THUNDERCLAP = 30633, - - SPELL_BURNING_MAUL = 30598, - H_SPELL_BURNING_MAUL = 36056, - - NPC_LEFT_HEAD = 19523, - NPC_RIGHT_HEAD = 19524 -}; - -struct Yell -{ - int32 id; - uint32 creature; -}; - -static Yell GoCombat[]= -{ - {-1540018, NPC_LEFT_HEAD}, - {-1540019, NPC_LEFT_HEAD}, - {-1540020, NPC_LEFT_HEAD}, -}; -static Yell GoCombatDelay[]= -{ - {-1540021, NPC_RIGHT_HEAD}, - {-1540022, NPC_RIGHT_HEAD}, - {-1540023, NPC_RIGHT_HEAD}, -}; - -static Yell Threat[]= -{ - {-1540024, NPC_LEFT_HEAD}, - {-1540025, NPC_RIGHT_HEAD}, - {-1540026, NPC_LEFT_HEAD}, - {-1540027, NPC_LEFT_HEAD}, -}; -static Yell ThreatDelay1[]= -{ - {-1540028, NPC_RIGHT_HEAD}, - {-1540029, NPC_LEFT_HEAD}, - {-1540030, NPC_RIGHT_HEAD}, - {-1540031, NPC_RIGHT_HEAD}, -}; -static Yell ThreatDelay2[]= -{ - {-1540032, NPC_LEFT_HEAD}, - {-1540033, NPC_RIGHT_HEAD}, - {-1540034, NPC_LEFT_HEAD}, - {-1540035, NPC_LEFT_HEAD}, -}; - -static Yell Killing[]= -{ - {-1540036, NPC_LEFT_HEAD}, - {-1540037, NPC_RIGHT_HEAD}, -}; -static Yell KillingDelay[]= -{ - {-1540038, NPC_RIGHT_HEAD}, - {-1000000, NPC_LEFT_HEAD}, -}; - -struct mob_omrogg_headsAI : public ScriptedAI -{ - mob_omrogg_headsAI(Creature *c) : ScriptedAI(c) {} - - bool DeathYell; - uint32 Death_Timer; - - void Reset() - { - Death_Timer = 4000; - DeathYell = false; - } - void EnterCombat(Unit* /*who*/) {} - - void DoDeathYell() - { - DeathYell = true; - } - - void UpdateAI(const uint32 diff) - { - if (!DeathYell) - return; - - if (Death_Timer <= diff) - { - DoScriptText(YELL_DIE_R, me); - Death_Timer = false; - me->setDeathState(JUST_DIED); - } else Death_Timer -= diff; - } -}; - -struct boss_warbringer_omroggAI : public ScriptedAI -{ - boss_warbringer_omroggAI(Creature *c) : ScriptedAI(c) - { - LeftHeadGUID = 0; - RightHeadGUID = 0; - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint64 LeftHeadGUID; - uint64 RightHeadGUID; - int iaggro; - int ithreat; - int ikilling; - - bool AggroYell; - bool ThreatYell; - bool ThreatYell2; - bool KillingYell; - - uint32 Delay_Timer; - uint32 BlastWave_Timer; - uint32 BlastCount; - uint32 Fear_Timer; - uint32 BurningMaul_Timer; - uint32 ThunderClap_Timer; - uint32 ResetThreat_Timer; - - void Reset() - { - if (Unit* pLeftHead = Unit::GetUnit(*me,LeftHeadGUID)) - { - pLeftHead->setDeathState(JUST_DIED); - LeftHeadGUID = 0; - } - - if (Unit* pRightHead = Unit::GetUnit(*me,RightHeadGUID)) - { - pRightHead->setDeathState(JUST_DIED); - RightHeadGUID = 0; - } - - AggroYell = false; - ThreatYell = false; - ThreatYell2 = false; - KillingYell = false; - - Delay_Timer = 4000; - BlastWave_Timer = 0; - BlastCount = 0; - Fear_Timer = 8000; - BurningMaul_Timer = 25000; - ThunderClap_Timer = 15000; - ResetThreat_Timer = 30000; - - if (pInstance) - pInstance->SetData(TYPE_OMROGG, NOT_STARTED); //End boss can use this later. O'mrogg must be defeated(DONE) or he will come to aid. - } - - void DoYellForThreat() - { - Unit *pLeftHead = Unit::GetUnit(*me,LeftHeadGUID); - Unit *pRightHead = Unit::GetUnit(*me,RightHeadGUID); - - if (!pLeftHead || !pRightHead) - return; - - ithreat = rand()%4; - - Unit *source = (pLeftHead->GetEntry() == Threat[ithreat].creature ? pLeftHead : pRightHead); - - DoScriptText(Threat[ithreat].id, source); - - Delay_Timer = 3500; - ThreatYell = true; - } - - void EnterCombat(Unit * /*who*/) - { - me->SummonCreature(NPC_LEFT_HEAD, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_DEAD_DESPAWN, 0); - me->SummonCreature(NPC_RIGHT_HEAD, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_DEAD_DESPAWN, 0); - - if (Unit *pLeftHead = Unit::GetUnit(*me,LeftHeadGUID)) - { - iaggro = rand()%3; - - DoScriptText(GoCombat[iaggro].id, pLeftHead); - - Delay_Timer = 3500; - AggroYell = true; - } - - if (pInstance) - pInstance->SetData(TYPE_OMROGG, IN_PROGRESS); - } - - void JustSummoned(Creature *summoned) - { - if (summoned->GetEntry() == NPC_LEFT_HEAD) - LeftHeadGUID = summoned->GetGUID(); - - if (summoned->GetEntry() == NPC_RIGHT_HEAD) - RightHeadGUID = summoned->GetGUID(); - - //summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - //summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - summoned->SetVisibility(VISIBILITY_OFF); - } - - void KilledUnit(Unit* /*victim*/) - { - Unit* pLeftHead = Unit::GetUnit(*me,LeftHeadGUID); - Unit* pRightHead = Unit::GetUnit(*me,RightHeadGUID); - - if (!pLeftHead || !pRightHead) - return; - - ikilling = rand()%2; - - Unit *source = (pLeftHead->GetEntry() == Killing[ikilling].creature ? pLeftHead : pRightHead); - - switch(ikilling) - { - case 0: - DoScriptText(Killing[ikilling].id, source); - Delay_Timer = 3500; - KillingYell = true; - break; - case 1: - DoScriptText(Killing[ikilling].id, source); - KillingYell = false; - break; - } - } - - void JustDied(Unit* /*Killer*/) - { - Unit* pLeftHead = Unit::GetUnit(*me,LeftHeadGUID); - Unit* pRightHead = Unit::GetUnit(*me,RightHeadGUID); - - if (!pLeftHead || !pRightHead) - return; - - DoScriptText(YELL_DIE_L, pLeftHead); - - CAST_AI(mob_omrogg_headsAI, CAST_CRE(pRightHead)->AI())->DoDeathYell(); - - if (pInstance) - pInstance->SetData(TYPE_OMROGG, DONE); - } - - void UpdateAI(const uint32 diff) - { - if (Delay_Timer <= diff) - { - Delay_Timer = 3500; - - Unit* pLeftHead = Unit::GetUnit(*me,LeftHeadGUID); - Unit* pRightHead = Unit::GetUnit(*me,RightHeadGUID); - - if (!pLeftHead || !pRightHead) - return; - - if (AggroYell) - { - DoScriptText(GoCombatDelay[iaggro].id, pRightHead); - AggroYell = false; - } - - if (ThreatYell2) - { - Unit *source = (pLeftHead->GetEntry() == ThreatDelay2[ithreat].creature ? pLeftHead : pRightHead); - - DoScriptText(ThreatDelay2[ithreat].id, source); - ThreatYell2 = false; - } - - if (ThreatYell) - { - Unit *source = (pLeftHead->GetEntry() == ThreatDelay1[ithreat].creature ? pLeftHead : pRightHead); - - DoScriptText(ThreatDelay1[ithreat].id, source); - ThreatYell = false; - ThreatYell2 = true; - } - - if (KillingYell) - { - Unit *source = (pLeftHead->GetEntry() == KillingDelay[ikilling].creature ? pLeftHead : pRightHead); - - DoScriptText(KillingDelay[ikilling].id, source); - KillingYell = false; - } - } else Delay_Timer -= diff; - - if (!UpdateVictim()) - return; - - if (BlastCount && BlastWave_Timer <= diff) - { - DoCast(me, SPELL_BLAST_WAVE); - BlastWave_Timer = 5000; - ++BlastCount; - - if (BlastCount == 3) - BlastCount = 0; - } else BlastWave_Timer -= diff; - - if (BurningMaul_Timer <= diff) - { - DoScriptText(EMOTE_ENRAGE, me); - DoCast(me, SPELL_BURNING_MAUL); - BurningMaul_Timer = 40000; - BlastWave_Timer = 16000; - BlastCount = 1; - } else BurningMaul_Timer -= diff; - - if (ResetThreat_Timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) - { - DoYellForThreat(); - DoResetThreat(); - me->AddThreat(pTarget, 0.0f); - } - ResetThreat_Timer = 25000+rand()%15000; - } else ResetThreat_Timer -= diff; - - if (Fear_Timer <= diff) - { - DoCast(me, SPELL_FEAR); - Fear_Timer = 15000+rand()%20000; - } else Fear_Timer -= diff; - - if (ThunderClap_Timer <= diff) - { - DoCast(me, SPELL_THUNDERCLAP); - ThunderClap_Timer = 15000+rand()%15000; - } else ThunderClap_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_warbringer_omrogg(Creature* pCreature) -{ - return new boss_warbringer_omroggAI (pCreature); -} - -CreatureAI* GetAI_mob_omrogg_heads(Creature* pCreature) -{ - return new mob_omrogg_headsAI (pCreature); -} - -void AddSC_boss_warbringer_omrogg() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "boss_warbringer_omrogg"; - newscript->GetAI = &GetAI_boss_warbringer_omrogg; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_omrogg_heads"; - newscript->GetAI = &GetAI_mob_omrogg_heads; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Outland/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp b/src/server/scripts/Outland/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp deleted file mode 100644 index b108077518a..00000000000 --- a/src/server/scripts/Outland/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp +++ /dev/null @@ -1,288 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Warchief_Kargath_Bladefist -SD%Complete: 90 -SDComment: -SDCategory: Hellfire Citadel, Shattered Halls -EndScriptData */ - -/* ContentData -boss_warchief_kargath_bladefist -EndContentData */ - -#include "ScriptedPch.h" - -#define SAY_AGGRO1 -1540042 -#define SAY_AGGRO2 -1540043 -#define SAY_AGGRO3 -1540044 -#define SAY_SLAY1 -1540045 -#define SAY_SLAY2 -1540046 -#define SAY_DEATH -1540047 - -#define SPELL_BLADE_DANCE 30739 -#define H_SPELL_CHARGE 25821 - -#define TARGET_NUM 5 - -#define MOB_SHATTERED_ASSASSIN 17695 -#define MOB_HEARTHEN_GUARD 17621 -#define MOB_SHARPSHOOTER_GUARD 17622 -#define MOB_REAVER_GUARD 17623 - -float AssassEntrance[3] = {275.136,-84.29,2.3}; // y -8 -float AssassExit[3] = {184.233,-84.29,2.3}; // y -8 -float AddsEntrance[3] = {306.036,-84.29,1.93}; - -struct boss_warchief_kargath_bladefistAI : public ScriptedAI -{ - boss_warchief_kargath_bladefistAI(Creature *c) : ScriptedAI(c) - { - } - - std::vector adds; - std::vector assassins; - - uint32 Charge_timer; - uint32 Blade_Dance_Timer; - uint32 Summon_Assistant_Timer; - uint32 resetcheck_timer; - uint32 Wait_Timer; - - uint32 Assassins_Timer; - - uint32 summoned; - bool InBlade; - - uint32 target_num; - - void Reset() - { - removeAdds(); - - me->SetSpeed(MOVE_RUN,2); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - - summoned = 2; - InBlade = false; - Wait_Timer = 0; - - Charge_timer = 0; - Blade_Dance_Timer = 45000; - Summon_Assistant_Timer = 30000; - Assassins_Timer = 5000; - resetcheck_timer = 5000; - } - - void EnterCombat(Unit * /*who*/) - { - DoScriptText(RAND(SAY_AGGRO1,SAY_AGGRO2,SAY_AGGRO3), me); - } - - void JustSummoned(Creature *summoned) - { - switch(summoned->GetEntry()) - { - case MOB_HEARTHEN_GUARD: - case MOB_SHARPSHOOTER_GUARD: - case MOB_REAVER_GUARD: - summoned->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM,0)); - adds.push_back(summoned->GetGUID()); - break; - case MOB_SHATTERED_ASSASSIN: - assassins.push_back(summoned->GetGUID()); - break; - } - } - - void KilledUnit(Unit* victim) - { - if (victim->GetTypeId() == TYPEID_PLAYER) - { - DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me); - } - } - - void JustDied(Unit* /*Killer*/) - { - DoScriptText(SAY_DEATH, me); - removeAdds(); - } - - void MovementInform(uint32 type, uint32 id) - { - if (InBlade) - { - if (type != POINT_MOTION_TYPE) - return; - - if (id != 1) - return; - - if (target_num > 0) // to prevent loops - { - Wait_Timer = 1; - DoCast(me, SPELL_BLADE_DANCE, true); - target_num--; - } - } - } - - void removeAdds() - { - for (std::vector::const_iterator itr = adds.begin(); itr!= adds.end(); ++itr) - { - Unit* temp = Unit::GetUnit((*me),*itr); - if (temp && temp->isAlive()) - { - (*temp).GetMotionMaster()->Clear(true); - me->DealDamage(temp,temp->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - CAST_CRE(temp)->RemoveCorpse(); - } - } - adds.clear(); - - for (std::vector::const_iterator itr = assassins.begin(); itr!= assassins.end(); ++itr) - { - Unit* temp = Unit::GetUnit((*me),*itr); - if (temp && temp->isAlive()) - { - (*temp).GetMotionMaster()->Clear(true); - me->DealDamage(temp,temp->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - CAST_CRE(temp)->RemoveCorpse(); - } - } - assassins.clear(); - } - void SpawnAssassin() - { - me->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassEntrance[0],AssassEntrance[1]+8, AssassEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); - me->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassEntrance[0],AssassEntrance[1]-8, AssassEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); - me->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassExit[0],AssassExit[1]+8, AssassExit[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); - me->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassExit[0],AssassExit[1]-8, AssassExit[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - if (Assassins_Timer) - if (Assassins_Timer <= diff) - { - SpawnAssassin(); - Assassins_Timer = 0; - } else Assassins_Timer -= diff; - - if (InBlade) - { - if (Wait_Timer) - if (Wait_Timer <= diff) - { - if (target_num <= 0) - { - // stop bladedance - InBlade = false; - me->SetSpeed(MOVE_RUN,2); - me->GetMotionMaster()->MoveChase(me->getVictim()); - Blade_Dance_Timer = 30000; - Wait_Timer = 0; - if (IsHeroic()) - Charge_timer = 5000; - } - else - { - //move in bladedance - float x,y,randx,randy; - randx = (rand()%40); - randy = (rand()%40); - x = 210+ randx ; - y = -60- randy ; - me->GetMotionMaster()->MovePoint(1,x,y,me->GetPositionZ()); - Wait_Timer = 0; - } - } else Wait_Timer -= diff; - } - else - { - if (Blade_Dance_Timer) - if (Blade_Dance_Timer <= diff) - { - target_num = TARGET_NUM; - Wait_Timer = 1; - InBlade = true; - Blade_Dance_Timer = 0; - me->SetSpeed(MOVE_RUN,4); - return; - } else Blade_Dance_Timer -= diff; - - if (Charge_timer) - if (Charge_timer <= diff) - { - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), H_SPELL_CHARGE); - Charge_timer = 0; - } else Charge_timer -= diff; - - if (Summon_Assistant_Timer <= diff) - { - for (uint8 i = 0; i < summoned; ++i) - { - switch (urand(0,2)) - { - case 0: me->SummonCreature(MOB_HEARTHEN_GUARD,AddsEntrance[0],AddsEntrance[1], AddsEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); break; - case 1: me->SummonCreature(MOB_SHARPSHOOTER_GUARD,AddsEntrance[0],AddsEntrance[1], AddsEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); break; - case 2: me->SummonCreature(MOB_REAVER_GUARD,AddsEntrance[0],AddsEntrance[1], AddsEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); break; - } - } - if (urand(0,9) < 2) - ++summoned; - Summon_Assistant_Timer = urand(25000,35000); - } else Summon_Assistant_Timer -= diff; - - DoMeleeAttackIfReady(); - } - - if (resetcheck_timer <= diff) - { - uint32 tempx,tempy; - tempx = uint32(me->GetPositionX()); - tempy = uint32(me->GetPositionY()); - if (tempx > 255 || tempx < 205) - { - EnterEvadeMode(); - return; - } - resetcheck_timer = 5000; - } else resetcheck_timer -= diff; - } -}; - -CreatureAI* GetAI_boss_warchief_kargath_bladefist(Creature* pCreature) -{ - return new boss_warchief_kargath_bladefistAI (pCreature); -} - -void AddSC_boss_warchief_kargath_bladefist() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_warchief_kargath_bladefist"; - newscript->GetAI = &GetAI_boss_warchief_kargath_bladefist; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Outland/hellfire_citadel/shattered_halls/instance_shattered_halls.cpp b/src/server/scripts/Outland/hellfire_citadel/shattered_halls/instance_shattered_halls.cpp deleted file mode 100644 index c29df4d6411..00000000000 --- a/src/server/scripts/Outland/hellfire_citadel/shattered_halls/instance_shattered_halls.cpp +++ /dev/null @@ -1,114 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Instance_Shattered_Halls -SD%Complete: 50 -SDComment: currently missing info about door. instance not complete -SDCategory: Hellfire Citadel, Shattered Halls -EndScriptData */ - -#include "ScriptedPch.h" -#include "shattered_halls.h" - -#define MAX_ENCOUNTER 2 - -#define DOOR_NETHEKURSE 1 - -struct instance_shattered_halls : public ScriptedInstance -{ - instance_shattered_halls(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - uint64 nethekurseGUID; - uint64 nethekurseDoorGUID; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - nethekurseGUID = 0; - nethekurseDoorGUID = 0; - } - - void OnGameObjectCreate(GameObject* pGo, bool /*add*/) - { - switch(pGo->GetEntry()) - { - case DOOR_NETHEKURSE: nethekurseDoorGUID = pGo->GetGUID(); break; - } - } - - void OnCreatureCreate(Creature* pCreature, bool /*add*/) - { - switch(pCreature->GetEntry()) - { - case 16807: nethekurseGUID = pCreature->GetGUID(); break; - } - } - - void SetData(uint32 type, uint32 data) - { - switch(type) - { - case TYPE_NETHEKURSE: - m_auiEncounter[0] = data; - break; - case TYPE_OMROGG: - m_auiEncounter[1] = data; - break; - } - } - - uint32 GetData(uint32 type) - { - switch(type) - { - case TYPE_NETHEKURSE: - return m_auiEncounter[0]; - case TYPE_OMROGG: - return m_auiEncounter[1]; - } - return 0; - } - - uint64 GetData64(uint32 data) - { - switch(data) - { - case DATA_NETHEKURSE: - return nethekurseGUID; - case DATA_NETHEKURSE_DOOR: - return nethekurseDoorGUID; - } - return 0; - } -}; - -InstanceData* GetInstanceData_instance_shattered_halls(Map* pMap) -{ - return new instance_shattered_halls(pMap); -} - -void AddSC_instance_shattered_halls() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_shattered_halls"; - newscript->GetInstanceData = &GetInstanceData_instance_shattered_halls; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Outland/hellfire_citadel/shattered_halls/shattered_halls.h b/src/server/scripts/Outland/hellfire_citadel/shattered_halls/shattered_halls.h deleted file mode 100644 index cbfa23ec4e0..00000000000 --- a/src/server/scripts/Outland/hellfire_citadel/shattered_halls/shattered_halls.h +++ /dev/null @@ -1,14 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ - -#ifndef DEF_SHATTERED_H -#define DEF_SHATTERED_H - -#define TYPE_NETHEKURSE 1 -#define DATA_NETHEKURSE 2 -#define DATA_NETHEKURSE_DOOR 3 - -#define TYPE_OMROGG 4 -#endif - diff --git a/src/server/scripts/Outland/tempest_keep/arcatraz/arcatraz.cpp b/src/server/scripts/Outland/tempest_keep/arcatraz/arcatraz.cpp deleted file mode 100644 index 69dbc877d89..00000000000 --- a/src/server/scripts/Outland/tempest_keep/arcatraz/arcatraz.cpp +++ /dev/null @@ -1,520 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Arcatraz -SD%Complete: 60 -SDComment: Warden Mellichar, event controller for Skyriss event. Millhouse Manastorm. TODO: make better combatAI for Millhouse. -SDCategory: Tempest Keep, The Arcatraz -EndScriptData */ - -/* ContentData -npc_millhouse_manastorm -npc_warden_mellichar -mob_zerekethvoidzone -EndContentData */ - -#include "ScriptedPch.h" -#include "arcatraz.h" - -/*##### -# npc_millhouse_manastorm -#####*/ - -#define SAY_INTRO_1 -1552010 -#define SAY_INTRO_2 -1552011 -#define SAY_WATER -1552012 -#define SAY_BUFFS -1552013 -#define SAY_DRINK -1552014 -#define SAY_READY -1552015 -#define SAY_KILL_1 -1552016 -#define SAY_KILL_2 -1552017 -#define SAY_PYRO -1552018 -#define SAY_ICEBLOCK -1552019 -#define SAY_LOWHP -1552020 -#define SAY_DEATH -1552021 -#define SAY_COMPLETE -1552022 - -#define SPELL_CONJURE_WATER 36879 -#define SPELL_ARCANE_INTELLECT 36880 -#define SPELL_ICE_ARMOR 36881 - -#define SPELL_ARCANE_MISSILES 33833 -#define SPELL_CONE_OF_COLD 12611 -#define SPELL_FIRE_BLAST 13341 -#define SPELL_FIREBALL 14034 -#define SPELL_FROSTBOLT 15497 -#define SPELL_PYROBLAST 33975 - -struct npc_millhouse_manastormAI : public ScriptedAI -{ - npc_millhouse_manastormAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint32 EventProgress_Timer; - uint32 Phase; - bool Init; - bool LowHp; - - uint32 Pyroblast_Timer; - uint32 Fireball_Timer; - - void Reset() - { - EventProgress_Timer = 2000; - LowHp = false; - Init = false; - Phase = 1; - - Pyroblast_Timer = 1000; - Fireball_Timer = 2500; - - if (pInstance) - { - if (pInstance->GetData(TYPE_WARDEN_2) == DONE) - Init = true; - - if (pInstance->GetData(TYPE_HARBINGERSKYRISS) == DONE) - { - DoScriptText(SAY_COMPLETE, me); - } - } - } - - void AttackStart(Unit* pWho) - { - if (me->Attack(pWho, true)) - { - me->AddThreat(pWho, 0.0f); - me->SetInCombatWith(pWho); - pWho->SetInCombatWith(me); - - me->GetMotionMaster()->MoveChase(pWho, 25.0f); - } - } - - void EnterCombat(Unit * /*who*/) - { - } - - void KilledUnit(Unit * /*victim*/) - { - DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2), me); - } - - void JustDied(Unit * /*victim*/) - { - DoScriptText(SAY_DEATH, me); - - /*for questId 10886 (heroic mode only) - if (pInstance && pInstance->GetData(TYPE_HARBINGERSKYRISS) != DONE) - ->FailQuest();*/ - } - - void UpdateAI(const uint32 diff) - { - if (!Init) - { - if (EventProgress_Timer <= diff) - { - if (Phase < 8) - { - switch(Phase) - { - case 1: - DoScriptText(SAY_INTRO_1, me); - EventProgress_Timer = 18000; - break; - case 2: - DoScriptText(SAY_INTRO_2, me); - EventProgress_Timer = 18000; - break; - case 3: - DoScriptText(SAY_WATER, me); - DoCast(me, SPELL_CONJURE_WATER); - EventProgress_Timer = 7000; - break; - case 4: - DoScriptText(SAY_BUFFS, me); - DoCast(me, SPELL_ICE_ARMOR); - EventProgress_Timer = 7000; - break; - case 5: - DoScriptText(SAY_DRINK, me); - DoCast(me, SPELL_ARCANE_INTELLECT); - EventProgress_Timer = 7000; - break; - case 6: - DoScriptText(SAY_READY, me); - EventProgress_Timer = 6000; - break; - case 7: - if (pInstance) - pInstance->SetData(TYPE_WARDEN_2,DONE); - Init = true; - break; - } - ++Phase; - } - } else EventProgress_Timer -= diff; - } - - if (!UpdateVictim()) - return; - - if (!LowHp && ((me->GetHealth()*100 / me->GetMaxHealth()) < 20)) - { - DoScriptText(SAY_LOWHP, me); - LowHp = true; - } - - if (Pyroblast_Timer <= diff) - { - if (me->IsNonMeleeSpellCasted(false)) - return; - - DoScriptText(SAY_PYRO, me); - - DoCast(me->getVictim(), SPELL_PYROBLAST); - Pyroblast_Timer = 40000; - } else Pyroblast_Timer -=diff; - - if (Fireball_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_FIREBALL); - Fireball_Timer = 4000; - } else Fireball_Timer -=diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_npc_millhouse_manastorm(Creature* pCreature) -{ - return new npc_millhouse_manastormAI (pCreature); -} - -/*##### -# npc_warden_mellichar -#####*/ - -#define YELL_INTRO1 -1552023 -#define YELL_INTRO2 -1552024 -#define YELL_RELEASE1 -1552025 -#define YELL_RELEASE2A -1552026 -#define YELL_RELEASE2B -1552027 -#define YELL_RELEASE3 -1552028 -#define YELL_RELEASE4 -1552029 -#define YELL_WELCOME -1552030 - -//phase 2(acid mobs) -#define ENTRY_TRICKSTER 20905 -#define ENTRY_PH_HUNTER 20906 -//phase 3 -#define ENTRY_MILLHOUSE 20977 -//phase 4(acid mobs) -#define ENTRY_AKKIRIS 20908 -#define ENTRY_SULFURON 20909 -//phase 5(acid mobs) -#define ENTRY_TW_DRAK 20910 -#define ENTRY_BL_DRAK 20911 -//phase 6 -#define ENTRY_SKYRISS 20912 - -//TARGET_SCRIPT -#define SPELL_TARGET_ALPHA 36856 -#define SPELL_TARGET_BETA 36854 -#define SPELL_TARGET_DELTA 36857 -#define SPELL_TARGET_GAMMA 36858 -#define SPELL_TARGET_OMEGA 36852 -#define SPELL_BUBBLE_VISUAL 36849 - -struct npc_warden_mellicharAI : public ScriptedAI -{ - npc_warden_mellicharAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - bool IsRunning; - bool CanSpawn; - - uint32 EventProgress_Timer; - uint32 Phase; - - void Reset() - { - IsRunning = false; - CanSpawn = false; - - EventProgress_Timer = 22000; - Phase = 1; - - me->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE); - DoCast(me, SPELL_TARGET_OMEGA); - - if (pInstance) - pInstance->SetData(TYPE_HARBINGERSKYRISS,NOT_STARTED); - } - - void AttackStart(Unit* /*who*/) {} - - void MoveInLineOfSight(Unit *who) - { - if (IsRunning) - return; - - if (!me->getVictim() && who->isTargetableForAttack() && (me->IsHostileTo(who)) && who->isInAccessiblePlaceFor(me)) - { - if (!me->canFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) - return; - if (who->GetTypeId() != TYPEID_PLAYER) - return; - - float attackRadius = me->GetAttackDistance(who)/10; - if (me->IsWithinDistInMap(who, attackRadius) && me->IsWithinLOSInMap(who)) - EnterCombat(who); - } - } - - void EnterCombat(Unit * /*who*/) - { - DoScriptText(YELL_INTRO1, me); - DoCast(me, SPELL_BUBBLE_VISUAL); - - if (pInstance) - { - pInstance->SetData(TYPE_HARBINGERSKYRISS,IN_PROGRESS); - pInstance->HandleGameObject(pInstance->GetData64(DATA_SPHERE_SHIELD), false); - IsRunning = true; - } - } - - bool CanProgress() - { - if (pInstance) - { - if (Phase == 7 && pInstance->GetData(TYPE_WARDEN_4) == DONE) - return true; - if (Phase == 6 && pInstance->GetData(TYPE_WARDEN_3) == DONE) - return true; - if (Phase == 5 && pInstance->GetData(TYPE_WARDEN_2) == DONE) - return true; - if (Phase == 4) - return true; - if (Phase == 3 && pInstance->GetData(TYPE_WARDEN_1) == DONE) - return true; - if (Phase == 2 && pInstance->GetData(TYPE_HARBINGERSKYRISS) == IN_PROGRESS) - return true; - if (Phase == 1 && pInstance->GetData(TYPE_HARBINGERSKYRISS) == IN_PROGRESS) - return true; - return false; - } - return false; - } - - void DoPrepareForPhase() - { - if (pInstance) - { - me->InterruptNonMeleeSpells(true); - me->RemoveAurasByType(SPELL_AURA_DUMMY); - - switch(Phase) - { - case 2: - DoCast(me, SPELL_TARGET_ALPHA); - pInstance->SetData(TYPE_WARDEN_1,IN_PROGRESS); - pInstance->HandleGameObject(pInstance->GetData64(DATA_SPHERE_SHIELD), false); - break; - case 3: - DoCast(me, SPELL_TARGET_BETA); - pInstance->SetData(TYPE_WARDEN_2,IN_PROGRESS); - break; - case 5: - DoCast(me, SPELL_TARGET_DELTA); - pInstance->SetData(TYPE_WARDEN_3,IN_PROGRESS); - break; - case 6: - DoCast(me, SPELL_TARGET_GAMMA); - pInstance->SetData(TYPE_WARDEN_4,IN_PROGRESS); - break; - case 7: - pInstance->SetData(TYPE_WARDEN_5,IN_PROGRESS); - break; - } - CanSpawn = true; - } - } - - void UpdateAI(const uint32 diff) - { - if (!IsRunning) - return; - - if (EventProgress_Timer <= diff) - { - if (pInstance) - { - if (pInstance->GetData(TYPE_HARBINGERSKYRISS) == FAIL) - { - Reset(); - return; - } - } - - if (CanSpawn) - { - //continue beam omega pod, unless we are about to summon skyriss - if (Phase != 7) - DoCast(me, SPELL_TARGET_OMEGA); - - switch(Phase) - { - case 2: - switch (urand(0,1)) - { - case 0: me->SummonCreature(ENTRY_TRICKSTER,478.326,-148.505,42.56,3.19,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break; - case 1: me->SummonCreature(ENTRY_PH_HUNTER,478.326,-148.505,42.56,3.19,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break; - } - break; - case 3: - me->SummonCreature(ENTRY_MILLHOUSE,413.292,-148.378,42.56,6.27,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); - break; - case 4: - DoScriptText(YELL_RELEASE2B, me); - break; - case 5: - switch (urand(0,1)) - { - case 0: me->SummonCreature(ENTRY_AKKIRIS,420.179,-174.396,42.58,0.02,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break; - case 1: me->SummonCreature(ENTRY_SULFURON,420.179,-174.396,42.58,0.02,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break; - } - break; - case 6: - switch (urand(0,1)) - { - case 0: me->SummonCreature(ENTRY_TW_DRAK,471.795,-174.58,42.58,3.06,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break; - case 1: me->SummonCreature(ENTRY_BL_DRAK,471.795,-174.58,42.58,3.06,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break; - } - break; - case 7: - me->SummonCreature(ENTRY_SKYRISS,445.763,-191.639,44.64,1.60,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); - DoScriptText(YELL_WELCOME, me); - break; - } - CanSpawn = false; - ++Phase; - } - if (CanProgress()) - { - switch(Phase) - { - case 1: - DoScriptText(YELL_INTRO2, me); - EventProgress_Timer = 10000; - ++Phase; - break; - case 2: - DoScriptText(YELL_RELEASE1, me); - DoPrepareForPhase(); - EventProgress_Timer = 7000; - break; - case 3: - DoScriptText(YELL_RELEASE2A, me); - DoPrepareForPhase(); - EventProgress_Timer = 10000; - break; - case 4: - DoPrepareForPhase(); - EventProgress_Timer = 15000; - break; - case 5: - DoScriptText(YELL_RELEASE3, me); - DoPrepareForPhase(); - EventProgress_Timer = 15000; - break; - case 6: - DoScriptText(YELL_RELEASE4, me); - DoPrepareForPhase(); - EventProgress_Timer = 15000; - break; - case 7: - DoPrepareForPhase(); - EventProgress_Timer = 15000; - break; - } - } - } else EventProgress_Timer -= diff; - } -}; -CreatureAI* GetAI_npc_warden_mellichar(Creature* pCreature) -{ - return new npc_warden_mellicharAI (pCreature); -} - -/*##### -# mob_zerekethvoidzone (this script probably not needed in future -> `creature_template_addon`.`auras`='36120 0') -#####*/ - -#define SPELL_VOID_ZONE_DAMAGE 36120 - -struct mob_zerekethvoidzoneAI : public ScriptedAI -{ - mob_zerekethvoidzoneAI(Creature *c) : ScriptedAI(c) {} - - void Reset() - { - me->SetUInt32Value(UNIT_NPC_FLAGS,0); - me->setFaction(16); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - - DoCast(me, SPELL_VOID_ZONE_DAMAGE); - } - - void EnterCombat(Unit* /*who*/) {} -}; -CreatureAI* GetAI_mob_zerekethvoidzoneAI(Creature* pCreature) -{ - return new mob_zerekethvoidzoneAI (pCreature); -} - -void AddSC_arcatraz() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "npc_millhouse_manastorm"; - newscript->GetAI = &GetAI_npc_millhouse_manastorm; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_warden_mellichar"; - newscript->GetAI = &GetAI_npc_warden_mellichar; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_zerekethvoidzone"; - newscript->GetAI = &GetAI_mob_zerekethvoidzoneAI; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Outland/tempest_keep/arcatraz/arcatraz.h b/src/server/scripts/Outland/tempest_keep/arcatraz/arcatraz.h deleted file mode 100644 index 3f8dee8bbd0..00000000000 --- a/src/server/scripts/Outland/tempest_keep/arcatraz/arcatraz.h +++ /dev/null @@ -1,21 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ - -#ifndef DEF_ARCATRAZ_H -#define DEF_ARCATRAZ_H - -#define TYPE_ZEREKETH 1 -#define TYPE_DALLIAH 2 -#define TYPE_SOCCOTHRATES 3 -#define TYPE_HARBINGERSKYRISS 4 -#define TYPE_WARDEN_1 5 -#define TYPE_WARDEN_2 6 -#define TYPE_WARDEN_3 7 -#define TYPE_WARDEN_4 8 -#define TYPE_WARDEN_5 9 -#define DATA_MELLICHAR 10 -#define TYPE_SHIELD_OPEN 11 -#define DATA_SPHERE_SHIELD 12 -#endif - diff --git a/src/server/scripts/Outland/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp b/src/server/scripts/Outland/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp deleted file mode 100644 index 6576974f3ff..00000000000 --- a/src/server/scripts/Outland/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp +++ /dev/null @@ -1,293 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Harbinger_Skyriss -SD%Complete: 45 -SDComment: CombatAI not fully implemented. Timers will need adjustments. Need more docs on how event fully work. Reset all event and force start over if fail at one point? -SDCategory: Tempest Keep, The Arcatraz -EndScriptData */ - -/* ContentData -boss_harbinger_skyriss -boss_harbinger_skyriss_illusion -EndContentData */ - -#include "ScriptedPch.h" -#include "arcatraz.h" - -#define SAY_INTRO -1552000 -#define SAY_AGGRO -1552001 -#define SAY_KILL_1 -1552002 -#define SAY_KILL_2 -1552003 -#define SAY_MIND_1 -1552004 -#define SAY_MIND_2 -1552005 -#define SAY_FEAR_1 -1552006 -#define SAY_FEAR_2 -1552007 -#define SAY_IMAGE -1552008 -#define SAY_DEATH -1552009 - -#define SPELL_FEAR 39415 - -#define SPELL_MIND_REND 36924 -#define H_SPELL_MIND_REND 39017 - -#define SPELL_DOMINATION 37162 -#define H_SPELL_DOMINATION 39019 - -#define H_SPELL_MANA_BURN 39020 - -#define SPELL_66_ILLUSION 36931 //entry 21466 -#define SPELL_33_ILLUSION 36932 //entry 21467 - -struct boss_harbinger_skyrissAI : public ScriptedAI -{ - boss_harbinger_skyrissAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - Intro = false; - } - - ScriptedInstance *pInstance; - - bool Intro; - bool IsImage33; - bool IsImage66; - - uint32 Intro_Phase; - uint32 Intro_Timer; - uint32 MindRend_Timer; - uint32 Fear_Timer; - uint32 Domination_Timer; - uint32 ManaBurn_Timer; - - void Reset() - { - if (!Intro) - me->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_OOC_NOT_ATTACKABLE); - - IsImage33 = false; - IsImage66 = false; - - Intro_Phase = 1; - Intro_Timer = 5000; - MindRend_Timer = 3000; - Fear_Timer = 15000; - Domination_Timer = 30000; - ManaBurn_Timer = 25000; - } - - void MoveInLineOfSight(Unit *who) - { - if (!Intro) - { - return; - } - ScriptedAI::MoveInLineOfSight(who); - } - - void EnterCombat(Unit * /*who*/) {} - - void JustDied(Unit* /*Killer*/) - { - DoScriptText(SAY_DEATH, me); - if (pInstance) - pInstance->SetData(TYPE_HARBINGERSKYRISS,DONE); - } - - void JustSummoned(Creature *summon) - { - if (!summon) - return; - if (IsImage66) - summon->SetHealth((summon->GetMaxHealth()*33)/100); - else - summon->SetHealth((summon->GetMaxHealth()*66)/100); - if (me->getVictim()) - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) - summon->AI()->AttackStart(pTarget); - } - - void KilledUnit(Unit* victim) - { - //won't yell killing pet/other unit - if (victim->GetEntry() == 21436) - return; - - DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2), me); - } - - void DoSplit(uint32 val) - { - if (me->IsNonMeleeSpellCasted(false)) - me->InterruptNonMeleeSpells(false); - - DoScriptText(SAY_IMAGE, me); - - if (val == 66) - DoCast(me, SPELL_66_ILLUSION); - else - DoCast(me, SPELL_33_ILLUSION); - } - - void UpdateAI(const uint32 diff) - { - if (!Intro) - { - if (!pInstance) - return; - - if (Intro_Timer <= diff) - { - switch(Intro_Phase) - { - case 1: - DoScriptText(SAY_INTRO, me); - pInstance->HandleGameObject(pInstance->GetData64(DATA_SPHERE_SHIELD), true); - ++Intro_Phase; - Intro_Timer = 25000; - break; - case 2: - DoScriptText(SAY_AGGRO, me); - if (Unit *mellic = Unit::GetUnit(*me,pInstance->GetData64(DATA_MELLICHAR))) - { - //should have a better way to do this. possibly spell exist. - mellic->setDeathState(JUST_DIED); - mellic->SetHealth(0); - pInstance->SetData(TYPE_SHIELD_OPEN,IN_PROGRESS); - } - ++Intro_Phase; - Intro_Timer = 3000; - break; - case 3: - me->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_OOC_NOT_ATTACKABLE); - Intro = true; - break; - } - } else Intro_Timer -=diff; - } - - if (!UpdateVictim()) - return; - - if (!IsImage66 && ((me->GetHealth()*100) / me->GetMaxHealth() <= 66)) - { - DoSplit(66); - IsImage66 = true; - } - if (!IsImage33 && ((me->GetHealth()*100) / me->GetMaxHealth() <= 33)) - { - DoSplit(33); - IsImage33 = true; - } - - if (MindRend_Timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1)) - DoCast(pTarget, SPELL_MIND_REND); - else - DoCast(me->getVictim(), SPELL_MIND_REND); - - MindRend_Timer = 8000; - } else MindRend_Timer -=diff; - - if (Fear_Timer <= diff) - { - if (me->IsNonMeleeSpellCasted(false)) - return; - - DoScriptText(RAND(SAY_FEAR_1,SAY_FEAR_2), me); - - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1)) - DoCast(pTarget, SPELL_FEAR); - else - DoCast(me->getVictim(), SPELL_FEAR); - - Fear_Timer = 25000; - } else Fear_Timer -=diff; - - if (Domination_Timer <= diff) - { - if (me->IsNonMeleeSpellCasted(false)) - return; - - DoScriptText(RAND(SAY_MIND_1,SAY_MIND_2), me); - - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1)) - DoCast(pTarget, SPELL_DOMINATION); - else - DoCast(me->getVictim(), SPELL_DOMINATION); - - Domination_Timer = 16000+rand()%16000; - } else Domination_Timer -=diff; - - if (IsHeroic()) - { - if (ManaBurn_Timer <= diff) - { - if (me->IsNonMeleeSpellCasted(false)) - return; - - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1)) - DoCast(pTarget, H_SPELL_MANA_BURN); - - ManaBurn_Timer = 16000+rand()%16000; - } else ManaBurn_Timer -=diff; - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_harbinger_skyriss(Creature* pCreature) -{ - return new boss_harbinger_skyrissAI (pCreature); -} - -#define SPELL_MIND_REND_IMAGE 36929 -#define H_SPELL_MIND_REND_IMAGE 39021 - -struct boss_harbinger_skyriss_illusionAI : public ScriptedAI -{ - boss_harbinger_skyriss_illusionAI(Creature *c) : ScriptedAI(c) - { - } - - void Reset() { } - - void EnterCombat(Unit * /*who*/) { } -}; - -CreatureAI* GetAI_boss_harbinger_skyriss_illusion(Creature* pCreature) -{ - return new boss_harbinger_skyriss_illusionAI (pCreature); -} - -void AddSC_boss_harbinger_skyriss() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "boss_harbinger_skyriss"; - newscript->GetAI = &GetAI_boss_harbinger_skyriss; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_harbinger_skyriss_illusion"; - newscript->GetAI = &GetAI_boss_harbinger_skyriss_illusion; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Outland/tempest_keep/arcatraz/instance_arcatraz.cpp b/src/server/scripts/Outland/tempest_keep/arcatraz/instance_arcatraz.cpp deleted file mode 100644 index d16975e2af6..00000000000 --- a/src/server/scripts/Outland/tempest_keep/arcatraz/instance_arcatraz.cpp +++ /dev/null @@ -1,240 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Instance_Arcatraz -SD%Complete: 80 -SDComment: Mainly Harbringer Skyriss event -SDCategory: Tempest Keep, The Arcatraz -EndScriptData */ - -#include "ScriptedPch.h" -#include "arcatraz.h" - -#define MAX_ENCOUNTER 9 - -#define CONTAINMENT_CORE_SECURITY_FIELD_ALPHA 184318 //door opened when Wrath-Scryer Soccothrates dies -#define CONTAINMENT_CORE_SECURITY_FIELD_BETA 184319 //door opened when Dalliah the Doomsayer dies -#define POD_ALPHA 183961 //pod first boss wave -#define POD_BETA 183963 //pod second boss wave -#define POD_DELTA 183964 //pod third boss wave -#define POD_GAMMA 183962 //pod fourth boss wave -#define POD_OMEGA 183965 //pod fifth boss wave -#define WARDENS_SHIELD 184802 // warden shield -#define SEAL_SPHERE 184802 //shield 'protecting' mellichar - -#define MELLICHAR 20904 //skyriss will kill this unit - -/* Arcatraz encounters: -1 - Zereketh the Unbound event -2 - Dalliah the Doomsayer event -3 - Wrath-Scryer Soccothrates event -4 - Harbinger Skyriss event, 5 sub-events -*/ - -struct instance_arcatraz : public ScriptedInstance -{ - instance_arcatraz(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - - uint64 Containment_Core_Security_Field_AlphaGUID; - uint64 Containment_Core_Security_Field_BetaGUID; - uint64 Pod_AlphaGUID; - uint64 Pod_GammaGUID; - uint64 Pod_BetaGUID; - uint64 Pod_DeltaGUID; - uint64 Pod_OmegaGUID; - uint64 Wardens_ShieldGUID; - uint64 GoSphereGUID; - uint64 MellicharGUID; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - Containment_Core_Security_Field_AlphaGUID = 0; - Containment_Core_Security_Field_BetaGUID = 0; - Pod_AlphaGUID = 0; - Pod_GammaGUID = 0; - Pod_BetaGUID = 0; - Pod_DeltaGUID = 0; - Pod_OmegaGUID = 0; - Wardens_ShieldGUID = 0; - GoSphereGUID = 0; - MellicharGUID = 0; - } - - bool IsEncounterInProgress() const - { - for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) return true; - - return false; - } - - void OnGameObjectCreate(GameObject* pGo, bool /*add*/) - { - switch(pGo->GetEntry()) - { - case CONTAINMENT_CORE_SECURITY_FIELD_ALPHA: Containment_Core_Security_Field_AlphaGUID = pGo->GetGUID(); break; - case CONTAINMENT_CORE_SECURITY_FIELD_BETA: Containment_Core_Security_Field_BetaGUID = pGo->GetGUID(); break; - case POD_ALPHA: Pod_AlphaGUID = pGo->GetGUID(); break; - case POD_GAMMA: Pod_GammaGUID = pGo->GetGUID(); break; - case POD_BETA: Pod_BetaGUID = pGo->GetGUID(); break; - case POD_DELTA: Pod_DeltaGUID = pGo->GetGUID(); break; - case POD_OMEGA: Pod_OmegaGUID = pGo->GetGUID(); break; - case SEAL_SPHERE: GoSphereGUID = pGo->GetGUID(); break; - //case WARDENS_SHIELD: Wardens_ShieldGUID = pGo->GetGUID(); break; - } - } - - void OnCreatureCreate(Creature* pCreature, bool /*add*/) - { - if (pCreature->GetEntry() == MELLICHAR) - MellicharGUID = pCreature->GetGUID(); - } - - void SetData(uint32 type, uint32 data) - { - switch(type) - { - case TYPE_ZEREKETH: - m_auiEncounter[0] = data; - break; - - case TYPE_DALLIAH: - if (data == DONE) - { - if (GameObject *pGo = instance->GetGameObject(Containment_Core_Security_Field_BetaGUID)) - pGo->UseDoorOrButton(); - } - m_auiEncounter[1] = data; - break; - - case TYPE_SOCCOTHRATES: - if (data == DONE) - { - if (GameObject *pGo = instance->GetGameObject(Containment_Core_Security_Field_AlphaGUID)) - pGo->UseDoorOrButton(); - } - m_auiEncounter[2] = data; - break; - - case TYPE_HARBINGERSKYRISS: - if (data == NOT_STARTED || data == FAIL) - { - m_auiEncounter[4] = NOT_STARTED; - m_auiEncounter[5] = NOT_STARTED; - m_auiEncounter[6] = NOT_STARTED; - m_auiEncounter[7] = NOT_STARTED; - m_auiEncounter[8] = NOT_STARTED; - } - m_auiEncounter[3] = data; - break; - - case TYPE_WARDEN_1: - if (data == IN_PROGRESS) - if (GameObject *pGo = instance->GetGameObject(Pod_AlphaGUID)) - pGo->UseDoorOrButton(); - m_auiEncounter[4] = data; - break; - - case TYPE_WARDEN_2: - if (data == IN_PROGRESS) - { - if (GameObject *pGo = instance->GetGameObject(Pod_BetaGUID)) - pGo->UseDoorOrButton(); - } - m_auiEncounter[5] = data; - break; - - case TYPE_WARDEN_3: - if (data == IN_PROGRESS) - { - if (GameObject *pGo = instance->GetGameObject(Pod_DeltaGUID)) - pGo->UseDoorOrButton(); - } - m_auiEncounter[6] = data; - break; - - case TYPE_WARDEN_4: - if (data == IN_PROGRESS) - { - if (GameObject *pGo = instance->GetGameObject(Pod_GammaGUID)) - pGo->UseDoorOrButton(); - } - m_auiEncounter[7] = data; - break; - - case TYPE_WARDEN_5: - if (data == IN_PROGRESS) - { - if (GameObject *pGo = instance->GetGameObject(Pod_OmegaGUID)) - pGo->UseDoorOrButton(); - } - m_auiEncounter[8] = data; - break; - - case TYPE_SHIELD_OPEN: - if (data == IN_PROGRESS) - { - if (GameObject *pGo = instance->GetGameObject(Wardens_ShieldGUID)) - pGo->UseDoorOrButton(); - } - break; - } - } - - uint32 GetData(uint32 type) - { - switch(type) - { - case TYPE_HARBINGERSKYRISS: return m_auiEncounter[3]; - case TYPE_WARDEN_1: return m_auiEncounter[4]; - case TYPE_WARDEN_2: return m_auiEncounter[5]; - case TYPE_WARDEN_3: return m_auiEncounter[6]; - case TYPE_WARDEN_4: return m_auiEncounter[7]; - case TYPE_WARDEN_5: return m_auiEncounter[8]; - } - return 0; - } - - uint64 GetData64(uint32 data) - { - switch(data) - { - case DATA_MELLICHAR: return MellicharGUID; - case DATA_SPHERE_SHIELD: return GoSphereGUID; - } - return 0; - } -}; - -InstanceData* GetInstanceData_instance_arcatraz(Map* pMap) -{ - return new instance_arcatraz(pMap); -} - -void AddSC_instance_arcatraz() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_arcatraz"; - newscript->GetInstanceData = &GetInstanceData_instance_arcatraz; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Outland/tempest_keep/botanica/boss_high_botanist_freywinn.cpp b/src/server/scripts/Outland/tempest_keep/botanica/boss_high_botanist_freywinn.cpp deleted file mode 100644 index 1a077036298..00000000000 --- a/src/server/scripts/Outland/tempest_keep/botanica/boss_high_botanist_freywinn.cpp +++ /dev/null @@ -1,191 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_High_Botanist_Freywinn -SD%Complete: 90 -SDComment: some strange visual related to tree form(if aura lost before normal duration end). possible make summon&transform -process smoother(transform after delay) -SDCategory: Tempest Keep, The Botanica -EndScriptData */ - -#include "ScriptedPch.h" - -#define SAY_AGGRO -1553000 -#define SAY_KILL_1 -1553001 -#define SAY_KILL_2 -1553002 -#define SAY_TREE_1 -1553003 -#define SAY_TREE_2 -1553004 -#define SAY_DEATH -1553005 - -#define SPELL_TRANQUILITY 34550 -#define SPELL_TREE_FORM 34551 - -#define SPELL_SUMMON_FRAYER 34557 -#define ENTRY_FRAYER 19953 - -#define SPELL_PLANT_WHITE 34759 -#define SPELL_PLANT_GREEN 34761 -#define SPELL_PLANT_BLUE 34762 -#define SPELL_PLANT_RED 34763 - -struct boss_high_botanist_freywinnAI : public ScriptedAI -{ - boss_high_botanist_freywinnAI(Creature *c) : ScriptedAI(c) {} - - std::list Adds_List; - - uint32 SummonSeedling_Timer; - uint32 TreeForm_Timer; - uint32 MoveCheck_Timer; - uint32 DeadAddsCount; - bool MoveFree; - - void Reset() - { - Adds_List.clear(); - - SummonSeedling_Timer = 6000; - TreeForm_Timer = 30000; - MoveCheck_Timer = 1000; - DeadAddsCount = 0; - MoveFree = true; - } - - void EnterCombat(Unit * /*who*/) - { - DoScriptText(SAY_AGGRO, me); - } - - void JustSummoned(Creature *summoned) - { - if (summoned->GetEntry() == ENTRY_FRAYER) - Adds_List.push_back(summoned->GetGUID()); - } - - void DoSummonSeedling() - { - switch(rand()%4) - { - case 0: DoCast(me, SPELL_PLANT_WHITE); break; - case 1: DoCast(me, SPELL_PLANT_GREEN); break; - case 2: DoCast(me, SPELL_PLANT_BLUE); break; - case 3: DoCast(me, SPELL_PLANT_RED); break; - } - } - - void KilledUnit(Unit* /*victim*/) - { - DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2), me); - } - - void JustDied(Unit* /*Killer*/) - { - DoScriptText(SAY_DEATH, me); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (TreeForm_Timer <= diff) - { - DoScriptText(RAND(SAY_TREE_1,SAY_TREE_2), me); - - if (me->IsNonMeleeSpellCasted(false)) - me->InterruptNonMeleeSpells(true); - - me->RemoveAllAuras(); - - DoCast(me, SPELL_SUMMON_FRAYER, true); - DoCast(me, SPELL_TRANQUILITY, true); - DoCast(me, SPELL_TREE_FORM, true); - - me->GetMotionMaster()->MoveIdle(); - MoveFree = false; - - TreeForm_Timer = 75000; - } else TreeForm_Timer -= diff; - - if (!MoveFree) - { - if (MoveCheck_Timer <= diff) - { - if (!Adds_List.empty()) - { - for (std::list::iterator itr = Adds_List.begin(); itr != Adds_List.end(); ++itr) - { - if (Unit *temp = Unit::GetUnit(*me,*itr)) - { - if (!temp->isAlive()) - { - Adds_List.erase(itr); - ++DeadAddsCount; - break; - } - } - } - } - - if (DeadAddsCount < 3 && TreeForm_Timer-30000 <= diff) - DeadAddsCount = 3; - - if (DeadAddsCount >= 3) - { - Adds_List.clear(); - DeadAddsCount = 0; - - me->InterruptNonMeleeSpells(true); - me->RemoveAllAuras(); - me->GetMotionMaster()->MoveChase(me->getVictim()); - MoveFree = true; - } - MoveCheck_Timer = 500; - } - else MoveCheck_Timer -= diff; - - return; - } - - /*if (me->HasAura(SPELL_TREE_FORM,0) || me->HasAura(SPELL_TRANQUILITY,0)) - return;*/ - - //one random seedling every 5 secs, but not in tree form - if (SummonSeedling_Timer <= diff) - { - DoSummonSeedling(); - SummonSeedling_Timer = 6000; - } else SummonSeedling_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_high_botanist_freywinn(Creature* pCreature) -{ - return new boss_high_botanist_freywinnAI (pCreature); -} - -void AddSC_boss_high_botanist_freywinn() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "boss_high_botanist_freywinn"; - newscript->GetAI = &GetAI_boss_high_botanist_freywinn; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Outland/tempest_keep/botanica/boss_laj.cpp b/src/server/scripts/Outland/tempest_keep/botanica/boss_laj.cpp deleted file mode 100644 index cbf21c2f992..00000000000 --- a/src/server/scripts/Outland/tempest_keep/botanica/boss_laj.cpp +++ /dev/null @@ -1,205 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Laj -SD%Complete: 90 -SDComment: Immunities are wrong, must be adjusted to use resistance from creature_templates. Most spells require database support. -SDCategory: Tempest Keep, The Botanica -EndScriptData */ - -#include "ScriptedPch.h" - -#define EMOTE_SUMMON -1553006 - -#define SPELL_ALLERGIC_REACTION 34697 -#define SPELL_TELEPORT_SELF 34673 - -#define SPELL_SUMMON_LASHER_1 34681 -#define SPELL_SUMMON_FLAYER_1 34682 -#define SPELL_SUMMON_LASHER_2 34684 -#define SPELL_SUMMON_FLAYER_2 34685 -#define SPELL_SUMMON_LASHER_3 34686 -#define SPELL_SUMMON_FLAYER_4 34687 -#define SPELL_SUMMON_LASHER_4 34688 -#define SPELL_SUMMON_FLAYER_3 34690 - -#define MODEL_DEFAULT 13109 -#define MODEL_ARCANE 14213 -#define MODEL_FIRE 13110 -#define MODEL_FROST 14112 -#define MODEL_NATURE 14214 - -struct boss_lajAI : public ScriptedAI -{ - boss_lajAI(Creature *c) : ScriptedAI(c) {} - - bool CanSummon; - uint32 Teleport_Timer; - uint32 Summon_Timer; - uint32 Transform_Timer; - uint32 Allergic_Timer; - - void Reset() - { - me->SetDisplayId(MODEL_DEFAULT); - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, true); - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, false); - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false); - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false); - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false); - - CanSummon = false; - Teleport_Timer = 20000; - Summon_Timer = 2500; - Transform_Timer = 30000; - Allergic_Timer = 5000; - } - - void DoTransform() - { - switch(rand()%5) - { - case 0: - me->SetDisplayId(MODEL_DEFAULT); - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, true); - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, false); - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false); - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false); - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false); - break; - case 1: - me->SetDisplayId(MODEL_ARCANE); - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, false); - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, true); - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false); - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false); - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false); - break; - case 2: - me->SetDisplayId(MODEL_FIRE); - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, false); - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, false); - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true); - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false); - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false); - break; - case 3: - me->SetDisplayId(MODEL_FROST); - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, false); - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, false); - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false); - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true); - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false); - break; - case 4: - me->SetDisplayId(MODEL_NATURE); - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, false); - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, false); - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false); - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false); - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, true); - break; - } - } - - void DoSummons() - { - switch(rand()%4) - { - case 0: - DoCast(me, SPELL_SUMMON_LASHER_1, true); - DoCast(me, SPELL_SUMMON_FLAYER_1, true); - break; - case 1: - DoCast(me, SPELL_SUMMON_LASHER_2, true); - DoCast(me, SPELL_SUMMON_FLAYER_2, true); - break; - case 2: - DoCast(me, SPELL_SUMMON_LASHER_3, true); - DoCast(me, SPELL_SUMMON_FLAYER_3, true); - break; - case 3: - DoCast(me, SPELL_SUMMON_LASHER_4, true); - DoCast(me, SPELL_SUMMON_FLAYER_4, true); - break; - } - CanSummon = false; - } - - void EnterCombat(Unit * /*who*/) - { - } - - void JustSummoned(Creature *summon) - { - if (summon && me->getVictim()) - summon->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0)); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (CanSummon) - { - if (Summon_Timer <= diff) - { - DoScriptText(EMOTE_SUMMON, me); - DoSummons(); - Summon_Timer = 2500; - } else Summon_Timer -= diff; - } - - if (Allergic_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_ALLERGIC_REACTION); - Allergic_Timer = 25000+rand()%15000; - } else Allergic_Timer -= diff; - - if (Teleport_Timer <= diff) - { - DoCast(me, SPELL_TELEPORT_SELF); - Teleport_Timer = 30000+rand()%10000; - CanSummon = true; - } else Teleport_Timer -= diff; - - if (Transform_Timer <= diff) - { - DoTransform(); - Transform_Timer = 25000+rand()%15000; - } else Transform_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_laj(Creature* pCreature) -{ - return new boss_lajAI (pCreature); -} - -void AddSC_boss_laj() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "boss_laj"; - newscript->GetAI = &GetAI_boss_laj; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Outland/tempest_keep/botanica/boss_warp_splinter.cpp b/src/server/scripts/Outland/tempest_keep/botanica/boss_warp_splinter.cpp deleted file mode 100644 index 48eb03c16d3..00000000000 --- a/src/server/scripts/Outland/tempest_keep/botanica/boss_warp_splinter.cpp +++ /dev/null @@ -1,216 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -/* ScriptData -SDName: Boss_Warp_Splinter -SD%Complete: 80 -SDComment: Includes Sapling (need some better control with these). -SDCategory: Tempest Keep, The Botanica -EndScriptData */ - -#include "ScriptedPch.h" - -/*##### -# mob_treant (Sapling) -#####*/ - -#define SPELL_HEAL_FATHER 6262 - -struct mob_treantAI : public ScriptedAI -{ - mob_treantAI (Creature *c) : ScriptedAI(c) - { - WarpGuid = 0; - } - - uint64 WarpGuid; - uint32 check_Timer; - - void Reset() - { - check_Timer = 0; - } - - void EnterCombat(Unit * /*who*/) {} - - void MoveInLineOfSight(Unit* /*who*/) {} - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - { - if (WarpGuid && check_Timer <= diff) - { - if (Unit *Warp = Unit::GetUnit(*me, WarpGuid)) - { - if (me->IsWithinMeleeRange(Warp,2.5f)) - { - int32 CurrentHP_Treant = (int32)me->GetHealth(); - Warp->CastCustomSpell(Warp,SPELL_HEAL_FATHER,&CurrentHP_Treant, 0, 0, true,0 ,0, me->GetGUID()); - me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - return; - } - me->GetMotionMaster()->MoveFollow(Warp,0,0); - } - check_Timer = 1000; - } else check_Timer -= diff; - return; - } - - if (me->getVictim()->GetGUID() != WarpGuid) - DoMeleeAttackIfReady(); - } -}; - -/*##### -# boss_warp_splinter -#####*/ - -#define SAY_AGGRO -1553007 -#define SAY_SLAY_1 -1553008 -#define SAY_SLAY_2 -1553009 -#define SAY_SUMMON_1 -1553010 -#define SAY_SUMMON_2 -1553011 -#define SAY_DEATH -1553012 - -#define WAR_STOMP 34716 -#define SUMMON_TREANTS 34727 // DBC: 34727, 34731, 34733, 34734, 34736, 34739, 34741 (with Ancestral Life spell 34742) // won't work (guardian summon) -#define ARCANE_VOLLEY DUNGEON_MODE(36705, 39133) - -#define CREATURE_TREANT 19949 - -#define TREANT_SPAWN_DIST 50 //50 yards from Warp Splinter's spawn point - -float treant_pos[6][3] = -{ - {24.301233, 427.221100, -27.060635}, - {16.795492, 359.678802, -27.355425}, - {53.493484, 345.381470, -26.196192}, - {61.867096, 439.362732, -25.921030}, - {109.861877, 423.201630, -27.356019}, - {106.780159, 355.582581, -27.593357} -}; - -struct boss_warp_splinterAI : public ScriptedAI -{ - boss_warp_splinterAI(Creature *c) : ScriptedAI(c) - { - Treant_Spawn_Pos_X = c->GetPositionX(); - Treant_Spawn_Pos_Y = c->GetPositionY(); - } - - uint32 War_Stomp_Timer; - uint32 Summon_Treants_Timer; - uint32 Arcane_Volley_Timer; - - float Treant_Spawn_Pos_X; - float Treant_Spawn_Pos_Y; - - void Reset() - { - War_Stomp_Timer = 25000 + rand()%15000; - Summon_Treants_Timer = 45000; - Arcane_Volley_Timer = 8000 + rand()%12000; - - me->SetSpeed(MOVE_RUN, 0.7f, true); - } - - void EnterCombat(Unit * /*who*/) - { - DoScriptText(SAY_AGGRO, me); - } - - void KilledUnit(Unit* /*victim*/) - { - DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me); - } - - void JustDied(Unit* /*Killer*/) - { - DoScriptText(SAY_DEATH, me); - } - - void SummonTreants() - { - for (uint8 i = 0; i < 6; ++i) - { - float angle = (M_PI / 3) * i; - - float X = Treant_Spawn_Pos_X + TREANT_SPAWN_DIST * cos(angle); - float Y = Treant_Spawn_Pos_Y + TREANT_SPAWN_DIST * sin(angle); - float O = - me->GetAngle(X,Y); - - if (Creature *pTreant = me->SummonCreature(CREATURE_TREANT,treant_pos[i][0],treant_pos[i][1],treant_pos[i][2],O,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,25000)) - CAST_AI(mob_treantAI, pTreant->AI())->WarpGuid = me->GetGUID(); - } - DoScriptText(RAND(SAY_SUMMON_1,SAY_SUMMON_2), me); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //Check for War Stomp - if (War_Stomp_Timer <= diff) - { - DoCast(me->getVictim(), WAR_STOMP); - War_Stomp_Timer = 25000 + rand()%15000; - } else War_Stomp_Timer -= diff; - - //Check for Arcane Volley - if (Arcane_Volley_Timer <= diff) - { - DoCast(me->getVictim(), ARCANE_VOLLEY); - Arcane_Volley_Timer = 20000 + rand()%15000; - } else Arcane_Volley_Timer -= diff; - - //Check for Summon Treants - if (Summon_Treants_Timer <= diff) - { - SummonTreants(); - Summon_Treants_Timer = 45000; - } else Summon_Treants_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_warp_splinter(Creature* pCreature) -{ - return new boss_warp_splinterAI (pCreature); -} - -CreatureAI* GetAI_mob_treant(Creature* pCreature) -{ - return new mob_treantAI (pCreature); -} - -void AddSC_boss_warp_splinter() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "boss_warp_splinter"; - newscript->GetAI = &GetAI_boss_warp_splinter; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_warp_splinter_treant"; - newscript->GetAI = &GetAI_mob_treant; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Outland/tempest_keep/the_eye/boss_alar.cpp b/src/server/scripts/Outland/tempest_keep/the_eye/boss_alar.cpp deleted file mode 100644 index af5f1bd95c1..00000000000 --- a/src/server/scripts/Outland/tempest_keep/the_eye/boss_alar.cpp +++ /dev/null @@ -1,523 +0,0 @@ -/* Copyright(C) 2006 - 2008 ScriptDev2 -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -*(at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -/* ScriptData -SDName: boss_alar -SD%Complete: 95 -SDComment: -SDCategory: Tempest Keep, The Eye -EndScriptData */ - -#include "ScriptedPch.h" -#include "the_eye.h" - -#define SPELL_FLAME_BUFFET 34121 // Flame Buffet - every 1,5 secs in phase 1 if there is no victim in melee range and after Dive Bomb in phase 2 with same conditions -#define SPELL_FLAME_QUILLS 34229 // Randomly after changing position in phase after watching tonns of movies, set probability 20% -#define SPELL_REBIRTH 34342 // Rebirth - beginning of second phase(after loose all health in phase 1) -#define SPELL_REBIRTH_2 35369 // Rebirth(another, without healing to full HP) - after Dive Bomb in phase 2 -#define SPELL_MELT_ARMOR 35410 // Melt Armor - every 60 sec in phase 2 -#define SPELL_CHARGE 35412 // Charge - 30 sec cooldown -#define SPELL_DIVE_BOMB_VISUAL 35367 // Bosskillers says 30 sec cooldown, wowwiki says 30 sec colldown, DBM and BigWigs addons says ~47 sec -#define SPELL_DIVE_BOMB 35181 // after watching tonns of movies, set cooldown to 40+rand()%5. -#define SPELL_BERSERK 45078 // 10 minutes after phase 2 starts(id is wrong, but proper id is unknown) - -#define CREATURE_EMBER_OF_ALAR 19551 // Al'ar summons one Ember of Al'ar every position change in phase 1 and two after Dive Bomb. Also in phase 2 when Ember of Al'ar dies, boss loose 3% health. -#define SPELL_EMBER_BLAST 34133 // When Ember of Al'ar dies, it casts Ember Blast - -#define CREATURE_FLAME_PATCH_ALAR 20602 // Flame Patch - every 30 sec in phase 2 -#define SPELL_FLAME_PATCH 35380 // - -static float waypoint[6][3] = -{ - {340.15, 58.65, 17.71}, - {388.09, 31.54, 20.18}, - {388.18, -32.85, 20.18}, - {340.29, -60.19, 17.72}, - {332, 0.01, 39}, // better not use the same xy coord - {331, 0.01, -2.39} -}; - -enum WaitEventType -{ - WE_NONE = 0, - WE_DUMMY = 1, - WE_PLATFORM = 2, - WE_QUILL = 3, - WE_DIE = 4, - WE_REVIVE = 5, - WE_CHARGE = 6, - WE_METEOR = 7, - WE_DIVE = 8, - WE_LAND = 9, - WE_SUMMON = 10 -}; - -struct boss_alarAI : public ScriptedAI -{ - boss_alarAI(Creature *c) : ScriptedAI(c) - { - pInstance =c->GetInstanceData(); - DefaultMoveSpeedRate = c->GetSpeedRate(MOVE_RUN); - } - - ScriptedInstance *pInstance; - - WaitEventType WaitEvent; - uint32 WaitTimer; - - bool AfterMoving; - - uint32 Platforms_Move_Timer; - uint32 DiveBomb_Timer; - uint32 MeltArmor_Timer; - uint32 Charge_Timer; - uint32 FlamePatch_Timer; - uint32 Berserk_Timer; - - float DefaultMoveSpeedRate; - - bool Phase1; - bool ForceMove; - uint32 ForceTimer; - - int8 cur_wp; - - void Reset() - { - if (pInstance) - pInstance->SetData(DATA_ALAREVENT, NOT_STARTED); - - Berserk_Timer = 1200000; - Platforms_Move_Timer = 0; - - Phase1 = true; - WaitEvent = WE_NONE; - WaitTimer = 0; - AfterMoving = false; - ForceMove = false; - ForceTimer = 5000; - - cur_wp = 4; - - me->SetDisplayId(me->GetNativeDisplayId()); - me->SetSpeed(MOVE_RUN, DefaultMoveSpeedRate); - //me->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 10); - //me->SetFloatValue(UNIT_FIELD_COMBATREACH, 10); - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true); - me->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->setActive(false); - } - - void EnterCombat(Unit * /*who*/) - { - if (pInstance) - pInstance->SetData(DATA_ALAREVENT, IN_PROGRESS); - - me->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); // after enterevademode will be set walk movement - DoZoneInCombat(); - me->setActive(true); - } - - void JustDied(Unit * /*victim*/) - { - if (pInstance) - pInstance->SetData(DATA_ALAREVENT, DONE); - } - - void JustSummoned(Creature *summon) - { - if (summon->GetEntry() == CREATURE_EMBER_OF_ALAR) - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) - summon->AI()->AttackStart(pTarget); - } - - void MoveInLineOfSight(Unit * /*who*/) {} - - void AttackStart(Unit* who) - { - if (Phase1) - AttackStartNoMove(who); - else - ScriptedAI::AttackStart(who); - } - - void DamageTaken(Unit* /*pKiller*/, uint32 &damage) - { - if (damage >= me->GetHealth() && Phase1) - { - damage = 0; - if (!WaitEvent) - { - WaitEvent = WE_DIE; - WaitTimer = 0; - me->SetHealth(0); - me->InterruptNonMeleeSpells(true); - me->RemoveAllAuras(); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->AttackStop(); - me->SetUInt64Value(UNIT_FIELD_TARGET, 0); - me->SetSpeed(MOVE_RUN, 5.0f); - me->GetMotionMaster()->Clear(); - me->GetMotionMaster()->MovePoint(0, waypoint[5][0], waypoint[5][1], waypoint[5][2]); - } - } - } - - void SpellHit(Unit*, const SpellEntry *spell) - { - if (spell->Id == SPELL_DIVE_BOMB_VISUAL) - { - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true); - me->SetDisplayId(11686); - //me->SendUpdateObjectToAllExcept(NULL); - } - } - - void MovementInform(uint32 type, uint32 /*id*/) - { - if (type == POINT_MOTION_TYPE) - { - WaitTimer = 1; - AfterMoving = true; - ForceMove = false; - } - } - - void UpdateAI(const uint32 diff) - { - if (!me->isInCombat()) // sometimes isincombat but !incombat, faction bug? - return; - - if (Berserk_Timer <= diff) - { - DoCast(me, SPELL_BERSERK, true); - Berserk_Timer = 60000; - } else Berserk_Timer -= diff; - - if (ForceMove) - { - if (ForceTimer <= diff) - { - me->GetMotionMaster()->MovePoint(0, waypoint[cur_wp][0], waypoint[cur_wp][1], waypoint[cur_wp][2]); - ForceTimer = 5000; - } else ForceTimer -= diff; - - } - if (WaitEvent) - { - if (WaitTimer) - { - if (WaitTimer <= diff) - { - if (AfterMoving) - { - me->GetMotionMaster()->MoveIdle(); - AfterMoving = false; - } - - switch(WaitEvent) - { - case WE_PLATFORM: - Platforms_Move_Timer = 30000+rand()%5000; - break; - case WE_QUILL: - DoCast(me, SPELL_FLAME_QUILLS, true); - Platforms_Move_Timer = 1; - WaitTimer = 10000; - WaitEvent = WE_DUMMY; - return; - case WE_DIE: - ForceMove = false; - me->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_DEAD); - WaitTimer = 5000; - WaitEvent = WE_REVIVE; - return; - case WE_REVIVE: - me->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_STAND); - me->SetHealth(me->GetMaxHealth()); - me->SetSpeed(MOVE_RUN, DefaultMoveSpeedRate); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - DoZoneInCombat(); - DoCast(me, SPELL_REBIRTH, true); - MeltArmor_Timer = 60000; - Charge_Timer = 7000; - DiveBomb_Timer = 40000+rand()%5000; - FlamePatch_Timer = 30000; - Phase1 = false; - break; - case WE_METEOR: - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false); - DoCast(me, SPELL_DIVE_BOMB_VISUAL, false); - WaitEvent = WE_DIVE; - WaitTimer = 4000; - return; - case WE_DIVE: - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - me->RemoveAurasDueToSpell(SPELL_DIVE_BOMB_VISUAL); - DoCast(pTarget, SPELL_DIVE_BOMB, true); - float dist = 3.0f; - if (me->IsWithinDist3d(pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 5.0f)) - dist = 5.0f; - WaitTimer = 1000 + floor(dist / 80 * 1000.0f); - me->GetMap()->CreatureRelocation(me, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0.0f); - me->StopMoving(); - WaitEvent = WE_LAND; - } - else - { - EnterEvadeMode(); - return; - } - case WE_LAND: - WaitEvent = WE_SUMMON; - WaitTimer = 2000; - return; - case WE_SUMMON: - for (uint8 i = 0; i < 2; ++i) - DoSpawnCreature(CREATURE_EMBER_OF_ALAR, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); - me->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 10); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetDisplayId(me->GetNativeDisplayId()); - DoCast(me, SPELL_REBIRTH_2, true); - break; - case WE_DUMMY: - default: - break; - } - - WaitEvent = WE_NONE; - WaitTimer = 0; - } else WaitTimer -= diff; - } - return; - } - - if (Phase1) - { - if (me->getThreatManager().getThreatList().empty()) - { - EnterEvadeMode(); - return; - } - - if (Platforms_Move_Timer <= diff) - { - if (cur_wp == 4) - { - cur_wp = 0; - WaitEvent = WE_PLATFORM; - } - else - { - if (urand(0,4)) // next platform - { - DoSpawnCreature(CREATURE_EMBER_OF_ALAR, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); - if (cur_wp == 3) - cur_wp = 0; - else - ++cur_wp; - WaitEvent = WE_PLATFORM; - } - else // flame quill - { - cur_wp = 4; - WaitEvent = WE_QUILL; - } - } - ForceMove = true; - ForceTimer = 5000; - me->GetMotionMaster()->MovePoint(0, waypoint[cur_wp][0], waypoint[cur_wp][1], waypoint[cur_wp][2]); - WaitTimer = 0; - return; - } else Platforms_Move_Timer -= diff; - } - else - { - if (Charge_Timer <= diff) - { - Unit *pTarget= SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true); - if (pTarget) - DoCast(pTarget, SPELL_CHARGE); - Charge_Timer = 30000; - } else Charge_Timer -= diff; - - if (MeltArmor_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_MELT_ARMOR); - MeltArmor_Timer = 60000; - } else MeltArmor_Timer -= diff; - - if (DiveBomb_Timer <= diff) - { - me->AttackStop(); - me->GetMotionMaster()->MovePoint(6, waypoint[4][0], waypoint[4][1], waypoint[4][2]); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 50); - WaitEvent = WE_METEOR; - WaitTimer = 0; - DiveBomb_Timer = 40000+rand()%5000; - return; - } else DiveBomb_Timer -= diff; - - if (FlamePatch_Timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - Creature* Summoned = me->SummonCreature(CREATURE_FLAME_PATCH_ALAR, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 120000); - if (Summoned) - { - Summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - Summoned->SetFloatValue(OBJECT_FIELD_SCALE_X, Summoned->GetFloatValue(OBJECT_FIELD_SCALE_X)*2.5f); - Summoned->SetDisplayId(11686); - Summoned->setFaction(me->getFaction()); - Summoned->SetLevel(me->getLevel()); - Summoned->CastSpell(Summoned, SPELL_FLAME_PATCH, false); - } - } - FlamePatch_Timer = 30000; - } else FlamePatch_Timer -= diff; - } - - DoMeleeAttackIfReady(); - } - - void DoMeleeAttackIfReady() - { - if (me->isAttackReady() && !me->IsNonMeleeSpellCasted(false)) - { - if (me->IsWithinMeleeRange(me->getVictim())) - { - me->AttackerStateUpdate(me->getVictim()); - me->resetAttackTimer(); - } - else - { - Unit *pTarget = NULL; - pTarget = me->SelectNearestTargetInAttackDistance(5); - if (pTarget) - me->AI()->AttackStart(pTarget); - else - { - DoCast(me, SPELL_FLAME_BUFFET, true); - me->setAttackTimer(BASE_ATTACK, 1500); - } - } - } - } -}; - -CreatureAI* GetAI_boss_alar(Creature* pCreature) -{ - return new boss_alarAI(pCreature); -} - -struct mob_ember_of_alarAI : public ScriptedAI -{ - mob_ember_of_alarAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - c->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); - c->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true); - } - - ScriptedInstance *pInstance; - bool toDie; - - void Reset() {toDie = false;} - void EnterCombat(Unit * /*who*/) {DoZoneInCombat();} - void EnterEvadeMode() {me->setDeathState(JUST_DIED);} - - void DamageTaken(Unit* pKiller, uint32 &damage) - { - if (damage >= me->GetHealth() && pKiller != me && !toDie) - { - damage = 0; - DoCast(me, SPELL_EMBER_BLAST, true); - me->SetDisplayId(11686); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - if (pInstance && pInstance->GetData(DATA_ALAREVENT) == 2) - { - if (Unit* Alar = Unit::GetUnit((*me), pInstance->GetData64(DATA_ALAR))) - { - int AlarHealth = Alar->GetHealth() - Alar->GetMaxHealth()*0.03; - if (AlarHealth > 0) - Alar->SetHealth(AlarHealth); - else - Alar->SetHealth(1); - } - } - toDie = true; - } - } - - void UpdateAI(const uint32 /*diff*/) - { - if (!UpdateVictim()) - return; - - if (toDie) - { - me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - //me->SetVisibility(VISIBILITY_OFF); - } - - DoMeleeAttackIfReady(); - } - -}; - -CreatureAI* GetAI_mob_ember_of_alar(Creature* pCreature) -{ - return new mob_ember_of_alarAI(pCreature); -} - -struct mob_flame_patch_alarAI : public ScriptedAI -{ - mob_flame_patch_alarAI(Creature *c) : ScriptedAI(c) {} - void Reset() {} - void EnterCombat(Unit * /*who*/) {} - void AttackStart(Unit* /*who*/) {} - void MoveInLineOfSight(Unit* /*who*/) {} - void UpdateAI(const uint32 /*diff*/) {} -}; - -CreatureAI* GetAI_mob_flame_patch_alar(Creature* pCreature) -{ - return new mob_flame_patch_alarAI(pCreature); -} - -void AddSC_boss_alar() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "boss_alar"; - newscript->GetAI = &GetAI_boss_alar; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_ember_of_alar"; - newscript->GetAI = &GetAI_mob_ember_of_alar; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_flame_patch_alar"; - newscript->GetAI = &GetAI_mob_flame_patch_alar; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Outland/tempest_keep/the_eye/boss_astromancer.cpp b/src/server/scripts/Outland/tempest_keep/the_eye/boss_astromancer.cpp deleted file mode 100644 index e9e217a5c62..00000000000 --- a/src/server/scripts/Outland/tempest_keep/the_eye/boss_astromancer.cpp +++ /dev/null @@ -1,466 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Astromancer -SD%Complete: 80 -SDComment: -SDCategory: Tempest Keep, The Eye -EndScriptData */ - -#include "ScriptedPch.h" -#include "the_eye.h" - -enum eEnums -{ - SAY_AGGRO = -1550007, - SAY_SUMMON1 = -1550008, - SAY_SUMMON2 = -1550009, - SAY_KILL1 = -1550010, - SAY_KILL2 = -1550011, - SAY_KILL3 = -1550012, - SAY_DEATH = -1550013, - SAY_VOIDA = -1550014, - SAY_VOIDB = -1550015, - - SPELL_ARCANE_MISSILES = 33031, - SPELL_WRATH_OF_THE_ASTROMANCER = 42783, - SPELL_BLINDING_LIGHT = 33009, - SPELL_FEAR = 34322, - SPELL_VOID_BOLT = 39329, - - SPELL_SPOTLIGHT = 25824, - NPC_ASTROMANCER_SOLARIAN_SPOTLIGHT = 18928, - - NPC_SOLARIUM_AGENT = 18925, - NPC_SOLARIUM_PRIEST = 18806, - - MODEL_HUMAN = 18239, - MODEL_VOIDWALKER = 18988, - - SPELL_SOLARIUM_GREAT_HEAL = 33387, - SPELL_SOLARIUM_HOLY_SMITE = 25054, - SPELL_SOLARIUM_ARCANE_TORRENT = 33390, - - WV_ARMOR = 31000 -}; - -const float CENTER_X = 432.909f; -const float CENTER_Y = -373.424f; -const float CENTER_Z = 17.9608f; -const float CENTER_O = 1.06421f; -const float SMALL_PORTAL_RADIUS = 12.6f; -const float LARGE_PORTAL_RADIUS = 26.0f; -const float PORTAL_Z = 17.005f; - - // x, y, z, o -static float SolarianPos[4] = {432.909, -373.424, 17.9608, 1.06421}; - -struct boss_high_astromancer_solarianAI : public ScriptedAI -{ - boss_high_astromancer_solarianAI(Creature *c) : ScriptedAI(c), Summons(me) - { - pInstance = c->GetInstanceData(); - - defaultarmor = c->GetArmor(); - defaultsize = c->GetFloatValue(OBJECT_FIELD_SCALE_X); - } - - ScriptedInstance *pInstance; - SummonList Summons; - - uint8 Phase; - - uint32 ArcaneMissiles_Timer; - uint32 m_uiWrathOfTheAstromancer_Timer; - uint32 BlindingLight_Timer; - uint32 Fear_Timer; - uint32 VoidBolt_Timer; - uint32 Phase1_Timer; - uint32 Phase2_Timer; - uint32 Phase3_Timer; - uint32 AppearDelay_Timer; - uint32 defaultarmor; - uint32 Wrath_Timer; - - float defaultsize; - float Portals[3][3]; - - bool AppearDelay; - bool BlindingLight; - - void Reset() - { - ArcaneMissiles_Timer = 2000; - m_uiWrathOfTheAstromancer_Timer = 15000; - BlindingLight_Timer = 41000; - Fear_Timer = 20000; - VoidBolt_Timer = 10000; - Phase1_Timer = 50000; - Phase2_Timer = 10000; - Phase3_Timer = 15000; - AppearDelay_Timer = 2000; - BlindingLight = false; - AppearDelay = false; - Wrath_Timer = 20000+rand()%5000;//twice in phase one - Phase = 1; - Wrath_Timer = 20000+rand()%5000;//twice in phase one - - if (pInstance) - pInstance->SetData(DATA_HIGHASTROMANCERSOLARIANEVENT, NOT_STARTED); - - me->SetArmor(defaultarmor); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetVisibility(VISIBILITY_ON); - me->SetFloatValue(OBJECT_FIELD_SCALE_X, defaultsize); - me->SetDisplayId(MODEL_HUMAN); - - Summons.DespawnAll(); - } - - void KilledUnit(Unit * /*victim*/) - { - DoScriptText(RAND(SAY_KILL1,SAY_KILL2,SAY_KILL3), me); - } - - void JustDied(Unit * /*victim*/) - { - me->SetFloatValue(OBJECT_FIELD_SCALE_X, defaultsize); - me->SetDisplayId(MODEL_HUMAN); - DoScriptText(SAY_DEATH, me); - - if (pInstance) - pInstance->SetData(DATA_HIGHASTROMANCERSOLARIANEVENT, DONE); - } - - void EnterCombat(Unit * /*who*/) - { - DoScriptText(SAY_AGGRO, me); - DoZoneInCombat(); - - if (pInstance) - pInstance->SetData(DATA_HIGHASTROMANCERSOLARIANEVENT, IN_PROGRESS); - } - - void SummonMinion(uint32 entry, float x, float y, float z) - { - Creature* Summoned = me->SummonCreature(entry, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); - if (Summoned) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) - Summoned->AI()->AttackStart(pTarget); - - Summons.Summon(Summoned); - } - } - - float Portal_X(float radius) - { - if (urand(0,1)) - radius = -radius; - - return radius * (float)(rand()%100)/100.0f + CENTER_X; - } - - float Portal_Y(float x, float radius) - { - float z = RAND(1, -1); - - return (z*sqrt(radius*radius - (x - CENTER_X)*(x - CENTER_X)) + CENTER_Y); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (AppearDelay) - { - me->StopMoving(); - me->AttackStop(); - if (AppearDelay_Timer <= diff) - { - AppearDelay = false; - if (Phase == 2) - { - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetVisibility(VISIBILITY_OFF); - } - AppearDelay_Timer = 2000; - } else AppearDelay_Timer -= diff; - } - - if (Phase == 1) - { - if (BlindingLight_Timer <= diff) - { - BlindingLight = true; - BlindingLight_Timer = 45000; - } else BlindingLight_Timer -= diff; - - if (Wrath_Timer <= diff) - { - me->InterruptNonMeleeSpells(false); - if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true)) - DoCast(pTarget, SPELL_WRATH_OF_THE_ASTROMANCER, true); - Wrath_Timer = 20000+rand()%5000; - } else Wrath_Timer -= diff; - - if (ArcaneMissiles_Timer <= diff) - { - if (BlindingLight) - { - DoCast(me->getVictim(), SPELL_BLINDING_LIGHT); - BlindingLight = false; - }else{ - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); - - if (!me->HasInArc(2.5f, pTarget)) - pTarget = me->getVictim(); - - if (pTarget) - DoCast(pTarget, SPELL_ARCANE_MISSILES); - } - ArcaneMissiles_Timer = 3000; - } else ArcaneMissiles_Timer -= diff; - - if (m_uiWrathOfTheAstromancer_Timer <= diff) - { - me->InterruptNonMeleeSpells(false); - - //Target the tank ? - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1)) - if (pTarget->GetTypeId() == TYPEID_PLAYER) - { - DoCast(pTarget, SPELL_WRATH_OF_THE_ASTROMANCER); - m_uiWrathOfTheAstromancer_Timer = 25000; - } - else - m_uiWrathOfTheAstromancer_Timer = 1000; - } else m_uiWrathOfTheAstromancer_Timer -= diff; - - //Phase1_Timer - if (Phase1_Timer <= diff) - { - Phase = 2; - Phase1_Timer = 50000; - //After these 50 seconds she portals to the middle of the room and disappears, leaving 3 light portals behind. - me->GetMotionMaster()->Clear(); - me->GetMap()->CreatureRelocation(me, CENTER_X, CENTER_Y, CENTER_Z, CENTER_O); - for (uint8 i=0; i <= 2; ++i) - { - if (!i) - { - Portals[i][0] = Portal_X(SMALL_PORTAL_RADIUS); - Portals[i][1] = Portal_Y(Portals[i][0], SMALL_PORTAL_RADIUS); - Portals[i][2] = CENTER_Z; - } - else - { - Portals[i][0] = Portal_X(LARGE_PORTAL_RADIUS); - Portals[i][1] = Portal_Y(Portals[i][0], LARGE_PORTAL_RADIUS); - Portals[i][2] = PORTAL_Z; - } - } - if ((abs(Portals[2][0] - Portals[1][0]) < 7) && (abs(Portals[2][1] - Portals[1][1]) < 7)) - { - int i=1; - if (abs(CENTER_X + 26.0f - Portals[2][0]) < 7) - i = -1; - Portals[2][0] = Portals[2][0]+7*i; - Portals[2][1] = Portal_Y(Portals[2][0], LARGE_PORTAL_RADIUS); - } - for (int i=0; i <= 2; ++i) - { - if (Creature* Summoned = me->SummonCreature(NPC_ASTROMANCER_SOLARIAN_SPOTLIGHT, Portals[i][0], Portals[i][1], Portals[i][2], CENTER_O, TEMPSUMMON_TIMED_DESPAWN, Phase2_Timer+Phase3_Timer+AppearDelay_Timer+1700)) - { - Summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - Summoned->CastSpell(Summoned, SPELL_SPOTLIGHT, false); - } - } - AppearDelay = true; - } else Phase1_Timer-=diff; - } - else if (Phase == 2) - { - //10 seconds after Solarian disappears, 12 mobs spawn out of the three portals. - me->AttackStop(); - me->StopMoving(); - if (Phase2_Timer <= diff) - { - Phase = 3; - for (int i=0; i <= 2; ++i) - for (int j=1; j <= 4; j++) - SummonMinion(NPC_SOLARIUM_AGENT, Portals[i][0], Portals[i][1], Portals[i][2]); - - DoScriptText(SAY_SUMMON1, me); - Phase2_Timer = 10000; - } else Phase2_Timer -= diff; - } - else if (Phase == 3) - { - me->AttackStop(); - me->StopMoving(); - - //Check Phase3_Timer - if (Phase3_Timer <= diff) - { - Phase = 1; - - //15 seconds later Solarian reappears out of one of the 3 portals. Simultaneously, 2 healers appear in the two other portals. - int i = rand()%3; - me->GetMotionMaster()->Clear(); - me->GetMap()->CreatureRelocation(me, Portals[i][0], Portals[i][1], Portals[i][2], CENTER_O); - - for (int j=0; j <= 2; j++) - if (j != i) - SummonMinion(NPC_SOLARIUM_PRIEST, Portals[j][0], Portals[j][1], Portals[j][2]); - - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetVisibility(VISIBILITY_ON); - - DoScriptText(SAY_SUMMON2, me); - AppearDelay = true; - Phase3_Timer = 15000; - } else Phase3_Timer -= diff; - } - else if (Phase == 4) - { - //Fear_Timer - if (Fear_Timer <= diff) - { - DoCast(me, SPELL_FEAR); - Fear_Timer = 20000; - } else Fear_Timer -= diff; - - //VoidBolt_Timer - if (VoidBolt_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_VOID_BOLT); - VoidBolt_Timer = 10000; - } else VoidBolt_Timer -= diff; - } - - //When Solarian reaches 20% she will transform into a huge void walker. - if (Phase != 4 && ((me->GetHealth()*100 / me->GetMaxHealth())<20)) - { - Phase = 4; - - //To make sure she wont be invisible or not selecatble - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetVisibility(VISIBILITY_ON); - DoScriptText(SAY_VOIDA, me); - DoScriptText(SAY_VOIDB, me); - me->SetArmor(WV_ARMOR); - me->SetDisplayId(MODEL_VOIDWALKER); - me->SetFloatValue(OBJECT_FIELD_SCALE_X, defaultsize*2.5f); - } - - DoMeleeAttackIfReady(); - } -}; - -struct mob_solarium_priestAI : public ScriptedAI -{ - mob_solarium_priestAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance *pInstance; - - uint32 healTimer; - uint32 holysmiteTimer; - uint32 aoesilenceTimer; - - void Reset() - { - healTimer = 9000; - holysmiteTimer = 1; - aoesilenceTimer = 15000; - } - - void EnterCombat(Unit * /*who*/) - { - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (healTimer <= diff) - { - Unit *pTarget = NULL; - - switch (urand(0,1)) - { - case 0: - if (pInstance) - pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_ASTROMANCER)); - break; - case 1: - pTarget = me; - break; - } - - if (pTarget) - { - DoCast(pTarget, SPELL_SOLARIUM_GREAT_HEAL); - healTimer = 9000; - } - } else healTimer -= diff; - - if (holysmiteTimer <= diff) - { - DoCast(me->getVictim(), SPELL_SOLARIUM_HOLY_SMITE); - holysmiteTimer = 4000; - } else holysmiteTimer -= diff; - - if (aoesilenceTimer <= diff) - { - DoCast(me->getVictim(), SPELL_SOLARIUM_ARCANE_TORRENT); - aoesilenceTimer = 13000; - } else aoesilenceTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_solarium_priest(Creature* pCreature) -{ - return new mob_solarium_priestAI (pCreature); -} - -CreatureAI* GetAI_boss_high_astromancer_solarian(Creature* pCreature) -{ - return new boss_high_astromancer_solarianAI (pCreature); -} - -void AddSC_boss_high_astromancer_solarian() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_high_astromancer_solarian"; - newscript->GetAI = &GetAI_boss_high_astromancer_solarian; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_solarium_priest"; - newscript->GetAI = &GetAI_mob_solarium_priest; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Outland/tempest_keep/the_eye/boss_kaelthas.cpp b/src/server/scripts/Outland/tempest_keep/the_eye/boss_kaelthas.cpp deleted file mode 100644 index 05681fb7539..00000000000 --- a/src/server/scripts/Outland/tempest_keep/the_eye/boss_kaelthas.cpp +++ /dev/null @@ -1,1498 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Kaelthas -SD%Complete: 60 -SDComment: SQL, weapon scripts, mind control, need correct spells(interruptible/uninterruptible), phoenix spawn location & animation, phoenix behaviour & spawn during gravity lapse -SDCategory: Tempest Keep, The Eye -EndScriptData */ - -#include "ScriptedPch.h" -#include "the_eye.h" -#include "WorldPacket.h" - -enum eEnums -{ - //kael'thas Speech - SAY_INTRO = -1550016, - SAY_INTRO_CAPERNIAN = -1550017, - SAY_INTRO_TELONICUS = -1550018, - SAY_INTRO_THALADRED = -1550019, - SAY_INTRO_SANGUINAR = -1550020, - SAY_PHASE2_WEAPON = -1550021, - SAY_PHASE3_ADVANCE = -1550022, - SAY_PHASE4_INTRO2 = -1550023, - SAY_PHASE5_NUTS = -1550024, - SAY_SLAY1 = -1550025, - SAY_SLAY2 = -1550026, - SAY_SLAY3 = -1550027, - SAY_MINDCONTROL1 = -1550028, - SAY_MINDCONTROL2 = -1550029, - SAY_GRAVITYLAPSE1 = -1550030, - SAY_GRAVITYLAPSE2 = -1550031, - SAY_SUMMON_PHOENIX1 = -1550032, - SAY_SUMMON_PHOENIX2 = -1550033, - SAY_DEATH = -1550034, - - //Thaladred the Darkener speech - SAY_THALADRED_AGGRO = -1550035, - SAY_THALADRED_DEATH = -1550036, - EMOTE_THALADRED_GAZE = -1550037, - - //Lord Sanguinar speech - SAY_SANGUINAR_AGGRO = -1550038, - SAY_SANGUINAR_DEATH = -1550039, - - //Grand Astromancer Capernian speech - SAY_CAPERNIAN_AGGRO = -1550040, - SAY_CAPERNIAN_DEATH = -1550041, - - //Master Engineer Telonicus speech - SAY_TELONICUS_AGGRO = -1550042, - SAY_TELONICUS_DEATH = -1550043, - - //Phase 2 spells - SPELL_SUMMON_WEAPONS = 36976, - SPELL_SUMMON_WEAPONA = 36958, - SPELL_SUMMON_WEAPONB = 36959, - SPELL_SUMMON_WEAPONC = 36960, - SPELL_SUMMON_WEAPOND = 36961, - SPELL_SUMMON_WEAPONE = 36962, - SPELL_SUMMON_WEAPONF = 36963, - SPELL_SUMMON_WEAPONG = 36964, - SPELL_RES_VISUAL = 24171, - - //Phase 4 spells - SPELL_FIREBALL = 22088, //wrong but works with CastCustomSpell - SPELL_PYROBLAST = 36819, - SPELL_FLAME_STRIKE = 36735, - SPELL_FLAME_STRIKE_VIS = 36730, - SPELL_FLAME_STRIKE_DMG = 36731, - SPELL_ARCANE_DISRUPTION = 36834, - SPELL_SHOCK_BARRIER = 36815, - SPELL_PHOENIX_ANIMATION = 36723, - SPELL_MIND_CONTROL = 32830, - - //Phase 5 spells - SPELL_EXPLODE = 36092, - SPELL_FULLPOWER = 36187, - SPELL_KNOCKBACK = 11027, - SPELL_GRAVITY_LAPSE = 34480, - SPELL_GRAVITY_LAPSE_AURA = 39432, - SPELL_NETHER_BEAM = 35873, - - //Thaladred the Darkener spells - SPELL_PSYCHIC_BLOW = 10689, - SPELL_SILENCE = 30225, - //Lord Sanguinar spells - SPELL_BELLOWING_ROAR = 40636, - //Grand Astromancer Capernian spells - - SPELL_CAPERNIAN_FIREBALL = 36971, - SPELL_CONFLAGRATION = 37018, - SPELL_ARCANE_EXPLOSION = 36970, - //Master Engineer Telonicus spells - SPELL_BOMB = 37036, - SPELL_REMOTE_TOY = 37027, - //Nether Vapor spell - SPELL_NETHER_VAPOR = 35859, - //Phoenix spell - SPELL_BURN = 36720, - SPELL_EMBER_BLAST = 34341, - SPELL_REBIRTH = 41587, - - //Creature IDs - NPC_PHOENIX = 21362, - NPC_PHOENIX_EGG = 21364, - - //Phoenix egg and phoenix model - MODEL_ID_PHOENIX = 19682, - MODEL_ID_PHOENIX_EGG = 20245, - - MAX_ADVISORS = 4 -}; - -uint32 m_auiSpellSummonWeapon[]= -{ - SPELL_SUMMON_WEAPONA, SPELL_SUMMON_WEAPONB, SPELL_SUMMON_WEAPONC, SPELL_SUMMON_WEAPOND, - SPELL_SUMMON_WEAPONE, SPELL_SUMMON_WEAPONF, SPELL_SUMMON_WEAPONG -}; - -const float CAPERNIAN_DISTANCE = 20.0f; //she casts away from the target -const float KAEL_VISIBLE_RANGE = 50.0f; - -const float afGravityPos[3] = {795.0f, 0.0f, 70.0f}; - -#define TIME_PHASE_2_3 120000 -#define TIME_PHASE_3_4 180000 - -//Base AI for Advisors -struct advisorbase_ai : public ScriptedAI -{ - advisorbase_ai(Creature* pCreature) : ScriptedAI(pCreature) - { - m_pInstance = pCreature->GetInstanceData(); - m_bDoubled_Health = false; - } - - ScriptedInstance* m_pInstance; - bool FakeDeath; - bool m_bDoubled_Health; - uint32 DelayRes_Timer; - uint64 DelayRes_Target; - - void Reset() - { - if (m_bDoubled_Health) - { - me->SetMaxHealth(me->GetMaxHealth() / 2); - m_bDoubled_Health = false; - } - - FakeDeath = false; - DelayRes_Timer = 0; - DelayRes_Target = 0; - - me->SetStandState(UNIT_STAND_STATE_STAND); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - - //reset encounter - if (m_pInstance && (m_pInstance->GetData(DATA_KAELTHASEVENT) == 1 || m_pInstance->GetData(DATA_KAELTHASEVENT) == 3)) - if (Creature *Kaelthas = Unit::GetCreature((*me), m_pInstance->GetData64(DATA_KAELTHAS))) - Kaelthas->AI()->EnterEvadeMode(); - } - - void MoveInLineOfSight(Unit *who) - { - if (!who || FakeDeath || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - return; - - ScriptedAI::MoveInLineOfSight(who); - } - - void AttackStart(Unit* who) - { - if (!who || FakeDeath || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - return; - - ScriptedAI::AttackStart(who); - } - - void Revive(Unit* /*Target*/) - { - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - // double health for phase 3 - me->SetMaxHealth(me->GetMaxHealth() * 2); - m_bDoubled_Health = true; - me->SetHealth(me->GetMaxHealth()); - me->SetStandState(UNIT_STAND_STATE_STAND); - - DoCast(me, SPELL_RES_VISUAL, false); - DelayRes_Timer = 2000; - } - - void DamageTaken(Unit* pKiller, uint32 &damage) - { - if (damage < me->GetHealth()) - return; - - //Prevent glitch if in fake death - if (FakeDeath && m_pInstance && m_pInstance->GetData(DATA_KAELTHASEVENT) != 0) - { - damage = 0; - return; - } - - //Don't really die in phase 1 & 3, only die after that - if (m_pInstance && m_pInstance->GetData(DATA_KAELTHASEVENT) != 0) - { - //prevent death - damage = 0; - FakeDeath = true; - - me->InterruptNonMeleeSpells(false); - me->SetHealth(0); - me->StopMoving(); - me->ClearComboPointHolders(); - me->RemoveAllAurasOnDeath(); - me->ModifyAuraState(AURA_STATE_HEALTHLESS_20_PERCENT, false); - me->ModifyAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, false); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->ClearAllReactives(); - me->SetUInt64Value(UNIT_FIELD_TARGET,0); - me->GetMotionMaster()->Clear(); - me->GetMotionMaster()->MoveIdle(); - me->SetStandState(UNIT_STAND_STATE_DEAD); - JustDied(pKiller); - } - } - - void UpdateAI(const uint32 diff) - { - if (DelayRes_Timer) - { - if (DelayRes_Timer <= diff) - { - DelayRes_Timer = 0; - FakeDeath = false; - - Unit* Target = Unit::GetUnit((*me), DelayRes_Target); - if (!Target) - Target = me->getVictim(); - - DoResetThreat(); - AttackStart(Target); - me->GetMotionMaster()->Clear(); - me->GetMotionMaster()->MoveChase(Target); - me->AddThreat(Target, 0.0f); - } else DelayRes_Timer -= diff; - } - } - -}; - -//Kael'thas AI -struct boss_kaelthasAI : public ScriptedAI -{ - boss_kaelthasAI(Creature* pCreature) : ScriptedAI(pCreature), summons(me) - { - m_pInstance = pCreature->GetInstanceData(); - memset(&m_auiAdvisorGuid, 0, sizeof(m_auiAdvisorGuid)); - } - - ScriptedInstance* m_pInstance; - - uint32 Fireball_Timer; - uint32 ArcaneDisruption_Timer; - uint32 Phoenix_Timer; - uint32 ShockBarrier_Timer; - uint32 GravityLapse_Timer; - uint32 GravityLapse_Phase; - uint32 NetherBeam_Timer; - uint32 NetherVapor_Timer; - uint32 FlameStrike_Timer; - uint32 MindControl_Timer; - uint32 Phase; - uint32 PhaseSubphase; //generic - uint32 Phase_Timer; //generic timer - uint32 PyrosCasted; - - bool InGravityLapse; - bool IsCastingFireball; - bool ChainPyros; - - SummonList summons; - - uint64 m_auiAdvisorGuid[MAX_ADVISORS]; - - void Reset() - { - Fireball_Timer = 5000+rand()%10000; - ArcaneDisruption_Timer = 45000; - MindControl_Timer = 40000; - Phoenix_Timer = 50000; - ShockBarrier_Timer = 60000; - FlameStrike_Timer = 30000; - GravityLapse_Timer = 20000; - GravityLapse_Phase = 0; - NetherBeam_Timer = 8000; - NetherVapor_Timer = 10000; - PyrosCasted = 0; - Phase = 0; - InGravityLapse = false; - IsCastingFireball = false; - ChainPyros = false; - - if (me->isInCombat()) - PrepareAdvisors(); - - summons.DespawnAll(); - - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - - if (m_pInstance) - m_pInstance->SetData(DATA_KAELTHASEVENT, 0); - } - - void PrepareAdvisors() - { - for (uint8 i = 0; i < MAX_ADVISORS; ++i) - { - if (Creature *pCreature = Unit::GetCreature((*me), m_auiAdvisorGuid[i])) - { - pCreature->Respawn(); - pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - pCreature->setFaction(me->getFaction()); - pCreature->AI()->EnterEvadeMode(); - } - } - } - - void StartEvent() - { - if (!m_pInstance) - return; - - m_auiAdvisorGuid[0] = m_pInstance->GetData64(DATA_THALADREDTHEDARKENER); - m_auiAdvisorGuid[1] = m_pInstance->GetData64(DATA_LORDSANGUINAR); - m_auiAdvisorGuid[2] = m_pInstance->GetData64(DATA_GRANDASTROMANCERCAPERNIAN); - m_auiAdvisorGuid[3] = m_pInstance->GetData64(DATA_MASTERENGINEERTELONICUS); - - if (!m_auiAdvisorGuid[0] || !m_auiAdvisorGuid[1] || !m_auiAdvisorGuid[2] || !m_auiAdvisorGuid[3]) - { - error_log("TSCR: Kael'Thas One or more advisors missing, Skipping Phases 1-3"); - - DoScriptText(SAY_PHASE4_INTRO2, me); - - Phase = 4; - - m_pInstance->SetData(DATA_KAELTHASEVENT, 4); - - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) - AttackStart(pTarget); - - } - else - { - PrepareAdvisors(); - - DoScriptText(SAY_INTRO, me); - - m_pInstance->SetData(DATA_KAELTHASEVENT, 1); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - - PhaseSubphase = 0; - Phase_Timer = 23000; - Phase = 1; - } - } - - void MoveInLineOfSight(Unit *who) - { - if (!me->hasUnitState(UNIT_STAT_STUNNED) && who->isTargetableForAttack() && - me->IsHostileTo(who) && who->isInAccessiblePlaceFor(me)) - { - if (!me->canFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) - return; - - float attackRadius = me->GetAttackDistance(who); - if (me->IsWithinDistInMap(who, attackRadius) && me->IsWithinLOSInMap(who)) - { - if (!me->getVictim() && Phase >= 4) - { - who->RemoveAurasDueToSpell(SPELL_AURA_MOD_STEALTH); - AttackStart(who); - } - else if (me->GetMap()->IsDungeon()) - { - if (m_pInstance && !m_pInstance->GetData(DATA_KAELTHASEVENT) && !Phase) - StartEvent(); - - who->SetInCombatWith(me); - me->AddThreat(who, 0.0f); - } - } - } - } - - void Aggro(Unit * /*who*/) - { - if (m_pInstance && !m_pInstance->GetData(DATA_KAELTHASEVENT) && !Phase) - StartEvent(); - } - - void KilledUnit() - { - DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), me); - } - - void JustSummoned(Creature* pSummoned) - { - // if not phoenix, then it's one of the 7 weapons - if (pSummoned->GetEntry() != NPC_PHOENIX) - { - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) - pSummoned->AI()->AttackStart(pTarget); - - summons.Summon(pSummoned); - } - } - - void SummonedCreatureDespawn(Creature *summon) {summons.Despawn(summon);} - - void JustDied(Unit* /*Killer*/) - { - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - - DoScriptText(SAY_DEATH, me); - - summons.DespawnAll(); - - if (m_pInstance) - m_pInstance->SetData(DATA_KAELTHASEVENT, 0); - - for (uint8 i = 0; i < MAX_ADVISORS; ++i) - { - if (Unit* pAdvisor = Unit::GetUnit((*me), m_auiAdvisorGuid[i])) - pAdvisor->Kill(pAdvisor); - } - } - - void UpdateAI(const uint32 diff) - { - //Phase 1 - switch (Phase) - { - case 1: - { - Unit *pTarget = NULL; - Creature* Advisor = NULL; - - //Subphase switch - switch(PhaseSubphase) - { - //Subphase 1 - Start - case 0: - if (Phase_Timer <= diff) - { - DoScriptText(SAY_INTRO_THALADRED, me); - - //start advisor within 7 seconds - Phase_Timer = 7000; - ++PhaseSubphase; - } else Phase_Timer -= diff; - break; - - //Subphase 1 - Unlock advisor - case 1: - if (Phase_Timer <= diff) - { - Advisor = (Unit::GetCreature((*me), m_auiAdvisorGuid[0])); - - if (Advisor) - { - Advisor->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - Advisor->setFaction(me->getFaction()); - - pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (pTarget) - Advisor->AI()->AttackStart(pTarget); - } - - ++PhaseSubphase; - } else Phase_Timer -= diff; - break; - - //Subphase 2 - Start - case 2: - Advisor = (Unit::GetCreature((*me), m_auiAdvisorGuid[0])); - - if (Advisor && (Advisor->getStandState() == UNIT_STAND_STATE_DEAD)) - { - DoScriptText(SAY_INTRO_SANGUINAR, me); - - //start advisor within 12.5 seconds - Phase_Timer = 12500; - ++PhaseSubphase; - } - break; - - //Subphase 2 - Unlock advisor - case 3: - if (Phase_Timer <= diff) - { - Advisor = (Unit::GetCreature((*me), m_auiAdvisorGuid[1])); - - if (Advisor) - { - Advisor->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - Advisor->setFaction(me->getFaction()); - - pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (pTarget) - Advisor->AI()->AttackStart(pTarget); - } - - ++PhaseSubphase; - } else Phase_Timer -= diff; - break; - - //Subphase 3 - Start - case 4: - Advisor = (Unit::GetCreature((*me), m_auiAdvisorGuid[1])); - - if (Advisor && (Advisor->getStandState() == UNIT_STAND_STATE_DEAD)) - { - DoScriptText(SAY_INTRO_CAPERNIAN, me); - - //start advisor within 7 seconds - Phase_Timer = 7000; - ++PhaseSubphase; - } - break; - - //Subphase 3 - Unlock advisor - case 5: - if (Phase_Timer <= diff) - { - Advisor = (Unit::GetCreature((*me), m_auiAdvisorGuid[2])); - - if (Advisor) - { - Advisor->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - Advisor->setFaction(me->getFaction()); - - pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (pTarget) - Advisor->AI()->AttackStart(pTarget); - } - - ++PhaseSubphase; - } else Phase_Timer -= diff; - break; - - //Subphase 4 - Start - case 6: - Advisor = (Unit::GetCreature((*me), m_auiAdvisorGuid[2])); - - if (Advisor && (Advisor->getStandState() == UNIT_STAND_STATE_DEAD)) - { - DoScriptText(SAY_INTRO_TELONICUS, me); - - //start advisor within 8.4 seconds - Phase_Timer = 8400; - ++PhaseSubphase; - } - break; - - //Subphase 4 - Unlock advisor - case 7: - if (Phase_Timer <= diff) - { - Advisor = (Unit::GetCreature((*me), m_auiAdvisorGuid[3])); - - if (Advisor) - { - Advisor->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - Advisor->setFaction(me->getFaction()); - - pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (pTarget) - Advisor->AI()->AttackStart(pTarget); - } - - Phase_Timer = 3000; - ++PhaseSubphase; - } else Phase_Timer -= diff; - break; - - //End of phase 1 - case 8: - Advisor = (Unit::GetCreature((*me), m_auiAdvisorGuid[3])); - - if (Advisor && (Advisor->getStandState() == UNIT_STAND_STATE_DEAD)) - { - Phase = 2; - if (m_pInstance) - m_pInstance->SetData(DATA_KAELTHASEVENT, 2); - - DoScriptText(SAY_PHASE2_WEAPON, me); - - PhaseSubphase = 0; - Phase_Timer = 3500; - DoCast(me, SPELL_SUMMON_WEAPONS); - } - break; - } - } - break; - - case 2: - { - if (PhaseSubphase == 0) - { - if (Phase_Timer <= diff) - { - PhaseSubphase = 1; - } else Phase_Timer -= diff; - } - - //Spawn weapons - if (PhaseSubphase == 1) - { - DoCast(me, SPELL_SUMMON_WEAPONS, false); - - uint8 uiMaxWeapon = sizeof(m_auiSpellSummonWeapon)/sizeof(uint32); - - for (uint32 i = 0; i < uiMaxWeapon; ++i) - DoCast(me, m_auiSpellSummonWeapon[i], true); - - PhaseSubphase = 2; - Phase_Timer = TIME_PHASE_2_3; - } - - if (PhaseSubphase == 2) - { - if (Phase_Timer <= diff) - { - DoScriptText(SAY_PHASE3_ADVANCE, me); - if (m_pInstance) - m_pInstance->SetData(DATA_KAELTHASEVENT, 3); - Phase = 3; - PhaseSubphase = 0; - } else Phase_Timer -= diff; - } - } - break; - - case 3: - { - if (PhaseSubphase == 0) - { - //Respawn advisors - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); - - Creature *Advisor; - for (uint8 i = 0; i < MAX_ADVISORS; ++i) - { - Advisor = Unit::GetCreature((*me), m_auiAdvisorGuid[i]); - - if (!Advisor) - error_log("SD2: Kael'Thas Advisor %u does not exist. Possibly despawned? Incorrectly Killed?", i); - else - CAST_AI(advisorbase_ai, Advisor->AI())->Revive(pTarget); - } - - PhaseSubphase = 1; - Phase_Timer = TIME_PHASE_3_4; - } - - if (Phase_Timer <= diff) - { - DoScriptText(SAY_PHASE4_INTRO2, me); - Phase = 4; - - if (m_pInstance) - m_pInstance->SetData(DATA_KAELTHASEVENT, 4); - - // Sometimes people can collect Aggro in Phase 1-3. Reset threat before releasing Kael. - DoResetThreat(); - - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) - AttackStart(pTarget); - - Phase_Timer = 30000; - } else Phase_Timer -= diff; - } - break; - - case 4: - case 5: - case 6: - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //Fireball_Timer - if (!InGravityLapse && !ChainPyros && Phase != 5) - { - if (Fireball_Timer <= diff) - { - if (!IsCastingFireball) - { - if (!me->IsNonMeleeSpellCasted(false)) - { - //interruptable - me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, false); - int32 dmg = 20000+rand()%5000; - me->CastCustomSpell(me->getVictim(), SPELL_FIREBALL, &dmg, 0, 0, false); - IsCastingFireball = true; - Fireball_Timer = 2500; - } - } - else - { - //apply resistance - me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, true); - IsCastingFireball = false; - Fireball_Timer = 5000+rand()%10000; - } - } else Fireball_Timer -= diff; - - //ArcaneDisruption_Timer - if (ArcaneDisruption_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_ARCANE_DISRUPTION, true); - ArcaneDisruption_Timer = 60000; - } else ArcaneDisruption_Timer -= diff; - - if (FlameStrike_Timer <= diff) - { - if (Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(pUnit, SPELL_FLAME_STRIKE); - - FlameStrike_Timer = 30000; - } else FlameStrike_Timer -= diff; - - if (MindControl_Timer <= diff) - { - if (me->getThreatManager().getThreatList().size() >= 2) - for (uint32 i = 0; i < 3; ++i) - { - debug_log("SD2: Kael'Thas mind control not supported."); - //DoCast(pUnit, SPELL_MIND_CONTROL); - } - - MindControl_Timer = 60000; - } else MindControl_Timer -= diff; - } - - //Phoenix_Timer - if (Phoenix_Timer <= diff) - { - DoCast(me, SPELL_PHOENIX_ANIMATION); - DoScriptText(RAND(SAY_SUMMON_PHOENIX1,SAY_SUMMON_PHOENIX2), me); - - Phoenix_Timer = 60000; - } else Phoenix_Timer -= diff; - - //Phase 4 specific spells - if (Phase == 4) - { - if (me->GetHealth()*100 / me->GetMaxHealth() < 50) - { - if (m_pInstance) - m_pInstance->SetData(DATA_KAELTHASEVENT, 4); - Phase = 5; - Phase_Timer = 10000; - - DoScriptText(SAY_PHASE5_NUTS, me); - - me->StopMoving(); - me->GetMotionMaster()->Clear(); - me->GetMotionMaster()->MoveIdle(); - me->GetMap()->CreatureRelocation(me, afGravityPos[0], afGravityPos[1], afGravityPos[2], 0); - me->SendMonsterMove(afGravityPos[0], afGravityPos[1], afGravityPos[2], 0, 0, 0); - - me->InterruptNonMeleeSpells(false); - DoCast(me, SPELL_FULLPOWER); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - } - - //ShockBarrier_Timer - if (ShockBarrier_Timer <= diff) - { - DoCast(me, SPELL_SHOCK_BARRIER); - ChainPyros = true; - PyrosCasted = 0; - ShockBarrier_Timer = 60000; - } else ShockBarrier_Timer -= diff; - - //Chain Pyros (3 of them max) - if (ChainPyros && !me->IsNonMeleeSpellCasted(false)) - { - if (PyrosCasted < 3) - { - DoCast(me->getVictim(), SPELL_PYROBLAST); - ++PyrosCasted; - } - else - { - ChainPyros = false; - Fireball_Timer = 2500; - ArcaneDisruption_Timer = 60000; - } - } - } - - if (Phase == 5) - { - if (Phase_Timer <= diff) - { - me->InterruptNonMeleeSpells(false); - me->RemoveAurasDueToSpell(SPELL_FULLPOWER); - - DoCast(me, SPELL_EXPLODE); - - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - Phase = 6; - AttackStart(me->getVictim()); - } else Phase_Timer -= diff; - } - - //Phase 5 - if (Phase == 6) - { - - //GravityLapse_Timer - if (GravityLapse_Timer <= diff) - { - std::list::const_iterator i = me->getThreatManager().getThreatList().begin(); - switch (GravityLapse_Phase) - { - case 0: - me->StopMoving(); - me->GetMotionMaster()->Clear(); - me->GetMotionMaster()->MoveIdle(); - me->GetMap()->CreatureRelocation(me, afGravityPos[0], afGravityPos[1], afGravityPos[2], 0); - me->SendMonsterMove(afGravityPos[0], afGravityPos[1], afGravityPos[2], 0, MOVEMENTFLAG_NONE, 0); - - // 1) Kael'thas will portal the whole raid right into his body - for (i = me->getThreatManager().getThreatList().begin(); i!= me->getThreatManager().getThreatList().end(); ++i) - { - Unit* pUnit = Unit::GetUnit((*me), (*i)->getUnitGuid()); - if (pUnit && (pUnit->GetTypeId() == TYPEID_PLAYER)) - { - //Use work around packet to prevent player from being dropped from combat - DoTeleportPlayer(pUnit, afGravityPos[0], afGravityPos[1], afGravityPos[2], pUnit->GetOrientation()); - } - } - - GravityLapse_Timer = 500; - ++GravityLapse_Phase; - InGravityLapse = true; - ShockBarrier_Timer = 1000; - NetherBeam_Timer = 5000; - break; - - case 1: - DoScriptText(RAND(SAY_GRAVITYLAPSE1,SAY_GRAVITYLAPSE2), me); - - // 2) At that point he will put a Gravity Lapse debuff on everyone - for (i = me->getThreatManager().getThreatList().begin(); i != me->getThreatManager().getThreatList().end(); ++i) - { - if (Unit* pUnit = Unit::GetUnit((*me), (*i)->getUnitGuid())) - { - DoCast(pUnit, SPELL_KNOCKBACK, true); - //Gravity lapse - needs an exception in Spell system to work - - pUnit->CastSpell(pUnit, SPELL_GRAVITY_LAPSE, true, 0, 0, me->GetGUID()); - pUnit->CastSpell(pUnit, SPELL_GRAVITY_LAPSE_AURA, true, 0, 0, me->GetGUID()); - - //Using packet workaround - WorldPacket data(12); - data.SetOpcode(SMSG_MOVE_SET_CAN_FLY); - data.append(pUnit->GetPackGUID()); - data << uint32(0); - pUnit->SendMessageToSet(&data, true); - } - } - GravityLapse_Timer = 10000; - ++GravityLapse_Phase; - break; - - case 2: - //Cast nether vapor aura on self - me->InterruptNonMeleeSpells(false); - DoCast(me, SPELL_NETHER_VAPOR); - - GravityLapse_Timer = 20000; - ++GravityLapse_Phase; - break; - - case 3: - //Remove flight - for (i = me->getThreatManager().getThreatList().begin(); i!= me->getThreatManager().getThreatList().end(); ++i) - { - if (Unit* pUnit = Unit::GetUnit((*me), (*i)->getUnitGuid())) - { - //Using packet workaround - WorldPacket data(12); - data.SetOpcode(SMSG_MOVE_UNSET_CAN_FLY); - data.append(pUnit->GetPackGUID()); - data << uint32(0); - pUnit->SendMessageToSet(&data, true); - } - } - - me->RemoveAurasDueToSpell(SPELL_NETHER_VAPOR); - InGravityLapse = false; - GravityLapse_Timer = 60000; - GravityLapse_Phase = 0; - AttackStart(me->getVictim()); - break; - } - } else GravityLapse_Timer -= diff; - - if (InGravityLapse) - { - //ShockBarrier_Timer - if (ShockBarrier_Timer <= diff) - { - DoCast(me, SPELL_SHOCK_BARRIER); - ShockBarrier_Timer = 20000; - } else ShockBarrier_Timer -= diff; - - //NetherBeam_Timer - if (NetherBeam_Timer <= diff) - { - if (Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(pUnit, SPELL_NETHER_BEAM); - - NetherBeam_Timer = 4000; - } else NetherBeam_Timer -= diff; - } - } - - if (!InGravityLapse) - DoMeleeAttackIfReady(); - } - } - } -}; - -//Thaladred the Darkener AI -struct boss_thaladred_the_darkenerAI : public advisorbase_ai -{ - boss_thaladred_the_darkenerAI(Creature* pCreature) : advisorbase_ai(pCreature) {} - - uint32 Gaze_Timer; - uint32 Silence_Timer; - uint32 PsychicBlow_Timer; - - void Reset() - { - Gaze_Timer = 100; - Silence_Timer = 20000; - PsychicBlow_Timer = 10000; - - advisorbase_ai::Reset(); - } - - void Aggro(Unit *who) - { - if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - return; - - if (!who || FakeDeath) - return; - - DoScriptText(SAY_THALADRED_AGGRO, me); - me->AddThreat(who, 5000000.0f); - } - - void JustDied(Unit* /*pKiller*/) - { - if (m_pInstance && m_pInstance->GetData(DATA_KAELTHASEVENT) == 3) - DoScriptText(SAY_THALADRED_DEATH, me); - } - - void UpdateAI(const uint32 diff) - { - advisorbase_ai::UpdateAI(diff); - - //Faking death, don't do anything - if (FakeDeath) - return; - - //Return since we have no target - if (!UpdateVictim()) - return; - - //Gaze_Timer - if (Gaze_Timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - DoResetThreat(); - me->AddThreat(pTarget, 5000000.0f); - DoScriptText(EMOTE_THALADRED_GAZE, me, pTarget); - Gaze_Timer = 8500; - } - } else Gaze_Timer -= diff; - - //Silence_Timer - if (Silence_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SILENCE); - Silence_Timer = 20000; - } else Silence_Timer -= diff; - - //PsychicBlow_Timer - if (PsychicBlow_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_PSYCHIC_BLOW); - PsychicBlow_Timer = 20000+rand()%5000; - } else PsychicBlow_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -//Lord Sanguinar AI -struct boss_lord_sanguinarAI : public advisorbase_ai -{ - boss_lord_sanguinarAI(Creature* pCreature) : advisorbase_ai(pCreature) {} - - uint32 Fear_Timer; - - void Reset() - { - Fear_Timer = 20000; - advisorbase_ai::Reset(); - } - - void Aggro(Unit *who) - { - if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - return; - - if (!who || FakeDeath) - return; - - DoScriptText(SAY_SANGUINAR_AGGRO, me); - } - - void JustDied(Unit* /*Killer*/) - { - if (m_pInstance && m_pInstance->GetData(DATA_KAELTHASEVENT) == 3) - DoScriptText(SAY_SANGUINAR_DEATH, me); - } - - void UpdateAI(const uint32 diff) - { - advisorbase_ai::UpdateAI(diff); - - //Faking death, don't do anything - if (FakeDeath) - return; - - //Return since we have no target - if (!UpdateVictim()) - return; - - //Fear_Timer - if (Fear_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_BELLOWING_ROAR); - Fear_Timer = 25000+rand()%10000; //approximately every 30 seconds - } else Fear_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -//Grand Astromancer Capernian AI -struct boss_grand_astromancer_capernianAI : public advisorbase_ai -{ - boss_grand_astromancer_capernianAI(Creature* pCreature) : advisorbase_ai(pCreature) {} - - uint32 Fireball_Timer; - uint32 Conflagration_Timer; - uint32 ArcaneExplosion_Timer; - uint32 Yell_Timer; - bool Yell; - - void Reset() - { - Fireball_Timer = 2000; - Conflagration_Timer = 20000; - ArcaneExplosion_Timer = 5000; - Yell_Timer = 2000; - Yell = false; - - advisorbase_ai::Reset(); - } - - void JustDied(Unit* /*pKiller*/) - { - if (m_pInstance && m_pInstance->GetData(DATA_KAELTHASEVENT) == 3) - DoScriptText(SAY_CAPERNIAN_DEATH, me); - } - - void AttackStart(Unit* who) - { - if (!who || FakeDeath || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - return; - - if (me->Attack(who, true)) - { - me->AddThreat(who, 0.0f); - me->SetInCombatWith(who); - who->SetInCombatWith(me); - - me->GetMotionMaster()->MoveChase(who, CAPERNIAN_DISTANCE); - } - } - - void Aggro(Unit *who) - { - if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - return; - - if (!who || FakeDeath) - return; - } - - void UpdateAI(const uint32 diff) - { - advisorbase_ai::UpdateAI(diff); - - //Faking Death, don't do anything - if (FakeDeath) - return; - - //Return since we have no target - if (!UpdateVictim()) - return; - - //Yell_Timer - if (!Yell) - { - if (Yell_Timer <= diff) - { - DoScriptText(SAY_CAPERNIAN_AGGRO, me); - Yell = true; - } else Yell_Timer -= diff; - } - - //Fireball_Timer - if (Fireball_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_CAPERNIAN_FIREBALL); - Fireball_Timer = 4000; - } else Fireball_Timer -= diff; - - //Conflagration_Timer - if (Conflagration_Timer <= diff) - { - Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); - - if (pTarget && me->IsWithinDistInMap(pTarget, 30)) - DoCast(pTarget, SPELL_CONFLAGRATION); - else - DoCast(me->getVictim(), SPELL_CONFLAGRATION); - - Conflagration_Timer = 10000+rand()%5000; - } else Conflagration_Timer -= diff; - - //ArcaneExplosion_Timer - if (ArcaneExplosion_Timer <= diff) - { - bool InMeleeRange = false; - Unit *pTarget = NULL; - std::list& m_threatlist = me->getThreatManager().getThreatList(); - for (std::list::const_iterator i = m_threatlist.begin(); i!= m_threatlist.end(); ++i) - { - Unit* pUnit = Unit::GetUnit((*me), (*i)->getUnitGuid()); - //if in melee range - if (pUnit && pUnit->IsWithinDistInMap(me, 5)) - { - InMeleeRange = true; - pTarget = pUnit; - break; - } - } - - if (InMeleeRange) - DoCast(pTarget, SPELL_ARCANE_EXPLOSION); - - ArcaneExplosion_Timer = 4000+rand()%2000; - } else ArcaneExplosion_Timer -= diff; - - //Do NOT deal any melee damage. - } -}; - -//Master Engineer Telonicus AI -struct boss_master_engineer_telonicusAI : public advisorbase_ai -{ - boss_master_engineer_telonicusAI(Creature* pCreature) : advisorbase_ai(pCreature) {} - - uint32 Bomb_Timer; - uint32 RemoteToy_Timer; - - void Reset() - { - Bomb_Timer = 10000; - RemoteToy_Timer = 5000; - - advisorbase_ai::Reset(); - } - - void JustDied(Unit* /*pKiller*/) - { - if (m_pInstance && m_pInstance->GetData(DATA_KAELTHASEVENT) == 3) - DoScriptText(SAY_TELONICUS_DEATH, me); - } - - void Aggro(Unit *who) - { - if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - return; - - if (!who || FakeDeath) - return; - - DoScriptText(SAY_TELONICUS_AGGRO, me); - } - - void UpdateAI(const uint32 diff) - { - advisorbase_ai::UpdateAI(diff); - - //Faking Death, do nothing - if (FakeDeath) - return; - - //Return since we have no target - if (!UpdateVictim()) - return; - - //Bomb_Timer - if (Bomb_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_BOMB); - Bomb_Timer = 25000; - } else Bomb_Timer -= diff; - - //RemoteToy_Timer - if (RemoteToy_Timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(pTarget, SPELL_REMOTE_TOY); - - RemoteToy_Timer = 10000+rand()%5000; - } else RemoteToy_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -//Flame Strike AI -struct mob_kael_flamestrikeAI : public Scripted_NoMovementAI -{ - mob_kael_flamestrikeAI(Creature* pCreature) : Scripted_NoMovementAI(pCreature) {} - - uint32 Timer; - bool Casting; - bool KillSelf; - - void Reset() - { - Timer = 5000; - Casting = false; - KillSelf = false; - - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->setFaction(14); - } - - void MoveInLineOfSight(Unit * /*who*/) {} - - void EnterCombat(Unit * /*who*/) {} - - void UpdateAI(const uint32 diff) - { - if (!Casting) - { - DoCast(me, SPELL_FLAME_STRIKE_VIS); - Casting = true; - } - - //Timer - if (Timer <= diff) - { - if (!KillSelf) - { - me->InterruptNonMeleeSpells(false); - DoCast(me, SPELL_FLAME_STRIKE_DMG); - } else me->Kill(me); - - KillSelf = true; - Timer = 1000; - } else Timer -= diff; - } -}; - -//Phoenix AI -struct mob_phoenix_tkAI : public ScriptedAI -{ - mob_phoenix_tkAI(Creature* pCreature) : ScriptedAI(pCreature) {} - - uint32 Cycle_Timer; - - void Reset() - { - Cycle_Timer = 2000; - DoCast(me, SPELL_BURN, true); - } - - void JustDied(Unit* /*killer*/) - { - //is this spell in use anylonger? - //DoCast(me, SPELL_EMBER_BLAST, true); - me->SummonCreature(NPC_PHOENIX_EGG,me->GetPositionX(),me->GetPositionY(),me->GetPositionZ(),me->GetOrientation(),TEMPSUMMON_TIMED_DESPAWN,16000); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (Cycle_Timer <= diff) - { - //spell Burn should possible do this, but it doesn't, so do this for now. - uint32 dmg = urand(4500,5500); - if (me->GetHealth() > dmg) - me->SetHealth(uint32(me->GetHealth()-dmg)); - Cycle_Timer = 2000; - } else Cycle_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -//Phoenix Egg AI -struct mob_phoenix_egg_tkAI : public ScriptedAI -{ - mob_phoenix_egg_tkAI(Creature* pCreature) : ScriptedAI(pCreature) {} - - uint32 Rebirth_Timer; - - void Reset() - { - Rebirth_Timer = 15000; - } - - //ignore any - void MoveInLineOfSight(Unit* /*who*/) {} - - void AttackStart(Unit* who) - { - if (me->Attack(who, false)) - { - me->SetInCombatWith(who); - who->SetInCombatWith(me); - - DoStartNoMovement(who); - } - } - - void JustSummoned(Creature* summoned) - { - summoned->AddThreat(me->getVictim(), 0.0f); - summoned->CastSpell(summoned,SPELL_REBIRTH,false); - } - - void UpdateAI(const uint32 diff) - { - if (!Rebirth_Timer) - return; - - if (Rebirth_Timer <= diff) - { - me->SummonCreature(NPC_PHOENIX,me->GetPositionX(),me->GetPositionY(),me->GetPositionZ(),me->GetOrientation(),TEMPSUMMON_CORPSE_DESPAWN,5000); - Rebirth_Timer = 0; - } else Rebirth_Timer -= diff; - } -}; - -CreatureAI* GetAI_boss_kaelthas(Creature* pCreature) -{ - return new boss_kaelthasAI(pCreature); -} - -CreatureAI* GetAI_boss_thaladred_the_darkener(Creature* pCreature) -{ - return new boss_thaladred_the_darkenerAI(pCreature); -} - -CreatureAI* GetAI_boss_lord_sanguinar(Creature* pCreature) -{ - return new boss_lord_sanguinarAI(pCreature); -} - -CreatureAI* GetAI_boss_grand_astromancer_capernian(Creature* pCreature) -{ - return new boss_grand_astromancer_capernianAI(pCreature); -} - -CreatureAI* GetAI_boss_master_engineer_telonicus(Creature* pCreature) -{ - return new boss_master_engineer_telonicusAI(pCreature); -} - -CreatureAI* GetAI_mob_kael_flamestrike(Creature* pCreature) -{ - return new mob_kael_flamestrikeAI(pCreature); -} - -CreatureAI* GetAI_mob_phoenix_tk(Creature* pCreature) -{ - return new mob_phoenix_tkAI(pCreature); -} - -CreatureAI* GetAI_mob_phoenix_egg_tk(Creature* pCreature) -{ - return new mob_phoenix_egg_tkAI(pCreature); -} - -void AddSC_boss_kaelthas() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_kaelthas"; - newscript->GetAI = &GetAI_boss_kaelthas; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_thaladred_the_darkener"; - newscript->GetAI = &GetAI_boss_thaladred_the_darkener; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_lord_sanguinar"; - newscript->GetAI = &GetAI_boss_lord_sanguinar; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_grand_astromancer_capernian"; - newscript->GetAI = &GetAI_boss_grand_astromancer_capernian; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_master_engineer_telonicus"; - newscript->GetAI = &GetAI_boss_master_engineer_telonicus; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_kael_flamestrike"; - newscript->GetAI = &GetAI_mob_kael_flamestrike; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_phoenix_tk"; - newscript->GetAI = &GetAI_mob_phoenix_tk; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_phoenix_egg_tk"; - newscript->GetAI = &GetAI_mob_phoenix_egg_tk; - newscript->RegisterSelf(); -} diff --git a/src/server/scripts/Outland/tempest_keep/the_eye/boss_void_reaver.cpp b/src/server/scripts/Outland/tempest_keep/the_eye/boss_void_reaver.cpp deleted file mode 100644 index e1b60b20948..00000000000 --- a/src/server/scripts/Outland/tempest_keep/the_eye/boss_void_reaver.cpp +++ /dev/null @@ -1,179 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Void_Reaver -SD%Complete: 90 -SDComment: Should reset if raid are out of room. -SDCategory: Tempest Keep, The Eye -EndScriptData */ - -#include "ScriptedPch.h" -#include "the_eye.h" - -enum eEnums -{ - SAY_AGGRO = -1550000, - SAY_SLAY1 = -1550001, - SAY_SLAY2 = -1550002, - SAY_SLAY3 = -1550003, - SAY_DEATH = -1550004, - SAY_POUNDING1 = -1550005, - SAY_POUNDING2 = -1550006, - - SPELL_POUNDING = 34162, - SPELL_ARCANE_ORB = 34172, - SPELL_KNOCK_AWAY = 25778, - SPELL_BERSERK = 27680 -}; - -struct boss_void_reaverAI : public ScriptedAI -{ - boss_void_reaverAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint32 Pounding_Timer; - uint32 ArcaneOrb_Timer; - uint32 KnockAway_Timer; - uint32 Berserk_Timer; - - bool Enraged; - - void Reset() - { - Pounding_Timer = 15000; - ArcaneOrb_Timer = 3000; - KnockAway_Timer = 30000; - Berserk_Timer = 600000; - - Enraged = false; - - if (pInstance && me->isAlive()) - pInstance->SetData(DATA_VOIDREAVEREVENT, NOT_STARTED); - } - - void KilledUnit(Unit * /*victim*/) - { - DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), me); - } - - void JustDied(Unit * /*victim*/) - { - DoScriptText(SAY_DEATH, me); - DoZoneInCombat(); - - if (pInstance) - pInstance->SetData(DATA_VOIDREAVEREVENT, DONE); - } - - void EnterCombat(Unit * /*who*/) - { - DoScriptText(SAY_AGGRO, me); - - if (pInstance) - pInstance->SetData(DATA_VOIDREAVEREVENT, IN_PROGRESS); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - // Pounding - if (Pounding_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_POUNDING); - - DoScriptText(RAND(SAY_POUNDING1,SAY_POUNDING2), me); - Pounding_Timer = 15000; //cast time(3000) + cooldown time(12000) - } else Pounding_Timer -= diff; - - // Arcane Orb - if (ArcaneOrb_Timer <= diff) - { - Unit *pTarget = NULL; - std::list t_list = me->getThreatManager().getThreatList(); - std::vector target_list; - for (std::list::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) - { - pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid()); - if (!pTarget) - continue; - - // exclude pets & totems - if (pTarget->GetTypeId() != TYPEID_PLAYER) - continue; - - //18 yard radius minimum - if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER && pTarget->isAlive() && !pTarget->IsWithinDist(me, 18, false)) - target_list.push_back(pTarget); - pTarget = NULL; - } - - if (target_list.size()) - pTarget = *(target_list.begin()+rand()%target_list.size()); - else - pTarget = me->getVictim(); - - if (pTarget) - me->CastSpell(pTarget->GetPositionX(),pTarget->GetPositionY(),pTarget->GetPositionZ(), SPELL_ARCANE_ORB, false, NULL, NULL, NULL, pTarget); - - ArcaneOrb_Timer = 3000; - } else ArcaneOrb_Timer -= diff; - - // Single Target knock back, reduces aggro - if (KnockAway_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_KNOCK_AWAY); - - //Drop 25% aggro - if (DoGetThreat(me->getVictim())) - DoModifyThreatPercent(me->getVictim(),-25); - - KnockAway_Timer = 30000; - } else KnockAway_Timer -= diff; - - //Berserk - if (Berserk_Timer < diff && !Enraged) - { - DoCast(me, SPELL_BERSERK); - Enraged = true; - } else Berserk_Timer -= diff; - - DoMeleeAttackIfReady(); - - EnterEvadeIfOutOfCombatArea(diff); - } -}; - -CreatureAI* GetAI_boss_void_reaver(Creature* pCreature) -{ - return new boss_void_reaverAI (pCreature); -} - -void AddSC_boss_void_reaver() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_void_reaver"; - newscript->GetAI = &GetAI_boss_void_reaver; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Outland/tempest_keep/the_eye/instance_the_eye.cpp b/src/server/scripts/Outland/tempest_keep/the_eye/instance_the_eye.cpp deleted file mode 100644 index 59c72071238..00000000000 --- a/src/server/scripts/Outland/tempest_keep/the_eye/instance_the_eye.cpp +++ /dev/null @@ -1,176 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Instance_The_Eye -SD%Complete: 100 -SDComment: -SDCategory: Tempest Keep, The Eye -EndScriptData */ - -#include "ScriptedPch.h" -#include "the_eye.h" - -#define MAX_ENCOUNTER 5 - -/* The Eye encounters: -0 - Kael'thas event -1 - Al' ar event -2 - Solarian Event -3 - Void Reaver event -*/ - -struct instance_the_eye : public ScriptedInstance -{ - instance_the_eye(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint64 ThaladredTheDarkener; - uint64 LordSanguinar; - uint64 GrandAstromancerCapernian; - uint64 MasterEngineerTelonicus; - uint64 Kaelthas; - uint64 Astromancer; - uint64 Alar; - - uint8 KaelthasEventPhase; - uint8 AlarEventPhase; - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - ThaladredTheDarkener = 0; - LordSanguinar = 0; - GrandAstromancerCapernian = 0; - MasterEngineerTelonicus = 0; - Kaelthas = 0; - Astromancer = 0; - Alar = 0; - - KaelthasEventPhase = 0; - AlarEventPhase = 0; - } - - bool IsEncounterInProgress() const - { - for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) return true; - - return false; - } - - void OnCreatureCreate(Creature* pCreature, bool /*add*/) - { - switch(pCreature->GetEntry()) - { - case 20064: ThaladredTheDarkener = pCreature->GetGUID(); break; - case 20063: MasterEngineerTelonicus = pCreature->GetGUID(); break; - case 20062: GrandAstromancerCapernian = pCreature->GetGUID(); break; - case 20060: LordSanguinar = pCreature->GetGUID(); break; - case 19622: Kaelthas = pCreature->GetGUID(); break; - case 18805: Astromancer = pCreature->GetGUID(); break; - case 19514: Alar = pCreature->GetGUID(); break; - } - } - - uint64 GetData64(uint32 identifier) - { - switch(identifier) - { - case DATA_THALADREDTHEDARKENER: return ThaladredTheDarkener; - case DATA_LORDSANGUINAR: return LordSanguinar; - case DATA_GRANDASTROMANCERCAPERNIAN: return GrandAstromancerCapernian; - case DATA_MASTERENGINEERTELONICUS: return MasterEngineerTelonicus; - case DATA_KAELTHAS: return Kaelthas; - case DATA_ASTROMANCER: return Astromancer; - case DATA_ALAR: return Alar; - } - return 0; - } - - void SetData(uint32 type, uint32 data) - { - switch(type) - { - case DATA_ALAREVENT: AlarEventPhase = data; m_auiEncounter[0] = data; break; - case DATA_HIGHASTROMANCERSOLARIANEVENT: m_auiEncounter[1] = data; break; - case DATA_VOIDREAVEREVENT: m_auiEncounter[2] = data; break; - case DATA_KAELTHASEVENT: KaelthasEventPhase = data; m_auiEncounter[3] = data; break; - } - if (data == DONE) - SaveToDB(); - } - - uint32 GetData(uint32 type) - { - switch(type) - { - case DATA_ALAREVENT: return AlarEventPhase; - case DATA_HIGHASTROMANCERSOLARIANEVENT: return m_auiEncounter[1]; - case DATA_VOIDREAVEREVENT: return m_auiEncounter[2]; - case DATA_KAELTHASEVENT: return KaelthasEventPhase; - } - return 0; - } - - std::string GetSaveData() - { - OUT_SAVE_INST_DATA; - std::ostringstream stream; - stream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " << m_auiEncounter[3]; - char* out = new char[stream.str().length() + 1]; - strcpy(out, stream.str().c_str()); - if (out) - { - OUT_SAVE_INST_DATA_COMPLETE; - return out; - } - return NULL; - } - - void Load(const char* in) - { - if (!in) - { - OUT_LOAD_INST_DATA_FAIL; - return; - } - OUT_LOAD_INST_DATA(in); - std::istringstream stream(in); - stream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3]; - for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) // Do not load an encounter as "In Progress" - reset it instead. - m_auiEncounter[i] = NOT_STARTED; - OUT_LOAD_INST_DATA_COMPLETE; - } -}; - -InstanceData* GetInstanceData_instance_the_eye(Map* pMap) -{ - return new instance_the_eye(pMap); -} - -void AddSC_instance_the_eye() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_the_eye"; - newscript->GetInstanceData = &GetInstanceData_instance_the_eye; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Outland/tempest_keep/the_eye/the_eye.cpp b/src/server/scripts/Outland/tempest_keep/the_eye/the_eye.cpp deleted file mode 100644 index 97021fdc031..00000000000 --- a/src/server/scripts/Outland/tempest_keep/the_eye/the_eye.cpp +++ /dev/null @@ -1,98 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: The_Eye -SD%Complete: 100 -SDComment: -SDCategory: Tempest Keep, The Eye -EndScriptData */ - -/* ContentData -mob_crystalcore_devastator -EndContentData */ - -#include "ScriptedPch.h" -#include "the_eye.h" - -#define SPELL_COUNTERCHARGE 35035 -#define SPELL_KNOCKAWAY 22893 - -struct mob_crystalcore_devastatorAI : public ScriptedAI -{ - mob_crystalcore_devastatorAI(Creature *c) : ScriptedAI(c) {} - - uint32 Knockaway_Timer; - uint32 Countercharge_Timer; - - void Reset() - { - Countercharge_Timer = 9000; - Knockaway_Timer = 25000; - } - - void EnterCombat(Unit * /*who*/) - { - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //Check if we have a current target - //Knockaway_Timer - if (Knockaway_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_KNOCKAWAY, true); - - // current aggro target is knocked away pick new target - Unit* pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO, 0); - - if (!pTarget || pTarget == me->getVictim()) - pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO, 1); - - if (pTarget) - me->TauntApply(pTarget); - - Knockaway_Timer = 23000; - } else Knockaway_Timer -= diff; - - //Countercharge_Timer - if (Countercharge_Timer <= diff) - { - DoCast(me, SPELL_COUNTERCHARGE); - Countercharge_Timer = 45000; - } else Countercharge_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_crystalcore_devastator(Creature* pCreature) -{ - return new mob_crystalcore_devastatorAI (pCreature); -} - -void AddSC_the_eye() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "mob_crystalcore_devastator"; - newscript->GetAI = &GetAI_mob_crystalcore_devastator; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Outland/tempest_keep/the_eye/the_eye.h b/src/server/scripts/Outland/tempest_keep/the_eye/the_eye.h deleted file mode 100644 index d0d3ea09061..00000000000 --- a/src/server/scripts/Outland/tempest_keep/the_eye/the_eye.h +++ /dev/null @@ -1,20 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ - -#ifndef DEF_THE_EYE_H -#define DEF_THE_EYE_H - -#define DATA_ALAREVENT 1 -#define DATA_ASTROMANCER 2 -#define DATA_GRANDASTROMANCERCAPERNIAN 3 -#define DATA_HIGHASTROMANCERSOLARIANEVENT 4 -#define DATA_KAELTHAS 5 -#define DATA_KAELTHASEVENT 6 -#define DATA_LORDSANGUINAR 7 -#define DATA_MASTERENGINEERTELONICUS 8 -#define DATA_THALADREDTHEDARKENER 10 -#define DATA_VOIDREAVEREVENT 11 -#define DATA_ALAR 12 -#endif - diff --git a/src/server/scripts/Outland/tempest_keep/the_mechanar/boss_gatewatcher_gyrokill.cpp b/src/server/scripts/Outland/tempest_keep/the_mechanar/boss_gatewatcher_gyrokill.cpp deleted file mode 100644 index b9c365eda65..00000000000 --- a/src/server/scripts/Outland/tempest_keep/the_mechanar/boss_gatewatcher_gyrokill.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Gatewatcher_Gyrokill -SD%Complete: 0 -SDComment: Place Holder -SDCategory: Tempest Keep, The Mechanar -EndScriptData */ - -#include "ScriptedPch.h" - -//not used -#define SAY_AGGRO -1554000 -#define SAY_SAW_ATTACK1 -1554001 -#define SAY_SAW_ATTACK2 -1554002 -#define SAY_SLAY1 -1554003 -#define SAY_SLAY2 -1554004 -#define SAY_DEATH -1554005 - -#define SPELL_STREAM_OF_MACHINE_FLUID 35311 -#define SPELL_SAW_BLADE 35318 -#define H_SPELL_SAW_BLADE 39192 -#define SPELL_SHADOW_POWER 35322 -#define H_SPELL_SHADOW_POWER 39193 - diff --git a/src/server/scripts/Outland/tempest_keep/the_mechanar/boss_gatewatcher_ironhand.cpp b/src/server/scripts/Outland/tempest_keep/the_mechanar/boss_gatewatcher_ironhand.cpp deleted file mode 100644 index 50c3a6171ce..00000000000 --- a/src/server/scripts/Outland/tempest_keep/the_mechanar/boss_gatewatcher_ironhand.cpp +++ /dev/null @@ -1,130 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -/* ScriptData -SDName: Boss_Gatewatcher_Ironhand -SD%Complete: 75 -SDComment: -SDCategory: Tempest Keep, The Mechanar -EndScriptData */ - -#include "ScriptedPch.h" - -#define SAY_AGGRO_1 -1554006 -#define SAY_HAMMER_1 -1554007 -#define SAY_HAMMER_2 -1554008 -#define SAY_SLAY_1 -1554009 -#define SAY_SLAY_2 -1554010 -#define SAY_DEATH_1 -1554011 -#define EMOTE_HAMMER -1554012 - -// Spells to be casted -#define SPELL_SHADOW_POWER 35322 -#define H_SPELL_SHADOW_POWER 39193 -#define SPELL_HAMMER_PUNCH 35326 -#define SPELL_JACKHAMMER 35327 -#define H_SPELL_JACKHAMMER 39194 -#define SPELL_STREAM_OF_MACHINE_FLUID 35311 - -// Gatewatcher Iron-Hand AI -struct boss_gatewatcher_iron_handAI : public ScriptedAI -{ - boss_gatewatcher_iron_handAI(Creature *c) : ScriptedAI(c) - { - } - - uint32 Shadow_Power_Timer; - uint32 Jackhammer_Timer; - uint32 Stream_of_Machine_Fluid_Timer; - - void Reset() - { - Shadow_Power_Timer = 25000; - Jackhammer_Timer = 45000; - Stream_of_Machine_Fluid_Timer = 55000; - - } - void EnterCombat(Unit * /*who*/) - { - DoScriptText(SAY_AGGRO_1, me); - } - - void KilledUnit(Unit* /*victim*/) - { - if (rand()%2) - return; - - DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me); - } - - void JustDied(Unit* /*Killer*/) - { - DoScriptText(SAY_DEATH_1, me); - //TODO: Add door check/open code - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //Shadow Power - if (Shadow_Power_Timer <= diff) - { - DoCast(me, SPELL_SHADOW_POWER); - Shadow_Power_Timer = 20000 + rand()%8000; - } else Shadow_Power_Timer -= diff; - - //Jack Hammer - if (Jackhammer_Timer <= diff) - { - //TODO: expect cast this about 5 times in a row (?), announce it by emote only once - DoScriptText(EMOTE_HAMMER, me); - DoCast(me->getVictim(), SPELL_JACKHAMMER); - - //chance to yell, but not same time as emote (after spell in fact casted) - if (rand()%2) - return; - - DoScriptText(RAND(SAY_HAMMER_1,SAY_HAMMER_2), me); - Jackhammer_Timer = 30000; - } else Jackhammer_Timer -= diff; - - //Stream of Machine Fluid - if (Stream_of_Machine_Fluid_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_STREAM_OF_MACHINE_FLUID); - Stream_of_Machine_Fluid_Timer = 35000 + rand()%15000; - } else Stream_of_Machine_Fluid_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_gatewatcher_iron_hand(Creature* pCreature) -{ - return new boss_gatewatcher_iron_handAI (pCreature); -} - -void AddSC_boss_gatewatcher_iron_hand() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_gatewatcher_iron_hand"; - newscript->GetAI = &GetAI_boss_gatewatcher_iron_hand; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Outland/tempest_keep/the_mechanar/boss_nethermancer_sepethrea.cpp b/src/server/scripts/Outland/tempest_keep/the_mechanar/boss_nethermancer_sepethrea.cpp deleted file mode 100644 index ededec0196d..00000000000 --- a/src/server/scripts/Outland/tempest_keep/the_mechanar/boss_nethermancer_sepethrea.cpp +++ /dev/null @@ -1,245 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -/* ScriptData -SDName: Boss_Nethermancer_Sepethrea -SD%Complete: 90 -SDComment: Need adjustments to initial summons -SDCategory: Tempest Keep, The Mechanar -EndScriptData */ - -#include "ScriptedPch.h" -#include "mechanar.h" - -#define SAY_AGGRO -1554013 -#define SAY_SUMMON -1554014 -#define SAY_DRAGONS_BREATH_1 -1554015 -#define SAY_DRAGONS_BREATH_2 -1554016 -#define SAY_SLAY1 -1554017 -#define SAY_SLAY2 -1554018 -#define SAY_DEATH -1554019 - -#define SPELL_SUMMON_RAGIN_FLAMES 35275 -#define H_SPELL_SUMMON_RAGIN_FLAMES 39084 - -#define SPELL_FROST_ATTACK 35263 -#define SPELL_ARCANE_BLAST 35314 -#define SPELL_DRAGONS_BREATH 35250 -#define SPELL_KNOCKBACK 37317 -#define SPELL_SOLARBURN 35267 - -struct boss_nethermancer_sepethreaAI : public ScriptedAI -{ - boss_nethermancer_sepethreaAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance *pInstance; - - uint32 frost_attack_Timer; - uint32 arcane_blast_Timer; - uint32 dragons_breath_Timer; - uint32 knockback_Timer; - uint32 solarburn_Timer; - - void Reset() - { - frost_attack_Timer = 7000 + rand()%3000; - arcane_blast_Timer = 12000 + rand()%6000; - dragons_breath_Timer = 18000 + rand()%4000; - knockback_Timer = 22000 + rand()%6000; - solarburn_Timer = 30000; - - if (pInstance) - pInstance->SetData(DATA_NETHERMANCER_EVENT, NOT_STARTED); - } - - void EnterCombat(Unit* who) - { - if (pInstance) - pInstance->SetData(DATA_NETHERMANCER_EVENT, IN_PROGRESS); - - DoScriptText(SAY_AGGRO, me); - DoCast(who, SPELL_SUMMON_RAGIN_FLAMES); - DoScriptText(SAY_SUMMON, me); - } - - void KilledUnit(Unit* /*victim*/) - { - DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me); - } - - void JustDied(Unit* /*Killer*/) - { - DoScriptText(SAY_DEATH, me); - - if (pInstance) - pInstance->SetData(DATA_NETHERMANCER_EVENT, DONE); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //Frost Attack - if (frost_attack_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_FROST_ATTACK); - frost_attack_Timer = 7000 + rand()%3000; - } else frost_attack_Timer -= diff; - - //Arcane Blast - if (arcane_blast_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_ARCANE_BLAST); - arcane_blast_Timer = 15000; - } else arcane_blast_Timer -= diff; - - //Dragons Breath - if (dragons_breath_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_DRAGONS_BREATH); - { - if (rand()%2) - return; - - DoScriptText(RAND(SAY_DRAGONS_BREATH_1,SAY_DRAGONS_BREATH_2), me); - } - dragons_breath_Timer = 12000 + rand()%10000; - } else dragons_breath_Timer -= diff; - - //Knockback - if (knockback_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_KNOCKBACK); - knockback_Timer = 15000 + rand()%10000; - } else knockback_Timer -= diff; - - //Solarburn - if (solarburn_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SOLARBURN); - solarburn_Timer = 30000; - } else solarburn_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_nethermancer_sepethrea(Creature* pCreature) -{ - return new boss_nethermancer_sepethreaAI (pCreature); -} - -#define SPELL_INFERNO 35268 -#define H_SPELL_INFERNO 39346 -#define SPELL_FIRE_TAIL 35278 - -struct mob_ragin_flamesAI : public ScriptedAI -{ - mob_ragin_flamesAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance *pInstance; - - uint32 inferno_Timer; - uint32 flame_timer; - uint32 Check_Timer; - - bool onlyonce; - - void Reset() - { - inferno_Timer = 10000; - flame_timer = 500; - Check_Timer = 2000; - onlyonce = false; - me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, true); - me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, true); - me->SetSpeed(MOVE_RUN, DUNGEON_MODE(0.5f, 0.7f)); - } - - void EnterCombat(Unit* /*who*/) - { - } - - void UpdateAI(const uint32 diff) - { - //Check_Timer - if (Check_Timer <= diff) - { - if (pInstance) - { - if (pInstance->GetData(DATA_NETHERMANCER_EVENT) != IN_PROGRESS) - { - //remove - me->setDeathState(JUST_DIED); - me->RemoveCorpse(); - } - } - Check_Timer = 1000; - } else Check_Timer -= diff; - - if (!UpdateVictim()) - return; - - if (!onlyonce) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) - me->GetMotionMaster()->MoveChase(pTarget); - onlyonce = true; - } - - if (inferno_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_INFERNO); - me->TauntApply(me->getVictim()); - inferno_Timer = 10000; - } else inferno_Timer -= diff; - - if (flame_timer <= diff) - { - DoCast(me, SPELL_FIRE_TAIL); - flame_timer = 500; - } else flame_timer -=diff; - - DoMeleeAttackIfReady(); - } - -}; -CreatureAI* GetAI_mob_ragin_flames(Creature* pCreature) -{ - return new mob_ragin_flamesAI (pCreature); -} -void AddSC_boss_nethermancer_sepethrea() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_nethermancer_sepethrea"; - newscript->GetAI = &GetAI_boss_nethermancer_sepethrea; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_ragin_flames"; - newscript->GetAI = &GetAI_mob_ragin_flames; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Outland/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp b/src/server/scripts/Outland/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp deleted file mode 100644 index c0c06704db7..00000000000 --- a/src/server/scripts/Outland/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp +++ /dev/null @@ -1,246 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -/* ScriptData -SDName: Boss Pathaleon the Calculator -SD%Complete: 50 -SDComment: Event missing. Script for himself 99% blizzlike. -SDCategory: Tempest Keep, The Mechanar -EndScriptData */ - -#include "ScriptedPch.h" - -#define SAY_AGGRO -1554020 -#define SAY_DOMINATION_1 -1554021 -#define SAY_DOMINATION_2 -1554022 -#define SAY_SUMMON -1554023 -#define SAY_ENRAGE -1554024 -#define SAY_SLAY_1 -1554025 -#define SAY_SLAY_2 -1554026 -#define SAY_DEATH -1554027 - -// Spells to be casted -#define SPELL_MANA_TAP 36021 -#define SPELL_ARCANE_TORRENT 36022 -#define SPELL_DOMINATION 35280 -#define H_SPELL_ARCANE_EXPLOSION 15453 -#define SPELL_FRENZY 36992 - -#define SPELL_SUMMON_NETHER_WRAITH_1 35285 //Spells work, but not implemented -#define SPELL_SUMMON_NETHER_WRAITH_2 35286 -#define SPELL_SUMMON_NETHER_WRAITH_3 35287 -#define SPELL_SUMMON_NETHER_WRAITH_4 35288 - -// Add Spells -#define SPELL_DETONATION 35058 -#define SPELL_ARCANE_MISSILES 35034 - -struct boss_pathaleon_the_calculatorAI : public ScriptedAI -{ - boss_pathaleon_the_calculatorAI(Creature *c) : ScriptedAI(c), summons(me) - { - } - - uint32 Summon_Timer; - SummonList summons; - uint32 ManaTap_Timer; - uint32 ArcaneTorrent_Timer; - uint32 Domination_Timer; - uint32 ArcaneExplosion_Timer; - - bool Enraged; - - uint32 Counter; - - void Reset() - { - Summon_Timer = 30000; - ManaTap_Timer = 12000 + rand()%8000; - ArcaneTorrent_Timer = 16000 + rand()%9000; - Domination_Timer = 25000 + rand()%15000; - ArcaneExplosion_Timer = 8000 + rand()%5000; - - Enraged = false; - - Counter = 0; - summons.DespawnAll(); - } - void EnterCombat(Unit * /*who*/) - { - DoScriptText(SAY_AGGRO, me); - } - - void KilledUnit(Unit* /*victim*/) - { - DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me); - } - - void JustDied(Unit* /*Killer*/) - { - DoScriptText(SAY_DEATH, me); - - summons.DespawnAll(); - } - - void JustSummoned(Creature *summon) {summons.Summon(summon);} - void SummonedCreatureDespawn(Creature *summon) {summons.Despawn(summon);} - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - if (Summon_Timer <= diff) - { - for (uint8 i = 0; i < 3; ++i) - { - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); - Creature* Wraith = me->SummonCreature(21062,me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - if (pTarget && Wraith) - Wraith->AI()->AttackStart(pTarget); - } - DoScriptText(SAY_SUMMON, me); - Summon_Timer = 30000 + rand()%15000; - } else Summon_Timer -= diff; - - if (ManaTap_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_MANA_TAP); - ManaTap_Timer = 14000 + rand()%8000; - } else ManaTap_Timer -= diff; - - if (ArcaneTorrent_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_ARCANE_TORRENT); - ArcaneTorrent_Timer = 12000 + rand()%6000; - } else ArcaneTorrent_Timer -= diff; - - if (Domination_Timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1)) - { - DoScriptText(RAND(SAY_DOMINATION_1,SAY_DOMINATION_2), me); - - DoCast(pTarget, SPELL_DOMINATION); - } - Domination_Timer = 25000 + rand()%5000; - } else Domination_Timer -= diff; - - //Only casting if Heroic Mode is used - if (IsHeroic()) - { - if (ArcaneExplosion_Timer <= diff) - { - DoCast(me->getVictim(), H_SPELL_ARCANE_EXPLOSION); - ArcaneExplosion_Timer = 10000 + rand()%4000; - } else ArcaneExplosion_Timer -= diff; - } - - if (!Enraged && me->GetHealth()*100 / me->GetMaxHealth() < 21) - { - DoCast(me, SPELL_FRENZY); - DoScriptText(SAY_ENRAGE, me); - Enraged = true; - - } - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_pathaleon_the_calculator(Creature* pCreature) -{ - return new boss_pathaleon_the_calculatorAI (pCreature); -} - -struct mob_nether_wraithAI : public ScriptedAI -{ - mob_nether_wraithAI(Creature *c) : ScriptedAI(c) {} - - uint32 ArcaneMissiles_Timer; - uint32 Detonation_Timer; - uint32 Die_Timer; - bool Detonation; - - void Reset() - { - ArcaneMissiles_Timer = 1000 + rand()%3000; - Detonation_Timer = 20000; - Die_Timer = 2200; - Detonation = false; - - } - - void EnterCombat(Unit* /*who*/) - { - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (ArcaneMissiles_Timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1)) - DoCast(pTarget, SPELL_ARCANE_MISSILES); - else - DoCast(me->getVictim(), SPELL_ARCANE_MISSILES); - - ArcaneMissiles_Timer = 5000 + rand()%5000; - } else ArcaneMissiles_Timer -=diff; - - if (!Detonation) - { - if (Detonation_Timer <= diff) - { - DoCast(me, SPELL_DETONATION); - Detonation = true; - } else Detonation_Timer -= diff; - } - - if (Detonation) - { - if (Die_Timer <= diff) - { - me->setDeathState(JUST_DIED); - me->RemoveCorpse(); - } else Die_Timer -= diff; - } - - DoMeleeAttackIfReady(); - } - -}; -CreatureAI* GetAI_mob_nether_wraith(Creature* pCreature) -{ - return new mob_nether_wraithAI (pCreature); -} - -void AddSC_boss_pathaleon_the_calculator() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_pathaleon_the_calculator"; - newscript->GetAI = &GetAI_boss_pathaleon_the_calculator; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_nether_wraith"; - newscript->GetAI = &GetAI_mob_nether_wraith; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Outland/tempest_keep/the_mechanar/instance_mechanar.cpp b/src/server/scripts/Outland/tempest_keep/the_mechanar/instance_mechanar.cpp deleted file mode 100644 index c70da24ea3f..00000000000 --- a/src/server/scripts/Outland/tempest_keep/the_mechanar/instance_mechanar.cpp +++ /dev/null @@ -1,86 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Instance_Mechanar -SD%Complete: 100 -SDComment: -SDCategory: Mechanar -EndScriptData */ - -#include "ScriptedPch.h" -#include "mechanar.h" - -#define MAX_ENCOUNTER 1 - -struct instance_mechanar : public ScriptedInstance -{ - instance_mechanar(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - } - - bool IsEncounterInProgress() const - { - for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) - return true; - - return false; - } - - uint32 GetData(uint32 type) - { - switch(type) - { - case DATA_NETHERMANCER_EVENT: return m_auiEncounter[0]; - } - - return false; - } - - uint64 GetData64 (uint32 /*identifier*/) - { - return 0; - } - - void SetData(uint32 type, uint32 data) - { - switch(type) - { - case DATA_NETHERMANCER_EVENT: m_auiEncounter[0] = data; break; - } - } -}; - -InstanceData* GetInstanceData_instance_mechanar(Map* pMap) -{ - return new instance_mechanar(pMap); -} - -void AddSC_instance_mechanar() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_mechanar"; - newscript->GetInstanceData = &GetInstanceData_instance_mechanar; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/Outland/tempest_keep/the_mechanar/mechanar.h b/src/server/scripts/Outland/tempest_keep/the_mechanar/mechanar.h deleted file mode 100644 index d1b53eebf53..00000000000 --- a/src/server/scripts/Outland/tempest_keep/the_mechanar/mechanar.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef DEF_MECHANAR_H -#define DEF_MECHANAR_H - -#define DATA_NETHERMANCER_EVENT 1 -#endif - -- cgit v1.2.3