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 --- .../AlteracValley/alterac_valley.cpp | 180 +++ .../EasternKingdoms/AlteracValley/boss_balinda.cpp | 203 +++ .../AlteracValley/boss_drekthar.cpp | 138 ++ .../AlteracValley/boss_galvangar.cpp | 129 ++ .../EasternKingdoms/AlteracValley/boss_vanndar.cpp | 129 ++ .../BlackrockDepths/blackrock_depths.cpp | 1338 ++++++++++++++++ .../BlackrockDepths/blackrock_depths.h | 45 + .../BlackrockDepths/boss_ambassador_flamelash.cpp | 91 ++ .../BlackrockDepths/boss_anubshiah.cpp | 116 ++ .../boss_emperor_dagran_thaurissan.cpp | 111 ++ .../BlackrockDepths/boss_general_angerforge.cpp | 132 ++ .../BlackrockDepths/boss_gorosh_the_dervish.cpp | 84 + .../BlackrockDepths/boss_grizzle.cpp | 94 ++ .../boss_high_interrogator_gerstahn.cpp | 106 ++ .../BlackrockDepths/boss_magmus.cpp | 98 ++ .../BlackrockDepths/boss_moira_bronzebeard.cpp | 98 ++ .../BlackrockDepths/boss_tomb_of_seven.cpp | 254 +++ .../BlackrockDepths/instance_blackrock_depths.cpp | 460 ++++++ .../BlackrockSpire/blackrock_spire.cpp | 77 + .../BlackrockSpire/blackrock_spire.h | 26 + .../BlackrockSpire/boss_drakkisath.cpp | 102 ++ .../EasternKingdoms/BlackrockSpire/boss_gyth.cpp | 205 +++ .../BlackrockSpire/boss_halycon.cpp | 96 ++ .../BlackrockSpire/boss_highlord_omokk.cpp | 132 ++ .../BlackrockSpire/boss_mother_smolderweb.cpp | 87 + .../BlackrockSpire/boss_overlord_wyrmthalak.cpp | 126 ++ .../BlackrockSpire/boss_pyroguard_emberseer.cpp | 93 ++ .../BlackrockSpire/boss_quartermaster_zigris.cpp | 86 + .../BlackrockSpire/boss_rend_blackhand.cpp | 92 ++ .../boss_shadow_hunter_voshgajin.cpp | 93 ++ .../BlackrockSpire/boss_the_beast.cpp | 93 ++ .../BlackrockSpire/boss_warmaster_voone.cpp | 122 ++ .../BlackrockSpire/instance_blackrock_spire.cpp | 104 ++ .../BlackwingLair/boss_broodlord_lashlayer.cpp | 112 ++ .../BlackwingLair/boss_chromaggus.cpp | 301 ++++ .../EasternKingdoms/BlackwingLair/boss_ebonroc.cpp | 104 ++ .../EasternKingdoms/BlackwingLair/boss_firemaw.cpp | 95 ++ .../BlackwingLair/boss_flamegor.cpp | 98 ++ .../BlackwingLair/boss_nefarian.cpp | 231 +++ .../BlackwingLair/boss_razorgore.cpp | 125 ++ .../BlackwingLair/boss_vaelastrasz.cpp | 262 +++ .../BlackwingLair/boss_victor_nefarius.cpp | 385 +++++ .../BlackwingLair/instance_blackwing_lair.cpp | 25 + .../EasternKingdoms/Deadmines/boss_mr_smite.cpp | 182 +++ .../EasternKingdoms/Deadmines/deadmines.cpp | 60 + .../scripts/EasternKingdoms/Deadmines/deadmines.h | 35 + .../Deadmines/instance_deadmines.cpp | 256 +++ .../EasternKingdoms/Gnomeregan/gnomeregan.cpp | 593 +++++++ .../EasternKingdoms/Gnomeregan/gnomeregan.h | 48 + .../Gnomeregan/instance_gnomeregan.cpp | 141 ++ .../EasternKingdoms/Karazhan/boss_curator.cpp | 196 +++ .../Karazhan/boss_maiden_of_virtue.cpp | 138 ++ .../EasternKingdoms/Karazhan/boss_midnight.cpp | 310 ++++ .../EasternKingdoms/Karazhan/boss_moroes.cpp | 785 +++++++++ .../EasternKingdoms/Karazhan/boss_netherspite.cpp | 343 ++++ .../EasternKingdoms/Karazhan/boss_nightbane.cpp | 418 +++++ .../Karazhan/boss_prince_malchezaar.cpp | 604 +++++++ .../Karazhan/boss_shade_of_aran.cpp | 569 +++++++ .../Karazhan/boss_terestian_illhoof.cpp | 417 +++++ .../EasternKingdoms/Karazhan/bosses_opera.cpp | 1494 +++++++++++++++++ .../EasternKingdoms/Karazhan/instance_karazhan.cpp | 308 ++++ .../scripts/EasternKingdoms/Karazhan/karazhan.cpp | 646 ++++++++ .../scripts/EasternKingdoms/Karazhan/karazhan.h | 53 + .../MagistersTerrace/boss_felblood_kaelthas.cpp | 680 ++++++++ .../MagistersTerrace/boss_priestess_delrissa.cpp | 1321 +++++++++++++++ .../MagistersTerrace/boss_selin_fireheart.cpp | 366 +++++ .../MagistersTerrace/boss_vexallus.cpp | 226 +++ .../instance_magisters_terrace.cpp | 205 +++ .../MagistersTerrace/magisters_terrace.cpp | 174 ++ .../MagistersTerrace/magisters_terrace.h | 31 + .../MoltenCore/boss_baron_geddon.cpp | 107 ++ .../EasternKingdoms/MoltenCore/boss_garr.cpp | 143 ++ .../EasternKingdoms/MoltenCore/boss_gehennas.cpp | 93 ++ .../EasternKingdoms/MoltenCore/boss_golemagg.cpp | 198 +++ .../EasternKingdoms/MoltenCore/boss_lucifron.cpp | 91 ++ .../EasternKingdoms/MoltenCore/boss_magmadar.cpp | 100 ++ .../MoltenCore/boss_majordomo_executus.cpp | 134 ++ .../EasternKingdoms/MoltenCore/boss_ragnaros.cpp | 297 ++++ .../EasternKingdoms/MoltenCore/boss_shazzrah.cpp | 121 ++ .../MoltenCore/boss_sulfuron_harbinger.cpp | 205 +++ .../MoltenCore/instance_molten_core.cpp | 266 ++++ .../EasternKingdoms/MoltenCore/molten_core.cpp | 81 + .../EasternKingdoms/MoltenCore/molten_core.h | 22 + .../EasternKingdoms/ScarletEnclave/chapter1.cpp | 1079 +++++++++++++ .../EasternKingdoms/ScarletEnclave/chapter2.cpp | 995 ++++++++++++ .../EasternKingdoms/ScarletEnclave/chapter5.cpp | 1684 ++++++++++++++++++++ .../ScarletEnclave/the_scarlet_enclave.cpp | 119 ++ .../ScarletMonastery/boss_arcanist_doan.cpp | 128 ++ .../ScarletMonastery/boss_azshir_the_sleepless.cpp | 98 ++ .../ScarletMonastery/boss_bloodmage_thalnos.cpp | 124 ++ .../ScarletMonastery/boss_headless_horseman.cpp | 892 +++++++++++ .../ScarletMonastery/boss_herod.cpp | 158 ++ .../boss_high_inquisitor_fairbanks.cpp | 133 ++ .../ScarletMonastery/boss_houndmaster_loksey.cpp | 77 + .../ScarletMonastery/boss_interrogator_vishas.cpp | 118 ++ .../boss_mograine_and_whitemane.cpp | 359 +++++ .../ScarletMonastery/boss_scorn.cpp | 101 ++ .../instance_scarlet_monastery.cpp | 157 ++ .../ScarletMonastery/scarlet_monastery.h | 18 + .../Scholomance/boss_darkmaster_gandling.cpp | 225 +++ .../Scholomance/boss_death_knight_darkreaver.cpp | 58 + .../Scholomance/boss_doctor_theolen_krastinov.cpp | 117 ++ .../Scholomance/boss_illucia_barov.cpp | 117 ++ .../Scholomance/boss_instructor_malicia.cpp | 153 ++ .../Scholomance/boss_jandice_barov.cpp | 201 +++ .../EasternKingdoms/Scholomance/boss_kormok.cpp | 120 ++ .../Scholomance/boss_lord_alexei_barov.cpp | 99 ++ .../Scholomance/boss_lorekeeper_polkelt.cpp | 114 ++ .../Scholomance/boss_ras_frostwhisper.cpp | 123 ++ .../Scholomance/boss_the_ravenian.cpp | 117 ++ .../EasternKingdoms/Scholomance/boss_vectus.cpp | 105 ++ .../Scholomance/instance_scholomance.cpp | 146 ++ .../EasternKingdoms/Scholomance/scholomance.h | 17 + .../ShadowfangKeep/instance_shadowfang_keep.cpp | 277 ++++ .../ShadowfangKeep/shadowfang_keep.cpp | 198 +++ .../ShadowfangKeep/shadowfang_keep.h | 17 + .../Stratholme/boss_baron_rivendare.cpp | 190 +++ .../Stratholme/boss_baroness_anastari.cpp | 127 ++ .../Stratholme/boss_cannon_master_willey.cpp | 220 +++ .../Stratholme/boss_dathrohan_balnazzar.cpp | 217 +++ .../Stratholme/boss_magistrate_barthilas.cpp | 128 ++ .../Stratholme/boss_maleki_the_pallid.cpp | 108 ++ .../EasternKingdoms/Stratholme/boss_nerubenkan.cpp | 121 ++ .../Stratholme/boss_order_of_silver_hand.cpp | 157 ++ .../Stratholme/boss_postmaster_malown.cpp | 144 ++ .../Stratholme/boss_ramstein_the_gorger.cpp | 102 ++ .../Stratholme/boss_timmy_the_cruel.cpp | 83 + .../Stratholme/instance_stratholme.cpp | 458 ++++++ .../EasternKingdoms/Stratholme/stratholme.cpp | 282 ++++ .../EasternKingdoms/Stratholme/stratholme.h | 28 + .../SunkenTemple/instance_sunken_temple.cpp | 204 +++ .../EasternKingdoms/SunkenTemple/sunken_temple.cpp | 71 + .../EasternKingdoms/SunkenTemple/sunken_temple.h | 22 + .../SunwellPlateau/boss_brutallus.cpp | 349 ++++ .../SunwellPlateau/boss_eredar_twins.cpp | 762 +++++++++ .../SunwellPlateau/boss_felmyst.cpp | 579 +++++++ .../SunwellPlateau/boss_kalecgos.cpp | 794 +++++++++ .../SunwellPlateau/boss_kiljaeden.cpp | 1408 ++++++++++++++++ .../EasternKingdoms/SunwellPlateau/boss_muru.cpp | 640 ++++++++ .../SunwellPlateau/instance_sunwell_plateau.cpp | 297 ++++ .../SunwellPlateau/sunwell_plateau.cpp | 65 + .../SunwellPlateau/sunwell_plateau.h | 95 ++ .../EasternKingdoms/Uldaman/boss_archaedas.cpp | 497 ++++++ .../EasternKingdoms/Uldaman/boss_ironaya.cpp | 106 ++ .../EasternKingdoms/Uldaman/instance_uldaman.cpp | 300 ++++ .../scripts/EasternKingdoms/Uldaman/uldaman.cpp | 205 +++ .../EasternKingdoms/ZulAman/boss_akilzon.cpp | 467 ++++++ .../EasternKingdoms/ZulAman/boss_halazzi.cpp | 401 +++++ .../EasternKingdoms/ZulAman/boss_hexlord.cpp | 907 +++++++++++ .../EasternKingdoms/ZulAman/boss_janalai.cpp | 687 ++++++++ .../EasternKingdoms/ZulAman/boss_nalorakk.cpp | 451 ++++++ .../EasternKingdoms/ZulAman/boss_zuljin.cpp | 623 ++++++++ .../EasternKingdoms/ZulAman/instance_zulaman.cpp | 320 ++++ .../scripts/EasternKingdoms/ZulAman/zulaman.cpp | 192 +++ .../scripts/EasternKingdoms/ZulAman/zulaman.h | 19 + .../EasternKingdoms/ZulGurub/boss_arlokk.cpp | 278 ++++ .../EasternKingdoms/ZulGurub/boss_gahzranka.cpp | 93 ++ .../EasternKingdoms/ZulGurub/boss_grilek.cpp | 93 ++ .../EasternKingdoms/ZulGurub/boss_hakkar.cpp | 250 +++ .../EasternKingdoms/ZulGurub/boss_hazzarah.cpp | 104 ++ .../EasternKingdoms/ZulGurub/boss_jeklik.cpp | 291 ++++ .../EasternKingdoms/ZulGurub/boss_jindo.cpp | 263 +++ .../EasternKingdoms/ZulGurub/boss_mandokir.cpp | 333 ++++ .../EasternKingdoms/ZulGurub/boss_marli.cpp | 261 +++ .../EasternKingdoms/ZulGurub/boss_renataki.cpp | 152 ++ .../EasternKingdoms/ZulGurub/boss_thekal.cpp | 556 +++++++ .../EasternKingdoms/ZulGurub/boss_venoxis.cpp | 199 +++ .../EasternKingdoms/ZulGurub/boss_wushoolay.cpp | 85 + .../EasternKingdoms/ZulGurub/instance_zulgurub.cpp | 159 ++ .../scripts/EasternKingdoms/ZulGurub/zulgurub.h | 28 + .../alterac_valley/alterac_valley.cpp | 180 --- .../alterac_valley/boss_balinda.cpp | 203 --- .../alterac_valley/boss_drekthar.cpp | 138 -- .../alterac_valley/boss_galvangar.cpp | 129 -- .../alterac_valley/boss_vanndar.cpp | 129 -- .../blackrock_depths/blackrock_depths.cpp | 1338 ---------------- .../blackrock_depths/blackrock_depths.h | 45 - .../blackrock_depths/boss_ambassador_flamelash.cpp | 91 -- .../blackrock_depths/boss_anubshiah.cpp | 116 -- .../boss_emperor_dagran_thaurissan.cpp | 111 -- .../blackrock_depths/boss_general_angerforge.cpp | 132 -- .../blackrock_depths/boss_gorosh_the_dervish.cpp | 84 - .../blackrock_depths/boss_grizzle.cpp | 94 -- .../boss_high_interrogator_gerstahn.cpp | 106 -- .../blackrock_depths/boss_magmus.cpp | 98 -- .../blackrock_depths/boss_moira_bronzebeard.cpp | 98 -- .../blackrock_depths/boss_tomb_of_seven.cpp | 254 --- .../blackrock_depths/instance_blackrock_depths.cpp | 460 ------ .../blackrock_spire/blackrock_spire.cpp | 77 - .../blackrock_spire/blackrock_spire.h | 26 - .../blackrock_spire/boss_drakkisath.cpp | 102 -- .../EasternKingdoms/blackrock_spire/boss_gyth.cpp | 205 --- .../blackrock_spire/boss_halycon.cpp | 96 -- .../blackrock_spire/boss_highlord_omokk.cpp | 132 -- .../blackrock_spire/boss_mother_smolderweb.cpp | 87 - .../blackrock_spire/boss_overlord_wyrmthalak.cpp | 126 -- .../blackrock_spire/boss_pyroguard_emberseer.cpp | 93 -- .../blackrock_spire/boss_quartermaster_zigris.cpp | 86 - .../blackrock_spire/boss_rend_blackhand.cpp | 92 -- .../boss_shadow_hunter_voshgajin.cpp | 93 -- .../blackrock_spire/boss_the_beast.cpp | 93 -- .../blackrock_spire/boss_warmaster_voone.cpp | 122 -- .../blackrock_spire/instance_blackrock_spire.cpp | 104 -- .../blackwing_lair/boss_broodlord_lashlayer.cpp | 112 -- .../blackwing_lair/boss_chromaggus.cpp | 301 ---- .../blackwing_lair/boss_ebonroc.cpp | 104 -- .../blackwing_lair/boss_firemaw.cpp | 95 -- .../blackwing_lair/boss_flamegor.cpp | 98 -- .../blackwing_lair/boss_nefarian.cpp | 231 --- .../blackwing_lair/boss_razorgore.cpp | 125 -- .../blackwing_lair/boss_vaelastrasz.cpp | 262 --- .../blackwing_lair/boss_victor_nefarius.cpp | 385 ----- .../blackwing_lair/instance_blackwing_lair.cpp | 25 - .../EasternKingdoms/deadmines/boss_mr_smite.cpp | 182 --- .../EasternKingdoms/deadmines/deadmines.cpp | 60 - .../scripts/EasternKingdoms/deadmines/deadmines.h | 35 - .../deadmines/instance_deadmines.cpp | 256 --- .../EasternKingdoms/gnomeregan/gnomeregan.cpp | 593 ------- .../EasternKingdoms/gnomeregan/gnomeregan.h | 48 - .../gnomeregan/instance_gnomeregan.cpp | 141 -- .../EasternKingdoms/karazhan/boss_curator.cpp | 196 --- .../karazhan/boss_maiden_of_virtue.cpp | 138 -- .../EasternKingdoms/karazhan/boss_midnight.cpp | 310 ---- .../EasternKingdoms/karazhan/boss_moroes.cpp | 785 --------- .../EasternKingdoms/karazhan/boss_netherspite.cpp | 343 ---- .../EasternKingdoms/karazhan/boss_nightbane.cpp | 418 ----- .../karazhan/boss_prince_malchezaar.cpp | 604 ------- .../karazhan/boss_shade_of_aran.cpp | 569 ------- .../karazhan/boss_terestian_illhoof.cpp | 417 ----- .../EasternKingdoms/karazhan/bosses_opera.cpp | 1494 ----------------- .../EasternKingdoms/karazhan/instance_karazhan.cpp | 308 ---- .../scripts/EasternKingdoms/karazhan/karazhan.cpp | 646 -------- .../scripts/EasternKingdoms/karazhan/karazhan.h | 53 - .../magisters_terrace/boss_felblood_kaelthas.cpp | 680 -------- .../magisters_terrace/boss_priestess_delrissa.cpp | 1321 --------------- .../magisters_terrace/boss_selin_fireheart.cpp | 366 ----- .../magisters_terrace/boss_vexallus.cpp | 226 --- .../instance_magisters_terrace.cpp | 205 --- .../magisters_terrace/magisters_terrace.cpp | 174 -- .../magisters_terrace/magisters_terrace.h | 31 - .../molten_core/boss_baron_geddon.cpp | 107 -- .../EasternKingdoms/molten_core/boss_garr.cpp | 143 -- .../EasternKingdoms/molten_core/boss_gehennas.cpp | 93 -- .../EasternKingdoms/molten_core/boss_golemagg.cpp | 198 --- .../EasternKingdoms/molten_core/boss_lucifron.cpp | 91 -- .../EasternKingdoms/molten_core/boss_magmadar.cpp | 100 -- .../molten_core/boss_majordomo_executus.cpp | 134 -- .../EasternKingdoms/molten_core/boss_ragnaros.cpp | 297 ---- .../EasternKingdoms/molten_core/boss_shazzrah.cpp | 121 -- .../molten_core/boss_sulfuron_harbinger.cpp | 205 --- .../molten_core/instance_molten_core.cpp | 266 ---- .../EasternKingdoms/molten_core/molten_core.cpp | 81 - .../EasternKingdoms/molten_core/molten_core.h | 22 - .../EasternKingdoms/scarlet_enclave/chapter1.cpp | 1079 ------------- .../EasternKingdoms/scarlet_enclave/chapter2.cpp | 995 ------------ .../EasternKingdoms/scarlet_enclave/chapter5.cpp | 1684 -------------------- .../scarlet_enclave/the_scarlet_enclave.cpp | 119 -- .../scarlet_monastery/boss_arcanist_doan.cpp | 128 -- .../boss_azshir_the_sleepless.cpp | 98 -- .../scarlet_monastery/boss_bloodmage_thalnos.cpp | 124 -- .../scarlet_monastery/boss_headless_horseman.cpp | 892 ----------- .../scarlet_monastery/boss_herod.cpp | 158 -- .../boss_high_inquisitor_fairbanks.cpp | 133 -- .../scarlet_monastery/boss_houndmaster_loksey.cpp | 77 - .../scarlet_monastery/boss_interrogator_vishas.cpp | 118 -- .../boss_mograine_and_whitemane.cpp | 359 ----- .../scarlet_monastery/boss_scorn.cpp | 101 -- .../instance_scarlet_monastery.cpp | 157 -- .../scarlet_monastery/scarlet_monastery.h | 18 - .../scholomance/boss_darkmaster_gandling.cpp | 225 --- .../scholomance/boss_death_knight_darkreaver.cpp | 58 - .../scholomance/boss_doctor_theolen_krastinov.cpp | 117 -- .../scholomance/boss_illucia_barov.cpp | 117 -- .../scholomance/boss_instructor_malicia.cpp | 153 -- .../scholomance/boss_jandice_barov.cpp | 201 --- .../EasternKingdoms/scholomance/boss_kormok.cpp | 120 -- .../scholomance/boss_lord_alexei_barov.cpp | 99 -- .../scholomance/boss_lorekeeper_polkelt.cpp | 114 -- .../scholomance/boss_ras_frostwhisper.cpp | 123 -- .../scholomance/boss_the_ravenian.cpp | 117 -- .../EasternKingdoms/scholomance/boss_vectus.cpp | 105 -- .../scholomance/instance_scholomance.cpp | 146 -- .../EasternKingdoms/scholomance/scholomance.h | 17 - .../shadowfang_keep/instance_shadowfang_keep.cpp | 277 ---- .../shadowfang_keep/shadowfang_keep.cpp | 198 --- .../shadowfang_keep/shadowfang_keep.h | 17 - .../stratholme/boss_baron_rivendare.cpp | 190 --- .../stratholme/boss_baroness_anastari.cpp | 127 -- .../stratholme/boss_cannon_master_willey.cpp | 220 --- .../stratholme/boss_dathrohan_balnazzar.cpp | 217 --- .../stratholme/boss_magistrate_barthilas.cpp | 128 -- .../stratholme/boss_maleki_the_pallid.cpp | 108 -- .../EasternKingdoms/stratholme/boss_nerubenkan.cpp | 121 -- .../stratholme/boss_order_of_silver_hand.cpp | 157 -- .../stratholme/boss_postmaster_malown.cpp | 144 -- .../stratholme/boss_ramstein_the_gorger.cpp | 102 -- .../stratholme/boss_timmy_the_cruel.cpp | 83 - .../stratholme/instance_stratholme.cpp | 458 ------ .../EasternKingdoms/stratholme/stratholme.cpp | 282 ---- .../EasternKingdoms/stratholme/stratholme.h | 28 - .../sunken_temple/instance_sunken_temple.cpp | 204 --- .../sunken_temple/sunken_temple.cpp | 71 - .../EasternKingdoms/sunken_temple/sunken_temple.h | 22 - .../sunwell_plateau/boss_brutallus.cpp | 349 ---- .../sunwell_plateau/boss_eredar_twins.cpp | 762 --------- .../sunwell_plateau/boss_felmyst.cpp | 579 ------- .../sunwell_plateau/boss_kalecgos.cpp | 794 --------- .../sunwell_plateau/boss_kiljaeden.cpp | 1408 ---------------- .../EasternKingdoms/sunwell_plateau/boss_muru.cpp | 640 -------- .../sunwell_plateau/instance_sunwell_plateau.cpp | 297 ---- .../sunwell_plateau/sunwell_plateau.cpp | 65 - .../sunwell_plateau/sunwell_plateau.h | 95 -- .../EasternKingdoms/uldaman/boss_archaedas.cpp | 497 ------ .../EasternKingdoms/uldaman/boss_ironaya.cpp | 106 -- .../EasternKingdoms/uldaman/instance_uldaman.cpp | 300 ---- .../scripts/EasternKingdoms/uldaman/uldaman.cpp | 205 --- .../EasternKingdoms/zulaman/boss_akilzon.cpp | 467 ------ .../EasternKingdoms/zulaman/boss_halazzi.cpp | 401 ----- .../EasternKingdoms/zulaman/boss_hexlord.cpp | 907 ----------- .../EasternKingdoms/zulaman/boss_janalai.cpp | 687 -------- .../EasternKingdoms/zulaman/boss_nalorakk.cpp | 451 ------ .../EasternKingdoms/zulaman/boss_zuljin.cpp | 623 -------- .../EasternKingdoms/zulaman/instance_zulaman.cpp | 320 ---- .../scripts/EasternKingdoms/zulaman/zulaman.cpp | 192 --- .../scripts/EasternKingdoms/zulaman/zulaman.h | 19 - .../EasternKingdoms/zulgurub/boss_arlokk.cpp | 278 ---- .../EasternKingdoms/zulgurub/boss_gahzranka.cpp | 93 -- .../EasternKingdoms/zulgurub/boss_grilek.cpp | 93 -- .../EasternKingdoms/zulgurub/boss_hakkar.cpp | 250 --- .../EasternKingdoms/zulgurub/boss_hazzarah.cpp | 104 -- .../EasternKingdoms/zulgurub/boss_jeklik.cpp | 291 ---- .../EasternKingdoms/zulgurub/boss_jindo.cpp | 263 --- .../EasternKingdoms/zulgurub/boss_mandokir.cpp | 333 ---- .../EasternKingdoms/zulgurub/boss_marli.cpp | 261 --- .../EasternKingdoms/zulgurub/boss_renataki.cpp | 152 -- .../EasternKingdoms/zulgurub/boss_thekal.cpp | 556 ------- .../EasternKingdoms/zulgurub/boss_venoxis.cpp | 199 --- .../EasternKingdoms/zulgurub/boss_wushoolay.cpp | 85 - .../EasternKingdoms/zulgurub/instance_zulgurub.cpp | 159 -- .../scripts/EasternKingdoms/zulgurub/zulgurub.h | 28 - 340 files changed, 43950 insertions(+), 43950 deletions(-) create mode 100644 src/server/scripts/EasternKingdoms/AlteracValley/alterac_valley.cpp create mode 100644 src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp create mode 100644 src/server/scripts/EasternKingdoms/AlteracValley/boss_drekthar.cpp create mode 100644 src/server/scripts/EasternKingdoms/AlteracValley/boss_galvangar.cpp create mode 100644 src/server/scripts/EasternKingdoms/AlteracValley/boss_vanndar.cpp create mode 100644 src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp create mode 100644 src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.h create mode 100644 src/server/scripts/EasternKingdoms/BlackrockDepths/boss_ambassador_flamelash.cpp create mode 100644 src/server/scripts/EasternKingdoms/BlackrockDepths/boss_anubshiah.cpp create mode 100644 src/server/scripts/EasternKingdoms/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp create mode 100644 src/server/scripts/EasternKingdoms/BlackrockDepths/boss_general_angerforge.cpp create mode 100644 src/server/scripts/EasternKingdoms/BlackrockDepths/boss_gorosh_the_dervish.cpp create mode 100644 src/server/scripts/EasternKingdoms/BlackrockDepths/boss_grizzle.cpp create mode 100644 src/server/scripts/EasternKingdoms/BlackrockDepths/boss_high_interrogator_gerstahn.cpp create mode 100644 src/server/scripts/EasternKingdoms/BlackrockDepths/boss_magmus.cpp create mode 100644 src/server/scripts/EasternKingdoms/BlackrockDepths/boss_moira_bronzebeard.cpp create mode 100644 src/server/scripts/EasternKingdoms/BlackrockDepths/boss_tomb_of_seven.cpp create mode 100644 src/server/scripts/EasternKingdoms/BlackrockDepths/instance_blackrock_depths.cpp create mode 100644 src/server/scripts/EasternKingdoms/BlackrockSpire/blackrock_spire.cpp create mode 100644 src/server/scripts/EasternKingdoms/BlackrockSpire/blackrock_spire.h create mode 100644 src/server/scripts/EasternKingdoms/BlackrockSpire/boss_drakkisath.cpp create mode 100644 src/server/scripts/EasternKingdoms/BlackrockSpire/boss_gyth.cpp create mode 100644 src/server/scripts/EasternKingdoms/BlackrockSpire/boss_halycon.cpp create mode 100644 src/server/scripts/EasternKingdoms/BlackrockSpire/boss_highlord_omokk.cpp create mode 100644 src/server/scripts/EasternKingdoms/BlackrockSpire/boss_mother_smolderweb.cpp create mode 100644 src/server/scripts/EasternKingdoms/BlackrockSpire/boss_overlord_wyrmthalak.cpp create mode 100644 src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp create mode 100644 src/server/scripts/EasternKingdoms/BlackrockSpire/boss_quartermaster_zigris.cpp create mode 100644 src/server/scripts/EasternKingdoms/BlackrockSpire/boss_rend_blackhand.cpp create mode 100644 src/server/scripts/EasternKingdoms/BlackrockSpire/boss_shadow_hunter_voshgajin.cpp create mode 100644 src/server/scripts/EasternKingdoms/BlackrockSpire/boss_the_beast.cpp create mode 100644 src/server/scripts/EasternKingdoms/BlackrockSpire/boss_warmaster_voone.cpp create mode 100644 src/server/scripts/EasternKingdoms/BlackrockSpire/instance_blackrock_spire.cpp create mode 100644 src/server/scripts/EasternKingdoms/BlackwingLair/boss_broodlord_lashlayer.cpp create mode 100644 src/server/scripts/EasternKingdoms/BlackwingLair/boss_chromaggus.cpp create mode 100644 src/server/scripts/EasternKingdoms/BlackwingLair/boss_ebonroc.cpp create mode 100644 src/server/scripts/EasternKingdoms/BlackwingLair/boss_firemaw.cpp create mode 100644 src/server/scripts/EasternKingdoms/BlackwingLair/boss_flamegor.cpp create mode 100644 src/server/scripts/EasternKingdoms/BlackwingLair/boss_nefarian.cpp create mode 100644 src/server/scripts/EasternKingdoms/BlackwingLair/boss_razorgore.cpp create mode 100644 src/server/scripts/EasternKingdoms/BlackwingLair/boss_vaelastrasz.cpp create mode 100644 src/server/scripts/EasternKingdoms/BlackwingLair/boss_victor_nefarius.cpp create mode 100644 src/server/scripts/EasternKingdoms/BlackwingLair/instance_blackwing_lair.cpp create mode 100644 src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp create mode 100644 src/server/scripts/EasternKingdoms/Deadmines/deadmines.cpp create mode 100644 src/server/scripts/EasternKingdoms/Deadmines/deadmines.h create mode 100644 src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp create mode 100644 src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp create mode 100644 src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.h create mode 100644 src/server/scripts/EasternKingdoms/Gnomeregan/instance_gnomeregan.cpp create mode 100644 src/server/scripts/EasternKingdoms/Karazhan/boss_curator.cpp create mode 100644 src/server/scripts/EasternKingdoms/Karazhan/boss_maiden_of_virtue.cpp create mode 100644 src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp create mode 100644 src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp create mode 100644 src/server/scripts/EasternKingdoms/Karazhan/boss_netherspite.cpp create mode 100644 src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp create mode 100644 src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp create mode 100644 src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp create mode 100644 src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp create mode 100644 src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp create mode 100644 src/server/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp create mode 100644 src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp create mode 100644 src/server/scripts/EasternKingdoms/Karazhan/karazhan.h create mode 100644 src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp create mode 100644 src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp create mode 100644 src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp create mode 100644 src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp create mode 100644 src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp create mode 100644 src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.cpp create mode 100644 src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.h create mode 100644 src/server/scripts/EasternKingdoms/MoltenCore/boss_baron_geddon.cpp create mode 100644 src/server/scripts/EasternKingdoms/MoltenCore/boss_garr.cpp create mode 100644 src/server/scripts/EasternKingdoms/MoltenCore/boss_gehennas.cpp create mode 100644 src/server/scripts/EasternKingdoms/MoltenCore/boss_golemagg.cpp create mode 100644 src/server/scripts/EasternKingdoms/MoltenCore/boss_lucifron.cpp create mode 100644 src/server/scripts/EasternKingdoms/MoltenCore/boss_magmadar.cpp create mode 100644 src/server/scripts/EasternKingdoms/MoltenCore/boss_majordomo_executus.cpp create mode 100644 src/server/scripts/EasternKingdoms/MoltenCore/boss_ragnaros.cpp create mode 100644 src/server/scripts/EasternKingdoms/MoltenCore/boss_shazzrah.cpp create mode 100644 src/server/scripts/EasternKingdoms/MoltenCore/boss_sulfuron_harbinger.cpp create mode 100644 src/server/scripts/EasternKingdoms/MoltenCore/instance_molten_core.cpp create mode 100644 src/server/scripts/EasternKingdoms/MoltenCore/molten_core.cpp create mode 100644 src/server/scripts/EasternKingdoms/MoltenCore/molten_core.h create mode 100644 src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp create mode 100644 src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp create mode 100644 src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp create mode 100644 src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp create mode 100644 src/server/scripts/EasternKingdoms/ScarletMonastery/boss_arcanist_doan.cpp create mode 100644 src/server/scripts/EasternKingdoms/ScarletMonastery/boss_azshir_the_sleepless.cpp create mode 100644 src/server/scripts/EasternKingdoms/ScarletMonastery/boss_bloodmage_thalnos.cpp create mode 100644 src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp create mode 100644 src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp create mode 100644 src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp create mode 100644 src/server/scripts/EasternKingdoms/ScarletMonastery/boss_houndmaster_loksey.cpp create mode 100644 src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp create mode 100644 src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp create mode 100644 src/server/scripts/EasternKingdoms/ScarletMonastery/boss_scorn.cpp create mode 100644 src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp create mode 100644 src/server/scripts/EasternKingdoms/ScarletMonastery/scarlet_monastery.h create mode 100644 src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp create mode 100644 src/server/scripts/EasternKingdoms/Scholomance/boss_death_knight_darkreaver.cpp create mode 100644 src/server/scripts/EasternKingdoms/Scholomance/boss_doctor_theolen_krastinov.cpp create mode 100644 src/server/scripts/EasternKingdoms/Scholomance/boss_illucia_barov.cpp create mode 100644 src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp create mode 100644 src/server/scripts/EasternKingdoms/Scholomance/boss_jandice_barov.cpp create mode 100644 src/server/scripts/EasternKingdoms/Scholomance/boss_kormok.cpp create mode 100644 src/server/scripts/EasternKingdoms/Scholomance/boss_lord_alexei_barov.cpp create mode 100644 src/server/scripts/EasternKingdoms/Scholomance/boss_lorekeeper_polkelt.cpp create mode 100644 src/server/scripts/EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp create mode 100644 src/server/scripts/EasternKingdoms/Scholomance/boss_the_ravenian.cpp create mode 100644 src/server/scripts/EasternKingdoms/Scholomance/boss_vectus.cpp create mode 100644 src/server/scripts/EasternKingdoms/Scholomance/instance_scholomance.cpp create mode 100644 src/server/scripts/EasternKingdoms/Scholomance/scholomance.h create mode 100644 src/server/scripts/EasternKingdoms/ShadowfangKeep/instance_shadowfang_keep.cpp create mode 100644 src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp create mode 100644 src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.h create mode 100644 src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp create mode 100644 src/server/scripts/EasternKingdoms/Stratholme/boss_baroness_anastari.cpp create mode 100644 src/server/scripts/EasternKingdoms/Stratholme/boss_cannon_master_willey.cpp create mode 100644 src/server/scripts/EasternKingdoms/Stratholme/boss_dathrohan_balnazzar.cpp create mode 100644 src/server/scripts/EasternKingdoms/Stratholme/boss_magistrate_barthilas.cpp create mode 100644 src/server/scripts/EasternKingdoms/Stratholme/boss_maleki_the_pallid.cpp create mode 100644 src/server/scripts/EasternKingdoms/Stratholme/boss_nerubenkan.cpp create mode 100644 src/server/scripts/EasternKingdoms/Stratholme/boss_order_of_silver_hand.cpp create mode 100644 src/server/scripts/EasternKingdoms/Stratholme/boss_postmaster_malown.cpp create mode 100644 src/server/scripts/EasternKingdoms/Stratholme/boss_ramstein_the_gorger.cpp create mode 100644 src/server/scripts/EasternKingdoms/Stratholme/boss_timmy_the_cruel.cpp create mode 100644 src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp create mode 100644 src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp create mode 100644 src/server/scripts/EasternKingdoms/Stratholme/stratholme.h create mode 100644 src/server/scripts/EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp create mode 100644 src/server/scripts/EasternKingdoms/SunkenTemple/sunken_temple.cpp create mode 100644 src/server/scripts/EasternKingdoms/SunkenTemple/sunken_temple.h create mode 100644 src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp create mode 100644 src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp create mode 100644 src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp create mode 100644 src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp create mode 100644 src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp create mode 100644 src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp create mode 100644 src/server/scripts/EasternKingdoms/SunwellPlateau/instance_sunwell_plateau.cpp create mode 100644 src/server/scripts/EasternKingdoms/SunwellPlateau/sunwell_plateau.cpp create mode 100644 src/server/scripts/EasternKingdoms/SunwellPlateau/sunwell_plateau.h create mode 100644 src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp create mode 100644 src/server/scripts/EasternKingdoms/Uldaman/boss_ironaya.cpp create mode 100644 src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp create mode 100644 src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp create mode 100644 src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp create mode 100644 src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp create mode 100644 src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp create mode 100644 src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp create mode 100644 src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp create mode 100644 src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp create mode 100644 src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp create mode 100644 src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp create mode 100644 src/server/scripts/EasternKingdoms/ZulAman/zulaman.h create mode 100644 src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp create mode 100644 src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp create mode 100644 src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp create mode 100644 src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp create mode 100644 src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp create mode 100644 src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp create mode 100644 src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp create mode 100644 src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp create mode 100644 src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp create mode 100644 src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp create mode 100644 src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp create mode 100644 src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp create mode 100644 src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp create mode 100644 src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp create mode 100644 src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h delete mode 100644 src/server/scripts/EasternKingdoms/alterac_valley/alterac_valley.cpp delete mode 100644 src/server/scripts/EasternKingdoms/alterac_valley/boss_balinda.cpp delete mode 100644 src/server/scripts/EasternKingdoms/alterac_valley/boss_drekthar.cpp delete mode 100644 src/server/scripts/EasternKingdoms/alterac_valley/boss_galvangar.cpp delete mode 100644 src/server/scripts/EasternKingdoms/alterac_valley/boss_vanndar.cpp delete mode 100644 src/server/scripts/EasternKingdoms/blackrock_depths/blackrock_depths.cpp delete mode 100644 src/server/scripts/EasternKingdoms/blackrock_depths/blackrock_depths.h delete mode 100644 src/server/scripts/EasternKingdoms/blackrock_depths/boss_ambassador_flamelash.cpp delete mode 100644 src/server/scripts/EasternKingdoms/blackrock_depths/boss_anubshiah.cpp delete mode 100644 src/server/scripts/EasternKingdoms/blackrock_depths/boss_emperor_dagran_thaurissan.cpp delete mode 100644 src/server/scripts/EasternKingdoms/blackrock_depths/boss_general_angerforge.cpp delete mode 100644 src/server/scripts/EasternKingdoms/blackrock_depths/boss_gorosh_the_dervish.cpp delete mode 100644 src/server/scripts/EasternKingdoms/blackrock_depths/boss_grizzle.cpp delete mode 100644 src/server/scripts/EasternKingdoms/blackrock_depths/boss_high_interrogator_gerstahn.cpp delete mode 100644 src/server/scripts/EasternKingdoms/blackrock_depths/boss_magmus.cpp delete mode 100644 src/server/scripts/EasternKingdoms/blackrock_depths/boss_moira_bronzebeard.cpp delete mode 100644 src/server/scripts/EasternKingdoms/blackrock_depths/boss_tomb_of_seven.cpp delete mode 100644 src/server/scripts/EasternKingdoms/blackrock_depths/instance_blackrock_depths.cpp delete mode 100644 src/server/scripts/EasternKingdoms/blackrock_spire/blackrock_spire.cpp delete mode 100644 src/server/scripts/EasternKingdoms/blackrock_spire/blackrock_spire.h delete mode 100644 src/server/scripts/EasternKingdoms/blackrock_spire/boss_drakkisath.cpp delete mode 100644 src/server/scripts/EasternKingdoms/blackrock_spire/boss_gyth.cpp delete mode 100644 src/server/scripts/EasternKingdoms/blackrock_spire/boss_halycon.cpp delete mode 100644 src/server/scripts/EasternKingdoms/blackrock_spire/boss_highlord_omokk.cpp delete mode 100644 src/server/scripts/EasternKingdoms/blackrock_spire/boss_mother_smolderweb.cpp delete mode 100644 src/server/scripts/EasternKingdoms/blackrock_spire/boss_overlord_wyrmthalak.cpp delete mode 100644 src/server/scripts/EasternKingdoms/blackrock_spire/boss_pyroguard_emberseer.cpp delete mode 100644 src/server/scripts/EasternKingdoms/blackrock_spire/boss_quartermaster_zigris.cpp delete mode 100644 src/server/scripts/EasternKingdoms/blackrock_spire/boss_rend_blackhand.cpp delete mode 100644 src/server/scripts/EasternKingdoms/blackrock_spire/boss_shadow_hunter_voshgajin.cpp delete mode 100644 src/server/scripts/EasternKingdoms/blackrock_spire/boss_the_beast.cpp delete mode 100644 src/server/scripts/EasternKingdoms/blackrock_spire/boss_warmaster_voone.cpp delete mode 100644 src/server/scripts/EasternKingdoms/blackrock_spire/instance_blackrock_spire.cpp delete mode 100644 src/server/scripts/EasternKingdoms/blackwing_lair/boss_broodlord_lashlayer.cpp delete mode 100644 src/server/scripts/EasternKingdoms/blackwing_lair/boss_chromaggus.cpp delete mode 100644 src/server/scripts/EasternKingdoms/blackwing_lair/boss_ebonroc.cpp delete mode 100644 src/server/scripts/EasternKingdoms/blackwing_lair/boss_firemaw.cpp delete mode 100644 src/server/scripts/EasternKingdoms/blackwing_lair/boss_flamegor.cpp delete mode 100644 src/server/scripts/EasternKingdoms/blackwing_lair/boss_nefarian.cpp delete mode 100644 src/server/scripts/EasternKingdoms/blackwing_lair/boss_razorgore.cpp delete mode 100644 src/server/scripts/EasternKingdoms/blackwing_lair/boss_vaelastrasz.cpp delete mode 100644 src/server/scripts/EasternKingdoms/blackwing_lair/boss_victor_nefarius.cpp delete mode 100644 src/server/scripts/EasternKingdoms/blackwing_lair/instance_blackwing_lair.cpp delete mode 100644 src/server/scripts/EasternKingdoms/deadmines/boss_mr_smite.cpp delete mode 100644 src/server/scripts/EasternKingdoms/deadmines/deadmines.cpp delete mode 100644 src/server/scripts/EasternKingdoms/deadmines/deadmines.h delete mode 100644 src/server/scripts/EasternKingdoms/deadmines/instance_deadmines.cpp delete mode 100644 src/server/scripts/EasternKingdoms/gnomeregan/gnomeregan.cpp delete mode 100644 src/server/scripts/EasternKingdoms/gnomeregan/gnomeregan.h delete mode 100644 src/server/scripts/EasternKingdoms/gnomeregan/instance_gnomeregan.cpp delete mode 100644 src/server/scripts/EasternKingdoms/karazhan/boss_curator.cpp delete mode 100644 src/server/scripts/EasternKingdoms/karazhan/boss_maiden_of_virtue.cpp delete mode 100644 src/server/scripts/EasternKingdoms/karazhan/boss_midnight.cpp delete mode 100644 src/server/scripts/EasternKingdoms/karazhan/boss_moroes.cpp delete mode 100644 src/server/scripts/EasternKingdoms/karazhan/boss_netherspite.cpp delete mode 100644 src/server/scripts/EasternKingdoms/karazhan/boss_nightbane.cpp delete mode 100644 src/server/scripts/EasternKingdoms/karazhan/boss_prince_malchezaar.cpp delete mode 100644 src/server/scripts/EasternKingdoms/karazhan/boss_shade_of_aran.cpp delete mode 100644 src/server/scripts/EasternKingdoms/karazhan/boss_terestian_illhoof.cpp delete mode 100644 src/server/scripts/EasternKingdoms/karazhan/bosses_opera.cpp delete mode 100644 src/server/scripts/EasternKingdoms/karazhan/instance_karazhan.cpp delete mode 100644 src/server/scripts/EasternKingdoms/karazhan/karazhan.cpp delete mode 100644 src/server/scripts/EasternKingdoms/karazhan/karazhan.h delete mode 100644 src/server/scripts/EasternKingdoms/magisters_terrace/boss_felblood_kaelthas.cpp delete mode 100644 src/server/scripts/EasternKingdoms/magisters_terrace/boss_priestess_delrissa.cpp delete mode 100644 src/server/scripts/EasternKingdoms/magisters_terrace/boss_selin_fireheart.cpp delete mode 100644 src/server/scripts/EasternKingdoms/magisters_terrace/boss_vexallus.cpp delete mode 100644 src/server/scripts/EasternKingdoms/magisters_terrace/instance_magisters_terrace.cpp delete mode 100644 src/server/scripts/EasternKingdoms/magisters_terrace/magisters_terrace.cpp delete mode 100644 src/server/scripts/EasternKingdoms/magisters_terrace/magisters_terrace.h delete mode 100644 src/server/scripts/EasternKingdoms/molten_core/boss_baron_geddon.cpp delete mode 100644 src/server/scripts/EasternKingdoms/molten_core/boss_garr.cpp delete mode 100644 src/server/scripts/EasternKingdoms/molten_core/boss_gehennas.cpp delete mode 100644 src/server/scripts/EasternKingdoms/molten_core/boss_golemagg.cpp delete mode 100644 src/server/scripts/EasternKingdoms/molten_core/boss_lucifron.cpp delete mode 100644 src/server/scripts/EasternKingdoms/molten_core/boss_magmadar.cpp delete mode 100644 src/server/scripts/EasternKingdoms/molten_core/boss_majordomo_executus.cpp delete mode 100644 src/server/scripts/EasternKingdoms/molten_core/boss_ragnaros.cpp delete mode 100644 src/server/scripts/EasternKingdoms/molten_core/boss_shazzrah.cpp delete mode 100644 src/server/scripts/EasternKingdoms/molten_core/boss_sulfuron_harbinger.cpp delete mode 100644 src/server/scripts/EasternKingdoms/molten_core/instance_molten_core.cpp delete mode 100644 src/server/scripts/EasternKingdoms/molten_core/molten_core.cpp delete mode 100644 src/server/scripts/EasternKingdoms/molten_core/molten_core.h delete mode 100644 src/server/scripts/EasternKingdoms/scarlet_enclave/chapter1.cpp delete mode 100644 src/server/scripts/EasternKingdoms/scarlet_enclave/chapter2.cpp delete mode 100644 src/server/scripts/EasternKingdoms/scarlet_enclave/chapter5.cpp delete mode 100644 src/server/scripts/EasternKingdoms/scarlet_enclave/the_scarlet_enclave.cpp delete mode 100644 src/server/scripts/EasternKingdoms/scarlet_monastery/boss_arcanist_doan.cpp delete mode 100644 src/server/scripts/EasternKingdoms/scarlet_monastery/boss_azshir_the_sleepless.cpp delete mode 100644 src/server/scripts/EasternKingdoms/scarlet_monastery/boss_bloodmage_thalnos.cpp delete mode 100644 src/server/scripts/EasternKingdoms/scarlet_monastery/boss_headless_horseman.cpp delete mode 100644 src/server/scripts/EasternKingdoms/scarlet_monastery/boss_herod.cpp delete mode 100644 src/server/scripts/EasternKingdoms/scarlet_monastery/boss_high_inquisitor_fairbanks.cpp delete mode 100644 src/server/scripts/EasternKingdoms/scarlet_monastery/boss_houndmaster_loksey.cpp delete mode 100644 src/server/scripts/EasternKingdoms/scarlet_monastery/boss_interrogator_vishas.cpp delete mode 100644 src/server/scripts/EasternKingdoms/scarlet_monastery/boss_mograine_and_whitemane.cpp delete mode 100644 src/server/scripts/EasternKingdoms/scarlet_monastery/boss_scorn.cpp delete mode 100644 src/server/scripts/EasternKingdoms/scarlet_monastery/instance_scarlet_monastery.cpp delete mode 100644 src/server/scripts/EasternKingdoms/scarlet_monastery/scarlet_monastery.h delete mode 100644 src/server/scripts/EasternKingdoms/scholomance/boss_darkmaster_gandling.cpp delete mode 100644 src/server/scripts/EasternKingdoms/scholomance/boss_death_knight_darkreaver.cpp delete mode 100644 src/server/scripts/EasternKingdoms/scholomance/boss_doctor_theolen_krastinov.cpp delete mode 100644 src/server/scripts/EasternKingdoms/scholomance/boss_illucia_barov.cpp delete mode 100644 src/server/scripts/EasternKingdoms/scholomance/boss_instructor_malicia.cpp delete mode 100644 src/server/scripts/EasternKingdoms/scholomance/boss_jandice_barov.cpp delete mode 100644 src/server/scripts/EasternKingdoms/scholomance/boss_kormok.cpp delete mode 100644 src/server/scripts/EasternKingdoms/scholomance/boss_lord_alexei_barov.cpp delete mode 100644 src/server/scripts/EasternKingdoms/scholomance/boss_lorekeeper_polkelt.cpp delete mode 100644 src/server/scripts/EasternKingdoms/scholomance/boss_ras_frostwhisper.cpp delete mode 100644 src/server/scripts/EasternKingdoms/scholomance/boss_the_ravenian.cpp delete mode 100644 src/server/scripts/EasternKingdoms/scholomance/boss_vectus.cpp delete mode 100644 src/server/scripts/EasternKingdoms/scholomance/instance_scholomance.cpp delete mode 100644 src/server/scripts/EasternKingdoms/scholomance/scholomance.h delete mode 100644 src/server/scripts/EasternKingdoms/shadowfang_keep/instance_shadowfang_keep.cpp delete mode 100644 src/server/scripts/EasternKingdoms/shadowfang_keep/shadowfang_keep.cpp delete mode 100644 src/server/scripts/EasternKingdoms/shadowfang_keep/shadowfang_keep.h delete mode 100644 src/server/scripts/EasternKingdoms/stratholme/boss_baron_rivendare.cpp delete mode 100644 src/server/scripts/EasternKingdoms/stratholme/boss_baroness_anastari.cpp delete mode 100644 src/server/scripts/EasternKingdoms/stratholme/boss_cannon_master_willey.cpp delete mode 100644 src/server/scripts/EasternKingdoms/stratholme/boss_dathrohan_balnazzar.cpp delete mode 100644 src/server/scripts/EasternKingdoms/stratholme/boss_magistrate_barthilas.cpp delete mode 100644 src/server/scripts/EasternKingdoms/stratholme/boss_maleki_the_pallid.cpp delete mode 100644 src/server/scripts/EasternKingdoms/stratholme/boss_nerubenkan.cpp delete mode 100644 src/server/scripts/EasternKingdoms/stratholme/boss_order_of_silver_hand.cpp delete mode 100644 src/server/scripts/EasternKingdoms/stratholme/boss_postmaster_malown.cpp delete mode 100644 src/server/scripts/EasternKingdoms/stratholme/boss_ramstein_the_gorger.cpp delete mode 100644 src/server/scripts/EasternKingdoms/stratholme/boss_timmy_the_cruel.cpp delete mode 100644 src/server/scripts/EasternKingdoms/stratholme/instance_stratholme.cpp delete mode 100644 src/server/scripts/EasternKingdoms/stratholme/stratholme.cpp delete mode 100644 src/server/scripts/EasternKingdoms/stratholme/stratholme.h delete mode 100644 src/server/scripts/EasternKingdoms/sunken_temple/instance_sunken_temple.cpp delete mode 100644 src/server/scripts/EasternKingdoms/sunken_temple/sunken_temple.cpp delete mode 100644 src/server/scripts/EasternKingdoms/sunken_temple/sunken_temple.h delete mode 100644 src/server/scripts/EasternKingdoms/sunwell_plateau/boss_brutallus.cpp delete mode 100644 src/server/scripts/EasternKingdoms/sunwell_plateau/boss_eredar_twins.cpp delete mode 100644 src/server/scripts/EasternKingdoms/sunwell_plateau/boss_felmyst.cpp delete mode 100644 src/server/scripts/EasternKingdoms/sunwell_plateau/boss_kalecgos.cpp delete mode 100644 src/server/scripts/EasternKingdoms/sunwell_plateau/boss_kiljaeden.cpp delete mode 100644 src/server/scripts/EasternKingdoms/sunwell_plateau/boss_muru.cpp delete mode 100644 src/server/scripts/EasternKingdoms/sunwell_plateau/instance_sunwell_plateau.cpp delete mode 100644 src/server/scripts/EasternKingdoms/sunwell_plateau/sunwell_plateau.cpp delete mode 100644 src/server/scripts/EasternKingdoms/sunwell_plateau/sunwell_plateau.h delete mode 100644 src/server/scripts/EasternKingdoms/uldaman/boss_archaedas.cpp delete mode 100644 src/server/scripts/EasternKingdoms/uldaman/boss_ironaya.cpp delete mode 100644 src/server/scripts/EasternKingdoms/uldaman/instance_uldaman.cpp delete mode 100644 src/server/scripts/EasternKingdoms/uldaman/uldaman.cpp delete mode 100644 src/server/scripts/EasternKingdoms/zulaman/boss_akilzon.cpp delete mode 100644 src/server/scripts/EasternKingdoms/zulaman/boss_halazzi.cpp delete mode 100644 src/server/scripts/EasternKingdoms/zulaman/boss_hexlord.cpp delete mode 100644 src/server/scripts/EasternKingdoms/zulaman/boss_janalai.cpp delete mode 100644 src/server/scripts/EasternKingdoms/zulaman/boss_nalorakk.cpp delete mode 100644 src/server/scripts/EasternKingdoms/zulaman/boss_zuljin.cpp delete mode 100644 src/server/scripts/EasternKingdoms/zulaman/instance_zulaman.cpp delete mode 100644 src/server/scripts/EasternKingdoms/zulaman/zulaman.cpp delete mode 100644 src/server/scripts/EasternKingdoms/zulaman/zulaman.h delete mode 100644 src/server/scripts/EasternKingdoms/zulgurub/boss_arlokk.cpp delete mode 100644 src/server/scripts/EasternKingdoms/zulgurub/boss_gahzranka.cpp delete mode 100644 src/server/scripts/EasternKingdoms/zulgurub/boss_grilek.cpp delete mode 100644 src/server/scripts/EasternKingdoms/zulgurub/boss_hakkar.cpp delete mode 100644 src/server/scripts/EasternKingdoms/zulgurub/boss_hazzarah.cpp delete mode 100644 src/server/scripts/EasternKingdoms/zulgurub/boss_jeklik.cpp delete mode 100644 src/server/scripts/EasternKingdoms/zulgurub/boss_jindo.cpp delete mode 100644 src/server/scripts/EasternKingdoms/zulgurub/boss_mandokir.cpp delete mode 100644 src/server/scripts/EasternKingdoms/zulgurub/boss_marli.cpp delete mode 100644 src/server/scripts/EasternKingdoms/zulgurub/boss_renataki.cpp delete mode 100644 src/server/scripts/EasternKingdoms/zulgurub/boss_thekal.cpp delete mode 100644 src/server/scripts/EasternKingdoms/zulgurub/boss_venoxis.cpp delete mode 100644 src/server/scripts/EasternKingdoms/zulgurub/boss_wushoolay.cpp delete mode 100644 src/server/scripts/EasternKingdoms/zulgurub/instance_zulgurub.cpp delete mode 100644 src/server/scripts/EasternKingdoms/zulgurub/zulgurub.h (limited to 'src/server/scripts/EasternKingdoms') diff --git a/src/server/scripts/EasternKingdoms/AlteracValley/alterac_valley.cpp b/src/server/scripts/EasternKingdoms/AlteracValley/alterac_valley.cpp new file mode 100644 index 00000000000..a61fc21d5ba --- /dev/null +++ b/src/server/scripts/EasternKingdoms/AlteracValley/alterac_valley.cpp @@ -0,0 +1,180 @@ +/* Copyright (C) 2008 - 2010 TrinityCore +* 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 +*/ + +#include "ScriptedPch.h" + +enum Spells +{ + SPELL_CHARGE = 22911, + SPELL_CLEAVE = 40504, + SPELL_DEMORALIZING_SHOUT = 23511, + SPELL_ENRAGE = 8599, + SPELL_WHIRLWIND1 = 15589, + SPELL_WHIRLWIND2 = 13736, + SPELL_NORTH_MARSHAL = 45828, + SPELL_SOUTH_MARSHAL = 45829, + SPELL_STONEHEARTH_MARSHAL = 45830, + SPELL_ICEWING_MARSHAL = 45831, + SPELL_ICEBLOOD_WARMASTER = 45822, + SPELL_TOWER_POINT_WARMASTER = 45823, + SPELL_WEST_FROSTWOLF_WARMASTER = 45824, + SPELL_EAST_FROSTWOLF_WARMASTER = 45826 +}; + +enum Creatures +{ + NPC_NORTH_MARSHAL = 14762, + NPC_SOUTH_MARSHAL = 14763, + NPC_ICEWING_MARSHAL = 14764, + NPC_STONEHEARTH_MARSHAL = 14765, + NPC_EAST_FROSTWOLF_WARMASTER = 14772, + NPC_ICEBLOOD_WARMASTER = 14773, + NPC_TOWER_POINT_WARMASTER = 14776, + NPC_WEST_FROSTWOLF_WARMASTER = 14777 +}; + +struct mob_av_marshal_or_warmasterAI : public ScriptedAI +{ + mob_av_marshal_or_warmasterAI(Creature *c) : ScriptedAI(c) {} + + uint32 uiChargeTimer; + uint32 uiCleaveTimer; + uint32 uiDemoralizingShoutTimer; + uint32 uiWhirlwind1Timer; + uint32 uiWhirlwind2Timer; + uint32 uiEnrageTimer; + uint32 uiResetTimer; + + bool bHasAura; + + void Reset() + { + uiChargeTimer = urand(2*IN_MILISECONDS,12*IN_MILISECONDS); + uiCleaveTimer = urand(1*IN_MILISECONDS,11*IN_MILISECONDS); + uiDemoralizingShoutTimer = urand(2*IN_MILISECONDS,2*IN_MILISECONDS); + uiWhirlwind1Timer = urand(1*IN_MILISECONDS,12*IN_MILISECONDS); + uiWhirlwind2Timer = urand(5*IN_MILISECONDS,20*IN_MILISECONDS); + uiEnrageTimer = urand(5*IN_MILISECONDS,20*IN_MILISECONDS); + uiResetTimer = 5*IN_MILISECONDS; + + bHasAura = false; + } + + void JustRespawned() + { + Reset(); + } + + void UpdateAI(const uint32 diff) + { + if (!bHasAura) + { + switch(me->GetEntry()) + { + case NPC_NORTH_MARSHAL: + DoCast(me,SPELL_NORTH_MARSHAL); + break; + case NPC_SOUTH_MARSHAL: + DoCast(me,SPELL_SOUTH_MARSHAL); + break; + case NPC_STONEHEARTH_MARSHAL: + DoCast(me,SPELL_STONEHEARTH_MARSHAL); + break; + case NPC_ICEWING_MARSHAL: + DoCast(me,SPELL_ICEWING_MARSHAL); + break; + case NPC_EAST_FROSTWOLF_WARMASTER: + DoCast(me,SPELL_EAST_FROSTWOLF_WARMASTER); + break; + case NPC_WEST_FROSTWOLF_WARMASTER: + DoCast(me,SPELL_WEST_FROSTWOLF_WARMASTER); + break; + case NPC_ICEBLOOD_WARMASTER: + DoCast(me,SPELL_ICEBLOOD_WARMASTER); + break; + case NPC_TOWER_POINT_WARMASTER: + DoCast(me,SPELL_TOWER_POINT_WARMASTER); + break; + } + + bHasAura = true; + } + + if (!UpdateVictim()) + return; + + if (uiChargeTimer <= diff) + { + DoCast(me->getVictim(), SPELL_CHARGE); + uiChargeTimer = urand(10*IN_MILISECONDS,25*IN_MILISECONDS); + } else uiChargeTimer -= diff; + + if (uiCleaveTimer <= diff) + { + DoCast(me->getVictim(), SPELL_CLEAVE); + uiCleaveTimer = urand(10*IN_MILISECONDS,16*IN_MILISECONDS); + } else uiCleaveTimer -= diff; + + if (uiDemoralizingShoutTimer <= diff) + { + DoCast(me->getVictim(), SPELL_DEMORALIZING_SHOUT); + uiDemoralizingShoutTimer = urand(10*IN_MILISECONDS,15*IN_MILISECONDS); + } else uiDemoralizingShoutTimer -= diff; + + if (uiWhirlwind1Timer <= diff) + { + DoCast(me->getVictim(), SPELL_WHIRLWIND1); + uiWhirlwind1Timer = urand(6*IN_MILISECONDS,20*IN_MILISECONDS); + } else uiWhirlwind1Timer -= diff; + + if (uiWhirlwind2Timer <= diff) + { + DoCast(me->getVictim(), SPELL_WHIRLWIND2); + uiWhirlwind2Timer = urand(10*IN_MILISECONDS,25*IN_MILISECONDS); + } else uiWhirlwind2Timer -= diff; + + if (uiEnrageTimer <= diff) + { + DoCast(me->getVictim(), SPELL_ENRAGE); + uiEnrageTimer = urand(10*IN_MILISECONDS,30*IN_MILISECONDS); + }else uiEnrageTimer -= diff; + + + // check if creature is not outside of building + if (uiResetTimer <= diff) + { + if (me->GetDistance2d(me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY()) > 50) + EnterEvadeMode(); + uiResetTimer = 5*IN_MILISECONDS; + } else uiResetTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_av_marshal_or_warmaster(Creature *_Creature) +{ + return new mob_av_marshal_or_warmasterAI (_Creature); +} + +void AddSC_alterac_valley() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "mob_av_marshal_or_warmaster"; + newscript->GetAI = &GetAI_mob_av_marshal_or_warmaster; + newscript->RegisterSelf(); +} diff --git a/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp b/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp new file mode 100644 index 00000000000..ce2a81c864a --- /dev/null +++ b/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp @@ -0,0 +1,203 @@ +/* Copyright (C) 2008 - 2010 TrinityCore + * 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 + */ + +#include "ScriptedPch.h" + +enum Spells +{ + SPELL_ARCANE_EXPLOSION = 46608, + SPELL_CONE_OF_COLD = 38384, + SPELL_FIREBALL = 46988, + SPELL_FROSTBOLT = 46987 +}; + +enum Yells +{ + YELL_AGGRO = -2100019, + YELL_EVADE = -2100020 +}; + +enum Creatures +{ + NPC_WATER_ELEMENTAL = 25040 +}; + +enum WaterElementalSpells +{ + SPELL_WATERBOLT = 46983 +}; + +struct mob_water_elementalAI : public ScriptedAI +{ + mob_water_elementalAI(Creature *c) : ScriptedAI(c) {} + + uint32 uiWaterBoltTimer; + uint64 uiBalindaGUID; + uint32 uiResetTimer; + + void Reset() + { + uiWaterBoltTimer = 3*IN_MILISECONDS; + uiResetTimer = 5*IN_MILISECONDS; + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (uiWaterBoltTimer < diff) + { + DoCast(me->getVictim(), SPELL_WATERBOLT); + uiWaterBoltTimer = 5*IN_MILISECONDS; + } else uiWaterBoltTimer -= diff; + + // check if creature is not outside of building + if (uiResetTimer < diff) + { + if (Creature *pBalinda = Unit::GetCreature(*me, uiBalindaGUID)) + if (me->GetDistance2d(pBalinda->GetHomePosition().GetPositionX(), pBalinda->GetHomePosition().GetPositionY()) > 50) + EnterEvadeMode(); + uiResetTimer = 5*IN_MILISECONDS; + } else uiResetTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct boss_balindaAI : public ScriptedAI +{ + boss_balindaAI(Creature *c) : ScriptedAI(c), Summons(me) {} + + uint32 uiArcaneExplosionTimer; + uint32 uiConeOfColdTimer; + uint32 uiFireBoltTimer; + uint32 uiFrostboltTimer; + uint32 uiResetTimer; + uint32 uiWaterElementalTimer; + + SummonList Summons; + + void Reset() + { + uiArcaneExplosionTimer = urand(5*IN_MILISECONDS,15*IN_MILISECONDS); + uiConeOfColdTimer = 8*IN_MILISECONDS; + uiFireBoltTimer = 1*IN_MILISECONDS; + uiFrostboltTimer = 4*IN_MILISECONDS; + uiResetTimer = 5*IN_MILISECONDS; + uiWaterElementalTimer = 0; + + Summons.DespawnAll(); + } + + void EnterCombat(Unit * /*who*/) + { + DoScriptText(YELL_AGGRO, me); + } + + void JustRespawned() + { + Reset(); + } + + void JustSummoned(Creature* summoned) + { + ((mob_water_elementalAI*)summoned->AI())->uiBalindaGUID = me->GetGUID(); + summoned->AI()->AttackStart(SelectTarget(SELECT_TARGET_RANDOM,0, 50, true)); + summoned->setFaction(me->getFaction()); + Summons.Summon(summoned); + } + + void JustDied(Unit* /*Killer*/) + { + Summons.DespawnAll(); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (uiWaterElementalTimer < diff) + { + if (Summons.empty()) + me->SummonCreature(NPC_WATER_ELEMENTAL, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45*IN_MILISECONDS); + uiWaterElementalTimer = 50*IN_MILISECONDS; + } else uiWaterElementalTimer -= diff; + + if (uiArcaneExplosionTimer < diff) + { + DoCast(me->getVictim(), SPELL_ARCANE_EXPLOSION); + uiArcaneExplosionTimer = urand(5*IN_MILISECONDS,15*IN_MILISECONDS); + } else uiArcaneExplosionTimer -= diff; + + if (uiConeOfColdTimer < diff) + { + DoCast(me->getVictim(), SPELL_CONE_OF_COLD); + uiConeOfColdTimer = urand(10*IN_MILISECONDS,20*IN_MILISECONDS); + } else uiConeOfColdTimer -= diff; + + if (uiFireBoltTimer < diff) + { + DoCast(me->getVictim(), SPELL_FIREBALL); + uiFireBoltTimer = urand(5*IN_MILISECONDS,9*IN_MILISECONDS); + } else uiFireBoltTimer -= diff; + + if (uiFrostboltTimer < diff) + { + DoCast(me->getVictim(), SPELL_FROSTBOLT); + uiFrostboltTimer = urand(4*IN_MILISECONDS,12*IN_MILISECONDS); + } else uiFrostboltTimer -= diff; + + + // check if creature is not outside of building + if (uiResetTimer < diff) + { + if (me->GetDistance2d(me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY()) > 50) + { + EnterEvadeMode(); + DoScriptText(YELL_EVADE, me); + } + uiResetTimer = 5*IN_MILISECONDS; + } else uiResetTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_balinda(Creature *_Creature) +{ + return new boss_balindaAI (_Creature); +} + +CreatureAI* GetAI_mob_water_elemental(Creature *_Creature) +{ + return new mob_water_elementalAI (_Creature); +} + +void AddSC_boss_balinda() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_balinda"; + newscript->GetAI = &GetAI_boss_balinda; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_water_elemental"; + newscript->GetAI = &GetAI_mob_water_elemental; + newscript->RegisterSelf(); +}; \ No newline at end of file diff --git a/src/server/scripts/EasternKingdoms/AlteracValley/boss_drekthar.cpp b/src/server/scripts/EasternKingdoms/AlteracValley/boss_drekthar.cpp new file mode 100644 index 00000000000..6477ebe5eaf --- /dev/null +++ b/src/server/scripts/EasternKingdoms/AlteracValley/boss_drekthar.cpp @@ -0,0 +1,138 @@ +/* Copyright (C) 2008 - 2010 TrinityCore +* 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 +*/ + +#include "ScriptedPch.h" + +enum Spells +{ + SPELL_WHIRLWIND = 15589, + SPELL_WHIRLWIND2 = 13736, + SPELL_KNOCKDOWN = 19128, + SPELL_FRENZY = 8269, + SPELL_SWEEPING_STRIKES = 18765, // not sure + SPELL_CLEAVE = 20677, // not sure + SPELL_WINDFURY = 35886, // not sure + SPELL_STORMPIKE = 51876 // not sure +}; + +enum Yells +{ + YELL_AGGRO = -1810000, + YELL_EVADE = -1810001, + YELL_RESPAWN = -1810002, + YELL_RANDOM1 = -1810003, + YELL_RANDOM2 = -1810004, + YELL_RANDOM3 = -1810005, + YELL_RANDOM4 = -1810006, + YELL_RANDOM5 = -1810007 +}; + +struct boss_drektharAI : public ScriptedAI +{ + boss_drektharAI(Creature *c) : ScriptedAI(c) {} + + uint32 uiWhirlwindTimer; + uint32 uiWhirlwind2Timer; + uint32 uiKnockdownTimer; + uint32 uiFrenzyTimer; + uint32 uiYellTimer; + uint32 uiResetTimer; + + void Reset() + { + uiWhirlwindTimer = urand(1*IN_MILISECONDS,20*IN_MILISECONDS); + uiWhirlwind2Timer = urand(1*IN_MILISECONDS,20*IN_MILISECONDS); + uiKnockdownTimer = 12*IN_MILISECONDS; + uiFrenzyTimer = 6*IN_MILISECONDS; + uiResetTimer = 5*IN_MILISECONDS; + uiYellTimer = urand(20*IN_MILISECONDS,30*IN_MILISECONDS); //20 to 30 seconds + } + + void Aggro(Unit * /*who*/) + { + DoScriptText(YELL_AGGRO, me); + } + + void JustRespawned() + { + Reset(); + DoScriptText(YELL_RESPAWN, me); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (uiWhirlwindTimer <= diff) + { + DoCast(me->getVictim(), SPELL_WHIRLWIND); + uiWhirlwindTimer = urand(8*IN_MILISECONDS,18*IN_MILISECONDS); + } else uiWhirlwindTimer -= diff; + + if (uiWhirlwind2Timer <= diff) + { + DoCast(me->getVictim(), SPELL_WHIRLWIND2); + uiWhirlwind2Timer = urand(7*IN_MILISECONDS,25*IN_MILISECONDS); + } else uiWhirlwind2Timer -= diff; + + if (uiKnockdownTimer <= diff) + { + DoCast(me->getVictim(), SPELL_KNOCKDOWN); + uiKnockdownTimer = urand(10*IN_MILISECONDS,15*IN_MILISECONDS); + } else uiKnockdownTimer -= diff; + + if (uiFrenzyTimer <= diff) + { + DoCast(me->getVictim(), SPELL_FRENZY); + uiFrenzyTimer = urand(20*IN_MILISECONDS,30*IN_MILISECONDS); + } else uiFrenzyTimer -= diff; + + if (uiYellTimer <= diff) + { + DoScriptText(RAND(YELL_RANDOM1,YELL_RANDOM2,YELL_RANDOM3,YELL_RANDOM4,YELL_RANDOM5), me); + uiYellTimer = urand(20*IN_MILISECONDS,30*IN_MILISECONDS); //20 to 30 seconds + } else uiYellTimer -= diff; + + // check if creature is not outside of building + if (uiResetTimer <= diff) + { + if (me->GetDistance2d(me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY()) > 50) + { + EnterEvadeMode(); + DoScriptText(YELL_EVADE, me); + } + uiResetTimer = 5*IN_MILISECONDS; + } else uiResetTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + + +CreatureAI* GetAI_boss_drekthar(Creature *_Creature) +{ + return new boss_drektharAI (_Creature); +} + +void AddSC_boss_drekthar() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_drekthar"; + newscript->GetAI = &GetAI_boss_drekthar; + newscript->RegisterSelf(); +} \ No newline at end of file diff --git a/src/server/scripts/EasternKingdoms/AlteracValley/boss_galvangar.cpp b/src/server/scripts/EasternKingdoms/AlteracValley/boss_galvangar.cpp new file mode 100644 index 00000000000..a12b9f267f9 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/AlteracValley/boss_galvangar.cpp @@ -0,0 +1,129 @@ +/* Copyright (C) 2008 - 2010 TrinityCore +* 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 +*/ + +#include "ScriptedPch.h" + +enum Spells +{ + SPELL_CLEAVE = 15284, + SPELL_FRIGHTENING_SHOUT = 19134, + SPELL_WHIRLWIND1 = 15589, + SPELL_WHIRLWIND2 = 13736, + SPELL_MORTAL_STRIKE = 16856 +}; + +enum Yells +{ + YELL_AGGRO = -1810021, + YELL_EVADE = -1810022 +}; + +struct boss_galvangarAI : public ScriptedAI +{ + boss_galvangarAI(Creature *c) : ScriptedAI(c) {} + + + uint32 uiCleaveTimer; + uint32 uiFrighteningShoutTimer; + uint32 uiWhirlwind1Timer; + uint32 uiWhirlwind2Timer; + uint32 uiMortalStrikeTimer; + uint32 uiResetTimer; + + + void Reset() + { + uiCleaveTimer = urand(1*IN_MILISECONDS,9*IN_MILISECONDS); + uiFrighteningShoutTimer = urand(2*IN_MILISECONDS,19*IN_MILISECONDS); + uiWhirlwind1Timer = urand(1*IN_MILISECONDS,13*IN_MILISECONDS); + uiWhirlwind2Timer = urand(5*IN_MILISECONDS,20*IN_MILISECONDS); + uiMortalStrikeTimer = urand(5*IN_MILISECONDS,20*IN_MILISECONDS); + uiResetTimer = 5*IN_MILISECONDS; + } + + void Aggro(Unit * /*who*/) + { + DoScriptText(YELL_AGGRO, me); + } + + void JustRespawned() + { + Reset(); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (uiCleaveTimer <= diff) + { + DoCast(me->getVictim(), SPELL_CLEAVE); + uiCleaveTimer = urand(10*IN_MILISECONDS,16*IN_MILISECONDS); + } else uiCleaveTimer -= diff; + + if (uiFrighteningShoutTimer <= diff) + { + DoCast(me->getVictim(), SPELL_FRIGHTENING_SHOUT); + uiFrighteningShoutTimer = urand(10*IN_MILISECONDS,15*IN_MILISECONDS); + } else uiFrighteningShoutTimer -= diff; + + if (uiWhirlwind1Timer <= diff) + { + DoCast(me->getVictim(), SPELL_WHIRLWIND1); + uiWhirlwind1Timer = urand(6*IN_MILISECONDS,10*IN_MILISECONDS); + } else uiWhirlwind1Timer -= diff; + + if (uiWhirlwind2Timer <= diff) + { + DoCast(me->getVictim(), SPELL_WHIRLWIND2); + uiWhirlwind2Timer = urand(10*IN_MILISECONDS,25*IN_MILISECONDS); + } else uiWhirlwind2Timer -= diff; + + if (uiMortalStrikeTimer <= diff) + { + DoCast(me->getVictim(), SPELL_MORTAL_STRIKE); + uiMortalStrikeTimer = urand(10*IN_MILISECONDS,30*IN_MILISECONDS); + } else uiMortalStrikeTimer -= diff; + + // check if creature is not outside of building + if (uiResetTimer <= diff) + { + if (me->GetDistance2d(me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY()) > 50) + { + EnterEvadeMode(); + DoScriptText(YELL_EVADE, me); + } + uiResetTimer = 5*IN_MILISECONDS; + } else uiResetTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_galvangar(Creature *_Creature) +{ + return new boss_galvangarAI (_Creature); +} + +void AddSC_boss_galvangar() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_galvangar"; + newscript->GetAI = &GetAI_boss_galvangar; + newscript->RegisterSelf(); +} diff --git a/src/server/scripts/EasternKingdoms/AlteracValley/boss_vanndar.cpp b/src/server/scripts/EasternKingdoms/AlteracValley/boss_vanndar.cpp new file mode 100644 index 00000000000..785827bc5d9 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/AlteracValley/boss_vanndar.cpp @@ -0,0 +1,129 @@ +/* Copyright (C) 2008 - 2010 TrinityCore +* 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 +*/ + +#include "ScriptedPch.h" + +enum Yells +{ + YELL_AGGRO = -1810008, + YELL_EVADE = -1810009, + YELL_RESPAWN1 = -1810010, + YELL_RESPAWN2 = -1810011, + YELL_RANDOM1 = -1810012, + YELL_RANDOM2 = -1810013, + YELL_RANDOM3 = -1810014, + YELL_RANDOM4 = -1810015, + YELL_RANDOM5 = -1810016, + YELL_RANDOM6 = -1810017, + YELL_RANDOM7 = -1810018 +}; + +enum Spells +{ + SPELL_AVATAR = 19135, + SPELL_THUNDERCLAP = 15588, + SPELL_STORMBOLT = 20685 // not sure +}; + +struct boss_vanndarAI : public ScriptedAI +{ + boss_vanndarAI(Creature *c) : ScriptedAI(c) {} + + + uint32 uiAvatarTimer; + uint32 uiThunderclapTimer; + uint32 uiStormboltTimer; + uint32 uiResetTimer; + uint32 uiYellTimer; + + + void Reset() + { + uiAvatarTimer = 3*IN_MILISECONDS; + uiThunderclapTimer = 4*IN_MILISECONDS; + uiStormboltTimer = 6*IN_MILISECONDS; + uiResetTimer = 5*IN_MILISECONDS; + uiYellTimer = urand(20*IN_MILISECONDS,30*IN_MILISECONDS); + } + + void Aggro(Unit * /*who*/) + { + DoScriptText(YELL_AGGRO, me); + } + + void JustRespawned() + { + Reset(); + DoScriptText(RAND(YELL_RESPAWN1,YELL_RESPAWN2), me); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (uiAvatarTimer <= diff) + { + DoCast(me->getVictim(), SPELL_AVATAR); + uiAvatarTimer = urand(15*IN_MILISECONDS,20*IN_MILISECONDS); + } else uiAvatarTimer -= diff; + + if (uiThunderclapTimer <= diff) + { + DoCast(me->getVictim(), SPELL_THUNDERCLAP); + uiThunderclapTimer = urand(5*IN_MILISECONDS,15*IN_MILISECONDS); + } else uiThunderclapTimer -= diff; + + if (uiStormboltTimer <= diff) + { + DoCast(me->getVictim(), SPELL_STORMBOLT); + uiStormboltTimer = urand(10*IN_MILISECONDS,25*IN_MILISECONDS); + } else uiStormboltTimer -= diff; + + if (uiYellTimer <= diff) + { + DoScriptText(RAND(YELL_RANDOM1,YELL_RANDOM2,YELL_RANDOM3,YELL_RANDOM4,YELL_RANDOM5,YELL_RANDOM6,YELL_RANDOM7), me); + uiYellTimer = urand(20*IN_MILISECONDS,30*IN_MILISECONDS); //20 to 30 seconds + } else uiYellTimer -= diff; + + // check if creature is not outside of building + if (uiResetTimer <= diff) + { + if (me->GetDistance2d(me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY()) > 50) + { + EnterEvadeMode(); + DoScriptText(YELL_EVADE, me); + } + uiResetTimer = 5*IN_MILISECONDS; + } else uiResetTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_vanndar(Creature *_Creature) +{ + return new boss_vanndarAI (_Creature); +} + +void AddSC_boss_vanndar() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_vanndar"; + newscript->GetAI = &GetAI_boss_vanndar; + newscript->RegisterSelf(); +} \ No newline at end of file diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp new file mode 100644 index 00000000000..e04fa8444b2 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp @@ -0,0 +1,1338 @@ +/* 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: Blackrock_Depths +SD%Complete: 95 +SDComment: Quest support: 4001, 4342, 7604, 4322. Vendor Lokhtos Darkbargainer. Need to rewrite the Jail Break support +SDCategory: Blackrock Depths +EndScriptData */ + +/* ContentData +go_shadowforge_brazier +at_ring_of_law +npc_grimstone +mob_phalanx +npc_kharan_mighthammer +npc_lokhtos_darkbargainer +npc_dughal_stormwing +npc_marshal_windsor +npc_marshal_reginald_windsor +npc_tobias_seecher +npc_rocknot +EndContentData */ + +#include "ScriptedPch.h" +#include "ScriptedEscortAI.h" +#include "blackrock_depths.h" + +/*###### ++## go_shadowforge_brazier ++######*/ + +bool GOHello_go_shadowforge_brazier(Player* /*pPlayer*/, GameObject* pGo) +{ + if (ScriptedInstance* pInstance = pGo->GetInstanceData()) + { + if (pInstance->GetData(TYPE_LYCEUM) == IN_PROGRESS) + pInstance->SetData(TYPE_LYCEUM, DONE); + else + pInstance->SetData(TYPE_LYCEUM, IN_PROGRESS); + // If used brazier open linked doors (North or South) + if (pGo->GetGUID() == pInstance->GetData64(DATA_SF_BRAZIER_N)) + pInstance->HandleGameObject(pInstance->GetData64(DATA_GOLEM_DOOR_N), true); + else if (pGo->GetGUID() == pInstance->GetData64(DATA_SF_BRAZIER_S)) + pInstance->HandleGameObject(pInstance->GetData64(DATA_GOLEM_DOOR_S), true); + } + return false; +} + +/*###### +## npc_grimstone +######*/ + +enum eGrimstone +{ + NPC_GRIMSTONE = 10096, + NPC_THELDREN = 16059, + + //4 or 6 in total? 1+2+1 / 2+2+2 / 3+3. Depending on this, code should be changed. + MAX_MOB_AMOUNT = 4 +}; + +uint32 RingMob[]= +{ + 8925, // Dredge Worm + 8926, // Deep Stinger + 8927, // Dark Screecher + 8928, // Burrowing Thundersnout + 8933, // Cave Creeper + 8932, // Borer Beetle +}; + +uint32 RingBoss[]= +{ + 9027, // Gorosh + 9028, // Grizzle + 9029, // Eviscerator + 9030, // Ok'thor + 9031, // Anub'shiah + 9032, // Hedrum +}; + +bool AreaTrigger_at_ring_of_law(Player* pPlayer, const AreaTriggerEntry * /*at*/) +{ + if (ScriptedInstance* pInstance = pPlayer->GetInstanceData()) + { + if (pInstance->GetData(TYPE_RING_OF_LAW) == IN_PROGRESS || pInstance->GetData(TYPE_RING_OF_LAW) == DONE) + return false; + + pInstance->SetData(TYPE_RING_OF_LAW,IN_PROGRESS); + pPlayer->SummonCreature(NPC_GRIMSTONE,625.559,-205.618,-52.735,2.609,TEMPSUMMON_DEAD_DESPAWN,0); + + return false; + } + return false; +} + +/*###### +## npc_grimstone +######*/ + +enum GrimstoneTexts +{ + SCRIPT_TEXT1 = -1000000, + SCRIPT_TEXT2 = -1000001, + SCRIPT_TEXT3 = -1000002, + SCRIPT_TEXT4 = -1000003, + SCRIPT_TEXT5 = -1000004, + SCRIPT_TEXT6 = -1000005 +}; + +//TODO: implement quest part of event (different end boss) +struct npc_grimstoneAI : public npc_escortAI +{ + npc_grimstoneAI(Creature *c) : npc_escortAI(c) + { + pInstance = c->GetInstanceData(); + MobSpawnId = rand()%6; + } + + ScriptedInstance* pInstance; + + uint8 EventPhase; + uint32 Event_Timer; + + uint8 MobSpawnId; + uint8 MobCount; + uint32 MobDeath_Timer; + + uint64 RingMobGUID[4]; + uint64 RingBossGUID; + + bool CanWalk; + + void Reset() + { + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + EventPhase = 0; + Event_Timer = 1000; + + MobCount = 0; + MobDeath_Timer = 0; + + for (uint8 i = 0; i < MAX_MOB_AMOUNT; ++i) + RingMobGUID[i] = 0; + + RingBossGUID = 0; + + CanWalk = false; + } + + //TODO: move them to center + void SummonRingMob() + { + if (Creature* tmp = me->SummonCreature(RingMob[MobSpawnId],608.960,-235.322,-53.907,1.857,TEMPSUMMON_DEAD_DESPAWN,0)) + RingMobGUID[MobCount] = tmp->GetGUID(); + + ++MobCount; + + if (MobCount == MAX_MOB_AMOUNT) + MobDeath_Timer = 2500; + } + + //TODO: move them to center + void SummonRingBoss() + { + if (Creature* tmp = me->SummonCreature(RingBoss[rand()%6],644.300,-175.989,-53.739,3.418,TEMPSUMMON_DEAD_DESPAWN,0)) + RingBossGUID = tmp->GetGUID(); + + MobDeath_Timer = 2500; + } + + void WaypointReached(uint32 i) + { + switch(i) + { + case 0: + DoScriptText(SCRIPT_TEXT1, me);//2 + CanWalk = false; + Event_Timer = 5000; + break; + case 1: + DoScriptText(SCRIPT_TEXT2, me);//4 + CanWalk = false; + Event_Timer = 5000; + break; + case 2: + CanWalk = false; + break; + case 3: + DoScriptText(SCRIPT_TEXT3, me);//5 + break; + case 4: + DoScriptText(SCRIPT_TEXT4, me);//6 + CanWalk = false; + Event_Timer = 5000; + break; + case 5: + if (pInstance) + { + pInstance->SetData(TYPE_RING_OF_LAW,DONE); + debug_log("TSCR: npc_grimstone: event reached end and set complete."); + } + break; + } + } + + void HandleGameObject(uint32 id, bool open) + { + pInstance->HandleGameObject(pInstance->GetData64(id), open); + } + + void UpdateAI(const uint32 diff) + { + if (!pInstance) + return; + + if (MobDeath_Timer) + { + if (MobDeath_Timer <= diff) + { + MobDeath_Timer = 2500; + + if (RingBossGUID) + { + Creature *boss = Unit::GetCreature(*me,RingBossGUID); + if (boss && !boss->isAlive() && boss->isDead()) + { + RingBossGUID = 0; + Event_Timer = 5000; + MobDeath_Timer = 0; + return; + } + return; + } + + for (uint8 i = 0; i < MAX_MOB_AMOUNT; ++i) + { + Creature *mob = Unit::GetCreature(*me,RingMobGUID[i]); + if (mob && !mob->isAlive() && mob->isDead()) + { + RingMobGUID[i] = 0; + --MobCount; + + //seems all are gone, so set timer to continue and discontinue this + if (!MobCount) + { + Event_Timer = 5000; + MobDeath_Timer = 0; + } + } + } + } else MobDeath_Timer -= diff; + } + + if (Event_Timer) + { + if (Event_Timer <= diff) + { + switch(EventPhase) + { + case 0: + DoScriptText(SCRIPT_TEXT5, me);//1 + HandleGameObject(DATA_ARENA4, false); + Start(false, false); + CanWalk = true; + Event_Timer = 0; + break; + case 1: + CanWalk = true; + Event_Timer = 0; + break; + case 2: + Event_Timer = 2000; + break; + case 3: + HandleGameObject(DATA_ARENA1, true); + Event_Timer = 3000; + break; + case 4: + CanWalk = true; + me->SetVisibility(VISIBILITY_OFF); + SummonRingMob(); + Event_Timer = 8000; + break; + case 5: + SummonRingMob(); + SummonRingMob(); + Event_Timer = 8000; + break; + case 6: + SummonRingMob(); + Event_Timer = 0; + break; + case 7: + me->SetVisibility(VISIBILITY_ON); + HandleGameObject(DATA_ARENA1, false); + DoScriptText(SCRIPT_TEXT6, me);//4 + CanWalk = true; + Event_Timer = 0; + break; + case 8: + HandleGameObject(DATA_ARENA2, true); + Event_Timer = 5000; + break; + case 9: + me->SetVisibility(VISIBILITY_OFF); + SummonRingBoss(); + Event_Timer = 0; + break; + case 10: + //if quest, complete + HandleGameObject(DATA_ARENA2, false); + HandleGameObject(DATA_ARENA3, true); + HandleGameObject(DATA_ARENA4, true); + CanWalk = true; + Event_Timer = 0; + break; + } + ++EventPhase; + } else Event_Timer -= diff; + } + + if (CanWalk) + npc_escortAI::UpdateAI(diff); + } +}; + +CreatureAI* GetAI_npc_grimstone(Creature* pCreature) +{ + return new npc_grimstoneAI(pCreature); +} + +/*###### +## mob_phalanx +######*/ + +enum PhalanxSpells +{ + SPELL_THUNDERCLAP = 8732, + SPELL_FIREBALLVOLLEY = 22425, + SPELL_MIGHTYBLOW = 14099 +}; + +struct mob_phalanxAI : public ScriptedAI +{ + mob_phalanxAI(Creature *c) : ScriptedAI(c) {} + + uint32 ThunderClap_Timer; + uint32 FireballVolley_Timer; + uint32 MightyBlow_Timer; + + void Reset() + { + ThunderClap_Timer = 12000; + FireballVolley_Timer =0; + MightyBlow_Timer = 15000; + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //ThunderClap_Timer + if (ThunderClap_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_THUNDERCLAP); + ThunderClap_Timer = 10000; + } else ThunderClap_Timer -= diff; + + //FireballVolley_Timer + if (me->GetHealth()*100 / me->GetMaxHealth() < 51) + { + if (FireballVolley_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_FIREBALLVOLLEY); + FireballVolley_Timer = 15000; + } else FireballVolley_Timer -= diff; + } + + //MightyBlow_Timer + if (MightyBlow_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_MIGHTYBLOW); + MightyBlow_Timer = 10000; + } else MightyBlow_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_mob_phalanx(Creature* pCreature) +{ + return new mob_phalanxAI (pCreature); +} + +/*###### +## npc_kharan_mighthammer +######*/ + +enum KharamQuests +{ + QUEST_4001 = 4001, + QUEST_4342 = 4342 +}; + +#define GOSSIP_ITEM_KHARAN_1 "I need to know where the princess are, Kharan!" +#define GOSSIP_ITEM_KHARAN_2 "All is not lost, Kharan!" + +#define GOSSIP_ITEM_KHARAN_3 "Gor'shak is my friend, you can trust me." +#define GOSSIP_ITEM_KHARAN_4 "Not enough, you need to tell me more." +#define GOSSIP_ITEM_KHARAN_5 "So what happened?" +#define GOSSIP_ITEM_KHARAN_6 "Continue..." +#define GOSSIP_ITEM_KHARAN_7 "So you suspect that someone on the inside was involved? That they were tipped off?" +#define GOSSIP_ITEM_KHARAN_8 "Continue with your story please." +#define GOSSIP_ITEM_KHARAN_9 "Indeed." +#define GOSSIP_ITEM_KHARAN_10 "The door is open, Kharan. You are a free man." + +bool GossipHello_npc_kharan_mighthammer(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(QUEST_4001) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + if (pPlayer->GetQuestStatus(4342) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); + + if (pPlayer->GetTeam() == HORDE) + pPlayer->SEND_GOSSIP_MENU(2473, pCreature->GetGUID()); + else + pPlayer->SEND_GOSSIP_MENU(2474, pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_kharan_mighthammer(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction) +{ + switch (uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + pPlayer->SEND_GOSSIP_MENU(2475, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); + pPlayer->SEND_GOSSIP_MENU(2476, pCreature->GetGUID()); + break; + + case GOSSIP_ACTION_INFO_DEF+3: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); + pPlayer->SEND_GOSSIP_MENU(2477, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+4: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); + pPlayer->SEND_GOSSIP_MENU(2478, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+5: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6); + pPlayer->SEND_GOSSIP_MENU(2479, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+6: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_8, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+7); + pPlayer->SEND_GOSSIP_MENU(2480, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+7: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_9, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+8); + pPlayer->SEND_GOSSIP_MENU(2481, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+8: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_10, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+9); + pPlayer->SEND_GOSSIP_MENU(2482, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+9: + pPlayer->CLOSE_GOSSIP_MENU(); + if (pPlayer->GetTeam() == HORDE) + pPlayer->AreaExploredOrEventHappens(QUEST_4001); + else + pPlayer->AreaExploredOrEventHappens(QUEST_4342); + break; + } + return true; +} + +/*###### +## npc_lokhtos_darkbargainer +######*/ + +enum LokhtosItems +{ + ITEM_THRORIUM_BROTHERHOOD_CONTRACT = 18628, + ITEM_SULFURON_INGOT = 17203 +}; + +enum LokhtosQuests +{ + QUEST_A_BINDING_CONTRACT = 7604 +}; + +enum LokhtosSpells +{ + SPELL_CREATE_THORIUM_BROTHERHOOD_CONTRACT_DND = 23059 +}; + +#define GOSSIP_ITEM_SHOW_ACCESS "Show me what I have access to, Lothos." +#define GOSSIP_ITEM_GET_CONTRACT "Get Thorium Brotherhood Contract" + +bool GossipHello_npc_lokhtos_darkbargainer(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pCreature->isVendor() && pPlayer->GetReputationRank(59) >= REP_FRIENDLY) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_ITEM_SHOW_ACCESS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); + + if (pPlayer->GetQuestRewardStatus(QUEST_A_BINDING_CONTRACT) != 1 && + !pPlayer->HasItemCount(ITEM_THRORIUM_BROTHERHOOD_CONTRACT, 1, true) && + pPlayer->HasItemCount(ITEM_SULFURON_INGOT, 1)) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_GET_CONTRACT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + } + + if (pPlayer->GetReputationRank(59) < REP_FRIENDLY) + pPlayer->SEND_GOSSIP_MENU(3673, pCreature->GetGUID()); + else + pPlayer->SEND_GOSSIP_MENU(3677, pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_lokhtos_darkbargainer(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) + { + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->CastSpell(pPlayer, SPELL_CREATE_THORIUM_BROTHERHOOD_CONTRACT_DND, false); + } + if (uiAction == GOSSIP_ACTION_TRADE) + pPlayer->SEND_VENDORLIST(pCreature->GetGUID()); + + return true; +} + +/*###### +## npc_dughal_stormwing +######*/ + +enum DughalQuests +{ + QUEST_JAIL_BREAK = 4322 +}; + +#define SAY_DUGHAL_FREE "Thank you, $N! I'm free!!!" +#define GOSSIP_DUGHAL "You're free, Dughal! Get out of here!" + +/* +struct npc_dughal_stormwingAI : public npc_escortAI +{ + npc_dughal_stormwingAI(Creature *c) : npc_escortAI(c) {} + + void WaypointReached(uint32 i) + { + switch(i) + { + case 0:me->Say(SAY_DUGHAL_FREE, LANG_UNIVERSAL, PlayerGUID); break; + case 1:pInstance->SetData(DATA_DUGHAL,ENCOUNTER_STATE_OBJECTIVE_COMPLETED);break; + case 2: + me->SetVisibility(VISIBILITY_OFF); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + pInstance->SetData(DATA_DUGHAL,ENCOUNTER_STATE_ENDED); + break; + } + } + + void EnterCombat(Unit* who) {} + void Reset() {} + + void JustDied(Unit* killer) + { + if (IsBeingEscorted && killer == me) + { + me->SetVisibility(VISIBILITY_OFF); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + pInstance->SetData(DATA_DUGHAL,ENCOUNTER_STATE_ENDED); + } + } + + void UpdateAI(const uint32 diff) + { + if (pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) return; + if ((pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_IN_PROGRESS || pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_FAILED || pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_ENDED)&& pInstance->GetData(DATA_DUGHAL) == ENCOUNTER_STATE_ENDED) + { + me->SetVisibility(VISIBILITY_OFF); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + else + { + me->SetVisibility(VISIBILITY_ON); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + npc_escortAI::UpdateAI(diff); + } +}; +CreatureAI* GetAI_npc_dughal_stormwing(Creature* pCreature) +{ + npc_dughal_stormwingAI* dughal_stormwingAI = new npc_dughal_stormwingAI(pCreature); + + dughal_stormwingAI->AddWaypoint(0, 280.42,-82.86, -77.12,0); + dughal_stormwingAI->AddWaypoint(1, 287.64,-87.01, -76.79,0); + dughal_stormwingAI->AddWaypoint(2, 354.63,-64.95, -67.53,0); + + return dughal_stormwingAI; +} +bool GossipHello_npc_dughal_stormwing(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetQuestStatus(QUEST_JAIL_BREAK) == QUEST_STATUS_INCOMPLETE && pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_IN_PROGRESS) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DUGHAL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + pPlayer->SEND_GOSSIP_MENU(2846, pCreature->GetGUID()); + } + return true; +} + +bool GossipSelect_npc_dughal_stormwing(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) + { + pPlayer->CLOSE_GOSSIP_MENU(); + CAST_AI(npc_escortAI, (pCreature->AI()))->Start(false, true, pPlayer->GetGUID()); + pCreature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + pInstance->SetData(DATA_QUEST_JAIL_BREAK,ENCOUNTER_STATE_IN_PROGRESS); + } + return true; +} + */ +/*###### +## npc_marshal_windsor +######*/ + +#define SAY_WINDSOR_AGGRO1 "You locked up the wrong Marshal. Prepare to be destroyed!" +#define SAY_WINDSOR_AGGRO2 "I bet you're sorry now, aren't you !?!!" +#define SAY_WINDSOR_AGGRO3 "You better hold me back $N or they are going to feel some prison house beatings." +#define SAY_WINDSOR_1 "Let's get a move on. My gear should be in the storage area up this way..." +#define SAY_WINDSOR_4_1 "Check that cell, $N. If someone is alive in there, we need to get them out." +#define SAY_WINDSOR_4_2 "Get him out of there!" +#define SAY_WINDSOR_4_3 "Good work! We're almost there, $N. This way." +#define SAY_WINDSOR_6 "This is it, $N. My stuff should be in that room. Cover me, I'm going in!" +#define SAY_WINDSOR_9 "Ah, there it is!" +#define MOB_ENTRY_REGINALD_WINDSOR 9682 + +Player* pPlayerStart; +/* +struct npc_marshal_windsorAI : public npc_escortAI +{ + npc_marshal_windsorAI(Creature *c) : npc_escortAI(c) + { + pInstance = c->GetInstanceData(); + } + + void WaypointReached(uint32 i) + { + switch(i) + { + case 1: + me->Say(SAY_WINDSOR_1, LANG_UNIVERSAL, PlayerGUID); + break; + case 7: + me->HandleEmoteCommand(EMOTE_STATE_POINT); + me->Say(SAY_WINDSOR_4_1, LANG_UNIVERSAL, PlayerGUID); + IsOnHold=true; + break; + case 10: + me->setFaction(534); + break; + case 12: + me->Say(SAY_WINDSOR_6, LANG_UNIVERSAL, PlayerGUID); + pInstance->SetData(DATA_SUPPLY_ROOM, ENCOUNTER_STATE_IN_PROGRESS); + break; + case 13: + me->HandleEmoteCommand(EMOTE_STATE_USESTANDING);//EMOTE_STATE_WORK + break; + case 14: + pInstance->SetData(DATA_GATE_SR,0); + me->setFaction(11); + break; + case 16: + me->Say(SAY_WINDSOR_9, LANG_UNIVERSAL, PlayerGUID); + break; + case 17: + me->HandleEmoteCommand(EMOTE_STATE_USESTANDING);//EMOTE_STATE_WORK + break; + case 18: + pInstance->SetData(DATA_GATE_SC,0); + break; + case 19: + me->SetVisibility(VISIBILITY_OFF); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + me->SummonCreature(MOB_ENTRY_REGINALD_WINDSOR,403.61,-51.71,-63.92,3.600434,TEMPSUMMON_DEAD_DESPAWN ,0); + pInstance->SetData(DATA_SUPPLY_ROOM, ENCOUNTER_STATE_ENDED); + break; + } + } + + void EnterCombat(Unit* who) + { + switch (urand(0,2)) + { + case 0: me->Say(SAY_WINDSOR_AGGRO1, LANG_UNIVERSAL, PlayerGUID); break; + case 1: me->Say(SAY_WINDSOR_AGGRO2, LANG_UNIVERSAL, PlayerGUID); break; + case 2: me->Say(SAY_WINDSOR_AGGRO3, LANG_UNIVERSAL, PlayerGUID); break; + } + } + + void Reset() {} + + void JustDied(Unit *slayer) + { + pInstance->SetData(DATA_QUEST_JAIL_BREAK,ENCOUNTER_STATE_FAILED); + } + + void UpdateAI(const uint32 diff) + { + if (pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) return; + if (pInstance->GetData(DATA_DUGHAL) == ENCOUNTER_STATE_OBJECTIVE_COMPLETED) + SetEscortPaused(false); + if (!pInstance->GetData(DATA_GATE_D) && pInstance->GetData(DATA_DUGHAL) == ENCOUNTER_STATE_NOT_STARTED) + { + me->Say(SAY_WINDSOR_4_2, LANG_UNIVERSAL, PlayerGUID); + pInstance->SetData(DATA_DUGHAL, ENCOUNTER_STATE_BEFORE_START); + } + if (pInstance->GetData(DATA_DUGHAL) == ENCOUNTER_STATE_OBJECTIVE_COMPLETED) + { + me->Say(SAY_WINDSOR_4_3, LANG_UNIVERSAL, PlayerGUID); + pInstance->SetData(DATA_DUGHAL, ENCOUNTER_STATE_ENDED); + } + if ((pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_IN_PROGRESS || pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_FAILED || pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_ENDED)&& pInstance->GetData(DATA_SUPPLY_ROOM) == ENCOUNTER_STATE_ENDED) + { + me->SetVisibility(VISIBILITY_OFF); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + else + { + me->SetVisibility(VISIBILITY_ON); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + npc_escortAI::UpdateAI(diff); + } +}; +CreatureAI* GetAI_npc_marshal_windsor(Creature* pCreature) +{ + npc_marshal_windsorAI* marshal_windsorAI = new npc_marshal_windsorAI(pCreature); + + marshal_windsorAI->AddWaypoint(0, 316.336,-225.528, -77.7258,7000); + marshal_windsorAI->AddWaypoint(1, 316.336,-225.528, -77.7258,2000); + marshal_windsorAI->AddWaypoint(2, 322.96,-207.13, -77.87,0); + marshal_windsorAI->AddWaypoint(3, 281.05,-172.16, -75.12,0); + marshal_windsorAI->AddWaypoint(4, 272.19,-139.14, -70.61,0); + marshal_windsorAI->AddWaypoint(5, 283.62,-116.09, -70.21,0); + marshal_windsorAI->AddWaypoint(6, 296.18,-94.30, -74.08,0); + marshal_windsorAI->AddWaypoint(7, 294.57,-93.11, -74.08,0); + marshal_windsorAI->AddWaypoint(8, 314.31,-74.31, -76.09,0); + marshal_windsorAI->AddWaypoint(9, 360.22,-62.93, -66.77,0); + marshal_windsorAI->AddWaypoint(10, 383.38,-69.40, -63.25,0); + marshal_windsorAI->AddWaypoint(11, 389.99,-67.86, -62.57,0); + marshal_windsorAI->AddWaypoint(12, 400.98,-72.01, -62.31,0); + marshal_windsorAI->AddWaypoint(13, 404.22,-62.30, -63.50,2300); + marshal_windsorAI->AddWaypoint(14, 404.22,-62.30, -63.50,1500); + marshal_windsorAI->AddWaypoint(15, 407.65,-51.86, -63.96,0); + marshal_windsorAI->AddWaypoint(16, 403.61,-51.71, -63.92,1000); + marshal_windsorAI->AddWaypoint(17, 403.61,-51.71, -63.92,2000); + marshal_windsorAI->AddWaypoint(18, 403.61,-51.71, -63.92,1000); + marshal_windsorAI->AddWaypoint(19, 403.61,-51.71, -63.92,0); + + return marshal_windsorAI; +} + +bool QuestAccept_npc_marshal_windsor(Player* pPlayer, Creature* pCreature, Quest const *quest) +{ + if (quest->GetQuestId() == 4322) + {PlayerStart = player; + if (pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) + { + CAST_AI(npc_escortAI, (pCreature->AI()))->Start(true, false, pPlayer->GetGUID()); + pInstance->SetData(DATA_QUEST_JAIL_BREAK,ENCOUNTER_STATE_IN_PROGRESS); + pCreature->setFaction(11); + } + + } + return false; +} + */ +/*###### +## npc_marshal_reginald_windsor +######*/ + +#define SAY_REGINALD_WINDSOR_0_1 "Can you feel the power, $N??? It's time to ROCK!" +#define SAY_REGINALD_WINDSOR_0_2 "Now we just have to free Tobias and we can get out of here. This way!" +#define SAY_REGINALD_WINDSOR_5_1 "Open it." +#define SAY_REGINALD_WINDSOR_5_2 "I never did like those two. Let's get moving." +#define SAY_REGINALD_WINDSOR_7_1 "Open it and be careful this time!" +#define SAY_REGINALD_WINDSOR_7_2 "That intolerant dirtbag finally got what was coming to him. Good riddance!" +#define SAY_REGINALD_WINDSOR_7_3 "Alright, let's go." +#define SAY_REGINALD_WINDSOR_13_1 "Open it. We need to hurry up. I can smell those Dark Irons coming a mile away and I can tell you one thing, they're COMING!" +#define SAY_REGINALD_WINDSOR_13_2 "Administering fists of fury on Crest Killer!" +#define SAY_REGINALD_WINDSOR_13_3 "He has to be in the last cell. Unless... they killed him." +#define SAY_REGINALD_WINDSOR_14_1 "Get him out of there!" +#define SAY_REGINALD_WINDSOR_14_2 "Excellent work, $N. Let's find the exit. I think I know the way. Follow me!" +#define SAY_REGINALD_WINDSOR_20_1 "We made it!" +#define SAY_REGINALD_WINDSOR_20_2 "Meet me at Maxwell's encampment. We'll go over the next stages of the plan there and figure out a way to decode my tablets without the decryption ring." +#define MOB_ENTRY_SHILL_DINGER 9678 +#define MOB_ENTRY_CREST_KILLER 9680 + +int wp = 0; +/* +struct npc_marshal_reginald_windsorAI : public npc_escortAI +{ + npc_marshal_reginald_windsorAI(Creature *c) : npc_escortAI(c) + { + } + + void WaypointReached(uint32 i) + { + wp=i; + switch(i) + { + case 0: + me->setFaction(11); + me->Say(SAY_REGINALD_WINDSOR_0_1, LANG_UNIVERSAL, PlayerGUID); + break; + case 1: + me->Say(SAY_REGINALD_WINDSOR_0_2, LANG_UNIVERSAL, PlayerGUID); + break; + case 7: + me->HandleEmoteCommand(EMOTE_STATE_POINT); + me->Say(SAY_REGINALD_WINDSOR_5_1, LANG_UNIVERSAL, PlayerGUID); + IsOnHold=true; + break; + case 8: + me->Say(SAY_REGINALD_WINDSOR_5_2, LANG_UNIVERSAL, PlayerGUID); + break; + case 11: + me->HandleEmoteCommand(EMOTE_STATE_POINT); + me->Say(SAY_REGINALD_WINDSOR_7_1, LANG_UNIVERSAL, PlayerGUID); + IsOnHold=true; + break; + case 12: + me->Say(SAY_REGINALD_WINDSOR_7_2, LANG_UNIVERSAL, PlayerGUID); + break; + case 13: + me->Say(SAY_REGINALD_WINDSOR_7_3, LANG_UNIVERSAL, PlayerGUID); + break; + case 20: + me->HandleEmoteCommand(EMOTE_STATE_POINT); + me->Say(SAY_REGINALD_WINDSOR_13_1, LANG_UNIVERSAL, PlayerGUID); + IsOnHold=true; + break; + case 21: + me->Say(SAY_REGINALD_WINDSOR_13_3, LANG_UNIVERSAL, PlayerGUID); + break; + case 23: + me->HandleEmoteCommand(EMOTE_STATE_POINT); + me->Say(SAY_REGINALD_WINDSOR_14_1, LANG_UNIVERSAL, PlayerGUID); + IsOnHold=true; + break; + case 24: + me->Say(SAY_REGINALD_WINDSOR_14_2, LANG_UNIVERSAL, PlayerGUID); + break; + case 31: + me->Say(SAY_REGINALD_WINDSOR_20_1, LANG_UNIVERSAL, PlayerGUID); + break; + case 32: + me->Say(SAY_REGINALD_WINDSOR_20_2, LANG_UNIVERSAL, PlayerGUID); + PlayerStart->GroupEventHappens(QUEST_JAIL_BREAK, me); + pInstance->SetData(DATA_SHILL, ENCOUNTER_STATE_ENDED); + break; + } + } + + void MoveInLineOfSight(Unit *who) + { + if (HasEscortState(STATE_ESCORT_ESCORTING)) + return; + + if (who->GetTypeId() == TYPEID_PLAYER) + { + if (CAST_PLR(who)->GetQuestStatus(4322) == QUEST_STATUS_INCOMPLETE) + { + float Radius = 10.0; + if (me->IsWithinDistInMap(who, Radius)) + { + SetEscortPaused(false); + Start(true, false, who->GetGUID()); + } + } + } + } + + void EnterCombat(Unit* who) + { + switch (urand(0,2)) + { + case 0: me->Say(SAY_WINDSOR_AGGRO1, LANG_UNIVERSAL, PlayerGUID); break; + case 1: me->Say(SAY_WINDSOR_AGGRO2, LANG_UNIVERSAL, PlayerGUID); break; + case 2: me->Say(SAY_WINDSOR_AGGRO3, LANG_UNIVERSAL, PlayerGUID); break; + } + } + void Reset() {} + + void JustDied(Unit *slayer) + { + pInstance->SetData(DATA_QUEST_JAIL_BREAK,ENCOUNTER_STATE_FAILED); + } + + void UpdateAI(const uint32 diff) + { + if (pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) return; + if (wp == 7) + { + if (!pInstance->GetData(DATA_GATE_J) && pInstance->GetData(DATA_JAZ) == ENCOUNTER_STATE_NOT_STARTED) + { + pInstance->SetData(DATA_CREATURE_JAZ,1); + pInstance->SetData(DATA_JAZ,ENCOUNTER_STATE_IN_PROGRESS); + } + if (pInstance->GetData(DATA_CREATURE_JAZ) && pInstance->GetData(DATA_CREATURE_OGRABISI) && pInstance->GetData(DATA_JAZ) == ENCOUNTER_STATE_IN_PROGRESS) + { + SetEscortPaused(false); + pInstance->SetData(DATA_JAZ,ENCOUNTER_STATE_ENDED); + } + } + else if (wp == 11) + { + if (!pInstance->GetData(DATA_GATE_S) && pInstance->GetData(DATA_SHILL) == ENCOUNTER_STATE_NOT_STARTED) + { + pInstance->SetData(DATA_CREATURE_SHILL,1); + pInstance->SetData(DATA_SHILL,ENCOUNTER_STATE_IN_PROGRESS); + } + if (pInstance->GetData(DATA_CREATURE_SHILL) && pInstance->GetData(DATA_SHILL) == ENCOUNTER_STATE_IN_PROGRESS) + { + pInstance->SetData(DATA_SHILL,ENCOUNTER_STATE_ENDED); + SetEscortPaused(false); + } + } + else if (wp == 20) + { + if (!pInstance->GetData(DATA_GATE_C) && pInstance->GetData(DATA_CREST) == ENCOUNTER_STATE_NOT_STARTED) + { + pInstance->SetData(DATA_CREATURE_CREST,1); + me->Say(SAY_REGINALD_WINDSOR_13_2, LANG_UNIVERSAL, PlayerGUID); + pInstance->SetData(DATA_CREST,ENCOUNTER_STATE_IN_PROGRESS); + } + if (pInstance->GetData(DATA_CREATURE_CREST) && pInstance->GetData(DATA_CREST) == ENCOUNTER_STATE_IN_PROGRESS) + { + SetEscortPaused(false); + pInstance->SetData(DATA_CREST,ENCOUNTER_STATE_ENDED); + } + } + if (pInstance->GetData(DATA_TOBIAS) == ENCOUNTER_STATE_OBJECTIVE_COMPLETED) SetEscortPaused(false); + npc_escortAI::UpdateAI(diff); + } +}; +CreatureAI* GetAI_npc_marshal_reginald_windsor(Creature* pCreature) +{ + npc_marshal_reginald_windsorAI* marshal_reginald_windsorAI = new npc_marshal_reginald_windsorAI(pCreature); + + marshal_reginald_windsorAI->AddWaypoint(0, 403.61,-52.71, -63.92,4000); + marshal_reginald_windsorAI->AddWaypoint(1, 403.61,-52.71, -63.92,4000); + marshal_reginald_windsorAI->AddWaypoint(2, 406.33,-54.87, -63.95,0); + marshal_reginald_windsorAI->AddWaypoint(3, 407.99,-73.91, -62.26,0); + marshal_reginald_windsorAI->AddWaypoint(4, 557.03,-119.71, -61.83,0); + marshal_reginald_windsorAI->AddWaypoint(5, 573.40,-124.39, -65.07,0); + marshal_reginald_windsorAI->AddWaypoint(6, 593.91,-130.29, -69.25,0); + marshal_reginald_windsorAI->AddWaypoint(7, 593.21,-132.16, -69.25,0); + marshal_reginald_windsorAI->AddWaypoint(8, 593.21,-132.16, -69.25,3000); + marshal_reginald_windsorAI->AddWaypoint(9, 622.81,-135.55, -71.92,0); + marshal_reginald_windsorAI->AddWaypoint(10, 634.68,-151.29, -70.32,0); + marshal_reginald_windsorAI->AddWaypoint(11, 635.06,-153.25, -70.32,0); + marshal_reginald_windsorAI->AddWaypoint(12, 635.06,-153.25, -70.32,3000); + marshal_reginald_windsorAI->AddWaypoint(13, 635.06,-153.25, -70.32,1500); + marshal_reginald_windsorAI->AddWaypoint(14, 655.25,-172.39, -73.72,0); + marshal_reginald_windsorAI->AddWaypoint(15, 654.79,-226.30, -83.06,0); + marshal_reginald_windsorAI->AddWaypoint(16, 622.85,-268.85, -83.96,0); + marshal_reginald_windsorAI->AddWaypoint(17, 579.45,-275.56, -80.44,0); + marshal_reginald_windsorAI->AddWaypoint(18, 561.19,-266.85, -75.59,0); + marshal_reginald_windsorAI->AddWaypoint(19, 547.91,-253.92, -70.34,0); + marshal_reginald_windsorAI->AddWaypoint(20, 549.20,-252.40, -70.34,0); + marshal_reginald_windsorAI->AddWaypoint(21, 549.20,-252.40, -70.34,4000); + marshal_reginald_windsorAI->AddWaypoint(22, 555.33,-269.16, -74.40,0); + marshal_reginald_windsorAI->AddWaypoint(23, 554.31,-270.88, -74.40,0); + marshal_reginald_windsorAI->AddWaypoint(24, 554.31,-270.88, -74.40,4000); + marshal_reginald_windsorAI->AddWaypoint(25, 536.10,-249.60, -67.47,0); + marshal_reginald_windsorAI->AddWaypoint(26, 520.94,-216.65, -59.28,0); + marshal_reginald_windsorAI->AddWaypoint(27, 505.99,-148.74, -62.17,0); + marshal_reginald_windsorAI->AddWaypoint(28, 484.21,-56.24, -62.43,0); + marshal_reginald_windsorAI->AddWaypoint(29, 470.39,-6.01, -70.10,0); + marshal_reginald_windsorAI->AddWaypoint(30, 451.27,30.85, -70.07,0); + marshal_reginald_windsorAI->AddWaypoint(31, 452.45,29.85, -70.37,1500); + marshal_reginald_windsorAI->AddWaypoint(32, 452.45,29.85, -70.37,7000); + marshal_reginald_windsorAI->AddWaypoint(33, 452.45,29.85, -70.37,10000); + marshal_reginald_windsorAI->AddWaypoint(34, 451.27,31.85, -70.07,0); + + return marshal_reginald_windsorAI; +} +*/ +/*###### +## npc_tobias_seecher +######*/ + +#define SAY_TOBIAS_FREE "Thank you! I will run for safety immediately!" +/* +struct npc_tobias_seecherAI : public npc_escortAI +{ + npc_tobias_seecherAI(Creature *c) :npc_escortAI(c) {} + + void EnterCombat(Unit* who) {} + void Reset() {} + + void JustDied(Unit* killer) + { + if (IsBeingEscorted && killer == me) + { + me->SetVisibility(VISIBILITY_OFF); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + pInstance->SetData(DATA_TOBIAS,ENCOUNTER_STATE_ENDED); + } + } + + void WaypointReached(uint32 i) + { + switch(i) + { + case 0:me->Say(SAY_TOBIAS_FREE, LANG_UNIVERSAL, PlayerGUID); break; + case 2: + pInstance->SetData(DATA_TOBIAS,ENCOUNTER_STATE_OBJECTIVE_COMPLETED);break; + case 4: + me->SetVisibility(VISIBILITY_OFF); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + pInstance->SetData(DATA_TOBIAS,ENCOUNTER_STATE_ENDED); + break; + } + } + + void UpdateAI(const uint32 diff) + { + if (pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) return; + if ((pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_IN_PROGRESS || pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_FAILED || pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_ENDED)&& pInstance->GetData(DATA_TOBIAS) == ENCOUNTER_STATE_ENDED) + { + me->SetVisibility(VISIBILITY_OFF); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + else + { + me->SetVisibility(VISIBILITY_ON); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + npc_escortAI::UpdateAI(diff); + } +}; + +CreatureAI* GetAI_npc_tobias_seecher(Creature* pCreature) +{ + npc_tobias_seecherAI* tobias_seecherAI = new npc_tobias_seecherAI(pCreature); + + tobias_seecherAI->AddWaypoint(0, 549.21, -281.07, -75.27); + tobias_seecherAI->AddWaypoint(1, 554.39, -267.39, -73.68); + tobias_seecherAI->AddWaypoint(2, 533.59, -249.38, -67.04); + tobias_seecherAI->AddWaypoint(3, 519.44, -217.02, -59.34); + tobias_seecherAI->AddWaypoint(4, 506.55, -153.49, -62.34); + + return tobias_seecherAI; +} + +bool GossipHello_npc_tobias_seecher(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetQuestStatus(QUEST_JAIL_BREAK) == QUEST_STATUS_INCOMPLETE && pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_IN_PROGRESS) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Get out of here, Tobias, you're free!", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + pPlayer->SEND_GOSSIP_MENU(2847, pCreature->GetGUID()); + } + return true; +} + +bool GossipSelect_npc_tobias_seecher(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) + { + pPlayer->CLOSE_GOSSIP_MENU(); + CAST_AI(npc_escortAI, (pCreature->AI()))->Start(false, true, pPlayer->GetGUID()); + pCreature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + pInstance->SetData(DATA_TOBIAS,ENCOUNTER_STATE_IN_PROGRESS); + } + return true; +} +*/ + +/*###### +## npc_rocknot +######*/ + +enum RocknotSays +{ + SAY_GOT_BEER = -1230000 +}; + +enum RocknotSpells +{ + SPELL_DRUNKEN_RAGE = 14872 +}; + +enum RocknotQuests +{ + QUEST_ALE = 4295 +}; + +struct npc_rocknotAI : public npc_escortAI +{ + npc_rocknotAI(Creature *c) : npc_escortAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint32 BreakKeg_Timer; + uint32 BreakDoor_Timer; + + void Reset() + { + if (HasEscortState(STATE_ESCORT_ESCORTING)) + return; + + BreakKeg_Timer = 0; + BreakDoor_Timer = 0; + } + + void DoGo(uint32 id, uint32 state) + { + if (GameObject* pGo = pInstance->instance->GetGameObject(pInstance->GetData64(id))) + pGo->SetGoState((GOState)state); + } + + void WaypointReached(uint32 i) + { + if (!pInstance) + return; + + switch(i) + { + case 1: + me->HandleEmoteCommand(EMOTE_ONESHOT_KICK); + break; + case 2: + me->HandleEmoteCommand(EMOTE_ONESHOT_ATTACKUNARMED); + break; + case 3: + me->HandleEmoteCommand(EMOTE_ONESHOT_ATTACKUNARMED); + break; + case 4: + me->HandleEmoteCommand(EMOTE_ONESHOT_KICK); + break; + case 5: + me->HandleEmoteCommand(EMOTE_ONESHOT_KICK); + BreakKeg_Timer = 2000; + break; + } + } + + void UpdateAI(const uint32 diff) + { + if (!pInstance) + return; + + if (BreakKeg_Timer) + { + if (BreakKeg_Timer <= diff) + { + DoGo(DATA_GO_BAR_KEG,0); + BreakKeg_Timer = 0; + BreakDoor_Timer = 1000; + } else BreakKeg_Timer -= diff; + } + + if (BreakDoor_Timer) + { + if (BreakDoor_Timer <= diff) + { + DoGo(DATA_GO_BAR_DOOR,2); + DoGo(DATA_GO_BAR_KEG_TRAP,0); //doesn't work very well, leaving code here for future + //spell by trap has effect61, this indicate the bar go hostile + + if (Unit *tmp = Unit::GetUnit(*me,pInstance->GetData64(DATA_PHALANX))) + tmp->setFaction(14); + + //for later, this event(s) has alot more to it. + //optionally, DONE can trigger bar to go hostile. + pInstance->SetData(TYPE_BAR,DONE); + + BreakDoor_Timer = 0; + } else BreakDoor_Timer -= diff; + } + + npc_escortAI::UpdateAI(diff); + } +}; + +CreatureAI* GetAI_npc_rocknot(Creature* pCreature) +{ + return new npc_rocknotAI(pCreature); +} + +bool ChooseReward_npc_rocknot(Player* /*pPlayer*/, Creature* pCreature, const Quest *_Quest, uint32 /*item*/) +{ + ScriptedInstance* pInstance = pCreature->GetInstanceData(); + + if (!pInstance) + return true; + + if (pInstance->GetData(TYPE_BAR) == DONE || pInstance->GetData(TYPE_BAR) == SPECIAL) + return true; + + if (_Quest->GetQuestId() == QUEST_ALE) + { + if (pInstance->GetData(TYPE_BAR) != IN_PROGRESS) + pInstance->SetData(TYPE_BAR,IN_PROGRESS); + + pInstance->SetData(TYPE_BAR,SPECIAL); + + //keep track of amount in instance script, returns SPECIAL if amount ok and event in progress + if (pInstance->GetData(TYPE_BAR) == SPECIAL) + { + DoScriptText(SAY_GOT_BEER, pCreature); + pCreature->CastSpell(pCreature,SPELL_DRUNKEN_RAGE,false); + if (npc_escortAI* pEscortAI = CAST_AI(npc_rocknotAI, pCreature->AI())) + pEscortAI->Start(false, false); + } + } + + return true; +} + +/*###### +## +######*/ + +void AddSC_blackrock_depths() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "go_shadowforge_brazier"; + newscript->pGOHello = &GOHello_go_shadowforge_brazier; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "at_ring_of_law"; + newscript->pAreaTrigger = &AreaTrigger_at_ring_of_law; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_grimstone"; + newscript->GetAI = &GetAI_npc_grimstone; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_phalanx"; + newscript->GetAI = &GetAI_mob_phalanx; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_kharan_mighthammer"; + newscript->pGossipHello = &GossipHello_npc_kharan_mighthammer; + newscript->pGossipSelect = &GossipSelect_npc_kharan_mighthammer; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_lokhtos_darkbargainer"; + newscript->pGossipHello = &GossipHello_npc_lokhtos_darkbargainer; + newscript->pGossipSelect = &GossipSelect_npc_lokhtos_darkbargainer; + newscript->RegisterSelf(); +/* + newscript = new Script; + newscript->Name = "npc_dughal_stormwing"; + newscript->pGossipHello = &GossipHello_npc_dughal_stormwing; + newscript->pGossipSelect = &GossipSelect_npc_dughal_stormwing; + newscript->GetAI = &GetAI_npc_dughal_stormwing; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_tobias_seecher"; + newscript->pGossipHello = &GossipHello_npc_tobias_seecher; + newscript->pGossipSelect = &GossipSelect_npc_tobias_seecher; + newscript->GetAI = &GetAI_npc_tobias_seecher; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_marshal_windsor"; + newscript->pQuestAccept = &QuestAccept_npc_marshal_windsor; + newscript->GetAI = &GetAI_npc_marshal_windsor; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_marshal_reginald_windsor"; + newscript->GetAI = &GetAI_npc_marshal_reginald_windsor; + newscript->RegisterSelf(); +*/ + newscript = new Script; + newscript->Name = "npc_rocknot"; + newscript->GetAI = &GetAI_npc_rocknot; + newscript->pChooseReward = &ChooseReward_npc_rocknot; + newscript->RegisterSelf(); +} diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.h b/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.h new file mode 100644 index 00000000000..edb340252b2 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.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_BRD_H +#define DEF_BRD_H + +#define FACTION_NEUTRAL 734 +#define FACTION_HOSTILE 754 +#define FACTION_FRIEND 35 + +enum eTypes +{ + TYPE_RING_OF_LAW = 1, + TYPE_VAULT = 2, + TYPE_BAR = 3, + TYPE_TOMB_OF_SEVEN = 4, + TYPE_LYCEUM = 5, + TYPE_IRON_HALL = 6, + + DATA_EMPEROR = 10, + DATA_PHALANX = 11, + + DATA_ARENA1 = 12, + DATA_ARENA2 = 13, + DATA_ARENA3 = 14, + DATA_ARENA4 = 15, + + DATA_GO_BAR_KEG = 16, + DATA_GO_BAR_KEG_TRAP = 17, + DATA_GO_BAR_DOOR = 18, + DATA_GO_CHALICE = 19, + + DATA_GHOSTKILL = 20, + DATA_EVENSTARTER = 21, + + DATA_GOLEM_DOOR_N = 22, + DATA_GOLEM_DOOR_S = 23, + + DATA_THRONE_DOOR = 24, + + DATA_SF_BRAZIER_N = 25, + DATA_SF_BRAZIER_S = 26 +}; +#endif diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_ambassador_flamelash.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_ambassador_flamelash.cpp new file mode 100644 index 00000000000..a387e816951 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_ambassador_flamelash.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: Boss_Ambassador_Flamelash +SD%Complete: 100 +SDComment: +SDCategory: Blackrock Depths +EndScriptData */ + +#include "ScriptedPch.h" + +enum Spells +{ + SPELL_FIREBLAST = 15573 +}; + +struct boss_ambassador_flamelashAI : public ScriptedAI +{ + boss_ambassador_flamelashAI(Creature *c) : ScriptedAI(c) {} + + uint32 FireBlast_Timer; + uint32 Spirit_Timer; + + void Reset() + { + FireBlast_Timer = 2000; + Spirit_Timer = 24000; + } + + void EnterCombat(Unit * /*who*/) {} + + void SummonSpirits(Unit* victim) + { + if (Creature *Spirit = DoSpawnCreature(9178, irand(-9,9), irand(-9,9), 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000)) + Spirit->AI()->AttackStart(victim); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //FireBlast_Timer + if (FireBlast_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_FIREBLAST); + FireBlast_Timer = 7000; + } else FireBlast_Timer -= diff; + + //Spirit_Timer + if (Spirit_Timer <= diff) + { + SummonSpirits(me->getVictim()); + SummonSpirits(me->getVictim()); + SummonSpirits(me->getVictim()); + SummonSpirits(me->getVictim()); + + Spirit_Timer = 30000; + } else Spirit_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_ambassador_flamelash(Creature* pCreature) +{ + return new boss_ambassador_flamelashAI (pCreature); +} + +void AddSC_boss_ambassador_flamelash() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_ambassador_flamelash"; + newscript->GetAI = &GetAI_boss_ambassador_flamelash; + newscript->RegisterSelf(); +} diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_anubshiah.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_anubshiah.cpp new file mode 100644 index 00000000000..60e1dec236c --- /dev/null +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_anubshiah.cpp @@ -0,0 +1,116 @@ +/* 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_Anubshiah +SD%Complete: 100 +SDComment: +SDCategory: Blackrock Depths +EndScriptData */ + +#include "ScriptedPch.h" + +enum Spells +{ + SPELL_SHADOWBOLT = 17228, + SPELL_CURSEOFTONGUES = 15470, + SPELL_CURSEOFWEAKNESS = 17227, + SPELL_DEMONARMOR = 11735, + SPELL_ENVELOPINGWEB = 15471 +}; + +struct boss_anubshiahAI : public ScriptedAI +{ + boss_anubshiahAI(Creature *c) : ScriptedAI(c) {} + + uint32 ShadowBolt_Timer; + uint32 CurseOfTongues_Timer; + uint32 CurseOfWeakness_Timer; + uint32 DemonArmor_Timer; + uint32 EnvelopingWeb_Timer; + + void Reset() + { + ShadowBolt_Timer = 7000; + CurseOfTongues_Timer = 24000; + CurseOfWeakness_Timer = 12000; + DemonArmor_Timer = 3000; + EnvelopingWeb_Timer = 16000; + } + + void EnterCombat(Unit * /*who*/) + { + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //ShadowBolt_Timer + if (ShadowBolt_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_SHADOWBOLT); + ShadowBolt_Timer = 7000; + } else ShadowBolt_Timer -= diff; + + //CurseOfTongues_Timer + if (CurseOfTongues_Timer <= diff) + { + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) + DoCast(pTarget, SPELL_CURSEOFTONGUES); + CurseOfTongues_Timer = 18000; + } else CurseOfTongues_Timer -= diff; + + //CurseOfWeakness_Timer + if (CurseOfWeakness_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_CURSEOFWEAKNESS); + CurseOfWeakness_Timer = 45000; + } else CurseOfWeakness_Timer -= diff; + + //DemonArmor_Timer + if (DemonArmor_Timer <= diff) + { + DoCast(me, SPELL_DEMONARMOR); + DemonArmor_Timer = 300000; + } else DemonArmor_Timer -= diff; + + //EnvelopingWeb_Timer + if (EnvelopingWeb_Timer <= diff) + { + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) + DoCast(pTarget, SPELL_ENVELOPINGWEB); + EnvelopingWeb_Timer = 12000; + } else EnvelopingWeb_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_anubshiah(Creature* pCreature) +{ + return new boss_anubshiahAI (pCreature); +} + +void AddSC_boss_anubshiah() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_anubshiah"; + newscript->GetAI = &GetAI_boss_anubshiah; + newscript->RegisterSelf(); +} diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp new file mode 100644 index 00000000000..29fe219d6ec --- /dev/null +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp @@ -0,0 +1,111 @@ +/* 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_Emperor_Dagran_Thaurissan +SD%Complete: 99 +SDComment: +SDCategory: Blackrock Depths +EndScriptData */ + +#include "ScriptedPch.h" + +enum Yells +{ + SAY_AGGRO = -1230001, + SAY_SLAY = -1230002 +}; + +enum Spells +{ + SPELL_HANDOFTHAURISSAN = 17492, + SPELL_AVATAROFFLAME = 15636 +}; + +struct boss_draganthaurissanAI : public ScriptedAI +{ + boss_draganthaurissanAI(Creature *c) : ScriptedAI(c) {} + + uint32 HandOfThaurissan_Timer; + uint32 AvatarOfFlame_Timer; + //uint32 Counter; + + void Reset() + { + HandOfThaurissan_Timer = 4000; + AvatarOfFlame_Timer = 25000; + //Counter= 0; + } + + void EnterCombat(Unit * /*who*/) + { + DoScriptText(SAY_AGGRO, me); + me->CallForHelp(VISIBLE_RANGE); + } + + void KilledUnit(Unit* /*victim*/) + { + DoScriptText(SAY_SLAY, me); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + if (HandOfThaurissan_Timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(pTarget, SPELL_HANDOFTHAURISSAN); + + //3 Hands of Thaurissan will be casted + //if (Counter < 3) + //{ + // HandOfThaurissan_Timer = 1000; + // ++Counter; + //} + //else + //{ + HandOfThaurissan_Timer = 5000; + //Counter = 0; + //} + } else HandOfThaurissan_Timer -= diff; + + //AvatarOfFlame_Timer + if (AvatarOfFlame_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_AVATAROFFLAME); + AvatarOfFlame_Timer = 18000; + } else AvatarOfFlame_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_draganthaurissan(Creature* pCreature) +{ + return new boss_draganthaurissanAI (pCreature); +} + +void AddSC_boss_draganthaurissan() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_emperor_dagran_thaurissan"; + newscript->GetAI = &GetAI_boss_draganthaurissan; + newscript->RegisterSelf(); +} diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_general_angerforge.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_general_angerforge.cpp new file mode 100644 index 00000000000..77d69263133 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_general_angerforge.cpp @@ -0,0 +1,132 @@ +/* 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_General_Angerforge +SD%Complete: 100 +SDComment: +SDCategory: Blackrock Depths +EndScriptData */ + +#include "ScriptedPch.h" + +enum Spells +{ + SPELL_MIGHTYBLOW = 14099, + SPELL_HAMSTRING = 9080, + SPELL_CLEAVE = 20691 +}; + +struct boss_general_angerforgeAI : public ScriptedAI +{ + boss_general_angerforgeAI(Creature *c) : ScriptedAI(c) {} + + uint32 MightyBlow_Timer; + uint32 HamString_Timer; + uint32 Cleave_Timer; + uint32 Adds_Timer; + bool Medics; + + void Reset() + { + MightyBlow_Timer = 8000; + HamString_Timer = 12000; + Cleave_Timer = 16000; + Adds_Timer = 0; + Medics = false; + } + + void EnterCombat(Unit * /*who*/) + { + } + + void SummonAdds(Unit* victim) + { + if (Creature *SummonedAdd = DoSpawnCreature(8901, irand(-14,14), irand(-14,14), 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 120000)) + SummonedAdd->AI()->AttackStart(victim); + } + + void SummonMedics(Unit* victim) + { + if (Creature *SummonedMedic = DoSpawnCreature(8894, irand(-9,9), irand(-9,9), 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 120000)) + SummonedMedic->AI()->AttackStart(victim); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //MightyBlow_Timer + if (MightyBlow_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_MIGHTYBLOW); + MightyBlow_Timer = 18000; + } else MightyBlow_Timer -= diff; + + //HamString_Timer + if (HamString_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_HAMSTRING); + HamString_Timer = 15000; + } else HamString_Timer -= diff; + + //Cleave_Timer + if (Cleave_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_CLEAVE); + Cleave_Timer = 9000; + } else Cleave_Timer -= diff; + + //Adds_Timer + if (me->GetHealth()*100 / me->GetMaxHealth() < 21) + { + if (Adds_Timer <= diff) + { + // summon 3 Adds every 25s + SummonAdds(me->getVictim()); + SummonAdds(me->getVictim()); + SummonAdds(me->getVictim()); + + Adds_Timer = 25000; + } else Adds_Timer -= diff; + } + + //Summon Medics + if (!Medics && me->GetHealth()*100 / me->GetMaxHealth() < 21) + { + SummonMedics(me->getVictim()); + SummonMedics(me->getVictim()); + Medics = true; + } + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_general_angerforge(Creature* pCreature) +{ + return new boss_general_angerforgeAI (pCreature); +} + +void AddSC_boss_general_angerforge() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_general_angerforge"; + newscript->GetAI = &GetAI_boss_general_angerforge; + newscript->RegisterSelf(); +} diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_gorosh_the_dervish.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_gorosh_the_dervish.cpp new file mode 100644 index 00000000000..886bc3fc909 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_gorosh_the_dervish.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: Boss_Gorosh_the_Dervish +SD%Complete: 100 +SDComment: +SDCategory: Blackrock Depths +EndScriptData */ + +#include "ScriptedPch.h" + +enum Spells +{ + SPELL_WHIRLWIND = 15589, + SPELL_MORTALSTRIKE = 24573 +}; + +struct boss_gorosh_the_dervishAI : public ScriptedAI +{ + boss_gorosh_the_dervishAI(Creature *c) : ScriptedAI(c) {} + + uint32 WhirlWind_Timer; + uint32 MortalStrike_Timer; + + void Reset() + { + WhirlWind_Timer = 12000; + MortalStrike_Timer = 22000; + } + + void EnterCombat(Unit * /*who*/) + { + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //WhirlWind_Timer + if (WhirlWind_Timer <= diff) + { + DoCast(me, SPELL_WHIRLWIND); + WhirlWind_Timer = 15000; + } else WhirlWind_Timer -= diff; + + //MortalStrike_Timer + if (MortalStrike_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_MORTALSTRIKE); + MortalStrike_Timer = 15000; + } else MortalStrike_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_gorosh_the_dervish(Creature* pCreature) +{ + return new boss_gorosh_the_dervishAI (pCreature); +} + +void AddSC_boss_gorosh_the_dervish() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_gorosh_the_dervish"; + newscript->GetAI = &GetAI_boss_gorosh_the_dervish; + newscript->RegisterSelf(); +} diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_grizzle.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_grizzle.cpp new file mode 100644 index 00000000000..d3551d38790 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_grizzle.cpp @@ -0,0 +1,94 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 .sourceforge.net/> + * 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_Grizzle +SD%Complete: 100 +SDComment: +SDCategory: Blackrock Depths +EndScriptData */ + +#include "ScriptedPch.h" + +enum Yells +{ + EMOTE_GENERIC_FRENZY_KILL = -1000001 +}; + +enum Spells +{ + SPELL_GROUNDTREMOR = 6524, + SPELL_FRENZY = 28371 +}; + +struct boss_grizzleAI : public ScriptedAI +{ + boss_grizzleAI(Creature *c) : ScriptedAI(c) {} + + uint32 GroundTremor_Timer; + uint32 Frenzy_Timer; + + void Reset() + { + GroundTremor_Timer = 12000; + Frenzy_Timer =0; + } + + void EnterCombat(Unit * /*who*/) + { + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //GroundTremor_Timer + if (GroundTremor_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_GROUNDTREMOR); + GroundTremor_Timer = 8000; + } else GroundTremor_Timer -= diff; + + //Frenzy_Timer + if (me->GetHealth()*100 / me->GetMaxHealth() < 51) + { + if (Frenzy_Timer <= diff) + { + DoCast(me, SPELL_FRENZY); + DoScriptText(EMOTE_GENERIC_FRENZY_KILL, me); + + Frenzy_Timer = 15000; + } else Frenzy_Timer -= diff; + } + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_grizzle(Creature* pCreature) +{ + return new boss_grizzleAI (pCreature); +} + +void AddSC_boss_grizzle() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_grizzle"; + newscript->GetAI = &GetAI_boss_grizzle; + newscript->RegisterSelf(); +} diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_high_interrogator_gerstahn.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_high_interrogator_gerstahn.cpp new file mode 100644 index 00000000000..2af203826a1 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_high_interrogator_gerstahn.cpp @@ -0,0 +1,106 @@ +/* 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_Interrogator_Gerstahn +SD%Complete: 100 +SDComment: +SDCategory: Blackrock Depths +EndScriptData */ + +#include "ScriptedPch.h" + +enum Spells +{ + SPELL_SHADOWWORDPAIN = 10894, + SPELL_MANABURN = 10876, + SPELL_PSYCHICSCREAM = 8122, + SPELL_SHADOWSHIELD = 22417 +}; + +struct boss_high_interrogator_gerstahnAI : public ScriptedAI +{ + boss_high_interrogator_gerstahnAI(Creature *c) : ScriptedAI(c) {} + + uint32 ShadowWordPain_Timer; + uint32 ManaBurn_Timer; + uint32 PsychicScream_Timer; + uint32 ShadowShield_Timer; + + void Reset() + { + ShadowWordPain_Timer = 4000; + ManaBurn_Timer = 14000; + PsychicScream_Timer = 32000; + ShadowShield_Timer = 8000; + } + + void EnterCombat(Unit * /*who*/) + { + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //ShadowWordPain_Timer + if (ShadowWordPain_Timer <= diff) + { + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) + DoCast(pTarget, SPELL_SHADOWWORDPAIN); + ShadowWordPain_Timer = 7000; + } else ShadowWordPain_Timer -= diff; + + //ManaBurn_Timer + if (ManaBurn_Timer <= diff) + { + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) + DoCast(pTarget, SPELL_MANABURN); + ManaBurn_Timer = 10000; + } else ManaBurn_Timer -= diff; + + //PsychicScream_Timer + if (PsychicScream_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_PSYCHICSCREAM); + PsychicScream_Timer = 30000; + } else PsychicScream_Timer -= diff; + + //ShadowShield_Timer + if (ShadowShield_Timer <= diff) + { + DoCast(me, SPELL_SHADOWSHIELD); + ShadowShield_Timer = 25000; + } else ShadowShield_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_high_interrogator_gerstahn(Creature* pCreature) +{ + return new boss_high_interrogator_gerstahnAI (pCreature); +} + +void AddSC_boss_high_interrogator_gerstahn() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_high_interrogator_gerstahn"; + newscript->GetAI = &GetAI_boss_high_interrogator_gerstahn; + newscript->RegisterSelf(); +} diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_magmus.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_magmus.cpp new file mode 100644 index 00000000000..2a0cf9be133 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_magmus.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: Boss_Magmus +SD%Complete: 100 +SDComment: +SDCategory: Blackrock Depths +EndScriptData */ + +#include "ScriptedPch.h" + +enum Spells +{ + SPELL_FIERYBURST = 13900, + SPELL_WARSTOMP = 24375 +}; + +enum eEnums +{ + DATA_THRONE_DOOR = 24 // not id or guid of doors but number of enum in blackrock_depths.h +}; + +struct boss_magmusAI : public ScriptedAI +{ + boss_magmusAI(Creature *c) : ScriptedAI(c) {} + + uint32 FieryBurst_Timer; + uint32 WarStomp_Timer; + + void Reset() + { + FieryBurst_Timer = 5000; + WarStomp_Timer =0; + } + + void EnterCombat(Unit * /*who*/) + { + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //FieryBurst_Timer + if (FieryBurst_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_FIERYBURST); + FieryBurst_Timer = 6000; + } else FieryBurst_Timer -= diff; + + //WarStomp_Timer + if (me->GetHealth()*100 / me->GetMaxHealth() < 51) + { + if (WarStomp_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_WARSTOMP); + WarStomp_Timer = 8000; + } else WarStomp_Timer -= diff; + } + + DoMeleeAttackIfReady(); + } + // When he die open door to last chamber + void JustDied(Unit *who) + { + if (ScriptedInstance* pInstance = who->GetInstanceData()) + pInstance->HandleGameObject(pInstance->GetData64(DATA_THRONE_DOOR), true); + } +}; +CreatureAI* GetAI_boss_magmus(Creature* pCreature) +{ + return new boss_magmusAI (pCreature); +} + +void AddSC_boss_magmus() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_magmus"; + newscript->GetAI = &GetAI_boss_magmus; + newscript->RegisterSelf(); +} diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_moira_bronzebeard.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_moira_bronzebeard.cpp new file mode 100644 index 00000000000..1c0ed389287 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_moira_bronzebeard.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: Boss_Moira_Bronzbeard +SD%Complete: 90 +SDComment: Healing of Emperor NYI +SDCategory: Blackrock Depths +EndScriptData */ + +#include "ScriptedPch.h" + +enum Spells +{ + SPELL_HEAL = 10917, + SPELL_RENEW = 10929, + SPELL_SHIELD = 10901, + SPELL_MINDBLAST = 10947, + SPELL_SHADOWWORDPAIN = 10894, + SPELL_SMITE = 10934 +}; + +struct boss_moira_bronzebeardAI : public ScriptedAI +{ + boss_moira_bronzebeardAI(Creature *c) : ScriptedAI(c) {} + + uint32 Heal_Timer; + uint32 MindBlast_Timer; + uint32 ShadowWordPain_Timer; + uint32 Smite_Timer; + + void Reset() + { + Heal_Timer = 12000; //These times are probably wrong + MindBlast_Timer = 16000; + ShadowWordPain_Timer = 2000; + Smite_Timer = 8000; + } + + void EnterCombat(Unit * /*who*/) + { + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //MindBlast_Timer + if (MindBlast_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_MINDBLAST); + MindBlast_Timer = 14000; + } else MindBlast_Timer -= diff; + + //ShadowWordPain_Timer + if (ShadowWordPain_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_SHADOWWORDPAIN); + ShadowWordPain_Timer = 18000; + } else ShadowWordPain_Timer -= diff; + + //Smite_Timer + if (Smite_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_SMITE); + Smite_Timer = 10000; + } else Smite_Timer -= diff; + + } +}; +CreatureAI* GetAI_boss_moira_bronzebeard(Creature* pCreature) +{ + return new boss_moira_bronzebeardAI (pCreature); +} + +void AddSC_boss_moira_bronzebeard() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_moira_bronzebeard"; + newscript->GetAI = &GetAI_boss_moira_bronzebeard; + newscript->RegisterSelf(); +} diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_tomb_of_seven.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_tomb_of_seven.cpp new file mode 100644 index 00000000000..94a37e8da7e --- /dev/null +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_tomb_of_seven.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: Boss_Tomb_Of_Seven +SD%Complete: 90 +SDComment: Learning Smelt Dark Iron if tribute quest rewarded. Missing event. +SDCategory: Blackrock Depths +EndScriptData */ + +#include "ScriptedPch.h" +#include "blackrock_depths.h" + +enum Spells +{ + SPELL_SMELT_DARK_IRON = 14891, + SPELL_LEARN_SMELT = 14894, +}; + +enum Quests +{ + QUEST_SPECTRAL_CHALICE = 4083 +}; + +enum Misc +{ + DATA_SKILLPOINT_MIN = 230 +}; + +#define GOSSIP_ITEM_TEACH_1 "Teach me the art of smelting dark iron" +#define GOSSIP_ITEM_TEACH_2 "Continue..." +#define GOSSIP_ITEM_TEACH_3 "[PH] Continue..." +#define GOSSIP_ITEM_TRIBUTE "I want to pay tribute" + +bool GossipHello_boss_gloomrel(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetQuestRewardStatus(QUEST_SPECTRAL_CHALICE) == 1 && pPlayer->GetSkillValue(SKILL_MINING) >= DATA_SKILLPOINT_MIN && !pPlayer->HasSpell(SPELL_SMELT_DARK_IRON)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TEACH_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + + if (pPlayer->GetQuestRewardStatus(QUEST_SPECTRAL_CHALICE) == 0 && pPlayer->GetSkillValue(SKILL_MINING) >= DATA_SKILLPOINT_MIN) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TRIBUTE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_boss_gloomrel(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction) +{ + switch (uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TEACH_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11); + pPlayer->SEND_GOSSIP_MENU(2606, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+11: + pPlayer->CLOSE_GOSSIP_MENU(); + pCreature->CastSpell(pPlayer, SPELL_LEARN_SMELT, false); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TEACH_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 22); + pPlayer->SEND_GOSSIP_MENU(2604, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+22: + pPlayer->CLOSE_GOSSIP_MENU(); + if (ScriptedInstance* pInstance = pCreature->GetInstanceData()) + { + //are 5 minutes expected? go template may have data to despawn when used at quest + pInstance->DoRespawnGameObject(pInstance->GetData64(DATA_GO_CHALICE),MINUTE*5); + } + break; + } + return true; +} + +enum DoomrelSpells +{ + SPELL_SHADOWBOLTVOLLEY = 15245, + SPELL_IMMOLATE = 12742, + SPELL_CURSEOFWEAKNESS = 12493, + SPELL_DEMONARMOR = 13787, + SPELL_SUMMON_VOIDWALKERS = 15092 +}; + +struct boss_doomrelAI : public ScriptedAI +{ + boss_doomrelAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + uint32 ShadowVolley_Timer; + uint32 Immolate_Timer; + uint32 CurseOfWeakness_Timer; + uint32 DemonArmor_Timer; + bool Voidwalkers; + + void Reset() + { + ShadowVolley_Timer = 10000; + Immolate_Timer = 18000; + CurseOfWeakness_Timer = 5000; + DemonArmor_Timer = 16000; + Voidwalkers = false; + + me->setFaction(FACTION_FRIEND); + + // was set before event start, so set again + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + + if (pInstance) + if (pInstance->GetData(DATA_GHOSTKILL) >= 7) + me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE); + else + me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + } + + void EnterCombat(Unit * /*who*/) + { + } + + void EnterEvadeMode() + { + me->RemoveAllAuras(); + me->DeleteThreatList(); + me->CombatStop(true); + me->LoadCreaturesAddon(); + if (me->isAlive()) + me->GetMotionMaster()->MoveTargetedHome(); + me->SetLootRecipient(NULL); + if (pInstance) + pInstance->SetData64(DATA_EVENSTARTER, 0); + } + + void JustDied(Unit * /*who*/) + { + if (pInstance) + pInstance->SetData(DATA_GHOSTKILL, 1); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //ShadowVolley_Timer + if (ShadowVolley_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_SHADOWBOLTVOLLEY); + ShadowVolley_Timer = 12000; + } else ShadowVolley_Timer -= diff; + + //Immolate_Timer + if (Immolate_Timer <= diff) + { + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) + DoCast(pTarget, SPELL_IMMOLATE); + + Immolate_Timer = 25000; + } else Immolate_Timer -= diff; + + //CurseOfWeakness_Timer + if (CurseOfWeakness_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_CURSEOFWEAKNESS); + CurseOfWeakness_Timer = 45000; + } else CurseOfWeakness_Timer -= diff; + + //DemonArmor_Timer + if (DemonArmor_Timer <= diff) + { + DoCast(me, SPELL_DEMONARMOR); + DemonArmor_Timer = 300000; + } else DemonArmor_Timer -= diff; + + //Summon Voidwalkers + if (!Voidwalkers && me->GetHealth()*100 / me->GetMaxHealth() < 51) + { + DoCast(me->getVictim(), SPELL_SUMMON_VOIDWALKERS, true); + Voidwalkers = true; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_doomrel(Creature* pCreature) +{ + return new boss_doomrelAI (pCreature); +} + +#define GOSSIP_ITEM_CHALLENGE "Your bondage is at an end, Doom'rel. I challenge you!" +#define GOSSIP_SELECT_DOOMREL "[PH] Continue..." + +bool GossipHello_boss_doomrel(Player* pPlayer, Creature* pCreature) +{ + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_CHALLENGE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + pPlayer->SEND_GOSSIP_MENU(2601, pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_boss_doomrel(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction) +{ + switch (uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_DOOMREL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + pPlayer->SEND_GOSSIP_MENU(2605, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->CLOSE_GOSSIP_MENU(); + //start event here + pCreature->setFaction(FACTION_HOSTILE); + pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + pCreature->AI()->AttackStart(pPlayer); + ScriptedInstance* pInstance = pCreature->GetInstanceData(); + if (pInstance) + pInstance->SetData64(DATA_EVENSTARTER,pPlayer->GetGUID()); + break; + } + return true; +} + +void AddSC_boss_tomb_of_seven() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_gloomrel"; + newscript->pGossipHello = &GossipHello_boss_gloomrel; + newscript->pGossipSelect = &GossipSelect_boss_gloomrel; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_doomrel"; + newscript->GetAI = &GetAI_boss_doomrel; + newscript->pGossipHello = &GossipHello_boss_doomrel; + newscript->pGossipSelect = &GossipSelect_boss_doomrel; + newscript->RegisterSelf(); +} diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/instance_blackrock_depths.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/instance_blackrock_depths.cpp new file mode 100644 index 00000000000..7684aa6c6ac --- /dev/null +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/instance_blackrock_depths.cpp @@ -0,0 +1,460 @@ +/* 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_Blackrock_Depths +SD%Complete: 100 +SDComment: +SDCategory: Blackrock Depths +EndScriptData */ + +/* +update `creature_template` set `npcflag`='1',`ScriptName`='npc_dughal_stormwing' where `entry`='9022'; +update `creature_template` set `ScriptName`='npc_marshal_windsor' where `entry`='9023'; +update `creature_template` set `ScriptName`='npc_marshal_reginald_windsor' where `entry`='9682'; +update `creature_template` set `npcflag`='1',`ScriptName`='npc_tobias_seecher' where `entry`='9679'; +update `instance_template` set `script`='instance_blackrock_depths' where `map`='230'; +*/ + +#include "ScriptedPch.h" +#include "blackrock_depths.h" + +#define TIMER_TOMBOFTHESEVEN 15000 + +enum eEnums +{ + MAX_ENCOUNTER = 6, + + NPC_EMPEROR = 9019, + NPC_PHALANX = 9502, + NPC_ANGERREL = 9035, + NPC_DOPEREL = 9040, + NPC_HATEREL = 9034, + NPC_VILEREL = 9036, + NPC_SEETHREL = 9038, + NPC_GLOOMREL = 9037, + NPC_DOOMREL = 9039, + NPC_MAGMUS = 9938, + + GO_ARENA1 = 161525, + GO_ARENA2 = 161522, + GO_ARENA3 = 161524, + GO_ARENA4 = 161523, + GO_SHADOW_LOCK = 161460, + GO_SHADOW_MECHANISM = 161461, + GO_SHADOW_GIANT_DOOR = 157923, + GO_SHADOW_DUMMY = 161516, + GO_BAR_KEG_SHOT = 170607, + GO_BAR_KEG_TRAP = 171941, + GO_BAR_DOOR = 170571, + GO_TOMB_ENTER = 170576, + GO_TOMB_EXIT = 170577, + GO_LYCEUM = 170558, + GO_SF_N = 174745, // Shadowforge Brazier North + GO_SF_S = 174744, // Shadowforge Brazier South + GO_GOLEM_ROOM_N = 170573, // Magmus door North + GO_GOLEM_ROOM_S = 170574, // Magmus door Soutsh + GO_THRONE_ROOM = 170575, // Throne door + + GO_SPECTRAL_CHALICE = 164869, + GO_CHEST_SEVEN = 169243 +}; + +struct instance_blackrock_depths : public ScriptedInstance +{ + instance_blackrock_depths(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + std::string str_data; + + uint64 EmperorGUID; + uint64 PhalanxGUID; + uint64 MagmusGUID; + + uint64 GoArena1GUID; + uint64 GoArena2GUID; + uint64 GoArena3GUID; + uint64 GoArena4GUID; + uint64 GoShadowLockGUID; + uint64 GoShadowMechGUID; + uint64 GoShadowGiantGUID; + uint64 GoShadowDummyGUID; + uint64 GoBarKegGUID; + uint64 GoBarKegTrapGUID; + uint64 GoBarDoorGUID; + uint64 GoTombEnterGUID; + uint64 GoTombExitGUID; + uint64 GoLyceumGUID; + uint64 GoSFSGUID; + uint64 GoSFNGUID; + uint64 GoGolemNGUID; + uint64 GoGolemSGUID; + uint64 GoThroneGUID; + uint64 GoChestGUID; + + uint32 BarAleCount; + uint32 GhostKillCount; + uint64 TombBossGUIDs[7]; + uint64 TombEventStarterGUID; + uint32 TombTimer; + uint32 TombEventCounter; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + EmperorGUID = 0; + PhalanxGUID = 0; + MagmusGUID = 0; + + GoArena1GUID = 0; + GoArena2GUID = 0; + GoArena3GUID = 0; + GoArena4GUID = 0; + GoShadowLockGUID = 0; + GoShadowMechGUID = 0; + GoShadowGiantGUID = 0; + GoShadowDummyGUID = 0; + GoBarKegGUID = 0; + GoBarKegTrapGUID = 0; + GoBarDoorGUID = 0; + GoTombEnterGUID = 0; + GoTombExitGUID = 0; + GoLyceumGUID = 0; + GoSFSGUID = 0; + GoSFNGUID = 0; + GoGolemNGUID = 0; + GoGolemSGUID = 0; + GoThroneGUID = 0; + GoChestGUID = 0; + + BarAleCount = 0; + GhostKillCount = 0; + TombEventStarterGUID = 0; + TombTimer = TIMER_TOMBOFTHESEVEN; + TombEventCounter = 0; + + for (uint8 i = 0; i < 7; ++i) + TombBossGUIDs[i] = 0; + } + + void OnCreatureCreate(Creature* pCreature, bool /*add*/) + { + switch(pCreature->GetEntry()) + { + case NPC_EMPEROR: EmperorGUID = pCreature->GetGUID(); break; + case NPC_PHALANX: PhalanxGUID = pCreature->GetGUID(); break; + case NPC_DOOMREL: TombBossGUIDs[0] = pCreature->GetGUID(); break; + case NPC_DOPEREL: TombBossGUIDs[1] = pCreature->GetGUID(); break; + case NPC_HATEREL: TombBossGUIDs[2] = pCreature->GetGUID(); break; + case NPC_VILEREL: TombBossGUIDs[3] = pCreature->GetGUID(); break; + case NPC_SEETHREL: TombBossGUIDs[4] = pCreature->GetGUID(); break; + case NPC_GLOOMREL: TombBossGUIDs[5] = pCreature->GetGUID(); break; + case NPC_ANGERREL: TombBossGUIDs[6] = pCreature->GetGUID(); break; + case NPC_MAGMUS: + MagmusGUID = pCreature->GetGUID(); + if (!pCreature->isAlive()) + HandleGameObject(GetData64(DATA_THRONE_DOOR), true); // if Magmus is dead open door to last boss + break; + } + } + + void OnGameObjectCreate(GameObject* pGo, bool /*add*/) + { + switch(pGo->GetEntry()) + { + case GO_ARENA1: GoArena1GUID = pGo->GetGUID(); break; + case GO_ARENA2: GoArena2GUID = pGo->GetGUID(); break; + case GO_ARENA3: GoArena3GUID = pGo->GetGUID(); break; + case GO_ARENA4: GoArena4GUID = pGo->GetGUID(); break; + case GO_SHADOW_LOCK: GoShadowLockGUID = pGo->GetGUID(); break; + case GO_SHADOW_MECHANISM: GoShadowMechGUID = pGo->GetGUID(); break; + case GO_SHADOW_GIANT_DOOR: GoShadowGiantGUID = pGo->GetGUID(); break; + case GO_SHADOW_DUMMY: GoShadowDummyGUID = pGo->GetGUID(); break; + case GO_BAR_KEG_SHOT: GoBarKegGUID = pGo->GetGUID(); break; + case GO_BAR_KEG_TRAP: GoBarKegTrapGUID = pGo->GetGUID(); break; + case GO_BAR_DOOR: GoBarDoorGUID = pGo->GetGUID(); break; + case GO_TOMB_ENTER: GoTombEnterGUID = pGo->GetGUID(); break; + case GO_TOMB_EXIT: + GoTombExitGUID = pGo->GetGUID(); + if (GhostKillCount >= 7) + HandleGameObject(0, true, pGo); + else + HandleGameObject(0, false, pGo); + break; + case GO_LYCEUM: GoLyceumGUID = pGo->GetGUID(); break; + case GO_SF_S: GoSFSGUID = pGo->GetGUID(); break; + case GO_SF_N: GoSFNGUID = pGo->GetGUID(); break; + case GO_GOLEM_ROOM_N: GoGolemNGUID = pGo->GetGUID(); break; + case GO_GOLEM_ROOM_S: GoGolemSGUID = pGo->GetGUID(); break; + case GO_THRONE_ROOM: GoThroneGUID = pGo->GetGUID(); break; + case GO_CHEST_SEVEN: GoChestGUID = pGo->GetGUID(); break; + } + } + + void SetData64(uint32 type, uint64 data) + { + debug_log("TSCR: Instance Blackrock Depths: SetData64 update (Type: %u Data %u)", type, data); + + switch(type) + { + case DATA_EVENSTARTER: + TombEventStarterGUID = data; + if (!TombEventStarterGUID) + TombOfSevenReset();//reset + else + TombOfSevenStart();//start + break; + } + } + + void SetData(uint32 type, uint32 data) + { + debug_log("TSCR: Instance Blackrock Depths: SetData update (Type: %u Data %u)", type, data); + + switch(type) + { + case TYPE_RING_OF_LAW: + m_auiEncounter[0] = data; + break; + case TYPE_VAULT: + m_auiEncounter[1] = data; + break; + case TYPE_BAR: + if (data == SPECIAL) + ++BarAleCount; + else + m_auiEncounter[2] = data; + break; + case TYPE_TOMB_OF_SEVEN: + m_auiEncounter[3] = data; + break; + case TYPE_LYCEUM: + m_auiEncounter[4] = data; + break; + case TYPE_IRON_HALL: + m_auiEncounter[5] = data; + break; + case DATA_GHOSTKILL: + GhostKillCount += data; + break; + } + + if (data == DONE || GhostKillCount >= 7) + { + 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] << " " << GhostKillCount; + + str_data = saveStream.str(); + + SaveToDB(); + OUT_SAVE_INST_DATA_COMPLETE; + } + } + + uint32 GetData(uint32 type) + { + switch(type) + { + case TYPE_RING_OF_LAW: + return m_auiEncounter[0]; + case TYPE_VAULT: + return m_auiEncounter[1]; + case TYPE_BAR: + if (m_auiEncounter[2] == IN_PROGRESS && BarAleCount == 3) + return SPECIAL; + else + return m_auiEncounter[2]; + case TYPE_TOMB_OF_SEVEN: + return m_auiEncounter[3]; + case TYPE_LYCEUM: + return m_auiEncounter[4]; + case TYPE_IRON_HALL: + return m_auiEncounter[5]; + case DATA_GHOSTKILL: + return GhostKillCount; + } + return 0; + } + + uint64 GetData64(uint32 data) + { + switch(data) + { + case DATA_EMPEROR: + return EmperorGUID; + case DATA_PHALANX: + return PhalanxGUID; + case DATA_ARENA1: + return GoArena1GUID; + case DATA_ARENA2: + return GoArena2GUID; + case DATA_ARENA3: + return GoArena3GUID; + case DATA_ARENA4: + return GoArena4GUID; + case DATA_GO_BAR_KEG: + return GoBarKegGUID; + case DATA_GO_BAR_KEG_TRAP: + return GoBarKegTrapGUID; + case DATA_GO_BAR_DOOR: + return GoBarDoorGUID; + case DATA_EVENSTARTER: + return TombEventStarterGUID; + case DATA_SF_BRAZIER_N: + return GoSFNGUID; + case DATA_SF_BRAZIER_S: + return GoSFSGUID; + case DATA_THRONE_DOOR: + return GoThroneGUID; + case DATA_GOLEM_DOOR_N: + return GoGolemNGUID; + case DATA_GOLEM_DOOR_S: + return GoGolemSGUID; + } + 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] >> GhostKillCount; + + for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) + m_auiEncounter[i] = NOT_STARTED; + if (GhostKillCount > 0 && GhostKillCount < 7) + GhostKillCount = 0;//reset tomb of seven event + if (GhostKillCount >= 7) + GhostKillCount = 7; + + OUT_LOAD_INST_DATA_COMPLETE; + } + + void TombOfSevenEvent() + { + if (GhostKillCount < 7 && TombBossGUIDs[TombEventCounter]) + { + if (Creature* boss = instance->GetCreature(TombBossGUIDs[TombEventCounter])) + { + boss->setFaction(FACTION_HOSTILE); + boss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + if (Unit *pTarget = boss->SelectNearestTarget(500)) + boss->AI()->AttackStart(pTarget); + } + } + } + + void TombOfSevenReset() + { + HandleGameObject(GoTombExitGUID,false);//event reseted, close exit door + HandleGameObject(GoTombEnterGUID,true);//event reseted, open entrance door + for (uint8 i = 0; i < 7; ++i) + { + if (Creature* boss = instance->GetCreature(TombBossGUIDs[i])) + { + if (!boss->isAlive()) + {//do not call EnterEvadeMode(), it will create infinit loops + boss->Respawn(); + boss->RemoveAllAuras(); + boss->DeleteThreatList(); + boss->CombatStop(true); + boss->LoadCreaturesAddon(); + boss->GetMotionMaster()->MoveTargetedHome(); + boss->SetLootRecipient(NULL); + } + boss->setFaction(FACTION_FRIEND); + } + } + GhostKillCount = 0; + TombEventStarterGUID = 0; + TombEventCounter = 0; + TombTimer = TIMER_TOMBOFTHESEVEN; + SetData(TYPE_TOMB_OF_SEVEN, NOT_STARTED); + } + + void TombOfSevenStart() + { + HandleGameObject(GoTombExitGUID,false);//event started, close exit door + HandleGameObject(GoTombEnterGUID,false);//event started, close entrance door + SetData(TYPE_TOMB_OF_SEVEN, IN_PROGRESS); + } + + void TombOfSevenEnd() + { + DoRespawnGameObject(GoChestGUID,DAY); + HandleGameObject(GoTombExitGUID,true);//event done, open exit door + HandleGameObject(GoTombEnterGUID,true);//event done, open entrance door + TombEventStarterGUID = 0; + SetData(TYPE_TOMB_OF_SEVEN, DONE); + } + void Update(uint32 diff) + { + if (TombEventStarterGUID && GhostKillCount < 7) + { + if (TombTimer <= diff) + { + TombTimer = TIMER_TOMBOFTHESEVEN; + ++TombEventCounter; + TombOfSevenEvent(); + // Check Killed bosses + for (uint8 i = 0; i < 7; ++i) + { + if (Creature* boss = instance->GetCreature(TombBossGUIDs[i])) + { + if (!boss->isAlive()) + { + GhostKillCount = i+1; + } + } + } + } else TombTimer -= diff; + } + if (GhostKillCount >= 7 && TombEventStarterGUID) + TombOfSevenEnd(); + } +}; + +InstanceData* GetInstanceData_instance_blackrock_depths(Map* pMap) +{ + return new instance_blackrock_depths(pMap); +} + + void AddSC_instance_blackrock_depths() + { + Script *newscript; + newscript = new Script; + newscript->Name = "instance_blackrock_depths"; + newscript->GetInstanceData = &GetInstanceData_instance_blackrock_depths; + newscript->RegisterSelf(); + } diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/blackrock_spire.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/blackrock_spire.cpp new file mode 100644 index 00000000000..2ea115e6e0b --- /dev/null +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/blackrock_spire.cpp @@ -0,0 +1,77 @@ +/* Copyright (C) 2008 - 2010 TrinityCore + * 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 + */ + +#include "ScriptedPch.h" +#include "blackrock_spire.h" + +enum Creatures +{ + NPC_ROOKERY_WHELP = 10161 +}; + +struct npc_rookey_whelpAI : public ScriptedAI +{ + npc_rookey_whelpAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + void JustDied(Unit * /*who*/) + { + if (pInstance) + pInstance->SetData(WHELP_DEATH_COUNT, pInstance->GetData(WHELP_DEATH_COUNT)+1); + } + + void UpdateAI(const uint32 /*diff*/) + { + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_rookey_whelp(Creature* pCreature) +{ + return new npc_rookey_whelpAI(pCreature); +} + +bool GOHello_rookey_egg(Player *pPlayer, GameObject * /*pGO*/) +{ + Position pos; + pPlayer->GetPosition(&pos); + pPlayer->SummonCreature(NPC_ROOKERY_WHELP, pos, TEMPSUMMON_TIMED_DESPAWN, 15*IN_MILISECONDS); + //destroy gobject need to be implemented + + return true; +}; + +void AddSC_blackrock_spire() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_rookey_whelp"; + newscript->GetAI = &GetAI_rookey_whelp; + newscript->RegisterSelf(); + newscript = new Script; + + newscript->Name = "go_rookey_egg"; + newscript->pGOHello = &GOHello_rookey_egg; + newscript->RegisterSelf(); +} diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/blackrock_spire.h b/src/server/scripts/EasternKingdoms/BlackrockSpire/blackrock_spire.h new file mode 100644 index 00000000000..56b6e0cbe23 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/blackrock_spire.h @@ -0,0 +1,26 @@ +/* Copyright (C) 2008 - 2010 TrinityCore + * 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 + */ + +#ifndef DEF_BRS_H +#define DEF_BRS_H + +enum Data +{ + EVENT_LEEEROY, + WHELP_DEATH_COUNT +}; + +#endif diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_drakkisath.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_drakkisath.cpp new file mode 100644 index 00000000000..b53ddaf23ef --- /dev/null +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_drakkisath.cpp @@ -0,0 +1,102 @@ +/* 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_Drakkisath +SD%Complete: 100 +SDComment: +SDCategory: Blackrock Spire +EndScriptData */ + +#include "ScriptedPch.h" + +#define SPELL_FIRENOVA 23462 +#define SPELL_CLEAVE 20691 +#define SPELL_CONFLIGURATION 16805 +#define SPELL_THUNDERCLAP 15548 //Not sure if right ID. 23931 would be a harder possibility. + +struct boss_drakkisathAI : public ScriptedAI +{ + boss_drakkisathAI(Creature *c) : ScriptedAI(c) {} + + uint32 FireNova_Timer; + uint32 Cleave_Timer; + uint32 Confliguration_Timer; + uint32 Thunderclap_Timer; + + void Reset() + { + FireNova_Timer = 6000; + Cleave_Timer = 8000; + Confliguration_Timer = 15000; + Thunderclap_Timer = 17000; + } + + void EnterCombat(Unit * /*who*/) + { + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //FireNova_Timer + if (FireNova_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_FIRENOVA); + FireNova_Timer = 10000; + } else FireNova_Timer -= diff; + + //Cleave_Timer + if (Cleave_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_CLEAVE); + Cleave_Timer = 8000; + } else Cleave_Timer -= diff; + + //Confliguration_Timer + if (Confliguration_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_CONFLIGURATION); + Confliguration_Timer = 18000; + } else Confliguration_Timer -= diff; + + //Thunderclap_Timer + if (Thunderclap_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_THUNDERCLAP); + Thunderclap_Timer = 20000; + } else Thunderclap_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_drakkisath(Creature* pCreature) +{ + return new boss_drakkisathAI (pCreature); +} + +void AddSC_boss_drakkisath() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_drakkisath"; + newscript->GetAI = &GetAI_boss_drakkisath; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_gyth.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_gyth.cpp new file mode 100644 index 00000000000..fcd2ea1a6d0 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_gyth.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_Gyth +SD%Complete: 100 +SDComment: +SDCategory: Blackrock Spire +EndScriptData */ + +#include "ScriptedPch.h" + +#define SPELL_CORROSIVEACID 20667 +#define SPELL_FREEZE 18763 +#define SPELL_FLAMEBREATH 20712 + +struct boss_gythAI : public ScriptedAI +{ + boss_gythAI(Creature *c) : ScriptedAI(c) {} + + uint32 Aggro_Timer; + uint32 Dragons_Timer; + uint32 Orc_Timer; + uint32 CorrosiveAcid_Timer; + uint32 Freeze_Timer; + uint32 Flamebreath_Timer; + uint32 Line1Count; + uint32 Line2Count; + + bool Event; + bool SummonedDragons; + bool SummonedOrcs; + bool SummonedRend; + bool bAggro; + bool RootSelf; + + void Reset() + { + Dragons_Timer = 3000; + Orc_Timer = 60000; + Aggro_Timer = 60000; + CorrosiveAcid_Timer = 8000; + Freeze_Timer = 11000; + Flamebreath_Timer = 4000; + Event = false; + SummonedDragons = false; + SummonedOrcs= false; + SummonedRend = false; + bAggro = false; + RootSelf = false; + + // how many times should the two lines of summoned creatures be spawned + // min 2 x 2, max 7 lines of attack in total + Line1Count = rand() % 4 + 2; + if (Line1Count < 5) + Line2Count = rand() % (5 - Line1Count) + 2; + else + Line2Count = 2; + + //Invisible for event start + me->SetDisplayId(11686); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + } + + void EnterCombat(Unit * /*who*/) + { + } + + void SummonCreatureWithRandomTarget(uint32 creatureId) + { + Unit* Summoned = me->SummonCreature(creatureId, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 240000); + if (Summoned) + { + Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (pTarget) + Summoned->AddThreat(pTarget, 1.0f); + } + } + + void UpdateAI(const uint32 diff) + { + //char buf[200]; + + //Return since we have no target + if (!UpdateVictim()) + return; + + if (!RootSelf) + { + //me->m_canMove = true; + DoCast(me, 33356); + RootSelf = true; + } + + if (!bAggro && Line1Count == 0 && Line2Count == 0) + { + if (Aggro_Timer <= diff) + { + bAggro = true; + // Visible now! + me->SetDisplayId(9723); + me->setFaction(14); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + } else Aggro_Timer -= diff; + } + + // Summon Dragon pack. 2 Dragons and 3 Whelps + if (!bAggro && !SummonedRend && Line1Count > 0) + { + if (Dragons_Timer <= diff) + { + SummonCreatureWithRandomTarget(10372); + SummonCreatureWithRandomTarget(10372); + SummonCreatureWithRandomTarget(10442); + SummonCreatureWithRandomTarget(10442); + SummonCreatureWithRandomTarget(10442); + Line1Count = Line1Count - 1; + Dragons_Timer = 60000; + } else Dragons_Timer -= diff; + } + + //Summon Orc pack. 1 Orc Handler 1 Elite Dragonkin and 3 Whelps + if (!bAggro && !SummonedRend && Line1Count == 0 && Line2Count > 0) + { + if (Orc_Timer <= diff) + { + SummonCreatureWithRandomTarget(10447); + SummonCreatureWithRandomTarget(10317); + SummonCreatureWithRandomTarget(10442); + SummonCreatureWithRandomTarget(10442); + SummonCreatureWithRandomTarget(10442); + Line2Count = Line2Count - 1; + Orc_Timer = 60000; + } else Orc_Timer -= diff; + } + + // we take part in the fight + if (bAggro) + { + // CorrosiveAcid_Timer + if (CorrosiveAcid_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_CORROSIVEACID); + CorrosiveAcid_Timer = 7000; + } else CorrosiveAcid_Timer -= diff; + + // Freeze_Timer + if (Freeze_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_FREEZE); + Freeze_Timer = 16000; + } else Freeze_Timer -= diff; + + // Flamebreath_Timer + if (Flamebreath_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_FLAMEBREATH); + Flamebreath_Timer = 10500; + } else Flamebreath_Timer -= diff; + + //Summon Rend + if (!SummonedRend && me->GetHealth()*100 / me->GetMaxHealth() < 11 + && me->GetHealth() > 0) + { + //summon Rend and Change model to normal Gyth + //Inturrupt any spell casting + me->InterruptNonMeleeSpells(false); + //Gyth model + me->SetDisplayId(9806); + me->SummonCreature(10429, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 900000); + SummonedRend = true; + } + + DoMeleeAttackIfReady(); + } // end if Aggro + } +}; + +CreatureAI* GetAI_boss_gyth(Creature* pCreature) +{ + return new boss_gythAI (pCreature); +} + +void AddSC_boss_gyth() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_gyth"; + newscript->GetAI = &GetAI_boss_gyth; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_halycon.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_halycon.cpp new file mode 100644 index 00000000000..9e78667717a --- /dev/null +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_halycon.cpp @@ -0,0 +1,96 @@ +/* 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_Halycon +SD%Complete: 100 +SDComment: +SDCategory: Blackrock Spire +EndScriptData */ + +#include "ScriptedPch.h" + +#define SPELL_CROWDPUMMEL 10887 +#define SPELL_MIGHTYBLOW 14099 + +#define ADD_1X -169.839203 +#define ADD_1Y -324.961395 +#define ADD_1Z 64.401443 +#define ADD_1O 3.124724 + +struct boss_halyconAI : public ScriptedAI +{ + boss_halyconAI(Creature *c) : ScriptedAI(c) {} + + uint32 CrowdPummel_Timer; + uint32 MightyBlow_Timer; + bool Summoned; + + void Reset() + { + CrowdPummel_Timer = 8000; + MightyBlow_Timer = 14000; + Summoned = false; + } + + void EnterCombat(Unit * /*who*/) + { + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //CrowdPummel_Timer + if (CrowdPummel_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_CROWDPUMMEL); + CrowdPummel_Timer = 14000; + } else CrowdPummel_Timer -= diff; + + //MightyBlow_Timer + if (MightyBlow_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_MIGHTYBLOW); + MightyBlow_Timer = 10000; + } else MightyBlow_Timer -= diff; + + //Summon Gizrul + if (!Summoned && me->GetHealth()*100 / me->GetMaxHealth() < 25) + { + me->SummonCreature(10268,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,300000); + Summoned = true; + } + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_halycon(Creature* pCreature) +{ + return new boss_halyconAI (pCreature); +} + +void AddSC_boss_halycon() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_halycon"; + newscript->GetAI = &GetAI_boss_halycon; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_highlord_omokk.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_highlord_omokk.cpp new file mode 100644 index 00000000000..65f1e8081a0 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_highlord_omokk.cpp @@ -0,0 +1,132 @@ +/* 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_Highlord_Omokk +SD%Complete: 100 +SDComment: +SDCategory: Blackrock Spire +EndScriptData */ + +#include "ScriptedPch.h" + +#define SPELL_WARSTOMP 24375 +#define SPELL_CLEAVE 15579 +#define SPELL_STRIKE 18368 +#define SPELL_REND 18106 +#define SPELL_SUNDERARMOR 24317 +#define SPELL_KNOCKAWAY 20686 +#define SPELL_SLOW 22356 + +struct boss_highlordomokkAI : public ScriptedAI +{ + boss_highlordomokkAI(Creature *c) : ScriptedAI(c) {} + + uint32 WarStomp_Timer; + uint32 Cleave_Timer; + uint32 Strike_Timer; + uint32 Rend_Timer; + uint32 SunderArmor_Timer; + uint32 KnockAway_Timer; + uint32 Slow_Timer; + + void Reset() + { + WarStomp_Timer = 15000; + Cleave_Timer = 6000; + Strike_Timer = 10000; + Rend_Timer = 14000; + SunderArmor_Timer = 2000; + KnockAway_Timer = 18000; + Slow_Timer = 24000; + } + + void EnterCombat(Unit * /*who*/) + { + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //WarStomp_Timer + if (WarStomp_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_WARSTOMP); + WarStomp_Timer = 14000; + } else WarStomp_Timer -= diff; + + //Cleave_Timer + if (Cleave_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_CLEAVE); + Cleave_Timer = 8000; + } else Cleave_Timer -= diff; + + //Strike_Timer + if (Strike_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_STRIKE); + Strike_Timer = 10000; + } else Strike_Timer -= diff; + + //Rend_Timer + if (Rend_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_REND); + Rend_Timer = 18000; + } else Rend_Timer -= diff; + + //SunderArmor_Timer + if (SunderArmor_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_SUNDERARMOR); + SunderArmor_Timer = 25000; + } else SunderArmor_Timer -= diff; + + //KnockAway_Timer + if (KnockAway_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_KNOCKAWAY); + KnockAway_Timer = 12000; + } else KnockAway_Timer -= diff; + + //Slow_Timer + if (Slow_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_SLOW); + Slow_Timer = 18000; + } else Slow_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_highlordomokk(Creature* pCreature) +{ + return new boss_highlordomokkAI (pCreature); +} + +void AddSC_boss_highlordomokk() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_highlord_omokk"; + newscript->GetAI = &GetAI_boss_highlordomokk; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_mother_smolderweb.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_mother_smolderweb.cpp new file mode 100644 index 00000000000..60dda5a5fab --- /dev/null +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_mother_smolderweb.cpp @@ -0,0 +1,87 @@ +/* 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_Smolderweb +SD%Complete: 100 +SDComment: Uncertain how often mother's milk is casted +SDCategory: Blackrock Spire +EndScriptData */ + +#include "ScriptedPch.h" + +#define SPELL_CRYSTALIZE 16104 +#define SPELL_MOTHERSMILK 16468 +#define SPELL_SUMMON_SPIRE_SPIDERLING 16103 + +struct boss_mothersmolderwebAI : public ScriptedAI +{ + boss_mothersmolderwebAI(Creature *c) : ScriptedAI(c) {} + + uint32 Crystalize_Timer; + uint32 MothersMilk_Timer; + + void Reset() + { + Crystalize_Timer = 20000; + MothersMilk_Timer = 10000; + } + + void EnterCombat(Unit * /*who*/) {} + + void DamageTaken(Unit * /*done_by*/, uint32 &damage) + { + if (me->GetHealth() <= damage) + DoCast(me, SPELL_SUMMON_SPIRE_SPIDERLING, true); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //Crystalize_Timer + if (Crystalize_Timer <= diff) + { + DoCast(me, SPELL_CRYSTALIZE); + Crystalize_Timer = 15000; + } else Crystalize_Timer -= diff; + + //MothersMilk_Timer + if (MothersMilk_Timer <= diff) + { + DoCast(me, SPELL_MOTHERSMILK); + MothersMilk_Timer = urand(5000,12500); + } else MothersMilk_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_mothersmolderweb(Creature* pCreature) +{ + return new boss_mothersmolderwebAI (pCreature); +} + +void AddSC_boss_mothersmolderweb() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_mother_smolderweb"; + newscript->GetAI = &GetAI_boss_mothersmolderweb; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_overlord_wyrmthalak.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_overlord_wyrmthalak.cpp new file mode 100644 index 00000000000..8846442705b --- /dev/null +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_overlord_wyrmthalak.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_Overlord_Wyrmthalak +SD%Complete: 100 +SDComment: +SDCategory: Blackrock Spire +EndScriptData */ + +#include "ScriptedPch.h" + +#define SPELL_BLASTWAVE 11130 +#define SPELL_SHOUT 23511 +#define SPELL_CLEAVE 20691 +#define SPELL_KNOCKAWAY 20686 + +#define ADD_1X -39.355381 +#define ADD_1Y -513.456482 +#define ADD_1Z 88.472046 +#define ADD_1O 4.679872 + +#define ADD_2X -49.875881 +#define ADD_2Y -511.896942 +#define ADD_2Z 88.195160 +#define ADD_2O 4.613114 + +struct boss_overlordwyrmthalakAI : public ScriptedAI +{ + boss_overlordwyrmthalakAI(Creature *c) : ScriptedAI(c) {} + + uint32 BlastWave_Timer; + uint32 Shout_Timer; + uint32 Cleave_Timer; + uint32 Knockaway_Timer; + bool Summoned; + + void Reset() + { + BlastWave_Timer = 20000; + Shout_Timer = 2000; + Cleave_Timer = 6000; + Knockaway_Timer = 12000; + Summoned = false; + } + + void EnterCombat(Unit * /*who*/) + { + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //BlastWave_Timer + if (BlastWave_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_BLASTWAVE); + BlastWave_Timer = 20000; + } else BlastWave_Timer -= diff; + + //Shout_Timer + if (Shout_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_SHOUT); + Shout_Timer = 10000; + } else Shout_Timer -= diff; + + //Cleave_Timer + if (Cleave_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_CLEAVE); + Cleave_Timer = 7000; + } else Cleave_Timer -= diff; + + //Knockaway_Timer + if (Knockaway_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_KNOCKAWAY); + Knockaway_Timer = 14000; + } else Knockaway_Timer -= diff; + + //Summon two Beserks + if (!Summoned && me->GetHealth()*100 / me->GetMaxHealth() < 51) + { + Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0, 100, true); + + if (Creature *SummonedCreature = me->SummonCreature(9216,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,300000)) + SummonedCreature->AI()->AttackStart(pTarget); + if (Creature *SummonedCreature = me->SummonCreature(9268,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,300000)) + SummonedCreature->AI()->AttackStart(pTarget); + Summoned = true; + } + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_overlordwyrmthalak(Creature* pCreature) +{ + return new boss_overlordwyrmthalakAI (pCreature); +} + +void AddSC_boss_overlordwyrmthalak() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_overlord_wyrmthalak"; + newscript->GetAI = &GetAI_boss_overlordwyrmthalak; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp new file mode 100644 index 00000000000..6cbd6955665 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp @@ -0,0 +1,93 @@ +/* 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_Pyroguard_Emberseer +SD%Complete: 100 +SDComment: Event to activate Emberseer NYI +SDCategory: Blackrock Spire +EndScriptData */ + +#include "ScriptedPch.h" + +#define SPELL_FIRENOVA 23462 +#define SPELL_FLAMEBUFFET 23341 +#define SPELL_PYROBLAST 17274 + +struct boss_pyroguard_emberseerAI : public ScriptedAI +{ + boss_pyroguard_emberseerAI(Creature *c) : ScriptedAI(c) {} + + uint32 FireNova_Timer; + uint32 FlameBuffet_Timer; + uint32 PyroBlast_Timer; + + void Reset() + { + FireNova_Timer = 6000; + FlameBuffet_Timer = 3000; + PyroBlast_Timer = 14000; + } + + void EnterCombat(Unit * /*who*/) + { + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //FireNova_Timer + if (FireNova_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_FIRENOVA); + FireNova_Timer = 6000; + } else FireNova_Timer -= diff; + + //FlameBuffet_Timer + if (FlameBuffet_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_FLAMEBUFFET); + FlameBuffet_Timer = 14000; + } else FlameBuffet_Timer -= diff; + + //PyroBlast_Timer + if (PyroBlast_Timer <= diff) + { + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) + DoCast(pTarget, SPELL_PYROBLAST); + PyroBlast_Timer = 15000; + } else PyroBlast_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_pyroguard_emberseer(Creature* pCreature) +{ + return new boss_pyroguard_emberseerAI (pCreature); +} + +void AddSC_boss_pyroguard_emberseer() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_pyroguard_emberseer"; + newscript->GetAI = &GetAI_boss_pyroguard_emberseer; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_quartermaster_zigris.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_quartermaster_zigris.cpp new file mode 100644 index 00000000000..9058b35cd5c --- /dev/null +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_quartermaster_zigris.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: Boss_Quartmaster_Zigris +SD%Complete: 100 +SDComment: Needs revision +SDCategory: Blackrock Spire +EndScriptData */ + +#include "ScriptedPch.h" + +#define SPELL_SHOOT 16496 +#define SPELL_STUNBOMB 16497 +#define SPELL_HEALING_POTION 15504 +#define SPELL_HOOKEDNET 15609 + +struct boss_quatermasterzigrisAI : public ScriptedAI +{ + boss_quatermasterzigrisAI(Creature *c) : ScriptedAI(c) {} + + uint32 Shoot_Timer; + uint32 StunBomb_Timer; + //uint32 HelingPotion_Timer; + + void Reset() + { + Shoot_Timer = 1000; + StunBomb_Timer = 16000; + //HelingPotion_Timer = 25000; + } + + void EnterCombat(Unit * /*who*/) + { + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //Shoot_Timer + if (Shoot_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_SHOOT); + Shoot_Timer = 500; + } else Shoot_Timer -= diff; + + //StunBomb_Timer + if (StunBomb_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_STUNBOMB); + StunBomb_Timer = 14000; + } else StunBomb_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_quatermasterzigris(Creature* pCreature) +{ + return new boss_quatermasterzigrisAI (pCreature); +} + +void AddSC_boss_quatermasterzigris() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "quartermaster_zigris"; + newscript->GetAI = &GetAI_boss_quatermasterzigris; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_rend_blackhand.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_rend_blackhand.cpp new file mode 100644 index 00000000000..56de5dbb385 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_rend_blackhand.cpp @@ -0,0 +1,92 @@ +/* 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_Rend_Blackhand +SD%Complete: 100 +SDComment: Intro event NYI +SDCategory: Blackrock Spire +EndScriptData */ + +#include "ScriptedPch.h" + +#define SPELL_WHIRLWIND 26038 +#define SPELL_CLEAVE 20691 +#define SPELL_THUNDERCLAP 23931 //Not sure if he cast this spell + +struct boss_rend_blackhandAI : public ScriptedAI +{ + boss_rend_blackhandAI(Creature *c) : ScriptedAI(c) {} + + uint32 WhirlWind_Timer; + uint32 Cleave_Timer; + uint32 Thunderclap_Timer; + + void Reset() + { + WhirlWind_Timer = 20000; + Cleave_Timer = 5000; + Thunderclap_Timer = 9000; + } + + void EnterCombat(Unit * /*who*/) + { + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //WhirlWind_Timer + if (WhirlWind_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_WHIRLWIND); + WhirlWind_Timer = 18000; + } else WhirlWind_Timer -= diff; + + //Cleave_Timer + if (Cleave_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_CLEAVE); + Cleave_Timer = 10000; + } else Cleave_Timer -= diff; + + //Thunderclap_Timer + if (Thunderclap_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_THUNDERCLAP); + Thunderclap_Timer = 16000; + } else Thunderclap_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_rend_blackhand(Creature* pCreature) +{ + return new boss_rend_blackhandAI (pCreature); +} + +void AddSC_boss_rend_blackhand() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_rend_blackhand"; + newscript->GetAI = &GetAI_boss_rend_blackhand; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_shadow_hunter_voshgajin.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_shadow_hunter_voshgajin.cpp new file mode 100644 index 00000000000..73afc3b5afe --- /dev/null +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_shadow_hunter_voshgajin.cpp @@ -0,0 +1,93 @@ +/* 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_Shadow_Hunter_Voshgajin +SD%Complete: 100 +SDComment: +SDCategory: Blackrock Spire +EndScriptData */ + +#include "ScriptedPch.h" + +#define SPELL_CURSEOFBLOOD 24673 +#define SPELL_HEX 16708 +#define SPELL_CLEAVE 20691 + +struct boss_shadowvoshAI : public ScriptedAI +{ + boss_shadowvoshAI(Creature *c) : ScriptedAI(c) {} + + uint32 CurseOfBlood_Timer; + uint32 Hex_Timer; + uint32 Cleave_Timer; + + void Reset() + { + CurseOfBlood_Timer = 2000; + Hex_Timer = 8000; + Cleave_Timer = 14000; + + //DoCast(me, SPELL_ICEARMOR, true); + } + + void EnterCombat(Unit * /*who*/){} + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //CurseOfBlood_Timer + if (CurseOfBlood_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_CURSEOFBLOOD); + CurseOfBlood_Timer = 45000; + } else CurseOfBlood_Timer -= diff; + + //Hex_Timer + if (Hex_Timer <= diff) + { + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) + DoCast(pTarget, SPELL_HEX); + Hex_Timer = 15000; + } else Hex_Timer -= diff; + + //Cleave_Timer + if (Cleave_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_CLEAVE); + Cleave_Timer = 7000; + } else Cleave_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_shadowvosh(Creature* pCreature) +{ + return new boss_shadowvoshAI (pCreature); +} + +void AddSC_boss_shadowvosh() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_shadow_hunter_voshgajin"; + newscript->GetAI = &GetAI_boss_shadowvosh; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_the_beast.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_the_beast.cpp new file mode 100644 index 00000000000..499f9cf4ce5 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_the_beast.cpp @@ -0,0 +1,93 @@ +/* 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_Best +SD%Complete: 100 +SDComment: +SDCategory: Blackrock Spire +EndScriptData */ + +#include "ScriptedPch.h" + +#define SPELL_FLAMEBREAK 16785 +#define SPELL_IMMOLATE 20294 +#define SPELL_TERRIFYINGROAR 14100 + +struct boss_thebeastAI : public ScriptedAI +{ + boss_thebeastAI(Creature *c) : ScriptedAI(c) {} + + uint32 Flamebreak_Timer; + uint32 Immolate_Timer; + uint32 TerrifyingRoar_Timer; + + void Reset() + { + Flamebreak_Timer = 12000; + Immolate_Timer = 3000; + TerrifyingRoar_Timer = 23000; + } + + void EnterCombat(Unit * /*who*/) + { + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //Flamebreak_Timer + if (Flamebreak_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_FLAMEBREAK); + Flamebreak_Timer = 10000; + } else Flamebreak_Timer -= diff; + + //Immolate_Timer + if (Immolate_Timer <= diff) + { + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) + DoCast(pTarget, SPELL_IMMOLATE); + Immolate_Timer = 8000; + } else Immolate_Timer -= diff; + + //TerrifyingRoar_Timer + if (TerrifyingRoar_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_TERRIFYINGROAR); + TerrifyingRoar_Timer = 20000; + } else TerrifyingRoar_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_thebeast(Creature* pCreature) +{ + return new boss_thebeastAI (pCreature); +} + +void AddSC_boss_thebeast() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_the_beast"; + newscript->GetAI = &GetAI_boss_thebeast; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_warmaster_voone.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_warmaster_voone.cpp new file mode 100644 index 00000000000..50b47c94fc5 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_warmaster_voone.cpp @@ -0,0 +1,122 @@ +/* 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_Warmaster_Voone +SD%Complete: 100 +SDComment: +SDCategory: Blackrock Spire +EndScriptData */ + +#include "ScriptedPch.h" + +#define SPELL_SNAPKICK 15618 +#define SPELL_CLEAVE 15579 +#define SPELL_UPPERCUT 10966 +#define SPELL_MORTALSTRIKE 16856 +#define SPELL_PUMMEL 15615 +#define SPELL_THROWAXE 16075 + +struct boss_warmastervooneAI : public ScriptedAI +{ + boss_warmastervooneAI(Creature *c) : ScriptedAI(c) {} + + uint32 Snapkick_Timer; + uint32 Cleave_Timer; + uint32 Uppercut_Timer; + uint32 MortalStrike_Timer; + uint32 Pummel_Timer; + uint32 ThrowAxe_Timer; + + void Reset() + { + Snapkick_Timer = 8000; + Cleave_Timer = 14000; + Uppercut_Timer = 20000; + MortalStrike_Timer = 12000; + Pummel_Timer = 32000; + ThrowAxe_Timer = 1000; + } + + void EnterCombat(Unit * /*who*/) + { + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //Snapkick_Timer + if (Snapkick_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_SNAPKICK); + Snapkick_Timer = 6000; + } else Snapkick_Timer -= diff; + + //Cleave_Timer + if (Cleave_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_CLEAVE); + Cleave_Timer = 12000; + } else Cleave_Timer -= diff; + + //Uppercut_Timer + if (Uppercut_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_UPPERCUT); + Uppercut_Timer = 14000; + } else Uppercut_Timer -= diff; + + //MortalStrike_Timer + if (MortalStrike_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_MORTALSTRIKE); + MortalStrike_Timer = 10000; + } else MortalStrike_Timer -= diff; + + //Pummel_Timer + if (Pummel_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_PUMMEL); + Pummel_Timer = 16000; + } else Pummel_Timer -= diff; + + //ThrowAxe_Timer + if (ThrowAxe_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_THROWAXE); + ThrowAxe_Timer = 8000; + } else ThrowAxe_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_warmastervoone(Creature* pCreature) +{ + return new boss_warmastervooneAI (pCreature); +} + +void AddSC_boss_warmastervoone() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_warmaster_voone"; + newscript->GetAI = &GetAI_boss_warmastervoone; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/instance_blackrock_spire.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/instance_blackrock_spire.cpp new file mode 100644 index 00000000000..f2e2b39fe87 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/instance_blackrock_spire.cpp @@ -0,0 +1,104 @@ +/* Copyright (C) 2008 - 2010 TrinityCore + * 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 + */ + +#include "ScriptedPch.h" +#include "blackrock_spire.h" + +enum Achievements +{ + ACHIEV_LEROY_JENKINS = 2188 +}; + +struct instance_blackrock_spire : public ScriptedInstance +{ + instance_blackrock_spire(Map* pMap) : ScriptedInstance(pMap) {} + + uint32 uiLeeroyTimer; + uint32 uiWhelpCount; + uint32 uiLeroyData; + + bool bLeeeeeeeeroy; + + void Initialize() + { + uiLeeroyTimer = 15*IN_MILISECONDS; + uiWhelpCount = 0; + bLeeeeeeeeroy = true; + uiLeroyData = 0; + } + + void SetData(uint32 type, uint32 data) + { + switch(type) + { + case EVENT_LEEEROY: + if (data == DONE) + DoCompleteAchievement(ACHIEV_LEROY_JENKINS); + uiLeroyData = data; + break; + case WHELP_DEATH_COUNT: + if (data == 1) + { + SetData(EVENT_LEEEROY, IN_PROGRESS); + //DoSendNotifyToInstance("Leeeeeeeeeeeeeroy! Started"); + } + uiWhelpCount = data; + break; + } + } + + uint32 GetData(uint32 type) + { + switch(type) + { + case EVENT_LEEEROY: return uiLeroyData; + case WHELP_DEATH_COUNT: return uiWhelpCount; + } + return 0; + } + + void Update(uint32 diff) + { + if (GetData(EVENT_LEEEROY) != FAIL && GetData(EVENT_LEEEROY) == IN_PROGRESS) + { + if (uiLeeroyTimer <= diff) + { + SetData(EVENT_LEEEROY, FAIL); + bLeeeeeeeeroy = false; + //DoSendNotifyToInstance("Leeeeeeeeeeeeeroy! Failed"); + } else uiLeeroyTimer -= diff; + if (uiWhelpCount >= 50 && bLeeeeeeeeroy) + { + SetData(EVENT_LEEEROY, DONE); + //DoSendNotifyToInstance("Leeeeeeeeeeeeeroy! Success"); + } + } + } +}; + +InstanceData* GetInstanceData_instance_blackrock_spire(Map* pMap) +{ + return new instance_blackrock_spire(pMap); +} + +void AddSC_instance_blackrock_spire() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_blackrock_spire"; + newscript->GetInstanceData = &GetInstanceData_instance_blackrock_spire; + newscript->RegisterSelf(); +} diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_broodlord_lashlayer.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_broodlord_lashlayer.cpp new file mode 100644 index 00000000000..856e1236176 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_broodlord_lashlayer.cpp @@ -0,0 +1,112 @@ +/* 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_Broodlord_Lashlayer +SD%Complete: 100 +SDComment: +SDCategory: Blackwing Lair +EndScriptData */ + +#include "ScriptedPch.h" + +#define SAY_AGGRO -1469000 +#define SAY_LEASH -1469001 + +#define SPELL_CLEAVE 26350 +#define SPELL_BLASTWAVE 23331 +#define SPELL_MORTALSTRIKE 24573 +#define SPELL_KNOCKBACK 25778 + +struct boss_broodlordAI : public ScriptedAI +{ + boss_broodlordAI(Creature *c) : ScriptedAI(c) {} + + uint32 Cleave_Timer; + uint32 BlastWave_Timer; + uint32 MortalStrike_Timer; + uint32 KnockBack_Timer; + + void Reset() + { + Cleave_Timer = 8000; //These times are probably wrong + BlastWave_Timer = 12000; + MortalStrike_Timer = 20000; + KnockBack_Timer = 30000; + } + + void EnterCombat(Unit * /*who*/) + { + DoScriptText(SAY_AGGRO, me); + DoZoneInCombat(); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //Cleave_Timer + if (Cleave_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_CLEAVE); + Cleave_Timer = 7000; + } else Cleave_Timer -= diff; + + // BlastWave + if (BlastWave_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_BLASTWAVE); + BlastWave_Timer = urand(8000,16000); + } else BlastWave_Timer -= diff; + + //MortalStrike_Timer + if (MortalStrike_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_MORTALSTRIKE); + MortalStrike_Timer = urand(25000,35000); + } else MortalStrike_Timer -= diff; + + if (KnockBack_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_KNOCKBACK); + //Drop 50% aggro + if (DoGetThreat(me->getVictim())) + DoModifyThreatPercent(me->getVictim(),-50); + + KnockBack_Timer = urand(15000,30000); + } else KnockBack_Timer -= diff; + + if (EnterEvadeIfOutOfCombatArea(diff)) + DoScriptText(SAY_LEASH, me); + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_broodlord(Creature* pCreature) +{ + return new boss_broodlordAI (pCreature); +} + +void AddSC_boss_broodlord() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_broodlord"; + newscript->GetAI = &GetAI_boss_broodlord; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_chromaggus.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_chromaggus.cpp new file mode 100644 index 00000000000..08bebe95384 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_chromaggus.cpp @@ -0,0 +1,301 @@ +/* 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_Chromaggus +SD%Complete: 95 +SDComment: Chromatic Mutation disabled due to lack of core support +SDCategory: Blackwing Lair +EndScriptData */ + +#include "ScriptedPch.h" + +enum Emotes +{ + EMOTE_FRENZY = -1469002, + EMOTE_SHIMMER = -1469003 +}; + +enum Spells +{ + //These spells are actually called elemental shield + //What they do is decrease all damage by 75% then they increase + //One school of damage by 1100% + SPELL_FIRE_VULNERABILITY = 22277, + SPELL_FROST_VULNERABILITY = 22278, + SPELL_SHADOW_VULNERABILITY = 22279, + SPELL_NATURE_VULNERABILITY = 22280, + SPELL_ARCANE_VULNERABILITY = 22281, + //Other spells + SPELL_INCINERATE = 23308, //Incinerate 23308,23309 + SPELL_TIMELAPSE = 23310, //Time lapse 23310, 23311(old threat mod that was removed in 2.01) + SPELL_CORROSIVEACID = 23313, //Corrosive Acid 23313, 23314 + SPELL_IGNITEFLESH = 23315, //Ignite Flesh 23315,23316 + SPELL_FROSTBURN = 23187, //Frost burn 23187, 23189 + //Brood Affliction 23173 - Scripted Spell that cycles through all targets within 100 yards and has a chance to cast one of the afflictions on them + //Since Scripted spells arn't coded I'll just write a function that does the same thing + SPELL_BROODAF_BLUE = 23153, //Blue affliction 23153 + SPELL_BROODAF_BLACK = 23154, //Black affliction 23154 + SPELL_BROODAF_RED = 23155, //Red affliction 23155 (23168 on death) + SPELL_BROODAF_BRONZE = 23170, //Bronze Affliction 23170 + SPELL_BROODAF_GREEN = 23169, //Brood Affliction Green 23169 + SPELL_CHROMATIC_MUT_1 = 23174, //Spell cast on player if they get all 5 debuffs + SPELL_FRENZY = 28371, //The frenzy spell may be wrong + SPELL_ENRAGE = 28747 +}; + +struct boss_chromaggusAI : public ScriptedAI +{ + boss_chromaggusAI(Creature *c) : ScriptedAI(c) + { + //Select the 2 breaths that we are going to use until despawned + //5 possiblities for the first breath, 4 for the second, 20 total possiblites + //This way we don't end up casting 2 of the same breath + //TL TL would be stupid + switch (urand(0,19)) + { + //B1 - Incin + case 0: + Breath1_Spell = SPELL_INCINERATE; + Breath2_Spell = SPELL_TIMELAPSE; + break; + case 1: + Breath1_Spell = SPELL_INCINERATE; + Breath2_Spell = SPELL_CORROSIVEACID; + break; + case 2: + Breath1_Spell = SPELL_INCINERATE; + Breath2_Spell = SPELL_IGNITEFLESH; + break; + case 3: + Breath1_Spell = SPELL_INCINERATE; + Breath2_Spell = SPELL_FROSTBURN; + break; + + //B1 - TL + case 4: + Breath1_Spell = SPELL_TIMELAPSE; + Breath2_Spell = SPELL_INCINERATE; + break; + case 5: + Breath1_Spell = SPELL_TIMELAPSE; + Breath2_Spell = SPELL_CORROSIVEACID; + break; + case 6: + Breath1_Spell = SPELL_TIMELAPSE; + Breath2_Spell = SPELL_IGNITEFLESH; + break; + case 7: + Breath1_Spell = SPELL_TIMELAPSE; + Breath2_Spell = SPELL_FROSTBURN; + break; + + //B1 - Acid + case 8: + Breath1_Spell = SPELL_CORROSIVEACID; + Breath2_Spell = SPELL_INCINERATE; + break; + case 9: + Breath1_Spell = SPELL_CORROSIVEACID; + Breath2_Spell = SPELL_TIMELAPSE; + break; + case 10: + Breath1_Spell = SPELL_CORROSIVEACID; + Breath2_Spell = SPELL_IGNITEFLESH; + break; + case 11: + Breath1_Spell = SPELL_CORROSIVEACID; + Breath2_Spell = SPELL_FROSTBURN; + break; + + //B1 - Ignite + case 12: + Breath1_Spell = SPELL_IGNITEFLESH; + Breath2_Spell = SPELL_INCINERATE; + break; + case 13: + Breath1_Spell = SPELL_IGNITEFLESH; + Breath2_Spell = SPELL_CORROSIVEACID; + break; + case 14: + Breath1_Spell = SPELL_IGNITEFLESH; + Breath2_Spell = SPELL_TIMELAPSE; + break; + case 15: + Breath1_Spell = SPELL_IGNITEFLESH; + Breath2_Spell = SPELL_FROSTBURN; + break; + + //B1 - Frost + case 16: + Breath1_Spell = SPELL_FROSTBURN; + Breath2_Spell = SPELL_INCINERATE; + break; + case 17: + Breath1_Spell = SPELL_FROSTBURN; + Breath2_Spell = SPELL_TIMELAPSE; + break; + case 18: + Breath1_Spell = SPELL_FROSTBURN; + Breath2_Spell = SPELL_CORROSIVEACID; + break; + case 19: + Breath1_Spell = SPELL_FROSTBURN; + Breath2_Spell = SPELL_IGNITEFLESH; + break; + }; + + EnterEvadeMode(); + } + + uint32 Breath1_Spell; + uint32 Breath2_Spell; + uint32 CurrentVurln_Spell; + + uint32 Shimmer_Timer; + uint32 Breath1_Timer; + uint32 Breath2_Timer; + uint32 Affliction_Timer; + uint32 Frenzy_Timer; + bool Enraged; + + void Reset() + { + CurrentVurln_Spell = 0; //We use this to store our last vulnerabilty spell so we can remove it later + + Shimmer_Timer = 0; //Time till we change vurlnerabilites + Breath1_Timer = 30000; //First breath is 30 seconds + Breath2_Timer = 60000; //Second is 1 minute so that we can alternate + Affliction_Timer = 10000; //This is special - 5 seconds means that we cast this on 1 player every 5 sconds + Frenzy_Timer = 15000; + + Enraged = false; + } + + void EnterCombat(Unit * /*who*/) + { + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //Shimmer_Timer Timer + if (Shimmer_Timer <= diff) + { + //Remove old vulnerabilty spell + if (CurrentVurln_Spell) + me->RemoveAurasDueToSpell(CurrentVurln_Spell); + + //Cast new random vulnerabilty on self + uint32 spell = RAND(SPELL_FIRE_VULNERABILITY, SPELL_FROST_VULNERABILITY, + SPELL_SHADOW_VULNERABILITY, SPELL_NATURE_VULNERABILITY, SPELL_ARCANE_VULNERABILITY); + + DoCast(me, spell); + CurrentVurln_Spell = spell; + + DoScriptText(EMOTE_SHIMMER, me); + Shimmer_Timer = 45000; + } else Shimmer_Timer -= diff; + + //Breath1_Timer + if (Breath1_Timer <= diff) + { + DoCast(me->getVictim(), Breath1_Spell); + Breath1_Timer = 60000; + } else Breath1_Timer -= diff; + + //Breath2_Timer + if (Breath2_Timer <= diff) + { + DoCast(me->getVictim(), Breath2_Spell); + Breath2_Timer = 60000; + } else Breath2_Timer -= diff; + + //Affliction_Timer + if (Affliction_Timer <= diff) + { + std::list threatlist = me->getThreatManager().getThreatList(); + for (std::list::const_iterator i = threatlist.begin(); i != threatlist.end(); ++i) + { + Unit* pUnit; + if ((*i) && (*i)->getSource()) + { + pUnit = Unit::GetUnit((*me), (*i)->getUnitGuid()); + if (pUnit) + { + //Cast affliction + DoCast(pUnit, RAND(SPELL_BROODAF_BLUE, SPELL_BROODAF_BLACK, + SPELL_BROODAF_RED, SPELL_BROODAF_BRONZE, SPELL_BROODAF_GREEN), true); + + //Chromatic mutation if target is effected by all afflictions + if (pUnit->HasAura(SPELL_BROODAF_BLUE) + && pUnit->HasAura(SPELL_BROODAF_BLACK) + && pUnit->HasAura(SPELL_BROODAF_RED) + && pUnit->HasAura(SPELL_BROODAF_BRONZE) + && pUnit->HasAura(SPELL_BROODAF_GREEN)) + { + //pTarget->RemoveAllAuras(); + //DoCast(pTarget, SPELL_CHROMATIC_MUT_1); + + //Chromatic mutation is causing issues + //Assuming it is caused by a lack of core support for Charm + //So instead we instant kill our target + + //WORKAROUND + if (pUnit->GetTypeId() == TYPEID_PLAYER) + pUnit->CastSpell(pUnit, 5, false); + } + } + } + } + + Affliction_Timer = 10000; + } else Affliction_Timer -= diff; + + //Frenzy_Timer + if (Frenzy_Timer <= diff) + { + DoCast(me, SPELL_FRENZY); + DoScriptText(EMOTE_FRENZY, me); + Frenzy_Timer = urand(10000,15000); + } else Frenzy_Timer -= diff; + + //Enrage if not already enraged and below 20% + if (!Enraged && (me->GetHealth()*100 / me->GetMaxHealth()) < 20) + { + DoCast(me, SPELL_ENRAGE); + Enraged = true; + } + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_chromaggus(Creature* pCreature) +{ + return new boss_chromaggusAI (pCreature); +} + +void AddSC_boss_chromaggus() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_chromaggus"; + newscript->GetAI = &GetAI_boss_chromaggus; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_ebonroc.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_ebonroc.cpp new file mode 100644 index 00000000000..49a999fc458 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_ebonroc.cpp @@ -0,0 +1,104 @@ +/* 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_Ebonroc +SD%Complete: 50 +SDComment: Shadow of Ebonroc needs core support +SDCategory: Blackwing Lair +EndScriptData */ + +#include "ScriptedPch.h" + +#define SPELL_SHADOWFLAME 22539 +#define SPELL_WINGBUFFET 18500 +#define SPELL_SHADOWOFEBONROC 23340 +#define SPELL_HEAL 41386 //Thea Heal spell of his Shadow + +struct boss_ebonrocAI : public ScriptedAI +{ + boss_ebonrocAI(Creature *c) : ScriptedAI(c) {} + + uint32 ShadowFlame_Timer; + uint32 WingBuffet_Timer; + uint32 ShadowOfEbonroc_Timer; + uint32 Heal_Timer; + + void Reset() + { + ShadowFlame_Timer = 15000; //These times are probably wrong + WingBuffet_Timer = 30000; + ShadowOfEbonroc_Timer = 45000; + Heal_Timer = 1000; + } + + void EnterCombat(Unit * /*who*/) + { + DoZoneInCombat(); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //Shadowflame Timer + if (ShadowFlame_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_SHADOWFLAME); + ShadowFlame_Timer = urand(12000,15000); + } else ShadowFlame_Timer -= diff; + + //Wing Buffet Timer + if (WingBuffet_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_WINGBUFFET); + WingBuffet_Timer = 25000; + } else WingBuffet_Timer -= diff; + + //Shadow of Ebonroc Timer + if (ShadowOfEbonroc_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_SHADOWOFEBONROC); + ShadowOfEbonroc_Timer = urand(25000,350000); + } else ShadowOfEbonroc_Timer -= diff; + + if (me->getVictim()->HasAura(SPELL_SHADOWOFEBONROC)) + { + if (Heal_Timer <= diff) + { + DoCast(me, SPELL_HEAL); + Heal_Timer = urand(1000,3000); + } else Heal_Timer -= diff; + } + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_ebonroc(Creature* pCreature) +{ + return new boss_ebonrocAI (pCreature); +} + +void AddSC_boss_ebonroc() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_ebonroc"; + newscript->GetAI = &GetAI_boss_ebonroc; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_firemaw.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_firemaw.cpp new file mode 100644 index 00000000000..af62b1103bc --- /dev/null +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_firemaw.cpp @@ -0,0 +1,95 @@ +/* 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_Firemaw +SD%Complete: 100 +SDComment: +SDCategory: Blackwing Lair +EndScriptData */ + +#include "ScriptedPch.h" + +#define SPELL_SHADOWFLAME 22539 +#define SPELL_WINGBUFFET 23339 +#define SPELL_FLAMEBUFFET 23341 + +struct boss_firemawAI : public ScriptedAI +{ + boss_firemawAI(Creature *c) : ScriptedAI(c) {} + + uint32 ShadowFlame_Timer; + uint32 WingBuffet_Timer; + uint32 FlameBuffet_Timer; + + void Reset() + { + ShadowFlame_Timer = 30000; //These times are probably wrong + WingBuffet_Timer = 24000; + FlameBuffet_Timer = 5000; + } + + void EnterCombat(Unit * /*who*/) + { + DoZoneInCombat(); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //ShadowFlame_Timer + if (ShadowFlame_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_SHADOWFLAME); + ShadowFlame_Timer = urand(15000,18000); + } else ShadowFlame_Timer -= diff; + + //WingBuffet_Timer + if (WingBuffet_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_WINGBUFFET); + if (DoGetThreat(me->getVictim())) + DoModifyThreatPercent(me->getVictim(),-75); + + WingBuffet_Timer = 25000; + } else WingBuffet_Timer -= diff; + + //FlameBuffet_Timer + if (FlameBuffet_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_FLAMEBUFFET); + FlameBuffet_Timer = 5000; + } else FlameBuffet_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_firemaw(Creature* pCreature) +{ + return new boss_firemawAI (pCreature); +} + +void AddSC_boss_firemaw() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_firemaw"; + newscript->GetAI = &GetAI_boss_firemaw; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_flamegor.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_flamegor.cpp new file mode 100644 index 00000000000..b29fe41f2b1 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_flamegor.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: Boss_Flamegor +SD%Complete: 100 +SDComment: +SDCategory: Blackwing Lair +EndScriptData */ + +#include "ScriptedPch.h" + +#define EMOTE_FRENZY -1469031 + +#define SPELL_SHADOWFLAME 22539 +#define SPELL_WINGBUFFET 23339 +#define SPELL_FRENZY 23342 //This spell periodically triggers fire nova + +struct boss_flamegorAI : public ScriptedAI +{ + boss_flamegorAI(Creature *c) : ScriptedAI(c) {} + + uint32 ShadowFlame_Timer; + uint32 WingBuffet_Timer; + uint32 Frenzy_Timer; + + void Reset() + { + ShadowFlame_Timer = 21000; //These times are probably wrong + WingBuffet_Timer = 35000; + Frenzy_Timer = 10000; + } + + void EnterCombat(Unit * /*who*/) + { + DoZoneInCombat(); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //ShadowFlame_Timer + if (ShadowFlame_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_SHADOWFLAME); + ShadowFlame_Timer = 15000 + rand()%7000; + } else ShadowFlame_Timer -= diff; + + //WingBuffet_Timer + if (WingBuffet_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_WINGBUFFET); + if (DoGetThreat(me->getVictim())) + DoModifyThreatPercent(me->getVictim(),-75); + + WingBuffet_Timer = 25000; + } else WingBuffet_Timer -= diff; + + //Frenzy_Timer + if (Frenzy_Timer <= diff) + { + DoScriptText(EMOTE_FRENZY, me); + DoCast(me, SPELL_FRENZY); + Frenzy_Timer = urand(8000, 10000); + } else Frenzy_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_flamegor(Creature* pCreature) +{ + return new boss_flamegorAI (pCreature); +} + +void AddSC_boss_flamegor() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_flamegor"; + newscript->GetAI = &GetAI_boss_flamegor; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_nefarian.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_nefarian.cpp new file mode 100644 index 00000000000..5ef05be519c --- /dev/null +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_nefarian.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: Boss_Nefarian +SD%Complete: 80 +SDComment: Some issues with class calls effecting more than one class +SDCategory: Blackwing Lair +EndScriptData */ + +#include "ScriptedPch.h" + +#define SAY_AGGRO -1469007 +#define SAY_XHEALTH -1469008 +#define SAY_SHADOWFLAME -1469009 +#define SAY_RAISE_SKELETONS -1469010 +#define SAY_SLAY -1469011 +#define SAY_DEATH -1469012 + +#define SAY_MAGE -1469013 +#define SAY_WARRIOR -1469014 +#define SAY_DRUID -1469015 +#define SAY_PRIEST -1469016 +#define SAY_PALADIN -1469017 +#define SAY_SHAMAN -1469018 +#define SAY_WARLOCK -1469019 +#define SAY_HUNTER -1469020 +#define SAY_ROGUE -1469021 + +#define SPELL_SHADOWFLAME_INITIAL 22972 +#define SPELL_SHADOWFLAME 22539 +#define SPELL_BELLOWINGROAR 22686 +#define SPELL_VEILOFSHADOW 7068 +#define SPELL_CLEAVE 20691 +#define SPELL_TAILLASH 23364 +#define SPELL_BONECONTRUST 23363 //23362, 23361 + +#define SPELL_MAGE 23410 //wild magic +#define SPELL_WARRIOR 23397 //beserk +#define SPELL_DRUID 23398 // cat form +#define SPELL_PRIEST 23401 // corrupted healing +#define SPELL_PALADIN 23418 //syphon blessing +#define SPELL_SHAMAN 23425 //totems +#define SPELL_WARLOCK 23427 //infernals +#define SPELL_HUNTER 23436 //bow broke +#define SPELL_ROGUE 23414 //Paralise + +struct boss_nefarianAI : public ScriptedAI +{ + boss_nefarianAI(Creature *c) : ScriptedAI(c) {} + + uint32 ShadowFlame_Timer; + uint32 BellowingRoar_Timer; + uint32 VeilOfShadow_Timer; + uint32 Cleave_Timer; + uint32 TailLash_Timer; + uint32 ClassCall_Timer; + bool Phase3; + + uint32 DespawnTimer; + + void Reset() + { + ShadowFlame_Timer = 12000; //These times are probably wrong + BellowingRoar_Timer = 30000; + VeilOfShadow_Timer = 15000; + Cleave_Timer = 7000; + TailLash_Timer = 10000; + ClassCall_Timer = 35000; //35-40 seconds + Phase3 = false; + + DespawnTimer = 5000; + } + + void KilledUnit(Unit* Victim) + { + if (rand()%5) + return; + + DoScriptText(SAY_SLAY, me, Victim); + } + + void JustDied(Unit* /*Killer*/) + { + DoScriptText(SAY_DEATH, me); + } + + void EnterCombat(Unit * who) + { + DoScriptText(RAND(SAY_XHEALTH,SAY_AGGRO,SAY_SHADOWFLAME), me); + + DoCast(who, SPELL_SHADOWFLAME_INITIAL); + DoZoneInCombat(); + } + + void UpdateAI(const uint32 diff) + { + if (DespawnTimer <= diff) + { + if (!UpdateVictim()) + me->ForcedDespawn(); + DespawnTimer = 5000; + } else DespawnTimer -= diff; + + if (!UpdateVictim()) + return; + + //ShadowFlame_Timer + if (ShadowFlame_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_SHADOWFLAME); + ShadowFlame_Timer = 12000; + } else ShadowFlame_Timer -= diff; + + //BellowingRoar_Timer + if (BellowingRoar_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_BELLOWINGROAR); + BellowingRoar_Timer = 30000; + } else BellowingRoar_Timer -= diff; + + //VeilOfShadow_Timer + if (VeilOfShadow_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_VEILOFSHADOW); + VeilOfShadow_Timer = 15000; + } else VeilOfShadow_Timer -= diff; + + //Cleave_Timer + if (Cleave_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_CLEAVE); + Cleave_Timer = 7000; + } else Cleave_Timer -= diff; + + //TailLash_Timer + if (TailLash_Timer <= diff) + { + //Cast NYI since we need a better check for behind target + //DoCast(me->getVictim(), SPELL_TAILLASH); + + TailLash_Timer = 10000; + } else TailLash_Timer -= diff; + + //ClassCall_Timer + if (ClassCall_Timer <= diff) + { + //Cast a random class call + //On official it is based on what classes are currently on the hostil list + //but we can't do that yet so just randomly call one + + switch (urand(0,8)) + { + case 0: + DoScriptText(SAY_MAGE, me); + DoCast(me, SPELL_MAGE); + break; + case 1: + DoScriptText(SAY_WARRIOR, me); + DoCast(me, SPELL_WARRIOR); + break; + case 2: + DoScriptText(SAY_DRUID, me); + DoCast(me, SPELL_DRUID); + break; + case 3: + DoScriptText(SAY_PRIEST, me); + DoCast(me, SPELL_PRIEST); + break; + case 4: + DoScriptText(SAY_PALADIN, me); + DoCast(me, SPELL_PALADIN); + break; + case 5: + DoScriptText(SAY_SHAMAN, me); + DoCast(me, SPELL_SHAMAN); + break; + case 6: + DoScriptText(SAY_WARLOCK, me); + DoCast(me, SPELL_WARLOCK); + break; + case 7: + DoScriptText(SAY_HUNTER, me); + DoCast(me, SPELL_HUNTER); + break; + case 8: + DoScriptText(SAY_ROGUE, me); + DoCast(me, SPELL_ROGUE); + break; + } + + ClassCall_Timer = 35000 + (rand() % 5000); + } else ClassCall_Timer -= diff; + + //Phase3 begins when we are below X health + if (!Phase3 && (me->GetHealth()*100 / me->GetMaxHealth()) < 20) + { + Phase3 = true; + DoScriptText(SAY_RAISE_SKELETONS, me); + } + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_nefarian(Creature* pCreature) +{ + return new boss_nefarianAI (pCreature); +} + +void AddSC_boss_nefarian() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_nefarian"; + newscript->GetAI = &GetAI_boss_nefarian; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_razorgore.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_razorgore.cpp new file mode 100644 index 00000000000..a095756b18b --- /dev/null +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_razorgore.cpp @@ -0,0 +1,125 @@ +/* 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_Razorgore +SD%Complete: 50 +SDComment: Needs additional review. Phase 1 NYI (Grethok the Controller) +SDCategory: Blackwing Lair +EndScriptData */ + +#include "ScriptedPch.h" + +//Razorgore Phase 2 Script + +#define SAY_EGGS_BROKEN1 -1469022 +#define SAY_EGGS_BROKEN2 -1469023 +#define SAY_EGGS_BROKEN3 -1469024 +#define SAY_DEATH -1469025 + +#define SPELL_CLEAVE 22540 +#define SPELL_WARSTOMP 24375 +#define SPELL_FIREBALLVOLLEY 22425 +#define SPELL_CONFLAGRATION 23023 + +struct boss_razorgoreAI : public ScriptedAI +{ + boss_razorgoreAI(Creature *c) : ScriptedAI(c) {} + + uint32 Cleave_Timer; + uint32 WarStomp_Timer; + uint32 FireballVolley_Timer; + uint32 Conflagration_Timer; + + void Reset() + { + Cleave_Timer = 15000; //These times are probably wrong + WarStomp_Timer = 35000; + FireballVolley_Timer = 7000; + Conflagration_Timer = 12000; + } + + void EnterCombat(Unit * /*who*/) + { + DoZoneInCombat(); + } + + void JustDied(Unit* /*Killer*/) + { + DoScriptText(SAY_DEATH, me); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //Cleave_Timer + if (Cleave_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_CLEAVE); + Cleave_Timer = urand(7000,10000); + } else Cleave_Timer -= diff; + + //WarStomp_Timer + if (WarStomp_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_WARSTOMP); + WarStomp_Timer = urand(15000,25000); + } else WarStomp_Timer -= diff; + + //FireballVolley_Timer + if (FireballVolley_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_FIREBALLVOLLEY); + FireballVolley_Timer = urand(12000,15000); + } else FireballVolley_Timer -= diff; + + //Conflagration_Timer + if (Conflagration_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_CONFLAGRATION); + //We will remove this threat reduction and add an aura check. + + //if (DoGetThreat(me->getVictim())) + //DoModifyThreatPercent(me->getVictim(),-50); + + Conflagration_Timer = 12000; + } else Conflagration_Timer -= diff; + + // Aura Check. If the gamer is affected by confliguration we attack a random gamer. + if (me->getVictim() && me->getVictim()->HasAura(SPELL_CONFLAGRATION)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true)) + me->TauntApply(pTarget); + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_razorgore(Creature* pCreature) +{ + return new boss_razorgoreAI (pCreature); +} + +void AddSC_boss_razorgore() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_razorgore"; + newscript->GetAI = &GetAI_boss_razorgore; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_vaelastrasz.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_vaelastrasz.cpp new file mode 100644 index 00000000000..f6e94307f2f --- /dev/null +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_vaelastrasz.cpp @@ -0,0 +1,262 @@ +/* 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_Vaelastrasz +SD%Complete: 75 +SDComment: Burning Adrenaline not correctly implemented in core +SDCategory: Blackwing Lair +EndScriptData */ + +#include "ScriptedPch.h" + +#define SAY_LINE1 -1469026 +#define SAY_LINE2 -1469027 +#define SAY_LINE3 -1469028 +#define SAY_HALFLIFE -1469029 +#define SAY_KILLTARGET -1469030 + +#define GOSSIP_ITEM "Start Event " + +#define SPELL_ESSENCEOFTHERED 23513 +#define SPELL_FLAMEBREATH 23461 +#define SPELL_FIRENOVA 23462 +#define SPELL_TAILSWIPE 15847 +#define SPELL_BURNINGADRENALINE 23620 +#define SPELL_CLEAVE 20684 //Chain cleave is most likely named something different and contains a dummy effect + +struct boss_vaelAI : public ScriptedAI +{ + boss_vaelAI(Creature *c) : ScriptedAI(c) + { + c->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + c->setFaction(35); + c->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + } + + uint64 PlayerGUID; + uint32 SpeechTimer; + uint32 SpeechNum; + uint32 Cleave_Timer; + uint32 FlameBreath_Timer; + uint32 FireNova_Timer; + uint32 BurningAdrenalineCaster_Timer; + uint32 BurningAdrenalineTank_Timer; + uint32 TailSwipe_Timer; + bool HasYelled; + bool DoingSpeech; + + void Reset() + { + PlayerGUID = 0; + SpeechTimer = 0; + SpeechNum = 0; + Cleave_Timer = 8000; //These times are probably wrong + FlameBreath_Timer = 11000; + BurningAdrenalineCaster_Timer = 15000; + BurningAdrenalineTank_Timer = 45000; + FireNova_Timer = 5000; + TailSwipe_Timer = 20000; + HasYelled = false; + DoingSpeech = false; + } + + void BeginSpeech(Unit *pTarget) + { + //Stand up and begin speach + PlayerGUID = pTarget->GetGUID(); + + //10 seconds + DoScriptText(SAY_LINE1, me); + + SpeechTimer = 10000; + SpeechNum = 0; + DoingSpeech = true; + + me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + } + + void KilledUnit(Unit * victim) + { + if (rand()%5) + return; + + DoScriptText(SAY_KILLTARGET, me, victim); + } + + void EnterCombat(Unit * /*who*/) + { + DoCast(me, SPELL_ESSENCEOFTHERED); + DoZoneInCombat(); + me->SetHealth(int(me->GetMaxHealth()*.3)); + } + + void UpdateAI(const uint32 diff) + { + //Speech + if (DoingSpeech) + { + if (SpeechTimer <= diff) + { + switch (SpeechNum) + { + case 0: + //16 seconds till next line + DoScriptText(SAY_LINE2, me); + SpeechTimer = 16000; + ++SpeechNum; + break; + case 1: + //This one is actually 16 seconds but we only go to 10 seconds because he starts attacking after he says "I must fight this!" + DoScriptText(SAY_LINE3, me); + SpeechTimer = 10000; + ++SpeechNum; + break; + case 2: + me->setFaction(103); + if (PlayerGUID && Unit::GetUnit((*me),PlayerGUID)) + { + AttackStart(Unit::GetUnit((*me),PlayerGUID)); + DoCast(me, SPELL_ESSENCEOFTHERED); + } + SpeechTimer = 0; + DoingSpeech = false; + break; + } + } else SpeechTimer -= diff; + } + + //Return since we have no target + if (!UpdateVictim()) + return; + + // Yell if hp lower than 15% + if (me->GetHealth()*100 / me->GetMaxHealth() < 15 && !HasYelled) + { + DoScriptText(SAY_HALFLIFE, me); + HasYelled = true; + } + + //Cleave_Timer + if (Cleave_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_CLEAVE); + Cleave_Timer = 15000; + } else Cleave_Timer -= diff; + + //FlameBreath_Timer + if (FlameBreath_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_FLAMEBREATH); + FlameBreath_Timer = urand(4000,8000); + } else FlameBreath_Timer -= diff; + + //BurningAdrenalineCaster_Timer + if (BurningAdrenalineCaster_Timer <= diff) + { + Unit *pTarget = NULL; + + uint8 i = 0; + while (i < 3) // max 3 tries to get a random target with power_mana + { + ++i; + pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true); //not aggro leader + if (pTarget && pTarget->getPowerType() == POWER_MANA) + i = 3; + } + if (pTarget) // cast on self (see below) + pTarget->CastSpell(pTarget,SPELL_BURNINGADRENALINE,1); + + BurningAdrenalineCaster_Timer = 15000; + } else BurningAdrenalineCaster_Timer -= diff; + + //BurningAdrenalineTank_Timer + if (BurningAdrenalineTank_Timer <= diff) + { + // have the victim cast the spell on himself otherwise the third effect aura will be applied + // to Vael instead of the player + me->getVictim()->CastSpell(me->getVictim(),SPELL_BURNINGADRENALINE,1); + + BurningAdrenalineTank_Timer = 45000; + } else BurningAdrenalineTank_Timer -= diff; + + //FireNova_Timer + if (FireNova_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_FIRENOVA); + FireNova_Timer = 5000; + } else FireNova_Timer -= diff; + + //TailSwipe_Timer + if (TailSwipe_Timer <= diff) + { + //Only cast if we are behind + /*if (!me->HasInArc(M_PI, me->getVictim())) + { + DoCast(me->getVictim(), SPELL_TAILSWIPE); + }*/ + + TailSwipe_Timer = 20000; + } else TailSwipe_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +void SendDefaultMenu_boss_vael(Player* pPlayer, Creature* pCreature, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) //Fight time + { + pPlayer->CLOSE_GOSSIP_MENU(); + CAST_AI(boss_vaelAI, pCreature->AI())->BeginSpeech(pPlayer); + } +} + +bool GossipSelect_boss_vael(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiSender == GOSSIP_SENDER_MAIN) + SendDefaultMenu_boss_vael(pPlayer, pCreature, uiAction); + + return true; +} + +bool GossipHello_boss_vael(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + 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; +} + +CreatureAI* GetAI_boss_vael(Creature* pCreature) +{ + return new boss_vaelAI (pCreature); +} + +void AddSC_boss_vael() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_vaelastrasz"; + newscript->GetAI = &GetAI_boss_vael; + newscript->pGossipHello = &GossipHello_boss_vael; + newscript->pGossipSelect = &GossipSelect_boss_vael; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_victor_nefarius.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_victor_nefarius.cpp new file mode 100644 index 00000000000..dfeb2519bae --- /dev/null +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_victor_nefarius.cpp @@ -0,0 +1,385 @@ +/* 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_Victor_Nefarius +SD%Complete: 75 +SDComment: Missing some text, Vael beginning event, and spawns Nef in wrong place +SDCategory: Blackwing Lair +EndScriptData */ + +#include "ScriptedPch.h" + +#define SAY_GAMESBEGIN_1 -1469004 +#define SAY_GAMESBEGIN_2 -1469005 +#define SAY_VAEL_INTRO -1469006 //when he corrupts Vaelastrasz + +#define GOSSIP_ITEM_1 "I've made no mistakes." +#define GOSSIP_ITEM_2 "You have lost your mind, Nefarius. You speak in riddles." +#define GOSSIP_ITEM_3 "Please do." + +#define CREATURE_BRONZE_DRAKANOID 14263 +#define CREATURE_BLUE_DRAKANOID 14261 +#define CREATURE_RED_DRAKANOID 14264 +#define CREATURE_GREEN_DRAKANOID 14262 +#define CREATURE_BLACK_DRAKANOID 14265 + +#define CREATURE_CHROMATIC_DRAKANOID 14302 +#define CREATURE_NEFARIAN 11583 + +#define ADD_X1 -7591.151855 +#define ADD_X2 -7514.598633 +#define ADD_Y1 -1204.051880 +#define ADD_Y2 -1150.448853 +#define ADD_Z1 476.800476 +#define ADD_Z2 476.796570 + +#define NEF_X -7445 +#define NEF_Y -1332 +#define NEF_Z 536 + +#define HIDE_X -7592 +#define HIDE_Y -1264 +#define HIDE_Z 481 + +#define SPELL_SHADOWBOLT 21077 +#define SPELL_FEAR 26070 + +//This script is complicated +//Instead of morphing Victor Nefarius we will have him control phase 1 +//And then have him spawn "Nefarian" for phase 2 +//When phase 2 starts Victor Nefarius will go into hiding and stop attacking +//If Nefarian despawns because he killed the players then this guy will EnterEvadeMode +//and allow players to start the event over +//If nefarian dies then he will kill himself then he will kill himself in his hiding place +//To prevent players from doing the event twice + +struct boss_victor_nefariusAI : public ScriptedAI +{ + boss_victor_nefariusAI(Creature *c) : ScriptedAI(c) + { + NefarianGUID = 0; + switch (urand(0,19)) + { + case 0: + DrakType1 = CREATURE_BRONZE_DRAKANOID; + DrakType2 = CREATURE_BLUE_DRAKANOID; + break; + case 1: + DrakType1 = CREATURE_BRONZE_DRAKANOID; + DrakType2 = CREATURE_RED_DRAKANOID; + break; + case 2: + DrakType1 = CREATURE_BRONZE_DRAKANOID; + DrakType2 = CREATURE_GREEN_DRAKANOID; + break; + case 3: + DrakType1 = CREATURE_BRONZE_DRAKANOID; + DrakType2 = CREATURE_BLACK_DRAKANOID; + break; + case 4: + DrakType1 = CREATURE_BLUE_DRAKANOID; + DrakType2 = CREATURE_BRONZE_DRAKANOID; + break; + case 5: + DrakType1 = CREATURE_BLUE_DRAKANOID; + DrakType2 = CREATURE_RED_DRAKANOID; + break; + case 6: + DrakType1 = CREATURE_BLUE_DRAKANOID; + DrakType2 = CREATURE_GREEN_DRAKANOID; + break; + case 7: + DrakType1 = CREATURE_BLUE_DRAKANOID; + DrakType2 = CREATURE_BLACK_DRAKANOID; + break; + case 8: + DrakType1 = CREATURE_RED_DRAKANOID; + DrakType2 = CREATURE_BRONZE_DRAKANOID; + break; + case 9: + DrakType1 = CREATURE_RED_DRAKANOID; + DrakType2 = CREATURE_BLUE_DRAKANOID; + break; + case 10: + DrakType1 = CREATURE_RED_DRAKANOID; + DrakType2 = CREATURE_GREEN_DRAKANOID; + break; + case 11: + DrakType1 = CREATURE_RED_DRAKANOID; + DrakType2 = CREATURE_BLACK_DRAKANOID; + break; + case 12: + DrakType1 = CREATURE_GREEN_DRAKANOID; + DrakType2 = CREATURE_BRONZE_DRAKANOID; + break; + case 13: + DrakType1 = CREATURE_GREEN_DRAKANOID; + DrakType2 = CREATURE_BLUE_DRAKANOID; + break; + case 14: + DrakType1 = CREATURE_GREEN_DRAKANOID; + DrakType2 = CREATURE_RED_DRAKANOID; + break; + case 15: + DrakType1 = CREATURE_GREEN_DRAKANOID; + DrakType2 = CREATURE_BLACK_DRAKANOID; + break; + case 16: + DrakType1 = CREATURE_BLACK_DRAKANOID; + DrakType2 = CREATURE_BRONZE_DRAKANOID; + break; + case 17: + DrakType1 = CREATURE_BLACK_DRAKANOID; + DrakType2 = CREATURE_BLUE_DRAKANOID; + break; + case 18: + DrakType1 = CREATURE_BLACK_DRAKANOID; + DrakType2 = CREATURE_GREEN_DRAKANOID; + break; + case 19: + DrakType1 = CREATURE_BLACK_DRAKANOID; + DrakType2 = CREATURE_RED_DRAKANOID; + break; + } + } + + uint32 SpawnedAdds; + uint32 AddSpawnTimer; + uint32 ShadowBoltTimer; + uint32 FearTimer; + uint32 MindControlTimer; + uint32 ResetTimer; + uint32 DrakType1; + uint32 DrakType2; + uint64 NefarianGUID; + uint32 NefCheckTime; + + void Reset() + { + SpawnedAdds = 0; + AddSpawnTimer = 10000; + ShadowBoltTimer = 5000; + FearTimer = 8000; + ResetTimer = 900000; //On official it takes him 15 minutes(900 seconds) to reset. We are only doing 1 minute to make testing easier + NefarianGUID = 0; + NefCheckTime = 2000; + + me->SetUInt32Value(UNIT_NPC_FLAGS,1); + me->setFaction(35); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + } + + void BeginEvent(Player *pTarget) + { + DoScriptText(SAY_GAMESBEGIN_2, me); + + //Trinity::Singleton::Instance().GetMap(me->GetMapId(), me)->GetPlayers().begin(); + /* + list ::const_iterator i = MapManager::Instance().GetMap(me->GetMapId(), me)->GetPlayers().begin(); + + for (i = MapManager::Instance().GetMap(me->GetMapId(), me)->GetPlayers().begin(); i != MapManager::Instance().GetMap(me->GetMapId(), me)->GetPlayers().end(); ++i) + { + AttackStart((*i)); + } + */ + me->SetUInt32Value(UNIT_NPC_FLAGS,0); + me->setFaction(103); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + AttackStart(pTarget); + } + + void EnterCombat(Unit * /*who*/) + { + } + + void MoveInLineOfSight(Unit *who) + { + //We simply use this function to find players until we can use pMap->GetPlayers() + + if (who && who->GetTypeId() == TYPEID_PLAYER && me->IsHostileTo(who)) + { + //Add them to our threat list + me->AddThreat(who, 0.0f); + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //Only do this if we haven't spawned nef yet + if (SpawnedAdds < 42) + { + //ShadowBoltTimer + if (ShadowBoltTimer <= diff) + { + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) + DoCast(pTarget, SPELL_SHADOWBOLT); + + ShadowBoltTimer = urand(3000,10000); + } else ShadowBoltTimer -= diff; + + //FearTimer + if (FearTimer <= diff) + { + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) + DoCast(pTarget, SPELL_FEAR); + + FearTimer = 10000 + (rand()%10000); + } else FearTimer -= diff; + + //Add spawning mechanism + if (AddSpawnTimer <= diff) + { + //Spawn 2 random types of creatures at the 2 locations + uint32 CreatureID; + Creature* Spawned = NULL; + Unit *pTarget = NULL; + + //1 in 3 chance it will be a chromatic + if (urand(0,2) == 0) + CreatureID = CREATURE_CHROMATIC_DRAKANOID; + else + CreatureID = DrakType1; + + ++SpawnedAdds; + + //Spawn Creature and force it to start attacking a random target + Spawned = me->SummonCreature(CreatureID,ADD_X1,ADD_Y1,ADD_Z1,5.000,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); + pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); + if (pTarget && Spawned) + { + Spawned->AI()->AttackStart(pTarget); + Spawned->setFaction(103); + } + + //1 in 3 chance it will be a chromatic + if (urand(0,2) == 0) + CreatureID = CREATURE_CHROMATIC_DRAKANOID; + else + CreatureID = DrakType2; + + ++SpawnedAdds; + + Spawned = me->SummonCreature(CreatureID,ADD_X2,ADD_Y2,ADD_Z2,5.000,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); + pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); + if (pTarget && Spawned) + { + Spawned->AI()->AttackStart(pTarget); + Spawned->setFaction(103); + } + + //Begin phase 2 by spawning Nefarian and what not + if (SpawnedAdds >= 42) + { + //Teleport Victor Nefarius way out of the map + //MapManager::Instance().GetMap(me->GetMapId(), me)->CreatureRelocation(me,0,0,-5000,0); + + //Inturrupt any spell casting + me->InterruptNonMeleeSpells(false); + + //Root self + DoCast(me, 33356); + + //Make super invis + DoCast(me, 8149); + + //Teleport self to a hiding spot (this causes errors in the Trinity log but no real issues) + DoTeleportTo(HIDE_X,HIDE_Y,HIDE_Z); + me->addUnitState(UNIT_STAT_FLEEING); + + //Spawn nef and have him attack a random target + Creature* Nefarian = me->SummonCreature(CREATURE_NEFARIAN,NEF_X,NEF_Y,NEF_Z,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,120000); + pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); + if (pTarget && Nefarian) + { + Nefarian->AI()->AttackStart(pTarget); + Nefarian->setFaction(103); + NefarianGUID = Nefarian->GetGUID(); + } + else error_log("TSCR: Blackwing Lair: Unable to spawn nefarian properly."); + } + + AddSpawnTimer = 4000; + } else AddSpawnTimer -= diff; + } + else if (NefarianGUID) + { + if (NefCheckTime <= diff) + { + Unit* Nefarian = Unit::GetCreature((*me),NefarianGUID); + + //If nef is dead then we die to so the players get out of combat + //and cannot repeat the event + if (!Nefarian || !Nefarian->isAlive()) + { + NefarianGUID = 0; + me->ForcedDespawn(); + } + + NefCheckTime = 2000; + } else NefCheckTime -= diff; + } + } +}; + +CreatureAI* GetAI_boss_victor_nefarius(Creature* pCreature) +{ + return new boss_victor_nefariusAI (pCreature); +} + +bool GossipHello_boss_victor_nefarius(Player* pPlayer, Creature* pCreature) +{ + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_1 , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->SEND_GOSSIP_MENU(7134, pCreature->GetGUID()); + return true; +} + +bool GossipSelect_boss_victor_nefarius(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction) +{ + switch (uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + pPlayer->SEND_GOSSIP_MENU(7198, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); + pPlayer->SEND_GOSSIP_MENU(7199, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + pPlayer->CLOSE_GOSSIP_MENU(); + DoScriptText(SAY_GAMESBEGIN_1, pCreature); + CAST_AI(boss_victor_nefariusAI, pCreature->AI())->BeginEvent(pPlayer); + break; + } + return true; +} + +void AddSC_boss_victor_nefarius() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_victor_nefarius"; + newscript->GetAI = &GetAI_boss_victor_nefarius; + newscript->pGossipHello = &GossipHello_boss_victor_nefarius; + newscript->pGossipSelect = &GossipSelect_boss_victor_nefarius; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/instance_blackwing_lair.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/instance_blackwing_lair.cpp new file mode 100644 index 00000000000..d6403fa1206 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/instance_blackwing_lair.cpp @@ -0,0 +1,25 @@ +/* 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_Blackwing_Lair +SD%Complete: 0 +SDComment: +SDCategory: Blackwing Lair +EndScriptData */ + +#include "ScriptedPch.h" + diff --git a/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp b/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp new file mode 100644 index 00000000000..5c6bab46e5a --- /dev/null +++ b/src/server/scripts/EasternKingdoms/Deadmines/boss_mr_smite.cpp @@ -0,0 +1,182 @@ +/* +* Copyright (C) 2008-2010 Trinity +* +* 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 Mr.Smite +SD%Complete: +SDComment: Timers and say taken from acid script +EndScriptData */ + +#include "ScriptedPch.h" +#include "deadmines.h" + +enum eSpels +{ + SPELL_TRASH = 3391, + SPELL_SMITE_STOMP = 6432, + SPELL_SMITE_SLAM = 6435, + SPELL_NIMBLE_REFLEXES = 6264, + + EQUIP_SWORD = 5191, + EQUIP_MACE = 7230, + + SAY_AGGRO = -1036001 +}; + +struct boss_mr_smiteAI : public ScriptedAI +{ + boss_mr_smiteAI(Creature* pCreature) : ScriptedAI(pCreature) + { + pInstance = pCreature->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint32 uiTrashTimer; + uint32 uiSlamTimer; + uint32 uiNimbleReflexesTimer; + + uint8 uiHealth; + + uint32 uiPhase; + uint32 uiTimer; + + void Reset() + { + uiTrashTimer = urand(5000,9000); + uiSlamTimer = 9000; + uiNimbleReflexesTimer = urand(15500,31600); + + uiHealth = 0; + + uiPhase = 0; + uiTimer = 0; + + SetEquipmentSlots(false, EQUIP_SWORD, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); + } + + void EnterCombat(Unit* /*pWho*/) + { + DoScriptText(SAY_AGGRO, me); + } + + bool bCheckChances() + { + uint32 uiChances = urand(0,99); + if (uiChances <= 15) + return false; + else + return true; + } + + void UpdateAI(const uint32 uiDiff) + { + if (!UpdateVictim()) + return; + + /*START ACID-AI*/ + if (uiTrashTimer <= uiDiff) + { + if (bCheckChances()) + DoCast(me, SPELL_TRASH); + uiTrashTimer = urand(6000,15500); + } else uiTrashTimer -= uiDiff; + + if (uiSlamTimer <= uiDiff) + { + if (bCheckChances()) + DoCast(me->getVictim(), SPELL_SMITE_SLAM); + uiSlamTimer = 11000; + } else uiSlamTimer -= uiDiff; + + if (uiNimbleReflexesTimer <= uiDiff) + { + if (bCheckChances()) + DoCast(me, SPELL_NIMBLE_REFLEXES); + uiNimbleReflexesTimer = urand(27300,60100); + } else uiNimbleReflexesTimer -= uiDiff; + /*END ACID-AI*/ + + if (uiHealth == 0 && me->GetHealth()*100 / me->GetMaxHealth() <= 66 || uiHealth == 1 && me->GetHealth()*100 / me->GetMaxHealth() <= 33) + { + ++uiHealth; + DoCastAOE(SPELL_SMITE_STOMP,false); + SetCombatMovement(false); + if (pInstance) + if (GameObject* pGo = GameObject::GetGameObject((*me),pInstance->GetData64(DATA_SMITE_CHEST))) + { + me->GetMotionMaster()->Clear(); + me->GetMotionMaster()->MovePoint(1,-3.00+pGo->GetPositionX(),pGo->GetPositionY(),pGo->GetPositionZ()); + } + } + + if (uiPhase) + { + if (uiTimer <= uiDiff) + { + switch(uiPhase) + { + case 1: + me->HandleEmoteCommand(EMOTE_STATE_KNEEL); //dosen't work? + uiTimer = 1000; + uiPhase = 2; + break; + case 2: + if (uiHealth == 1) + SetEquipmentSlots(false, EQUIP_SWORD, EQUIP_SWORD, EQUIP_NO_CHANGE); + else + SetEquipmentSlots(false, EQUIP_MACE, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); + uiTimer = 500; + uiPhase = 3; + break; + case 3: + SetCombatMovement(true); + me->GetMotionMaster()->MoveChase(me->getVictim(), me->m_CombatDistance); + uiPhase = 0; + break; + + } + } else uiTimer -= uiDiff; + } + + DoMeleeAttackIfReady(); + } + + void MovementInform(uint32 uiType, uint32 /*uiId*/) + { + if (uiType != POINT_MOTION_TYPE) + return; + + uiTimer = 1500; + uiPhase = 1; + } + +}; +CreatureAI* GetAI_boss_mr_smite(Creature* pCreature) +{ + return new boss_mr_smiteAI (pCreature); +} + +void AddSC_boss_mr_smite() +{ + Script* newscript; + newscript = new Script; + newscript->Name = "boss_mr_smite"; + newscript->GetAI = &GetAI_boss_mr_smite; + newscript->RegisterSelf(); +} diff --git a/src/server/scripts/EasternKingdoms/Deadmines/deadmines.cpp b/src/server/scripts/EasternKingdoms/Deadmines/deadmines.cpp new file mode 100644 index 00000000000..5bc1121bead --- /dev/null +++ b/src/server/scripts/EasternKingdoms/Deadmines/deadmines.cpp @@ -0,0 +1,60 @@ +/* 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: Deadmines +SD%Complete: 0 +SDComment: Placeholder +SDCategory: Deadmines +EndScriptData */ + +#include "ScriptedPch.h" +#include "deadmines.h" +#include "Spell.h" + +/*##### +# item_Defias_Gunpowder +#####*/ + +bool ItemUse_item_defias_gunpowder(Player* pPlayer, Item* pItem, SpellCastTargets const& targets) +{ + ScriptedInstance *pInstance = pPlayer->GetInstanceData(); + + if (!pInstance) + { + pPlayer->GetSession()->SendNotification("Instance script not initialized"); + return true; + } + if (pInstance->GetData(EVENT_STATE)!= CANNON_NOT_USED) + return false; + if (targets.getGOTarget() && targets.getGOTarget()->GetTypeId() == TYPEID_GAMEOBJECT && + targets.getGOTarget()->GetEntry() == GO_DEFIAS_CANNON) + { + pInstance->SetData(EVENT_STATE, CANNON_GUNPOWDER_USED); + } + + pPlayer->DestroyItemCount(pItem->GetEntry(), 1, true); + return true; +} + +void AddSC_deadmines() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "item_defias_gunpowder"; + newscript->pItemUse = &ItemUse_item_defias_gunpowder; + newscript->RegisterSelf(); +} diff --git a/src/server/scripts/EasternKingdoms/Deadmines/deadmines.h b/src/server/scripts/EasternKingdoms/Deadmines/deadmines.h new file mode 100644 index 00000000000..203494ad5b7 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/Deadmines/deadmines.h @@ -0,0 +1,35 @@ +#ifndef DEF_DEADMINES_H +#define DEF_DEADMINES_H + +#include "ScriptedPch.h" + +enum CannonState +{ + CANNON_NOT_USED, + CANNON_GUNPOWDER_USED, + CANNON_BLAST_INITIATED, + PIRATES_ATTACK, + EVENT_DONE +}; + +enum Data +{ + EVENT_STATE, + EVENT_RHAHKZOR +}; + +enum Data64 +{ + DATA_SMITE_CHEST +}; + +enum GameObjects +{ + GO_FACTORY_DOOR = 13965, + GO_IRONCLAD_DOOR = 16397, + GO_DEFIAS_CANNON = 16398, + GO_DOOR_LEVER = 101833, + GO_MR_SMITE_CHEST = 144111 +}; +#endif + diff --git a/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp b/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp new file mode 100644 index 00000000000..f1aa0c62b8a --- /dev/null +++ b/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp @@ -0,0 +1,256 @@ +/* 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: Instance_Deadmines +SD%Complete: 100 +SDComment: +SDCategory: Deadmines +EndScriptData */ + +#include "ScriptedPch.h" +#include "deadmines.h" + +enum Sounds +{ + SOUND_CANNONFIRE = 1400, + SOUND_DESTROYDOOR = 3079, + SOUND_MR_SMITE_ALARM1 = 5775, + SOUND_MR_SMITE_ALARM2 = 5777 +}; + +#define SAY_MR_SMITE_ALARM1 "You there, check out that noise!" +#define SAY_MR_SMITE_ALARM2 "We're under attack! A vast, ye swabs! Repel the invaders!" + +enum Misc +{ + DATA_CANNON_BLAST_TIMER = 3000, + DATA_PIRATES_DELAY_TIMER = 1000 +}; + +struct instance_deadmines : public ScriptedInstance +{ + instance_deadmines(Map* pMap) : ScriptedInstance(pMap) { Initialize(); }; + + uint64 FactoryDoorGUID; + uint64 IronCladDoorGUID; + uint64 DefiasCannonGUID; + uint64 DoorLeverGUID; + uint64 DefiasPirate1GUID; + uint64 DefiasPirate2GUID; + uint64 DefiasCompanionGUID; + + uint32 State; + uint32 CannonBlast_Timer; + uint32 PiratesDelay_Timer; + uint64 uiSmiteChestGUID; + + void Initialize() + { + FactoryDoorGUID = 0; + IronCladDoorGUID = 0; + DefiasCannonGUID = 0; + DoorLeverGUID = 0; + DefiasPirate1GUID = 0; + DefiasPirate2GUID = 0; + DefiasCompanionGUID = 0; + + State = CANNON_NOT_USED; + uiSmiteChestGUID = 0; + } + + virtual void Update(uint32 diff) + { + if (!IronCladDoorGUID || !DefiasCannonGUID || !DoorLeverGUID) + return; + + GameObject *pIronCladDoor = instance->GetGameObject(IronCladDoorGUID); + if (!pIronCladDoor) + return; + + switch (State) + { + case CANNON_GUNPOWDER_USED: + CannonBlast_Timer = DATA_CANNON_BLAST_TIMER; + // it's a hack - Mr. Smite should do that but his too far away + pIronCladDoor->SetName("Mr. Smite"); + pIronCladDoor->MonsterYell(SAY_MR_SMITE_ALARM1, LANG_UNIVERSAL, 0); + DoPlaySound(pIronCladDoor, SOUND_MR_SMITE_ALARM1); + State = CANNON_BLAST_INITIATED; + break; + case CANNON_BLAST_INITIATED: + PiratesDelay_Timer = DATA_PIRATES_DELAY_TIMER; + if (CannonBlast_Timer <= diff) + { + SummonCreatures(); + ShootCannon(); + BlastOutDoor(); + LeverStucked(); + pIronCladDoor->MonsterYell(SAY_MR_SMITE_ALARM2, LANG_UNIVERSAL, 0); + DoPlaySound(pIronCladDoor, SOUND_MR_SMITE_ALARM2); + State = PIRATES_ATTACK; + } else CannonBlast_Timer -= diff; + break; + case PIRATES_ATTACK: + if (PiratesDelay_Timer <= diff) + { + MoveCreaturesInside(); + State = EVENT_DONE; + } else PiratesDelay_Timer -= diff; + break; + } + } + + void SummonCreatures() + { + if (GameObject *pIronCladDoor = instance->GetGameObject(IronCladDoorGUID)) + { + Creature *DefiasPirate1 = pIronCladDoor->SummonCreature(657,pIronCladDoor->GetPositionX() - 2,pIronCladDoor->GetPositionY()-7,pIronCladDoor->GetPositionZ(), 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000); + Creature *DefiasPirate2 = pIronCladDoor->SummonCreature(657,pIronCladDoor->GetPositionX() + 3,pIronCladDoor->GetPositionY()-6,pIronCladDoor->GetPositionZ(), 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000); + Creature *DefiasCompanion = pIronCladDoor->SummonCreature(3450,pIronCladDoor->GetPositionX() + 2,pIronCladDoor->GetPositionY()-6,pIronCladDoor->GetPositionZ(), 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000); + + DefiasPirate1GUID = DefiasPirate1->GetGUID(); + DefiasPirate2GUID = DefiasPirate2->GetGUID(); + DefiasCompanionGUID = DefiasCompanion->GetGUID(); + } + } + + void MoveCreaturesInside() + { + if (!DefiasPirate1GUID || !DefiasPirate2GUID || !DefiasCompanionGUID) + return; + + Creature *pDefiasPirate1 = instance->GetCreature(DefiasPirate1GUID); + Creature *pDefiasPirate2 = instance->GetCreature(DefiasPirate2GUID); + Creature *pDefiasCompanion = instance->GetCreature(DefiasCompanionGUID); + if (!pDefiasPirate1 || !pDefiasPirate2 || !pDefiasCompanion) + return; + + MoveCreatureInside(pDefiasPirate1); + MoveCreatureInside(pDefiasPirate2); + MoveCreatureInside(pDefiasCompanion); + } + + void MoveCreatureInside(Creature* pCreature) + { + pCreature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + pCreature->GetMotionMaster()->MovePoint(0, -102.7,-655.9, pCreature->GetPositionZ()); + } + + void ShootCannon() + { + if (GameObject *pDefiasCannon = instance->GetGameObject(DefiasCannonGUID)) + { + pDefiasCannon->SetGoState(GO_STATE_ACTIVE); + DoPlaySound(pDefiasCannon, SOUND_CANNONFIRE); + } + } + + void BlastOutDoor() + { + if (GameObject *pIronCladDoor = instance->GetGameObject(IronCladDoorGUID)) + { + pIronCladDoor->SetGoState(GO_STATE_ACTIVE_ALTERNATIVE); + DoPlaySound(pIronCladDoor, SOUND_DESTROYDOOR); + } + } + + void LeverStucked() + { + if (GameObject *pDoorLever = instance->GetGameObject(DoorLeverGUID)) + pDoorLever->SetUInt32Value(GAMEOBJECT_FLAGS, 4); + } + + void OnGameObjectCreate(GameObject* pGo, bool /*add*/) + { + switch(pGo->GetEntry()) + { + case GO_FACTORY_DOOR: FactoryDoorGUID = pGo->GetGUID(); break; + case GO_IRONCLAD_DOOR: IronCladDoorGUID = pGo->GetGUID(); break; + case GO_DEFIAS_CANNON: DefiasCannonGUID = pGo->GetGUID(); break; + case GO_DOOR_LEVER: DoorLeverGUID = pGo->GetGUID(); break; + case GO_MR_SMITE_CHEST: uiSmiteChestGUID = pGo->GetGUID(); break; + } + } + + void SetData(uint32 type, uint32 data) + { + switch (type) + { + case EVENT_STATE: + if (DefiasCannonGUID && IronCladDoorGUID) + State=data; + break; + case EVENT_RHAHKZOR: + if (data == DONE) + if (GameObject* pGo = instance->GetGameObject(FactoryDoorGUID)) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + } + } + + uint32 GetData(uint32 type) + { + switch (type) + { + case EVENT_STATE: + return State; + } + + return 0; + } + + uint64 GetData64(uint32 data) + { + switch (data) + { + case DATA_SMITE_CHEST: + return uiSmiteChestGUID; + } + + return 0; + } + + void DoPlaySound(GameObject* unit, uint32 sound) + { + WorldPacket data(4); + data.SetOpcode(SMSG_PLAY_SOUND); + data << uint32(sound); + unit->SendMessageToSet(&data,false); + } + + void DoPlaySoundCreature(Unit* unit, uint32 sound) + { + WorldPacket data(4); + data.SetOpcode(SMSG_PLAY_SOUND); + data << uint32(sound); + unit->SendMessageToSet(&data,false); + } +}; + +InstanceData* GetInstanceData_instance_deadmines(Map* pMap) +{ + return new instance_deadmines(pMap); +} + +void AddSC_instance_deadmines() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_deadmines"; + newscript->GetInstanceData = &GetInstanceData_instance_deadmines; + newscript->RegisterSelf(); +} diff --git a/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp new file mode 100644 index 00000000000..c39bfb69910 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp @@ -0,0 +1,593 @@ +/* + * Copyright (C) 2010 Trinity + * + * 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 + */ + +/* Script Data Start +SDName: Gnomeregan +SDAuthor: Manuel +SD%Complete: 90% +SDComment: Some visual effects are not implemented. +Script Data End */ + +#include "ScriptedPch.h" +#include "gnomeregan.h" +#include "ScriptedEscortAI.h" + +#define GOSSIP_START_EVENT "I am ready to being" + +enum eBlastmasterEmiShortfuse +{ + GOSSIP_TEXT_EMI = 1693, + + SAY_BLASTMASTER_0 = -1090000, + SAY_BLASTMASTER_1 = -1090001, + SAY_BLASTMASTER_2 = -1090002, + SAY_BLASTMASTER_3 = -1090003, + SAY_BLASTMASTER_4 = -1090004, + SAY_BLASTMASTER_5 = -1090005, + SAY_BLASTMASTER_6 = -1090006, + SAY_BLASTMASTER_7 = -1090007, + SAY_BLASTMASTER_8 = -1090008, + SAY_BLASTMASTER_9 = -1090009, + SAY_BLASTMASTER_10 = -1090010, + SAY_BLASTMASTER_11 = -1090011, + SAY_BLASTMASTER_12 = -1090012, + SAY_BLASTMASTER_13 = -1090013, + SAY_BLASTMASTER_14 = -1090014, + SAY_BLASTMASTER_15 = -1090015, + SAY_BLASTMASTER_16 = -1090016, + SAY_BLASTMASTER_17 = -1090017, + SAY_BLASTMASTER_18 = -1090018, + SAY_BLASTMASTER_19 = -1090019, + SAY_BLASTMASTER_20 = -1090020, + SAY_BLASTMASTER_21 = -1090021, + SAY_BLASTMASTER_22 = -1090022, + SAY_BLASTMASTER_23 = -1090023, + SAY_BLASTMASTER_24 = -1090024, + SAY_BLASTMASTER_25 = -1090025, + SAY_BLASTMASTER_26 = -1090026, + SAY_BLASTMASTER_27 = -1090027, + + SAY_GRUBBIS = -1090028 +}; + +const Position SpawnPosition[] = +{ + {-557.630,-114.514,-152.209,0.641}, + {-555.263,-113.802,-152.737,0.311}, + {-552.154,-112.476,-153.349,0.621}, + {-548.692,-111.089,-154.090,0.621}, + {-546.905,-108.340,-154.877,0.729}, + {-547.736,-105.154,-155.176,0.372}, + {-547.274,-114.109,-153.952,0.735}, + {-552.534,-110.012,-153.577,0.747}, + {-550.708,-116.436,-153.103,0.679}, + {-554.030,-115.983,-152.635,0.695}, + {-494.595,-87.516,149.116,3.344}, + {-493.349,-90.845,-148.882,3.717}, + {-491.995,-87.619,-148.197,3.230}, + {-490.732,-90.739,-148.091,3.230}, + {-490.554,-89.114,-148.055,3.230}, + {-495.240,-90.808,-149.493,3.238}, + {-494.195,-89.553,-149.131,3.254} +}; + +struct npc_blastmaster_emi_shortfuseAI : public npc_escortAI +{ + npc_blastmaster_emi_shortfuseAI(Creature* pCreature) : npc_escortAI(pCreature) + { + pInstance = pCreature->GetInstanceData(); + pCreature->RestoreFaction(); + Reset(); + } + + ScriptedInstance* pInstance; + + uint8 uiPhase; + uint32 uiTimer; + + std::list SummonList; + std::list GoSummonList; + + void Reset() + { + if (!HasEscortState(STATE_ESCORT_ESCORTING)) + { + uiTimer = 0; + uiPhase = 0; + + RestoreAll(); + + SummonList.clear(); + GoSummonList.clear(); + } + } + + void NextStep(uint32 uiTimerStep,bool bNextStep = true,uint8 uiPhaseStep = 0) + { + uiTimer = uiTimerStep; + if (bNextStep) + ++uiPhase; + else + uiPhase = uiPhaseStep; + } + + void CaveDestruction(bool bBool) + { + if (GoSummonList.empty()) + return; + + for (std::list::const_iterator itr = GoSummonList.begin(); itr != GoSummonList.end(); ++itr) + { + if (GameObject* pGo = GameObject::GetGameObject(*me, *itr)) + { + if (pGo) + { + if (Creature *trigger = pGo->SummonTrigger(pGo->GetPositionX(), pGo->GetPositionY(),pGo->GetPositionZ(), 0, 1)) + { + //visual effects are not working! ¬¬ + trigger->CastSpell(trigger,11542,true); + trigger->CastSpell(trigger,35470,true); + } + pGo->RemoveFromWorld(); + //pGo->CastSpell(me,12158); makes all die?! + } + } + } + + if (bBool) + { + if (pInstance) + if (GameObject* pGo = GameObject::GetGameObject((*me),pInstance->GetData64(DATA_GO_CAVE_IN_RIGHT))) + pInstance->HandleGameObject(NULL,false,pGo); + }else + if (pInstance) + if (GameObject* pGo = GameObject::GetGameObject((*me),pInstance->GetData64(DATA_GO_CAVE_IN_LEFT))) + pInstance->HandleGameObject(NULL,false,pGo); + } + + void SetInFace(bool bBool) + { + if (!pInstance) + return; + + if (bBool) + { + if (GameObject* pGo = GameObject::GetGameObject((*me),pInstance->GetData64(DATA_GO_CAVE_IN_RIGHT))) + me->SetFacingToObject(pGo); + }else + if (GameObject* pGo = GameObject::GetGameObject((*me),pInstance->GetData64(DATA_GO_CAVE_IN_LEFT))) + me->SetFacingToObject(pGo); + } + + void RestoreAll() + { + if (!pInstance) + return; + + if (GameObject* pGo = GameObject::GetGameObject((*me),pInstance->GetData64(DATA_GO_CAVE_IN_RIGHT))) + pInstance->HandleGameObject(NULL,false,pGo); + + if (GameObject* pGo = GameObject::GetGameObject((*me),pInstance->GetData64(DATA_GO_CAVE_IN_LEFT))) + pInstance->HandleGameObject(NULL,false,pGo); + + if (!GoSummonList.empty()) + for (std::list::const_iterator itr = GoSummonList.begin(); itr != GoSummonList.end(); ++itr) + { + if (GameObject* pGo = GameObject::GetGameObject(*me, *itr)) + pGo->RemoveFromWorld(); + } + + if (!SummonList.empty()) + for (std::list::const_iterator itr = SummonList.begin(); itr != SummonList.end(); ++itr) + { + if (Creature* pSummon = Unit::GetCreature(*me, *itr)) + { + if (pSummon->isAlive()) + pSummon->DisappearAndDie(); + else + pSummon->RemoveCorpse(); + } + } + } + + void AggroAllPlayers(Creature* pTemp) + { + Map::PlayerList const &PlList = me->GetMap()->GetPlayers(); + + if (PlList.isEmpty()) + return; + + for (Map::PlayerList::const_iterator i = PlList.begin(); i != PlList.end(); ++i) + { + if (Player* pPlayer = i->getSource()) + { + if (pPlayer->isGameMaster()) + continue; + + if (pPlayer->isAlive()) + { + pTemp->SetInCombatWith(pPlayer); + pPlayer->SetInCombatWith(pTemp); + pTemp->AddThreat(pPlayer, 0.0f); + } + } + } + } + + void WaypointReached(uint32 uiPoint) + { + //just in case + if (GetPlayerForEscort()) + if (me->getFaction() != GetPlayerForEscort()->getFaction()) + me->setFaction(GetPlayerForEscort()->getFaction()); + + switch(uiPoint) + { + case 3: + SetEscortPaused(true); + NextStep(2000,false,3); + break; + case 7: + SetEscortPaused(true); + NextStep(2000,false,4); + break; + case 9: + NextStep(1000,false,8); + break; + case 10: + NextStep(25000,false,10); + break; + case 11: + SetEscortPaused(true); + SetInFace(true); + NextStep(1000,false,11); + break; + case 12: + NextStep(25000,false,18); + break; + case 13: + Summon(7); + NextStep(25000,false,19); + break; + case 14: + SetInFace(false); + DoScriptText(SAY_BLASTMASTER_26,me); + SetEscortPaused(true); + NextStep(5000,false,20); + break; + } + } + + void SetData(uint32 uiI,uint32 uiValue) + { + switch(uiI) + { + case 1: + SetEscortPaused(true); + DoScriptText(SAY_BLASTMASTER_0,me); + NextStep(1500,true); + break; + case 2: + if (!pInstance) + return; + + switch(uiValue) + { + case 1: + pInstance->SetData(TYPE_EVENT, IN_PROGRESS); + break; + case 2: + pInstance->SetData(TYPE_EVENT, DONE); + NextStep(5000,false,22); + break; + } + break; + } + } + + void Summon(uint8 uiCase) + { + switch(uiCase) + { + case 1: + me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000); + me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000); + me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000); + me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000); + me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[4], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000); + me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[5], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000); + me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[6], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000); + me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[7], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000); + me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[8], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000); + me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[9], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000); + break; + case 2: + if (GameObject* pGo = me->SummonGameObject(183410, -533.140,-105.322,-156.016, 0, 0, 0, 0, 0, 1000)) + { + GoSummonList.push_back(pGo->GetGUID()); + pGo->SetFlag(GAMEOBJECT_FLAGS,GO_FLAG_UNK1); //We can't use it! + } + Summon(3); + break; + case 3: + me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000); + me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000); + me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000); + me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000); + DoScriptText(SAY_BLASTMASTER_19,me); + break; + case 4: + if (GameObject* pGo = me->SummonGameObject(183410, -542.199,-96.854,-155.790, 0, 0, 0, 0, 0, 1000)) + { + GoSummonList.push_back(pGo->GetGUID()); + pGo->SetFlag(GAMEOBJECT_FLAGS,GO_FLAG_UNK1); + } + break; + case 5: + me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000); + me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000); + me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000); + DoScriptText(SAY_BLASTMASTER_15,me); + break; + case 6: + me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[10], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000); + me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[11], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000); + me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[12], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000); + me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[13], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000); + me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[14], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000); + break; + case 7: + if (GameObject* pGo = me->SummonGameObject(183410, -507.820,-103.333,-151.353, 0, 0, 0, 0, 0, 1000)) + { + GoSummonList.push_back(pGo->GetGUID()); + pGo->SetFlag(GAMEOBJECT_FLAGS,GO_FLAG_UNK1); //We can't use it! + Summon(6); + } + break; + case 8: + if (GameObject* pGo = me->SummonGameObject(183410, -511.829,-86.249,-151.431, 0, 0, 0, 0, 0, 1000)) + { + GoSummonList.push_back(pGo->GetGUID()); + pGo->SetFlag(GAMEOBJECT_FLAGS,GO_FLAG_UNK1); //We can't use it! + } + break; + case 9: + if (Creature* pGrubbis = me->SummonCreature(NPC_GRUBBIS, SpawnPosition[15], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000)) + DoScriptText(SAY_GRUBBIS,pGrubbis); + me->SummonCreature(NPC_CHOMPER, SpawnPosition[16], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000); + break; + } + } + + void UpdateEscortAI(const uint32 uiDiff) + { + if (uiPhase) + { + if (uiTimer <= uiDiff) + { + switch(uiPhase) + { + case 1: + DoScriptText(SAY_BLASTMASTER_1,me); + NextStep(1500,true); + break; + case 2: + SetEscortPaused(false); + NextStep(0,false,0); + break; + case 3: + DoScriptText(SAY_BLASTMASTER_2,me); + SetEscortPaused(false); + NextStep(0,false,0); + break; + case 4: + DoScriptText(SAY_BLASTMASTER_3,me); + NextStep(3000,true); + break; + case 5: + DoScriptText(SAY_BLASTMASTER_4,me); + NextStep(3000,true); + break; + case 6: + SetInFace(true); + DoScriptText(SAY_BLASTMASTER_5,me); + Summon(1); + if (pInstance) + if (GameObject* pGo = GameObject::GetGameObject((*me),pInstance->GetData64(DATA_GO_CAVE_IN_RIGHT))) + pInstance->HandleGameObject(NULL,true,pGo); + NextStep(3000,true); + break; + case 7: + DoScriptText(SAY_BLASTMASTER_6,me); + SetEscortPaused(false); + NextStep(0,false,0); + break; + case 8: + me->HandleEmoteCommand(EMOTE_STATE_WORK); + NextStep(25000,true); + break; + case 9: + Summon(2); + NextStep(0,false); + break; + case 10: + Summon(4); + NextStep(0,false); + break; + case 11: + DoScriptText(SAY_BLASTMASTER_17,me); + NextStep(5000,true); + break; + case 12: + DoScriptText(SAY_BLASTMASTER_18,me); + NextStep(5000,true); + break; + case 13: + DoScriptText(SAY_BLASTMASTER_20,me); + CaveDestruction(true); + NextStep(8000,true); + break; + case 14: + DoScriptText(SAY_BLASTMASTER_21,me); + NextStep(8500,true); + break; + case 15: + DoScriptText(SAY_BLASTMASTER_22,me); + NextStep(2000,true); + break; + case 16: + DoScriptText(SAY_BLASTMASTER_23,me); + SetInFace(false); + if (pInstance) + if (GameObject* pGo = GameObject::GetGameObject((*me),pInstance->GetData64(DATA_GO_CAVE_IN_LEFT))) + pInstance->HandleGameObject(NULL,true,pGo); + NextStep(2000,true); + break; + case 17: + SetEscortPaused(false); + DoScriptText(SAY_BLASTMASTER_24,me); + Summon(6); + NextStep(0,false); + break; + case 18: + Summon(7); + NextStep(0,false); + break; + case 19: + SetInFace(false); + Summon(8); + DoScriptText(SAY_BLASTMASTER_25,me); + NextStep(0,false); + break; + case 20: + DoScriptText(SAY_BLASTMASTER_27,me); + NextStep(2000,true); + break; + case 21: + Summon(9); + NextStep(0,false); + break; + case 22: + CaveDestruction(false); + DoScriptText(SAY_BLASTMASTER_20,me); + NextStep(0,false); + break; + } + } else uiTimer -= uiDiff; + } + + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + + void JustSummoned(Creature* pSummon) + { + SummonList.push_back(pSummon->GetGUID()); + AggroAllPlayers(pSummon); + } +}; + +CreatureAI* GetAI_npc_blastmaster_emi_shortfuse(Creature* pCreature) +{ + return new npc_blastmaster_emi_shortfuseAI(pCreature); +} + +bool GossipHello_npc_blastmaster_emi_shortfuse(Player* pPlayer, Creature* pCreature) +{ + ScriptedInstance* pInstance = pCreature->GetInstanceData(); + + if (pInstance && pInstance->GetData(TYPE_EVENT) == NOT_STARTED) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_START_EVENT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXT_EMI, pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_blastmaster_emi_shortfuse(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + if (npc_escortAI* pEscortAI = CAST_AI(npc_blastmaster_emi_shortfuseAI, pCreature->AI())) + pEscortAI->Start(true, false,pPlayer->GetGUID()); + + pCreature->setFaction(pPlayer->getFaction()); + pCreature->AI()->SetData(1,0); + + pPlayer->CLOSE_GOSSIP_MENU(); + } + return true; +} + +struct boss_grubbisAI : public ScriptedAI +{ + boss_grubbisAI(Creature* pCreature) : ScriptedAI(pCreature) + { + SetDataSummoner(); + } + + void SetDataSummoner() + { + if (!me->isSummon()) + return; + + if (Unit* pSummon = CAST_SUM(me)->GetSummoner()) + CAST_CRE(pSummon)->AI()->SetData(2,1); + } + + void UpdateAI(const uint32 /*diff*/) + { + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + + void JustDied(Unit* /*pKiller*/) + { + if (!me->isSummon()) + return; + + if (Unit* pSummon = CAST_SUM(me)->GetSummoner()) + CAST_CRE(pSummon)->AI()->SetData(2,2); + } +}; + +CreatureAI* GetAI_boss_grubbis(Creature* pCreature) +{ + return new boss_grubbisAI(pCreature); +} + +void AddSC_gnomeregan() +{ + Script* newscript; + + newscript = new Script; + newscript->Name = "npc_blastmaster_emi_shortfuse"; + newscript->pGossipHello = &GossipHello_npc_blastmaster_emi_shortfuse; + newscript->pGossipSelect = &GossipSelect_npc_blastmaster_emi_shortfuse; + newscript->GetAI = &GetAI_npc_blastmaster_emi_shortfuse; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_grubbis"; + newscript->GetAI = &GetAI_boss_grubbis; + newscript->RegisterSelf(); +} diff --git a/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.h b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.h new file mode 100644 index 00000000000..e46c811e9b1 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.h @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2010 Trinity + * + * 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 + */ + +#ifndef DEF_GNOMEREGAN_H +#define DEF_GNOMEREGAN_H + +enum eGameObjects +{ + GO_CAVE_IN_LEFT = 146085, + GO_CAVE_IN_RIGHT = 146086 +}; + +enum eCreatures +{ + NPC_BLASTMASTER_EMI_SHORTFUSE = 7998, + NPC_CAVERNDEEP_AMBUSHER = 6207, + NPC_GRUBBIS = 7361, + NPC_CHOMPER = 6215 +}; + +enum eData +{ + TYPE_EVENT = 1 +}; + +enum eData64 +{ + DATA_GO_CAVE_IN_LEFT, + DATA_GO_CAVE_IN_RIGHT, + DATA_NPC_BASTMASTER_EMI_SHORTFUSE +}; + +#endif diff --git a/src/server/scripts/EasternKingdoms/Gnomeregan/instance_gnomeregan.cpp b/src/server/scripts/EasternKingdoms/Gnomeregan/instance_gnomeregan.cpp new file mode 100644 index 00000000000..980a6d3552b --- /dev/null +++ b/src/server/scripts/EasternKingdoms/Gnomeregan/instance_gnomeregan.cpp @@ -0,0 +1,141 @@ +/* + * Copyright (C) 2010 Trinity + * + * 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 + */ + +#include "ScriptedPch.h" +#include "gnomeregan.h" + +#define MAX_ENCOUNTER 1 + +struct instance_gnomeregan : public ScriptedInstance +{ + instance_gnomeregan(Map* pMap) : ScriptedInstance(pMap) + { + Initialize(); + }; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + + uint64 uiCaveInLeftGUID; + uint64 uiCaveInRightGUID; + + uint64 uiBastmasterEmiShortfuseGUID; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + uiCaveInLeftGUID = 0; + uiCaveInRightGUID = 0; + + uiBastmasterEmiShortfuseGUID = 0; + } + + 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]; + + for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) + { + if (m_auiEncounter[i] == IN_PROGRESS) + m_auiEncounter[i] = NOT_STARTED; + } + + OUT_LOAD_INST_DATA_COMPLETE; + } + + void OnCreatureCreate(Creature* pCreature, bool /*bAdd*/) + { + switch(pCreature->GetEntry()) + { + case NPC_BLASTMASTER_EMI_SHORTFUSE: uiBastmasterEmiShortfuseGUID = pCreature->GetGUID(); break; + } + } + + void OnGameObjectCreate(GameObject* pGo, bool /*bAdd*/) + { + switch(pGo->GetEntry()) + { + case GO_CAVE_IN_LEFT: + uiCaveInLeftGUID = pGo->GetGUID(); + if (m_auiEncounter[0] == DONE || m_auiEncounter[0] == NOT_STARTED) + HandleGameObject(NULL,false,pGo); + break; + case GO_CAVE_IN_RIGHT: + uiCaveInRightGUID = pGo->GetGUID(); + if (m_auiEncounter[0] == DONE || m_auiEncounter[0] == NOT_STARTED) + HandleGameObject(NULL,false,pGo); + break; + } + } + + void SetData(uint32 uiType, uint32 uiData) + { + switch(uiType) + { + case TYPE_EVENT: + m_auiEncounter[0] = uiData; + if (uiData == DONE) + SaveToDB(); + break; + } + } + + uint32 GetData(uint32 uiType, uint32 /*uiData*/) + { + switch(uiType) + { + case TYPE_EVENT: return m_auiEncounter[0]; + } + } + + uint64 GetData64(uint32 uiType) + { + switch(uiType) + { + case DATA_GO_CAVE_IN_LEFT: return uiCaveInLeftGUID; + case DATA_GO_CAVE_IN_RIGHT: return uiCaveInRightGUID; + case DATA_NPC_BASTMASTER_EMI_SHORTFUSE: return uiBastmasterEmiShortfuseGUID; + } + + return 0; + } +}; + +InstanceData* GetInstanceData_instance_gnomeregan(Map* pMap) +{ + return new instance_gnomeregan(pMap); +} + +void AddSC_instance_gnomeregan() +{ + Script* newscript; + + newscript = new Script; + newscript->Name = "instance_gnomeregan"; + newscript->GetInstanceData = &GetInstanceData_instance_gnomeregan; + newscript->RegisterSelf(); +} diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_curator.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_curator.cpp new file mode 100644 index 00000000000..7105d27ca6a --- /dev/null +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_curator.cpp @@ -0,0 +1,196 @@ +/* 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_Curator +SD%Complete: 100 +SDComment: +SDCategory: Karazhan +EndScriptData */ + +#include "ScriptedPch.h" + +#define SAY_AGGRO -1532057 +#define SAY_SUMMON1 -1532058 +#define SAY_SUMMON2 -1532059 +#define SAY_EVOCATE -1532060 +#define SAY_ENRAGE -1532061 +#define SAY_KILL1 -1532062 +#define SAY_KILL2 -1532063 +#define SAY_DEATH -1532064 + +//Flare spell info +#define SPELL_ASTRAL_FLARE_PASSIVE 30234 //Visual effect + Flare damage + +//Curator spell info +#define SPELL_HATEFUL_BOLT 30383 +#define SPELL_EVOCATION 30254 +#define SPELL_ENRAGE 30403 //Arcane Infusion: Transforms Curator and adds damage. +#define SPELL_BERSERK 26662 + +struct boss_curatorAI : public ScriptedAI +{ + boss_curatorAI(Creature *c) : ScriptedAI(c) {} + + uint32 AddTimer; + uint32 HatefulBoltTimer; + uint32 BerserkTimer; + + bool Enraged; + bool Evocating; + + void Reset() + { + AddTimer = 10000; + HatefulBoltTimer = 15000; //This time may be wrong + BerserkTimer = 720000; //12 minutes + Enraged = false; + Evocating = false; + + me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_ARCANE, true); + } + + void KilledUnit(Unit * /*victim*/) + { + DoScriptText(RAND(SAY_KILL1,SAY_KILL2), me); + } + + void JustDied(Unit * /*victim*/) + { + DoScriptText(SAY_DEATH, me); + } + + void EnterCombat(Unit * /*who*/) + { + DoScriptText(SAY_AGGRO, me); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //always decrease BerserkTimer + if (BerserkTimer <= diff) + { + //if evocate, then break evocate + if (Evocating) + { + if (me->HasAura(SPELL_EVOCATION)) + me->RemoveAurasDueToSpell(SPELL_EVOCATION); + + Evocating = false; + } + + //may not be correct SAY (generic hard enrage) + DoScriptText(SAY_ENRAGE, me); + + me->InterruptNonMeleeSpells(true); + DoCast(me, SPELL_BERSERK); + + //don't know if he's supposed to do summon/evocate after hard enrage (probably not) + Enraged = true; + } else BerserkTimer -= diff; + + if (Evocating) + { + //not supposed to do anything while evocate + if (me->HasAura(SPELL_EVOCATION)) + return; + else + Evocating = false; + } + + if (!Enraged) + { + if (AddTimer <= diff) + { + //Summon Astral Flare + Creature* AstralFlare = DoSpawnCreature(17096, rand()%37, rand()%37, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + Unit *pTarget = NULL; + pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + + if (AstralFlare && pTarget) + { + AstralFlare->CastSpell(AstralFlare, SPELL_ASTRAL_FLARE_PASSIVE, false); + AstralFlare->AI()->AttackStart(pTarget); + } + + //Reduce Mana by 10% of max health + if (int32 mana = me->GetMaxPower(POWER_MANA)) + { + mana /= 10; + me->ModifyPower(POWER_MANA, -mana); + + //if this get's us below 10%, then we evocate (the 10th should be summoned now) + if (me->GetPower(POWER_MANA)*100 / me->GetMaxPower(POWER_MANA) < 10) + { + DoScriptText(SAY_EVOCATE, me); + me->InterruptNonMeleeSpells(false); + DoCast(me, SPELL_EVOCATION); + Evocating = true; + //no AddTimer cooldown, this will make first flare appear instantly after evocate end, like expected + return; + } + else + { + if (urand(0,1) == 0) + { + DoScriptText(RAND(SAY_SUMMON1,SAY_SUMMON2), me); + } + } + } + + AddTimer = 10000; + } else AddTimer -= diff; + + if (me->GetHealth()*100 / me->GetMaxHealth() <= 15) + { + Enraged = true; + DoCast(me, SPELL_ENRAGE); + DoScriptText(SAY_ENRAGE, me); + } + } + + if (HatefulBoltTimer <= diff) + { + if (Enraged) + HatefulBoltTimer = 7000; + else + HatefulBoltTimer = 15000; + + if (Unit *pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO, 1)) + DoCast(pTarget, SPELL_HATEFUL_BOLT); + + } else HatefulBoltTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_curator(Creature* pCreature) +{ + return new boss_curatorAI (pCreature); +} + +void AddSC_boss_curator() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_curator"; + newscript->GetAI = &GetAI_boss_curator; + newscript->RegisterSelf(); +} diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_maiden_of_virtue.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_maiden_of_virtue.cpp new file mode 100644 index 00000000000..21db1be1be3 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_maiden_of_virtue.cpp @@ -0,0 +1,138 @@ +/* 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_Maiden_of_Virtue +SD%Complete: 100 +SDComment: +SDCategory: Karazhan +EndScriptData */ + +#include "ScriptedPch.h" + +#define SAY_AGGRO -1532018 +#define SAY_SLAY1 -1532019 +#define SAY_SLAY2 -1532020 +#define SAY_SLAY3 -1532021 +#define SAY_REPENTANCE1 -1532022 +#define SAY_REPENTANCE2 -1532023 +#define SAY_DEATH -1532024 + +#define SPELL_REPENTANCE 29511 +#define SPELL_HOLYFIRE 29522 +#define SPELL_HOLYWRATH 32445 +#define SPELL_HOLYGROUND 29512 +#define SPELL_BERSERK 26662 + +struct boss_maiden_of_virtueAI : public ScriptedAI +{ + boss_maiden_of_virtueAI(Creature *c) : ScriptedAI(c) {} + + uint32 Repentance_Timer; + uint32 Holyfire_Timer; + uint32 Holywrath_Timer; + uint32 Holyground_Timer; + uint32 Enrage_Timer; + + bool Enraged; + + void Reset() + { + Repentance_Timer = 25000+(rand()%15000); + Holyfire_Timer = 8000+(rand()%17000); + Holywrath_Timer = 15000+(rand()%10000); + Holyground_Timer = 3000; + Enrage_Timer = 600000; + + Enraged = false; + } + + void KilledUnit(Unit* /*Victim*/) + { + if (urand(0,1) == 0) + DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), me); + } + + void JustDied(Unit* /*Killer*/) + { + DoScriptText(SAY_DEATH, me); + } + + void EnterCombat(Unit * /*who*/) + { + DoScriptText(SAY_AGGRO, me); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (Enrage_Timer < diff && !Enraged) + { + DoCast(me, SPELL_BERSERK, true); + Enraged = true; + } else Enrage_Timer -= diff; + + if (Holyground_Timer <= diff) + { + DoCast(me, SPELL_HOLYGROUND, true); //Triggered so it doesn't interrupt her at all + Holyground_Timer = 3000; + } else Holyground_Timer -= diff; + + if (Repentance_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_REPENTANCE); + DoScriptText(RAND(SAY_REPENTANCE1,SAY_REPENTANCE2), me); + + Repentance_Timer = urand(25000,35000); //A little randomness on that spell + } else Repentance_Timer -= diff; + + if (Holyfire_Timer <= diff) + { + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) + DoCast(pTarget, SPELL_HOLYFIRE); + + Holyfire_Timer = urand(8000,23000); //Anywhere from 8 to 23 seconds, good luck having several of those in a row! + } else Holyfire_Timer -= diff; + + if (Holywrath_Timer <= diff) + { + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) + DoCast(pTarget, SPELL_HOLYWRATH); + + Holywrath_Timer = urand(20000,25000); //20-30 secs sounds nice + } else Holywrath_Timer -= diff; + + DoMeleeAttackIfReady(); + } + +}; + +CreatureAI* GetAI_boss_maiden_of_virtue(Creature* pCreature) +{ + return new boss_maiden_of_virtueAI (pCreature); +} + +void AddSC_boss_maiden_of_virtue() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_maiden_of_virtue"; + newscript->GetAI = &GetAI_boss_maiden_of_virtue; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp new file mode 100644 index 00000000000..a2f2a8b605e --- /dev/null +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp @@ -0,0 +1,310 @@ +/* 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_Midnight +SD%Complete: 100 +SDComment: +SDCategory: Karazhan +EndScriptData */ + +#include "ScriptedPch.h" + +#define SAY_MIDNIGHT_KILL -1532000 +#define SAY_APPEAR1 -1532001 +#define SAY_APPEAR2 -1532002 +#define SAY_APPEAR3 -1532003 +#define SAY_MOUNT -1532004 +#define SAY_KILL1 -1532005 +#define SAY_KILL2 -1532006 +#define SAY_DISARMED -1532007 +#define SAY_DEATH -1532008 +#define SAY_RANDOM1 -1532009 +#define SAY_RANDOM2 -1532010 + +#define SPELL_SHADOWCLEAVE 29832 +#define SPELL_INTANGIBLE_PRESENCE 29833 +#define SPELL_BERSERKER_CHARGE 26561 //Only when mounted + +#define MOUNTED_DISPLAYID 16040 + +//Attumen (TODO: Use the summoning spell instead of Creature id. It works , but is not convenient for us) +#define SUMMON_ATTUMEN 15550 + +struct boss_midnightAI : public ScriptedAI +{ + boss_midnightAI(Creature *c) : ScriptedAI(c) {} + + uint64 Attumen; + uint8 Phase; + uint32 Mount_Timer; + + void Reset() + { + Phase = 1; + Attumen = 0; + Mount_Timer = 0; + + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + me->SetVisibility(VISIBILITY_ON); + } + + void EnterCombat(Unit* /*who*/) {} + + void KilledUnit(Unit * /*victim*/) + { + if (Phase == 2) + { + if (Unit *pUnit = Unit::GetUnit(*me, Attumen)) + DoScriptText(SAY_MIDNIGHT_KILL, pUnit); + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (Phase == 1 && (me->GetHealth()*100)/me->GetMaxHealth() < 95) + { + Phase = 2; + if (Creature* pAttumen = me->SummonCreature(SUMMON_ATTUMEN, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30000)) + { + Attumen = pAttumen->GetGUID(); + pAttumen->AI()->AttackStart(me->getVictim()); + SetMidnight(pAttumen, me->GetGUID()); + DoScriptText(RAND(SAY_APPEAR1,SAY_APPEAR2,SAY_APPEAR3), pAttumen); + } + } + else if (Phase == 2 && (me->GetHealth()*100)/me->GetMaxHealth() < 25) + { + if (Unit *pAttumen = Unit::GetUnit(*me, Attumen)) + Mount(pAttumen); + } + else if (Phase == 3) + { + if (Mount_Timer) + { + if (Mount_Timer <= diff) + { + Mount_Timer = 0; + me->SetVisibility(VISIBILITY_OFF); + me->GetMotionMaster()->MoveIdle(); + if (Unit *pAttumen = Unit::GetUnit(*me, Attumen)) + { + pAttumen->SetDisplayId(MOUNTED_DISPLAYID); + pAttumen->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + if (pAttumen->getVictim()) + { + pAttumen->GetMotionMaster()->MoveChase(pAttumen->getVictim()); + pAttumen->SetUInt64Value(UNIT_FIELD_TARGET, pAttumen->getVictim()->GetGUID()); + } + pAttumen->SetFloatValue(OBJECT_FIELD_SCALE_X,1); + } + } else Mount_Timer -= diff; + } + } + + if (Phase != 3) + DoMeleeAttackIfReady(); + } + + void Mount(Unit *pAttumen) + { + DoScriptText(SAY_MOUNT, pAttumen); + Phase = 3; + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + pAttumen->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + float angle = me->GetAngle(pAttumen); + float distance = me->GetDistance2d(pAttumen); + float newX = me->GetPositionX() + cos(angle)*(distance/2) ; + float newY = me->GetPositionY() + sin(angle)*(distance/2) ; + float newZ = 50; + //me->Relocate(newX,newY,newZ,angle); + //me->SendMonsterMove(newX, newY, newZ, 0, true, 1000); + me->GetMotionMaster()->Clear(); + me->GetMotionMaster()->MovePoint(0, newX, newY, newZ); + distance += 10; + newX = me->GetPositionX() + cos(angle)*(distance/2) ; + newY = me->GetPositionY() + sin(angle)*(distance/2) ; + pAttumen->GetMotionMaster()->Clear(); + pAttumen->GetMotionMaster()->MovePoint(0, newX, newY, newZ); + //pAttumen->Relocate(newX,newY,newZ,-angle); + //pAttumen->SendMonsterMove(newX, newY, newZ, 0, true, 1000); + Mount_Timer = 1000; + } + + void SetMidnight(Creature *, uint64); //Below .. +}; + +CreatureAI* GetAI_boss_midnight(Creature* pCreature) +{ + return new boss_midnightAI(pCreature); +} + +struct boss_attumenAI : public ScriptedAI +{ + boss_attumenAI(Creature *c) : ScriptedAI(c) + { + Phase = 1; + + CleaveTimer = urand(10000,15000); + CurseTimer = 30000; + RandomYellTimer = urand(30000,60000); //Occasionally yell + ChargeTimer = 20000; + ResetTimer = 0; + } + + uint64 Midnight; + uint8 Phase; + uint32 CleaveTimer; + uint32 CurseTimer; + uint32 RandomYellTimer; + uint32 ChargeTimer; //only when mounted + uint32 ResetTimer; + + void Reset() + { + ResetTimer = 2000; + } + + void EnterCombat(Unit* /*who*/) {} + + void KilledUnit(Unit * /*victim*/) + { + DoScriptText(RAND(SAY_KILL1,SAY_KILL2), me); + } + + void JustDied(Unit * /*victim*/) + { + DoScriptText(SAY_DEATH, me); + if (Unit *pMidnight = Unit::GetUnit(*me, Midnight)) + pMidnight->Kill(pMidnight); + } + + void UpdateAI(const uint32 diff) + { + if (ResetTimer) + { + if (ResetTimer <= diff) + { + ResetTimer = 0; + Unit *pMidnight = Unit::GetUnit(*me, Midnight); + if (pMidnight) + { + pMidnight->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + pMidnight->SetVisibility(VISIBILITY_ON); + } + Midnight = 0; + me->SetVisibility(VISIBILITY_OFF); + me->Kill(me); + } + } else ResetTimer -= diff; + + //Return since we have no target + if (!UpdateVictim()) + return; + + if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE)) + return; + + if (CleaveTimer <= diff) + { + DoCast(me->getVictim(), SPELL_SHADOWCLEAVE); + CleaveTimer = urand(10000,15000); + } else CleaveTimer -= diff; + + if (CurseTimer <= diff) + { + DoCast(me->getVictim(), SPELL_INTANGIBLE_PRESENCE); + CurseTimer = 30000; + } else CurseTimer -= diff; + + if (RandomYellTimer <= diff) + { + DoScriptText(RAND(SAY_RANDOM1,SAY_RANDOM2), me); + RandomYellTimer = urand(30000,60000); + } else RandomYellTimer -= diff; + + if (me->GetUInt32Value(UNIT_FIELD_DISPLAYID) == MOUNTED_DISPLAYID) + { + if (ChargeTimer <= 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 && !pTarget->IsWithinDist(me, ATTACK_DISTANCE, false)) + target_list.push_back(pTarget); + pTarget = NULL; + } + if (target_list.size()) + pTarget = *(target_list.begin()+rand()%target_list.size()); + + DoCast(pTarget, SPELL_BERSERKER_CHARGE); + ChargeTimer = 20000; + } else ChargeTimer -= diff; + } + else + { + if ((me->GetHealth()*100)/me->GetMaxHealth() < 25) + { + Creature *pMidnight = Unit::GetCreature(*me, Midnight); + if (pMidnight && pMidnight->GetTypeId() == TYPEID_UNIT) + { + CAST_AI(boss_midnightAI, (pMidnight->AI()))->Mount(me); + me->SetHealth(pMidnight->GetHealth()); + DoResetThreat(); + } + } + } + + DoMeleeAttackIfReady(); + } + + void SpellHit(Unit * /*source*/, const SpellEntry *spell) + { + if (spell->Mechanic == MECHANIC_DISARM) + DoScriptText(SAY_DISARMED, me); + } +}; + +void boss_midnightAI::SetMidnight(Creature *pAttumen, uint64 value) +{ + CAST_AI(boss_attumenAI, pAttumen->AI())->Midnight = value; +} + +CreatureAI* GetAI_boss_attumen(Creature* pCreature) +{ + return new boss_attumenAI (pCreature); +} + +void AddSC_boss_attumen() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_attumen"; + newscript->GetAI = &GetAI_boss_attumen; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_midnight"; + newscript->GetAI = &GetAI_boss_midnight; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp new file mode 100644 index 00000000000..6c8fabcca35 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp @@ -0,0 +1,785 @@ +/* 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_Moroes +SD%Complete: 95 +SDComment: +SDCategory: Karazhan +EndScriptData */ + +#include "ScriptedPch.h" +#include "karazhan.h" + +#define SAY_AGGRO -1532011 +#define SAY_SPECIAL_1 -1532012 +#define SAY_SPECIAL_2 -1532013 +#define SAY_KILL_1 -1532014 +#define SAY_KILL_2 -1532015 +#define SAY_KILL_3 -1532016 +#define SAY_DEATH -1532017 + +#define SPELL_VANISH 29448 +#define SPELL_GARROTE 37066 +#define SPELL_BLIND 34694 +#define SPELL_GOUGE 29425 +#define SPELL_FRENZY 37023 + +#define POS_Z 81.73 + +float Locations[4][3]= +{ + {-10991.0, -1884.33, 0.614315}, + {-10989.4, -1885.88, 0.904913}, + {-10978.1, -1887.07, 2.035550}, + {-10975.9, -1885.81, 2.253890}, +}; + +const uint32 Adds[6]= +{ + 17007, + 19872, + 19873, + 19874, + 19875, + 19876, +}; + +struct boss_moroesAI : public ScriptedAI +{ + boss_moroesAI(Creature *c) : ScriptedAI(c) + { + for (uint8 i = 0; i < 4; ++i) + { + AddId[i] = 0; + } + pInstance = c->GetInstanceData(); + } + + ScriptedInstance *pInstance; + + uint64 AddGUID[4]; + + uint32 Vanish_Timer; + uint32 Blind_Timer; + uint32 Gouge_Timer; + uint32 Wait_Timer; + uint32 CheckAdds_Timer; + uint32 AddId[4]; + + bool InVanish; + bool Enrage; + + void Reset() + { + Vanish_Timer = 30000; + Blind_Timer = 35000; + Gouge_Timer = 23000; + Wait_Timer = 0; + CheckAdds_Timer = 5000; + + Enrage = false; + InVanish = false; + if (me->GetHealth() > 0) + { + SpawnAdds(); + } + + if (pInstance) + pInstance->SetData(TYPE_MOROES, NOT_STARTED); + } + + void StartEvent() + { + if (pInstance) + pInstance->SetData(TYPE_MOROES, IN_PROGRESS); + + DoZoneInCombat(); + } + + void EnterCombat(Unit* /*who*/) + { + StartEvent(); + + DoScriptText(SAY_AGGRO, me); + AddsAttack(); + DoZoneInCombat(); + } + + void KilledUnit(Unit* /*victim*/) + { + DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2,SAY_KILL_3), me); + } + + void JustDied(Unit* /*victim*/) + { + DoScriptText(SAY_DEATH, me); + + if (pInstance) + pInstance->SetData(TYPE_MOROES, DONE); + + DeSpawnAdds(); + + //remove aura from spell Garrote when Moroes dies + if (pInstance) + pInstance->DoRemoveAurasDueToSpellOnPlayers(SPELL_GARROTE); + } + + void SpawnAdds() + { + DeSpawnAdds(); + if (isAddlistEmpty()) + { + Creature *pCreature = NULL; + std::vector AddList; + + for (uint8 i = 0; i < 6; ++i) + AddList.push_back(Adds[i]); + + while (AddList.size() > 4) + AddList.erase((AddList.begin())+(rand()%AddList.size())); + + uint8 i = 0; + for (std::vector::const_iterator itr = AddList.begin(); itr != AddList.end(); ++itr) + { + uint32 entry = *itr; + + pCreature = me->SummonCreature(entry, Locations[i][0], Locations[i][1], POS_Z, Locations[i][2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); + if (pCreature) + { + AddGUID[i] = pCreature->GetGUID(); + AddId[i] = entry; + } + ++i; + } + }else + { + for (uint8 i = 0; i < 4; ++i) + { + Creature *pCreature = me->SummonCreature(AddId[i], Locations[i][0], Locations[i][1], POS_Z, Locations[i][2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); + if (pCreature) + { + AddGUID[i] = pCreature->GetGUID(); + } + } + } + } + + bool isAddlistEmpty() + { + for (uint8 i = 0; i < 4; ++i) + { + if (AddId[i] == 0) + return true; + } + return false; + } + + void DeSpawnAdds() + { + for (uint8 i = 0; i < 4 ; ++i) + { + Creature* Temp = NULL; + if (AddGUID[i]) + { + Temp = Creature::GetCreature((*me),AddGUID[i]); + if (Temp && Temp->isAlive()) + Temp->DisappearAndDie(); + } + } + } + + void AddsAttack() + { + for (uint8 i = 0; i < 4; ++i) + { + Creature* Temp = NULL; + if (AddGUID[i]) + { + Temp = Creature::GetCreature((*me),AddGUID[i]); + if (Temp && Temp->isAlive()) + { + Temp->AI()->AttackStart(me->getVictim()); + DoZoneInCombat(Temp); + } else + EnterEvadeMode(); + } + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (pInstance && !pInstance->GetData(TYPE_MOROES)) + { + EnterEvadeMode(); + return; + } + + if (!Enrage && me->GetHealth()*100 / me->GetMaxHealth() < 30) + { + DoCast(me, SPELL_FRENZY); + Enrage = true; + } + + if (CheckAdds_Timer <= diff) + { + for (uint8 i = 0; i < 4; ++i) + { + Creature* Temp = NULL; + if (AddGUID[i]) + { + Temp = Unit::GetCreature((*me),AddGUID[i]); + if (Temp && Temp->isAlive()) + if (!Temp->getVictim()) + Temp->AI()->AttackStart(me->getVictim()); + } + } + CheckAdds_Timer = 5000; + } else CheckAdds_Timer -= diff; + + if (!Enrage) + { + //Cast Vanish, then Garrote random victim + if (Vanish_Timer <= diff) + { + DoCast(me, SPELL_VANISH); + InVanish = true; + Vanish_Timer = 30000; + Wait_Timer = 5000; + } else Vanish_Timer -= diff; + + if (Gouge_Timer <= diff) + { + DoCastVictim(SPELL_GOUGE); + Gouge_Timer = 40000; + } else Gouge_Timer -= diff; + + if (Blind_Timer <= diff) + { + std::list pTargets; + SelectTargetList(pTargets, 5, SELECT_TARGET_RANDOM, me->GetMeleeReach()*5, true); + for (std::list::const_iterator i = pTargets.begin(); i != pTargets.end(); ++i) + if (!me->IsWithinMeleeRange(*i)) + { + DoCast(*i, SPELL_BLIND); + break; + } + Blind_Timer = 40000; + } else Blind_Timer -= diff; + } + + if (InVanish) + { + if (Wait_Timer <= diff) + { + DoScriptText(RAND(SAY_SPECIAL_1,SAY_SPECIAL_2), me); + + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) + pTarget->CastSpell(pTarget, SPELL_GARROTE,true); + + InVanish = false; + } else Wait_Timer -= diff; + } + + if (!InVanish) + DoMeleeAttackIfReady(); + } +}; + +struct boss_moroes_guestAI : public ScriptedAI +{ + ScriptedInstance* pInstance; + + uint64 GuestGUID[4]; + + boss_moroes_guestAI(Creature* c) : ScriptedAI(c) + { + for (uint8 i = 0; i < 4; ++i) + GuestGUID[i] = 0; + + pInstance = c->GetInstanceData(); + } + + void Reset() + { + if (pInstance) + pInstance->SetData(TYPE_MOROES, NOT_STARTED); + } + + void AcquireGUID() + { + if (!pInstance) + return; + + uint64 MoroesGUID = pInstance->GetData64(DATA_MOROES); + Creature* Moroes = (Unit::GetCreature((*me), MoroesGUID)); + if (Moroes) + { + for (uint8 i = 0; i < 4; ++i) + { + uint64 GUID = CAST_AI(boss_moroesAI, Moroes->AI())->AddGUID[i]; + if (GUID) + GuestGUID[i] = GUID; + } + } + } + + Unit* SelectGuestTarget() + { + uint64 TempGUID = GuestGUID[rand()%4]; + if (TempGUID) + { + Unit* pUnit = Unit::GetUnit((*me), TempGUID); + if (pUnit && pUnit->isAlive()) + return pUnit; + } + + return me; + } + + void UpdateAI(const uint32 /*diff*/) + { + if (pInstance && !pInstance->GetData(TYPE_MOROES)) + EnterEvadeMode(); + + DoMeleeAttackIfReady(); + } +}; + +#define SPELL_MANABURN 29405 +#define SPELL_MINDFLY 29570 +#define SPELL_SWPAIN 34441 +#define SPELL_SHADOWFORM 29406 + +struct boss_baroness_dorothea_millstipeAI : public boss_moroes_guestAI +{ + //Shadow Priest + boss_baroness_dorothea_millstipeAI(Creature *c) : boss_moroes_guestAI(c) {} + + uint32 ManaBurn_Timer; + uint32 MindFlay_Timer; + uint32 ShadowWordPain_Timer; + + void Reset() + { + ManaBurn_Timer = 7000; + MindFlay_Timer = 1000; + ShadowWordPain_Timer = 6000; + + DoCast(me, SPELL_SHADOWFORM, true); + + boss_moroes_guestAI::Reset(); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + boss_moroes_guestAI::UpdateAI(diff); + + if (MindFlay_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_MINDFLY); + MindFlay_Timer = 12000; // 3 sec channeled + } else MindFlay_Timer -= diff; + + if (ManaBurn_Timer <= diff) + { + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) + if (pTarget->getPowerType() == POWER_MANA) + DoCast(pTarget, SPELL_MANABURN); + ManaBurn_Timer = 5000; // 3 sec cast + } else ManaBurn_Timer -= diff; + + if (ShadowWordPain_Timer <= diff) + { + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) + { + DoCast(pTarget, SPELL_SWPAIN); + ShadowWordPain_Timer = 7000; + } + } else ShadowWordPain_Timer -= diff; + } +}; + +#define SPELL_HAMMEROFJUSTICE 13005 +#define SPELL_JUDGEMENTOFCOMMAND 29386 +#define SPELL_SEALOFCOMMAND 29385 + +struct boss_baron_rafe_dreugerAI : public boss_moroes_guestAI +{ + //Retr Pally + boss_baron_rafe_dreugerAI(Creature *c) : boss_moroes_guestAI(c){} + + uint32 HammerOfJustice_Timer; + uint32 SealOfCommand_Timer; + uint32 JudgementOfCommand_Timer; + + void Reset() + { + HammerOfJustice_Timer = 1000; + SealOfCommand_Timer = 7000; + JudgementOfCommand_Timer = SealOfCommand_Timer + 29000; + + boss_moroes_guestAI::Reset(); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + boss_moroes_guestAI::UpdateAI(diff); + + if (SealOfCommand_Timer <= diff) + { + DoCast(me, SPELL_SEALOFCOMMAND); + SealOfCommand_Timer = 32000; + JudgementOfCommand_Timer = 29000; + } else SealOfCommand_Timer -= diff; + + if (JudgementOfCommand_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_JUDGEMENTOFCOMMAND); + JudgementOfCommand_Timer = SealOfCommand_Timer + 29000; + } else JudgementOfCommand_Timer -= diff; + + if (HammerOfJustice_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_HAMMEROFJUSTICE); + HammerOfJustice_Timer = 12000; + } else HammerOfJustice_Timer -= diff; + } +}; + +#define SPELL_DISPELMAGIC 15090 //Self or other guest+Moroes +#define SPELL_GREATERHEAL 29564 //Self or other guest+Moroes +#define SPELL_HOLYFIRE 29563 +#define SPELL_PWSHIELD 29408 + +struct boss_lady_catriona_von_indiAI : public boss_moroes_guestAI +{ + //Holy Priest + boss_lady_catriona_von_indiAI(Creature *c) : boss_moroes_guestAI(c) {} + + uint32 DispelMagic_Timer; + uint32 GreaterHeal_Timer; + uint32 HolyFire_Timer; + uint32 PowerWordShield_Timer; + + void Reset() + { + DispelMagic_Timer = 11000; + GreaterHeal_Timer = 1500; + HolyFire_Timer = 5000; + PowerWordShield_Timer = 1000; + + AcquireGUID(); + + boss_moroes_guestAI::Reset(); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + boss_moroes_guestAI::UpdateAI(diff); + + if (PowerWordShield_Timer <= diff) + { + DoCast(me, SPELL_PWSHIELD); + PowerWordShield_Timer = 15000; + } else PowerWordShield_Timer -= diff; + + if (GreaterHeal_Timer <= diff) + { + Unit *pTarget = SelectGuestTarget(); + + DoCast(pTarget, SPELL_GREATERHEAL); + GreaterHeal_Timer = 17000; + } else GreaterHeal_Timer -= diff; + + if (HolyFire_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_HOLYFIRE); + HolyFire_Timer = 22000; + } else HolyFire_Timer -= diff; + + if (DispelMagic_Timer <= diff) + { + if (Unit *pTarget = RAND(SelectGuestTarget(), SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))) + DoCast(pTarget, SPELL_DISPELMAGIC); + + DispelMagic_Timer = 25000; + } else DispelMagic_Timer -= diff; + } +}; + +#define SPELL_CLEANSE 29380 //Self or other guest+Moroes +#define SPELL_GREATERBLESSOFMIGHT 29381 //Self or other guest+Moroes +#define SPELL_HOLYLIGHT 29562 //Self or other guest+Moroes +#define SPELL_DIVINESHIELD 41367 + +struct boss_lady_keira_berrybuckAI : public boss_moroes_guestAI +{ + //Holy Pally + boss_lady_keira_berrybuckAI(Creature *c) : boss_moroes_guestAI(c) {} + + uint32 Cleanse_Timer; + uint32 GreaterBless_Timer; + uint32 HolyLight_Timer; + uint32 DivineShield_Timer; + + void Reset() + { + Cleanse_Timer = 13000; + GreaterBless_Timer = 1000; + HolyLight_Timer = 7000; + DivineShield_Timer = 31000; + + AcquireGUID(); + + boss_moroes_guestAI::Reset(); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + boss_moroes_guestAI::UpdateAI(diff); + + if (DivineShield_Timer <= diff) + { + DoCast(me, SPELL_DIVINESHIELD); + DivineShield_Timer = 31000; + } else DivineShield_Timer -= diff; + + if (HolyLight_Timer <= diff) + { + Unit *pTarget = SelectGuestTarget(); + + DoCast(pTarget, SPELL_HOLYLIGHT); + HolyLight_Timer = 10000; + } else HolyLight_Timer -= diff; + + if (GreaterBless_Timer <= diff) + { + Unit *pTarget = SelectGuestTarget(); + + DoCast(pTarget, SPELL_GREATERBLESSOFMIGHT); + + GreaterBless_Timer = 50000; + } else GreaterBless_Timer -= diff; + + if (Cleanse_Timer <= diff) + { + Unit *pTarget = SelectGuestTarget(); + + DoCast(pTarget, SPELL_CLEANSE); + + Cleanse_Timer = 10000; + } else Cleanse_Timer -= diff; + } +}; + +#define SPELL_HAMSTRING 9080 +#define SPELL_MORTALSTRIKE 29572 +#define SPELL_WHIRLWIND 29573 + +struct boss_lord_robin_darisAI : public boss_moroes_guestAI +{ + //Arms Warr + boss_lord_robin_darisAI(Creature *c) : boss_moroes_guestAI(c) {} + + uint32 Hamstring_Timer; + uint32 MortalStrike_Timer; + uint32 WhirlWind_Timer; + + void Reset() + { + Hamstring_Timer = 7000; + MortalStrike_Timer = 10000; + WhirlWind_Timer = 21000; + + boss_moroes_guestAI::Reset(); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + boss_moroes_guestAI::UpdateAI(diff); + + if (Hamstring_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_HAMSTRING); + Hamstring_Timer = 12000; + } else Hamstring_Timer -= diff; + + if (MortalStrike_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_MORTALSTRIKE); + MortalStrike_Timer = 18000; + } else MortalStrike_Timer -= diff; + + if (WhirlWind_Timer <= diff) + { + DoCast(me, SPELL_WHIRLWIND); + WhirlWind_Timer = 21000; + } else WhirlWind_Timer -= diff; + } +}; + +#define SPELL_DISARM 8379 +#define SPELL_HEROICSTRIKE 29567 +#define SPELL_SHIELDBASH 11972 +#define SPELL_SHIELDWALL 29390 + +struct boss_lord_crispin_ferenceAI : public boss_moroes_guestAI +{ + //Arms Warr + boss_lord_crispin_ferenceAI(Creature *c) : boss_moroes_guestAI(c) {} + + uint32 Disarm_Timer; + uint32 HeroicStrike_Timer; + uint32 ShieldBash_Timer; + uint32 ShieldWall_Timer; + + void Reset() + { + Disarm_Timer = 6000; + HeroicStrike_Timer = 10000; + ShieldBash_Timer = 8000; + ShieldWall_Timer = 4000; + + boss_moroes_guestAI::Reset(); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + boss_moroes_guestAI::UpdateAI(diff); + + if (Disarm_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_DISARM); + Disarm_Timer = 12000; + } else Disarm_Timer -= diff; + + if (HeroicStrike_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_HEROICSTRIKE); + HeroicStrike_Timer = 10000; + } else HeroicStrike_Timer -= diff; + + if (ShieldBash_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_SHIELDBASH); + ShieldBash_Timer = 13000; + } else ShieldBash_Timer -= diff; + + if (ShieldWall_Timer <= diff) + { + DoCast(me, SPELL_SHIELDWALL); + ShieldWall_Timer = 21000; + } else ShieldWall_Timer -= diff; + } +}; + +CreatureAI* GetAI_boss_moroes(Creature* pCreature) +{ + return new boss_moroesAI (pCreature); +} + +CreatureAI* GetAI_baroness_dorothea_millstipe(Creature* pCreature) +{ + return new boss_baroness_dorothea_millstipeAI (pCreature); +} + +CreatureAI* GetAI_baron_rafe_dreuger(Creature* pCreature) +{ + return new boss_baron_rafe_dreugerAI (pCreature); +} + +CreatureAI* GetAI_lady_catriona_von_indi(Creature* pCreature) +{ + return new boss_lady_catriona_von_indiAI (pCreature); +} + +CreatureAI* GetAI_lady_keira_berrybuck(Creature* pCreature) +{ + return new boss_lady_keira_berrybuckAI (pCreature); +} + +CreatureAI* GetAI_lord_robin_daris(Creature* pCreature) +{ + return new boss_lord_robin_darisAI (pCreature); +} + +CreatureAI* GetAI_lord_crispin_ference(Creature* pCreature) +{ + return new boss_lord_crispin_ferenceAI (pCreature); +} + +void AddSC_boss_moroes() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_moroes"; + newscript->GetAI = &GetAI_boss_moroes; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_baroness_dorothea_millstipe"; + newscript->GetAI = &GetAI_baroness_dorothea_millstipe; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_baron_rafe_dreuger"; + newscript->GetAI = &GetAI_baron_rafe_dreuger; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_lady_catriona_von_indi"; + newscript->GetAI = &GetAI_lady_catriona_von_indi; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_lady_keira_berrybuck"; + newscript->GetAI = &GetAI_lady_keira_berrybuck; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_lord_robin_daris"; + newscript->GetAI = &GetAI_lord_robin_daris; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_lord_crispin_ference"; + newscript->GetAI = &GetAI_lord_crispin_ference; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_netherspite.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_netherspite.cpp new file mode 100644 index 00000000000..004f1902bfc --- /dev/null +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_netherspite.cpp @@ -0,0 +1,343 @@ +/* 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_Netherspite +SD%Complete: 90 +SDComment: Not sure about timing and portals placing +SDCategory: Karazhan +EndScriptData */ + +#include "ScriptedPch.h" +#include "karazhan.h" + +#define EMOTE_PHASE_PORTAL -1532089 +#define EMOTE_PHASE_BANISH -1532090 + +#define SPELL_NETHERBURN_AURA 30522 +#define SPELL_VOIDZONE 37063 +#define SPELL_NETHER_INFUSION 38688 +#define SPELL_NETHERBREATH 38523 +#define SPELL_BANISH_VISUAL 39833 +#define SPELL_BANISH_ROOT 42716 +#define SPELL_EMPOWERMENT 38549 +#define SPELL_NETHERSPITE_ROAR 38684 + +const float PortalCoord[3][3] = +{ + {-11195.353516, -1613.237183, 278.237258}, // Left side + {-11137.846680, -1685.607422, 278.239258}, // Right side + {-11094.493164, -1591.969238, 279.949188} // Back side +}; + +enum Netherspite_Portal{ + RED_PORTAL = 0, // Perseverence + GREEN_PORTAL = 1, // Serenity + BLUE_PORTAL = 2 // Dominance +}; + +const uint32 PortalID[3] = {17369, 17367, 17368}; +const uint32 PortalVisual[3] = {30487,30490,30491}; +const uint32 PortalBeam[3] = {30465,30464,30463}; +const uint32 PlayerBuff[3] = {30421,30422,30423}; +const uint32 NetherBuff[3] = {30466,30467,30468}; +const uint32 PlayerDebuff[3] = {38637,38638,38639}; + +struct boss_netherspiteAI : public ScriptedAI +{ + boss_netherspiteAI(Creature* c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + + for (int i=0; i<3; ++i) + { + PortalGUID[i] = 0; + BeamTarget[i] = 0; + BeamerGUID[i] = 0; + } + // need core fix + for (int i=0; i<3; ++i) + { + if (SpellEntry *spell = (SpellEntry*)GetSpellStore()->LookupEntry(PlayerBuff[i])) + spell->AttributesEx |= SPELL_ATTR_EX_NEGATIVE; + } + } + + ScriptedInstance* pInstance; + + bool PortalPhase; + bool Berserk; + uint32 PhaseTimer; // timer for phase switching + uint32 VoidZoneTimer; + uint32 NetherInfusionTimer; // berserking timer + uint32 NetherbreathTimer; + uint32 EmpowermentTimer; + uint32 PortalTimer; // timer for beam checking + uint64 PortalGUID[3]; // guid's of portals + uint64 BeamerGUID[3]; // guid's of auxiliary beaming portals + uint64 BeamTarget[3]; // guid's of portals' current targets + + bool IsBetween(WorldObject* u1, WorldObject *pTarget, WorldObject* u2) // the in-line checker + { + if (!u1 || !u2 || !pTarget) + return false; + + float xn, yn, xp, yp, xh, yh; + xn = u1->GetPositionX(); + yn = u1->GetPositionY(); + xp = u2->GetPositionX(); + yp = u2->GetPositionY(); + xh = pTarget->GetPositionX(); + yh = pTarget->GetPositionY(); + + // check if target is between (not checking distance from the beam yet) + if (dist(xn,yn,xh,yh) >= dist(xn,yn,xp,yp) || dist(xp,yp,xh,yh) >= dist(xn,yn,xp,yp)) + return false; + // check distance from the beam + return (abs((xn-xp)*yh+(yp-yn)*xh-xn*yp+xp*yn)/dist(xn,yn,xp,yp) < 1.5f); + } + + float dist(float xa, float ya, float xb, float yb) // auxiliary method for distance + { + return sqrt((xa-xb)*(xa-xb) + (ya-yb)*(ya-yb)); + } + + void Reset() + { + Berserk = false; + NetherInfusionTimer = 540000; + VoidZoneTimer = 15000; + NetherbreathTimer = 3000; + + HandleDoors(true); + DestroyPortals(); + } + + void SummonPortals() + { + uint8 r = rand()%4; + uint8 pos[3]; + pos[RED_PORTAL] = (r%2 ? (r>1 ? 2: 1): 0); + pos[GREEN_PORTAL] = (r%2 ? 0: (r>1 ? 2: 1)); + pos[BLUE_PORTAL] = (r>1 ? 1: 2); // Blue Portal not on the left side (0) + + for (int i=0; i<3; ++i) + if (Creature *portal = me->SummonCreature(PortalID[i],PortalCoord[pos[i]][0],PortalCoord[pos[i]][1],PortalCoord[pos[i]][2],0,TEMPSUMMON_TIMED_DESPAWN,60000)) + { + PortalGUID[i] = portal->GetGUID(); + portal->AddAura(PortalVisual[i], portal); + } + } + + void DestroyPortals() + { + for (int i=0; i<3; ++i) + { + if (Creature *portal = Unit::GetCreature(*me, PortalGUID[i])) + portal->DisappearAndDie(); + if (Creature *portal = Unit::GetCreature(*me, BeamerGUID[i])) + portal->DisappearAndDie(); + PortalGUID[i] = 0; + BeamTarget[i] = 0; + } + } + + void UpdatePortals() // Here we handle the beams' behavior + { + for (int j=0; j<3; ++j) // j = color + if (Creature *portal = Unit::GetCreature(*me, PortalGUID[j])) + { + // the one who's been casted upon before + Unit *current = Unit::GetUnit(*portal, BeamTarget[j]); + // temporary store for the best suitable beam reciever + Unit *pTarget = me; + + if (Map* map = me->GetMap()) + { + Map::PlayerList const& players = map->GetPlayers(); + + // get the best suitable target + for (Map::PlayerList::const_iterator i = players.begin(); i != players.end(); ++i) + { + Player* p = i->getSource(); + if (p && p->isAlive() // alive + && (!pTarget || pTarget->GetDistance2d(portal)>p->GetDistance2d(portal)) // closer than current best + && !p->HasAura(PlayerDebuff[j],0) // not exhausted + && !p->HasAura(PlayerBuff[(j+1)%3],0) // not on another beam + && !p->HasAura(PlayerBuff[(j+2)%3],0) + && IsBetween(me, p, portal)) // on the beam + pTarget = p; + } + } + // buff the target + if (pTarget->GetTypeId() == TYPEID_PLAYER) + pTarget->AddAura(PlayerBuff[j], pTarget); + else + pTarget->AddAura(NetherBuff[j], pTarget); + // cast visual beam on the chosen target if switched + // simple target switching isn't working -> using BeamerGUID to cast (workaround) + if (!current || pTarget != current) + { + BeamTarget[j] = pTarget->GetGUID(); + // remove currently beaming portal + if (Creature *beamer = Unit::GetCreature(*portal, BeamerGUID[j])) + { + beamer->CastSpell(pTarget, PortalBeam[j], false); + beamer->DisappearAndDie(); + BeamerGUID[j] = 0; + } + // create new one and start beaming on the target + if (Creature *beamer = portal->SummonCreature(PortalID[j],portal->GetPositionX(),portal->GetPositionY(),portal->GetPositionZ(),portal->GetOrientation(),TEMPSUMMON_TIMED_DESPAWN,60000)) + { + beamer->CastSpell(pTarget, PortalBeam[j], false); + BeamerGUID[j] = beamer->GetGUID(); + } + } + // aggro target if Red Beam + if (j == RED_PORTAL && me->getVictim() != pTarget && pTarget->GetTypeId() == TYPEID_PLAYER) + me->getThreatManager().addThreat(pTarget, 100000.0f+DoGetThreat(me->getVictim())); + } + } + + void SwitchToPortalPhase() + { + me->RemoveAurasDueToSpell(SPELL_BANISH_ROOT); + me->RemoveAurasDueToSpell(SPELL_BANISH_VISUAL); + SummonPortals(); + PhaseTimer = 60000; + PortalPhase = true; + PortalTimer = 10000; + EmpowermentTimer = 10000; + DoScriptText(EMOTE_PHASE_PORTAL,me); + } + + void SwitchToBanishPhase() + { + me->RemoveAurasDueToSpell(SPELL_EMPOWERMENT); + me->RemoveAurasDueToSpell(SPELL_NETHERBURN_AURA); + DoCast(me, SPELL_BANISH_VISUAL, true); + DoCast(me, SPELL_BANISH_ROOT, true); + DestroyPortals(); + PhaseTimer = 30000; + PortalPhase = false; + DoScriptText(EMOTE_PHASE_BANISH,me); + + for (int i=0; i<3; ++i) + me->RemoveAurasDueToSpell(NetherBuff[i]); + } + + void HandleDoors(bool open) // Massive Door switcher + { + if (GameObject *Door = GameObject::GetGameObject(*me, pInstance ? pInstance->GetData64(DATA_GO_MASSIVE_DOOR) : 0)) + Door->SetGoState(open ? GO_STATE_ACTIVE : GO_STATE_READY); + } + + void Aggro(Unit * /*who*/) + { + HandleDoors(false); + SwitchToPortalPhase(); + } + + void JustDied(Unit* /*killer*/) + { + HandleDoors(true); + DestroyPortals(); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + // Void Zone + if (VoidZoneTimer <= diff) + { + DoCast(SelectTarget(SELECT_TARGET_RANDOM,1,45,true),SPELL_VOIDZONE,true); + VoidZoneTimer = 15000; + } else VoidZoneTimer -= diff; + + // NetherInfusion Berserk + if (!Berserk && NetherInfusionTimer <= diff) + { + me->AddAura(SPELL_NETHER_INFUSION, me); + DoCast(me, SPELL_NETHERSPITE_ROAR); + Berserk = true; + } else NetherInfusionTimer -= diff; + + if (PortalPhase) // PORTAL PHASE + { + // Distribute beams and buffs + if (PortalTimer <= diff) + { + UpdatePortals(); + PortalTimer = 1000; + } else PortalTimer -= diff; + + // Empowerment & Nether Burn + if (EmpowermentTimer <= diff) + { + DoCast(me, SPELL_EMPOWERMENT); + me->AddAura(SPELL_NETHERBURN_AURA, me); + EmpowermentTimer = 90000; + } else EmpowermentTimer -= diff; + + if (PhaseTimer <= diff) + { + if (!me->IsNonMeleeSpellCasted(false)) + { + SwitchToBanishPhase(); + return; + } + } else PhaseTimer -= diff; + } + else // BANISH PHASE + { + // Netherbreath + if (NetherbreathTimer <= diff) + { + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0,40,true)) + DoCast(pTarget, SPELL_NETHERBREATH); + NetherbreathTimer = urand(5000,7000); + } else NetherbreathTimer -= diff; + + if (PhaseTimer <= diff) + { + if (!me->IsNonMeleeSpellCasted(false)) + { + SwitchToPortalPhase(); + return; + } + } else PhaseTimer -= diff; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_netherspite(Creature *pCreature) +{ + return new boss_netherspiteAI(pCreature); +} + +void AddSC_boss_netherspite() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_netherspite"; + newscript->GetAI = GetAI_boss_netherspite; + newscript->RegisterSelf(); +} diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp new file mode 100644 index 00000000000..2e8b6f51317 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp @@ -0,0 +1,418 @@ +/* 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_Nightbane +SD%Complete: 80 +SDComment: SDComment: Timers may incorrect +SDCategory: Karazhan +EndScriptData */ + +#include "ScriptedPch.h" +#include "karazhan.h" + +//phase 1 +#define SPELL_BELLOWING_ROAR 39427 +#define SPELL_CHARRED_EARTH 30129 +#define SPELL_DISTRACTING_ASH 30130 +#define SPELL_SMOLDERING_BREATH 30210 +#define SPELL_TAIL_SWEEP 25653 +//phase 2 +#define SPELL_RAIN_OF_BONES 37098 +#define SPELL_SMOKING_BLAST 37057 +#define SPELL_FIREBALL_BARRAGE 30282 +#define SPELL_SEARING_CINDERS 30127 +#define SPELL_SUMMON_SKELETON 30170 + +#define EMOTE_SUMMON "An ancient being awakens in the distance..." +#define YELL_AGGRO "What fools! I shall bring a quick end to your suffering!" +#define YELL_FLY_PHASE "Miserable vermin. I shall exterminate you from the air!" +#define YELL_LAND_PHASE_1 "Enough! I shall land and crush you myself!" +#define YELL_LAND_PHASE_2 "Insects! Let me show you my strength up close!" +#define EMOTE_BREATH "takes a deep breath." + +float IntroWay[8][3] = +{ + {-11053.37,-1794.48,149}, + {-11141.07,-1841.40,125}, + {-11187.28,-1890.23,125}, + {-11189.20,-1931.25,125}, + {-11153.76,-1948.93,125}, + {-11128.73,-1929.75,125}, + {-11140 , -1915 ,122}, + {-11163 , -1903 ,91.473} +}; + +struct boss_nightbaneAI : public ScriptedAI +{ + boss_nightbaneAI(Creature* c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + Intro = true; + } + + ScriptedInstance* pInstance; + + uint32 Phase; + + bool RainBones; + bool Skeletons; + + uint32 BellowingRoarTimer; + uint32 CharredEarthTimer; + uint32 DistractingAshTimer; + uint32 SmolderingBreathTimer; + uint32 TailSweepTimer; + uint32 RainofBonesTimer; + uint32 SmokingBlastTimer; + uint32 FireballBarrageTimer; + uint32 SearingCindersTimer; + + uint32 FlyCount; + uint32 FlyTimer; + + bool Intro; + bool Flying; + bool Movement; + + uint32 WaitTimer; + uint32 MovePhase; + + void Reset() + { + BellowingRoarTimer = 30000; + CharredEarthTimer = 15000; + DistractingAshTimer = 20000; + SmolderingBreathTimer = 10000; + TailSweepTimer = 12000; + RainofBonesTimer = 10000; + SmokingBlastTimer = 20000; + FireballBarrageTimer = 13000; + SearingCindersTimer = 14000; + WaitTimer = 1000; + + Phase =1; + FlyCount = 0; + MovePhase = 0; + + me->SetSpeed(MOVE_RUN, 2.0f); + me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + me->setActive(true); + + if (pInstance) + { + if (pInstance->GetData(TYPE_NIGHTBANE) == DONE || pInstance->GetData(TYPE_NIGHTBANE) == IN_PROGRESS) + me->DisappearAndDie(); + else + pInstance->SetData(TYPE_NIGHTBANE, NOT_STARTED); + } + + HandleTerraceDoors(true); + + Flying = false; + Movement = false; + + if (!Intro) + { + me->SetHomePosition(IntroWay[7][0],IntroWay[7][1],IntroWay[7][2],0); + me->GetMotionMaster()->MoveTargetedHome(); + } + } + + void HandleTerraceDoors(bool open) + { + if (pInstance) + { + pInstance->HandleGameObject(pInstance->GetData64(DATA_MASTERS_TERRACE_DOOR_1), open); + pInstance->HandleGameObject(pInstance->GetData64(DATA_MASTERS_TERRACE_DOOR_2), open); + } + } + + void EnterCombat(Unit * /*who*/) + { + if (pInstance) + pInstance->SetData(TYPE_NIGHTBANE, IN_PROGRESS); + + HandleTerraceDoors(false); + me->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, NULL); + } + + void AttackStart(Unit* who) + { + if (!Intro && !Flying) + ScriptedAI::AttackStart(who); + } + + void JustDied(Unit* /*killer*/) + { + if (pInstance) + pInstance->SetData(TYPE_NIGHTBANE, DONE); + + HandleTerraceDoors(true); + } + + void MoveInLineOfSight(Unit *who) + { + if (!Intro && !Flying) + ScriptedAI::MoveInLineOfSight(who); + } + + void MovementInform(uint32 type, uint32 id) + { + if (type != POINT_MOTION_TYPE) + return; + + if (Intro) + { + if (id >= 8) + { + Intro = false; + me->SetHomePosition(IntroWay[7][0],IntroWay[7][1],IntroWay[7][2],0); + return; + } + + WaitTimer = 1; + } + + if (Flying) + { + if (id == 0) + { + me->MonsterTextEmote(EMOTE_BREATH, 0, true); + Flying = false; + Phase = 2; + return; + } + + if (id == 3) + { + MovePhase = 4; + WaitTimer = 1; + return; + } + + if (id == 8) + { + Flying = false; + Phase = 1; + Movement = true; + return; + } + + WaitTimer = 1; + } + } + + void JustSummoned(Creature *summoned) + { + summoned->AI()->AttackStart(me->getVictim()); + } + + void TakeOff() + { + me->MonsterYell(YELL_FLY_PHASE, LANG_UNIVERSAL, NULL); + + me->InterruptSpell(CURRENT_GENERIC_SPELL); + me->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); + me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + (*me).GetMotionMaster()->Clear(false); + (*me).GetMotionMaster()->MovePoint(0,IntroWay[2][0],IntroWay[2][1],IntroWay[2][2]); + + Flying = true; + + FlyTimer = urand(45000,60000); //timer wrong between 45 and 60 seconds + ++FlyCount; + + RainofBonesTimer = 5000; //timer wrong (maybe) + RainBones = false; + Skeletons = false; + } + + void UpdateAI(const uint32 diff) + { + /* The timer for this was never setup apparently, not sure if the code works properly: + if (WaitTimer <= diff) + { + if (Intro) + { + if (MovePhase >= 7) + { + me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->HandleEmoteCommand(EMOTE_ONESHOT_LAND); + me->GetMotionMaster()->MovePoint(8,IntroWay[7][0],IntroWay[7][1],IntroWay[7][2]); + } + else + { + me->GetMotionMaster()->MovePoint(MovePhase,IntroWay[MovePhase][0],IntroWay[MovePhase][1],IntroWay[MovePhase][2]); + ++MovePhase; + } + } + if (Flying) + { + if (MovePhase >= 7) + { + me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->HandleEmoteCommand(EMOTE_ONESHOT_LAND); + me->GetMotionMaster()->MovePoint(8,IntroWay[7][0],IntroWay[7][1],IntroWay[7][2]); + } + else + { + me->GetMotionMaster()->MovePoint(MovePhase,IntroWay[MovePhase][0],IntroWay[MovePhase][1],IntroWay[MovePhase][2]); + ++MovePhase; + } + } + + WaitTimer = 0; + } else WaitTimer -= diff; + */ + + if (!UpdateVictim()) + return; + + if (Flying) + return; + + // Phase 1 "GROUND FIGHT" + if (Phase == 1) + { + if (Movement) + { + DoStartMovement(me->getVictim()); + Movement = false; + } + + if (BellowingRoarTimer <= diff) + { + DoCast(me->getVictim(), SPELL_BELLOWING_ROAR); + BellowingRoarTimer = urand(30000,40000); + } else BellowingRoarTimer -= diff; + + if (SmolderingBreathTimer <= diff) + { + DoCast(me->getVictim(), SPELL_SMOLDERING_BREATH); + SmolderingBreathTimer = 20000; + } else SmolderingBreathTimer -= diff; + + if (CharredEarthTimer <= diff) + { + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) + DoCast(pTarget, SPELL_CHARRED_EARTH); + CharredEarthTimer = 20000; + } else CharredEarthTimer -= diff; + + if (TailSweepTimer <= diff) + { + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) + if (!me->HasInArc(M_PI, pTarget)) + DoCast(pTarget, SPELL_TAIL_SWEEP); + TailSweepTimer = 15000; + } else TailSweepTimer -= diff; + + if (SearingCindersTimer <= diff) + { + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) + DoCast(pTarget, SPELL_SEARING_CINDERS); + SearingCindersTimer = 10000; + } else SearingCindersTimer -= diff; + + uint32 Prozent; + Prozent = (me->GetHealth()*100) / me->GetMaxHealth(); + + if (Prozent < 75 && FlyCount == 0) // first take off 75% + TakeOff(); + + if (Prozent < 50 && FlyCount == 1) // secound take off 50% + TakeOff(); + + if (Prozent < 25 && FlyCount == 2) // third take off 25% + TakeOff(); + + DoMeleeAttackIfReady(); + } + + //Phase 2 "FLYING FIGHT" + if (Phase == 2) + { + if (!RainBones) + { + if (!Skeletons) + { + for (uint8 i = 0; i <= 3; ++i) + { + DoCast(me->getVictim(), SPELL_SUMMON_SKELETON); + Skeletons = true; + } + } + + if (RainofBonesTimer < diff && !RainBones) // only once at the beginning of phase 2 + { + DoCast(me->getVictim(), SPELL_RAIN_OF_BONES); + RainBones = true; + SmokingBlastTimer = 20000; + } else RainofBonesTimer -= diff; + + if (DistractingAshTimer <= diff) + { + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) + DoCast(pTarget, SPELL_DISTRACTING_ASH); + DistractingAshTimer = 2000; //timer wrong + } else DistractingAshTimer -= diff; + } + + if (RainBones) + { + if (SmokingBlastTimer <= diff) + { + DoCast(me->getVictim(), SPELL_SMOKING_BLAST); + SmokingBlastTimer = 1500; //timer wrong + } else SmokingBlastTimer -= diff; + } + + if (FireballBarrageTimer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_FARTHEST, 0)) + DoCast(pTarget, SPELL_FIREBALL_BARRAGE); + FireballBarrageTimer = 20000; + } else FireballBarrageTimer -= diff; + + if (FlyTimer <= diff) //landing + { + me->MonsterYell(RAND(*YELL_LAND_PHASE_1,*YELL_LAND_PHASE_2), LANG_UNIVERSAL, NULL); + + me->GetMotionMaster()->Clear(false); + me->GetMotionMaster()->MovePoint(3,IntroWay[3][0],IntroWay[3][1],IntroWay[3][2]); + + Flying = true; + } else FlyTimer -= diff; + } + } +}; + +CreatureAI* GetAI_boss_nightbane(Creature* pCreature) +{ + return new boss_nightbaneAI (pCreature); +} + +void AddSC_boss_nightbane() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_nightbane"; + newscript->GetAI = &GetAI_boss_nightbane; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp new file mode 100644 index 00000000000..1071eae78a0 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp @@ -0,0 +1,604 @@ +/* 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_Prince_Malchezzar +SD%Complete: 100 +SDComment: +SDCategory: Karazhan +EndScriptData */ + +#include "ScriptedPch.h" +#include "karazhan.h" + +#define SAY_AGGRO -1532091 +#define SAY_AXE_TOSS1 -1532092 +#define SAY_AXE_TOSS2 -1532093 +#define SAY_SPECIAL1 -1532094 +#define SAY_SPECIAL2 -1532095 +#define SAY_SPECIAL3 -1532096 +#define SAY_SLAY1 -1532097 +#define SAY_SLAY2 -1532098 +#define SAY_SLAY3 -1532099 +#define SAY_SUMMON1 -1532100 +#define SAY_SUMMON2 -1532101 +#define SAY_DEATH -1532102 + +// 18 Coordinates for Infernal spawns +struct InfernalPoint +{ + float x,y; +}; + +#define INFERNAL_Z 275.5 + +static InfernalPoint InfernalPoints[] = +{ + {-10922.8, -1985.2}, + {-10916.2, -1996.2}, + {-10932.2, -2008.1}, + {-10948.8, -2022.1}, + {-10958.7, -1997.7}, + {-10971.5, -1997.5}, + {-10990.8, -1995.1}, + {-10989.8, -1976.5}, + {-10971.6, -1973.0}, + {-10955.5, -1974.0}, + {-10939.6, -1969.8}, + {-10958.0, -1952.2}, + {-10941.7, -1954.8}, + {-10943.1, -1988.5}, + {-10948.8, -2005.1}, + {-10984.0, -2019.3}, + {-10932.8, -1979.6}, + {-10935.7, -1996.0} +}; + +#define TOTAL_INFERNAL_POINTS 18 + +//Enfeeble is supposed to reduce hp to 1 and then heal player back to full when it ends +//Along with reducing healing and regen while enfeebled to 0% +//This spell effect will only reduce healing + +#define SPELL_ENFEEBLE 30843 //Enfeeble during phase 1 and 2 +#define SPELL_ENFEEBLE_EFFECT 41624 + +#define SPELL_SHADOWNOVA 30852 //Shadownova used during all phases +#define SPELL_SW_PAIN 30854 //Shadow word pain during phase 1 and 3 (different targeting rules though) +#define SPELL_THRASH_PASSIVE 12787 //Extra attack chance during phase 2 +#define SPELL_SUNDER_ARMOR 30901 //Sunder armor during phase 2 +#define SPELL_THRASH_AURA 12787 //Passive proc chance for thrash +#define SPELL_EQUIP_AXES 30857 //Visual for axe equiping +#define SPELL_AMPLIFY_DAMAGE 39095 //Amplifiy during phase 3 +#define SPELL_CLEAVE 30131 //Same as Nightbane. +#define SPELL_HELLFIRE 30859 //Infenals' hellfire aura +#define NETHERSPITE_INFERNAL 17646 //The netherspite infernal creature +#define MALCHEZARS_AXE 17650 //Malchezar's axes (creatures), summoned during phase 3 + +#define INFERNAL_MODEL_INVISIBLE 11686 //Infernal Effects +#define SPELL_INFERNAL_RELAY 30834 + +#define EQUIP_ID_AXE 33542 //Axes info + +//---------Infernal code first +struct netherspite_infernalAI : public ScriptedAI +{ + netherspite_infernalAI(Creature *c) : ScriptedAI(c) , + malchezaar(0), HellfireTimer(0), CleanupTimer(0), point(NULL) {} + + uint32 HellfireTimer; + uint32 CleanupTimer; + uint32 malchezaar; + InfernalPoint *point; + + void Reset() {} + void EnterCombat(Unit * /*who*/) {} + void MoveInLineOfSight(Unit * /*who*/) {} + + void UpdateAI(const uint32 diff) + { + if (HellfireTimer) + if (HellfireTimer <= diff) + { + DoCast(me, SPELL_HELLFIRE); + HellfireTimer = 0; + } + else HellfireTimer -= diff; + + if (CleanupTimer) + if (CleanupTimer <= diff) + { + Cleanup(); + CleanupTimer = 0; + } else CleanupTimer -= diff; + } + + void KilledUnit(Unit *who) + { + Unit *pMalchezaar = Unit::GetUnit(*me, malchezaar); + if (pMalchezaar) + CAST_CRE(pMalchezaar)->AI()->KilledUnit(who); + } + + void SpellHit(Unit * /*who*/, const SpellEntry *spell) + { + if (spell->Id == SPELL_INFERNAL_RELAY) + { + me->SetDisplayId(me->GetUInt32Value(UNIT_FIELD_NATIVEDISPLAYID)); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + HellfireTimer = 4000; + CleanupTimer = 170000; + } + } + + void DamageTaken(Unit *done_by, uint32 &damage) + { + if (done_by->GetGUID() != malchezaar) + damage = 0; + } + + void Cleanup(); //below ... +}; + +struct boss_malchezaarAI : public ScriptedAI +{ + boss_malchezaarAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance *pInstance; + uint32 EnfeebleTimer; + uint32 EnfeebleResetTimer; + uint32 ShadowNovaTimer; + uint32 SWPainTimer; + uint32 SunderArmorTimer; + uint32 AmplifyDamageTimer; + uint32 Cleave_Timer; + uint32 InfernalTimer; + uint32 AxesTargetSwitchTimer; + uint32 InfernalCleanupTimer; + + std::vector infernals; + std::vector positions; + + uint64 axes[2]; + uint64 enfeeble_targets[5]; + uint64 enfeeble_health[5]; + + uint32 phase; + + void Reset() + { + AxesCleanup(); + ClearWeapons(); + InfernalCleanup(); + positions.clear(); + + for (uint8 i = 0; i < 5; ++i) + enfeeble_targets[i] = 0; + + for (uint8 i = 0; i < TOTAL_INFERNAL_POINTS; ++i) + positions.push_back(&InfernalPoints[i]); + + EnfeebleTimer = 30000; + EnfeebleResetTimer = 38000; + ShadowNovaTimer = 35500; + SWPainTimer = 20000; + AmplifyDamageTimer = 5000; + Cleave_Timer = 8000; + InfernalTimer = 45000; + InfernalCleanupTimer = 47000; + AxesTargetSwitchTimer = urand(7500,20000); + SunderArmorTimer = urand(5000,10000); + phase = 1; + + if (pInstance) + pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_NETHER_DOOR), true); + } + + void KilledUnit(Unit * /*victim*/) + { + DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), me); + } + + void JustDied(Unit * /*victim*/) + { + DoScriptText(SAY_DEATH, me); + + AxesCleanup(); + ClearWeapons(); + InfernalCleanup(); + positions.clear(); + + for (uint8 i = 0; i < TOTAL_INFERNAL_POINTS; ++i) + positions.push_back(&InfernalPoints[i]); + + if (pInstance) + pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_NETHER_DOOR), true); + } + + void EnterCombat(Unit * /*who*/) + { + DoScriptText(SAY_AGGRO, me); + + if (pInstance) + pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_NETHER_DOOR), false); // Open the door leading further in + } + + void InfernalCleanup() + { + //Infernal Cleanup + for (std::vector::const_iterator itr = infernals.begin(); itr != infernals.end(); ++itr) + if (Unit *pInfernal = Unit::GetUnit(*me, *itr)) + if (pInfernal->isAlive()) + { + pInfernal->SetVisibility(VISIBILITY_OFF); + pInfernal->setDeathState(JUST_DIED); + } + + infernals.clear(); + } + + void AxesCleanup() + { + for (uint8 i = 0; i < 2; ++i) + { + Unit *axe = Unit::GetUnit(*me, axes[i]); + if (axe && axe->isAlive()) + axe->Kill(axe); + axes[i] = 0; + } + } + + void ClearWeapons() + { + SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); + + //damage + const CreatureInfo *cinfo = me->GetCreatureInfo(); + me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, cinfo->mindmg); + me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, cinfo->maxdmg); + me->UpdateDamagePhysical(BASE_ATTACK); + } + + void EnfeebleHealthEffect() + { + const SpellEntry *info = GetSpellStore()->LookupEntry(SPELL_ENFEEBLE_EFFECT); + if (!info) + return; + + std::list t_list = me->getThreatManager().getThreatList(); + std::vector targets; + + if (!t_list.size()) + return; + + //begin + 1, so we don't target the one with the highest threat + std::list::const_iterator itr = t_list.begin(); + std::advance(itr, 1); + for (; itr != t_list.end(); ++itr) //store the threat list in a different container + if (Unit *pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid())) + if (pTarget->isAlive() && pTarget->GetTypeId() == TYPEID_PLAYER) + targets.push_back(pTarget); + + //cut down to size if we have more than 5 targets + while (targets.size() > 5) + targets.erase(targets.begin()+rand()%targets.size()); + + uint32 i = 0; + for (std::vector::const_iterator iter = targets.begin(); iter != targets.end(); ++iter, ++i) + if (Unit *pTarget = *iter) + { + enfeeble_targets[i] = pTarget->GetGUID(); + enfeeble_health[i] = pTarget->GetHealth(); + + pTarget->CastSpell(pTarget, SPELL_ENFEEBLE, true, 0, 0, me->GetGUID()); + pTarget->SetHealth(1); + } + } + + void EnfeebleResetHealth() + { + for (uint8 i = 0; i < 5; ++i) + { + Unit *pTarget = Unit::GetUnit(*me, enfeeble_targets[i]); + if (pTarget && pTarget->isAlive()) + pTarget->SetHealth(enfeeble_health[i]); + enfeeble_targets[i] = 0; + enfeeble_health[i] = 0; + } + } + + void SummonInfernal(const uint32 /*diff*/) + { + InfernalPoint *point = NULL; + Position pos; + if ((me->GetMapId() != 532) || positions.empty()) + me->GetRandomNearPosition(pos, 60); + else + { + std::vector::iterator itr = positions.begin()+rand()%positions.size(); + point = *itr; + positions.erase(itr); + pos.Relocate(point->x, point->y, INFERNAL_Z); + } + + Creature *Infernal = me->SummonCreature(NETHERSPITE_INFERNAL, pos, TEMPSUMMON_TIMED_DESPAWN, 180000); + + if (Infernal) + { + Infernal->SetDisplayId(INFERNAL_MODEL_INVISIBLE); + Infernal->setFaction(me->getFaction()); + if (point) + CAST_AI(netherspite_infernalAI, Infernal->AI())->point=point; + CAST_AI(netherspite_infernalAI, Infernal->AI())->malchezaar=me->GetGUID(); + + infernals.push_back(Infernal->GetGUID()); + DoCast(Infernal, SPELL_INFERNAL_RELAY); + } + + DoScriptText(RAND(SAY_SUMMON1,SAY_SUMMON2), me); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (EnfeebleResetTimer && EnfeebleResetTimer <= diff) // Let's not forget to reset that + { + EnfeebleResetHealth(); + EnfeebleResetTimer = 0; + } else EnfeebleResetTimer -= diff; + + if (me->hasUnitState(UNIT_STAT_STUNNED)) // While shifting to phase 2 malchezaar stuns himself + return; + + if (me->GetUInt64Value(UNIT_FIELD_TARGET) != me->getVictim()->GetGUID()) + me->SetUInt64Value(UNIT_FIELD_TARGET, me->getVictim()->GetGUID()); + + if (phase == 1) + { + if ((me->GetHealth()*100) / me->GetMaxHealth() < 60) + { + me->InterruptNonMeleeSpells(false); + + phase = 2; + + //animation + DoCast(me, SPELL_EQUIP_AXES); + + //text + DoScriptText(SAY_AXE_TOSS1, me); + + //passive thrash aura + DoCast(me, SPELL_THRASH_AURA, true); + + //models + SetEquipmentSlots(false, EQUIP_ID_AXE, EQUIP_ID_AXE, EQUIP_NO_CHANGE); + + //damage + const CreatureInfo *cinfo = me->GetCreatureInfo(); + me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, 2*cinfo->mindmg); + me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, 2*cinfo->maxdmg); + me->UpdateDamagePhysical(BASE_ATTACK); + + me->SetBaseWeaponDamage(OFF_ATTACK, MINDAMAGE, cinfo->mindmg); + me->SetBaseWeaponDamage(OFF_ATTACK, MAXDAMAGE, cinfo->maxdmg); + //Sigh, updating only works on main attack, do it manually .... + me->SetFloatValue(UNIT_FIELD_MINOFFHANDDAMAGE, cinfo->mindmg); + me->SetFloatValue(UNIT_FIELD_MAXOFFHANDDAMAGE, cinfo->maxdmg); + + me->SetAttackTime(OFF_ATTACK, (me->GetAttackTime(BASE_ATTACK)*150)/100); + } + } + else if (phase == 2) + { + if ((me->GetHealth()*100) / me->GetMaxHealth() < 30) + { + InfernalTimer = 15000; + + phase = 3; + + ClearWeapons(); + + //remove thrash + me->RemoveAurasDueToSpell(SPELL_THRASH_AURA); + + DoScriptText(SAY_AXE_TOSS2, me); + + Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); + for (uint8 i = 0; i < 2; ++i) + { + Creature *axe = me->SummonCreature(MALCHEZARS_AXE, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000); + if (axe) + { + axe->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + axe->setFaction(me->getFaction()); + axes[i] = axe->GetGUID(); + if (pTarget) + { + axe->AI()->AttackStart(pTarget); + //axe->getThreatManager().tauntApply(pTarget); //Taunt Apply and fade out does not work properly + // So we'll use a hack to add a lot of threat to our target + axe->AddThreat(pTarget, 10000000.0f); + } + } + } + + if (ShadowNovaTimer > 35000) + ShadowNovaTimer = EnfeebleTimer + 5000; + + return; + } + + if (SunderArmorTimer <= diff) + { + DoCast(me->getVictim(), SPELL_SUNDER_ARMOR); + SunderArmorTimer = urand(10000,18000); + + } else SunderArmorTimer -= diff; + + if (Cleave_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_CLEAVE); + Cleave_Timer = urand(6000,12000); + + } else Cleave_Timer -= diff; + } + else + { + if (AxesTargetSwitchTimer <= diff) + { + AxesTargetSwitchTimer = urand(7500,20000); + + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) + { + for (uint8 i = 0; i < 2; ++i) + { + if (Unit *axe = Unit::GetUnit(*me, axes[i])) + { + if (axe->getVictim()) + DoModifyThreatPercent(axe->getVictim(), -100); + if (pTarget) + axe->AddThreat(pTarget, 1000000.0f); + //axe->getThreatManager().tauntFadeOut(axe->getVictim()); + //axe->getThreatManager().tauntApply(pTarget); + } + } + } + } else AxesTargetSwitchTimer -= diff; + + if (AmplifyDamageTimer <= diff) + { + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) + DoCast(pTarget, SPELL_AMPLIFY_DAMAGE); + AmplifyDamageTimer = urand(20000,30000); + } else AmplifyDamageTimer -= diff; + } + + //Time for global and double timers + if (InfernalTimer <= diff) + { + SummonInfernal(diff); + InfernalTimer = phase == 3 ? 14500 : 44500; // 15 secs in phase 3, 45 otherwise + } else InfernalTimer -= diff; + + if (ShadowNovaTimer <= diff) + { + DoCast(me->getVictim(), SPELL_SHADOWNOVA); + ShadowNovaTimer = phase == 3 ? 31000 : uint32(-1); + } else ShadowNovaTimer -= diff; + + if (phase != 2) + { + if (SWPainTimer <= diff) + { + Unit *pTarget = NULL; + if (phase == 1) + pTarget = me->getVictim(); // the tank + else // anyone but the tank + pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true); + + if (pTarget) + DoCast(pTarget, SPELL_SW_PAIN); + + SWPainTimer = 20000; + } else SWPainTimer -= diff; + } + + if (phase != 3) + { + if (EnfeebleTimer <= diff) + { + EnfeebleHealthEffect(); + EnfeebleTimer = 30000; + ShadowNovaTimer = 5000; + EnfeebleResetTimer = 9000; + } else EnfeebleTimer -= diff; + } + + if (phase == 2) + DoMeleeAttacksIfReady(); + else + DoMeleeAttackIfReady(); + } + + void DoMeleeAttacksIfReady() + { + if (me->IsWithinMeleeRange(me->getVictim()) && !me->IsNonMeleeSpellCasted(false)) + { + //Check for base attack + if (me->isAttackReady() && me->getVictim()) + { + me->AttackerStateUpdate(me->getVictim()); + me->resetAttackTimer(); + } + //Check for offhand attack + if (me->isAttackReady(OFF_ATTACK) && me->getVictim()) + { + me->AttackerStateUpdate(me->getVictim(), OFF_ATTACK); + me->resetAttackTimer(OFF_ATTACK); + } + } + } + + void Cleanup(Creature *infernal, InfernalPoint *point) + { + for (std::vector::iterator itr = infernals.begin(); itr!= infernals.end(); ++itr) + if (*itr == infernal->GetGUID()) + { + infernals.erase(itr); + break; + } + + positions.push_back(point); + } +}; + +void netherspite_infernalAI::Cleanup() +{ + Unit *pMalchezaar = Unit::GetUnit(*me, malchezaar); + + if (pMalchezaar && pMalchezaar->isAlive()) + CAST_AI(boss_malchezaarAI, CAST_CRE(pMalchezaar)->AI())->Cleanup(me, point); +} + +CreatureAI* GetAI_netherspite_infernal(Creature* pCreature) +{ + return new netherspite_infernalAI (pCreature); +} + +CreatureAI* GetAI_boss_malchezaar(Creature* pCreature) +{ + return new boss_malchezaarAI (pCreature); +} + +void AddSC_boss_malchezaar() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_malchezaar"; + newscript->GetAI = &GetAI_boss_malchezaar; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "netherspite_infernal"; + newscript->GetAI = &GetAI_netherspite_infernal; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp new file mode 100644 index 00000000000..394cff3ccc5 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_shade_of_aran.cpp @@ -0,0 +1,569 @@ +/* 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_Aran +SD%Complete: 95 +SDComment: Flame wreath missing cast animation, mods won't triggere. +SDCategory: Karazhan +EndScriptData */ + +#include "ScriptedPch.h" +#include "ScriptedSimpleAI.h" +#include "karazhan.h" +#include "GameObject.h" + +#define SAY_AGGRO1 -1532073 +#define SAY_AGGRO2 -1532074 +#define SAY_AGGRO3 -1532075 +#define SAY_FLAMEWREATH1 -1532076 +#define SAY_FLAMEWREATH2 -1532077 +#define SAY_BLIZZARD1 -1532078 +#define SAY_BLIZZARD2 -1532079 +#define SAY_EXPLOSION1 -1532080 +#define SAY_EXPLOSION2 -1532081 +#define SAY_DRINK -1532082 //Low Mana / AoE Pyroblast +#define SAY_ELEMENTALS -1532083 +#define SAY_KILL1 -1532084 +#define SAY_KILL2 -1532085 +#define SAY_TIMEOVER -1532086 +#define SAY_DEATH -1532087 +#define SAY_ATIESH -1532088 //Atiesh is equipped by a raid member + +//Spells +#define SPELL_FROSTBOLT 29954 +#define SPELL_FIREBALL 29953 +#define SPELL_ARCMISSLE 29955 +#define SPELL_CHAINSOFICE 29991 +#define SPELL_DRAGONSBREATH 29964 +#define SPELL_MASSSLOW 30035 +#define SPELL_FLAME_WREATH 29946 +#define SPELL_AOE_CS 29961 +#define SPELL_PLAYERPULL 32265 +#define SPELL_AEXPLOSION 29973 +#define SPELL_MASS_POLY 29963 +#define SPELL_BLINK_CENTER 29967 +#define SPELL_ELEMENTALS 29962 +#define SPELL_CONJURE 29975 +#define SPELL_DRINK 30024 +#define SPELL_POTION 32453 +#define SPELL_AOE_PYROBLAST 29978 + +//Creature Spells +#define SPELL_CIRCULAR_BLIZZARD 29951 //29952 is the REAL circular blizzard that leaves persistant blizzards that last for 10 seconds +#define SPELL_WATERBOLT 31012 +#define SPELL_SHADOW_PYRO 29978 + +//Creatures +#define CREATURE_WATER_ELEMENTAL 17167 +#define CREATURE_SHADOW_OF_ARAN 18254 +#define CREATURE_ARAN_BLIZZARD 17161 + +enum SuperSpell +{ + SUPER_FLAME = 0, + SUPER_BLIZZARD, + SUPER_AE, +}; + +struct boss_aranAI : public ScriptedAI +{ + boss_aranAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint32 SecondarySpellTimer; + uint32 NormalCastTimer; + uint32 SuperCastTimer; + uint32 BerserkTimer; + uint32 CloseDoorTimer; // Don't close the door right on aggro in case some people are still entering. + + uint8 LastSuperSpell; + + uint32 FlameWreathTimer; + uint32 FlameWreathCheckTime; + uint64 FlameWreathTarget[3]; + float FWTargPosX[3]; + float FWTargPosY[3]; + + uint32 CurrentNormalSpell; + uint32 ArcaneCooldown; + uint32 FireCooldown; + uint32 FrostCooldown; + + uint32 DrinkInturruptTimer; + + bool ElementalsSpawned; + bool Drinking; + bool DrinkInturrupted; + + void Reset() + { + SecondarySpellTimer = 5000; + NormalCastTimer = 0; + SuperCastTimer = 35000; + BerserkTimer = 720000; + CloseDoorTimer = 15000; + + LastSuperSpell = rand()%3; + + FlameWreathTimer = 0; + FlameWreathCheckTime = 0; + + CurrentNormalSpell = 0; + ArcaneCooldown = 0; + FireCooldown = 0; + FrostCooldown = 0; + + DrinkInturruptTimer = 10000; + + ElementalsSpawned = false; + Drinking = false; + DrinkInturrupted = false; + + if (pInstance) + { + // Not in progress + pInstance->SetData(TYPE_ARAN, NOT_STARTED); + pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_LIBRARY_DOOR), true); + } + } + + void KilledUnit(Unit * /*victim*/) + { + DoScriptText(RAND(SAY_KILL1,SAY_KILL2), me); + } + + void JustDied(Unit * /*victim*/) + { + DoScriptText(SAY_DEATH, me); + + if (pInstance) + { + pInstance->SetData(TYPE_ARAN, DONE); + pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_LIBRARY_DOOR), true); + } + } + + void EnterCombat(Unit * /*who*/) + { + DoScriptText(RAND(SAY_AGGRO1,SAY_AGGRO2,SAY_AGGRO3), me); + + if (pInstance) + { + pInstance->SetData(TYPE_ARAN, IN_PROGRESS); + pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_LIBRARY_DOOR), false); + } + } + + void FlameWreathEffect() + { + std::vector targets; + std::list t_list = me->getThreatManager().getThreatList(); + + if (!t_list.size()) + return; + + //store the threat list in a different container + for (std::list::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) + { + Unit *pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid()); + //only on alive players + if (pTarget && pTarget->isAlive() && pTarget->GetTypeId() == TYPEID_PLAYER) + targets.push_back(pTarget); + } + + //cut down to size if we have more than 3 targets + while (targets.size() > 3) + targets.erase(targets.begin()+rand()%targets.size()); + + uint32 i = 0; + for (std::vector::const_iterator itr = targets.begin(); itr!= targets.end(); ++itr) + { + if (*itr) + { + FlameWreathTarget[i] = (*itr)->GetGUID(); + FWTargPosX[i] = (*itr)->GetPositionX(); + FWTargPosY[i] = (*itr)->GetPositionY(); + DoCast((*itr), SPELL_FLAME_WREATH, true); + ++i; + } + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (CloseDoorTimer) + { + if (CloseDoorTimer <= diff) + { + if (pInstance) + { + pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_LIBRARY_DOOR), false); + CloseDoorTimer = 0; + } + } else CloseDoorTimer -= diff; + } + + //Cooldowns for casts + if (ArcaneCooldown) + { + if (ArcaneCooldown >= diff) + ArcaneCooldown -= diff; + else ArcaneCooldown = 0; + } + + if (FireCooldown) + { + if (FireCooldown >= diff) + FireCooldown -= diff; + else FireCooldown = 0; + } + + if (FrostCooldown) + { + if (FrostCooldown >= diff) + FrostCooldown -= diff; + else FrostCooldown = 0; + } + + if (!Drinking && me->GetMaxPower(POWER_MANA) && (me->GetPower(POWER_MANA)*100 / me->GetMaxPower(POWER_MANA)) < 20) + { + Drinking = true; + me->InterruptNonMeleeSpells(false); + + DoScriptText(SAY_DRINK, me); + + if (!DrinkInturrupted) + { + DoCast(me, SPELL_MASS_POLY, true); + DoCast(me, SPELL_CONJURE, false); + DoCast(me, SPELL_DRINK, false); + me->SetStandState(UNIT_STAND_STATE_SIT); + DrinkInturruptTimer = 10000; + } + } + + //Drink Inturrupt + if (Drinking && DrinkInturrupted) + { + Drinking = false; + me->RemoveAurasDueToSpell(SPELL_DRINK); + me->SetStandState(UNIT_STAND_STATE_STAND); + me->SetPower(POWER_MANA, me->GetMaxPower(POWER_MANA)-32000); + DoCast(me, SPELL_POTION, false); + } + + //Drink Inturrupt Timer + if (Drinking && !DrinkInturrupted) + if (DrinkInturruptTimer >= diff) + DrinkInturruptTimer -= diff; + else + { + me->SetStandState(UNIT_STAND_STATE_STAND); + DoCast(me, SPELL_POTION, true); + DoCast(me, SPELL_AOE_PYROBLAST, false); + DrinkInturrupted = true; + Drinking = false; + } + + //Don't execute any more code if we are drinking + if (Drinking) + return; + + //Normal casts + if (NormalCastTimer <= diff) + { + if (!me->IsNonMeleeSpellCasted(false)) + { + Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); + if (!pTarget) + return; + + uint32 Spells[3]; + uint8 AvailableSpells = 0; + + //Check for what spells are not on cooldown + if (!ArcaneCooldown) + { + Spells[AvailableSpells] = SPELL_ARCMISSLE; + ++AvailableSpells; + } + if (!FireCooldown) + { + Spells[AvailableSpells] = SPELL_FIREBALL; + ++AvailableSpells; + } + if (!FrostCooldown) + { + Spells[AvailableSpells] = SPELL_FROSTBOLT; + ++AvailableSpells; + } + + //If no available spells wait 1 second and try again + if (AvailableSpells) + { + CurrentNormalSpell = Spells[rand() % AvailableSpells]; + DoCast(pTarget, CurrentNormalSpell); + } + } + NormalCastTimer = 1000; + } else NormalCastTimer -= diff; + + if (SecondarySpellTimer <= diff) + { + switch (urand(0,1)) + { + case 0: + DoCast(me, SPELL_AOE_CS); + break; + case 1: + if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) + DoCast(pTarget, SPELL_CHAINSOFICE); + break; + } + SecondarySpellTimer = urand(5000,20000); + } else SecondarySpellTimer -= diff; + + if (SuperCastTimer <= diff) + { + uint8 Available[2]; + + switch (LastSuperSpell) + { + case SUPER_AE: + Available[0] = SUPER_FLAME; + Available[1] = SUPER_BLIZZARD; + break; + case SUPER_FLAME: + Available[0] = SUPER_AE; + Available[1] = SUPER_BLIZZARD; + break; + case SUPER_BLIZZARD: + Available[0] = SUPER_FLAME; + Available[1] = SUPER_AE; + break; + } + + LastSuperSpell = Available[urand(0,1)]; + + switch (LastSuperSpell) + { + case SUPER_AE: + DoScriptText(RAND(SAY_EXPLOSION1,SAY_EXPLOSION2), me); + + DoCast(me, SPELL_BLINK_CENTER, true); + DoCast(me, SPELL_PLAYERPULL, true); + DoCast(me, SPELL_MASSSLOW, true); + DoCast(me, SPELL_AEXPLOSION, false); + break; + + case SUPER_FLAME: + DoScriptText(RAND(SAY_FLAMEWREATH1,SAY_FLAMEWREATH2), me); + + FlameWreathTimer = 20000; + FlameWreathCheckTime = 500; + + FlameWreathTarget[0] = 0; + FlameWreathTarget[1] = 0; + FlameWreathTarget[2] = 0; + + FlameWreathEffect(); + break; + + case SUPER_BLIZZARD: + DoScriptText(RAND(SAY_BLIZZARD1,SAY_BLIZZARD2), me); + + if (Creature* pSpawn = me->SummonCreature(CREATURE_ARAN_BLIZZARD, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 25000)) + { + pSpawn->setFaction(me->getFaction()); + pSpawn->CastSpell(pSpawn, SPELL_CIRCULAR_BLIZZARD, false); + } + break; + } + + SuperCastTimer = urand(35000,40000); + } else SuperCastTimer -= diff; + + if (!ElementalsSpawned && me->GetHealth()*100 / me->GetMaxHealth() < 40) + { + ElementalsSpawned = true; + + for (uint32 i = 0; i < 4; ++i) + { + if (Creature* pUnit = me->SummonCreature(CREATURE_WATER_ELEMENTAL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 90000)) + { + pUnit->Attack(me->getVictim(), true); + pUnit->setFaction(me->getFaction()); + } + } + + DoScriptText(SAY_ELEMENTALS, me); + } + + if (BerserkTimer <= diff) + { + for (uint32 i = 0; i < 5; ++i) + { + if (Creature* pUnit = me->SummonCreature(CREATURE_SHADOW_OF_ARAN, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000)) + { + pUnit->Attack(me->getVictim(), true); + pUnit->setFaction(me->getFaction()); + } + } + + DoScriptText(SAY_TIMEOVER, me); + + BerserkTimer = 60000; + } else BerserkTimer -= diff; + + //Flame Wreath check + if (FlameWreathTimer) + { + if (FlameWreathTimer >= diff) + FlameWreathTimer -= diff; + else FlameWreathTimer = 0; + + if (FlameWreathCheckTime <= diff) + { + for (uint8 i = 0; i < 3; ++i) + { + if (!FlameWreathTarget[i]) + continue; + + Unit* pUnit = Unit::GetUnit(*me, FlameWreathTarget[i]); + if (pUnit && !pUnit->IsWithinDist2d(FWTargPosX[i], FWTargPosY[i], 3)) + { + pUnit->CastSpell(pUnit, 20476, true, 0, 0, me->GetGUID()); + pUnit->CastSpell(pUnit, 11027, true); + FlameWreathTarget[i] = 0; + } + } + FlameWreathCheckTime = 500; + } else FlameWreathCheckTime -= diff; + } + + if (ArcaneCooldown && FireCooldown && FrostCooldown) + DoMeleeAttackIfReady(); + } + + void DamageTaken(Unit* /*pAttacker*/, uint32 &damage) + { + if (!DrinkInturrupted && Drinking && damage) + DrinkInturrupted = true; + } + + void SpellHit(Unit* /*pAttacker*/, const SpellEntry* Spell) + { + //We only care about inturrupt effects and only if they are durring a spell currently being casted + if ((Spell->Effect[0] != SPELL_EFFECT_INTERRUPT_CAST && + Spell->Effect[1] != SPELL_EFFECT_INTERRUPT_CAST && + Spell->Effect[2] != SPELL_EFFECT_INTERRUPT_CAST) || !me->IsNonMeleeSpellCasted(false)) + return; + + //Inturrupt effect + me->InterruptNonMeleeSpells(false); + + //Normally we would set the cooldown equal to the spell duration + //but we do not have access to the DurationStore + + switch (CurrentNormalSpell) + { + case SPELL_ARCMISSLE: ArcaneCooldown = 5000; break; + case SPELL_FIREBALL: FireCooldown = 5000; break; + case SPELL_FROSTBOLT: FrostCooldown = 5000; break; + } + } +}; + +struct water_elementalAI : public ScriptedAI +{ + water_elementalAI(Creature *c) : ScriptedAI(c) {} + + uint32 CastTimer; + + void Reset() + { + CastTimer = 2000 + (rand()%3000); + } + + void EnterCombat(Unit* /*who*/) {} + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (CastTimer <= diff) + { + DoCast(me->getVictim(), SPELL_WATERBOLT); + CastTimer = urand(2000,5000); + } else CastTimer -= diff; + } +}; + +CreatureAI* GetAI_boss_aran(Creature* pCreature) +{ + return new boss_aranAI (pCreature); +} + +CreatureAI* GetAI_water_elemental(Creature* pCreature) +{ + return new water_elementalAI (pCreature); +} + +// CONVERT TO ACID +CreatureAI* GetAI_shadow_of_aran(Creature* pCreature) +{ + outstring_log("TSCR: Convert simpleAI script for Creature Entry %u to ACID", pCreature->GetEntry()); + SimpleAI* ai = new SimpleAI (pCreature); + + ai->Spell[0].Enabled = true; + ai->Spell[0].Spell_Id = SPELL_SHADOW_PYRO; + ai->Spell[0].Cooldown = 5000; + ai->Spell[0].First_Cast = 1000; + ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_TARGET; + + ai->EnterEvadeMode(); + + return ai; +} + +void AddSC_boss_shade_of_aran() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_shade_of_aran"; + newscript->GetAI = &GetAI_boss_aran; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_shadow_of_aran"; + newscript->GetAI = &GetAI_shadow_of_aran; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_aran_elemental"; + newscript->GetAI = &GetAI_water_elemental; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp new file mode 100644 index 00000000000..5305cc8d354 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp @@ -0,0 +1,417 @@ +/* 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_Terestian_Illhoof +SD%Complete: 95 +SDComment: Complete! Needs adjustments to use spell though. +SDCategory: Karazhan +EndScriptData */ + +#include "ScriptedPch.h" +#include "karazhan.h" + +#define SAY_SLAY1 -1532065 +#define SAY_SLAY2 -1532066 +#define SAY_DEATH -1532067 +#define SAY_AGGRO -1532068 +#define SAY_SACRIFICE1 -1532069 +#define SAY_SACRIFICE2 -1532070 +#define SAY_SUMMON1 -1532071 +#define SAY_SUMMON2 -1532072 + +#define SPELL_SUMMON_DEMONCHAINS 30120 // Summons demonic chains that maintain the ritual of sacrifice. +#define SPELL_DEMON_CHAINS 30206 // Instant - Visual Effect +#define SPELL_ENRAGE 23537 // Increases the caster's attack speed by 50% and the Physical damage it deals by 219 to 281 for 10 min. +#define SPELL_SHADOW_BOLT 30055 // Hurls a bolt of dark magic at an enemy, inflicting Shadow damage. +#define SPELL_SACRIFICE 30115 // Teleports and adds the debuff +#define SPELL_BERSERK 32965 // Increases attack speed by 75%. Periodically casts Shadow Bolt Volley. +#define SPELL_SUMMON_FIENDISIMP 30184 // Summons a Fiendish Imp. +#define SPELL_SUMMON_IMP 30066 // Summons Kil'rek + +#define SPELL_FIENDISH_PORTAL 30171 // Opens portal and summons Fiendish Portal, 2 sec cast +#define SPELL_FIENDISH_PORTAL_1 30179 // Opens portal and summons Fiendish Portal, instant cast + +#define SPELL_FIREBOLT 30050 // Blasts a target for 150 Fire damage. +#define SPELL_BROKEN_PACT 30065 // All damage taken increased by 25%. +#define SPELL_AMPLIFY_FLAMES 30053 // Increases the Fire damage taken by an enemy by 500 for 25 sec. + +#define CREATURE_DEMONCHAINS 17248 +#define CREATURE_FIENDISHIMP 17267 +#define CREATURE_PORTAL 17265 +#define CREATURE_KILREK 17229 + +struct mob_kilrekAI : public ScriptedAI +{ + mob_kilrekAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint64 TerestianGUID; + + uint32 AmplifyTimer; + + void Reset() + { + TerestianGUID = 0; + AmplifyTimer = 2000; + } + + void EnterCombat(Unit * /*who*/) + { + if (!pInstance) + { + ERROR_INST_DATA(me); + return; + } + } + + void JustDied(Unit* /*Killer*/) + { + if (pInstance) + { + uint64 TerestianGUID = pInstance->GetData64(DATA_TERESTIAN); + if (TerestianGUID) + { + Unit* Terestian = Unit::GetUnit((*me), TerestianGUID); + if (Terestian && Terestian->isAlive()) + DoCast(Terestian, SPELL_BROKEN_PACT, true); + } + } else ERROR_INST_DATA(me); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + if (AmplifyTimer <= diff) + { + me->InterruptNonMeleeSpells(false); + DoCast(me->getVictim(), SPELL_AMPLIFY_FLAMES); + + AmplifyTimer = urand(10000,20000); + } else AmplifyTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct mob_demon_chainAI : public ScriptedAI +{ + mob_demon_chainAI(Creature *c) : ScriptedAI(c) {} + + uint64 SacrificeGUID; + + void Reset() + { + SacrificeGUID = 0; + } + + void EnterCombat(Unit* /*who*/) {} + void AttackStart(Unit* /*who*/) {} + void MoveInLineOfSight(Unit* /*who*/) {} + + void JustDied(Unit * /*killer*/) + { + if (SacrificeGUID) + { + Unit* Sacrifice = Unit::GetUnit((*me),SacrificeGUID); + if (Sacrifice) + Sacrifice->RemoveAurasDueToSpell(SPELL_SACRIFICE); + } + } +}; + +struct mob_fiendish_portalAI : public PassiveAI +{ + mob_fiendish_portalAI(Creature *c) : PassiveAI(c),summons(me){} + + SummonList summons; + + void Reset() + { + summons.DespawnAll(); + } + + void JustSummoned(Creature* summon) + { + summons.Summon(summon); + DoZoneInCombat(summon); + } + + void DespawnAllImp() + { + summons.DespawnAll(); + } +}; + +struct boss_terestianAI : public ScriptedAI +{ + boss_terestianAI(Creature *c) : ScriptedAI(c) + { + for (uint8 i = 0; i < 2; ++i) + PortalGUID[i] = 0; + pInstance = c->GetInstanceData(); + } + + ScriptedInstance *pInstance; + + uint64 PortalGUID[2]; + uint8 PortalsCount; + + uint32 SacrificeTimer; + uint32 ShadowboltTimer; + uint32 SummonTimer; + uint32 BerserkTimer; + + bool SummonedPortals; + bool Berserk; + + void Reset() + { + for (uint8 i = 0; i < 2; ++i) + { + if (PortalGUID[i]) + { + if (Creature* pPortal = Unit::GetCreature(*me, PortalGUID[i])) + { + CAST_AI(mob_fiendish_portalAI, pPortal->AI())->DespawnAllImp(); + pPortal->ForcedDespawn(); + } + + PortalGUID[i] = 0; + } + } + + PortalsCount = 0; + SacrificeTimer = 30000; + ShadowboltTimer = 5000; + SummonTimer = 10000; + BerserkTimer = 600000; + + SummonedPortals = false; + Berserk = false; + + if (pInstance) + pInstance->SetData(TYPE_TERESTIAN, NOT_STARTED); + + me->RemoveAurasDueToSpell(SPELL_BROKEN_PACT); + + if (Minion* Kilrek = me->GetFirstMinion()) + { + if (!Kilrek->isAlive()) + { + Kilrek->UnSummon(); + DoCast(me, SPELL_SUMMON_IMP, true); + } + } + else DoCast(me, SPELL_SUMMON_IMP, true); + } + + void EnterCombat(Unit* /*who*/) + { + DoScriptText(SAY_AGGRO, me); + } + + void JustSummoned(Creature* pSummoned) + { + if (pSummoned->GetEntry() == CREATURE_PORTAL) + { + PortalGUID[PortalsCount] = pSummoned->GetGUID(); + ++PortalsCount; + + if (pSummoned->GetUInt32Value(UNIT_CREATED_BY_SPELL) == SPELL_FIENDISH_PORTAL_1) + { + DoScriptText(RAND(SAY_SUMMON1,SAY_SUMMON2), me); + SummonedPortals = true; + } + } + } + + void KilledUnit(Unit * /*victim*/) + { + DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me); + } + + void JustDied(Unit * /*killer*/) + { + for (uint8 i = 0; i < 2; ++i) + { + if (PortalGUID[i]) + { + if (Creature* pPortal = Unit::GetCreature((*me), PortalGUID[i])) + pPortal->ForcedDespawn(); + + PortalGUID[i] = 0; + } + } + + DoScriptText(SAY_DEATH, me); + + if (pInstance) + pInstance->SetData(TYPE_TERESTIAN, DONE); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (SacrificeTimer <= diff) + { + Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true); + if (pTarget && pTarget->isAlive()) + { + DoCast(pTarget, SPELL_SACRIFICE, true); + DoCast(pTarget, SPELL_SUMMON_DEMONCHAINS, true); + + if (Creature* Chains = me->FindNearestCreature(CREATURE_DEMONCHAINS, 5000)) + { + CAST_AI(mob_demon_chainAI, Chains->AI())->SacrificeGUID = pTarget->GetGUID(); + Chains->CastSpell(Chains, SPELL_DEMON_CHAINS, true); + DoScriptText(RAND(SAY_SACRIFICE1,SAY_SACRIFICE2), me); + SacrificeTimer = 30000; + } + } + } else SacrificeTimer -= diff; + + if (ShadowboltTimer <= diff) + { + DoCast(SelectUnit(SELECT_TARGET_TOPAGGRO, 0), SPELL_SHADOW_BOLT); + ShadowboltTimer = 10000; + } else ShadowboltTimer -= diff; + + if (SummonTimer <= diff) + { + if (!PortalGUID[0]) + DoCast(me->getVictim(), SPELL_FIENDISH_PORTAL, false); + + if (!PortalGUID[1]) + DoCast(me->getVictim(), SPELL_FIENDISH_PORTAL_1, false); + + if (PortalGUID[0] && PortalGUID[1]) + { + if (Creature* pPortal = Unit::GetCreature(*me, PortalGUID[urand(0,1)])) + pPortal->CastSpell(me->getVictim(), SPELL_SUMMON_FIENDISIMP, false); + SummonTimer = 5000; + } + } else SummonTimer -= diff; + + if (!Berserk) + { + if (BerserkTimer <= diff) + { + DoCast(me, SPELL_BERSERK); + Berserk = true; + } else BerserkTimer -= diff; + } + + DoMeleeAttackIfReady(); + } +}; + +#define SPELL_FIREBOLT 30050 // Blasts a target for 181-209 Fire damage. + +struct mob_fiendish_impAI : public ScriptedAI +{ + mob_fiendish_impAI(Creature *c) : ScriptedAI(c) {} + + uint32 FireboltTimer; + + void Reset() + { + FireboltTimer = 2000; + + me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true); + } + + void EnterCombat(Unit * /*who*/) {} + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + if (FireboltTimer <= diff) + { + DoCast(me->getVictim(), SPELL_FIREBOLT); + FireboltTimer = 2200; + } else FireboltTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_kilrek(Creature* pCreature) +{ + return new mob_kilrekAI (pCreature); +} + +CreatureAI* GetAI_mob_fiendish_imp(Creature* pCreature) +{ + return new mob_fiendish_impAI (pCreature); +} + +CreatureAI* GetAI_mob_fiendish_portal(Creature* pCreature) +{ + return new mob_fiendish_portalAI (pCreature); +} + +CreatureAI* GetAI_boss_terestian_illhoof(Creature* pCreature) +{ + return new boss_terestianAI (pCreature); +} + +CreatureAI* GetAI_mob_demon_chain(Creature* pCreature) +{ + return new mob_demon_chainAI(pCreature); +} + +void AddSC_boss_terestian_illhoof() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_terestian_illhoof"; + newscript->GetAI = &GetAI_boss_terestian_illhoof; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_fiendish_imp"; + newscript->GetAI = &GetAI_mob_fiendish_imp; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name= "mob_fiendish_portal"; + newscript->GetAI = &GetAI_mob_fiendish_portal; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_kilrek"; + newscript->GetAI = &GetAI_mob_kilrek; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_demon_chain"; + newscript->GetAI = &GetAI_mob_demon_chain; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp new file mode 100644 index 00000000000..ae6de9c1add --- /dev/null +++ b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp @@ -0,0 +1,1494 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 .sourceforge.net/> + * 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: Bosses_Opera +SD%Complete: 90 +SDComment: Oz, Hood, and RAJ event implemented. RAJ event requires more testing. +SDCategory: Karazhan +EndScriptData */ + +#include "ScriptedPch.h" +#include "karazhan.h" + +/***********************************/ +/*** OPERA WIZARD OF OZ EVENT *****/ +/*********************************/ + +#define SAY_DOROTHEE_DEATH -1532025 +#define SAY_DOROTHEE_SUMMON -1532026 +#define SAY_DOROTHEE_TITO_DEATH -1532027 +#define SAY_DOROTHEE_AGGRO -1532028 + +#define SAY_ROAR_AGGRO -1532029 +#define SAY_ROAR_DEATH -1532030 +#define SAY_ROAR_SLAY -1532031 + +#define SAY_STRAWMAN_AGGRO -1532032 +#define SAY_STRAWMAN_DEATH -1532033 +#define SAY_STRAWMAN_SLAY -1532034 + +#define SAY_TINHEAD_AGGRO -1532035 +#define SAY_TINHEAD_DEATH -1532036 +#define SAY_TINHEAD_SLAY -1532037 +#define EMOTE_RUST -1532038 + +#define SAY_CRONE_AGGRO -1532039 +#define SAY_CRONE_AGGRO2 -1532040 +#define SAY_CRONE_DEATH -1532041 +#define SAY_CRONE_SLAY -1532042 + +/**** Spells ****/ +// Dorothee +#define SPELL_WATERBOLT 31012 +#define SPELL_SCREAM 31013 +#define SPELL_SUMMONTITO 31014 + +// Tito +#define SPELL_YIPPING 31015 + +// Strawman +#define SPELL_BRAIN_BASH 31046 +#define SPELL_BRAIN_WIPE 31069 +#define SPELL_BURNING_STRAW 31075 + +// Tinhead +#define SPELL_CLEAVE 31043 +#define SPELL_RUST 31086 + +// Roar +#define SPELL_MANGLE 31041 +#define SPELL_SHRED 31042 +#define SPELL_FRIGHTENED_SCREAM 31013 + +// Crone +#define SPELL_CHAIN_LIGHTNING 32337 + +// Cyclone +#define SPELL_KNOCKBACK 32334 +#define SPELL_CYCLONE_VISUAL 32332 + +/** Creature Entries **/ +#define CREATURE_TITO 17548 +#define CREATURE_CYCLONE 18412 +#define CREATURE_CRONE 18168 + +void SummonCroneIfReady(ScriptedInstance* pInstance, Creature* pCreature) +{ + pInstance->SetData(DATA_OPERA_OZ_DEATHCOUNT, SPECIAL); // Increment DeathCount + + if (pInstance->GetData(DATA_OPERA_OZ_DEATHCOUNT) == 4) + { + if (Creature* pCrone = pCreature->SummonCreature(CREATURE_CRONE, -10891.96, -1755.95, pCreature->GetPositionZ(), 4.64, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, HOUR*2*IN_MILISECONDS)) + { + if (pCreature->getVictim()) + pCrone->AI()->AttackStart(pCreature->getVictim()); + } + } +}; + +struct boss_dorotheeAI : public ScriptedAI +{ + boss_dorotheeAI(Creature* c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint32 AggroTimer; + + uint32 WaterBoltTimer; + uint32 FearTimer; + uint32 SummonTitoTimer; + + bool SummonedTito; + bool TitoDied; + + void Reset() + { + AggroTimer = 500; + + WaterBoltTimer = 5000; + FearTimer = 15000; + SummonTitoTimer = 47500; + + SummonedTito = false; + TitoDied = false; + } + + void EnterCombat(Unit* /*who*/) + { + DoScriptText(SAY_DOROTHEE_AGGRO, me); + } + + void JustReachedHome() + { + me->ForcedDespawn(); + } + + void SummonTito(); // See below + + void JustDied(Unit* /*killer*/) + { + DoScriptText(SAY_DOROTHEE_DEATH, me); + + if (pInstance) + SummonCroneIfReady(pInstance, me); + } + + void AttackStart(Unit* who) + { + if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + ScriptedAI::AttackStart(who); + } + + void MoveInLineOfSight(Unit* who) + { + if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + ScriptedAI::MoveInLineOfSight(who); + } + + void UpdateAI(const uint32 diff) + { + if (AggroTimer) + { + if (AggroTimer <= diff) + { + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + AggroTimer = 0; + } else AggroTimer -= diff; + } + + if (!UpdateVictim()) + return; + + if (WaterBoltTimer <= diff) + { + DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_WATERBOLT); + WaterBoltTimer = TitoDied ? 1500 : 5000; + } else WaterBoltTimer -= diff; + + if (FearTimer <= diff) + { + DoCast(me->getVictim(), SPELL_SCREAM); + FearTimer = 30000; + } else FearTimer -= diff; + + if (!SummonedTito) + { + if (SummonTitoTimer <= diff) + SummonTito(); + else SummonTitoTimer -= diff; + } + + DoMeleeAttackIfReady(); + } +}; + +struct mob_titoAI : public ScriptedAI +{ + mob_titoAI(Creature* c) : ScriptedAI(c) {} + + uint64 DorotheeGUID; + uint32 YipTimer; + + void Reset() + { + DorotheeGUID = 0; + YipTimer = 10000; + } + + void EnterCombat(Unit* /*who*/) {} + + void JustDied(Unit* /*killer*/) + { + if (DorotheeGUID) + { + Creature* Dorothee = (Unit::GetCreature((*me), DorotheeGUID)); + if (Dorothee && Dorothee->isAlive()) + { + CAST_AI(boss_dorotheeAI, Dorothee->AI())->TitoDied = true; + DoScriptText(SAY_DOROTHEE_TITO_DEATH, Dorothee); + } + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (YipTimer <= diff) + { + DoCast(me->getVictim(), SPELL_YIPPING); + YipTimer = 10000; + } else YipTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +void boss_dorotheeAI::SummonTito() +{ + if (Creature* pTito = me->SummonCreature(CREATURE_TITO, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000)) + { + DoScriptText(SAY_DOROTHEE_SUMMON, me); + CAST_AI(mob_titoAI, pTito->AI())->DorotheeGUID = me->GetGUID(); + pTito->AI()->AttackStart(me->getVictim()); + SummonedTito = true; + TitoDied = false; + } +} + +struct boss_strawmanAI : public ScriptedAI +{ + boss_strawmanAI(Creature* c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint32 AggroTimer; + uint32 BrainBashTimer; + uint32 BrainWipeTimer; + + void Reset() + { + AggroTimer = 13000; + BrainBashTimer = 5000; + BrainWipeTimer = 7000; + } + + void AttackStart(Unit* who) + { + if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + ScriptedAI::AttackStart(who); + } + + void MoveInLineOfSight(Unit* who) + { + if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + ScriptedAI::MoveInLineOfSight(who); + } + + void EnterCombat(Unit* /*who*/) + { + DoScriptText(SAY_STRAWMAN_AGGRO, me); + } + + void JustReachedHome() + { + me->ForcedDespawn(); + } + + void SpellHit(Unit* /*caster*/, const SpellEntry *Spell) + { + if ((Spell->SchoolMask == SPELL_SCHOOL_MASK_FIRE) && (!(rand()%10))) + { + /* + if (not direct damage(aoe,dot)) + return; + */ + + DoCast(me, SPELL_BURNING_STRAW, true); + } + } + + void JustDied(Unit* /*killer*/) + { + DoScriptText(SAY_STRAWMAN_DEATH, me); + + if (pInstance) + SummonCroneIfReady(pInstance, me); + } + + void KilledUnit(Unit* /*victim*/) + { + DoScriptText(SAY_STRAWMAN_SLAY, me); + } + + void UpdateAI(const uint32 diff) + { + if (AggroTimer) + { + if (AggroTimer <= diff) + { + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + AggroTimer = 0; + } else AggroTimer -= diff; + } + + if (!UpdateVictim()) + return; + + if (BrainBashTimer <= diff) + { + DoCast(me->getVictim(), SPELL_BRAIN_BASH); + BrainBashTimer = 15000; + } else BrainBashTimer -= diff; + + if (BrainWipeTimer <= diff) + { + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) + DoCast(pTarget, SPELL_BRAIN_WIPE); + BrainWipeTimer = 20000; + } else BrainWipeTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct boss_tinheadAI : public ScriptedAI +{ + boss_tinheadAI(Creature* c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint32 AggroTimer; + uint32 CleaveTimer; + uint32 RustTimer; + + uint8 RustCount; + + void Reset() + { + AggroTimer = 15000; + CleaveTimer = 5000; + RustTimer = 30000; + + RustCount = 0; + } + + void EnterCombat(Unit* /*who*/) + { + DoScriptText(SAY_TINHEAD_AGGRO, me); + } + + void JustReachedHome() + { + me->ForcedDespawn(); + } + + void AttackStart(Unit* who) + { + if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + ScriptedAI::AttackStart(who); + } + + void MoveInLineOfSight(Unit* who) + { + if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + ScriptedAI::MoveInLineOfSight(who); + } + + void JustDied(Unit* /*killer*/) + { + DoScriptText(SAY_TINHEAD_DEATH, me); + + if (pInstance) + SummonCroneIfReady(pInstance, me); + } + + void KilledUnit(Unit* /*victim*/) + { + DoScriptText(SAY_TINHEAD_SLAY, me); + } + + void UpdateAI(const uint32 diff) + { + if (AggroTimer) + { + if (AggroTimer <= diff) + { + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + AggroTimer = 0; + } else AggroTimer -= diff; + } + + if (!UpdateVictim()) + return; + + if (CleaveTimer <= diff) + { + DoCast(me->getVictim(), SPELL_CLEAVE); + CleaveTimer = 5000; + } else CleaveTimer -= diff; + + if (RustCount < 8) + { + if (RustTimer <= diff) + { + ++RustCount; + DoScriptText(EMOTE_RUST, me); + DoCast(me, SPELL_RUST); + RustTimer = 6000; + } else RustTimer -= diff; + } + + DoMeleeAttackIfReady(); + } +}; + +struct boss_roarAI : public ScriptedAI +{ + boss_roarAI(Creature* c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint32 AggroTimer; + uint32 MangleTimer; + uint32 ShredTimer; + uint32 ScreamTimer; + + void Reset() + { + AggroTimer = 20000; + MangleTimer = 5000; + ShredTimer = 10000; + ScreamTimer = 15000; + } + + void MoveInLineOfSight(Unit* who) + { + if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + ScriptedAI::MoveInLineOfSight(who); + } + + void AttackStart(Unit* who) + { + if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + ScriptedAI::AttackStart(who); + } + + void EnterCombat(Unit* /*who*/) + { + DoScriptText(SAY_ROAR_AGGRO, me); + } + + void JustReachedHome() + { + me->ForcedDespawn(); + } + + void JustDied(Unit* /*killer*/) + { + DoScriptText(SAY_ROAR_DEATH, me); + + if (pInstance) + SummonCroneIfReady(pInstance, me); + } + + void KilledUnit(Unit* /*victim*/) + { + DoScriptText(SAY_ROAR_SLAY, me); + } + + void UpdateAI(const uint32 diff) + { + if (AggroTimer) + { + if (AggroTimer <= diff) + { + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + AggroTimer = 0; + } else AggroTimer -= diff; + } + + if (!UpdateVictim()) + return; + + if (MangleTimer <= diff) + { + DoCast(me->getVictim(), SPELL_MANGLE); + MangleTimer = urand(5000,8000); + } else MangleTimer -= diff; + + if (ShredTimer <= diff) + { + DoCast(me->getVictim(), SPELL_SHRED); + ShredTimer = urand(10000,15000); + } else ShredTimer -= diff; + + if (ScreamTimer <= diff) + { + DoCast(me->getVictim(), SPELL_FRIGHTENED_SCREAM); + ScreamTimer = urand(20000,30000); + } else ScreamTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct boss_croneAI : public ScriptedAI +{ + boss_croneAI(Creature* c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint32 CycloneTimer; + uint32 ChainLightningTimer; + + void Reset() + { + CycloneTimer = 30000; + ChainLightningTimer = 10000; + } + + void JustReachedHome() + { + me->ForcedDespawn(); + } + + void EnterCombat(Unit* /*who*/) + { + DoScriptText(RAND(SAY_CRONE_AGGRO,SAY_CRONE_AGGRO2), me); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + } + + void JustDied(Unit* /*killer*/) + { + DoScriptText(SAY_CRONE_DEATH, me); + + if (pInstance) + { + pInstance->SetData(TYPE_OPERA, DONE); + pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_STAGEDOORLEFT), true); + pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_STAGEDOORRIGHT), true); + + if (GameObject* pSideEntrance = pInstance->instance->GetGameObject(pInstance->GetData64(DATA_GO_SIDE_ENTRANCE_DOOR))) + pSideEntrance->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED); + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + if (CycloneTimer <= diff) + { + if (Creature* Cyclone = DoSpawnCreature(CREATURE_CYCLONE, urand(0,9), urand(0,9), 0, 0, TEMPSUMMON_TIMED_DESPAWN, 15000)) + Cyclone->CastSpell(Cyclone, SPELL_CYCLONE_VISUAL, true); + CycloneTimer = 30000; + } else CycloneTimer -= diff; + + if (ChainLightningTimer <= diff) + { + DoCast(me->getVictim(), SPELL_CHAIN_LIGHTNING); + ChainLightningTimer = 15000; + } else ChainLightningTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct mob_cycloneAI : public ScriptedAI +{ + mob_cycloneAI(Creature* c) : ScriptedAI(c) {} + + uint32 MoveTimer; + + void Reset() + { + MoveTimer = 1000; + } + + void EnterCombat(Unit* /*who*/) {} + + void MoveInLineOfSight(Unit* /*who*/) + { + } + + void UpdateAI(const uint32 diff) + { + if (!me->HasAura(SPELL_KNOCKBACK)) + DoCast(me, SPELL_KNOCKBACK, true); + + if (MoveTimer <= diff) + { + Position pos; + me->GetRandomNearPosition(pos, 10); + me->GetMotionMaster()->MovePoint(0, pos); + MoveTimer = urand(5000,8000); + } else MoveTimer -= diff; + } +}; + +CreatureAI* GetAI_boss_dorothee(Creature* pCreature) +{ + return new boss_dorotheeAI(pCreature); +} + +CreatureAI* GetAI_boss_strawman(Creature* pCreature) +{ + return new boss_strawmanAI(pCreature); +} + +CreatureAI* GetAI_boss_tinhead(Creature* pCreature) +{ + return new boss_tinheadAI(pCreature); +} + +CreatureAI* GetAI_boss_roar(Creature* pCreature) +{ + return new boss_roarAI(pCreature); +} + +CreatureAI* GetAI_boss_crone(Creature* pCreature) +{ + return new boss_croneAI(pCreature); +} + +CreatureAI* GetAI_mob_tito(Creature* pCreature) +{ + return new mob_titoAI(pCreature); +} + +CreatureAI* GetAI_mob_cyclone(Creature* pCreature) +{ + return new mob_cycloneAI(pCreature); +} + +/**************************************/ +/**** Opera Red Riding Hood Event ****/ +/************************************/ + +/**** Yells for the Wolf ****/ +#define SAY_WOLF_AGGRO -1532043 +#define SAY_WOLF_SLAY -1532044 +#define SAY_WOLF_HOOD -1532045 +#define SOUND_WOLF_DEATH 9275 //Only sound on death, no text. + +/**** Spells For The Wolf ****/ +#define SPELL_LITTLE_RED_RIDING_HOOD 30768 +#define SPELL_TERRIFYING_HOWL 30752 +#define SPELL_WIDE_SWIPE 30761 + +#define GOSSIP_GRANDMA "What phat lewtz you have grandmother?" + +/**** The Wolf's Entry ****/ +#define CREATURE_BIG_BAD_WOLF 17521 + +bool GossipHello_npc_grandmother(Player* pPlayer, Creature* pCreature) +{ + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_GRANDMA, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + pPlayer->SEND_GOSSIP_MENU(8990, pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_grandmother(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF) + { + if (Creature* pBigBadWolf = pCreature->SummonCreature(CREATURE_BIG_BAD_WOLF, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, HOUR*2*IN_MILISECONDS)) + pBigBadWolf->AI()->AttackStart(pPlayer); + + pCreature->ForcedDespawn(); + } + + return true; +} + +struct boss_bigbadwolfAI : public ScriptedAI +{ + boss_bigbadwolfAI(Creature* c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint32 ChaseTimer; + uint32 FearTimer; + uint32 SwipeTimer; + + uint64 HoodGUID; + float TempThreat; + + bool IsChasing; + + void Reset() + { + ChaseTimer = 30000; + FearTimer = 25000 + rand()%10000; + SwipeTimer = 5000; + + HoodGUID = 0; + TempThreat = 0; + + IsChasing = false; + } + + void EnterCombat(Unit* /*who*/) + { + DoScriptText(SAY_WOLF_AGGRO, me); + } + + void JustReachedHome() + { + me->ForcedDespawn(); + } + + void JustDied(Unit* /*killer*/) + { + DoPlaySoundToSet(me, SOUND_WOLF_DEATH); + + if (pInstance) + { + pInstance->SetData(TYPE_OPERA, DONE); + pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_STAGEDOORLEFT), true); + pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_STAGEDOORRIGHT), true); + + if (GameObject* pSideEntrance = pInstance->instance->GetGameObject(pInstance->GetData64(DATA_GO_SIDE_ENTRANCE_DOOR))) + pSideEntrance->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED); + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + + if (ChaseTimer <= diff) + { + if (!IsChasing) + { + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) + { + DoScriptText(SAY_WOLF_HOOD, me); + DoCast(pTarget, SPELL_LITTLE_RED_RIDING_HOOD, true); + TempThreat = DoGetThreat(pTarget); + if (TempThreat) + DoModifyThreatPercent(pTarget, -100); + HoodGUID = pTarget->GetGUID(); + me->AddThreat(pTarget, 1000000.0f); + ChaseTimer = 20000; + IsChasing = true; + } + } + else + { + IsChasing = false; + + if (Unit *pTarget = Unit::GetUnit((*me), HoodGUID)) + { + HoodGUID = 0; + if (DoGetThreat(pTarget)) + DoModifyThreatPercent(pTarget, -100); + me->AddThreat(pTarget, TempThreat); + TempThreat = 0; + } + + ChaseTimer = 40000; + } + } else ChaseTimer -= diff; + + if (IsChasing) + return; + + if (FearTimer <= diff) + { + DoCast(me->getVictim(), SPELL_TERRIFYING_HOWL); + FearTimer = urand(25000,35000); + } else FearTimer -= diff; + + if (SwipeTimer <= diff) + { + DoCast(me->getVictim(), SPELL_WIDE_SWIPE); + SwipeTimer = urand(25000,30000); + } else SwipeTimer -= diff; + + } +}; + +CreatureAI* GetAI_boss_bigbadwolf(Creature* pCreature) +{ + return new boss_bigbadwolfAI(pCreature); +} + +/**********************************************/ +/******** Opera Romeo and Juliet Event *******/ +/********************************************/ + +/**** Speech *****/ +#define SAY_JULIANNE_AGGRO -1532046 +#define SAY_JULIANNE_ENTER -1532047 +#define SAY_JULIANNE_DEATH01 -1532048 +#define SAY_JULIANNE_DEATH02 -1532049 +#define SAY_JULIANNE_RESURRECT -1532050 +#define SAY_JULIANNE_SLAY -1532051 + +#define SAY_ROMULO_AGGRO -1532052 +#define SAY_ROMULO_DEATH -1532053 +#define SAY_ROMULO_ENTER -1532054 +#define SAY_ROMULO_RESURRECT -1532055 +#define SAY_ROMULO_SLAY -1532056 + +/***** Spells For Julianne *****/ +#define SPELL_BLINDING_PASSION 30890 +#define SPELL_DEVOTION 30887 +#define SPELL_ETERNAL_AFFECTION 30878 +#define SPELL_POWERFUL_ATTRACTION 30889 +#define SPELL_DRINK_POISON 30907 + +/***** Spells For Romulo ****/ +#define SPELL_BACKWARD_LUNGE 30815 +#define SPELL_DARING 30841 +#define SPELL_DEADLY_SWATHE 30817 +#define SPELL_POISON_THRUST 30822 + +/**** Other Misc. Spells ****/ +#define SPELL_UNDYING_LOVE 30951 +#define SPELL_RES_VISUAL 24171 + +/*** Misc. Information ****/ +#define CREATURE_ROMULO 17533 +#define ROMULO_X -10900 +#define ROMULO_Y -1758 + +enum RAJPhase +{ + PHASE_JULIANNE = 0, + PHASE_ROMULO = 1, + PHASE_BOTH = 2, +}; + +void PretendToDie(Creature* pCreature) +{ + pCreature->InterruptNonMeleeSpells(true); + pCreature->RemoveAllAuras(); + pCreature->SetHealth(0); + pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + pCreature->GetMotionMaster()->MovementExpired(false); + pCreature->GetMotionMaster()->MoveIdle(); + pCreature->SetStandState(UNIT_STAND_STATE_DEAD); +}; + +void Resurrect(Creature *pTarget) +{ + pTarget->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + pTarget->SetHealth(pTarget->GetMaxHealth()); + pTarget->SetStandState(UNIT_STAND_STATE_STAND); + pTarget->CastSpell(pTarget, SPELL_RES_VISUAL, true); + if (pTarget->getVictim()) + { + pTarget->GetMotionMaster()->MoveChase(pTarget->getVictim()); + pTarget->AI()->AttackStart(pTarget->getVictim()); + } + else + pTarget->GetMotionMaster()->Initialize(); +}; + +struct boss_julianneAI : public ScriptedAI +{ + boss_julianneAI(Creature* c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + EntryYellTimer = 1000; + AggroYellTimer = 10000; + IsFakingDeath = false; + } + + ScriptedInstance* pInstance; + + uint32 EntryYellTimer; + uint32 AggroYellTimer; + + uint64 RomuloGUID; + + uint32 Phase; + + uint32 BlindingPassionTimer; + uint32 DevotionTimer; + uint32 EternalAffectionTimer; + uint32 PowerfulAttractionTimer; + uint32 SummonRomuloTimer; + uint32 ResurrectTimer; + uint32 DrinkPoisonTimer; + uint32 ResurrectSelfTimer; + + bool IsFakingDeath; + bool SummonedRomulo; + bool RomuloDead; + + void Reset() + { + RomuloGUID = 0; + Phase = PHASE_JULIANNE; + + BlindingPassionTimer = 30000; + DevotionTimer = 15000; + EternalAffectionTimer = 25000; + PowerfulAttractionTimer = 5000; + SummonRomuloTimer = 10000; + DrinkPoisonTimer = 0; + ResurrectSelfTimer = 0; + + if (IsFakingDeath) + { + Resurrect(me); + IsFakingDeath = false; + } + + SummonedRomulo = false; + RomuloDead = false; + } + + void EnterCombat(Unit* /*who*/) {} + + void AttackStart(Unit* who) + { + if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + ScriptedAI::AttackStart(who); + } + + void MoveInLineOfSight(Unit* who) + { + if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + ScriptedAI::MoveInLineOfSight(who); + } + + void JustReachedHome() + { + me->ForcedDespawn(); + } + + void SpellHit(Unit* /*caster*/, const SpellEntry *Spell) + { + if (Spell->Id == SPELL_DRINK_POISON) + { + DoScriptText(SAY_JULIANNE_DEATH01, me); + DrinkPoisonTimer = 2500; + } + } + + void DamageTaken(Unit* done_by, uint32 &damage); + + void JustDied(Unit* /*killer*/) + { + DoScriptText(SAY_JULIANNE_DEATH02, me); + + if (pInstance) + { + pInstance->SetData(TYPE_OPERA, DONE); + pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_STAGEDOORLEFT), true); + pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_STAGEDOORRIGHT), true); + if (GameObject* pSideEntrance = pInstance->instance->GetGameObject(pInstance->GetData64(DATA_GO_SIDE_ENTRANCE_DOOR))) + pSideEntrance->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED); + } + } + + void KilledUnit(Unit* /*victim*/) + { + DoScriptText(SAY_JULIANNE_SLAY, me); + } + + void UpdateAI(const uint32 diff); +}; + +struct boss_romuloAI : public ScriptedAI +{ + boss_romuloAI(Creature* c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + EntryYellTimer = 8000; + AggroYellTimer = 15000; + } + + ScriptedInstance* pInstance; + + uint64 JulianneGUID; + uint32 Phase; + + uint32 EntryYellTimer; + uint32 AggroYellTimer; + uint32 BackwardLungeTimer; + uint32 DaringTimer; + uint32 DeadlySwatheTimer; + uint32 PoisonThrustTimer; + uint32 ResurrectTimer; + + bool IsFakingDeath; + bool JulianneDead; + + void Reset() + { + JulianneGUID = 0; + Phase = PHASE_ROMULO; + + BackwardLungeTimer = 15000; + DaringTimer = 20000; + DeadlySwatheTimer = 25000; + PoisonThrustTimer = 10000; + ResurrectTimer = 10000; + + IsFakingDeath = false; + JulianneDead = false; + } + + void JustReachedHome() + { + me->ForcedDespawn(); + } + + void DamageTaken(Unit* done_by, uint32 &damage); + + void EnterCombat(Unit* /*who*/) + { + DoScriptText(SAY_ROMULO_AGGRO, me); + if (JulianneGUID) + { + Creature* Julianne = (Unit::GetCreature((*me), JulianneGUID)); + if (Julianne && Julianne->getVictim()) + { + me->AddThreat(Julianne->getVictim(), 1.0f); + AttackStart(Julianne->getVictim()); + } + } + } + + void MoveInLineOfSight(Unit* who) + { + if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + ScriptedAI::MoveInLineOfSight(who); + } + + void JustDied(Unit* /*killer*/) + { + DoScriptText(SAY_ROMULO_DEATH, me); + + if (pInstance) + { + pInstance->SetData(TYPE_OPERA, DONE); + pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_STAGEDOORLEFT), true); + pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_STAGEDOORRIGHT), true); + + if (GameObject* pSideEntrance = pInstance->instance->GetGameObject(pInstance->GetData64(DATA_GO_SIDE_ENTRANCE_DOOR))) + pSideEntrance->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED); + } + } + + void KilledUnit(Unit* /*victim*/) + { + DoScriptText(SAY_ROMULO_SLAY, me); + } + + void UpdateAI(const uint32 diff); +}; + +void boss_julianneAI::DamageTaken(Unit* /*done_by*/, uint32 &damage) +{ + if (damage < me->GetHealth()) + return; + + //anything below only used if incoming damage will kill + + if (Phase == PHASE_JULIANNE) + { + damage = 0; + + //this means already drinking, so return + if (IsFakingDeath) + return; + + me->InterruptNonMeleeSpells(true); + DoCast(me, SPELL_DRINK_POISON); + + IsFakingDeath = true; + //IS THIS USEFULL? Creature* Julianne = (Unit::GetCreature((*me), JulianneGUID)); + return; + } + + if (Phase == PHASE_ROMULO) + { + error_log("TSCR: boss_julianneAI: cannot take damage in PHASE_ROMULO, why was i here?"); + damage = 0; + return; + } + + if (Phase == PHASE_BOTH) + { + //if this is true then we have to kill romulo too + if (RomuloDead) + { + if (Creature* Romulo = (Unit::GetCreature((*me), RomuloGUID))) + { + Romulo->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + Romulo->GetMotionMaster()->Clear(); + Romulo->setDeathState(JUST_DIED); + Romulo->CombatStop(true); + Romulo->DeleteThreatList(); + Romulo->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); + } + + return; + } + + //if not already returned, then romulo is alive and we can pretend die + if (Creature* Romulo = (Unit::GetCreature((*me), RomuloGUID))) + { + PretendToDie(me); + IsFakingDeath = true; + CAST_AI(boss_romuloAI, Romulo->AI())->ResurrectTimer = 10000; + CAST_AI(boss_romuloAI, Romulo->AI())->JulianneDead = true; + damage = 0; + return; + } + } + error_log("TSCR: boss_julianneAI: DamageTaken reach end of code, that should not happen."); +} + +void boss_romuloAI::DamageTaken(Unit* /*done_by*/, uint32 &damage) +{ + if (damage < me->GetHealth()) + return; + + //anything below only used if incoming damage will kill + + if (Phase == PHASE_ROMULO) + { + DoScriptText(SAY_ROMULO_DEATH, me); + PretendToDie(me); + IsFakingDeath = true; + Phase = PHASE_BOTH; + + if (Creature* Julianne = (Unit::GetCreature((*me), JulianneGUID))) + { + CAST_AI(boss_julianneAI, Julianne->AI())->RomuloDead = true; + CAST_AI(boss_julianneAI, Julianne->AI())->ResurrectSelfTimer = 10000; + } + + damage = 0; + return; + } + + if (Phase == PHASE_BOTH) + { + if (JulianneDead) + { + if (Creature* Julianne = (Unit::GetCreature((*me), JulianneGUID))) + { + Julianne->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + Julianne->GetMotionMaster()->Clear(); + Julianne->setDeathState(JUST_DIED); + Julianne->CombatStop(true); + Julianne->DeleteThreatList(); + Julianne->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); + } + return; + } + + if (Creature* Julianne = (Unit::GetCreature((*me), JulianneGUID))) + { + PretendToDie(me); + IsFakingDeath = true; + CAST_AI(boss_julianneAI, Julianne->AI())->ResurrectTimer = 10000; + CAST_AI(boss_julianneAI, Julianne->AI())->RomuloDead = true; + damage = 0; + return; + } + } + + error_log("TSCR: boss_romuloAI: DamageTaken reach end of code, that should not happen."); +} + +void boss_julianneAI::UpdateAI(const uint32 diff) +{ + if (EntryYellTimer) + { + if (EntryYellTimer <= diff) + { + DoScriptText(SAY_JULIANNE_ENTER, me); + EntryYellTimer = 0; + } else EntryYellTimer -= diff; + } + + if (AggroYellTimer) + { + if (AggroYellTimer <= diff) + { + DoScriptText(SAY_JULIANNE_AGGRO, me); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + me->setFaction(16); + AggroYellTimer = 0; + } else AggroYellTimer -= diff; + } + + if (DrinkPoisonTimer) + { + //will do this 2secs after spell hit. this is time to display visual as expected + if (DrinkPoisonTimer <= diff) + { + PretendToDie(me); + Phase = PHASE_ROMULO; + SummonRomuloTimer = 10000; + DrinkPoisonTimer = 0; + } else DrinkPoisonTimer -= diff; + } + + if (Phase == PHASE_ROMULO && !SummonedRomulo) + { + if (SummonRomuloTimer <= diff) + { + if (Creature* pRomulo = me->SummonCreature(CREATURE_ROMULO, ROMULO_X, ROMULO_Y, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, HOUR*2*IN_MILISECONDS)) + { + RomuloGUID = pRomulo->GetGUID(); + CAST_AI(boss_romuloAI, pRomulo->AI())->JulianneGUID = me->GetGUID(); + CAST_AI(boss_romuloAI, pRomulo->AI())->Phase = PHASE_ROMULO; + DoZoneInCombat(pRomulo); + + pRomulo->setFaction(16); + } + SummonedRomulo = true; + } else SummonRomuloTimer -= diff; + } + + if (ResurrectSelfTimer) + { + if (ResurrectSelfTimer <= diff) + { + Resurrect(me); + Phase = PHASE_BOTH; + IsFakingDeath = false; + + if (me->getVictim()) + AttackStart(me->getVictim()); + + ResurrectSelfTimer = 0; + ResurrectTimer = 1000; + } else ResurrectSelfTimer -= diff; + } + + if (!UpdateVictim() || IsFakingDeath) + return; + + if (RomuloDead) + { + if (ResurrectTimer <= diff) + { + Creature* Romulo = (Unit::GetCreature((*me), RomuloGUID)); + if (Romulo && CAST_AI(boss_romuloAI, Romulo->AI())->IsFakingDeath) + { + DoScriptText(SAY_JULIANNE_RESURRECT, me); + Resurrect(Romulo); + CAST_AI(boss_romuloAI, Romulo->AI())->IsFakingDeath = false; + RomuloDead = false; + ResurrectTimer = 10000; + } + } else ResurrectTimer -= diff; + } + + if (BlindingPassionTimer <= diff) + { + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) + DoCast(pTarget, SPELL_BLINDING_PASSION); + BlindingPassionTimer = urand(30000,45000); + } else BlindingPassionTimer -= diff; + + if (DevotionTimer <= diff) + { + DoCast(me, SPELL_DEVOTION); + DevotionTimer = urand(15000,45000); + } else DevotionTimer -= diff; + + if (PowerfulAttractionTimer <= diff) + { + DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_POWERFUL_ATTRACTION); + PowerfulAttractionTimer = urand(5000,30000); + } else PowerfulAttractionTimer -= diff; + + if (EternalAffectionTimer <= diff) + { + if (urand(0,1) && SummonedRomulo) + { + Creature* Romulo = (Unit::GetCreature((*me), RomuloGUID)); + if (Romulo && Romulo->isAlive() && !RomuloDead) + DoCast(Romulo, SPELL_ETERNAL_AFFECTION); + } else DoCast(me, SPELL_ETERNAL_AFFECTION); + + EternalAffectionTimer = urand(45000,60000); + } else EternalAffectionTimer -= diff; + + DoMeleeAttackIfReady(); +} + +void boss_romuloAI::UpdateAI(const uint32 diff) +{ + if (!UpdateVictim() || IsFakingDeath) + return; + + if (JulianneDead) + { + if (ResurrectTimer <= diff) + { + Creature* Julianne = (Unit::GetCreature((*me), JulianneGUID)); + if (Julianne && CAST_AI(boss_julianneAI, Julianne->AI())->IsFakingDeath) + { + DoScriptText(SAY_ROMULO_RESURRECT, me); + Resurrect(Julianne); + CAST_AI(boss_julianneAI, Julianne->AI())->IsFakingDeath = false; + JulianneDead = false; + ResurrectTimer = 10000; + } + } else ResurrectTimer -= diff; + } + + if (BackwardLungeTimer <= diff) + { + Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true); + if (pTarget && !me->HasInArc(M_PI, pTarget)) + { + DoCast(pTarget, SPELL_BACKWARD_LUNGE); + BackwardLungeTimer = urand(15000,30000); + } + } else BackwardLungeTimer -= diff; + + if (DaringTimer <= diff) + { + DoCast(me, SPELL_DARING); + DaringTimer = urand(20000,40000); + } else DaringTimer -= diff; + + if (DeadlySwatheTimer <= diff) + { + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) + DoCast(pTarget, SPELL_DEADLY_SWATHE); + DeadlySwatheTimer = urand(15000,25000); + } else DeadlySwatheTimer -= diff; + + if (PoisonThrustTimer <= diff) + { + DoCast(me->getVictim(), SPELL_POISON_THRUST); + PoisonThrustTimer = urand(10000,20000); + } else PoisonThrustTimer -= diff; + + DoMeleeAttackIfReady(); +} + +CreatureAI* GetAI_boss_julianne(Creature* pCreature) +{ + return new boss_julianneAI(pCreature); +} + +CreatureAI* GetAI_boss_romulo(Creature* pCreature) +{ + return new boss_romuloAI(pCreature); +} + +void AddSC_bosses_opera() +{ + Script* newscript; + + // Oz + newscript = new Script; + newscript->GetAI = &GetAI_boss_dorothee; + newscript->Name = "boss_dorothee"; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->GetAI = &GetAI_boss_strawman; + newscript->Name = "boss_strawman"; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->GetAI = &GetAI_boss_tinhead; + newscript->Name = "boss_tinhead"; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->GetAI = &GetAI_boss_roar; + newscript->Name = "boss_roar"; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->GetAI = &GetAI_boss_crone; + newscript->Name = "boss_crone"; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->GetAI = &GetAI_mob_tito; + newscript->Name = "mob_tito"; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->GetAI = &GetAI_mob_cyclone; + newscript->Name = "mob_cyclone"; + newscript->RegisterSelf(); + + // Hood + newscript = new Script; + newscript->pGossipHello = &GossipHello_npc_grandmother; + newscript->pGossipSelect = &GossipSelect_npc_grandmother; + newscript->Name = "npc_grandmother"; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->GetAI = &GetAI_boss_bigbadwolf; + newscript->Name = "boss_bigbadwolf"; + newscript->RegisterSelf(); + + // Romeo And Juliet + newscript = new Script; + newscript->GetAI = &GetAI_boss_julianne; + newscript->Name = "boss_julianne"; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->GetAI = &GetAI_boss_romulo; + newscript->Name = "boss_romulo"; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp b/src/server/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp new file mode 100644 index 00000000000..59c1236bcdc --- /dev/null +++ b/src/server/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp @@ -0,0 +1,308 @@ +/* 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_Karazhan +SD%Complete: 70 +SDComment: Instance Script for Karazhan to help in various encounters. TODO: GameObject visibility for Opera event. +SDCategory: Karazhan +EndScriptData */ + +#include "ScriptedPch.h" +#include "karazhan.h" + +#define MAX_ENCOUNTER 12 + +/* +0 - Attumen + Midnight (optional) +1 - Moroes +2 - Maiden of Virtue (optional) +3 - Hyakiss the Lurker / Rokad the Ravager / Shadikith the Glider +4 - Opera Event +5 - Curator +6 - Shade of Aran (optional) +7 - Terestian Illhoof (optional) +8 - Netherspite (optional) +9 - Chess Event +10 - Prince Malchezzar +11 - Nightbane +*/ + +struct instance_karazhan : public ScriptedInstance +{ + instance_karazhan(Map* pMap) : ScriptedInstance(pMap) {Initialize();} + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + std::string strSaveData; + + uint32 m_uiOperaEvent; + uint32 m_uiOzDeathCount; + + uint64 m_uiCurtainGUID; + uint64 m_uiStageDoorLeftGUID; + uint64 m_uiStageDoorRightGUID; + uint64 m_uiKilrekGUID; + uint64 m_uiTerestianGUID; + uint64 m_uiMoroesGUID; + uint64 m_uiLibraryDoor; // Door at Shade of Aran + uint64 m_uiMassiveDoor; // Door at Netherspite + uint64 m_uiSideEntranceDoor; // Side Entrance + uint64 m_uiGamesmansDoor; // Door before Chess + uint64 m_uiGamesmansExitDoor; // Door after Chess + uint64 m_uiNetherspaceDoor; // Door at Malchezaar + uint64 MastersTerraceDoor[2]; + uint64 ImageGUID; + uint64 DustCoveredChest; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + // 1 - OZ, 2 - HOOD, 3 - RAJ, this never gets altered. + m_uiOperaEvent = urand(1,3); + m_uiOzDeathCount = 0; + + m_uiCurtainGUID = 0; + m_uiStageDoorLeftGUID = 0; + m_uiStageDoorRightGUID = 0; + + m_uiKilrekGUID = 0; + m_uiTerestianGUID = 0; + m_uiMoroesGUID = 0; + + m_uiLibraryDoor = 0; + m_uiMassiveDoor = 0; + m_uiSideEntranceDoor = 0; + m_uiGamesmansDoor = 0; + m_uiGamesmansExitDoor = 0; + m_uiNetherspaceDoor = 0; + MastersTerraceDoor[0]= 0; + MastersTerraceDoor[1]= 0; + ImageGUID = 0; + DustCoveredChest = 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 17229: m_uiKilrekGUID = pCreature->GetGUID(); break; + case 15688: m_uiTerestianGUID = pCreature->GetGUID(); break; + case 15687: m_uiMoroesGUID = pCreature->GetGUID(); break; + } + } + + void SetData(uint32 type, uint32 uiData) + { + switch (type) + { + case TYPE_ATTUMEN: m_auiEncounter[0] = uiData; break; + case TYPE_MOROES: + if (m_auiEncounter[1] == DONE) + break; + m_auiEncounter[1] = uiData; + break; + case TYPE_MAIDEN: m_auiEncounter[2] = uiData; break; + case TYPE_OPTIONAL_BOSS: m_auiEncounter[3] = uiData; break; + case TYPE_OPERA: m_auiEncounter[4] = uiData; break; + case TYPE_CURATOR: m_auiEncounter[5] = uiData; break; + case TYPE_ARAN: m_auiEncounter[6] = uiData; break; + case TYPE_TERESTIAN: m_auiEncounter[7] = uiData; break; + case TYPE_NETHERSPITE: m_auiEncounter[8] = uiData; break; + case TYPE_CHESS: + if (uiData == DONE) + DoRespawnGameObject(DustCoveredChest,DAY); + m_auiEncounter[9] = uiData; + break; + case TYPE_MALCHEZZAR: m_auiEncounter[10] = uiData; break; + case TYPE_NIGHTBANE: + if (m_auiEncounter[11] != DONE) + m_auiEncounter[11] = uiData; + break; + case DATA_OPERA_OZ_DEATHCOUNT: + if (uiData == SPECIAL) + ++m_uiOzDeathCount; + else if (uiData == IN_PROGRESS) + m_uiOzDeathCount = 0; + break; + } + + if (uiData == 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] << " " << m_auiEncounter[9] << " " << m_auiEncounter[10] << " " << m_auiEncounter[11]; + + strSaveData = saveStream.str(); + + SaveToDB(); + OUT_SAVE_INST_DATA_COMPLETE; + } + } + + void SetData64(uint32 identifier, uint64 data) + { + switch(identifier) + { + case DATA_IMAGE_OF_MEDIVH: ImageGUID = data; + } + } + + void OnGameObjectCreate(GameObject* pGo, bool /*add*/) + { + switch(pGo->GetEntry()) + { + case 183932: m_uiCurtainGUID = pGo->GetGUID(); break; + case 184278: + m_uiStageDoorLeftGUID = pGo->GetGUID(); + if (m_auiEncounter[4] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case 184279: + m_uiStageDoorRightGUID = pGo->GetGUID(); + if (m_auiEncounter[4] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case 184517: m_uiLibraryDoor = pGo->GetGUID(); break; + case 185521: m_uiMassiveDoor = pGo->GetGUID(); break; + case 184276: m_uiGamesmansDoor = pGo->GetGUID(); break; + case 184277: m_uiGamesmansExitDoor = pGo->GetGUID(); break; + case 185134: m_uiNetherspaceDoor = pGo->GetGUID(); break; + case 184274: MastersTerraceDoor[0] = pGo->GetGUID(); break; + case 184280: MastersTerraceDoor[1] = pGo->GetGUID(); break; + case 184275: + m_uiSideEntranceDoor = pGo->GetGUID(); + if (m_auiEncounter[4] == DONE) + pGo->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED); + else + pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED); + break; + case 185119: DustCoveredChest = pGo->GetGUID(); break; + } + + switch(m_uiOperaEvent) + { + //TODO: Set Object visibilities for Opera based on performance + case EVENT_OZ: + break; + + case EVENT_HOOD: + break; + + case EVENT_RAJ: + break; + } + } + + std::string GetSaveData() + { + return strSaveData; + } + + uint32 GetData(uint32 uiData) + { + switch (uiData) + { + case TYPE_ATTUMEN: return m_auiEncounter[0]; + case TYPE_MOROES: return m_auiEncounter[1]; + case TYPE_MAIDEN: return m_auiEncounter[2]; + case TYPE_OPTIONAL_BOSS: return m_auiEncounter[3]; + case TYPE_OPERA: return m_auiEncounter[4]; + case TYPE_CURATOR: return m_auiEncounter[5]; + case TYPE_ARAN: return m_auiEncounter[6]; + case TYPE_TERESTIAN: return m_auiEncounter[7]; + case TYPE_NETHERSPITE: return m_auiEncounter[8]; + case TYPE_CHESS: return m_auiEncounter[9]; + case TYPE_MALCHEZZAR: return m_auiEncounter[10]; + case TYPE_NIGHTBANE: return m_auiEncounter[11]; + case DATA_OPERA_PERFORMANCE: return m_uiOperaEvent; + case DATA_OPERA_OZ_DEATHCOUNT: return m_uiOzDeathCount; + case DATA_IMAGE_OF_MEDIVH: return ImageGUID; + } + + return 0; + } + + uint64 GetData64(uint32 uiData) + { + switch (uiData) + { + case DATA_KILREK: return m_uiKilrekGUID; + case DATA_TERESTIAN: return m_uiTerestianGUID; + case DATA_MOROES: return m_uiMoroesGUID; + case DATA_GO_STAGEDOORLEFT: return m_uiStageDoorLeftGUID; + case DATA_GO_STAGEDOORRIGHT: return m_uiStageDoorRightGUID; + case DATA_GO_CURTAINS: return m_uiCurtainGUID; + case DATA_GO_LIBRARY_DOOR: return m_uiLibraryDoor; + case DATA_GO_MASSIVE_DOOR: return m_uiMassiveDoor; + case DATA_GO_SIDE_ENTRANCE_DOOR: return m_uiSideEntranceDoor; + case DATA_GO_GAME_DOOR: return m_uiGamesmansDoor; + case DATA_GO_GAME_EXIT_DOOR: return m_uiGamesmansExitDoor; + case DATA_GO_NETHER_DOOR: return m_uiNetherspaceDoor; + case DATA_MASTERS_TERRACE_DOOR_1: return MastersTerraceDoor[0]; + case DATA_MASTERS_TERRACE_DOOR_2: return MastersTerraceDoor[1]; + } + + return 0; + } + + void Load(const char* chrIn) + { + if (!chrIn) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(chrIn); + std::istringstream loadStream(chrIn); + + 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] >> m_auiEncounter[9] >> m_auiEncounter[10] >> m_auiEncounter[11]; + 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_karazhan(Map* pMap) +{ + return new instance_karazhan(pMap); +} + +void AddSC_instance_karazhan() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_karazhan"; + newscript->GetInstanceData = &GetInstanceData_instance_karazhan; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp new file mode 100644 index 00000000000..5186a794b0d --- /dev/null +++ b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp @@ -0,0 +1,646 @@ + /* 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: Karazhan +SD%Complete: 100 +SDComment: Support for Barnes (Opera controller) and Berthold (Doorman), Support for Quest 9645. +SDCategory: Karazhan +EndScriptData */ + +/* ContentData +npc_barnes +npc_berthold +npc_image_of_medivh +EndContentData */ + +#include "ScriptedPch.h" +#include "karazhan.h" +#include "ScriptedEscortAI.h" + +/*###### +# npc_barnesAI +######*/ + +#define GOSSIP_READY "I'm not an actor." + +#define SAY_READY "Splendid, I'm going to get the audience ready. Break a leg!" +#define SAY_OZ_INTRO1 "Finally, everything is in place. Are you ready for your big stage debut?" +#define OZ_GOSSIP1 "I'm not an actor." +#define SAY_OZ_INTRO2 "Don't worry, you'll be fine. You look like a natural!" +#define OZ_GOSSIP2 "Ok, I'll give it a try, then." + +#define SAY_RAJ_INTRO1 "The romantic plays are really tough, but you'll do better this time. You have TALENT. Ready?" +#define RAJ_GOSSIP1 "I've never been more ready." + +#define OZ_GM_GOSSIP1 "[GM] Change event to EVENT_OZ" +#define OZ_GM_GOSSIP2 "[GM] Change event to EVENT_HOOD" +#define OZ_GM_GOSSIP3 "[GM] Change event to EVENT_RAJ" + +struct Dialogue +{ + int32 textid; + uint32 timer; +}; + +static Dialogue OzDialogue[]= +{ + {-1532103, 6000}, + {-1532104, 18000}, + {-1532105, 9000}, + {-1532106, 15000} +}; + +static Dialogue HoodDialogue[]= +{ + {-1532107, 6000}, + {-1532108, 10000}, + {-1532109, 14000}, + {-1532110, 15000} +}; + +static Dialogue RAJDialogue[]= +{ + {-1532111, 5000}, + {-1532112, 7000}, + {-1532113, 14000}, + {-1532114, 14000} +}; + +// Entries and spawn locations for creatures in Oz event +float Spawns[6][2]= +{ + {17535, -10896}, // Dorothee + {17546, -10891}, // Roar + {17547, -10884}, // Tinhead + {17543, -10902}, // Strawman + {17603, -10892}, // Grandmother + {17534, -10900}, // Julianne +}; + +#define CREATURE_SPOTLIGHT 19525 + +#define SPELL_SPOTLIGHT 25824 +#define SPELL_TUXEDO 32616 + +#define SPAWN_Z 90.5 +#define SPAWN_Y -1758 +#define SPAWN_O 4.738 + +struct npc_barnesAI : public npc_escortAI +{ + npc_barnesAI(Creature* c) : npc_escortAI(c) + { + RaidWiped = false; + m_uiEventId = 0; + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint64 m_uiSpotlightGUID; + + uint32 TalkCount; + uint32 TalkTimer; + uint32 WipeTimer; + uint32 m_uiEventId; + + bool PerformanceReady; + bool RaidWiped; + + void Reset() + { + m_uiSpotlightGUID = 0; + + TalkCount = 0; + TalkTimer = 2000; + WipeTimer = 5000; + + PerformanceReady = false; + + if (pInstance) + m_uiEventId = pInstance->GetData(DATA_OPERA_PERFORMANCE); + } + + void StartEvent() + { + if (!pInstance) + return; + + pInstance->SetData(TYPE_OPERA, IN_PROGRESS); + + //resets count for this event, in case earlier failed + if (m_uiEventId == EVENT_OZ) + pInstance->SetData(DATA_OPERA_OZ_DEATHCOUNT, IN_PROGRESS); + + Start(false, false); + } + + void EnterCombat(Unit* /*who*/) {} + + void WaypointReached(uint32 i) + { + if (!pInstance) + return; + + switch(i) + { + case 0: + DoCast(me, SPELL_TUXEDO, false); + pInstance->DoUseDoorOrButton(pInstance->GetData64(DATA_GO_STAGEDOORLEFT)); + break; + case 4: + TalkCount = 0; + SetEscortPaused(true); + + if (Creature* pSpotlight = me->SummonCreature(CREATURE_SPOTLIGHT, + me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0.0f, + TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000)) + { + pSpotlight->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + pSpotlight->CastSpell(pSpotlight, SPELL_SPOTLIGHT, false); + m_uiSpotlightGUID = pSpotlight->GetGUID(); + } + break; + case 8: + pInstance->DoUseDoorOrButton(pInstance->GetData64(DATA_GO_STAGEDOORLEFT)); + PerformanceReady = true; + break; + case 9: + PrepareEncounter(); + pInstance->DoUseDoorOrButton(pInstance->GetData64(DATA_GO_CURTAINS)); + break; + } + } + + void Talk(uint32 count) + { + int32 text = 0; + + switch(m_uiEventId) + { + case EVENT_OZ: + if (OzDialogue[count].textid) + text = OzDialogue[count].textid; + if (OzDialogue[count].timer) + TalkTimer = OzDialogue[count].timer; + break; + + case EVENT_HOOD: + if (HoodDialogue[count].textid) + text = HoodDialogue[count].textid; + if (HoodDialogue[count].timer) + TalkTimer = HoodDialogue[count].timer; + break; + + case EVENT_RAJ: + if (RAJDialogue[count].textid) + text = RAJDialogue[count].textid; + if (RAJDialogue[count].timer) + TalkTimer = RAJDialogue[count].timer; + break; + } + + if (text) + DoScriptText(text, me); + } + + void PrepareEncounter() + { + debug_log("TSCR: Barnes Opera Event - Introduction complete - preparing encounter %d", m_uiEventId); + uint8 index = 0; + uint8 count = 0; + + switch(m_uiEventId) + { + case EVENT_OZ: + index = 0; + count = 4; + break; + case EVENT_HOOD: + index = 4; + count = index+1; + break; + case EVENT_RAJ: + index = 5; + count = index+1; + break; + } + + for (; index < count; ++index) + { + uint32 entry = ((uint32)Spawns[index][0]); + float PosX = Spawns[index][1]; + + if (Creature* pCreature = me->SummonCreature(entry, PosX, SPAWN_Y, SPAWN_Z, SPAWN_O, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, HOUR*2*IN_MILISECONDS)) + { + // In case database has bad flags + pCreature->SetUInt32Value(UNIT_FIELD_FLAGS, 0); + pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + } + + RaidWiped = false; + } + + void UpdateAI(const uint32 diff) + { + npc_escortAI::UpdateAI(diff); + + if (HasEscortState(STATE_ESCORT_PAUSED)) + { + if (TalkTimer <= diff) + { + if (TalkCount > 3) + { + if (Creature* pSpotlight = Unit::GetCreature(*me, m_uiSpotlightGUID)) + pSpotlight->ForcedDespawn(); + + SetEscortPaused(false); + return; + } + + Talk(TalkCount); + ++TalkCount; + } else TalkTimer -= diff; + } + + if (PerformanceReady) + { + if (!RaidWiped) + { + if (WipeTimer <= diff) + { + Map* pMap = me->GetMap(); + if (!pMap->IsDungeon()) + return; + + Map::PlayerList const &PlayerList = pMap->GetPlayers(); + if (PlayerList.isEmpty()) + return; + + RaidWiped = true; + for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) + { + if (i->getSource()->isAlive() && !i->getSource()->isGameMaster()) + { + RaidWiped = false; + break; + } + } + + if (RaidWiped) + { + RaidWiped = true; + EnterEvadeMode(); + return; + } + + WipeTimer = 15000; + } else WipeTimer -= diff; + } + + } + } +}; + +CreatureAI* GetAI_npc_barnesAI(Creature* pCreature) +{ + return new npc_barnesAI(pCreature); +} + +bool GossipHello_npc_barnes(Player* pPlayer, Creature* pCreature) +{ + if (ScriptedInstance* pInstance = pCreature->GetInstanceData()) + { + // Check for death of Moroes and if opera event is not done already + if (pInstance->GetData(TYPE_MOROES) == DONE && pInstance->GetData(TYPE_OPERA) != DONE) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, OZ_GOSSIP1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + + if (pPlayer->isGameMaster()) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_DOT, OZ_GM_GOSSIP1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_DOT, OZ_GM_GOSSIP2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_DOT, OZ_GM_GOSSIP3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5); + } + + if (npc_barnesAI* pBarnesAI = CAST_AI(npc_barnesAI,pCreature->AI())) + { + if (!pBarnesAI->RaidWiped) + pPlayer->SEND_GOSSIP_MENU(8970, pCreature->GetGUID()); + else + pPlayer->SEND_GOSSIP_MENU(8975, pCreature->GetGUID()); + + return true; + } + } + } + + pPlayer->SEND_GOSSIP_MENU(8978, pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_barnes(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction) +{ + npc_barnesAI* pBarnesAI = CAST_AI(npc_barnesAI, pCreature->AI()); + + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, OZ_GOSSIP2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + pPlayer->SEND_GOSSIP_MENU(8971, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->CLOSE_GOSSIP_MENU(); + pBarnesAI->StartEvent(); + break; + case GOSSIP_ACTION_INFO_DEF+3: + pPlayer->CLOSE_GOSSIP_MENU(); + pBarnesAI->m_uiEventId = EVENT_OZ; + outstring_log("TSCR: player (GUID %i) manually set Opera event to EVENT_OZ",pPlayer->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+4: + pPlayer->CLOSE_GOSSIP_MENU(); + pBarnesAI->m_uiEventId = EVENT_HOOD; + outstring_log("TSCR: player (GUID %i) manually set Opera event to EVENT_HOOD",pPlayer->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+5: + pPlayer->CLOSE_GOSSIP_MENU(); + pBarnesAI->m_uiEventId = EVENT_RAJ; + outstring_log("TSCR: player (GUID %i) manually set Opera event to EVENT_RAJ",pPlayer->GetGUID()); + break; + } + + return true; +} + +/*### +# npc_berthold +####*/ + +enum eBerthold +{ + SPELL_TELEPORT = 39567 +}; + +#define GOSSIP_ITEM_TELEPORT "Teleport me to the Guardian's Library" + +bool GossipHello_npc_berthold(Player* pPlayer, Creature* pCreature) +{ + if (ScriptedInstance* pInstance = pCreature->GetInstanceData()) + { + // Check if Shade of Aran event is done + if (pInstance->GetData(TYPE_ARAN) == DONE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TELEPORT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + } + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_berthold(Player* pPlayer, Creature* /*pCreature*/, uint32 /*uiSender*/, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) + pPlayer->CastSpell(pPlayer, SPELL_TELEPORT, true); + + pPlayer->CLOSE_GOSSIP_MENU(); + return true; +} + +/*### +# npc_image_of_medivh +####*/ + +#define SAY_DIALOG_MEDIVH_1 "You've got my attention, dragon. You'll find I'm not as easily scared as the villagers below." +#define SAY_DIALOG_ARCANAGOS_2 "Your dabbling in the arcane has gone too far, Medivh. You've attracted the attention of powers beyond your understanding. You must leave Karazhan at once!" +#define SAY_DIALOG_MEDIVH_3 "You dare challenge me at my own dwelling? Your arrogance is astounding, even for a dragon!" +#define SAY_DIALOG_ARCANAGOS_4 "A dark power seeks to use you, Medivh! If you stay, dire days will follow. You must hurry, we don't have much time!" +#define SAY_DIALOG_MEDIVH_5 "I do not know what you speak of, dragon... but I will not be bullied by this display of insolence. I'll leave Karazhan when it suits me!" +#define SAY_DIALOG_ARCANAGOS_6 "You leave me no alternative. I will stop you by force if you won't listen to reason!" +#define EMOTE_DIALOG_MEDIVH_7 "begins to cast a spell of great power, weaving his own essence into the magic." +#define SAY_DIALOG_ARCANAGOS_8 "What have you done, wizard? This cannot be! I'm burning from... within!" +#define SAY_DIALOG_MEDIVH_9 "He should not have angered me. I must go... recover my strength now..." + +#define MOB_ARCANAGOS 17652 +#define SPELL_FIRE_BALL 30967 +#define SPELL_UBER_FIREBALL 30971 +#define SPELL_CONFLAGRATION_BLAST 30977 +#define SPELL_MANA_SHIELD 31635 + +static float MedivPos[4] = {-11161.49,-1902.24,91.48,1.94}; +static float ArcanagosPos[4] = {-11169.75,-1881.48,95.39,4.83}; + +struct npc_image_of_medivhAI : public ScriptedAI +{ + npc_image_of_medivhAI(Creature* c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance *pInstance; + + uint64 ArcanagosGUID; + + uint32 YellTimer; + uint32 Step; + uint32 FireMedivhTimer; + uint32 FireArcanagosTimer; + + bool EventStarted; + + void Reset() + { + ArcanagosGUID = 0; + + if (pInstance && pInstance->GetData64(DATA_IMAGE_OF_MEDIVH) == 0) + { + pInstance->SetData64(DATA_IMAGE_OF_MEDIVH, me->GetGUID()); + (*me).GetMotionMaster()->MovePoint(1,MedivPos[0],MedivPos[1],MedivPos[2]); + Step = 0; + }else + { + me->DealDamage(me,me->GetHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + me->RemoveCorpse(); + } + } + void EnterCombat(Unit* /*who*/) {} + + void MovementInform(uint32 type, uint32 id) + { + if (type != POINT_MOTION_TYPE) + return; + if (id == 1) + { + StartEvent(); + me->SetOrientation(MedivPos[3]); + me->SetOrientation(MedivPos[3]); + } + } + + void StartEvent() + { + Step = 1; + EventStarted = true; + Creature* Arcanagos = me->SummonCreature(MOB_ARCANAGOS,ArcanagosPos[0],ArcanagosPos[1],ArcanagosPos[2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,20000); + if (!Arcanagos) + return; + ArcanagosGUID = Arcanagos->GetGUID(); + Arcanagos->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + (*Arcanagos).GetMotionMaster()->MovePoint(0,ArcanagosPos[0],ArcanagosPos[1],ArcanagosPos[2]); + Arcanagos->SetOrientation(ArcanagosPos[3]); + me->SetOrientation(MedivPos[3]); + YellTimer = 10000; + } + + uint32 NextStep(uint32 Step) + { + Unit* arca = Unit::GetUnit((*me),ArcanagosGUID); + Map* pMap = me->GetMap(); + switch(Step) + { + case 0: return 9999999; + case 1: + me->MonsterYell(SAY_DIALOG_MEDIVH_1,LANG_UNIVERSAL,NULL); + return 10000; + case 2: + if (arca) + CAST_CRE(arca)->MonsterYell(SAY_DIALOG_ARCANAGOS_2,LANG_UNIVERSAL,NULL); + return 20000; + case 3: + me->MonsterYell(SAY_DIALOG_MEDIVH_3,LANG_UNIVERSAL,NULL); + return 10000; + case 4: + if (arca) + CAST_CRE(arca)->MonsterYell(SAY_DIALOG_ARCANAGOS_4, LANG_UNIVERSAL, NULL); + return 20000; + case 5: + me->MonsterYell(SAY_DIALOG_MEDIVH_5, LANG_UNIVERSAL, NULL); + return 20000; + case 6: + if (arca) + CAST_CRE(arca)->MonsterYell(SAY_DIALOG_ARCANAGOS_6, LANG_UNIVERSAL, NULL); + return 10000; + case 7: + FireArcanagosTimer = 500; + return 5000; + case 8: + FireMedivhTimer = 500; + DoCast(me, SPELL_MANA_SHIELD); + return 10000; + case 9: + me->MonsterTextEmote(EMOTE_DIALOG_MEDIVH_7, 0, false); + return 10000; + case 10: + if (arca) + DoCast(arca, SPELL_CONFLAGRATION_BLAST, false); + return 1000; + case 11: + if (arca) + CAST_CRE(arca)->MonsterYell(SAY_DIALOG_ARCANAGOS_8, LANG_UNIVERSAL, NULL); + return 5000; + case 12: + arca->GetMotionMaster()->MovePoint(0, -11010.82,-1761.18, 156.47); + arca->setActive(true); + arca->InterruptNonMeleeSpells(true); + arca->SetSpeed(MOVE_FLIGHT, 2.0f); + return 10000; + case 13: + me->MonsterYell(SAY_DIALOG_MEDIVH_9, LANG_UNIVERSAL, NULL); + return 10000; + case 14: + me->SetVisibility(VISIBILITY_OFF); + me->ClearInCombat(); + + if (pMap->IsDungeon()) + { + InstanceMap::PlayerList const &PlayerList = pMap->GetPlayers(); + for (InstanceMap::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) + { + if (i->getSource()->isAlive()) + { + if (i->getSource()->GetQuestStatus(9645) == QUEST_STATUS_INCOMPLETE) + i->getSource()->CompleteQuest(9645); + } + } + } + return 50000; + case 15: + arca->DealDamage(arca,arca->GetHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + return 5000; + default : return 9999999; + } + + } + + void UpdateAI(const uint32 diff) + { + + if (YellTimer <= diff) + { + if (EventStarted) + YellTimer = NextStep(Step++); + } else YellTimer -= diff; + + if (Step >= 7 && Step <= 12) + { + Unit* arca = Unit::GetUnit((*me),ArcanagosGUID); + + if (FireArcanagosTimer <= diff) + { + if (arca) + arca->CastSpell(me, SPELL_FIRE_BALL, false); + FireArcanagosTimer = 6000; + } else FireArcanagosTimer -= diff; + + if (FireMedivhTimer <= diff) + { + if (arca) + DoCast(arca, SPELL_FIRE_BALL); + FireMedivhTimer = 5000; + } else FireMedivhTimer -= diff; + } + } +}; + +CreatureAI* GetAI_npc_image_of_medivh(Creature* pCreature) +{ + return new npc_image_of_medivhAI(pCreature); +} + +void AddSC_karazhan() +{ + Script* newscript; + + newscript = new Script; + newscript->GetAI = &GetAI_npc_barnesAI; + newscript->Name = "npc_barnes"; + newscript->pGossipHello = &GossipHello_npc_barnes; + newscript->pGossipSelect = &GossipSelect_npc_barnes; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_berthold"; + newscript->pGossipHello = &GossipHello_npc_berthold; + newscript->pGossipSelect = &GossipSelect_npc_berthold; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_image_of_medivh"; + newscript->GetAI = &GetAI_npc_image_of_medivh; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.h b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.h new file mode 100644 index 00000000000..56a6b106332 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.h @@ -0,0 +1,53 @@ +/* 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_KARAZHAN_H +#define DEF_KARAZHAN_H + +enum eEnums +{ + TYPE_ATTUMEN = 1, + TYPE_MOROES = 2, + TYPE_MAIDEN = 3, + TYPE_OPTIONAL_BOSS = 4, + TYPE_OPERA = 5, + TYPE_CURATOR = 6, + TYPE_ARAN = 7, + TYPE_TERESTIAN = 8, + TYPE_NETHERSPITE = 9, + TYPE_CHESS = 10, + TYPE_MALCHEZZAR = 11, + TYPE_NIGHTBANE = 12, + + DATA_OPERA_PERFORMANCE = 13, + DATA_OPERA_OZ_DEATHCOUNT = 14, + + DATA_KILREK = 15, + DATA_TERESTIAN = 16, + DATA_MOROES = 17, + DATA_GO_CURTAINS = 18, + DATA_GO_STAGEDOORLEFT = 19, + DATA_GO_STAGEDOORRIGHT = 20, + DATA_GO_LIBRARY_DOOR = 21, + DATA_GO_MASSIVE_DOOR = 22, + DATA_GO_NETHER_DOOR = 23, + DATA_GO_GAME_DOOR = 24, + DATA_GO_GAME_EXIT_DOOR = 25, + + DATA_IMAGE_OF_MEDIVH = 26, + DATA_MASTERS_TERRACE_DOOR_1 = 27, + DATA_MASTERS_TERRACE_DOOR_2 = 28, + DATA_GO_SIDE_ENTRANCE_DOOR = 29 +}; + +enum OperaEvents +{ + EVENT_OZ = 1, + EVENT_HOOD = 2, + EVENT_RAJ = 3 +}; + +#define ERROR_INST_DATA(a) error_log("TSCR: Instance Data for Karazhan not set properly. Encounter for Creature Entry %u may not work properly.", a->GetEntry()); +#endif + diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp new file mode 100644 index 00000000000..b5835dfe0a1 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp @@ -0,0 +1,680 @@ +/* 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_Felblood_Kaelthas +SD%Complete: 80 +SDComment: Normal and Heroic Support. Issues: Arcane Spheres do not initially follow targets. +SDCategory: Magisters' Terrace +EndScriptData */ + +#include "ScriptedPch.h" +#include "magisters_terrace.h" +#include "WorldPacket.h" + +#define SAY_AGGRO -1585023 //This yell should be done when the room is cleared. For now, set it as a movelineofsight yell. +#define SAY_PHOENIX -1585024 +#define SAY_FLAMESTRIKE -1585025 +#define SAY_GRAVITY_LAPSE -1585026 +#define SAY_TIRED -1585027 +#define SAY_RECAST_GRAVITY -1585028 +#define SAY_DEATH -1585029 + +/*** Spells ***/ + +// Phase 1 spells +#define SPELL_FIREBALL_NORMAL 44189 // Deals 2700-3300 damage at current target +#define SPELL_FIREBALL_HEROIC 46164 // 4950-6050 + +#define SPELL_PHOENIX 44194 // Summons a phoenix (Doesn't work?) +#define SPELL_PHOENIX_BURN 44197 // A spell Phoenix uses to damage everything around +#define SPELL_REBIRTH_DMG 44196 // DMG if a Phoenix rebirth happen + +#define SPELL_FLAMESTRIKE1_NORMAL 44190 // Damage part +#define SPELL_FLAMESTRIKE1_HEROIC 46163 // Heroic damage part +#define SPELL_FLAMESTRIKE2 44191 // Flamestrike indicator before the damage +#define SPELL_FLAMESTRIKE3 44192 // Summons the trigger + animation (projectile) + +#define SPELL_SHOCK_BARRIER 46165 // Heroic only; 10k damage shield, followed by Pyroblast +#define SPELL_PYROBLAST 36819 // Heroic only; 45-55k fire damage + +// Phase 2 spells +#define SPELL_GRAVITY_LAPSE_INITIAL 44224 // Cast at the beginning of every Gravity Lapse +#define SPELL_GRAVITY_LAPSE_CHANNEL 44251 // Channeled; blue beam animation to every enemy in range +#define SPELL_TELEPORT_CENTER 44218 // Should teleport people to the center. Requires DB entry in spell_target_position. +#define SPELL_GRAVITY_LAPSE_FLY 44227 // Hastens flyspeed and allows flying for 1 minute. For some reason removes 44226. +#define SPELL_GRAVITY_LAPSE_DOT 44226 // Knocks up in the air and applies a 300 DPS DoT. +#define SPELL_ARCANE_SPHERE_PASSIVE 44263 // Passive auras on Arcane Spheres +#define SPELL_POWER_FEEDBACK 44233 // Stuns him, making him take 50% more damage for 10 seconds. Cast after Gravity Lapse + +/*** Creatures ***/ +#define CREATURE_PHOENIX 24674 +#define CREATURE_PHOENIX_EGG 24675 +#define CREATURE_ARCANE_SPHERE 24708 + +/** Locations **/ +float KaelLocations[3][2]= +{ + {148.744659, 181.377426}, + {140.823883, 195.403046}, + {156.574188, 195.650482}, +}; + +#define LOCATION_Z -16.727455 + +struct boss_felblood_kaelthasAI : public ScriptedAI +{ + boss_felblood_kaelthasAI(Creature* c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint32 FireballTimer; + uint32 PhoenixTimer; + uint32 FlameStrikeTimer; + uint32 CombatPulseTimer; + + //Heroic only + uint32 PyroblastTimer; + + uint32 GravityLapseTimer; + uint32 GravityLapsePhase; + // 0 = No Gravity Lapse + // 1 = Casting Gravity Lapse visual + // 2 = Teleported people to self + // 3 = Knocked people up in the air + // 4 = Applied an aura that allows them to fly, channeling visual, relased Arcane Orbs. + + bool FirstGravityLapse; + bool HasTaunted; + + uint8 Phase; + // 0 = Not started + // 1 = Fireball; Summon Phoenix; Flamestrike + // 2 = Gravity Lapses + + void Reset() + { + // TODO: Timers + FireballTimer = 0; + PhoenixTimer = 10000; + FlameStrikeTimer = 25000; + CombatPulseTimer = 0; + + PyroblastTimer = 60000; + + GravityLapseTimer = 0; + GravityLapsePhase = 0; + + FirstGravityLapse = true; + HasTaunted = false; + + Phase = 0; + + if (pInstance) + { + pInstance->SetData(DATA_KAELTHAS_EVENT, NOT_STARTED); + pInstance->HandleGameObject(pInstance->GetData64(DATA_KAEL_DOOR), true); + // Open the big encounter door. Close it in Aggro and open it only in JustDied(and here) + // Small door opened after event are expected to be closed by default + } + } + + void JustDied(Unit * /*killer*/) + { + DoScriptText(SAY_DEATH, me); + + if (!pInstance) + return; + + pInstance->HandleGameObject(pInstance->GetData64(DATA_KAEL_DOOR), true); + // Open the encounter door + } + + void DamageTaken(Unit* /*done_by*/, uint32 &damage) + { + if (damage > me->GetHealth()) + RemoveGravityLapse(); // Remove Gravity Lapse so that players fall to ground if they kill him when in air. + } + + void EnterCombat(Unit * /*who*/) + { + if (!pInstance) + return; + + pInstance->HandleGameObject(pInstance->GetData64(DATA_KAEL_DOOR), false); + //Close the encounter door, open it in JustDied/Reset + } + + void MoveInLineOfSight(Unit *who) + { + if (!HasTaunted && me->IsWithinDistInMap(who, 40.0)) + { + DoScriptText(SAY_AGGRO, me); + HasTaunted = true; + } + + ScriptedAI::MoveInLineOfSight(who); + } + + void SetThreatList(Creature* SummonedUnit) + { + if (!SummonedUnit) + 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 = me->getThreatManager().getThreat(pUnit); + SummonedUnit->AddThreat(pUnit, threat); + } + } + } + + void TeleportPlayersToSelf() + { + float x = KaelLocations[0][0]; + float y = KaelLocations[0][1]; + me->GetMap()->CreatureRelocation(me, x, y, LOCATION_Z, 0.0f); + //me->SendMonsterMove(x, y, LOCATION_Z, 0, 0, 0); // causes some issues... + std::list::const_iterator i = me->getThreatManager().getThreatList().begin(); + 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)) + pUnit->CastSpell(pUnit, SPELL_TELEPORT_CENTER, true); + } + DoCast(me, SPELL_TELEPORT_CENTER, true); + } + + void CastGravityLapseKnockUp() + { + std::list::const_iterator i = me->getThreatManager().getThreatList().begin(); + 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)) + // Knockback into the air + pUnit->CastSpell(pUnit, SPELL_GRAVITY_LAPSE_DOT, true, 0, 0, me->GetGUID()); + } + } + + void CastGravityLapseFly() // Use Fly Packet hack for now as players can't cast "fly" spells unless in map 530. Has to be done a while after they get knocked into the air... + { + std::list::const_iterator i = me->getThreatManager().getThreatList().begin(); + 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)) + { + // Also needs an exception in spell system. + pUnit->CastSpell(pUnit, SPELL_GRAVITY_LAPSE_FLY, true, 0, 0, me->GetGUID()); + // Use packet hack + WorldPacket data(12); + data.SetOpcode(SMSG_MOVE_SET_CAN_FLY); + data.append(pUnit->GetPackGUID()); + data << uint32(0); + pUnit->SendMessageToSet(&data, true); + } + } + } + + void RemoveGravityLapse() + { + std::list::const_iterator i = me->getThreatManager().getThreatList().begin(); + 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)) + { + pUnit->RemoveAurasDueToSpell(SPELL_GRAVITY_LAPSE_FLY); + pUnit->RemoveAurasDueToSpell(SPELL_GRAVITY_LAPSE_DOT); + + WorldPacket data(12); + data.SetOpcode(SMSG_MOVE_UNSET_CAN_FLY); + data.append(pUnit->GetPackGUID()); + data << uint32(0); + pUnit->SendMessageToSet(&data, true); + } + } + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + switch(Phase) + { + case 0: + { + // *Heroic mode only: + if (IsHeroic()) + { + if (PyroblastTimer <= diff) + { + me->InterruptSpell(CURRENT_CHANNELED_SPELL); + me->InterruptSpell(CURRENT_GENERIC_SPELL); + DoCast(me, SPELL_SHOCK_BARRIER, true); + DoCast(me->getVictim(), SPELL_PYROBLAST); + PyroblastTimer = 60000; + } else PyroblastTimer -= diff; + } + + if (FireballTimer <= diff) + { + DoCast(me->getVictim(), SPELL_FIREBALL_NORMAL); + FireballTimer = urand(2000,6000); + } else FireballTimer -= diff; + + if (PhoenixTimer <= diff) + { + + Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1); + + uint8 random = urand(1,2); + float x = KaelLocations[random][0]; + float y = KaelLocations[random][1]; + + Creature* Phoenix = me->SummonCreature(CREATURE_PHOENIX, x, y, LOCATION_Z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000); + if (Phoenix) + { + Phoenix->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE); + SetThreatList(Phoenix); + Phoenix->AI()->AttackStart(pTarget); + } + + DoScriptText(SAY_PHOENIX, me); + + PhoenixTimer = 60000; + } else PhoenixTimer -= diff; + + if (FlameStrikeTimer <= diff) + { + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) + { + me->InterruptSpell(CURRENT_CHANNELED_SPELL); + me->InterruptSpell(CURRENT_GENERIC_SPELL); + DoCast(pTarget, SPELL_FLAMESTRIKE3, true); + DoScriptText(SAY_FLAMESTRIKE, me); + } + FlameStrikeTimer = urand(15000,25000); + } else FlameStrikeTimer -= diff; + + // Below 50% + if (me->GetMaxHealth() * 0.5 > me->GetHealth()) + { + me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, true); + me->StopMoving(); + me->GetMotionMaster()->Clear(); + me->GetMotionMaster()->MoveIdle(); + GravityLapseTimer = 0; + GravityLapsePhase = 0; + Phase = 1; + } + + DoMeleeAttackIfReady(); + } + break; + + case 1: + { + if (GravityLapseTimer <= diff) + { + switch(GravityLapsePhase) + { + case 0: + if (FirstGravityLapse) // Different yells at 50%, and at every following Gravity Lapse + { + DoScriptText(SAY_GRAVITY_LAPSE, me); + FirstGravityLapse = false; + + if (pInstance) + { + pInstance->HandleGameObject(pInstance->GetData64(DATA_KAEL_STATUE_LEFT), true); + pInstance->HandleGameObject(pInstance->GetData64(DATA_KAEL_STATUE_RIGHT), true); + } + }else + { + DoScriptText(SAY_RECAST_GRAVITY, me); + } + + DoCast(me, SPELL_GRAVITY_LAPSE_INITIAL); + GravityLapseTimer = 2000 + diff;// Don't interrupt the visual spell + GravityLapsePhase = 1; + break; + + case 1: + TeleportPlayersToSelf(); + GravityLapseTimer = 1000; + GravityLapsePhase = 2; + break; + + case 2: + CastGravityLapseKnockUp(); + GravityLapseTimer = 1000; + GravityLapsePhase = 3; + break; + + case 3: + CastGravityLapseFly(); + GravityLapseTimer = 30000; + GravityLapsePhase = 4; + + for (uint8 i = 0; i < 3; ++i) + { + Unit *pTarget = NULL; + pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); + + Creature* Orb = DoSpawnCreature(CREATURE_ARCANE_SPHERE, 5, 5, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000); + if (Orb && pTarget) + { + Orb->SetSpeed(MOVE_RUN, 0.5f); + Orb->AddThreat(pTarget, 1000000.0f); + Orb->AI()->AttackStart(pTarget); + } + + } + + DoCast(me, SPELL_GRAVITY_LAPSE_CHANNEL); + break; + + case 4: + me->InterruptNonMeleeSpells(false); + DoScriptText(SAY_TIRED, me); + DoCast(me, SPELL_POWER_FEEDBACK); + RemoveGravityLapse(); + GravityLapseTimer = 10000; + GravityLapsePhase = 0; + break; + } + } else GravityLapseTimer -= diff; + } + break; + } + } +}; + +struct mob_felkael_flamestrikeAI : public ScriptedAI +{ + mob_felkael_flamestrikeAI(Creature *c) : ScriptedAI(c) + { + } + + uint32 FlameStrikeTimer; + + void Reset() + { + FlameStrikeTimer = 5000; + + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->setFaction(14); + + DoCast(me, SPELL_FLAMESTRIKE2, true); + } + + void EnterCombat(Unit * /*who*/) {} + void MoveInLineOfSight(Unit * /*who*/) {} + void UpdateAI(const uint32 diff) + { + if (FlameStrikeTimer <= diff) + { + DoCast(me, SPELL_FLAMESTRIKE1_NORMAL, true); + me->Kill(me); + } else FlameStrikeTimer -= diff; + } +}; + +struct mob_felkael_phoenixAI : public ScriptedAI +{ + mob_felkael_phoenixAI(Creature* c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + uint32 BurnTimer; + uint32 Death_Timer; + bool Rebirth; + bool FakeDeath; + + void Reset() + { + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE); + me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + DoCast(me, SPELL_PHOENIX_BURN, true); + BurnTimer = 2000; + Death_Timer = 3000; + Rebirth = false; + FakeDeath = false; + } + + void EnterCombat(Unit* /*who*/) {} + + void DamageTaken(Unit* /*pKiller*/, uint32 &damage) + { + if (damage < me->GetHealth()) + return; + + //Prevent glitch if in fake death + if (FakeDeath) + { + damage = 0; + return; + + } + //Don't really die in all phases of Kael'Thas + if (pInstance && pInstance->GetData(DATA_KAELTHAS_EVENT) == 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); + + } + + } + + void JustDied(Unit* /*slayer*/) + { + me->SummonCreature(CREATURE_PHOENIX_EGG, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000); + } + + void UpdateAI(const uint32 diff) + { + + //If we are fake death, we cast revbirth and after that we kill the phoenix to spawn the egg. + if (FakeDeath) + { + if (!Rebirth) + { + DoCast(me, SPELL_REBIRTH_DMG); + Rebirth = true; + } + + if (Rebirth) + { + + if (Death_Timer <= diff) + { + me->SummonCreature(CREATURE_PHOENIX_EGG, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000); + me->DisappearAndDie(); + Rebirth = false; + } else Death_Timer -= diff; + } + + } + + if (!UpdateVictim()) + return; + + if (BurnTimer <= diff) + { + //spell Burn should possible do this, but it doesn't, so do this for now. + uint16 dmg = urand(1650,2050); + me->DealDamage(me, dmg, 0, DOT, SPELL_SCHOOL_MASK_FIRE, NULL, false); + BurnTimer += 2000; + } BurnTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct mob_felkael_phoenix_eggAI : public ScriptedAI +{ + mob_felkael_phoenix_eggAI(Creature *c) : ScriptedAI(c) {} + + uint32 HatchTimer; + + void Reset() + { + HatchTimer = 10000; + } + + void EnterCombat(Unit* /*who*/) {} + void MoveInLineOfSight(Unit* /*who*/) {} + + void UpdateAI(const uint32 diff) + { + if (HatchTimer <= diff) + { + me->SummonCreature(CREATURE_PHOENIX, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000); + me->Kill(me); + } else HatchTimer -= diff; + + } +}; + +struct mob_arcane_sphereAI : public ScriptedAI +{ + mob_arcane_sphereAI(Creature *c) : ScriptedAI(c) { Reset(); } + + uint32 DespawnTimer; + uint32 ChangeTargetTimer; + + void Reset() + { + DespawnTimer = 30000; + ChangeTargetTimer = urand(6000,12000); + + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->setFaction(14); + DoCast(me, SPELL_ARCANE_SPHERE_PASSIVE, true); + } + + void EnterCombat(Unit* /*who*/) {} + + void UpdateAI(const uint32 diff) + { + if (DespawnTimer <= diff) + me->Kill(me); + else + DespawnTimer -= diff; + + //Return since we have no target + if (!UpdateVictim()) + return; + + if (ChangeTargetTimer <= diff) + { + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) + { + me->AddThreat(pTarget, 1.0f); + me->TauntApply(pTarget); + AttackStart(pTarget); + } + + ChangeTargetTimer = urand(5000,15000); + } else ChangeTargetTimer -= diff; + } +}; + +CreatureAI* GetAI_boss_felblood_kaelthas(Creature* c) +{ + return new boss_felblood_kaelthasAI(c); +} + +CreatureAI* GetAI_mob_arcane_sphere(Creature* c) +{ + return new mob_arcane_sphereAI(c); +} + +CreatureAI* GetAI_mob_felkael_phoenix(Creature* c) +{ + return new mob_felkael_phoenixAI(c); +} + +CreatureAI* GetAI_mob_felkael_phoenix_egg(Creature* c) +{ + return new mob_felkael_phoenix_eggAI(c); +} + +CreatureAI* GetAI_mob_felkael_flamestrike(Creature* c) +{ + return new mob_felkael_flamestrikeAI(c); +} + +void AddSC_boss_felblood_kaelthas() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_felblood_kaelthas"; + newscript->GetAI = &GetAI_boss_felblood_kaelthas; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_arcane_sphere"; + newscript->GetAI = &GetAI_mob_arcane_sphere; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_felkael_phoenix"; + newscript->GetAI = &GetAI_mob_felkael_phoenix; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_felkael_phoenix_egg"; + newscript->GetAI = &GetAI_mob_felkael_phoenix_egg; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_felkael_flamestrike"; + newscript->GetAI = &GetAI_mob_felkael_flamestrike; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp new file mode 100644 index 00000000000..2112eaabc87 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp @@ -0,0 +1,1321 @@ +/* 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_Priestess_Delrissa +SD%Complete: 65 +SDComment: No Heroic support yet. Needs further testing. Several scripts for pets disabled, not seem to require any special script. +SDCategory: Magister's Terrace +EndScriptData */ + +#include "ScriptedPch.h" +#include "magisters_terrace.h" + +struct Speech +{ + int32 id; +}; + +static Speech LackeyDeath[]= +{ + {-1585013}, + {-1585014}, + {-1585015}, + {-1585016}, +}; + +static Speech PlayerDeath[]= +{ + {-1585017}, + {-1585018}, + {-1585019}, + {-1585020}, + {-1585021}, +}; + +enum eEnums +{ + SAY_AGGRO = -1585012, + SAY_DEATH = -1585022, + + SPELL_DISPEL_MAGIC = 27609, + SPELL_FLASH_HEAL = 17843, + SPELL_SW_PAIN_NORMAL = 14032, + SPELL_SW_PAIN_HEROIC = 15654, + SPELL_SHIELD = 44291, + SPELL_RENEW_NORMAL = 44174, + SPELL_RENEW_HEROIC = 46192, + + MAX_ACTIVE_LACKEY = 4 +}; + +const float fOrientation = 4.98; +const float fZLocation = -19.921; + +float LackeyLocations[4][2]= +{ + {123.77, 17.6007}, + {131.731, 15.0827}, + {121.563, 15.6213}, + {129.988, 17.2355}, +}; + +const uint32 m_auiAddEntries[] = +{ + 24557, //Kagani Nightstrike + 24558, //Elris Duskhallow + 24554, //Eramas Brightblaze + 24561, //Yazzaj + 24559, //Warlord Salaris + 24555, //Garaxxas + 24553, //Apoko + 24556, //Zelfan +}; + +struct boss_priestess_delrissaAI : public ScriptedAI +{ + boss_priestess_delrissaAI(Creature* c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + memset(&m_auiLackeyGUID, 0, sizeof(m_auiLackeyGUID)); + LackeyEntryList.clear(); + } + + ScriptedInstance* pInstance; + + std::vector LackeyEntryList; + uint64 m_auiLackeyGUID[MAX_ACTIVE_LACKEY]; + + uint8 PlayersKilled; + + uint32 HealTimer; + uint32 RenewTimer; + uint32 ShieldTimer; + uint32 SWPainTimer; + uint32 DispelTimer; + uint32 ResetTimer; + + void Reset() + { + PlayersKilled = 0; + + HealTimer = 15000; + RenewTimer = 10000; + ShieldTimer = 2000; + SWPainTimer = 5000; + DispelTimer = 7500; + ResetTimer = 5000; + + InitializeLackeys(); + } + + //this mean she at some point evaded + void JustReachedHome() + { + if (pInstance) + pInstance->SetData(DATA_DELRISSA_EVENT, FAIL); + } + + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, me); + + for (uint8 i = 0; i < MAX_ACTIVE_LACKEY; ++i) + { + if (Unit* pAdd = Unit::GetUnit(*me, m_auiLackeyGUID[i])) + { + if (!pAdd->getVictim()) + { + who->SetInCombatWith(pAdd); + pAdd->AddThreat(who, 0.0f); + } + } + } + + if (pInstance) + pInstance->SetData(DATA_DELRISSA_EVENT, IN_PROGRESS); + } + + void InitializeLackeys() + { + //can be called if Creature are dead, so avoid + if (!me->isAlive()) + return; + + uint8 j = 0; + + //it's empty, so first time + if (LackeyEntryList.empty()) + { + //pre-allocate size for speed + LackeyEntryList.resize((sizeof(m_auiAddEntries) / sizeof(uint32))); + + //fill vector array with entries from Creature array + for (uint8 i = 0; i < LackeyEntryList.size(); ++i) + LackeyEntryList[i] = m_auiAddEntries[i]; + + //remove random entries + while (LackeyEntryList.size() > MAX_ACTIVE_LACKEY) + LackeyEntryList.erase(LackeyEntryList.begin() + rand()%LackeyEntryList.size()); + + //summon all the remaining in vector + for (std::vector::const_iterator itr = LackeyEntryList.begin(); itr != LackeyEntryList.end(); ++itr) + { + if (Creature* pAdd = me->SummonCreature((*itr), LackeyLocations[j][0], LackeyLocations[j][1], fZLocation, fOrientation, TEMPSUMMON_CORPSE_DESPAWN, 0)) + m_auiLackeyGUID[j] = pAdd->GetGUID(); + + ++j; + } + } + else + { + for (std::vector::const_iterator itr = LackeyEntryList.begin(); itr != LackeyEntryList.end(); ++itr) + { + Unit* pAdd = Unit::GetUnit(*me, m_auiLackeyGUID[j]); + + //object already removed, not exist + if (!pAdd) + { + if (Creature* pAdd = me->SummonCreature((*itr), LackeyLocations[j][0], LackeyLocations[j][1], fZLocation, fOrientation, TEMPSUMMON_CORPSE_DESPAWN, 0)) + m_auiLackeyGUID[j] = pAdd->GetGUID(); + } + ++j; + } + } + } + + void KilledUnit(Unit* victim) + { + if (victim->GetTypeId() != TYPEID_PLAYER) + return; + + DoScriptText(PlayerDeath[PlayersKilled].id, me); + + if (PlayersKilled < 4) + ++PlayersKilled; + } + + void JustDied(Unit* /*killer*/) + { + DoScriptText(SAY_DEATH, me); + + if (!pInstance) + return; + + if (pInstance->GetData(DATA_DELRISSA_DEATH_COUNT) == MAX_ACTIVE_LACKEY) + pInstance->SetData(DATA_DELRISSA_EVENT, DONE); + else + { + if (me->HasFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE)) + me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (ResetTimer <= diff) + { + float x, y, z, o; + me->GetHomePosition(x, y, z, o); + if (me->GetPositionZ() >= z+10) + { + EnterEvadeMode(); + return; + } + ResetTimer = 5000; + } else ResetTimer -= diff; + + if (HealTimer <= diff) + { + uint32 health = me->GetHealth(); + Unit *pTarget = me; + for (uint8 i = 0; i < MAX_ACTIVE_LACKEY; ++i) + { + if (Unit* pAdd = Unit::GetUnit(*me, m_auiLackeyGUID[i])) + { + if (pAdd->isAlive() && pAdd->GetHealth() < health) + pTarget = pAdd; + } + } + + DoCast(pTarget, SPELL_FLASH_HEAL); + HealTimer = 15000; + } else HealTimer -= diff; + + if (RenewTimer <= diff) + { + Unit *pTarget = me; + + if (urand(0,1)) + if (Unit* pAdd = Unit::GetUnit(*me, m_auiLackeyGUID[rand()%MAX_ACTIVE_LACKEY])) + if (pAdd->isAlive()) + pTarget = pAdd; + + DoCast(pTarget, SPELL_RENEW_NORMAL); + RenewTimer = 5000; + } else RenewTimer -= diff; + + if (ShieldTimer <= diff) + { + Unit *pTarget = me; + + if (urand(0,1)) + if (Unit* pAdd = Unit::GetUnit(*me, m_auiLackeyGUID[rand()%MAX_ACTIVE_LACKEY])) + if (pAdd->isAlive() && !pAdd->HasAura(SPELL_SHIELD)) + pTarget = pAdd; + + DoCast(pTarget, SPELL_SHIELD); + ShieldTimer = 7500; + } else ShieldTimer -= diff; + + if (DispelTimer <= diff) + { + Unit *pTarget = NULL; + bool friendly = false; + + if (urand(0,1)) + pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); + else + { + friendly = true; + + if (urand(0,1)) + pTarget = me; + else + if (Unit* pAdd = Unit::GetUnit(*me, m_auiLackeyGUID[rand()%MAX_ACTIVE_LACKEY])) + if (pAdd->isAlive()) + pTarget = pAdd; + } + + if (pTarget) + DoCast(pTarget, SPELL_DISPEL_MAGIC); + + DispelTimer = 12000; + } else DispelTimer -= diff; + + if (SWPainTimer <= diff) + { + if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) + DoCast(pTarget, SPELL_SW_PAIN_NORMAL); + + SWPainTimer = 10000; + } else SWPainTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_priestess_delrissa(Creature* pCreature) +{ + return new boss_priestess_delrissaAI(pCreature); +} + +enum eHealingPotion +{ + SPELL_HEALING_POTION = 15503 +}; + +//all 8 possible lackey use this common +struct boss_priestess_lackey_commonAI : public ScriptedAI +{ + boss_priestess_lackey_commonAI(Creature* c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + memset(&m_auiLackeyGUIDs, 0, sizeof(m_auiLackeyGUIDs)); + AcquireGUIDs(); + } + + ScriptedInstance* pInstance; + + uint64 m_auiLackeyGUIDs[MAX_ACTIVE_LACKEY]; + uint32 ResetThreatTimer; + + bool UsedPotion; + + void Reset() + { + UsedPotion = false; + + // These guys does not follow normal threat system rules + // For later development, some alternative threat system should be made + // We do not know what this system is based upon, but one theory is class (healers=high threat, dps=medium, etc) + // We reset their threat frequently as an alternative until such a system exist + ResetThreatTimer = urand(5000,20000); + + // in case she is not alive and Reset was for some reason called, respawn her (most likely party wipe after killing her) + if (Creature* pDelrissa = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_DELRISSA) : 0)) + { + if (!pDelrissa->isAlive()) + pDelrissa->Respawn(); + } + } + + void EnterCombat(Unit* pWho) + { + if (!pWho) + return; + + if (pInstance) + { + for (uint8 i = 0; i < MAX_ACTIVE_LACKEY; ++i) + { + if (Unit* pAdd = Unit::GetUnit(*me, m_auiLackeyGUIDs[i])) + { + if (!pAdd->getVictim() && pAdd != me) + { + pWho->SetInCombatWith(pAdd); + pAdd->AddThreat(pWho, 0.0f); + } + } + } + + if (Creature* pDelrissa = Unit::GetCreature(*me, pInstance->GetData64(DATA_DELRISSA))) + { + if (pDelrissa->isAlive() && !pDelrissa->getVictim()) + { + pWho->SetInCombatWith(pDelrissa); + pDelrissa->AddThreat(pWho, 0.0f); + } + } + } + } + + void JustDied(Unit* /*killer*/) + { + if (!pInstance) + return; + + Creature* pDelrissa = Unit::GetCreature(*me, pInstance->GetData64(DATA_DELRISSA)); + uint32 uiLackeyDeathCount = pInstance->GetData(DATA_DELRISSA_DEATH_COUNT); + + if (!pDelrissa) + return; + + //should delrissa really yell if dead? + DoScriptText(LackeyDeath[uiLackeyDeathCount].id, pDelrissa); + + pInstance->SetData(DATA_DELRISSA_DEATH_COUNT, SPECIAL); + + //increase local var, since we now may have four dead + ++uiLackeyDeathCount; + + if (uiLackeyDeathCount == MAX_ACTIVE_LACKEY) + { + //time to make her lootable and complete event if she died before lackeys + if (!pDelrissa->isAlive()) + { + if (!pDelrissa->HasFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE)) + pDelrissa->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); + + pInstance->SetData(DATA_DELRISSA_EVENT, DONE); + } + } + } + + void KilledUnit(Unit* victim) + { + if (!pInstance) + return; + + if (Creature* Delrissa = Unit::GetCreature(*me, pInstance->GetData64(DATA_DELRISSA))) + Delrissa->AI()->KilledUnit(victim); + } + + void AcquireGUIDs() + { + if (!pInstance) + return; + + if (Creature* Delrissa = (Unit::GetCreature(*me, pInstance->GetData64(DATA_DELRISSA)))) + { + for (uint8 i = 0; i < MAX_ACTIVE_LACKEY; ++i) + m_auiLackeyGUIDs[i] = CAST_AI(boss_priestess_delrissaAI, Delrissa->AI())->m_auiLackeyGUID[i]; + } + } + + void UpdateAI(const uint32 diff) + { + if (!UsedPotion && (me->GetHealth()*100 / me->GetMaxHealth()) < 25) + { + DoCast(me, SPELL_HEALING_POTION); + UsedPotion = true; + } + + if (ResetThreatTimer <= diff) + { + DoResetThreat(); + ResetThreatTimer = 5000 + rand()%15000; + } else ResetThreatTimer -= diff; + } +}; + +enum eRogueSpells +{ + SPELL_KIDNEY_SHOT = 27615, + SPELL_GOUGE = 12540, + SPELL_KICK = 27613, + SPELL_VANISH = 44290, + SPELL_BACKSTAB = 15657, + SPELL_EVISCERATE = 27611 +}; + +struct boss_kagani_nightstrikeAI : public boss_priestess_lackey_commonAI +{ + //Rogue + boss_kagani_nightstrikeAI(Creature *c) : boss_priestess_lackey_commonAI(c) {} + + uint32 Gouge_Timer; + uint32 Kick_Timer; + uint32 Vanish_Timer; + uint32 Eviscerate_Timer; + uint32 Wait_Timer; + bool InVanish; + + void Reset() + { + Gouge_Timer = 5500; + Kick_Timer = 7000; + Vanish_Timer = 2000; + Eviscerate_Timer = 6000; + Wait_Timer = 5000; + InVanish = false; + me->SetVisibility(VISIBILITY_ON); + + boss_priestess_lackey_commonAI::Reset(); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + boss_priestess_lackey_commonAI::UpdateAI(diff); + + if (Vanish_Timer <= diff) + { + DoCast(me, SPELL_VANISH); + + Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 0); + + DoResetThreat(); + + if (pUnit) + me->AddThreat(pUnit, 1000.0f); + + InVanish = true; + Vanish_Timer = 30000; + Wait_Timer = 10000; + } else Vanish_Timer -= diff; + + if (InVanish) + { + if (Wait_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_BACKSTAB, true); + DoCast(me->getVictim(), SPELL_KIDNEY_SHOT, true); + me->SetVisibility(VISIBILITY_ON); // ...? Hacklike + InVanish = false; + } else Wait_Timer -= diff; + } + + if (Gouge_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_GOUGE); + Gouge_Timer = 5500; + } else Gouge_Timer -= diff; + + if (Kick_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_KICK); + Kick_Timer = 7000; + } else Kick_Timer -= diff; + + if (Eviscerate_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_EVISCERATE); + Eviscerate_Timer = 4000; + } else Eviscerate_Timer -= diff; + + if (!InVanish) + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_kagani_nightstrike(Creature* pCreature) +{ + return new boss_kagani_nightstrikeAI(pCreature); +} + +enum eWarlockSpells +{ + SPELL_IMMOLATE = 44267, + SPELL_SHADOW_BOLT = 12471, + SPELL_SEED_OF_CORRUPTION = 44141, + SPELL_CURSE_OF_AGONY = 14875, + SPELL_FEAR = 38595, + SPELL_IMP_FIREBALL = 44164, + SPELL_SUMMON_IMP = 44163 +}; + +struct boss_ellris_duskhallowAI : public boss_priestess_lackey_commonAI +{ + //Warlock + boss_ellris_duskhallowAI(Creature *c) : boss_priestess_lackey_commonAI(c) {} + + uint32 Immolate_Timer; + uint32 Shadow_Bolt_Timer; + uint32 Seed_of_Corruption_Timer; + uint32 Curse_of_Agony_Timer; + uint32 Fear_Timer; + + void Reset() + { + Immolate_Timer = 6000; + Shadow_Bolt_Timer = 3000; + Seed_of_Corruption_Timer = 2000; + Curse_of_Agony_Timer = 1000; + Fear_Timer = 10000; + + boss_priestess_lackey_commonAI::Reset(); + } + + void Aggro(Unit* /*pWho*/) + { + DoCast(me, SPELL_SUMMON_IMP); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + boss_priestess_lackey_commonAI::UpdateAI(diff); + + if (Immolate_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_IMMOLATE); + Immolate_Timer = 6000; + } else Immolate_Timer -= diff; + + if (Shadow_Bolt_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_SHADOW_BOLT); + Shadow_Bolt_Timer = 5000; + } else Shadow_Bolt_Timer -= diff; + + if (Seed_of_Corruption_Timer <= diff) + { + if (Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(pUnit, SPELL_SEED_OF_CORRUPTION); + + Seed_of_Corruption_Timer = 10000; + } else Seed_of_Corruption_Timer -= diff; + + if (Curse_of_Agony_Timer <= diff) + { + if (Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(pUnit, SPELL_CURSE_OF_AGONY); + + Curse_of_Agony_Timer = 13000; + } else Curse_of_Agony_Timer -= diff; + + if (Fear_Timer <= diff) + { + if (Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(pUnit, SPELL_FEAR); + + Fear_Timer = 10000; + } else Fear_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_ellris_duskhallow(Creature* pCreature) +{ + return new boss_ellris_duskhallowAI(pCreature); +} + +enum eKickDown +{ + SPELL_KNOCKDOWN = 11428, + SPELL_SNAP_KICK = 46182 +}; + +struct boss_eramas_brightblazeAI : public boss_priestess_lackey_commonAI +{ + //Monk + boss_eramas_brightblazeAI(Creature *c) : boss_priestess_lackey_commonAI(c) {} + + uint32 Knockdown_Timer; + uint32 Snap_Kick_Timer; + + void Reset() + { + Knockdown_Timer = 6000; + Snap_Kick_Timer = 4500; + + boss_priestess_lackey_commonAI::Reset(); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + boss_priestess_lackey_commonAI::UpdateAI(diff); + + if (Knockdown_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_KNOCKDOWN); + Knockdown_Timer = 6000; + } else Knockdown_Timer -= diff; + + if (Snap_Kick_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_SNAP_KICK); + Snap_Kick_Timer = 4500; + } else Snap_Kick_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_eramas_brightblaze(Creature* pCreature) +{ + return new boss_eramas_brightblazeAI(pCreature); +} + +enum eMageSpells +{ + SPELL_POLYMORPH = 13323, + SPELL_ICE_BLOCK = 27619, + SPELL_BLIZZARD = 44178, + SPELL_ICE_LANCE = 46194, + SPELL_CONE_OF_COLD = 38384, + SPELL_FROSTBOLT = 15043, + SPELL_BLINK = 14514 +}; + +struct boss_yazzaiAI : public boss_priestess_lackey_commonAI +{ + //Mage + boss_yazzaiAI(Creature *c) : boss_priestess_lackey_commonAI(c) {} + + bool HasIceBlocked; + + uint32 Polymorph_Timer; + uint32 Ice_Block_Timer; + uint32 Wait_Timer; + uint32 Blizzard_Timer; + uint32 Ice_Lance_Timer; + uint32 Cone_of_Cold_Timer; + uint32 Frostbolt_Timer; + uint32 Blink_Timer; + + void Reset() + { + HasIceBlocked = false; + + Polymorph_Timer = 1000; + Ice_Block_Timer = 20000; + Wait_Timer = 10000; + Blizzard_Timer = 8000; + Ice_Lance_Timer = 12000; + Cone_of_Cold_Timer = 10000; + Frostbolt_Timer = 3000; + Blink_Timer = 8000; + + boss_priestess_lackey_commonAI::Reset(); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + boss_priestess_lackey_commonAI::UpdateAI(diff); + + if (Polymorph_Timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + DoCast(pTarget, SPELL_POLYMORPH); + Polymorph_Timer = 20000; + } + } else Polymorph_Timer -= diff; + + if (((me->GetHealth()*100 / me->GetMaxHealth()) < 35) && !HasIceBlocked) + { + DoCast(me, SPELL_ICE_BLOCK); + HasIceBlocked = true; + } + + if (Blizzard_Timer <= diff) + { + if (Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(pUnit, SPELL_BLIZZARD); + + Blizzard_Timer = 8000; + } else Blizzard_Timer -= diff; + + if (Ice_Lance_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_ICE_LANCE); + Ice_Lance_Timer = 12000; + } else Ice_Lance_Timer -= diff; + + if (Cone_of_Cold_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_CONE_OF_COLD); + Cone_of_Cold_Timer = 10000; + } else Cone_of_Cold_Timer -= diff; + + if (Frostbolt_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_FROSTBOLT); + Frostbolt_Timer = 8000; + } else Frostbolt_Timer -= diff; + + if (Blink_Timer <= diff) + { + bool InMeleeRange = false; + std::list& t_list = me->getThreatManager().getThreatList(); + for (std::list::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) + { + if (Unit *pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid())) + { + //if in melee range + if (pTarget->IsWithinDistInMap(me, 5)) + { + InMeleeRange = true; + break; + } + } + } + + //if anybody is in melee range than escape by blink + if (InMeleeRange) + DoCast(me, SPELL_BLINK); + + Blink_Timer = 8000; + } else Blink_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_yazzai(Creature* pCreature) +{ + return new boss_yazzaiAI(pCreature); +} + +enum eWarriorSpells +{ + SPELL_INTERCEPT_STUN = 27577, + SPELL_DISARM = 27581, + SPELL_PIERCING_HOWL = 23600, + SPELL_FRIGHTENING_SHOUT = 19134, + SPELL_HAMSTRING = 27584, + SPELL_BATTLE_SHOUT = 27578, + SPELL_MORTAL_STRIKE = 44268 +}; + +struct boss_warlord_salarisAI : public boss_priestess_lackey_commonAI +{ + //Warrior + boss_warlord_salarisAI(Creature *c) : boss_priestess_lackey_commonAI(c) {} + + uint32 Intercept_Stun_Timer; + uint32 Disarm_Timer; + uint32 Piercing_Howl_Timer; + uint32 Frightening_Shout_Timer; + uint32 Hamstring_Timer; + uint32 Mortal_Strike_Timer; + + void Reset() + { + Intercept_Stun_Timer = 500; + Disarm_Timer = 6000; + Piercing_Howl_Timer = 10000; + Frightening_Shout_Timer = 18000; + Hamstring_Timer = 4500; + Mortal_Strike_Timer = 8000; + + boss_priestess_lackey_commonAI::Reset(); + } + + void EnterCombat(Unit* /*who*/) + { + DoCast(me, SPELL_BATTLE_SHOUT); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + boss_priestess_lackey_commonAI::UpdateAI(diff); + + if (Intercept_Stun_Timer <= diff) + { + bool InMeleeRange = false; + std::list& t_list = me->getThreatManager().getThreatList(); + for (std::list::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) + { + if (Unit *pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid())) + { + //if in melee range + if (pTarget->IsWithinDistInMap(me, ATTACK_DISTANCE)) + { + InMeleeRange = true; + break; + } + } + } + + //if nobody is in melee range than try to use Intercept + if (!InMeleeRange) + { + if (Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(pUnit, SPELL_INTERCEPT_STUN); + } + + Intercept_Stun_Timer = 10000; + } else Intercept_Stun_Timer -= diff; + + if (Disarm_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_DISARM); + Disarm_Timer = 6000; + } else Disarm_Timer -= diff; + + if (Hamstring_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_HAMSTRING); + Hamstring_Timer = 4500; + } else Hamstring_Timer -= diff; + + if (Mortal_Strike_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_MORTAL_STRIKE); + Mortal_Strike_Timer = 4500; + } else Mortal_Strike_Timer -= diff; + + if (Piercing_Howl_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_PIERCING_HOWL); + Piercing_Howl_Timer = 10000; + } else Piercing_Howl_Timer -= diff; + + if (Frightening_Shout_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_FRIGHTENING_SHOUT); + Frightening_Shout_Timer = 18000; + } else Frightening_Shout_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_warlord_salaris(Creature* pCreature) +{ + return new boss_warlord_salarisAI(pCreature); +} + +enum eHunterSpells +{ + SPELL_AIMED_SHOT = 44271, + SPELL_SHOOT = 15620, + SPELL_CONCUSSIVE_SHOT = 27634, + SPELL_MULTI_SHOT = 31942, + SPELL_WING_CLIP = 44286, + SPELL_FREEZING_TRAP = 44136, + + NPC_SLIVER = 24552 +}; + +struct boss_garaxxasAI : public boss_priestess_lackey_commonAI +{ + //Hunter + boss_garaxxasAI(Creature *c) : boss_priestess_lackey_commonAI(c) { m_uiPetGUID = 0; } + + uint64 m_uiPetGUID; + + uint32 Aimed_Shot_Timer; + uint32 Shoot_Timer; + uint32 Concussive_Shot_Timer; + uint32 Multi_Shot_Timer; + uint32 Wing_Clip_Timer; + uint32 Freezing_Trap_Timer; + + void Reset() + { + Aimed_Shot_Timer = 6000; + Shoot_Timer = 2500; + Concussive_Shot_Timer = 8000; + Multi_Shot_Timer = 10000; + Wing_Clip_Timer = 4000; + Freezing_Trap_Timer = 15000; + + Unit* pPet = Unit::GetUnit(*me,m_uiPetGUID); + if (!pPet) + me->SummonCreature(NPC_SLIVER, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0); + + boss_priestess_lackey_commonAI::Reset(); + } + + void JustSummoned(Creature* pSummoned) + { + m_uiPetGUID = pSummoned->GetGUID(); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + boss_priestess_lackey_commonAI::UpdateAI(diff); + + if (me->IsWithinDistInMap(me->getVictim(), ATTACK_DISTANCE)) + { + if (Wing_Clip_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_WING_CLIP); + Wing_Clip_Timer = 4000; + } else Wing_Clip_Timer -= diff; + + if (Freezing_Trap_Timer <= diff) + { + //attempt find go summoned from spell (casted by me) + GameObject* pGo = me->GetGameObject(SPELL_FREEZING_TRAP); + + //if we have a pGo, we need to wait (only one trap at a time) + if (pGo) + Freezing_Trap_Timer = 2500; + else + { + //if pGo does not exist, then we can cast + DoCast(me->getVictim(), SPELL_FREEZING_TRAP); + Freezing_Trap_Timer = 15000; + } + } else Freezing_Trap_Timer -= diff; + + DoMeleeAttackIfReady(); + } + else + { + if (Concussive_Shot_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_CONCUSSIVE_SHOT); + Concussive_Shot_Timer = 8000; + } else Concussive_Shot_Timer -= diff; + + if (Multi_Shot_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_MULTI_SHOT); + Multi_Shot_Timer = 10000; + } else Multi_Shot_Timer -= diff; + + if (Aimed_Shot_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_AIMED_SHOT); + Aimed_Shot_Timer = 6000; + } else Aimed_Shot_Timer -= diff; + + if (Shoot_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_SHOOT); + Shoot_Timer = 2500; + } else Shoot_Timer -= diff; + } + } +}; + +CreatureAI* GetAI_garaxxas(Creature* pCreature) +{ + return new boss_garaxxasAI(pCreature); +} + +enum Spells +{ + SPELL_WINDFURY_TOTEM = 27621, + SPELL_WAR_STOMP = 46026, + SPELL_PURGE = 27626, + SPELL_LESSER_HEALING_WAVE = 44256, + SPELL_FROST_SHOCK = 21401, + SPELL_FIRE_NOVA_TOTEM = 44257, + SPELL_EARTHBIND_TOTEM = 15786 +}; + +struct boss_apokoAI : public boss_priestess_lackey_commonAI +{ + //Shaman + boss_apokoAI(Creature *c) : boss_priestess_lackey_commonAI(c) {} + + uint32 Totem_Timer; + uint8 Totem_Amount; + uint32 War_Stomp_Timer; + uint32 Purge_Timer; + uint32 Healing_Wave_Timer; + uint32 Frost_Shock_Timer; + + void Reset() + { + Totem_Timer = 2000; + Totem_Amount = 1; + War_Stomp_Timer = 10000; + Purge_Timer = 8000; + Healing_Wave_Timer = 5000; + Frost_Shock_Timer = 7000; + + boss_priestess_lackey_commonAI::Reset(); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + boss_priestess_lackey_commonAI::UpdateAI(diff); + + if (Totem_Timer <= diff) + { + DoCast(me, RAND(SPELL_WINDFURY_TOTEM,SPELL_FIRE_NOVA_TOTEM,SPELL_EARTHBIND_TOTEM)); + ++Totem_Amount; + Totem_Timer = Totem_Amount*2000; + } else Totem_Timer -= diff; + + if (War_Stomp_Timer <= diff) + { + DoCast(me, SPELL_WAR_STOMP); + War_Stomp_Timer = 10000; + } else War_Stomp_Timer -= diff; + + if (Purge_Timer <= diff) + { + if (Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(pUnit, SPELL_PURGE); + + Purge_Timer = 15000; + } else Purge_Timer -= diff; + + if (Frost_Shock_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_FROST_SHOCK); + Frost_Shock_Timer = 7000; + } else Frost_Shock_Timer -= diff; + + if (Healing_Wave_Timer <= diff) + { + // std::vector::const_iterator itr = Group.begin() + rand()%Group.size(); + // uint64 guid = (*itr)->guid; + // if (guid) + // { + // Unit* pAdd = Unit::GetUnit(*me, (*itr)->guid); + // if (pAdd && pAdd->isAlive()) + // { + DoCast(me, SPELL_LESSER_HEALING_WAVE); + Healing_Wave_Timer = 5000; + // } + // } + } else Healing_Wave_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_apoko(Creature* pCreature) +{ + return new boss_apokoAI(pCreature); +} + +enum eEngineerSpells +{ + SPELL_GOBLIN_DRAGON_GUN = 44272, + SPELL_ROCKET_LAUNCH = 44137, + SPELL_RECOMBOBULATE = 44274, + SPELL_HIGH_EXPLOSIVE_SHEEP = 44276, + SPELL_FEL_IRON_BOMB = 46024, + SPELL_SHEEP_EXPLOSION = 44279 +}; + +struct boss_zelfanAI : public boss_priestess_lackey_commonAI +{ + //Engineer + boss_zelfanAI(Creature *c) : boss_priestess_lackey_commonAI(c) {} + + uint32 Goblin_Dragon_Gun_Timer; + uint32 Rocket_Launch_Timer; + uint32 Recombobulate_Timer; + uint32 High_Explosive_Sheep_Timer; + uint32 Fel_Iron_Bomb_Timer; + + void Reset() + { + Goblin_Dragon_Gun_Timer = 20000; + Rocket_Launch_Timer = 7000; + Recombobulate_Timer = 4000; + High_Explosive_Sheep_Timer = 10000; + Fel_Iron_Bomb_Timer = 15000; + + boss_priestess_lackey_commonAI::Reset(); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + boss_priestess_lackey_commonAI::UpdateAI(diff); + + if (Goblin_Dragon_Gun_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_GOBLIN_DRAGON_GUN); + Goblin_Dragon_Gun_Timer = 10000; + } else Goblin_Dragon_Gun_Timer -= diff; + + if (Rocket_Launch_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_ROCKET_LAUNCH); + Rocket_Launch_Timer = 9000; + } else Rocket_Launch_Timer -= diff; + + if (Fel_Iron_Bomb_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_FEL_IRON_BOMB); + Fel_Iron_Bomb_Timer = 15000; + } else Fel_Iron_Bomb_Timer -= diff; + + if (Recombobulate_Timer <= diff) + { + for (uint8 i = 0; i < MAX_ACTIVE_LACKEY; ++i) + { + if (Unit* pAdd = Unit::GetUnit(*me, m_auiLackeyGUIDs[i])) + { + if (pAdd->IsPolymorphed()) + { + DoCast(pAdd, SPELL_RECOMBOBULATE); + break; + } + } + } + Recombobulate_Timer = 2000; + } else Recombobulate_Timer -= diff; + + if (High_Explosive_Sheep_Timer <= diff) + { + DoCast(me, SPELL_HIGH_EXPLOSIVE_SHEEP); + High_Explosive_Sheep_Timer = 65000; + } else High_Explosive_Sheep_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_zelfan(Creature* pCreature) +{ + return new boss_zelfanAI(pCreature); +} + +//struct mob_high_explosive_sheepAI : public ScriptedAI +//{ +// mob_high_explosive_sheepAI(Creature *c) : ScriptedAI(c) {} +// +// uint32 Explosion_Timer; +// +// void Reset() +// { +// Explosion_Timer = 60000; +// } +// +// void JustDied(Unit *Killer){} +// +// void EnterCombat(Unit * /*who*/){} +// +// void UpdateAI(const uint32 diff) +// { +// if (Explosion_Timer <= diff) +// { +// DoCast(me->getVictim(), SPELL_SHEEP_EXPLOSION); +// }else +// Explosion_Timer -= diff; +// } +//}; + +//CreatureAI* GetAI_mob_high_explosive_sheep(Creature* pCreature) +//{ +// return new mob_high_explosive_sheepAI (pCreature); +//}; + +void AddSC_boss_priestess_delrissa() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_priestess_delrissa"; + newscript->GetAI = &GetAI_boss_priestess_delrissa; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_kagani_nightstrike"; + newscript->GetAI = &GetAI_boss_kagani_nightstrike; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_ellris_duskhallow"; + newscript->GetAI = &GetAI_ellris_duskhallow; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_eramas_brightblaze"; + newscript->GetAI = &GetAI_eramas_brightblaze; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_yazzai"; + newscript->GetAI = &GetAI_yazzai; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_warlord_salaris"; + newscript->GetAI = &GetAI_warlord_salaris; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_garaxxas"; + newscript->GetAI = &GetAI_garaxxas; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_apoko"; + newscript->GetAI = &GetAI_apoko; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_zelfan"; + newscript->GetAI = &GetAI_zelfan; + newscript->RegisterSelf(); + + /*newscript = new Script; + newscript->Name = "mob_high_explosive_sheep"; + newscript->GetAI = &GetAI_mob_high_explosive_sheep; + newscript->RegisterSelf();*/ +} + diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp new file mode 100644 index 00000000000..adb0700eabf --- /dev/null +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp @@ -0,0 +1,366 @@ +/* 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_Selin_Fireheart +SD%Complete: 90 +SDComment: Heroic and Normal Support. Needs further testing. +SDCategory: Magister's Terrace +EndScriptData */ + +#include "ScriptedPch.h" +#include "magisters_terrace.h" + +#define SAY_AGGRO -1585000 +#define SAY_ENERGY -1585001 +#define SAY_EMPOWERED -1585002 +#define SAY_KILL_1 -1585003 +#define SAY_KILL_2 -1585004 +#define SAY_DEATH -1585005 +#define EMOTE_CRYSTAL -1585006 + +//Crystal effect spells +#define SPELL_FEL_CRYSTAL_COSMETIC 44374 +#define SPELL_FEL_CRYSTAL_DUMMY 44329 +#define SPELL_FEL_CRYSTAL_VISUAL 44355 +#define SPELL_MANA_RAGE 44320 // This spell triggers 44321, which changes scale and regens mana Requires an entry in spell_script_target + +//Selin's spells +#define SPELL_DRAIN_LIFE 44294 +#define SPELL_FEL_EXPLOSION 44314 + +#define SPELL_DRAIN_MANA 46153 // Heroic only + +#define CRYSTALS_NUMBER 5 +#define DATA_CRYSTALS 6 + +#define CREATURE_FEL_CRYSTAL 24722 + +struct boss_selin_fireheartAI : public ScriptedAI +{ + boss_selin_fireheartAI(Creature* c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + + Crystals.clear(); + //GUIDs per instance is static, so we only need to load them once. + if (pInstance) + { + uint32 size = pInstance->GetData(DATA_FEL_CRYSTAL_SIZE); + for (uint8 i = 0; i < size; ++i) + { + uint64 guid = pInstance->GetData64(DATA_FEL_CRYSTAL); + debug_log("TSCR: Selin: Adding Fel Crystal %u to list", guid); + Crystals.push_back(guid); + } + } + } + + ScriptedInstance* pInstance; + + std::list Crystals; + + uint32 DrainLifeTimer; + uint32 DrainManaTimer; + uint32 FelExplosionTimer; + uint32 DrainCrystalTimer; + uint32 EmpowerTimer; + + bool IsDraining; + bool DrainingCrystal; + + uint64 CrystalGUID; // This will help us create a pointer to the crystal we are draining. We store GUIDs, never units in case unit is deleted/offline (offline if player of course). + + void Reset() + { + if (pInstance) + { + //for (uint8 i = 0; i < CRYSTALS_NUMBER; ++i) + for (std::list::const_iterator itr = Crystals.begin(); itr != Crystals.end(); ++itr) + { + //Unit* pUnit = Unit::GetUnit(*me, FelCrystals[i]); + Unit* pUnit = Unit::GetUnit(*me, *itr); + if (pUnit) + { + if (!pUnit->isAlive()) + CAST_CRE(pUnit)->Respawn(); // Let the core handle setting death state, etc. + + // Only need to set unselectable flag. You can't attack unselectable units so non_attackable flag is not necessary here. + pUnit->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + } + } + + pInstance->HandleGameObject(pInstance->GetData64(DATA_SELIN_ENCOUNTER_DOOR), true); + // Open the big encounter door. Close it in Aggro and open it only in JustDied(and here) + // Small door opened after event are expected to be closed by default + // Set Inst data for encounter + pInstance->SetData(DATA_SELIN_EVENT, NOT_STARTED); + } else error_log(ERROR_INST_DATA); + + DrainLifeTimer = 3000 + rand()%4000; + DrainManaTimer = DrainLifeTimer + 5000; + FelExplosionTimer = 2100; + DrainCrystalTimer = 10000 + rand()%5000; + DrainCrystalTimer = 20000 + rand()%5000; + EmpowerTimer = 10000; + + IsDraining = false; + DrainingCrystal = false; + CrystalGUID = 0; + } + + void SelectNearestCrystal() + { + if (Crystals.empty()) + return; + + //float ShortestDistance = 0; + CrystalGUID = 0; + Unit* pCrystal = NULL; + Unit* CrystalChosen = NULL; + //for (uint8 i = 0; i < CRYSTALS_NUMBER; ++i) + for (std::list::const_iterator itr = Crystals.begin(); itr != Crystals.end(); ++itr) + { + pCrystal = NULL; + //pCrystal = Unit::GetUnit(*me, FelCrystals[i]); + pCrystal = Unit::GetUnit(*me, *itr); + if (pCrystal && pCrystal->isAlive()) + { + // select nearest + if (!CrystalChosen || me->GetDistanceOrder(pCrystal, CrystalChosen, false)) + { + CrystalGUID = pCrystal->GetGUID(); + CrystalChosen = pCrystal; // Store a copy of pCrystal so we don't need to recreate a pointer to closest crystal for the movement and yell. + } + } + } + if (CrystalChosen) + { + DoScriptText(SAY_ENERGY, me); + DoScriptText(EMOTE_CRYSTAL, me); + + CrystalChosen->CastSpell(CrystalChosen, SPELL_FEL_CRYSTAL_COSMETIC, true); + + float x, y, z; // coords that we move to, close to the crystal. + CrystalChosen->GetClosePoint(x, y, z, me->GetObjectSize(), CONTACT_DISTANCE); + + me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + me->GetMotionMaster()->MovePoint(1, x, y, z); + DrainingCrystal = true; + } + } + + void ShatterRemainingCrystals() + { + if (Crystals.empty()) + return; + + //for (uint8 i = 0; i < CRYSTALS_NUMBER; ++i) + for (std::list::const_iterator itr = Crystals.begin(); itr != Crystals.end(); ++itr) + { + //Creature* pCrystal = (Unit::GetCreature(*me, FelCrystals[i])); + Creature* pCrystal = Unit::GetCreature(*me, *itr); + if (pCrystal && pCrystal->isAlive()) + pCrystal->Kill(pCrystal); + } + } + + void EnterCombat(Unit* /*who*/) + { + DoScriptText(SAY_AGGRO, me); + + if (pInstance) + pInstance->HandleGameObject(pInstance->GetData64(DATA_SELIN_ENCOUNTER_DOOR), false); + //Close the encounter door, open it in JustDied/Reset + } + + void KilledUnit(Unit* /*victim*/) + { + DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2), me); + } + + void MovementInform(uint32 type, uint32 id) + { + if (type == POINT_MOTION_TYPE && id == 1) + { + Unit* CrystalChosen = Unit::GetUnit(*me, CrystalGUID); + if (CrystalChosen && CrystalChosen->isAlive()) + { + // Make the crystal attackable + // We also remove NON_ATTACKABLE in case the database has it set. + CrystalChosen->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE); + CrystalChosen->CastSpell(me, SPELL_MANA_RAGE, true); + IsDraining = true; + } + else + { + // Make an error message in case something weird happened here + error_log("TSCR: Selin Fireheart unable to drain crystal as the crystal is either dead or despawned"); + DrainingCrystal = false; + } + } + } + + void JustDied(Unit* /*killer*/) + { + DoScriptText(SAY_DEATH, me); + + if (!pInstance) + return; + + pInstance->SetData(DATA_SELIN_EVENT, DONE); // Encounter complete! + pInstance->HandleGameObject(pInstance->GetData64(DATA_SELIN_ENCOUNTER_DOOR), true); // Open the encounter door + pInstance->HandleGameObject(pInstance->GetData64(DATA_SELIN_DOOR), true); // Open the door leading further in + ShatterRemainingCrystals(); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (!DrainingCrystal) + { + uint32 maxPowerMana = me->GetMaxPower(POWER_MANA); + if (maxPowerMana && ((me->GetPower(POWER_MANA)*100 / maxPowerMana) < 10)) + { + if (DrainLifeTimer <= diff) + { + DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_DRAIN_LIFE); + DrainLifeTimer = 10000; + } else DrainLifeTimer -= diff; + + // Heroic only + if (IsHeroic()) + { + if (DrainManaTimer <= diff) + { + DoCast(SelectUnit(SELECT_TARGET_RANDOM, 1), SPELL_DRAIN_MANA); + DrainManaTimer = 10000; + } else DrainManaTimer -= diff; + } + } + + if (FelExplosionTimer <= diff) + { + if (!me->IsNonMeleeSpellCasted(false)) + { + DoCast(me, SPELL_FEL_EXPLOSION); + FelExplosionTimer = 2000; + } + } else FelExplosionTimer -= diff; + + // If below 10% mana, start recharging + maxPowerMana = me->GetMaxPower(POWER_MANA); + if (maxPowerMana && ((me->GetPower(POWER_MANA)*100 / maxPowerMana) < 10)) + { + if (DrainCrystalTimer <= diff) + { + SelectNearestCrystal(); + if (IsHeroic()) + DrainCrystalTimer = 10000 + rand()%5000; + else + DrainCrystalTimer = 20000 + rand()%5000; + } else DrainCrystalTimer -= diff; + } + + }else + { + if (IsDraining) + { + if (EmpowerTimer <= diff) + { + IsDraining = false; + DrainingCrystal = false; + + DoScriptText(SAY_EMPOWERED, me); + + Unit* CrystalChosen = Unit::GetUnit(*me, CrystalGUID); + if (CrystalChosen && CrystalChosen->isAlive()) + // Use Deal Damage to kill it, not setDeathState. + CrystalChosen->Kill(CrystalChosen); + + CrystalGUID = 0; + + me->GetMotionMaster()->Clear(); + me->GetMotionMaster()->MoveChase(me->getVictim()); + } else EmpowerTimer -= diff; + } + } + + DoMeleeAttackIfReady(); // No need to check if we are draining crystal here, as the spell has a stun. + } +}; + +CreatureAI* GetAI_boss_selin_fireheart(Creature* pCreature) +{ + return new boss_selin_fireheartAI (pCreature); +}; + +struct mob_fel_crystalAI : public ScriptedAI +{ + mob_fel_crystalAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* /*who*/) {} + void AttackStart(Unit* /*who*/) {} + void MoveInLineOfSight(Unit* /*who*/) {} + void UpdateAI(const uint32 /*diff*/) {} + + void JustDied(Unit* /*killer*/) + { + if (ScriptedInstance* pInstance = me->GetInstanceData()) + { + Creature* Selin = (Unit::GetCreature(*me, pInstance->GetData64(DATA_SELIN))); + if (Selin && Selin->isAlive()) + { + if (CAST_AI(boss_selin_fireheartAI, Selin->AI())->CrystalGUID == me->GetGUID()) + { + // Set this to false if we are the Creature that Selin is draining so his AI flows properly + CAST_AI(boss_selin_fireheartAI, Selin->AI())->DrainingCrystal = false; + CAST_AI(boss_selin_fireheartAI, Selin->AI())->IsDraining = false; + CAST_AI(boss_selin_fireheartAI, Selin->AI())->EmpowerTimer = 10000; + if (Selin->getVictim()) + { + Selin->AI()->AttackStart(Selin->getVictim()); + Selin->GetMotionMaster()->MoveChase(Selin->getVictim()); + } + } + } + } else error_log(ERROR_INST_DATA); + } +}; + +CreatureAI* GetAI_mob_fel_crystal(Creature* pCreature) +{ + return new mob_fel_crystalAI (pCreature); +}; + +void AddSC_boss_selin_fireheart() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_selin_fireheart"; + newscript->GetAI = &GetAI_boss_selin_fireheart; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_fel_crystal"; + newscript->GetAI = &GetAI_mob_fel_crystal; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp new file mode 100644 index 00000000000..bc8bd5cec30 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.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_Vexallus +SD%Complete: 90 +SDComment: Heroic and Normal support. Needs further testing. +SDCategory: Magister's Terrace +EndScriptData */ + +#include "ScriptedPch.h" +#include "magisters_terrace.h" + +enum eEnums +{ + SAY_AGGRO = -1585007, + SAY_ENERGY = -1585008, + SAY_OVERLOAD = -1585009, + SAY_KILL = -1585010, + EMOTE_DISCHARGE_ENERGY = -1585011, + + //is this text for real? + //#define SAY_DEATH "What...happen...ed." + + //Pure energy spell info + SPELL_ENERGY_BOLT = 46156, + SPELL_ENERGY_FEEDBACK = 44335, + + //Vexallus spell info + SPELL_CHAIN_LIGHTNING = 44318, + SPELL_H_CHAIN_LIGHTNING = 46380, //heroic spell + SPELL_OVERLOAD = 44353, + SPELL_ARCANE_SHOCK = 44319, + SPELL_H_ARCANE_SHOCK = 46381, //heroic spell + + SPELL_SUMMON_PURE_ENERGY = 44322, //mod scale -10 + H_SPELL_SUMMON_PURE_ENERGY1 = 46154, //mod scale -5 + H_SPELL_SUMMON_PURE_ENERGY2 = 46159, //mod scale -5 + + //Creatures + NPC_PURE_ENERGY = 24745, + + INTERVAL_MODIFIER = 15, + INTERVAL_SWITCH = 6 +}; + +struct boss_vexallusAI : public ScriptedAI +{ + boss_vexallusAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint32 ChainLightningTimer; + uint32 ArcaneShockTimer; + uint32 OverloadTimer; + uint32 IntervalHealthAmount; + bool Enraged; + + void Reset() + { + ChainLightningTimer = 8000; + ArcaneShockTimer = 5000; + OverloadTimer = 1200; + IntervalHealthAmount = 1; + Enraged = false; + + if (pInstance) + pInstance->SetData(DATA_VEXALLUS_EVENT, NOT_STARTED); + } + + void KilledUnit(Unit * /*victim*/) + { + DoScriptText(SAY_KILL, me); + } + + void JustDied(Unit * /*victim*/) + { + if (pInstance) + pInstance->SetData(DATA_VEXALLUS_EVENT, DONE); + } + + void EnterCombat(Unit * /*who*/) + { + DoScriptText(SAY_AGGRO, me); + + if (pInstance) + pInstance->SetData(DATA_VEXALLUS_EVENT, IN_PROGRESS); + } + + void JustSummoned(Creature *summoned) + { + if (Unit *temp = SelectUnit(SELECT_TARGET_RANDOM, 0)) + summoned->GetMotionMaster()->MoveFollow(temp,0,0); + + //spells are SUMMON_TYPE_GUARDIAN, so using setOwner should be ok + summoned->CastSpell(summoned,SPELL_ENERGY_BOLT,false,0,0,me->GetGUID()); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (!Enraged) + { + //used for check, when Vexallus cast adds 85%, 70%, 55%, 40%, 25% + if ((me->GetHealth()*100 / me->GetMaxHealth()) <= (100-(INTERVAL_MODIFIER*IntervalHealthAmount))) + { + //increase amount, unless we're at 10%, then we switch and return + if (IntervalHealthAmount == INTERVAL_SWITCH) + { + Enraged = true; + return; + } + else + ++IntervalHealthAmount; + + DoScriptText(SAY_ENERGY, me); + DoScriptText(EMOTE_DISCHARGE_ENERGY, me); + + if (IsHeroic()) + { + DoCast(me, H_SPELL_SUMMON_PURE_ENERGY1, false); + DoCast(me, H_SPELL_SUMMON_PURE_ENERGY2, false); + } + else + DoCast(me, SPELL_SUMMON_PURE_ENERGY, false); + + //below are workaround summons, remove when summoning spells w/implicitTarget 73 implemented in the core + me->SummonCreature(NPC_PURE_ENERGY, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0); + + if (IsHeroic()) + me->SummonCreature(NPC_PURE_ENERGY, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0); + } + + if (ChainLightningTimer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(pTarget, SPELL_CHAIN_LIGHTNING); + + ChainLightningTimer = 8000; + } else ChainLightningTimer -= diff; + + if (ArcaneShockTimer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (pTarget) + DoCast(pTarget, SPELL_ARCANE_SHOCK); + + ArcaneShockTimer = 8000; + } else ArcaneShockTimer -= diff; + } + else + { + if (OverloadTimer <= diff) + { + DoCast(me->getVictim(), SPELL_OVERLOAD); + + OverloadTimer = 2000; + } else OverloadTimer -= diff; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_vexallus(Creature* pCreature) +{ + return new boss_vexallusAI (pCreature); +}; + +struct mob_pure_energyAI : public ScriptedAI +{ + mob_pure_energyAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + + void JustDied(Unit* slayer) + { + if (Unit *temp = me->GetOwner()) + { + if (temp && temp->isAlive()) + slayer->CastSpell(slayer, SPELL_ENERGY_FEEDBACK, true, 0, 0, temp->GetGUID()); + } + } + + void EnterCombat(Unit * /*who*/) {} + void MoveInLineOfSight(Unit * /*who*/) {} + void AttackStart(Unit * /*who*/) {} +}; + +CreatureAI* GetAI_mob_pure_energy(Creature* pCreature) +{ + return new mob_pure_energyAI (pCreature); +}; + +void AddSC_boss_vexallus() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_vexallus"; + newscript->GetAI = &GetAI_boss_vexallus; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_pure_energy"; + newscript->GetAI = &GetAI_mob_pure_energy; + newscript->RegisterSelf(); +} diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp new file mode 100644 index 00000000000..455c03739bc --- /dev/null +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.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: Instance_Magisters_Terrace +SD%Complete: 60 +SDComment: Designed only for Selin Fireheart +SDCategory: Magister's Terrace +EndScriptData */ + +#include "ScriptedPch.h" +#include "magisters_terrace.h" + +#define MAX_ENCOUNTER 4 + +/* +0 - Selin Fireheart +1 - Vexallus +2 - Priestess Delrissa +3 - Kael'thas Sunstrider +*/ + +struct instance_magisters_terrace : public ScriptedInstance +{ + instance_magisters_terrace(Map* pMap) : ScriptedInstance(pMap) {Initialize();} + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + uint32 DelrissaDeathCount; + + std::list FelCrystals; + std::list::const_iterator CrystalItr; + + uint64 SelinGUID; + uint64 DelrissaGUID; + uint64 VexallusDoorGUID; + uint64 SelinDoorGUID; + uint64 SelinEncounterDoorGUID; + uint64 DelrissaDoorGUID; + uint64 KaelDoorGUID; + uint64 KaelStatue[2]; + + bool InitializedItr; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + FelCrystals.clear(); + + DelrissaDeathCount = 0; + + SelinGUID = 0; + DelrissaGUID = 0; + VexallusDoorGUID = 0; + SelinDoorGUID = 0; + SelinEncounterDoorGUID = 0; + DelrissaDoorGUID = 0; + KaelDoorGUID = 0; + KaelStatue[0] = 0; + KaelStatue[1] = 0; + + InitializedItr = false; + } + + bool IsEncounterInProgress() const + { + for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) + return true; + return false; + } + + uint32 GetData(uint32 identifier) + { + switch(identifier) + { + case DATA_SELIN_EVENT: return m_auiEncounter[0]; + case DATA_VEXALLUS_EVENT: return m_auiEncounter[1]; + case DATA_DELRISSA_EVENT: return m_auiEncounter[2]; + case DATA_KAELTHAS_EVENT: return m_auiEncounter[3]; + case DATA_DELRISSA_DEATH_COUNT: return DelrissaDeathCount; + case DATA_FEL_CRYSTAL_SIZE: return FelCrystals.size(); + } + return 0; + } + + void SetData(uint32 identifier, uint32 data) + { + switch(identifier) + { + case DATA_SELIN_EVENT: m_auiEncounter[0] = data; break; + case DATA_VEXALLUS_EVENT: + if (data == DONE) + DoUseDoorOrButton(VexallusDoorGUID); + m_auiEncounter[1] = data; + break; + case DATA_DELRISSA_EVENT: + if (data == DONE) + DoUseDoorOrButton(DelrissaDoorGUID); + if (data == IN_PROGRESS) + DelrissaDeathCount = 0; + m_auiEncounter[2] = data; + break; + case DATA_KAELTHAS_EVENT: m_auiEncounter[3] = data; break; + + case DATA_DELRISSA_DEATH_COUNT: + if (data == SPECIAL) + ++DelrissaDeathCount; + else + DelrissaDeathCount = 0; + break; + } + } + + void OnCreatureCreate(Creature* pCreature, bool /*add*/) + { + switch(pCreature->GetEntry()) + { + case 24723: SelinGUID = pCreature->GetGUID(); break; + case 24560: DelrissaGUID = pCreature->GetGUID(); break; + case 24722: FelCrystals.push_back(pCreature->GetGUID()); break; + } + } + + void OnGameObjectCreate(GameObject* pGo, bool /*add*/) + { + switch(pGo->GetEntry()) + { + case 187896: VexallusDoorGUID = pGo->GetGUID(); break; + //SunwellRaid Gate 02 + case 187979: SelinDoorGUID = pGo->GetGUID(); break; + //Assembly Chamber Door + case 188065: SelinEncounterDoorGUID = pGo->GetGUID(); break; + case 187770: DelrissaDoorGUID = pGo->GetGUID(); break; + case 188064: KaelDoorGUID = pGo->GetGUID(); break; + case 188165: KaelStatue[0] = pGo->GetGUID(); break; + case 188166: KaelStatue[1] = pGo->GetGUID(); break; + } + } + + uint64 GetData64(uint32 identifier) + { + switch(identifier) + { + case DATA_SELIN: return SelinGUID; + case DATA_DELRISSA: return DelrissaGUID; + case DATA_VEXALLUS_DOOR: return VexallusDoorGUID; + case DATA_SELIN_DOOR: return SelinDoorGUID; + case DATA_SELIN_ENCOUNTER_DOOR: return SelinEncounterDoorGUID; + case DATA_DELRISSA_DOOR: return DelrissaDoorGUID; + case DATA_KAEL_DOOR: return KaelDoorGUID; + case DATA_KAEL_STATUE_LEFT: return KaelStatue[0]; + case DATA_KAEL_STATUE_RIGHT: return KaelStatue[1]; + + case DATA_FEL_CRYSTAL: + { + if (FelCrystals.empty()) + { + error_log("TSCR: Magisters Terrace: No Fel Crystals loaded in Inst Data"); + return 0; + } + + if (!InitializedItr) + { + CrystalItr = FelCrystals.begin(); + InitializedItr = true; + } + + uint64 guid = *CrystalItr; + ++CrystalItr; + return guid; + } + } + return 0; + } +}; + +InstanceData* GetInstanceData_instance_magisters_terrace(Map* pMap) +{ + return new instance_magisters_terrace(pMap); +} + +void AddSC_instance_magisters_terrace() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "instance_magisters_terrace"; + newscript->GetInstanceData = &GetInstanceData_instance_magisters_terrace; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.cpp new file mode 100644 index 00000000000..e46da9cb1bf --- /dev/null +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.cpp @@ -0,0 +1,174 @@ +/* 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: Magisters_Terrace +SD%Complete: 100 +SDComment: Quest support: 11490(post-event) +SDCategory: Magisters Terrace +EndScriptData */ + +/* ContentData +npc_kalecgos +EndContentData */ + +#include "ScriptedPch.h" + +/*###### +## npc_kalecgos +######*/ + +enum eEnums +{ + SPELL_TRANSFORM_TO_KAEL = 44670, + SPELL_ORB_KILL_CREDIT = 46307, + NPC_KAEL = 24848, //human form entry + POINT_ID_LAND = 1 +}; + +const float afKaelLandPoint[] = {225.045, -276.236, -5.434}; + +#define GOSSIP_ITEM_KAEL_1 "Who are you?" +#define GOSSIP_ITEM_KAEL_2 "What can we do to assist you?" +#define GOSSIP_ITEM_KAEL_3 "What brings you to the Sunwell?" +#define GOSSIP_ITEM_KAEL_4 "You're not alone here?" +#define GOSSIP_ITEM_KAEL_5 "What would Kil'jaeden want with a mortal woman?" + +// This is friendly keal that appear after used Orb. +// If we assume DB handle summon, summon appear somewhere outside the platform where Orb is +struct npc_kalecgosAI : public ScriptedAI +{ + npc_kalecgosAI(Creature* pCreature) : ScriptedAI(pCreature) {} + + uint32 m_uiTransformTimer; + + void Reset() + { + m_uiTransformTimer = 0; + + // we must assume he appear as dragon somewhere outside the platform of orb, and then move directly to here + if (me->GetEntry() != NPC_KAEL) + me->GetMotionMaster()->MovePoint(POINT_ID_LAND, afKaelLandPoint[0], afKaelLandPoint[1], afKaelLandPoint[2]); + } + + void MovementInform(uint32 uiType, uint32 uiPointId) + { + if (uiType != POINT_MOTION_TYPE) + return; + + if (uiPointId == POINT_ID_LAND) + m_uiTransformTimer = MINUTE*IN_MILISECONDS; + } + + // some targeting issues with the spell, so use this workaround as temporary solution + void DoWorkaroundForQuestCredit() + { + Map* pMap = me->GetMap(); + + if (!pMap || pMap->IsHeroic()) + return; + + Map::PlayerList const &lList = pMap->GetPlayers(); + + if (lList.isEmpty()) + return; + + SpellEntry const* pSpell = GetSpellStore()->LookupEntry(SPELL_ORB_KILL_CREDIT); + + for (Map::PlayerList::const_iterator i = lList.begin(); i != lList.end(); ++i) + { + if (Player* pPlayer = i->getSource()) + { + if (pSpell && pSpell->EffectMiscValue[0]) + pPlayer->KilledMonsterCredit(pSpell->EffectMiscValue[0], 0); + } + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (m_uiTransformTimer) + { + if (m_uiTransformTimer <= uiDiff) + { + DoCast(me, SPELL_ORB_KILL_CREDIT, false); + DoWorkaroundForQuestCredit(); + + // Transform and update entry, now ready for quest/read gossip + DoCast(me, SPELL_TRANSFORM_TO_KAEL, false); + me->UpdateEntry(NPC_KAEL); + + m_uiTransformTimer = 0; + } else m_uiTransformTimer -= uiDiff; + } + } +}; + +CreatureAI* GetAI_npc_kalecgos(Creature* pCreature) +{ + return new npc_kalecgosAI(pCreature); +} + +bool GossipHello_npc_kalecgos(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAEL_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + pPlayer->SEND_GOSSIP_MENU(12498, pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_kalecgos(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAEL_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + pPlayer->SEND_GOSSIP_MENU(12500, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAEL_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + pPlayer->SEND_GOSSIP_MENU(12502, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAEL_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + pPlayer->SEND_GOSSIP_MENU(12606, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAEL_5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); + pPlayer->SEND_GOSSIP_MENU(12607, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+4: + pPlayer->SEND_GOSSIP_MENU(12608, pCreature->GetGUID()); + break; + } + + return true; +} + +void AddSC_magisters_terrace() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_kalecgos"; + newscript->GetAI = &GetAI_npc_kalecgos; + newscript->pGossipHello = &GossipHello_npc_kalecgos; + newscript->pGossipSelect = &GossipSelect_npc_kalecgos; + newscript->RegisterSelf(); +} diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.h b/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.h new file mode 100644 index 00000000000..d6419ea409c --- /dev/null +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.h @@ -0,0 +1,31 @@ +/* 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_MAGISTERS_TERRACE_H +#define DEF_MAGISTERS_TERRACE_H + +#define DATA_SELIN_EVENT 1 +#define DATA_VEXALLUS_EVENT 2 +#define DATA_DELRISSA_EVENT 3 +#define DATA_KAELTHAS_EVENT 4 + +#define DATA_SELIN 5 +#define DATA_FEL_CRYSTAL 6 +#define DATA_FEL_CRYSTAL_SIZE 7 + +#define DATA_VEXALLUS_DOOR 8 +#define DATA_SELIN_DOOR 9 +#define DATA_DELRISSA 10 +#define DATA_DELRISSA_DOOR 11 +#define DATA_SELIN_ENCOUNTER_DOOR 12 + +#define DATA_KAEL_DOOR 13 +#define DATA_KAEL_STATUE_LEFT 14 +#define DATA_KAEL_STATUE_RIGHT 15 + +#define DATA_DELRISSA_DEATH_COUNT 16 + +#define ERROR_INST_DATA "TSCR Error: Instance Data not set properly for Magister's Terrace instance (map 585). Encounters will be buggy." +#endif + diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_baron_geddon.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_baron_geddon.cpp new file mode 100644 index 00000000000..77c6fafa10a --- /dev/null +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_baron_geddon.cpp @@ -0,0 +1,107 @@ +/* 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_Baron_Geddon +SD%Complete: 100 +SDComment: +SDCategory: Molten Core +EndScriptData */ + +#include "ScriptedPch.h" + +#define EMOTE_SERVICE -1409000 + +#define SPELL_INFERNO 19695 +#define SPELL_IGNITEMANA 19659 +#define SPELL_LIVINGBOMB 20475 +#define SPELL_ARMAGEDDOM 20479 + +struct boss_baron_geddonAI : public ScriptedAI +{ + boss_baron_geddonAI(Creature *c) : ScriptedAI(c) {} + + uint32 Inferno_Timer; + uint32 IgniteMana_Timer; + uint32 LivingBomb_Timer; + + void Reset() + { + Inferno_Timer = 45000; //These times are probably wrong + IgniteMana_Timer = 30000; + LivingBomb_Timer = 35000; + } + + void EnterCombat(Unit * /*who*/) + { + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //If we are <2% hp cast Armageddom + if (me->GetHealth()*100 / me->GetMaxHealth() <= 2) + { + me->InterruptNonMeleeSpells(true); + DoCast(me, SPELL_ARMAGEDDOM); + DoScriptText(EMOTE_SERVICE, me); + return; + } + + //Inferno_Timer + if (Inferno_Timer <= diff) + { + DoCast(me, SPELL_INFERNO); + Inferno_Timer = 45000; + } else Inferno_Timer -= diff; + + //IgniteMana_Timer + if (IgniteMana_Timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(pTarget, SPELL_IGNITEMANA); + + IgniteMana_Timer = 30000; + } else IgniteMana_Timer -= diff; + + //LivingBomb_Timer + if (LivingBomb_Timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(pTarget, SPELL_LIVINGBOMB); + + LivingBomb_Timer = 35000; + } else LivingBomb_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_baron_geddon(Creature* pCreature) +{ + return new boss_baron_geddonAI (pCreature); +} + +void AddSC_boss_baron_geddon() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_baron_geddon"; + newscript->GetAI = &GetAI_boss_baron_geddon; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_garr.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_garr.cpp new file mode 100644 index 00000000000..75891cf8c43 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_garr.cpp @@ -0,0 +1,143 @@ +/* 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_Garr +SD%Complete: 50 +SDComment: Adds NYI +SDCategory: Molten Core +EndScriptData */ + +#include "ScriptedPch.h" + +// Garr spells +#define SPELL_ANTIMAGICPULSE 19492 +#define SPELL_MAGMASHACKLES 19496 +#define SPELL_ENRAGE 19516 //Stacking enrage (stacks to 10 times) + +//Add spells +#define SPELL_ERUPTION 19497 +#define SPELL_IMMOLATE 20294 + +struct boss_garrAI : public ScriptedAI +{ + boss_garrAI(Creature *c) : ScriptedAI(c) {} + + uint32 AntiMagicPulse_Timer; + uint32 MagmaShackles_Timer; + uint32 CheckAdds_Timer; + uint64 Add[8]; + bool Enraged[8]; + + void Reset() + { + AntiMagicPulse_Timer = 25000; //These times are probably wrong + MagmaShackles_Timer = 15000; + CheckAdds_Timer = 2000; + } + + void EnterCombat(Unit * /*who*/) + { + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //AntiMagicPulse_Timer + if (AntiMagicPulse_Timer <= diff) + { + DoCast(me, SPELL_ANTIMAGICPULSE); + AntiMagicPulse_Timer = 10000 + rand()%5000; + } else AntiMagicPulse_Timer -= diff; + + //MagmaShackles_Timer + if (MagmaShackles_Timer <= diff) + { + DoCast(me, SPELL_MAGMASHACKLES); + MagmaShackles_Timer = 8000 + rand()%4000; + } else MagmaShackles_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct mob_fireswornAI : public ScriptedAI +{ + mob_fireswornAI(Creature *c) : ScriptedAI(c) {} + + uint32 Immolate_Timer; + + void Reset() + { + Immolate_Timer = 4000; //These times are probably wrong + } + + void EnterCombat(Unit * /*who*/) + { + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //Immolate_Timer + if (Immolate_Timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(pTarget, SPELL_IMMOLATE); + + Immolate_Timer = urand(5000,10000); + } else Immolate_Timer -= diff; + + //Cast Erruption and let them die + if (me->GetHealth() <= me->GetMaxHealth() * 0.10) + { + DoCast(me->getVictim(), SPELL_ERUPTION); + me->setDeathState(JUST_DIED); + me->RemoveCorpse(); + } + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_garr(Creature* pCreature) +{ + return new boss_garrAI (pCreature); +} + +CreatureAI* GetAI_mob_firesworn(Creature* pCreature) +{ + return new mob_fireswornAI (pCreature); +} + +void AddSC_boss_garr() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_garr"; + newscript->GetAI = &GetAI_boss_garr; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_firesworn"; + newscript->GetAI = &GetAI_mob_firesworn; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_gehennas.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_gehennas.cpp new file mode 100644 index 00000000000..9ebe69c0c4e --- /dev/null +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_gehennas.cpp @@ -0,0 +1,93 @@ +/* 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_Gehennas +SD%Complete: 90 +SDComment: Adds MC NYI +SDCategory: Molten Core +EndScriptData */ + +#include "ScriptedPch.h" + +#define SPELL_SHADOWBOLT 19728 +#define SPELL_RAINOFFIRE 19717 +#define SPELL_GEHENNASCURSE 19716 + +struct boss_gehennasAI : public ScriptedAI +{ + boss_gehennasAI(Creature *c) : ScriptedAI(c) {} + + uint32 ShadowBolt_Timer; + uint32 RainOfFire_Timer; + uint32 GehennasCurse_Timer; + + void Reset() + { + ShadowBolt_Timer = 6000; + RainOfFire_Timer = 10000; + GehennasCurse_Timer = 12000; + } + + void EnterCombat(Unit * /*who*/) {} + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //ShadowBolt_Timer + if (ShadowBolt_Timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1)) + DoCast(pTarget, SPELL_SHADOWBOLT); + + ShadowBolt_Timer = 7000; + } else ShadowBolt_Timer -= diff; + + //RainOfFire_Timer + if (RainOfFire_Timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(pTarget, SPELL_RAINOFFIRE); + + RainOfFire_Timer = urand(4000,12000); + } else RainOfFire_Timer -= diff; + + //GehennasCurse_Timer + if (GehennasCurse_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_GEHENNASCURSE); + GehennasCurse_Timer = urand(22000,30000); + } else GehennasCurse_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_gehennas(Creature* pCreature) +{ + return new boss_gehennasAI (pCreature); +} + +void AddSC_boss_gehennas() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_gehennas"; + newscript->GetAI = &GetAI_boss_gehennas; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_golemagg.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_golemagg.cpp new file mode 100644 index 00000000000..2aba378d399 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_golemagg.cpp @@ -0,0 +1,198 @@ +/* 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_Golemagg +SD%Complete: 90 +SDComment: Timers need to be confirmed, Golemagg's Trust need to be checked +SDCategory: Molten Core +EndScriptData */ + +#include "ScriptedPch.h" +#include "molten_core.h" + +enum eEnums +{ + SPELL_MAGMASPLASH = 13879, + SPELL_PYROBLAST = 20228, + SPELL_EARTHQUAKE = 19798, + SPELL_ENRAGE = 19953, + SPELL_GOLEMAGG_TRUST = 20553, + + // Core Rager + EMOTE_LOWHP = -1409002, + SPELL_MANGLE = 19820 +}; + +struct boss_golemaggAI : public ScriptedAI +{ + boss_golemaggAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = pCreature->GetInstanceData(); + } + + ScriptedInstance* m_pInstance; + + uint32 m_uiPyroblastTimer; + uint32 m_uiEarthquakeTimer; + uint32 m_uiBuffTimer; + bool m_bEnraged; + + void Reset() + { + m_uiPyroblastTimer = 7*IN_MILISECONDS; // These timers are probably wrong + m_uiEarthquakeTimer = 3*IN_MILISECONDS; + m_uiBuffTimer = 2.5*IN_MILISECONDS; + m_bEnraged = false; + + DoCast(me, SPELL_MAGMASPLASH, true); + } + + void JustDied(Unit* /*pKiller*/) + { + if (m_pInstance) + m_pInstance->SetData(DATA_GOLEMAGG_DEATH, 0); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!UpdateVictim()) + return; + + //Pyroblast + if (m_uiPyroblastTimer <= uiDiff) + { + if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(pTarget, SPELL_PYROBLAST); + + m_uiPyroblastTimer = 7*IN_MILISECONDS; + } + else + m_uiPyroblastTimer -= uiDiff; + + // Enrage + if (!m_bEnraged && me->GetHealth()*100 < me->GetMaxHealth()*10) + { + DoCast(me, SPELL_ENRAGE); + m_bEnraged = true; + } + + // Earthquake + if (m_bEnraged) + { + if (m_uiEarthquakeTimer <= uiDiff) + { + DoCast(me->getVictim(), SPELL_EARTHQUAKE); + m_uiEarthquakeTimer = 3*IN_MILISECONDS; + } + else + m_uiEarthquakeTimer -= uiDiff; + } + + /* + // Golemagg's Trust + if (m_uiBuffTimer <= uidiff) + { + DoCast(me, SPELL_GOLEMAGG_TRUST); + m_uiBuffTimer = 2.5*IN_MILISECONDS; + } + else + m_uiBuffTimer -= uiDiff; + */ + + DoMeleeAttackIfReady(); + } +}; + +struct mob_core_ragerAI : public ScriptedAI +{ + mob_core_ragerAI(Creature *c) : ScriptedAI(c) + { + m_pInstance = c->GetInstanceData(); + } + + ScriptedInstance* m_pInstance; + + uint32 m_uiMangleTimer; + + void Reset() + { + m_uiMangleTimer = 7*IN_MILISECONDS; // These times are probably wrong + } + + void DamageTaken(Unit* /*pDoneBy*/, uint32& uiDamage) + { + if (me->GetHealth()*100 < me->GetMaxHealth()*50) + { + if (m_pInstance) + { + if (Creature* pGolemagg = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_GOLEMAGG))) + { + if (pGolemagg->isAlive()) + { + DoScriptText(EMOTE_LOWHP, me); + me->SetHealth(me->GetMaxHealth()); + } + else + uiDamage = me->GetHealth(); + } + } + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (!UpdateVictim()) + return; + + // Mangle + if (m_uiMangleTimer <= uiDiff) + { + DoCast(me->getVictim(), SPELL_MANGLE); + m_uiMangleTimer = 10*IN_MILISECONDS; + } + else + m_uiMangleTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_golemagg(Creature* pCreature) +{ + return new boss_golemaggAI (pCreature); +} + +CreatureAI* GetAI_mob_core_rager(Creature* pCreature) +{ + return new mob_core_ragerAI (pCreature); +} + +void AddSC_boss_golemagg() +{ + Script* newscript; + + newscript = new Script; + newscript->Name = "boss_golemagg"; + newscript->GetAI = &GetAI_boss_golemagg; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_core_rager"; + newscript->GetAI = &GetAI_mob_core_rager; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_lucifron.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_lucifron.cpp new file mode 100644 index 00000000000..50601f04147 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_lucifron.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: Boss_Lucifron +SD%Complete: 100 +SDComment: +SDCategory: Molten Core +EndScriptData */ + +#include "ScriptedPch.h" + +#define SPELL_IMPENDINGDOOM 19702 +#define SPELL_LUCIFRONCURSE 19703 +#define SPELL_SHADOWSHOCK 20603 + +struct boss_lucifronAI : public ScriptedAI +{ + boss_lucifronAI(Creature *c) : ScriptedAI(c) {} + + uint32 ImpendingDoom_Timer; + uint32 LucifronCurse_Timer; + uint32 ShadowShock_Timer; + + void Reset() + { + ImpendingDoom_Timer = 10000; //Initial cast after 10 seconds so the debuffs alternate + LucifronCurse_Timer = 20000; //Initial cast after 20 seconds + ShadowShock_Timer = 6000; //6 seconds + } + + void EnterCombat(Unit * /*who*/) + { + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //Impending doom timer + if (ImpendingDoom_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_IMPENDINGDOOM); + ImpendingDoom_Timer = 20000; + } else ImpendingDoom_Timer -= diff; + + //Lucifron's curse timer + if (LucifronCurse_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_LUCIFRONCURSE); + LucifronCurse_Timer = 15000; + } else LucifronCurse_Timer -= diff; + + //Shadowshock + if (ShadowShock_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_SHADOWSHOCK); + ShadowShock_Timer = 6000; + } else ShadowShock_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_lucifron(Creature* pCreature) +{ + return new boss_lucifronAI (pCreature); +} + +void AddSC_boss_lucifron() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_lucifron"; + newscript->GetAI = &GetAI_boss_lucifron; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_magmadar.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_magmadar.cpp new file mode 100644 index 00000000000..f612003b076 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_magmadar.cpp @@ -0,0 +1,100 @@ +/* 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_Magmadar +SD%Complete: 75 +SDComment: Conflag on ground nyi, fear causes issues without VMAPs +SDCategory: Molten Core +EndScriptData */ + +#include "ScriptedPch.h" + +#define EMOTE_FRENZY -1409001 + +#define SPELL_FRENZY 19451 +#define SPELL_MAGMASPIT 19449 //This is actually a buff he gives himself +#define SPELL_PANIC 19408 +#define SPELL_LAVABOMB 19411 //This calls a dummy server side effect that isn't implemented yet +#define SPELL_LAVABOMB_ALT 19428 //This is the spell that the lava bomb casts + +struct boss_magmadarAI : public ScriptedAI +{ + boss_magmadarAI(Creature *c) : ScriptedAI(c) {} + + uint32 Frenzy_Timer; + uint32 Panic_Timer; + uint32 Lavabomb_Timer; + + void Reset() + { + Frenzy_Timer = 30000; + Panic_Timer = 20000; + Lavabomb_Timer = 12000; + + DoCast(me, SPELL_MAGMASPIT, true); + } + + void EnterCombat(Unit * /*who*/) + { + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //Frenzy_Timer + if (Frenzy_Timer <= diff) + { + DoScriptText(EMOTE_FRENZY, me); + DoCast(me, SPELL_FRENZY); + Frenzy_Timer = 15000; + } else Frenzy_Timer -= diff; + + //Panic_Timer + if (Panic_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_PANIC); + Panic_Timer = 35000; + } else Panic_Timer -= diff; + + //Lavabomb_Timer + if (Lavabomb_Timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(pTarget, SPELL_LAVABOMB_ALT); + + Lavabomb_Timer = 12000; + } else Lavabomb_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_magmadar(Creature* pCreature) +{ + return new boss_magmadarAI (pCreature); +} + +void AddSC_boss_magmadar() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_magmadar"; + newscript->GetAI = &GetAI_boss_magmadar; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_majordomo_executus.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_majordomo_executus.cpp new file mode 100644 index 00000000000..11ae70befcf --- /dev/null +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_majordomo_executus.cpp @@ -0,0 +1,134 @@ +/* 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_Majordomo_Executus +SD%Complete: 30 +SDComment: Correct spawning and Event NYI +SDCategory: Molten Core +EndScriptData */ + +#include "ScriptedPch.h" + +#define SAY_AGGRO -1409003 +#define SAY_SPAWN -1409004 +#define SAY_SLAY -1409005 +#define SAY_SPECIAL -1409006 +#define SAY_DEFEAT -1409007 + +#define SAY_SUMMON_MAJ -1409008 +#define SAY_ARRIVAL1_RAG -1409009 +#define SAY_ARRIVAL2_MAJ -1409010 +#define SAY_ARRIVAL3_RAG -1409011 +#define SAY_ARRIVAL5_RAG -1409012 + +#define SPAWN_RAG_X 838.51 +#define SPAWN_RAG_Y -829.84 +#define SPAWN_RAG_Z -232.00 +#define SPAWN_RAG_O 1.70 + +#define SPELL_MAGIC_REFLECTION 20619 +#define SPELL_DAMAGE_REFLECTION 21075 + +#define SPELL_BLASTWAVE 20229 +#define SPELL_AEGIS 20620 //This is self casted whenever we are below 50% +#define SPELL_TELEPORT 20618 +#define SPELL_SUMMON_RAGNAROS 19774 + +#define ENTRY_FLAMEWALKER_HEALER 11663 +#define ENTRY_FLAMEWALKER_ELITE 11664 + +struct boss_majordomoAI : public ScriptedAI +{ + boss_majordomoAI(Creature *c) : ScriptedAI(c) {} + + uint32 MagicReflection_Timer; + uint32 DamageReflection_Timer; + uint32 Blastwave_Timer; + + void Reset() + { + MagicReflection_Timer = 30000; //Damage reflection first so we alternate + DamageReflection_Timer = 15000; + Blastwave_Timer = 10000; + } + + void KilledUnit(Unit* /*victim*/) + { + if (rand()%5) + return; + + DoScriptText(SAY_SLAY, me); + } + + void EnterCombat(Unit * /*who*/) + { + DoScriptText(SAY_AGGRO, me); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //Cast Ageis if less than 50% hp + if (me->GetHealth()*100 / me->GetMaxHealth() < 50) + { + DoCast(me, SPELL_AEGIS); + } + + //MagicReflection_Timer + // if (MagicReflection_Timer <= diff) + // { + // DoCast(me, SPELL_MAGICREFLECTION); + + //60 seconds until we should cast this agian + // MagicReflection_Timer = 30000; + // } else MagicReflection_Timer -= diff; + + //DamageReflection_Timer + // if (DamageReflection_Timer <= diff) + // { + // DoCast(me, SPELL_DAMAGEREFLECTION); + + //60 seconds until we should cast this agian + // DamageReflection_Timer = 30000; + // } else DamageReflection_Timer -= diff; + + //Blastwave_Timer + if (Blastwave_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_BLASTWAVE); + Blastwave_Timer = 10000; + } else Blastwave_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_majordomo(Creature* pCreature) +{ + return new boss_majordomoAI (pCreature); +} + +void AddSC_boss_majordomo() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_majordomo"; + newscript->GetAI = &GetAI_boss_majordomo; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_ragnaros.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_ragnaros.cpp new file mode 100644 index 00000000000..71c0b40de3f --- /dev/null +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_ragnaros.cpp @@ -0,0 +1,297 @@ +/* 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_Ragnaros +SD%Complete: 75 +SDComment: Intro Dialog and event NYI +SDCategory: Molten Core +EndScriptData */ + +#include "ScriptedPch.h" + +#define SAY_REINFORCEMENTS1 -1409013 +#define SAY_REINFORCEMENTS2 -1409014 +#define SAY_HAND -1409015 +#define SAY_WRATH -1409016 +#define SAY_KILL -1409017 +#define SAY_MAGMABURST -1409018 + +#define SPELL_HANDOFRAGNAROS 19780 +#define SPELL_WRATHOFRAGNAROS 20566 +#define SPELL_LAVABURST 21158 + +#define SPELL_MAGMABURST 20565 //Ranged attack + +#define SPELL_SONSOFFLAME_DUMMY 21108 //Server side effect +#define SPELL_RAGSUBMERGE 21107 //Stealth aura +#define SPELL_RAGEMERGE 20568 +#define SPELL_MELTWEAPON 21388 +#define SPELL_ELEMENTALFIRE 20564 +#define SPELL_ERRUPTION 17731 + +#define ADD_1X 848.740356 +#define ADD_1Y -816.103455 +#define ADD_1Z -229.74327 +#define ADD_1O 2.615287 + +#define ADD_2X 852.560791 +#define ADD_2Y -849.861511 +#define ADD_2Z -228.560974 +#define ADD_2O 2.836073 + +#define ADD_3X 808.710632 +#define ADD_3Y -852.845764 +#define ADD_3Z -227.914963 +#define ADD_3O 0.964207 + +#define ADD_4X 786.597107 +#define ADD_4Y -821.132874 +#define ADD_4Z -226.350128 +#define ADD_4O 0.949377 + +#define ADD_5X 796.219116 +#define ADD_5Y -800.948059 +#define ADD_5Z -226.010361 +#define ADD_5O 0.560603 + +#define ADD_6X 821.602539 +#define ADD_6Y -782.744109 +#define ADD_6Z -226.023575 +#define ADD_6O 6.157440 + +#define ADD_7X 844.924744 +#define ADD_7Y -769.453735 +#define ADD_7Z -225.521698 +#define ADD_7O 4.4539958 + +#define ADD_8X 839.823364 +#define ADD_8Y -810.869385 +#define ADD_8Z -229.683182 +#define ADD_8O 4.693108 + +struct boss_ragnarosAI : public ScriptedAI +{ + boss_ragnarosAI(Creature *c) : ScriptedAI(c) + { + SetCombatMovement(false); + } + + uint32 WrathOfRagnaros_Timer; + uint32 HandOfRagnaros_Timer; + uint32 LavaBurst_Timer; + uint32 MagmaBurst_Timer; + uint32 ElementalFire_Timer; + uint32 Erruption_Timer; + uint32 Submerge_Timer; + uint32 Attack_Timer; + + bool HasYelledMagmaBurst; + bool HasSubmergedOnce; + bool WasBanished; + bool HasAura; + + void Reset() + { + WrathOfRagnaros_Timer = 30000; + HandOfRagnaros_Timer = 25000; + LavaBurst_Timer = 10000; + MagmaBurst_Timer = 2000; + Erruption_Timer = 15000; + ElementalFire_Timer = 3000; + Submerge_Timer = 180000; + Attack_Timer = 90000; + HasYelledMagmaBurst = false; + HasSubmergedOnce = false; + WasBanished = false; + + DoCast(me, SPELL_MELTWEAPON, true); + HasAura = true; + } + + void KilledUnit(Unit* /*victim*/) + { + if (rand()%5) + return; + + DoScriptText(SAY_KILL, me); + } + + void EnterCombat(Unit * /*who*/) + { + } + + void UpdateAI(const uint32 diff) + { + if (WasBanished && Attack_Timer <= diff) + { + //Become unbanished again + me->setFaction(14); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + DoCast(me, SPELL_RAGEMERGE); + WasBanished = false; + } else if (WasBanished) + { + Attack_Timer -= diff; + //Do nothing while banished + return; + } + + //Return since we have no target + if (!UpdateVictim()) + return; + + //WrathOfRagnaros_Timer + if (WrathOfRagnaros_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_WRATHOFRAGNAROS); + + if (urand(0,1)) + DoScriptText(SAY_WRATH, me); + + WrathOfRagnaros_Timer = 30000; + } else WrathOfRagnaros_Timer -= diff; + + //HandOfRagnaros_Timer + if (HandOfRagnaros_Timer <= diff) + { + DoCast(me, SPELL_HANDOFRAGNAROS); + + if (urand(0,1)) + DoScriptText(SAY_HAND, me); + + HandOfRagnaros_Timer = 25000; + } else HandOfRagnaros_Timer -= diff; + + //LavaBurst_Timer + if (LavaBurst_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_LAVABURST); + LavaBurst_Timer = 10000; + } else LavaBurst_Timer -= diff; + + //Erruption_Timer + if (LavaBurst_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_ERRUPTION); + Erruption_Timer = urand(20000,45000); + } else Erruption_Timer -= diff; + + //ElementalFire_Timer + if (ElementalFire_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_ELEMENTALFIRE); + ElementalFire_Timer = urand(10000,14000); + } else ElementalFire_Timer -= diff; + + //Submerge_Timer + if (!WasBanished && Submerge_Timer <= diff) + { + //Creature spawning and ragnaros becomming unattackable + //is not very well supported in the core + //so added normaly spawning and banish workaround and attack again after 90 secs. + + me->InterruptNonMeleeSpells(false); + //Root self + DoCast(me, 23973); + me->setFaction(35); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->HandleEmoteCommand(EMOTE_ONESHOT_SUBMERGE); + + if (!HasSubmergedOnce) + { + DoScriptText(SAY_REINFORCEMENTS1, me); + + // summon 10 elementals + for (uint8 i = 0; i < 9; ++i) + { + if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + { + if (Creature* pSummoned = me->SummonCreature(12143,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0.0f,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,900000)) + pSummoned->AI()->AttackStart(pTarget); + } + } + + HasSubmergedOnce = true; + WasBanished = true; + DoCast(me, SPELL_RAGSUBMERGE); + Attack_Timer = 90000; + + } + else + { + DoScriptText(SAY_REINFORCEMENTS2, me); + + for (uint8 i = 0; i < 9; ++i) + { + if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + { + if (Creature* pSummoned = me->SummonCreature(12143,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0.0f,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,900000)) + pSummoned->AI()->AttackStart(pTarget); + } + } + + WasBanished = true; + DoCast(me, SPELL_RAGSUBMERGE); + Attack_Timer = 90000; + } + + Submerge_Timer = 180000; + } else Submerge_Timer -= diff; + + //If we are within range melee the target + if (me->IsWithinMeleeRange(me->getVictim())) + { + //Make sure our attack is ready and we arn't currently casting + if (me->isAttackReady() && !me->IsNonMeleeSpellCasted(false)) + { + me->AttackerStateUpdate(me->getVictim()); + me->resetAttackTimer(); + } + } + else + { + //MagmaBurst_Timer + if (MagmaBurst_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_MAGMABURST); + + if (!HasYelledMagmaBurst) + { + //Say our dialog + DoScriptText(SAY_MAGMABURST, me); + HasYelledMagmaBurst = true; + } + + MagmaBurst_Timer = 2500; + } else MagmaBurst_Timer -= diff; + } + } +}; +CreatureAI* GetAI_boss_ragnaros(Creature* pCreature) +{ + return new boss_ragnarosAI (pCreature); +} + +void AddSC_boss_ragnaros() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_ragnaros"; + newscript->GetAI = &GetAI_boss_ragnaros; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_shazzrah.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_shazzrah.cpp new file mode 100644 index 00000000000..4b0774cdc54 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_shazzrah.cpp @@ -0,0 +1,121 @@ +/* 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_Shazzrah +SD%Complete: 75 +SDComment: Teleport NYI +SDCategory: Molten Core +EndScriptData */ + +#include "ScriptedPch.h" + +#define SPELL_ARCANEEXPLOSION 19712 +#define SPELL_SHAZZRAHCURSE 19713 +#define SPELL_DEADENMAGIC 19714 +#define SPELL_COUNTERSPELL 19715 + +struct boss_shazzrahAI : public ScriptedAI +{ + boss_shazzrahAI(Creature *c) : ScriptedAI(c) {} + + uint32 ArcaneExplosion_Timer; + uint32 ShazzrahCurse_Timer; + uint32 DeadenMagic_Timer; + uint32 Countspell_Timer; + uint32 Blink_Timer; + + void Reset() + { + ArcaneExplosion_Timer = 6000; //These times are probably wrong + ShazzrahCurse_Timer = 10000; + DeadenMagic_Timer = 24000; + Countspell_Timer = 15000; + Blink_Timer = 30000; + } + + void EnterCombat(Unit * /*who*/) + { + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //ArcaneExplosion_Timer + if (ArcaneExplosion_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_ARCANEEXPLOSION); + ArcaneExplosion_Timer = 5000 + rand()%4000; + } else ArcaneExplosion_Timer -= diff; + + //ShazzrahCurse_Timer + if (ShazzrahCurse_Timer <= diff) + { + Unit *pTarget = NULL; + pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); + if (pTarget) DoCast(pTarget, SPELL_SHAZZRAHCURSE); + + ShazzrahCurse_Timer = 25000 + rand()%5000; + } else ShazzrahCurse_Timer -= diff; + + //DeadenMagic_Timer + if (DeadenMagic_Timer <= diff) + { + DoCast(me, SPELL_DEADENMAGIC); + DeadenMagic_Timer = 35000; + } else DeadenMagic_Timer -= diff; + + //Countspell_Timer + if (Countspell_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_COUNTERSPELL); + Countspell_Timer = 16000 + rand()%4000; + } else Countspell_Timer -= diff; + + //Blink_Timer + if (Blink_Timer <= diff) + { + // Teleporting him to a random gamer and casting Arcane Explosion after that. + // Blink is not working cause of LoS System we need to do this hardcoded. + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0, 100, true)) + { + DoTeleportTo(pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ()); + DoCast(pTarget, SPELL_ARCANEEXPLOSION); + DoResetThreat(); + } + + Blink_Timer = 45000; + } else Blink_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_shazzrah(Creature* pCreature) +{ + return new boss_shazzrahAI (pCreature); +} + +void AddSC_boss_shazzrah() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_shazzrah"; + newscript->GetAI = &GetAI_boss_shazzrah; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_sulfuron_harbinger.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_sulfuron_harbinger.cpp new file mode 100644 index 00000000000..83288fe003b --- /dev/null +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_sulfuron_harbinger.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_Sulfuron_Harbringer +SD%Complete: 80 +SDComment: Adds NYI +SDCategory: Molten Core +EndScriptData */ + +#include "ScriptedPch.h" +#include "molten_core.h" + +#define SPELL_DARKSTRIKE 19777 +#define SPELL_DEMORALIZINGSHOUT 19778 +#define SPELL_INSPIRE 19779 +#define SPELL_KNOCKDOWN 19780 +#define SPELL_FLAMESPEAR 19781 + +//Adds Spells +#define SPELL_HEAL 19775 +#define SPELL_SHADOWWORDPAIN 19776 +#define SPELL_IMMOLATE 20294 + +struct boss_sulfuronAI : public ScriptedAI +{ + boss_sulfuronAI(Creature *c) : ScriptedAI(c) {} + + uint32 Darkstrike_Timer; + uint32 DemoralizingShout_Timer; + uint32 Inspire_Timer; + uint32 Knockdown_Timer; + uint32 Flamespear_Timer; + + void Reset() + { + Darkstrike_Timer=10000; //These times are probably wrong + DemoralizingShout_Timer = 15000; + Inspire_Timer = 13000; + Knockdown_Timer = 6000; + Flamespear_Timer = 2000; + } + + void EnterCombat(Unit * /*who*/) + { + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //DemoralizingShout_Timer + if (DemoralizingShout_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_DEMORALIZINGSHOUT); + DemoralizingShout_Timer = 15000 + rand()%5000; + } else DemoralizingShout_Timer -= diff; + + //Inspire_Timer + if (Inspire_Timer <= diff) + { + Creature *pTarget = NULL; + std::list pList = DoFindFriendlyMissingBuff(45.0f,SPELL_INSPIRE); + if (!pList.empty()) + { + std::list::const_iterator i = pList.begin(); + advance(i, (rand()%pList.size())); + pTarget = (*i); + } + + if (pTarget) + DoCast(pTarget, SPELL_INSPIRE); + + DoCast(me, SPELL_INSPIRE); + + Inspire_Timer = 20000 + rand()%6000; + } else Inspire_Timer -= diff; + + //Knockdown_Timer + if (Knockdown_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_KNOCKDOWN); + Knockdown_Timer = 12000 + rand()%3000; + } else Knockdown_Timer -= diff; + + //Flamespear_Timer + if (Flamespear_Timer <= diff) + { + Unit *pTarget = NULL; + pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); + if (pTarget) DoCast(pTarget, SPELL_FLAMESPEAR); + + Flamespear_Timer = 12000 + rand()%4000; + } else Flamespear_Timer -= diff; + + //DarkStrike_Timer + if (Darkstrike_Timer <= diff) + { + DoCast(me, SPELL_DARKSTRIKE); + Darkstrike_Timer = 15000 + rand()%3000; + } else Darkstrike_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct mob_flamewaker_priestAI : public ScriptedAI +{ + mob_flamewaker_priestAI(Creature *c) : ScriptedAI(c) {} + + uint32 Heal_Timer; + uint32 ShadowWordPain_Timer; + uint32 Immolate_Timer; + + void Reset() + { + Heal_Timer = 15000+rand()%15000; + ShadowWordPain_Timer = 2000; + Immolate_Timer = 8000; + } + + void EnterCombat(Unit * /*who*/) + { + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //Casting Heal to Sulfuron or other Guards. + if (Heal_Timer <= diff) + { + Unit* pUnit = DoSelectLowestHpFriendly(60.0f, 1); + if (!pUnit) + return; + + DoCast(pUnit, SPELL_HEAL); + + Heal_Timer = 15000+rand()%5000; + } else Heal_Timer -= diff; + + //ShadowWordPain_Timer + if (ShadowWordPain_Timer <= diff) + { + Unit *pTarget = NULL; + pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); + if (pTarget) DoCast(pTarget, SPELL_SHADOWWORDPAIN); + + ShadowWordPain_Timer = 18000+rand()%8000; + } else ShadowWordPain_Timer -= diff; + + //Immolate_Timer + if (Immolate_Timer <= diff) + { + Unit *pTarget = NULL; + pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); + if (pTarget) DoCast(pTarget, SPELL_IMMOLATE); + + Immolate_Timer = 15000+rand()%10000; + } else Immolate_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_sulfuron(Creature* pCreature) +{ + return new boss_sulfuronAI (pCreature); +} + +CreatureAI* GetAI_mob_flamewaker_priest(Creature* pCreature) +{ + return new mob_flamewaker_priestAI (pCreature); +} + +void AddSC_boss_sulfuron() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_sulfuron"; + newscript->GetAI = &GetAI_boss_sulfuron; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_flamewaker_priest"; + newscript->GetAI = &GetAI_mob_flamewaker_priest; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/instance_molten_core.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/instance_molten_core.cpp new file mode 100644 index 00000000000..eb79c234134 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/MoltenCore/instance_molten_core.cpp @@ -0,0 +1,266 @@ +/* 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_Molten_Core +SD%Complete: 0 +SDComment: Place Holder +SDCategory: Molten Core +EndScriptData */ + +#include "ScriptedPch.h" +#include "molten_core.h" + +#define MAX_ENCOUNTER 9 + +#define ID_LUCIFRON 12118 +#define ID_MAGMADAR 11982 +#define ID_GEHENNAS 12259 +#define ID_GARR 12057 +#define ID_GEDDON 12056 +#define ID_SHAZZRAH 12264 +#define ID_GOLEMAGG 11988 +#define ID_SULFURON 12098 +#define ID_DOMO 12018 +#define ID_RAGNAROS 11502 +#define ID_FLAMEWAKERPRIEST 11662 + +struct instance_molten_core : public ScriptedInstance +{ + instance_molten_core(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint64 Lucifron, Magmadar, Gehennas, Garr, Geddon, Shazzrah, Sulfuron, Golemagg, Domo, Ragnaros, FlamewakerPriest; + uint64 RuneKoro, RuneZeth, RuneMazj, RuneTheri, RuneBlaz, RuneKress, RuneMohn, m_uiFirelordCacheGUID; + + //If all Bosses are dead. + bool IsBossDied[9]; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + Lucifron = 0; + Magmadar = 0; + Gehennas = 0; + Garr = 0; + Geddon = 0; + Shazzrah = 0; + Sulfuron = 0; + Golemagg = 0; + Domo = 0; + Ragnaros = 0; + FlamewakerPriest = 0; + + RuneKoro = 0; + RuneZeth = 0; + RuneMazj = 0; + RuneTheri = 0; + RuneBlaz = 0; + RuneKress = 0; + RuneMohn = 0; + + m_uiFirelordCacheGUID = 0; + + IsBossDied[0] = false; + IsBossDied[1] = false; + IsBossDied[2] = false; + IsBossDied[3] = false; + IsBossDied[4] = false; + IsBossDied[5] = false; + IsBossDied[6] = false; + + IsBossDied[7] = false; + IsBossDied[8] = false; + } + + bool IsEncounterInProgress() const + { + return false; + }; + + void OnGameObjectCreate(GameObject* pGo, bool /*add*/) + { + switch(pGo->GetEntry()) + { + case 176951: //Sulfuron + RuneKoro = pGo->GetGUID(); + break; + case 176952: //Geddon + RuneZeth = pGo->GetGUID(); + break; + case 176953: //Shazzrah + RuneMazj = pGo->GetGUID(); + break; + case 176954: //Golemagg + RuneTheri = pGo->GetGUID(); + break; + case 176955: //Garr + RuneBlaz = pGo->GetGUID(); + break; + case 176956: //Magmadar + RuneKress = pGo->GetGUID(); + break; + case 176957: //Gehennas + RuneMohn = pGo->GetGUID(); + break; + case 179703: + m_uiFirelordCacheGUID = pGo->GetGUID(); //when majordomo event == DONE DoRespawnGameObject(m_uiFirelordCacheGUID,); + break; + } + } + + void OnCreatureCreate(Creature* pCreature, bool /*add*/) + { + switch (pCreature->GetEntry()) + { + case ID_LUCIFRON: + Lucifron = pCreature->GetGUID(); + break; + + case ID_MAGMADAR: + Magmadar = pCreature->GetGUID(); + break; + + case ID_GEHENNAS: + Gehennas = pCreature->GetGUID(); + break; + + case ID_GARR: + Garr = pCreature->GetGUID(); + break; + + case ID_GEDDON: + Geddon = pCreature->GetGUID(); + break; + + case ID_SHAZZRAH: + Shazzrah = pCreature->GetGUID(); + break; + + case ID_SULFURON: + Sulfuron = pCreature->GetGUID(); + break; + + case ID_GOLEMAGG: + Golemagg = pCreature->GetGUID(); + break; + + case ID_DOMO: + Domo = pCreature->GetGUID(); + break; + + case ID_RAGNAROS: + Ragnaros = pCreature->GetGUID(); + break; + + case ID_FLAMEWAKERPRIEST: + FlamewakerPriest = pCreature->GetGUID(); + break; + } + } + + uint64 GetData64 (uint32 identifier) + { + switch(identifier) + { + case DATA_SULFURON: + return Sulfuron; + case DATA_GOLEMAGG: + return Golemagg; + + case DATA_FLAMEWAKERPRIEST: + return FlamewakerPriest; + } + + return 0; + } + + uint32 GetData(uint32 type) + { + switch(type) + { + case DATA_LUCIFRONISDEAD: + if (IsBossDied[0]) + return 1; + break; + + case DATA_MAGMADARISDEAD: + if (IsBossDied[1]) + return 1; + break; + + case DATA_GEHENNASISDEAD: + if (IsBossDied[2]) + return 1; + break; + + case DATA_GARRISDEAD: + if (IsBossDied[3]) + return 1; + break; + + case DATA_GEDDONISDEAD: + if (IsBossDied[4]) + return 1; + break; + + case DATA_SHAZZRAHISDEAD: + if (IsBossDied[5]) + return 1; + break; + + case DATA_SULFURONISDEAD: + if (IsBossDied[6]) + return 1; + break; + + case DATA_GOLEMAGGISDEAD: + if (IsBossDied[7]) + return 1; + break; + + case DATA_MAJORDOMOISDEAD: + if (IsBossDied[8]) + return 1; + break; + } + + return 0; + } + + void SetData(uint32 type, uint32 /*data*/) + { + if (type == DATA_GOLEMAGG_DEATH) + IsBossDied[7] = true; + } +}; + +InstanceData* GetInstance_instance_molten_core(Map* pMap) +{ + return new instance_molten_core (pMap); +} + +void AddSC_instance_molten_core() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_molten_core"; + newscript->GetInstanceData = &GetInstance_instance_molten_core; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/molten_core.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/molten_core.cpp new file mode 100644 index 00000000000..f8fe5bf1477 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/MoltenCore/molten_core.cpp @@ -0,0 +1,81 @@ +/* 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: Molten_Core +SD%Complete: 100 +SDComment: +SDCategory: Molten Core +EndScriptData */ + +/* ContentData +mob_ancient_core_hound +EndContentData */ + +#include "ScriptedPch.h" +#include "ScriptedSimpleAI.h" + +#define SPELL_CONE_OF_FIRE 19630 +#define SPELL_BITE 19771 + +//Random Debuff (each hound has only one of these) +#define SPELL_GROUND_STOMP 19364 +#define SPELL_ANCIENT_DREAD 19365 +#define SPELL_CAUTERIZING_FLAMES 19366 +#define SPELL_WITHERING_HEAT 19367 +#define SPELL_ANCIENT_DESPAIR 19369 +#define SPELL_ANCIENT_HYSTERIA 19372 + +CreatureAI* GetAI_mob_ancient_core_hound(Creature* pCreature) +{ + SimpleAI *ai = new SimpleAI(pCreature); + + ai->Spell[0].Enabled = true; + ai->Spell[0].Spell_Id = SPELL_CONE_OF_FIRE; + ai->Spell[0].Cooldown = 7000; + ai->Spell[0].First_Cast = 10000; + ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_TARGET; + + uint32 RandDebuff = RAND(SPELL_GROUND_STOMP,SPELL_ANCIENT_DREAD,SPELL_CAUTERIZING_FLAMES, + SPELL_WITHERING_HEAT,SPELL_ANCIENT_DESPAIR,SPELL_ANCIENT_HYSTERIA); + + ai->Spell[1].Enabled = true; + ai->Spell[1].Spell_Id = RandDebuff; + ai->Spell[1].Cooldown = 24000; + ai->Spell[1].First_Cast = 15000; + ai->Spell[1].Cast_Target_Type = CAST_HOSTILE_TARGET; + + ai->Spell[2].Enabled = true; + ai->Spell[2].Spell_Id = SPELL_BITE; + ai->Spell[2].Cooldown = 6000; + ai->Spell[2].First_Cast = 4000; + ai->Spell[2].Cast_Target_Type = CAST_HOSTILE_TARGET; + + ai->EnterEvadeMode(); + + return ai; +} + +void AddSC_molten_core() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "mob_ancient_core_hound"; + newscript->GetAI = &GetAI_mob_ancient_core_hound; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/molten_core.h b/src/server/scripts/EasternKingdoms/MoltenCore/molten_core.h new file mode 100644 index 00000000000..5874d8b9408 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/MoltenCore/molten_core.h @@ -0,0 +1,22 @@ +/* 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_MOLTEN_CORE_H +#define DEF_MOLTEN_CORE_H + +#define DATA_FLAMEWAKERPRIEST 1 +#define DATA_GARRISDEAD 2 +#define DATA_GEDDONISDEAD 3 +#define DATA_GEHENNASISDEAD 4 +#define DATA_GOLEMAGGISDEAD 5 +#define DATA_GOLEMAGG_DEATH 6 +#define DATA_LUCIFRONISDEAD 7 +#define DATA_MAGMADARISDEAD 8 +#define DATA_MAJORDOMOISDEAD 9 +#define DATA_SHAZZRAHISDEAD 10 +#define DATA_SULFURON 11 +#define DATA_SULFURONISDEAD 12 +#define DATA_GOLEMAGG 13 +#endif + diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp new file mode 100644 index 00000000000..bdbf6b7c081 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp @@ -0,0 +1,1079 @@ +/* + * Copyright (C) 2009 Trinity + * + * 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 + */ + +#include "ScriptedPch.h" +#include "Vehicle.h" +#include "ObjectMgr.h" +#include "ScriptedEscortAI.h" + +/*###### +##Quest 12848 +######*/ + +#define GCD_CAST 1 + +enum eDeathKnightSpells +{ + SPELL_SOUL_PRISON_CHAIN_SELF = 54612, + SPELL_SOUL_PRISON_CHAIN = 54613, + SPELL_DK_INITIATE_VISUAL = 51519, + + SPELL_ICY_TOUCH = 52372, + SPELL_PLAGUE_STRIKE = 52373, + SPELL_BLOOD_STRIKE = 52374, + SPELL_DEATH_COIL = 52375 +}; + +#define EVENT_ICY_TOUCH 1 +#define EVENT_PLAGUE_STRIKE 2 +#define EVENT_BLOOD_STRIKE 3 +#define EVENT_DEATH_COIL 4 + +//used by 29519,29520,29565,29566,29567 but signed for 29519 +int32 say_event_start[8] = +{ + -1609000,-1609001,-1609002,-1609003, + -1609004,-1609005,-1609006,-1609007 +}; + +int32 say_event_attack[9] = +{ + -1609008,-1609009,-1609010,-1609011,-1609012, + -1609013,-1609014,-1609015,-1609016 +}; + +uint32 acherus_soul_prison[12] = +{ + 191577, + 191580, + 191581, + 191582, + 191583, + 191584, + 191585, + 191586, + 191587, + 191588, + 191589, + 191590 +}; + +uint32 acherus_unworthy_initiate[5] = +{ + 29519, + 29520, + 29565, + 29566, + 29567 +}; + +enum UnworthyInitiatePhase +{ + PHASE_CHAINED, + PHASE_TO_EQUIP, + PHASE_EQUIPING, + PHASE_TO_ATTACK, + PHASE_ATTACKING, +}; + +struct npc_unworthy_initiateAI : public ScriptedAI +{ + npc_unworthy_initiateAI(Creature *c) : ScriptedAI(c) + { + me->SetReactState(REACT_PASSIVE); + if (!me->GetEquipmentId()) + if (const CreatureInfo *info = GetCreatureInfo(28406)) + if (info->equipmentId) + const_cast(me->GetCreatureInfo())->equipmentId = info->equipmentId; + } + + uint64 playerGUID; + UnworthyInitiatePhase phase; + uint32 wait_timer; + float anchorX, anchorY; + uint64 anchorGUID; + + EventMap events; + + void Reset() + { + anchorGUID = 0; + phase = PHASE_CHAINED; + events.Reset(); + me->setFaction(7); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->SetUInt32Value(UNIT_FIELD_BYTES_1, 8); + me->LoadEquipment(0, true); + } + + void EnterCombat(Unit * /*who*/) + { + events.ScheduleEvent(EVENT_ICY_TOUCH, 1000, GCD_CAST); + events.ScheduleEvent(EVENT_PLAGUE_STRIKE, 3000, GCD_CAST); + events.ScheduleEvent(EVENT_BLOOD_STRIKE, 2000, GCD_CAST); + events.ScheduleEvent(EVENT_DEATH_COIL, 5000, GCD_CAST); + } + + void MovementInform(uint32 type, uint32 id) + { + if (type != POINT_MOTION_TYPE) + return; + + if (id == 1) + { + wait_timer = 5000; + me->CastSpell(me, SPELL_DK_INITIATE_VISUAL, true); + + if (Player* starter = Unit::GetPlayer(playerGUID)) + DoScriptText(say_event_attack[rand()%9], me, starter); + + phase = PHASE_TO_ATTACK; + } + } + + void EventStart(Creature* anchor, Player *pTarget) + { + wait_timer = 5000; + phase = PHASE_TO_EQUIP; + + me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); + me->RemoveAurasDueToSpell(SPELL_SOUL_PRISON_CHAIN_SELF); + me->RemoveAurasDueToSpell(SPELL_SOUL_PRISON_CHAIN); + + float z; + anchor->GetContactPoint(me, anchorX, anchorY, z, 1.0f); + + playerGUID = pTarget->GetGUID(); + DoScriptText(say_event_start[rand()%8], me, pTarget); + } + + void UpdateAI(const uint32 diff); +}; + +CreatureAI* GetAI_npc_unworthy_initiate(Creature* pCreature) +{ + return new npc_unworthy_initiateAI(pCreature); +} + +struct npc_unworthy_initiate_anchorAI : public PassiveAI +{ + npc_unworthy_initiate_anchorAI(Creature *c) : PassiveAI(c), prisonerGUID(0) {} + + uint64 prisonerGUID; + + void SetGUID(const uint64 &guid, int32 /*id*/) + { + if (!prisonerGUID) + prisonerGUID = guid; + } + + uint64 GetGUID(int32 /*id*/) { return prisonerGUID; } +}; + +void npc_unworthy_initiateAI::UpdateAI(const uint32 diff) +{ + switch(phase) + { + case PHASE_CHAINED: + if (!anchorGUID) + { + if (Creature *anchor = me->FindNearestCreature(29521, 30)) + { + anchor->AI()->SetGUID(me->GetGUID()); + anchor->CastSpell(me, SPELL_SOUL_PRISON_CHAIN, true); + anchorGUID = anchor->GetGUID(); + } + else + error_log("npc_unworthy_initiateAI: unable to find anchor!"); + + float dist = 99.0f; + GameObject *prison = NULL; + + for (uint8 i = 0; i < 12; ++i) + { + if (GameObject* temp_prison = me->FindNearestGameObject(acherus_soul_prison[i],30)) + { + if (me->IsWithinDist(temp_prison, dist, false)) + { + dist = me->GetDistance2d(temp_prison); + prison = temp_prison; + } + } + } + + if (prison) + prison->ResetDoorOrButton(); + else + error_log("npc_unworthy_initiateAI: unable to find prison!"); + } + return; + case PHASE_TO_EQUIP: + if (wait_timer) + { + if (wait_timer > diff) + wait_timer -= diff; + else + { + me->GetMotionMaster()->MovePoint(1, anchorX, anchorY, me->GetPositionZ()); + //debug_log("npc_unworthy_initiateAI: move to %f %f %f", anchorX, anchorY, me->GetPositionZ()); + phase = PHASE_EQUIPING; + wait_timer = 0; + } + } + return; + case PHASE_TO_ATTACK: + if (wait_timer) + { + if (wait_timer > diff) + wait_timer -= diff; + else + { + me->setFaction(14); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + phase = PHASE_ATTACKING; + + if (Player *pTarget = Unit::GetPlayer(playerGUID)) + me->AI()->AttackStart(pTarget); + wait_timer = 0; + } + } + return; + case PHASE_ATTACKING: + if (!UpdateVictim()) + return; + + events.Update(diff); + + while (uint32 eventId = events.ExecuteEvent()) + { + switch(eventId) + { + case EVENT_ICY_TOUCH: + DoCast(me->getVictim(), SPELL_ICY_TOUCH); + events.DelayEvents(1000, GCD_CAST); + events.ScheduleEvent(EVENT_ICY_TOUCH, 5000, GCD_CAST); + break; + case EVENT_PLAGUE_STRIKE: + DoCast(me->getVictim(), SPELL_PLAGUE_STRIKE); + events.DelayEvents(1000, GCD_CAST); + events.ScheduleEvent(SPELL_PLAGUE_STRIKE, 5000, GCD_CAST); + break; + case EVENT_BLOOD_STRIKE: + DoCast(me->getVictim(), SPELL_BLOOD_STRIKE); + events.DelayEvents(1000, GCD_CAST); + events.ScheduleEvent(EVENT_BLOOD_STRIKE, 5000, GCD_CAST); + break; + case EVENT_DEATH_COIL: + DoCast(me->getVictim(), SPELL_DEATH_COIL); + events.DelayEvents(1000, GCD_CAST); + events.ScheduleEvent(EVENT_DEATH_COIL, 5000, GCD_CAST); + break; + } + } + + DoMeleeAttackIfReady(); + } +} + +CreatureAI* GetAI_npc_unworthy_initiate_anchor(Creature* pCreature) +{ + return new npc_unworthy_initiate_anchorAI(pCreature); +} + +bool GOHello_go_acherus_soul_prison(Player* pPlayer, GameObject* pGo) +{ + if (Creature *anchor = pGo->FindNearestCreature(29521, 15)) + if (uint64 prisonerGUID = anchor->AI()->GetGUID()) + if (Creature* prisoner = Creature::GetCreature(*pPlayer, prisonerGUID)) + CAST_AI(npc_unworthy_initiateAI, prisoner->AI())->EventStart(anchor, pPlayer); + + return false; +} + +/*###### +## npc_death_knight_initiate +######*/ + +#define GOSSIP_ACCEPT_DUEL "I challenge you, death knight!" + +enum eDuelEnums +{ + SAY_DUEL_A = -1609080, + SAY_DUEL_B = -1609081, + SAY_DUEL_C = -1609082, + SAY_DUEL_D = -1609083, + SAY_DUEL_E = -1609084, + SAY_DUEL_F = -1609085, + SAY_DUEL_G = -1609086, + SAY_DUEL_H = -1609087, + SAY_DUEL_I = -1609088, + + SPELL_DUEL = 52996, + //SPELL_DUEL_TRIGGERED = 52990, + SPELL_DUEL_VICTORY = 52994, + SPELL_DUEL_FLAG = 52991, + + QUEST_DEATH_CHALLENGE = 12733, + FACTION_HOSTILE = 2068 +}; + +int32 m_auiRandomSay[] = +{ + SAY_DUEL_A, SAY_DUEL_B, SAY_DUEL_C, SAY_DUEL_D, SAY_DUEL_E, SAY_DUEL_F, SAY_DUEL_G, SAY_DUEL_H, SAY_DUEL_I +}; + +struct npc_death_knight_initiateAI : public CombatAI +{ + npc_death_knight_initiateAI(Creature* pCreature) : CombatAI(pCreature) + { + m_bIsDuelInProgress = false; + } + + bool lose; + uint64 m_uiDuelerGUID; + uint32 m_uiDuelTimer; + bool m_bIsDuelInProgress; + + void Reset() + { + lose = false; + me->RestoreFaction(); + CombatAI::Reset(); + + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_15); + + m_uiDuelerGUID = 0; + m_uiDuelTimer = 5000; + m_bIsDuelInProgress = false; + } + + void SpellHit(Unit* pCaster, const SpellEntry* pSpell) + { + if (!m_bIsDuelInProgress && pSpell->Id == SPELL_DUEL) + { + m_uiDuelerGUID = pCaster->GetGUID(); + m_bIsDuelInProgress = true; + } + } + + void DamageTaken(Unit* pDoneBy, uint32 &uiDamage) + { + if (m_bIsDuelInProgress && pDoneBy->IsControlledByPlayer()) + { + if (pDoneBy->GetGUID() != m_uiDuelerGUID && pDoneBy->GetOwnerGUID() != m_uiDuelerGUID) // other players cannot help + uiDamage = 0; + else if (uiDamage >= me->GetHealth()) + { + uiDamage = 0; + + if (!lose) + { + pDoneBy->RemoveGameObject(SPELL_DUEL_FLAG, true); + pDoneBy->AttackStop(); + me->CastSpell(pDoneBy, SPELL_DUEL_VICTORY, true); + lose = true; + me->CastSpell(me, 7267, true); + me->RestoreFaction(); + } + } + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (!UpdateVictim()) + { + if (m_bIsDuelInProgress) + { + if (m_uiDuelTimer <= uiDiff) + { + me->setFaction(FACTION_HOSTILE); + + if (Unit* pUnit = Unit::GetUnit(*me, m_uiDuelerGUID)) + AttackStart(pUnit); + } + else + m_uiDuelTimer -= uiDiff; + } + return; + } + + if (m_bIsDuelInProgress) + { + if (lose) + { + if (!me->HasAura(7267)) + EnterEvadeMode(); + return; + } + else if (me->getVictim()->GetTypeId() == TYPEID_PLAYER + && me->getVictim()->GetHealth() * 10 < me->getVictim()->GetMaxHealth()) + { + me->getVictim()->CastSpell(me->getVictim(), 7267, true); // beg + me->getVictim()->RemoveGameObject(SPELL_DUEL_FLAG, true); + EnterEvadeMode(); + return; + } + } + + // TODO: spells + + CombatAI::UpdateAI(uiDiff); + } +}; + +CreatureAI* GetAI_npc_death_knight_initiate(Creature* pCreature) +{ + return new npc_death_knight_initiateAI(pCreature); +} + +bool GossipHello_npc_death_knight_initiate(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetQuestStatus(QUEST_DEATH_CHALLENGE) == QUEST_STATUS_INCOMPLETE && pCreature->GetHealth() == pCreature->GetMaxHealth()) + { + if (pPlayer->GetHealth() * 10 < pPlayer->GetMaxHealth()) + return true; + + if (pPlayer->isInCombat() || pCreature->isInCombat()) + return true; + + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ACCEPT_DUEL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature),pCreature->GetGUID()); + } + return true; +} + +bool GossipSelect_npc_death_knight_initiate(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF) + { + pPlayer->CLOSE_GOSSIP_MENU(); + + if (pPlayer->isInCombat() || pCreature->isInCombat()) + return true; + + if (npc_death_knight_initiateAI* pInitiateAI = CAST_AI(npc_death_knight_initiateAI, pCreature->AI())) + { + if (pInitiateAI->m_bIsDuelInProgress) + return true; + } + + pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_15); + + int32 uiSayId = rand()% (sizeof(m_auiRandomSay)/sizeof(int32)); + DoScriptText(m_auiRandomSay[uiSayId], pCreature, pPlayer); + + pPlayer->CastSpell(pCreature, SPELL_DUEL, false); + pPlayer->CastSpell(pPlayer, SPELL_DUEL_FLAG, true); + } + return true; +} + +/*###### +## npc_dark_rider_of_acherus +######*/ + +#define DESPAWN_HORSE 52267 +#define SAY_DARK_RIDER "The realm of shadows awaits..." + +struct npc_dark_rider_of_acherusAI : public ScriptedAI +{ + npc_dark_rider_of_acherusAI(Creature *c) : ScriptedAI(c) {} + + uint32 PhaseTimer; + uint32 Phase; + bool Intro; + uint64 TargetGUID; + + void Reset() + { + PhaseTimer = 4000; + Phase = 0; + Intro = false; + TargetGUID = 0; + } + + void UpdateAI(const uint32 diff) + { + if (!Intro || !TargetGUID) + return; + + if (PhaseTimer <= diff) + { + switch(Phase) + { + case 0: + me->MonsterSay(SAY_DARK_RIDER, LANG_UNIVERSAL, 0); + PhaseTimer = 5000; + Phase = 1; + break; + case 1: + if (Unit *pTarget = Unit::GetUnit(*me, TargetGUID)) + DoCast(pTarget, DESPAWN_HORSE, true); + PhaseTimer = 3000; + Phase = 2; + break; + case 2: + me->SetVisibility(VISIBILITY_OFF); + PhaseTimer = 2000; + Phase = 3; + break; + case 3: + me->ForcedDespawn(); + break; + default: + break; + } + } else PhaseTimer -= diff; + + } + + void InitDespawnHorse(Unit *who) + { + if (!who) + return; + + TargetGUID = who->GetGUID(); + me->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + me->SetSpeed(MOVE_RUN, 0.4f); + me->GetMotionMaster()->MoveChase(who); + me->SetUInt64Value(UNIT_FIELD_TARGET, TargetGUID); + Intro = true; + } + +}; + +CreatureAI* GetAI_npc_dark_rider_of_acherus(Creature* pCreature) +{ + return new npc_dark_rider_of_acherusAI(pCreature); +} + +/*###### +## npc_salanar_the_horseman +######*/ + +enum eSalanar +{ + REALM_OF_SHADOWS = 52693, + EFFECT_STOLEN_HORSE = 52263, + DELIVER_STOLEN_HORSE = 52264, + CALL_DARK_RIDER = 52266, + SPELL_EFFECT_OVERTAKE = 52349 +}; + +struct npc_salanar_the_horsemanAI : public ScriptedAI +{ + npc_salanar_the_horsemanAI(Creature *c) : ScriptedAI(c) {} + + void SpellHit(Unit *caster, const SpellEntry *spell) + { + if (spell->Id == DELIVER_STOLEN_HORSE) + { + if (caster->GetTypeId() == TYPEID_UNIT && caster->IsVehicle()) + { + if (Unit *charmer = caster->GetCharmer()) + { + charmer->RemoveAurasDueToSpell(EFFECT_STOLEN_HORSE); + caster->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK); + caster->setFaction(35); + DoCast(caster, CALL_DARK_RIDER, true); + if (Creature* Dark_Rider = me->FindNearestCreature(28654, 15)) + CAST_AI(npc_dark_rider_of_acherusAI, Dark_Rider->AI())->InitDespawnHorse(caster); + } + } + } + } + + void MoveInLineOfSight(Unit *who) + { + ScriptedAI::MoveInLineOfSight(who); + + if (who->GetTypeId() == TYPEID_UNIT && who->IsVehicle() && me->IsWithinDistInMap(who, 5.0f)) + { + if (Unit *charmer = who->GetCharmer()) + { + if (charmer->GetTypeId() == TYPEID_PLAYER) + { + // for quest Into the Realm of Shadows(12687) + if (me->GetEntry() == 28788 && CAST_PLR(charmer)->GetQuestStatus(12687) == QUEST_STATUS_INCOMPLETE) + { + CAST_PLR(charmer)->GroupEventHappens(12687, me); + charmer->RemoveAurasDueToSpell(SPELL_EFFECT_OVERTAKE); + CAST_CRE(who)->ForcedDespawn(); + //CAST_CRE(who)->Respawn(true); + } + + if (CAST_PLR(charmer)->HasAura(REALM_OF_SHADOWS)) + charmer->RemoveAurasDueToSpell(REALM_OF_SHADOWS); + } + } + } + } +}; + +CreatureAI* GetAI_npc_salanar_the_horseman(Creature* pCreature) +{ + return new npc_salanar_the_horsemanAI(pCreature); +} + +/*###### +## npc_ros_dark_rider +######*/ + +struct npc_ros_dark_riderAI : public ScriptedAI +{ + npc_ros_dark_riderAI(Creature *c) : ScriptedAI(c) {} + + void EnterCombat(Unit * /*who*/) + { + me->ExitVehicle(); + } + + void Reset() + { + Creature* deathcharger = me->FindNearestCreature(28782, 30); + if (!deathcharger) return; + deathcharger->RestoreFaction(); + deathcharger->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK); + deathcharger->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + if (!me->GetVehicle() && deathcharger->IsVehicle() && deathcharger->GetVehicleKit()->HasEmptySeat(0)) + me->EnterVehicle(deathcharger); + } + + void JustDied(Unit *killer) + { + Creature* deathcharger = me->FindNearestCreature(28782, 30); + if (!deathcharger) return; + if (killer->GetTypeId() == TYPEID_PLAYER && deathcharger->GetTypeId() == TYPEID_UNIT && deathcharger->IsVehicle()) + { + deathcharger->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK); + deathcharger->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + deathcharger->setFaction(2096); + } + } +}; + +CreatureAI* GetAI_npc_ros_dark_rider(Creature* pCreature) +{ + return new npc_ros_dark_riderAI(pCreature); +} + +// correct way: 52312 52314 52555 ... +enum SG +{ + GHOULS = 28845, + GHOSTS = 28846, +}; +struct npc_dkc1_gothikAI : public ScriptedAI +{ + npc_dkc1_gothikAI(Creature *c) : ScriptedAI(c) {} + + void MoveInLineOfSight(Unit *who) + { + ScriptedAI::MoveInLineOfSight(who); + + if (who->GetEntry() == GHOULS && me->IsWithinDistInMap(who, 10.0f)) + { + if (Unit *owner = who->GetOwner()) + { + if (owner->GetTypeId() == TYPEID_PLAYER) + { + if (CAST_PLR(owner)->GetQuestStatus(12698) == QUEST_STATUS_INCOMPLETE) + { + //CAST_CRE(who)->CastSpell(owner, 52517, true); + CAST_PLR(owner)->KilledMonsterCredit(GHOULS, me->GetGUID()); + } + //Todo: Creatures must not be removed, but, must instead + // stand next to Gothik and be commanded into the pit + // and dig into the ground. + CAST_CRE(who)->ForcedDespawn(); + + if (CAST_PLR(owner)->GetQuestStatus(12698) == QUEST_STATUS_COMPLETE) + owner->RemoveAllMinionsByEntry(GHOULS); + } + } + } + } +}; + +CreatureAI* GetAI_npc_dkc1_gothik(Creature* pCreature) +{ + return new npc_dkc1_gothikAI(pCreature); +} + +struct npc_scarlet_ghoulAI : public ScriptedAI +{ + npc_scarlet_ghoulAI(Creature *c) : ScriptedAI(c) + { + // Ghouls should display their Birth Animation + // Crawling out of the ground + //DoCast(me, 35177, true); + //me->MonsterSay("Mommy?",LANG_UNIVERSAL,0); + me->SetReactState(REACT_DEFENSIVE); + } + + void FindMinions(Unit *owner) + { + std::list MinionList; + owner->GetAllMinionsByEntry(MinionList,GHOULS); + + if (!MinionList.empty()) + { + for (std::list::const_iterator itr = MinionList.begin(); itr != MinionList.end(); ++itr) + { + if (CAST_CRE(*itr)->GetOwner()->GetGUID() == me->GetOwner()->GetGUID()) + { + if (CAST_CRE(*itr)->isInCombat() && CAST_CRE(*itr)->getAttackerForHelper()) + { + AttackStart(CAST_CRE(*itr)->getAttackerForHelper()); + } + } + } + } + } + + void UpdateAI(const uint32 /*diff*/) + { + if (!me->isInCombat()) + { + if (Unit *owner = me->GetOwner()) + { + if (owner->GetTypeId() == TYPEID_PLAYER && CAST_PLR(owner)->isInCombat()) + { + if (CAST_PLR(owner)->getAttackerForHelper() && CAST_PLR(owner)->getAttackerForHelper()->GetEntry() == GHOSTS) + { + AttackStart(CAST_PLR(owner)->getAttackerForHelper()); + } + else + { + FindMinions(owner); + } + } + } + } + + if (!UpdateVictim()) + return; + + //ScriptedAI::UpdateAI(diff); + //Check if we have a current target + if (me->getVictim()->GetEntry() == GHOSTS) + { + if (me->isAttackReady()) + { + //If we are within range melee the target + if (me->IsWithinMeleeRange(me->getVictim())) + { + me->AttackerStateUpdate(me->getVictim()); + me->resetAttackTimer(); + } + } + } + } +}; + +CreatureAI* GetAI_npc_scarlet_ghoul(Creature* pCreature) +{ + return new npc_scarlet_ghoulAI(pCreature); +} + +/*#### +## npc_scarlet_miner_cart +####*/ + +#define SPELL_CART_CHECK 54173 +#define SPELL_CART_DRAG 52465 + +struct npc_scarlet_miner_cartAI : public PassiveAI +{ + npc_scarlet_miner_cartAI(Creature *c) : PassiveAI(c), minerGUID(0) + { + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->SetDisplayId(me->GetCreatureInfo()->Modelid1); // H0 is horse + } + + uint64 minerGUID; + + void SetGUID(const uint64 &guid, int32 /*id*/) + { + minerGUID = guid; + } + + void DoAction(const int32 /*param*/) + { + if (Creature *miner = Unit::GetCreature(*me, minerGUID)) + { + // very bad visual effect + me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + //me->SetSpeed(MOVE_WALK, miner->GetSpeed(MOVE_WALK)); + me->SetSpeed(MOVE_RUN, miner->GetSpeed(MOVE_RUN)); + me->GetMotionMaster()->MoveFollow(miner, 1.0f, 0); + } + } + + void PassengerBoarded(Unit * /*who*/, int8 /*seatId*/, bool apply) + { + if (!apply) + if (Creature *miner = Unit::GetCreature(*me, minerGUID)) + miner->DisappearAndDie(); + } +}; + +CreatureAI* GetAI_npc_scarlet_miner_cart(Creature *_Creature) +{ + return new npc_scarlet_miner_cartAI(_Creature); +} + +/*#### +## npc_scarlet_miner +####*/ + +#define SAY_SCARLET_MINER1 "Where'd this come from? I better get this down to the ships before the foreman sees it!" +#define SAY_SCARLET_MINER2 "Now I can have a rest!" + +struct npc_scarlet_minerAI : public npc_escortAI +{ + npc_scarlet_minerAI(Creature *c) : npc_escortAI(c) + { + me->SetReactState(REACT_PASSIVE); + } + + uint32 IntroTimer; + uint32 IntroPhase; + uint64 carGUID; + + void Reset() + { + carGUID = 0; + IntroTimer = 0; + IntroPhase = 0; + } + + void InitWaypoint() + { + AddWaypoint(1, 2389.03, -5902.74, 109.014, 5000); + AddWaypoint(2, 2341.812012, -5900.484863, 102.619743); + AddWaypoint(3, 2306.561279, -5901.738281, 91.792419); + AddWaypoint(4, 2300.098389, -5912.618652, 86.014885); + AddWaypoint(5, 2294.142090, -5927.274414, 75.316849); + AddWaypoint(6, 2286.984375, -5944.955566, 63.714966); + AddWaypoint(7, 2280.001709, -5961.186035, 54.228283); + AddWaypoint(8, 2259.389648, -5974.197754, 42.359348); + AddWaypoint(9, 2242.882812, -5984.642578, 32.827850); + AddWaypoint(10, 2217.265625, -6028.959473, 7.675705); + AddWaypoint(11, 2202.595947, -6061.325684, 5.882018); + AddWaypoint(12, 2188.974609, -6080.866699, 3.370027); + + if (urand(0,1)) + { + AddWaypoint(13, 2176.483887, -6110.407227, 1.855181); + AddWaypoint(14, 2172.516602, -6146.752441, 1.074235); + AddWaypoint(15, 2138.918457, -6158.920898, 1.342926); + AddWaypoint(16, 2129.866699, -6174.107910, 4.380779); + AddWaypoint(17, 2117.709473, -6193.830078, 13.3542, 10000); + } + else + { + AddWaypoint(13, 2184.190186, -6166.447266, 0.968877); + AddWaypoint(14, 2234.265625, -6163.741211, 0.916021); + AddWaypoint(15, 2268.071777, -6158.750977, 1.822252); + AddWaypoint(16, 2270.028320, -6176.505859, 6.340538); + AddWaypoint(17, 2271.739014, -6195.401855, 13.3542, 10000); + } + } + + void InitCartQuest(Player *who) + { + carGUID = who->GetVehicleBase()->GetGUID(); + InitWaypoint(); + Start(false, false, who->GetGUID()); + SetDespawnAtFar(false); + } + + void WaypointReached(uint32 i) + { + switch (i) + { + case 1: + if (Unit *car = Unit::GetCreature(*me, carGUID)) + { + me->SetInFront(car); + me->SendMovementFlagUpdate(); + } + me->MonsterSay(SAY_SCARLET_MINER1,LANG_UNIVERSAL,NULL); + SetRun(true); + IntroTimer = 4000; + IntroPhase = 1; + break; + case 17: + if (Unit *car = Unit::GetCreature(*me, carGUID)) + { + me->SetInFront(car); + me->SendMovementFlagUpdate(); + car->Relocate(car->GetPositionX(), car->GetPositionY(), me->GetPositionZ()); + car->SendMonsterStop(); + //this make player fall under ground, dunno why + //car->GetMotionMaster()->MovePoint(0, car->GetPositionX(), car->GetPositionY(), me->GetPositionZ()); + car->RemoveAura(SPELL_CART_DRAG); + } + me->MonsterSay(SAY_SCARLET_MINER2,LANG_UNIVERSAL,NULL); + break; + default: + break; + } + } + + void UpdateAI(const uint32 diff) + { + if (IntroPhase) + { + if (IntroTimer <= diff) + { + if (IntroPhase == 1) + { + if (Creature *car = Unit::GetCreature(*me, carGUID)) + DoCast(car, SPELL_CART_DRAG); + IntroTimer = 800; + IntroPhase = 2; + } + else + { + if (Creature *car = Unit::GetCreature(*me, carGUID)) + car->AI()->DoAction(); + IntroPhase = 0; + } + } else IntroTimer-=diff; + } + npc_escortAI::UpdateAI(diff); + } +}; + +CreatureAI* GetAI_npc_scarlet_miner(Creature *_Creature) +{ + return new npc_scarlet_minerAI(_Creature); +} + +/*###### +## go_inconspicuous_mine_car +######*/ + +#define SPELL_CART_SUMM 52463 + +bool GOHello_go_inconspicuous_mine_car(Player* pPlayer, GameObject* /*pGO*/) +{ + if (pPlayer->GetQuestStatus(12701) == QUEST_STATUS_INCOMPLETE) + { + // Hack Why Trinity Dont Support Custom Summon Location + if (Creature *miner = pPlayer->SummonCreature(28841, 2383.869629, -5900.312500, 107.996086, pPlayer->GetOrientation(),TEMPSUMMON_DEAD_DESPAWN, 1)) + { + pPlayer->CastSpell(pPlayer, SPELL_CART_SUMM, true); + if (Creature *car = pPlayer->GetVehicleCreatureBase()) + { + if (car->GetEntry() == 28817) + { + car->AI()->SetGUID(miner->GetGUID()); + CAST_AI(npc_scarlet_minerAI, miner->AI())->InitCartQuest(pPlayer); + } else error_log("TSCR: GOHello_go_inconspicuous_mine_car vehicle entry is not correct."); + } else error_log("TSCR: GOHello_go_inconspicuous_mine_car player is not on the vehicle."); + } else error_log("TSCR: GOHello_go_inconspicuous_mine_car Scarlet Miner cant be found by script."); + } + return true; +} + +// npc 28912 quest 17217 boss 29001 mob 29007 go 191092 + +void AddSC_the_scarlet_enclave_c1() +{ + Script *newscript; + + // 12848 The Endless Hunger + newscript = new Script; + newscript->Name = "npc_unworthy_initiate"; + newscript->GetAI = &GetAI_npc_unworthy_initiate; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_unworthy_initiate_anchor"; + newscript->GetAI = &GetAI_npc_unworthy_initiate_anchor; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "go_acherus_soul_prison"; + newscript->pGOHello = &GOHello_go_acherus_soul_prison; + newscript->RegisterSelf(); + + // Death's Challenge + newscript = new Script; + newscript->Name = "npc_death_knight_initiate"; + newscript->GetAI = &GetAI_npc_death_knight_initiate; + newscript->pGossipHello = &GossipHello_npc_death_knight_initiate; + newscript->pGossipSelect = &GossipSelect_npc_death_knight_initiate; + newscript->RegisterSelf(); + + // 12680 Grand Theft Palomino + newscript = new Script; + newscript->Name = "npc_salanar_the_horseman"; + newscript->GetAI = &GetAI_npc_salanar_the_horseman; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_dark_rider_of_acherus"; + newscript->GetAI = &GetAI_npc_dark_rider_of_acherus; + newscript->RegisterSelf(); + + // 12687 Into the Realm of Shadows + newscript = new Script; + newscript->Name = "npc_ros_dark_rider"; + newscript->GetAI = &GetAI_npc_ros_dark_rider; + newscript->RegisterSelf(); + + // 12698 The Gift That Keeps On Giving + newscript = new Script; + newscript->Name = "npc_dkc1_gothik"; + newscript->GetAI = &GetAI_npc_dkc1_gothik; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_scarlet_ghoul"; + newscript->GetAI = &GetAI_npc_scarlet_ghoul; + newscript->RegisterSelf(); + + // Massacre At Light's Point + newscript = new Script; + newscript->Name = "npc_scarlet_miner"; + newscript->GetAI = &GetAI_npc_scarlet_miner; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_scarlet_miner_cart"; + newscript->GetAI = &GetAI_npc_scarlet_miner_cart; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "go_inconspicuous_mine_car"; + newscript->pGOHello = &GOHello_go_inconspicuous_mine_car; + newscript->RegisterSelf(); +} + +/* +DELETE FROM `script_texts` WHERE `entry` IN(-1609301, -1609302); +INSERT INTO `script_texts` (`entry`,`content_default`,`type`,`language`,`emote`,`comment`) VALUES +(-1609301, 'Come, weakling! Strike me down!', 0, 0, 0, 'SAY_DEATH_RIDER_FINAL'), +(-1609302, '%s rears up, beckoning you to ride it.', 2, 0, 0, 'SAY_DEATH_CHARGER'); +*/ diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp new file mode 100644 index 00000000000..91f7e0e6cbe --- /dev/null +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp @@ -0,0 +1,995 @@ +/* + * Copyright (C) 2009 Trinity + * + * 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 + */ + +#include "ScriptedPch.h" +#include "ScriptedEscortAI.h" + +//How to win friends and influence enemies +// texts signed for creature 28939 but used for 28939,28940,28610 +enum win_friends +{ + SAY_PERSUADE1 = -1609501, + SAY_PERSUADE2 = -1609502, + SAY_PERSUADE3 = -1609503, + SAY_PERSUADE4 = -1609504, + SAY_PERSUADE5 = -1609505, + SAY_PERSUADE6 = -1609506, + SAY_PERSUADE7 = -1609507, + SAY_CRUSADER1 = -1609508, + SAY_CRUSADER2 = -1609509, + SAY_CRUSADER3 = -1609510, + SAY_CRUSADER4 = -1609511, + SAY_CRUSADER5 = -1609512, + SAY_CRUSADER6 = -1609513, + SAY_PERSUADED1 = -1609514, + SAY_PERSUADED2 = -1609515, + SAY_PERSUADED3 = -1609516, + SAY_PERSUADED4 = -1609517, + SAY_PERSUADED5 = -1609518, + SAY_PERSUADED6 = -1609519, + SPELL_PERSUASIVE_STRIKE = 52781 +}; + +struct npc_crusade_persuadedAI : public ScriptedAI +{ + npc_crusade_persuadedAI(Creature *pCreature) : ScriptedAI(pCreature) {} + + uint32 uiSpeech_timer; + uint32 uiSpeech_counter; + uint64 uiPlayerGUID; + + void Reset() + { + uiSpeech_timer = 0; + uiSpeech_counter = 0; + uiPlayerGUID = 0; + me->SetReactState(REACT_AGGRESSIVE); + me->RestoreFaction(); + } + + void SpellHit(Unit *caster, const SpellEntry *spell) + { + if (spell->Id == SPELL_PERSUASIVE_STRIKE && caster->GetTypeId() == TYPEID_PLAYER && me->isAlive() && !uiSpeech_counter) + { + if (CAST_PLR(caster)->GetQuestStatus(12720) == QUEST_STATUS_INCOMPLETE) + { + uiPlayerGUID = caster->GetGUID(); + uiSpeech_timer = 1000; + uiSpeech_counter = 1; + me->setFaction(caster->getFaction()); + me->CombatStop(true); + me->GetMotionMaster()->MoveIdle(); + me->SetReactState(REACT_PASSIVE); + DoCastAOE(58111, true); + + DoScriptText(RAND(SAY_PERSUADE1,SAY_PERSUADE2,SAY_PERSUADE3, + SAY_PERSUADE4,SAY_PERSUADE5,SAY_PERSUADE6, + SAY_PERSUADE7), caster); + + DoScriptText(RAND(SAY_CRUSADER1,SAY_CRUSADER2,SAY_CRUSADER3, + SAY_CRUSADER4,SAY_CRUSADER5,SAY_CRUSADER6), me); + } + } + } + + void UpdateAI(const uint32 diff) + { + if (uiSpeech_counter) + { + if (uiSpeech_timer <= diff) + { + Player* pPlayer = Unit::GetPlayer(uiPlayerGUID); + if (!pPlayer) + { + EnterEvadeMode(); + return; + } + + switch(uiSpeech_counter) + { + case 1: DoScriptText(SAY_PERSUADED1, me); uiSpeech_timer = 8000; break; + case 2: DoScriptText(SAY_PERSUADED2, me); uiSpeech_timer = 8000; break; + case 3: DoScriptText(SAY_PERSUADED3, me); uiSpeech_timer = 8000; break; + case 4: DoScriptText(SAY_PERSUADED4, me); uiSpeech_timer = 8000; break; + case 5: DoScriptText(SAY_PERSUADED5, pPlayer); uiSpeech_timer = 8000; break; + case 6: DoScriptText(SAY_PERSUADED6, me); + pPlayer->Kill(me); + //me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + //me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + uiSpeech_counter = 0; + pPlayer->GroupEventHappens(12720, me); + return; + } + + ++uiSpeech_counter; + DoCastAOE(58111, true); + } else uiSpeech_timer -= diff; + + return; + } + + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_npc_crusade_persuaded(Creature* pCreature) +{ + return new npc_crusade_persuadedAI (pCreature); +} + +/*###### +## npc_koltira_deathweaver +######*/ + +enum eKoltira +{ + SAY_BREAKOUT1 = -1609561, + SAY_BREAKOUT2 = -1609562, + SAY_BREAKOUT3 = -1609563, + SAY_BREAKOUT4 = -1609564, + SAY_BREAKOUT5 = -1609565, + SAY_BREAKOUT6 = -1609566, + SAY_BREAKOUT7 = -1609567, + SAY_BREAKOUT8 = -1609568, + SAY_BREAKOUT9 = -1609569, + SAY_BREAKOUT10 = -1609570, + + SPELL_KOLTIRA_TRANSFORM = 52899, + SPELL_ANTI_MAGIC_ZONE = 52894, + + QUEST_BREAKOUT = 12727, + + NPC_CRIMSON_ACOLYTE = 29007, + NPC_HIGH_INQUISITOR_VALROTH = 29001, + NPC_KOLTIRA_ALT = 28447, + + //not sure about this id + //NPC_DEATH_KNIGHT_MOUNT = 29201, + MODEL_DEATH_KNIGHT_MOUNT = 25278 +}; + +struct npc_koltira_deathweaverAI : public npc_escortAI +{ + npc_koltira_deathweaverAI(Creature *pCreature) : npc_escortAI(pCreature) + { + me->SetReactState(REACT_DEFENSIVE); + } + + uint32 m_uiWave; + uint32 m_uiWave_Timer; + uint64 m_uiValrothGUID; + + void Reset() + { + if (!HasEscortState(STATE_ESCORT_ESCORTING)) + { + m_uiWave = 0; + m_uiWave_Timer = 3000; + m_uiValrothGUID = 0; + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + me->LoadEquipment(0, true); + me->RemoveAura(SPELL_ANTI_MAGIC_ZONE); + } + } + + void WaypointReached(uint32 uiPointId) + { + switch(uiPointId) + { + case 0: + DoScriptText(SAY_BREAKOUT1, me); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + break; + case 1: + me->SetStandState(UNIT_STAND_STATE_KNEEL); + break; + case 2: + me->SetStandState(UNIT_STAND_STATE_STAND); + //me->UpdateEntry(NPC_KOLTIRA_ALT); //unclear if we must update or not + DoCast(me, SPELL_KOLTIRA_TRANSFORM); + me->LoadEquipment(me->GetEquipmentId()); + break; + case 3: + SetEscortPaused(true); + me->SetStandState(UNIT_STAND_STATE_KNEEL); + DoScriptText(SAY_BREAKOUT2, me); + DoCast(me, SPELL_ANTI_MAGIC_ZONE); // cast again that makes bubble up + break; + case 4: + SetRun(true); + break; + case 9: + me->Mount(MODEL_DEATH_KNIGHT_MOUNT); + break; + case 10: + me->Unmount(); + break; + } + } + + void JustSummoned(Creature* pSummoned) + { + if (Player* pPlayer = GetPlayerForEscort()) + { + pSummoned->AI()->AttackStart(pPlayer); + } + + if (pSummoned->GetEntry() == NPC_HIGH_INQUISITOR_VALROTH) + m_uiValrothGUID = pSummoned->GetGUID(); + + pSummoned->AddThreat(me, 0.0f); + pSummoned->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + } + + void SummonAcolyte(uint32 uiAmount) + { + for (uint32 i = 0; i < uiAmount; ++i) + me->SummonCreature(NPC_CRIMSON_ACOLYTE, 1642.329, -6045.818, 127.583, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + } + + void UpdateAI(const uint32 uiDiff) + { + npc_escortAI::UpdateAI(uiDiff); + + if (HasEscortState(STATE_ESCORT_PAUSED)) + { + if (m_uiWave_Timer <= uiDiff) + { + switch(m_uiWave) + { + case 0: + DoScriptText(SAY_BREAKOUT3, me); + SummonAcolyte(3); + m_uiWave_Timer = 20000; + break; + case 1: + DoScriptText(SAY_BREAKOUT4, me); + SummonAcolyte(3); + m_uiWave_Timer = 20000; + break; + case 2: + DoScriptText(SAY_BREAKOUT5, me); + SummonAcolyte(4); + m_uiWave_Timer = 20000; + break; + case 3: + DoScriptText(SAY_BREAKOUT6, me); + me->SummonCreature(NPC_HIGH_INQUISITOR_VALROTH, 1642.329, -6045.818, 127.583, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000); + m_uiWave_Timer = 1000; + break; + case 4: + { + Creature* pTemp = Unit::GetCreature(*me, m_uiValrothGUID); + + if (!pTemp || !pTemp->isAlive()) + { + DoScriptText(SAY_BREAKOUT8, me); + m_uiWave_Timer = 5000; + } + else + { + m_uiWave_Timer = 2500; + return; //return, we don't want m_uiWave to increment now + } + break; + } + case 5: + DoScriptText(SAY_BREAKOUT9, me); + me->RemoveAurasDueToSpell(SPELL_ANTI_MAGIC_ZONE); + // i do not know why the armor will also be removed + m_uiWave_Timer = 2500; + break; + case 6: + DoScriptText(SAY_BREAKOUT10, me); + SetEscortPaused(false); + break; + } + + ++m_uiWave; + } + else + m_uiWave_Timer -= uiDiff; + } + } +}; + +CreatureAI* GetAI_npc_koltira_deathweaver(Creature* pCreature) +{ + return new npc_koltira_deathweaverAI(pCreature); +} + +bool QuestAccept_npc_koltira_deathweaver(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_BREAKOUT) + { + pCreature->SetStandState(UNIT_STAND_STATE_STAND); + + if (npc_escortAI* pEscortAI = CAST_AI(npc_koltira_deathweaverAI,pCreature->AI())) + pEscortAI->Start(false, false, pPlayer->GetGUID()); + } + return true; +} + +//Scarlet courier +enum ScarletCourierEnum +{ + SAY_TREE1 = -1609531, + SAY_TREE2 = -1609532, + SPELL_SHOOT = 52818, + GO_INCONSPICUOUS_TREE = 191144, + NPC_SCARLET_COURIER = 29076 +}; + +struct mob_scarlet_courierAI : public ScriptedAI +{ + mob_scarlet_courierAI(Creature *pCreature) : ScriptedAI(pCreature) {} + + uint32 uiStage; + uint32 uiStage_timer; + + void Reset() + { + me->Mount(14338); // not sure about this id + uiStage = 1; + uiStage_timer = 3000; + } + + void EnterCombat(Unit * /*who*/) + { + DoScriptText(SAY_TREE2, me); + me->Unmount(); + uiStage = 0; + } + + void MovementInform(uint32 type, uint32 id) + { + if (type != POINT_MOTION_TYPE) + return; + + if (id == 1) + uiStage = 2; + } + + void UpdateAI(const uint32 diff) + { + if (uiStage && !me->isInCombat()) + { + if (uiStage_timer <= diff) + { + switch(uiStage) + { + case 1: + me->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + if (GameObject* tree = me->FindNearestGameObject(GO_INCONSPICUOUS_TREE, 40.0f)) + { + DoScriptText(SAY_TREE1, me); + float x, y, z; + tree->GetContactPoint(me, x, y, z); + me->GetMotionMaster()->MovePoint(1, x, y, z); + } + break; + case 2: + if (GameObject* tree = me->FindNearestGameObject(GO_INCONSPICUOUS_TREE, 40.0f)) + if (Unit *unit = tree->GetOwner()) + AttackStart(unit); + break; + } + uiStage_timer = 3000; + uiStage = 0; + } else uiStage_timer -= diff; + } + + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_scarlet_courier(Creature* pCreature) +{ + return new mob_scarlet_courierAI (pCreature); +} + +//Koltira & Valroth- Breakout + +enum valroth +{ + SAY_VALROTH1 = -1609581, + SAY_VALROTH2 = -1609582, + SAY_VALROTH3 = -1609583, + SAY_VALROTH4 = -1609584, + SAY_VALROTH5 = -1609585, + SAY_VALROTH6 = -1609586, + SPELL_RENEW = 38210, + SPELL_INQUISITOR_PENANCE = 52922, + SPELL_VALROTH_SMITE = 52926, + SPELL_SUMMON_VALROTH_REMAINS = 52929 +}; + +struct mob_high_inquisitor_valrothAI : public ScriptedAI +{ + mob_high_inquisitor_valrothAI(Creature *pCreature) : ScriptedAI(pCreature) {} + + uint32 uiRenew_timer; + uint32 uiInquisitor_Penance_timer; + uint32 uiValroth_Smite_timer; + + void Reset() + { + uiRenew_timer = 1000; + uiInquisitor_Penance_timer = 2000; + uiValroth_Smite_timer = 1000; + } + + void EnterCombat(Unit* who) + { + DoScriptText(SAY_VALROTH2, me); + DoCast(who, SPELL_VALROTH_SMITE); + } + + void UpdateAI(const uint32 diff) + { + if (uiRenew_timer <= diff) + { + Shout(); + DoCast(me, SPELL_RENEW); + uiRenew_timer = 1000 + rand()%5000; + } else uiRenew_timer -= diff; + + if (uiInquisitor_Penance_timer <= diff) + { + Shout(); + DoCast(me->getVictim(), SPELL_INQUISITOR_PENANCE); + uiInquisitor_Penance_timer = 2000 + rand()%5000; + } else uiInquisitor_Penance_timer -= diff; + + if (uiValroth_Smite_timer <= diff) + { + Shout(); + DoCast(me->getVictim(), SPELL_VALROTH_SMITE); + uiValroth_Smite_timer = 1000 + rand()%5000; + } else uiValroth_Smite_timer -= diff; + + DoMeleeAttackIfReady(); + } + + void Shout() + { + if (rand()%100 < 15) + DoScriptText(RAND(SAY_VALROTH3,SAY_VALROTH4,SAY_VALROTH5), me); + } + + void JustDied(Unit* killer) + { + DoScriptText(SAY_VALROTH6, me); + killer->CastSpell(me, SPELL_SUMMON_VALROTH_REMAINS, true); + } +}; + +CreatureAI* GetAI_mob_high_inquisitor_valroth(Creature* pCreature) +{ + return new mob_high_inquisitor_valrothAI (pCreature); +} + +/*###### +## npc_a_special_surprise +######*/ +//used by 29032,29061,29065,29067,29068,29070,29074,29072,29073,29071 but signed for 29032 +enum SpecialSurprise +{ + SAY_EXEC_START_1 = -1609025, // speech for all + SAY_EXEC_START_2 = -1609026, + SAY_EXEC_START_3 = -1609027, + SAY_EXEC_PROG_1 = -1609028, + SAY_EXEC_PROG_2 = -1609029, + SAY_EXEC_PROG_3 = -1609030, + SAY_EXEC_PROG_4 = -1609031, + SAY_EXEC_PROG_5 = -1609032, + SAY_EXEC_PROG_6 = -1609033, + SAY_EXEC_PROG_7 = -1609034, + SAY_EXEC_NAME_1 = -1609035, + SAY_EXEC_NAME_2 = -1609036, + SAY_EXEC_RECOG_1 = -1609037, + SAY_EXEC_RECOG_2 = -1609038, + SAY_EXEC_RECOG_3 = -1609039, + SAY_EXEC_RECOG_4 = -1609040, + SAY_EXEC_RECOG_5 = -1609041, + SAY_EXEC_RECOG_6 = -1609042, + SAY_EXEC_NOREM_1 = -1609043, + SAY_EXEC_NOREM_2 = -1609044, + SAY_EXEC_NOREM_3 = -1609045, + SAY_EXEC_NOREM_4 = -1609046, + SAY_EXEC_NOREM_5 = -1609047, + SAY_EXEC_NOREM_6 = -1609048, + SAY_EXEC_NOREM_7 = -1609049, + SAY_EXEC_NOREM_8 = -1609050, + SAY_EXEC_NOREM_9 = -1609051, + SAY_EXEC_THINK_1 = -1609052, + SAY_EXEC_THINK_2 = -1609053, + SAY_EXEC_THINK_3 = -1609054, + SAY_EXEC_THINK_4 = -1609055, + SAY_EXEC_THINK_5 = -1609056, + SAY_EXEC_THINK_6 = -1609057, + SAY_EXEC_THINK_7 = -1609058, + SAY_EXEC_THINK_8 = -1609059, + SAY_EXEC_THINK_9 = -1609060, + SAY_EXEC_THINK_10 = -1609061, + SAY_EXEC_LISTEN_1 = -1609062, + SAY_EXEC_LISTEN_2 = -1609063, + SAY_EXEC_LISTEN_3 = -1609064, + SAY_EXEC_LISTEN_4 = -1609065, + SAY_PLAGUEFIST = -1609066, + SAY_EXEC_TIME_1 = -1609067, + SAY_EXEC_TIME_2 = -1609068, + SAY_EXEC_TIME_3 = -1609069, + SAY_EXEC_TIME_4 = -1609070, + SAY_EXEC_TIME_5 = -1609071, + SAY_EXEC_TIME_6 = -1609072, + SAY_EXEC_TIME_7 = -1609073, + SAY_EXEC_TIME_8 = -1609074, + SAY_EXEC_TIME_9 = -1609075, + SAY_EXEC_TIME_10 = -1609076, + SAY_EXEC_WAITING = -1609077, + EMOTE_DIES = -1609078, + + NPC_PLAGUEFIST = 29053 +}; + +struct npc_a_special_surpriseAI : public ScriptedAI +{ + npc_a_special_surpriseAI(Creature *pCreature) : ScriptedAI(pCreature) {} + + uint32 ExecuteSpeech_Timer; + uint32 ExecuteSpeech_Counter; + uint64 PlayerGUID; + + void Reset() + { + ExecuteSpeech_Timer = 0; + ExecuteSpeech_Counter = 0; + PlayerGUID = 0; + + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + } + + bool MeetQuestCondition(Unit* pPlayer) + { + switch(me->GetEntry()) + { + case 29061: // Ellen Stanbridge + if (CAST_PLR(pPlayer)->GetQuestStatus(12742) == QUEST_STATUS_INCOMPLETE) + return true; + break; + case 29072: // Kug Ironjaw + if (CAST_PLR(pPlayer)->GetQuestStatus(12748) == QUEST_STATUS_INCOMPLETE) + return true; + break; + case 29067: // Donovan Pulfrost + if (CAST_PLR(pPlayer)->GetQuestStatus(12744) == QUEST_STATUS_INCOMPLETE) + return true; + break; + case 29065: // Yazmina Oakenthorn + if (CAST_PLR(pPlayer)->GetQuestStatus(12743) == QUEST_STATUS_INCOMPLETE) + return true; + break; + case 29071: // Antoine Brack + if (CAST_PLR(pPlayer)->GetQuestStatus(12750) == QUEST_STATUS_INCOMPLETE) + return true; + break; + case 29032: // Malar Bravehorn + if (CAST_PLR(pPlayer)->GetQuestStatus(12739) == QUEST_STATUS_INCOMPLETE) + return true; + break; + case 29068: // Goby Blastenheimer + if (CAST_PLR(pPlayer)->GetQuestStatus(12745) == QUEST_STATUS_INCOMPLETE) + return true; + break; + case 29073: // Iggy Darktusk + if (CAST_PLR(pPlayer)->GetQuestStatus(12749) == QUEST_STATUS_INCOMPLETE) + return true; + break; + case 29074: // Lady Eonys + if (CAST_PLR(pPlayer)->GetQuestStatus(12747) == QUEST_STATUS_INCOMPLETE) + return true; + break; + case 29070: // Valok the Righteous + if (CAST_PLR(pPlayer)->GetQuestStatus(12746) == QUEST_STATUS_INCOMPLETE) + return true; + break; + } + + return false; + } + + void MoveInLineOfSight(Unit* pWho) + { + if (PlayerGUID || pWho->GetTypeId() != TYPEID_PLAYER || !pWho->IsWithinDist(me, INTERACTION_DISTANCE)) + return; + + if (MeetQuestCondition(pWho)) + PlayerGUID = pWho->GetGUID(); + } + + void UpdateAI(const uint32 diff) + { + if (PlayerGUID && !me->getVictim() && me->isAlive()) + { + if (ExecuteSpeech_Timer <= diff) + { + Player* pPlayer = Unit::GetPlayer(PlayerGUID); + + if (!pPlayer) + { + Reset(); + return; + } + + //TODO: simplify text's selection + + switch(pPlayer->getRace()) + { + case RACE_HUMAN: + switch(ExecuteSpeech_Counter) + { + case 0: DoScriptText(SAY_EXEC_START_1, me, pPlayer); break; + case 1: me->SetStandState(UNIT_STAND_STATE_STAND); break; + case 2: DoScriptText(SAY_EXEC_PROG_5, me, pPlayer); break; + case 3: DoScriptText(SAY_EXEC_NAME_1, me, pPlayer); break; + case 4: DoScriptText(SAY_EXEC_RECOG_1, me, pPlayer); break; + case 5: DoScriptText(SAY_EXEC_NOREM_5, me, pPlayer); break; + case 6: DoScriptText(SAY_EXEC_THINK_7, me, pPlayer); break; + case 7: DoScriptText(SAY_EXEC_LISTEN_1, me, pPlayer); break; + case 8: + if (Creature* Plaguefist = GetClosestCreatureWithEntry(me, NPC_PLAGUEFIST, 85.0f)) + DoScriptText(SAY_PLAGUEFIST, Plaguefist, pPlayer); + break; + case 9: + DoScriptText(SAY_EXEC_TIME_6, me, pPlayer); + me->SetStandState(UNIT_STAND_STATE_KNEEL); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + break; + case 10: DoScriptText(SAY_EXEC_WAITING, me, pPlayer); break; + case 11: + DoScriptText(EMOTE_DIES, me); + me->setDeathState(JUST_DIED); + me->SetHealth(0); + return; + } + break; + case RACE_ORC: + switch(ExecuteSpeech_Counter) + { + case 0: DoScriptText(SAY_EXEC_START_1, me, pPlayer); break; + case 1: me->SetStandState(UNIT_STAND_STATE_STAND); break; + case 2: DoScriptText(SAY_EXEC_PROG_6, me, pPlayer); break; + case 3: DoScriptText(SAY_EXEC_NAME_1, me, pPlayer); break; + case 4: DoScriptText(SAY_EXEC_RECOG_1, me, pPlayer); break; + case 5: DoScriptText(SAY_EXEC_NOREM_7, me, pPlayer); break; + case 6: DoScriptText(SAY_EXEC_THINK_8, me, pPlayer); break; + case 7: DoScriptText(SAY_EXEC_LISTEN_1, me, pPlayer); break; + case 8: + if (Creature* Plaguefist = GetClosestCreatureWithEntry(me, NPC_PLAGUEFIST, 85.0f)) + DoScriptText(SAY_PLAGUEFIST, Plaguefist, pPlayer); + break; + case 9: + DoScriptText(SAY_EXEC_TIME_8, me, pPlayer); + me->SetStandState(UNIT_STAND_STATE_KNEEL); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + break; + case 10: DoScriptText(SAY_EXEC_WAITING, me, pPlayer); break; + case 11: + DoScriptText(EMOTE_DIES, me); + me->setDeathState(JUST_DIED); + me->SetHealth(0); + return; + } + break; + case RACE_DWARF: + switch(ExecuteSpeech_Counter) + { + case 0: DoScriptText(SAY_EXEC_START_2, me, pPlayer); break; + case 1: me->SetStandState(UNIT_STAND_STATE_STAND); break; + case 2: DoScriptText(SAY_EXEC_PROG_2, me, pPlayer); break; + case 3: DoScriptText(SAY_EXEC_NAME_1, me, pPlayer); break; + case 4: DoScriptText(SAY_EXEC_RECOG_3, me, pPlayer); break; + case 5: DoScriptText(SAY_EXEC_NOREM_2, me, pPlayer); break; + case 6: DoScriptText(SAY_EXEC_THINK_5, me, pPlayer); break; + case 7: DoScriptText(SAY_EXEC_LISTEN_2, me, pPlayer); break; + case 8: + if (Creature* Plaguefist = GetClosestCreatureWithEntry(me, NPC_PLAGUEFIST, 85.0f)) + DoScriptText(SAY_PLAGUEFIST, Plaguefist, pPlayer); + break; + case 9: + DoScriptText(SAY_EXEC_TIME_3, me, pPlayer); + me->SetStandState(UNIT_STAND_STATE_KNEEL); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + break; + case 10: DoScriptText(SAY_EXEC_WAITING, me, pPlayer); break; + case 11: + DoScriptText(EMOTE_DIES, me); + me->setDeathState(JUST_DIED); + me->SetHealth(0); + return; + } + break; + case RACE_NIGHTELF: + switch(ExecuteSpeech_Counter) + { + case 0: DoScriptText(SAY_EXEC_START_1, me, pPlayer); break; + case 1: me->SetStandState(UNIT_STAND_STATE_STAND); break; + case 2: DoScriptText(SAY_EXEC_PROG_5, me, pPlayer); break; + case 3: DoScriptText(SAY_EXEC_NAME_1, me, pPlayer); break; + case 4: DoScriptText(SAY_EXEC_RECOG_1, me, pPlayer); break; + case 5: DoScriptText(SAY_EXEC_NOREM_6, me, pPlayer); break; + case 6: DoScriptText(SAY_EXEC_THINK_2, me, pPlayer); break; + case 7: DoScriptText(SAY_EXEC_LISTEN_1, me, pPlayer); break; + case 8: + if (Creature* Plaguefist = GetClosestCreatureWithEntry(me, NPC_PLAGUEFIST, 85.0f)) + DoScriptText(SAY_PLAGUEFIST, Plaguefist, pPlayer); + break; + case 9: + DoScriptText(SAY_EXEC_TIME_7, me, pPlayer); + me->SetStandState(UNIT_STAND_STATE_KNEEL); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + break; + case 10: DoScriptText(SAY_EXEC_WAITING, me, pPlayer); break; + case 11: + DoScriptText(EMOTE_DIES, me); + me->setDeathState(JUST_DIED); + me->SetHealth(0); + return; + } + break; + case RACE_UNDEAD_PLAYER: + switch(ExecuteSpeech_Counter) + { + case 0: DoScriptText(SAY_EXEC_START_1, me, pPlayer); break; + case 1: me->SetStandState(UNIT_STAND_STATE_STAND); break; + case 2: DoScriptText(SAY_EXEC_PROG_3, me, pPlayer); break; + case 3: DoScriptText(SAY_EXEC_NAME_1, me, pPlayer); break; + case 4: DoScriptText(SAY_EXEC_RECOG_4, me, pPlayer); break; + case 5: DoScriptText(SAY_EXEC_NOREM_3, me, pPlayer); break; + case 6: DoScriptText(SAY_EXEC_THINK_1, me, pPlayer); break; + case 7: DoScriptText(SAY_EXEC_LISTEN_3, me, pPlayer); break; + case 8: + if (Creature* Plaguefist = GetClosestCreatureWithEntry(me, NPC_PLAGUEFIST, 85.0f)) + DoScriptText(SAY_PLAGUEFIST, Plaguefist, pPlayer); + break; + case 9: + DoScriptText(SAY_EXEC_TIME_4, me, pPlayer); + me->SetStandState(UNIT_STAND_STATE_KNEEL); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + break; + case 10: DoScriptText(SAY_EXEC_WAITING, me, pPlayer); break; + case 11: + DoScriptText(EMOTE_DIES, me); + me->setDeathState(JUST_DIED); + me->SetHealth(0); + return; + } + break; + case RACE_TAUREN: + switch(ExecuteSpeech_Counter) + { + case 0: DoScriptText(SAY_EXEC_START_1, me, pPlayer); break; + case 1: me->SetStandState(UNIT_STAND_STATE_STAND); break; + case 2: DoScriptText(SAY_EXEC_PROG_1, me, pPlayer); break; + case 3: DoScriptText(SAY_EXEC_NAME_1, me, pPlayer); break; + case 4: DoScriptText(SAY_EXEC_RECOG_5, me, pPlayer); break; + case 5: DoScriptText(SAY_EXEC_NOREM_8, me, pPlayer); break; + case 6: DoScriptText(SAY_EXEC_THINK_9, me, pPlayer); break; + case 7: DoScriptText(SAY_EXEC_LISTEN_1, me, pPlayer); break; + case 8: + if (Creature* Plaguefist = GetClosestCreatureWithEntry(me, NPC_PLAGUEFIST, 85.0f)) + DoScriptText(SAY_PLAGUEFIST, Plaguefist, pPlayer); + break; + case 9: + DoScriptText(SAY_EXEC_TIME_9, me, pPlayer); + me->SetStandState(UNIT_STAND_STATE_KNEEL); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + break; + case 10: DoScriptText(SAY_EXEC_WAITING, me, pPlayer); break; + case 11: + DoScriptText(EMOTE_DIES, me); + me->setDeathState(JUST_DIED); + me->SetHealth(0); + return; + } + break; + case RACE_GNOME: + switch(ExecuteSpeech_Counter) + { + case 0: DoScriptText(SAY_EXEC_START_1, me, pPlayer); break; + case 1: me->SetStandState(UNIT_STAND_STATE_STAND); break; + case 2: DoScriptText(SAY_EXEC_PROG_4, me, pPlayer); break; + case 3: DoScriptText(SAY_EXEC_NAME_1, me, pPlayer); break; + case 4: DoScriptText(SAY_EXEC_RECOG_1, me, pPlayer); break; + case 5: DoScriptText(SAY_EXEC_NOREM_4, me, pPlayer); break; + case 6: DoScriptText(SAY_EXEC_THINK_6, me, pPlayer); break; + case 7: DoScriptText(SAY_EXEC_LISTEN_1, me, pPlayer); break; + case 8: + if (Creature* Plaguefist = GetClosestCreatureWithEntry(me, NPC_PLAGUEFIST, 85.0f)) + DoScriptText(SAY_PLAGUEFIST, Plaguefist, pPlayer); + break; + case 9: + DoScriptText(SAY_EXEC_TIME_5, me, pPlayer); + me->SetStandState(UNIT_STAND_STATE_KNEEL); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + break; + case 10: DoScriptText(SAY_EXEC_WAITING, me, pPlayer); break; + case 11: + DoScriptText(EMOTE_DIES, me); + me->setDeathState(JUST_DIED); + me->SetHealth(0); + return; + } + break; + case RACE_TROLL: + switch(ExecuteSpeech_Counter) + { + case 0: DoScriptText(SAY_EXEC_START_3, me, pPlayer); break; + case 1: me->SetStandState(UNIT_STAND_STATE_STAND); break; + case 2: DoScriptText(SAY_EXEC_PROG_7, me, pPlayer); break; + case 3: DoScriptText(SAY_EXEC_NAME_2, me, pPlayer); break; + case 4: DoScriptText(SAY_EXEC_RECOG_6, me, pPlayer); break; + case 5: DoScriptText(SAY_EXEC_NOREM_9, me, pPlayer); break; + case 6: DoScriptText(SAY_EXEC_THINK_10, me, pPlayer); break; + case 7: DoScriptText(SAY_EXEC_LISTEN_4, me, pPlayer); break; + case 8: + if (Creature* Plaguefist = GetClosestCreatureWithEntry(me, NPC_PLAGUEFIST, 85.0f)) + DoScriptText(SAY_PLAGUEFIST, Plaguefist, pPlayer); + break; + case 9: + DoScriptText(SAY_EXEC_TIME_10, me, pPlayer); + me->SetStandState(UNIT_STAND_STATE_KNEEL); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + break; + case 10: DoScriptText(SAY_EXEC_WAITING, me, pPlayer); break; + case 11: + DoScriptText(EMOTE_DIES, me); + me->setDeathState(JUST_DIED); + me->SetHealth(0); + return; + } + break; + case RACE_BLOODELF: + switch(ExecuteSpeech_Counter) + { + case 0: DoScriptText(SAY_EXEC_START_1, me, pPlayer); break; + case 1: me->SetStandState(UNIT_STAND_STATE_STAND); break; + case 2: DoScriptText(SAY_EXEC_PROG_1, me, pPlayer); break; + case 3: DoScriptText(SAY_EXEC_NAME_1, me, pPlayer); break; + case 4: DoScriptText(SAY_EXEC_RECOG_1, me, pPlayer); break; + //case 5: //unknown + case 6: DoScriptText(SAY_EXEC_THINK_3, me, pPlayer); break; + case 7: DoScriptText(SAY_EXEC_LISTEN_1, me, pPlayer); break; + case 8: + if (Creature* Plaguefist = GetClosestCreatureWithEntry(me, NPC_PLAGUEFIST, 85.0f)) + DoScriptText(SAY_PLAGUEFIST, Plaguefist, pPlayer); + break; + case 9: + DoScriptText(SAY_EXEC_TIME_1, me, pPlayer); + me->SetStandState(UNIT_STAND_STATE_KNEEL); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + break; + case 10: DoScriptText(SAY_EXEC_WAITING, me, pPlayer); break; + case 11: + DoScriptText(EMOTE_DIES, me); + me->setDeathState(JUST_DIED); + me->SetHealth(0); + return; + } + break; + case RACE_DRAENEI: + switch(ExecuteSpeech_Counter) + { + case 0: DoScriptText(SAY_EXEC_START_1, me, pPlayer); break; + case 1: me->SetStandState(UNIT_STAND_STATE_STAND); break; + case 2: DoScriptText(SAY_EXEC_PROG_1, me, pPlayer); break; + case 3: DoScriptText(SAY_EXEC_NAME_1, me, pPlayer); break; + case 4: DoScriptText(SAY_EXEC_RECOG_2, me, pPlayer); break; + case 5: DoScriptText(SAY_EXEC_NOREM_1, me, pPlayer); break; + case 6: DoScriptText(SAY_EXEC_THINK_4, me, pPlayer); break; + case 7: DoScriptText(SAY_EXEC_LISTEN_1, me, pPlayer); break; + case 8: + if (Creature* Plaguefist = GetClosestCreatureWithEntry(me, NPC_PLAGUEFIST, 85.0f)) + DoScriptText(SAY_PLAGUEFIST, Plaguefist, pPlayer); + break; + case 9: + DoScriptText(SAY_EXEC_TIME_2, me, pPlayer); + me->SetStandState(UNIT_STAND_STATE_KNEEL); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + break; + case 10: DoScriptText(SAY_EXEC_WAITING, me, pPlayer); break; + case 11: + DoScriptText(EMOTE_DIES, me); + me->setDeathState(JUST_DIED); + me->SetHealth(0); + return; + } + break; + } + + if (ExecuteSpeech_Counter >= 9) + ExecuteSpeech_Timer = 15000; + else + ExecuteSpeech_Timer = 7000; + + ++ExecuteSpeech_Counter; + } + else + ExecuteSpeech_Timer -= diff; + } + } +}; + +CreatureAI* GetAI_npc_a_special_surprise(Creature* pCreature) +{ + return new npc_a_special_surpriseAI(pCreature); +} + +void AddSC_the_scarlet_enclave_c2() +{ + Script *newscript; + + // How to win friends and influence enemies + newscript = new Script; + newscript->Name = "npc_crusade_persuaded"; + newscript->GetAI = &GetAI_npc_crusade_persuaded; + newscript->RegisterSelf(); + + // Ambush At The Overlook + newscript = new Script; + newscript->Name = "mob_scarlet_courier"; + newscript->GetAI = &GetAI_mob_scarlet_courier; + newscript->RegisterSelf(); + + // 12727 Bloody Breakout + newscript = new Script; + newscript->Name = "npc_koltira_deathweaver"; + newscript->GetAI = &GetAI_npc_koltira_deathweaver; + newscript->pQuestAccept = &QuestAccept_npc_koltira_deathweaver; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_high_inquisitor_valroth"; + newscript->GetAI = &GetAI_mob_high_inquisitor_valroth; + newscript->RegisterSelf(); + + // A Special Suprise + newscript = new Script; + newscript->Name = "npc_a_special_surprise"; + newscript->GetAI = &GetAI_npc_a_special_surprise; + newscript->RegisterSelf(); +} + +/* +-- Bloody Breakout +UPDATE `creature_template` SET `ScriptName`='npc_koltira_deathweaver' WHERE `entry`='28912'; +UPDATE `creature_template` SET `ScriptName`='mob_high_inquisitor_valroth',minmana=6489,maxmana=6489,unit_flags=32768 WHERE `entry`='29001'; +UPDATE `creature_template` SET `ScriptName`='mob_eventai', `AIName`='EventAI',minmana=1020,maxmana=1058,unit_flags=32768 WHERE (`entry`='29007'); +DELETE FROM creature_ai_scripts WHERE id BETWEEN 90030 AND 90033; +INSERT INTO `creature_ai_scripts` VALUES ('90030', '29007', '0', '0', '100', '1', '1000', '4000', '1000', '4000', '11', '15498', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', 'Crimson Acolyte - Holy Smite'); +INSERT INTO `creature_ai_scripts` VALUES ('90031', '29007', '0', '0', '100', '1', '1000', '10000', '20000', '21000', '11', '34809', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 'Crimson Acolyte - Holy Fury'); +INSERT INTO `creature_ai_scripts` VALUES ('90032', '29007', '0', '0', '100', '1', '1000', '5000', '1000', '5000', '11', '19725', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', 'Crimson Acolyte - Turn Undead'); +INSERT INTO `creature_ai_scripts` VALUES ('90033', '29007', '4', '0', '100', '0', '0', '0', '0', '0', '11', '15498', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', 'Crimson Acolyte aggro'); +*/ diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp new file mode 100644 index 00000000000..3b0ce186592 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp @@ -0,0 +1,1684 @@ +/* + * Copyright (C) 2009 Trinity + * + * 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 + */ + +#include "ScriptedPch.h" +#include "ScriptedEscortAI.h" + +#define LESS_MOB // if you do not have a good server and do not want it to be laggy as hell +//Light of Dawn +enum mograine +{ +#ifdef LESS_MOB + ENCOUNTER_DK_NUMBER = 5, // how many player queue to start the quest , or - + ENCOUNTER_DK_TIMER = 10, // *every 5 minutes. These have to be done in instance data + ENCOUNTER_DEFENDER_NUMBER = 10, // how many of defender + ENCOUNTER_EARTHSHATTER_NUMBER = 1, // how many of earthshatter + ENCOUNTER_ABOMINATION_NUMBER = 2, // how many of abomination + ENCOUNTER_BEHEMOTH_NUMBER = 1, // how many of behemoth + ENCOUNTER_GHOUL_NUMBER = 5, // how many of ghoul + ENCOUNTER_WARRIOR_NUMBER = 1, // how many of warrior +#else + ENCOUNTER_DK_NUMBER = 5, // how many player queue to start the quest , or - + ENCOUNTER_DK_TIMER = 10, // *every 5 minutes. These have to be done in instance data + ENCOUNTER_DEFENDER_NUMBER = 20, // how many of defender + ENCOUNTER_EARTHSHATTER_NUMBER = 20, // how many of earthshatter + ENCOUNTER_ABOMINATION_NUMBER = 3, // how many of abomination + ENCOUNTER_BEHEMOTH_NUMBER = 2, // how many of behemoth + ENCOUNTER_GHOUL_NUMBER = 10, // how many of ghoul + ENCOUNTER_WARRIOR_NUMBER = 2, // how many of warrior +#endif + ENCOUNTER_TOTAL_DAWN = 300, // Total number + ENCOUNTER_TOTAL_SCOURGE = 10000, + + WORLD_STATE_REMAINS = 3592, + WORLD_STATE_COUNTDOWN = 3603, + WORLD_STATE_EVENT_BEGIN = 3605, + + SAY_LIGHT_OF_DAWN01 = -1609201, // pre text + SAY_LIGHT_OF_DAWN02 = -1609202, + SAY_LIGHT_OF_DAWN03 = -1609203, + SAY_LIGHT_OF_DAWN04 = -1609204, // intro + SAY_LIGHT_OF_DAWN05 = -1609205, + SAY_LIGHT_OF_DAWN06 = -1609206, + SAY_LIGHT_OF_DAWN07 = -1609207, // During the fight - Korfax, Champion of the Light + SAY_LIGHT_OF_DAWN08 = -1609208, // Lord Maxwell Tyrosus + SAY_LIGHT_OF_DAWN09 = -1609209, // Highlord Darion Mograine + SAY_LIGHT_OF_DAWN10 = -1609210, + SAY_LIGHT_OF_DAWN11 = -1609211, + SAY_LIGHT_OF_DAWN12 = -1609212, + SAY_LIGHT_OF_DAWN13 = -1609213, + SAY_LIGHT_OF_DAWN14 = -1609214, + SAY_LIGHT_OF_DAWN15 = -1609215, + SAY_LIGHT_OF_DAWN16 = -1609216, + SAY_LIGHT_OF_DAWN17 = -1609217, + SAY_LIGHT_OF_DAWN18 = -1609218, + SAY_LIGHT_OF_DAWN19 = -1609219, + SAY_LIGHT_OF_DAWN20 = -1609220, + SAY_LIGHT_OF_DAWN21 = -1609221, + SAY_LIGHT_OF_DAWN22 = -1609222, + SAY_LIGHT_OF_DAWN23 = -1609223, + SAY_LIGHT_OF_DAWN24 = -1609224, + SAY_LIGHT_OF_DAWN25 = -1609225, // After the fight + SAY_LIGHT_OF_DAWN26 = -1609226, // Highlord Tirion Fordring + SAY_LIGHT_OF_DAWN27 = -1609227, // Highlord Darion Mograine + SAY_LIGHT_OF_DAWN28 = -1609228, // Highlord Tirion Fordring + SAY_LIGHT_OF_DAWN29 = -1609229, // Highlord Tirion Fordring + SAY_LIGHT_OF_DAWN30 = -1609230, // Highlord Tirion Fordring + SAY_LIGHT_OF_DAWN31 = -1609231, // Highlord Tirion Fordring + SAY_LIGHT_OF_DAWN32 = -1609232, // Highlord Alexandros Mograine + SAY_LIGHT_OF_DAWN33 = -1609233, // Highlord Darion Mograine + SAY_LIGHT_OF_DAWN34 = -1609234, // Highlord Darion Mograine + SAY_LIGHT_OF_DAWN35 = -1609235, // Darion Mograine + SAY_LIGHT_OF_DAWN36 = -1609236, // Darion Mograine + SAY_LIGHT_OF_DAWN37 = -1609237, // Highlord Alexandros Mograine + SAY_LIGHT_OF_DAWN38 = -1609238, // Darion Mograine + SAY_LIGHT_OF_DAWN39 = -1609239, // Highlord Alexandros Mograine + SAY_LIGHT_OF_DAWN40 = -1609240, // Darion Mograine + SAY_LIGHT_OF_DAWN41 = -1609241, // Highlord Alexandros Mograine + SAY_LIGHT_OF_DAWN42 = -1609242, // Highlord Alexandros Mograine + SAY_LIGHT_OF_DAWN43 = -1609243, // The Lich King + SAY_LIGHT_OF_DAWN44 = -1609244, // Highlord Darion Mograine + SAY_LIGHT_OF_DAWN45 = -1609245, // The Lich King + SAY_LIGHT_OF_DAWN46 = -1609246, // The Lich King + SAY_LIGHT_OF_DAWN47 = -1609247, // Highlord Tirion Fordring + SAY_LIGHT_OF_DAWN48 = -1609248, // The Lich King + SAY_LIGHT_OF_DAWN49 = -1609249, // The Lich King + SAY_LIGHT_OF_DAWN50 = -1609250, // Lord Maxwell Tyrosus + SAY_LIGHT_OF_DAWN51 = -1609251, // The Lich King + SAY_LIGHT_OF_DAWN52 = -1609252, // Highlord Darion Mograine + SAY_LIGHT_OF_DAWN53 = -1609253, // Highlord Darion Mograine + SAY_LIGHT_OF_DAWN54 = -1609254, // Highlord Tirion Fordring + SAY_LIGHT_OF_DAWN55 = -1609255, // The Lich King + SAY_LIGHT_OF_DAWN56 = -1609256, // Highlord Tirion Fordring + SAY_LIGHT_OF_DAWN57 = -1609257, // The Lich King + SAY_LIGHT_OF_DAWN58 = -1609258, // The Lich King + SAY_LIGHT_OF_DAWN59 = -1609259, // The Lich King + SAY_LIGHT_OF_DAWN60 = -1609260, // Highlord Tirion Fordring + SAY_LIGHT_OF_DAWN61 = -1609261, // Highlord Tirion Fordring + SAY_LIGHT_OF_DAWN62 = -1609262, // Highlord Tirion Fordring + SAY_LIGHT_OF_DAWN63 = -1609263, // Highlord Tirion Fordring + SAY_LIGHT_OF_DAWN64 = -1609264, // Highlord Tirion Fordring + SAY_LIGHT_OF_DAWN65 = -1609265, // Highlord Tirion Fordring + SAY_LIGHT_OF_DAWN66 = -1609266, // Highlord Tirion Fordring + SAY_LIGHT_OF_DAWN67 = -1609267, // Highlord Tirion Fordring + SAY_LIGHT_OF_DAWN68 = -1609268, // Highlord Darion Mograine + + EMOTE_LIGHT_OF_DAWN01 = -1609269, // Emotes + EMOTE_LIGHT_OF_DAWN02 = -1609270, + EMOTE_LIGHT_OF_DAWN03 = -1609271, + EMOTE_LIGHT_OF_DAWN04 = -1609272, + EMOTE_LIGHT_OF_DAWN05 = -1609273, + EMOTE_LIGHT_OF_DAWN06 = -1609274, + EMOTE_LIGHT_OF_DAWN07 = -1609275, + EMOTE_LIGHT_OF_DAWN08 = -1609276, + EMOTE_LIGHT_OF_DAWN09 = -1609277, + EMOTE_LIGHT_OF_DAWN10 = -1609278, + EMOTE_LIGHT_OF_DAWN11 = -1609279, + EMOTE_LIGHT_OF_DAWN12 = -1609280, + EMOTE_LIGHT_OF_DAWN13 = -1609281, + EMOTE_LIGHT_OF_DAWN14 = -1609282, + EMOTE_LIGHT_OF_DAWN15 = -1609283, + EMOTE_LIGHT_OF_DAWN16 = -1609284, + EMOTE_LIGHT_OF_DAWN17 = -1609285, + EMOTE_LIGHT_OF_DAWN18 = -1609286, + + GO_LIGHT_OF_DAWN = 191330, + SPELL_THE_LIGHT_OF_DAWN_Q = 53606, // quest credit + + // ---- Dark Knight npc -------------------- + // Highlord Darion Mograine + NPC_HIGHLORD_DARION_MOGRAINE = 29173, + SPELL_ANTI_MAGIC_ZONE1 = 52893, + SPELL_DEATH_STRIKE = 53639, + SPELL_DEATH_EMBRACE = 53635, + SPELL_ICY_TOUCH1 = 49723, + SPELL_THE_LIGHT_OF_DAWN = 53658, + SPELL_THE_MIGHT_OF_MOGRAINE = 53642, // on players when begins + SPELL_UNHOLY_BLIGHT = 53640, + SPELL_ALEXANDROS_MOGRAINE_SPAWN = 53667, + SPELL_MOGRAINE_CHARGE = 53679, + SPELL_ASHBRINGER = 53701, + + // Koltira Deathweaver & Orbaz Bloodbane are using the same abilities + NPC_KOLTIRA_DEATHWEAVER = 29199, + NPC_ORBAZ_BLOODBANE = 29204, // this guy fleed + NPC_THASSARIAN = 29200, // he also does SPELL_THE_LIGHT_OF_DAWN 53658 + SPELL_BLOOD_STRIKE1 = 52374, + SPELL_DEATH_GRIP = 49576, + SPELL_ICY_TOUCH2 = 52372, + SPELL_PLAGUE_STRIKE1 = 50668, + // all do SPELL_HERO_AGGRO_AURA 53627 + + // Lich King + NPC_THE_LICH_KING = 29183, // show up at end + SPELL_APOCALYPSE = 53210, + SPELL_TELEPORT_VISUAL = 52233, + SPELL_SOUL_FEAST_ALEX = 53677, // on Alexandros + SPELL_SOUL_FEAST_TIRION = 53685, // on Tirion + SPELL_ICEBOUND_VISAGE = 53274, // not sure what is it for + SPELL_REBUKE = 53680, + + // others + NPC_RAMPAGING_ABOMINATION = 29186, + SPELL_CLEAVE1 = 53633, + SPELL_SCOURGE_HOOK = 50335, + SPELL_SCOURGE_AGGRO_AURA = 53624, + + NPC_FLESH_BEHEMOTH = 29190, // giant guy + SPELL_STOMP = 53634, + SPELL_THUNDERCLAP = 36706, + SPELL_HERO_AGGRO_AURA = 53627, + + NPC_ACHERUS_GHOUL = 29219, // just ghoul.... + SPELL_GHOULPLOSION = 53632, + + NPC_WARRIOR_OF_THE_FROZEN_WASTES = 29206, // use SPELL_CLEAVE 53631 + + NPC_HIGHLORD_ALEXANDROS_MOGRAINE = 29227, // ghost + NPC_DARION_MOGRAINE = 29228, // ghost + + // ---- Dawn npc -------------------- + // Highlord Tirion Fordring + NPC_HIGHLORD_TIRION_FORDRING = 29175, + EQUIP_HIGHLORD_TIRION_FORDRING = 13262, + SPELL_LAY_ON_HANDS = 53778, + SPELL_REBIRTH_OF_THE_ASHBRINGER = 53702, + SPELL_TIRION_CHARGE = 53705, + SPELL_TIRION_CHARGE_VISUAL = 53706, + + // others + NPC_KORFAX_CHAMPION_OF_THE_LIGHT = 29176, + SPELL_CLEAVE = 53631, + SPELL_HEROIC_LEAP = 53625, + + NPC_LORD_MAXWELL_TYROSUS = 29178, + NPC_LEONID_BARTHALOMEW_THE_REVERED = 29179, + NPC_DUKE_NICHOLAS_ZVERENHOFF = 29180, + + NPC_COMMANDER_ELIGOR_DAWNBRINGER = 29177, + SPELL_HOLY_LIGHT2 = 37979, + + NPC_RAYNE = 29181, + SPELL_REJUVENATION = 20664, + SPELL_STARFALL = 20678, + SPELL_TRANQUILITY = 25817, + SPELL_WRATH = 21807, + + NPC_DEFENDER_OF_THE_LIGHT = 29174, // also does SPELL_HEROIC_LEAP 53625 + SPELL_HOLY_LIGHT1 = 29427, + SPELL_HOLY_STRIKE = 53643, + SPELL_HOLY_WRATH = 53638, + SPELL_UPPERCUT = 53629, + + NPC_RIMBLAT_EARTHSHATTER = 29182, + SPELL_CHAIN_HEAL = 33642, + SPELL_THUNDER = 53630 +}; + +struct Locations +{ + float x, y, z, o; + uint32 id; +}; + +void UpdateWorldState(Map *map, uint32 id, uint32 state) +{ + Map::PlayerList const& players = map->GetPlayers(); + + if (!players.isEmpty()) + { + for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + { + if (Player* pPlayer = itr->getSource()) + pPlayer->SendUpdateWorldState(id,state); + } + } +} + +static Locations LightofDawnLoc[]= +{ + {2281.335, -5300.409, 85.170, 0}, // 0 Tirion Fordring loc + {2283.896, -5287.914, 83.066, 1.55}, // 1 Tirion Fordring loc2 + {2281.461, -5263.014, 81.164, 0}, // 2 Tirion charges + {2262.277, -5293.477, 82.167, 0}, // 3 Tirion run + {2270.286, -5287.73, 82.262, 0}, // 4 Tirion relocate + {2269.511, -5288.289, 82.225, 0}, // 5 Tirion forward + {2262.277, -5293.477, 82.167, 0}, // 6 Tirion runs to Darion + {2270.286, -5287.73, 82.262, 0}, + {2269.511, -5288.289, 82.225, 0}, + {2273.205, -5288.848, 82.617, 0}, // 9 Korfax loc1 + {2274.739, -5287.926, 82.684, 0}, // 10 Korfax loc2 + {2253.673, -5318.004, 81.724, 0}, // 11 Korfax kicked + {2287.028, -5309.644, 87.253, 0}, // 12 Maxwell loc1 + {2286.978, -5308.025, 86.83, 0}, // 13 Maxwell loc2 + {2248.877, -5307.586, 82.166, 0}, // 14 maxwell kicked + {2278.58, -5316.933, 88.319, 0}, // 15 Eligor loc1 + {2278.535, -5315.479, 88.08, 0}, // 16 Eligor loc2 + {2259.416, -5304.505, 82.149, 0}, // 17 eligor kicked + {2289.259, -5280.355, 82.112, 0}, // 18 Koltira loc1 + {2289.02, -5281.985, 82.207, 0}, // 19 Koltira loc2 + {2273.289, -5273.675, 81.701, 0}, // 20 Thassarian loc1 + {2273.332, -5275.544, 81.849, 0}, // 21 Thassarian loc2 + {2281.198, -5257.397, 80.224, 4.66}, // 22 Alexandros loc1 + {2281.156, -5259.934, 80.647, 0}, // 23 Alexandros loc2 + {2281.294, -5281.895, 82.445, 1.35}, // 24 Darion loc1 + {2281.093, -5263.013, 81.125, 0}, // 25 Darion loc1 + {2281.313, -5250.282, 79.322, 4.69}, // 26 Lich King spawns + {2281.523, -5261.058, 80.877, 0}, // 27 Lich king move forwards + {2272.709, -5255.552, 78.226, 0}, // 28 Lich king kicked + {2273.972, -5257.676, 78.862, 0} // 29 Lich king moves forward +}; + +struct npc_highlord_darion_mograineAI : public npc_escortAI +{ + npc_highlord_darion_mograineAI(Creature *pCreature) : npc_escortAI(pCreature) + { + Reset(); + } + + bool bIsBattle; + uint32 uiStep; + uint32 uiPhase_timer; + uint32 uiFight_duration; + uint32 uiTotal_dawn; + uint32 uiTotal_scourge; + uint32 uiSummon_counter; + + // Darion Mograine + uint32 uiAnti_magic_zone; + uint32 uiDeath_strike; + uint32 uiDeath_embrace; + uint32 uiIcy_touch; + uint32 uiUnholy_blight; + uint32 uiFight_speech; + uint32 uiSpawncheck; + uint32 uiTargetcheck; + + // Dawn + uint64 uiTirionGUID; + uint64 uiAlexandrosGUID; + uint64 uiDarionGUID; + uint64 uiKorfaxGUID; + uint64 uiMaxwellGUID; + uint64 uiEligorGUID; + uint64 uiRayneGUID; + uint64 uiDefenderGUID[ENCOUNTER_DEFENDER_NUMBER]; + uint64 uiEarthshatterGUID[ENCOUNTER_EARTHSHATTER_NUMBER]; + + // Death + uint64 uiKoltiraGUID; + uint64 uiOrbazGUID; + uint64 uiThassarianGUID; + uint64 uiLichKingGUID; + uint64 uiAbominationGUID[ENCOUNTER_ABOMINATION_NUMBER]; + uint64 uiBehemothGUID[ENCOUNTER_BEHEMOTH_NUMBER]; + uint64 uiGhoulGUID[ENCOUNTER_GHOUL_NUMBER]; + uint64 uiWarriorGUID[ENCOUNTER_WARRIOR_NUMBER]; + + void Reset() + { + if (!HasEscortState(STATE_ESCORT_ESCORTING)) + { + bIsBattle = false; + uiStep = 0; + uiPhase_timer = 3000; + uiFight_duration = 300000; // 5 minutes + uiTotal_dawn = ENCOUNTER_TOTAL_DAWN; + uiTotal_scourge = ENCOUNTER_TOTAL_SCOURGE; + uiSummon_counter = 0; + + uiAnti_magic_zone = urand(1000,6000); + uiDeath_strike = urand(5000,10000); + uiDeath_embrace = urand(5000,10000); + uiIcy_touch = urand(5000,10000); + uiUnholy_blight = urand(5000,10000); + + uiFight_speech = 15000; + uiSpawncheck = 1000; + uiTargetcheck = 10000; + + me->SetStandState(UNIT_STAND_STATE_STAND); + me->Mount(25279); + me->SetVisibility(VISIBILITY_ON); + + UpdateWorldState(me->GetMap(), WORLD_STATE_REMAINS, 0); + //UpdateWorldState(me->GetMap(), WORLD_STATE_COUNTDOWN, 0); + UpdateWorldState(me->GetMap(), WORLD_STATE_EVENT_BEGIN, 0); + + if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) + pTemp->setDeathState(JUST_DIED); + if (Creature* pTemp = Unit::GetCreature(*me, uiKorfaxGUID)) + pTemp->setDeathState(JUST_DIED); + if (Creature* pTemp = Unit::GetCreature(*me, uiMaxwellGUID)) + pTemp->setDeathState(JUST_DIED); + if (Creature* pTemp = Unit::GetCreature(*me, uiEligorGUID)) + pTemp->setDeathState(JUST_DIED); + if (Creature* pTemp = Unit::GetCreature(*me, uiRayneGUID)) + pTemp->setDeathState(JUST_DIED); + + uiTirionGUID = NULL; + uiKorfaxGUID = NULL; + uiMaxwellGUID = NULL; + uiEligorGUID = NULL; + uiRayneGUID = NULL; + + for (uint8 i = 0; i < ENCOUNTER_DEFENDER_NUMBER; ++i) + { + if (Creature* pTemp = Unit::GetCreature(*me, uiDefenderGUID[i])) + pTemp->setDeathState(JUST_DIED); + uiDefenderGUID[i] = 0; + } + for (uint8 i = 0; i < ENCOUNTER_EARTHSHATTER_NUMBER; ++i) + { + if (Creature* pTemp = Unit::GetCreature(*me, uiEarthshatterGUID[i])) + pTemp->setDeathState(JUST_DIED); + uiEarthshatterGUID[i] = 0; + } + + if (Creature* pTemp = Unit::GetCreature(*me, uiKoltiraGUID)) + pTemp->setDeathState(JUST_DIED); + if (Creature* pTemp = Unit::GetCreature(*me, uiOrbazGUID)) + pTemp->setDeathState(JUST_DIED); + if (Creature* pTemp = Unit::GetCreature(*me, uiThassarianGUID)) + pTemp->setDeathState(JUST_DIED); + if (Creature* pTemp = Unit::GetCreature(*me, uiLichKingGUID)) + pTemp->setDeathState(JUST_DIED); + + uiKoltiraGUID = NULL; + uiOrbazGUID = NULL; + uiThassarianGUID = NULL; + uiLichKingGUID = NULL; + for (uint8 i = 0; i < ENCOUNTER_ABOMINATION_NUMBER; ++i) + { + if (Creature* pTemp = Unit::GetCreature(*me, uiAbominationGUID[i])) + pTemp->setDeathState(JUST_DIED); + uiAbominationGUID[i] = 0; + } + for (uint8 i = 0; i < ENCOUNTER_BEHEMOTH_NUMBER; ++i) + { + if (Creature* pTemp = Unit::GetCreature(*me, uiBehemothGUID[i])) + pTemp->setDeathState(JUST_DIED); + uiBehemothGUID[i] = 0; + } + for (uint8 i = 0; i < ENCOUNTER_GHOUL_NUMBER; ++i) + { + if (Creature* pTemp = Unit::GetCreature(*me, uiGhoulGUID[i])) + pTemp->setDeathState(JUST_DIED); + uiGhoulGUID[i] = 0; + } + for (uint8 i = 0; i < ENCOUNTER_WARRIOR_NUMBER; ++i) + { + if (Creature* pTemp = Unit::GetCreature(*me, uiWarriorGUID[i])) + pTemp->setDeathState(JUST_DIED); + uiWarriorGUID[i] = 0; + } + } + } + + void AttackStart(Unit* who) + { + if (!who) + return; + + if (who == me) + return; + + if (me->Attack(who, true)) + { + me->AddThreat(who, 0.0f); + me->SetInCombatWith(who); + who->SetInCombatWith(me); + DoStartMovement(who); + } + } + + void MoveInLineOfSight(Unit* who) + { + if (!who) + return; + + if (who->isTargetableForAttack() && me->IsHostileTo(who)) + if (me->IsWithinDistInMap(who, 20) && me->IsWithinLOSInMap(who)) + AttackStart(who); + } + + void SetHoldState(bool bOnHold) + { + SetEscortPaused(bOnHold); + } + + void WaypointReached(uint32 i) + { + switch (i) + { + case 0: + me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + SetHoldState(true); + break; + case 1: + SetHoldState(true); + + SpawnNPC(); + if (Creature* pTemp = Unit::GetCreature(*me, uiKorfaxGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN07, pTemp); + if (Creature* pTemp = Unit::GetCreature(*me, uiMaxwellGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN08, pTemp); + + for (uint8 i = 0; i < ENCOUNTER_GHOUL_NUMBER; ++i) + NPCChangeTarget(uiGhoulGUID[i]); + for (uint8 i = 0; i < ENCOUNTER_WARRIOR_NUMBER; ++i) + NPCChangeTarget(uiWarriorGUID[i]); + for (uint8 i = 0; i < ENCOUNTER_ABOMINATION_NUMBER; ++i) + NPCChangeTarget(uiAbominationGUID[i]); + for (uint8 i = 0; i < ENCOUNTER_BEHEMOTH_NUMBER; ++i) + NPCChangeTarget(uiBehemothGUID[i]); + NPCChangeTarget(uiKoltiraGUID); + NPCChangeTarget(uiOrbazGUID); + NPCChangeTarget(uiThassarianGUID); + + me->Unmount(); + me->CastSpell(me, SPELL_THE_MIGHT_OF_MOGRAINE, true); // need to fix, on player only + + if (Creature* pTemp = Unit::GetCreature(*me, uiKoltiraGUID)) + pTemp->Unmount(); + if (Creature* pTemp = Unit::GetCreature(*me, uiThassarianGUID)) + pTemp->Unmount(); + + bIsBattle = true; + break; + case 2: + me->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + DoCast(me, SPELL_THE_LIGHT_OF_DAWN); + break; + case 3: + { + //Unit* pTirion = Unit::GetCreature(*me, uiTirionGUID); + + DoScriptText(EMOTE_LIGHT_OF_DAWN05, me); + if (me->HasAura(SPELL_THE_LIGHT_OF_DAWN, 0)) + me->RemoveAurasDueToSpell(SPELL_THE_LIGHT_OF_DAWN); + if (Creature* pTemp = Unit::GetCreature(*me, uiKoltiraGUID)) + { + if (pTemp->HasAura(SPELL_THE_LIGHT_OF_DAWN, 0)) + pTemp->RemoveAurasDueToSpell(SPELL_THE_LIGHT_OF_DAWN); + pTemp->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[19].x, LightofDawnLoc[19].y, LightofDawnLoc[19].z); + } + if (Creature* pTemp = Unit::GetCreature(*me, uiThassarianGUID)) + { + if (pTemp->HasAura(SPELL_THE_LIGHT_OF_DAWN, 0)) + pTemp->RemoveAurasDueToSpell(SPELL_THE_LIGHT_OF_DAWN); + pTemp->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[21].x, LightofDawnLoc[21].y, LightofDawnLoc[21].z); + } + if (Creature* pTemp = Unit::GetCreature(*me, uiKorfaxGUID)) + { + pTemp->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + pTemp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY2H); + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[10].x, LightofDawnLoc[10].y, LightofDawnLoc[10].z); + } + if (Creature* pTemp = Unit::GetCreature(*me, uiMaxwellGUID)) + { + pTemp->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[13].x, LightofDawnLoc[13].y, LightofDawnLoc[13].z); + } + if (Creature* pTemp = Unit::GetCreature(*me, uiEligorGUID)) + { + pTemp->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[16].x, LightofDawnLoc[16].y, LightofDawnLoc[16].z); + } + JumpToNextStep(10000); + } break; + case 4: + DoScriptText(SAY_LIGHT_OF_DAWN27, me); + me->SetStandState(UNIT_STAND_STATE_KNEEL); + + if (Creature* pTemp = Unit::GetCreature(*me, uiKoltiraGUID)) + pTemp->SetStandState(UNIT_STAND_STATE_KNEEL); + if (Creature* pTemp = Unit::GetCreature(*me, uiThassarianGUID)) + pTemp->SetStandState(UNIT_STAND_STATE_KNEEL); + SetHoldState(true); + break; + case 5: + DoScriptText(SAY_LIGHT_OF_DAWN33, me); + SetHoldState(true); + break; + case 6: + SetHoldState(true); + me->HandleEmoteCommand(EMOTE_ONESHOT_SPECIALATTACK1H); + JumpToNextStep(1000); + break; + case 7: + SetHoldState(true); + JumpToNextStep(2000); + break; + case 8: + me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(EQUIP_UNEQUIP)); + if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) + me->CastSpell(pTemp, SPELL_ASHBRINGER, true); + DoScriptText(EMOTE_LIGHT_OF_DAWN14, me); + SetHoldState(true); + break; + } + } + + void EnterEvadeMode() + { + if (!bIsBattle)//do not reset self if we are in battle + npc_escortAI::EnterEvadeMode(); + } + + void UpdateAI(const uint32 diff) + { + npc_escortAI::UpdateAI(diff); + + if (!bIsBattle) + { + if (uiPhase_timer <= diff) + { + // ******* Before battle ***************************************************************** + switch (uiStep) + { + case 0: // countdown + //UpdateWorldState(me->GetMap(), WORLD_STATE_COUNTDOWN, 1); + break; + + case 1: // just delay + //UpdateWorldState(me->GetMap(), WORLD_STATE_REMAINS, 1); + UpdateWorldState(me->GetMap(), WORLD_STATE_COUNTDOWN, 0); + UpdateWorldState(me->GetMap(), WORLD_STATE_EVENT_BEGIN, 1); + me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + JumpToNextStep(3000); + break; + + case 2: + DoScriptText(SAY_LIGHT_OF_DAWN04, me); + if (Creature* pKoltira = GetClosestCreatureWithEntry(me, NPC_KOLTIRA_DEATHWEAVER, 50.0f)) + uiKoltiraGUID = pKoltira->GetGUID(); + if (Creature* pOrbaz = GetClosestCreatureWithEntry(me, NPC_ORBAZ_BLOODBANE, 50.0f)) + uiOrbazGUID = pOrbaz->GetGUID(); + if (Creature* pThassarian = GetClosestCreatureWithEntry(me, NPC_THASSARIAN, 50.0f)) + uiThassarianGUID = pThassarian->GetGUID(); + JumpToNextStep(10000); + break; + + case 3: // rise + DoScriptText(SAY_LIGHT_OF_DAWN05, me); + JumpToNextStep(3000); + break; + + case 4: // summon ghoul + // Dunno whats the summon spell, so workaround + DoCast(me, 33271); // shack effect + uiPhase_timer = 500; + if (uiSummon_counter < ENCOUNTER_GHOUL_NUMBER) + { + Unit* pTemp = me->SummonCreature(NPC_ACHERUS_GHOUL, (me->GetPositionX()-20)+rand()%40, (me->GetPositionY()-20)+rand()%40, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); + pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + pTemp->setFaction(2084); + uiGhoulGUID[uiSummon_counter] = pTemp->GetGUID(); + ++uiSummon_counter; + } + else + { + uiSummon_counter = 0; + ++uiStep; + } + break; + + case 5: // summon abomination + DoCast(me, 33271); // shack effect + uiPhase_timer = 500; + if (uiSummon_counter < ENCOUNTER_ABOMINATION_NUMBER) + { + Unit* pTemp = me->SummonCreature(NPC_RAMPAGING_ABOMINATION, (me->GetPositionX()-20)+rand()%40, (me->GetPositionY()-20)+rand()%40, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); + pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + pTemp->setFaction(2084); + uiAbominationGUID[uiSummon_counter] = pTemp->GetGUID(); + ++uiSummon_counter; + } + else + { + uiSummon_counter = 0; + ++uiStep; + } + break; + + case 6: // summon warrior + DoCast(me, 33271); // shack effect + uiPhase_timer = 500; + if (uiSummon_counter < ENCOUNTER_WARRIOR_NUMBER) + { + Unit* pTemp = me->SummonCreature(NPC_WARRIOR_OF_THE_FROZEN_WASTES, (me->GetPositionX()-20)+rand()%40, (me->GetPositionY()-20)+rand()%40, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); + pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + pTemp->setFaction(2084); + uiWarriorGUID[uiSummon_counter] = pTemp->GetGUID(); + ++uiSummon_counter; + } + else + { + uiSummon_counter = 0; + ++uiStep; + } + break; + + case 7: // summon warrior + DoCast(me, 33271); // shack effect + uiPhase_timer = 500; + if (uiSummon_counter < ENCOUNTER_BEHEMOTH_NUMBER) + { + Unit* pTemp = me->SummonCreature(NPC_FLESH_BEHEMOTH, (me->GetPositionX()-20)+rand()%40, (me->GetPositionY()-20)+rand()%40, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); + pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + pTemp->setFaction(2084); + uiBehemothGUID[uiSummon_counter] = pTemp->GetGUID(); + ++uiSummon_counter; + } + else + { + uiSummon_counter = 0; + ++uiStep; + } + break; + + case 8: // summon announce + DoScriptText(SAY_LIGHT_OF_DAWN06, me); + JumpToNextStep(5000); + break; + + case 9: // charge begins + SetHoldState(false); + if (Creature* pTemp = Unit::GetCreature(*me, uiKoltiraGUID)) + { + pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z); + } + if (Creature* pTemp = Unit::GetCreature(*me, uiOrbazGUID)) + { + pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z); + } + if (Creature* pTemp = Unit::GetCreature(*me, uiThassarianGUID)) + { + pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z); + } + for (uint8 i = 0; i < ENCOUNTER_ABOMINATION_NUMBER; ++i) + if (Creature* pTemp = Unit::GetCreature(*me, uiAbominationGUID[i])) + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z); + for (uint8 i = 0; i < ENCOUNTER_BEHEMOTH_NUMBER; ++i) + if (Creature* pTemp = Unit::GetCreature(*me, uiBehemothGUID[i])) + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z); + for (uint8 i = 0; i < ENCOUNTER_GHOUL_NUMBER; ++i) + if (Creature* pTemp = Unit::GetCreature(*me, uiGhoulGUID[i])) + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z); + for (uint8 i = 0; i < ENCOUNTER_WARRIOR_NUMBER; ++i) + if (Creature* pTemp = Unit::GetCreature(*me, uiWarriorGUID[i])) + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z); + JumpToNextStep(5000); + break; + + // ******* After battle ***************************************************************** + case 11: // Tirion starts to speak + if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN28, pTemp); + JumpToNextStep(21000); + break; + + case 12: + if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN29, pTemp); + JumpToNextStep(13000); + break; + + case 13: + if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN30, pTemp); + JumpToNextStep(13000); + break; + + case 14: + me->SetStandState(UNIT_STAND_STATE_STAND); + DoScriptText(SAY_LIGHT_OF_DAWN31, me); + JumpToNextStep(7000); + break; + + case 15: // summon gate + if (Unit* pTemp = me->SummonCreature(NPC_HIGHLORD_ALEXANDROS_MOGRAINE, LightofDawnLoc[22].x, LightofDawnLoc[22].y, LightofDawnLoc[22].z, LightofDawnLoc[22].o, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000)) + { + pTemp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + pTemp->CastSpell(pTemp, SPELL_ALEXANDROS_MOGRAINE_SPAWN, true); + DoScriptText(EMOTE_LIGHT_OF_DAWN06, pTemp); + uiAlexandrosGUID = pTemp->GetGUID(); + } + JumpToNextStep(4000); + break; + + case 16: // Alexandros out + if (Creature* pTemp = Unit::GetCreature(*me, uiAlexandrosGUID)) + { + pTemp->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[23].x, LightofDawnLoc[23].y, LightofDawnLoc[23].z); + DoScriptText(SAY_LIGHT_OF_DAWN32, pTemp); + } + SetHoldState(false); // makes darion turns back + JumpToNextStep(5000); + break; + + case 17: + me->SetStandState(UNIT_STAND_STATE_KNEEL); + DoScriptText(SAY_LIGHT_OF_DAWN34, me); + JumpToNextStep(5000); + break; + + case 18: // Darion's spirit out + if (Unit* pTemp = me->SummonCreature(NPC_DARION_MOGRAINE, LightofDawnLoc[24].x, LightofDawnLoc[24].y, LightofDawnLoc[24].z, LightofDawnLoc[24].o, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000)) + { + DoScriptText(SAY_LIGHT_OF_DAWN35, pTemp); + pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + uiDarionGUID = pTemp->GetGUID(); + } + JumpToNextStep(4000); + break; + + case 19: // runs to father + if (Creature* pTemp = Unit::GetCreature(*me, uiDarionGUID)) + { + DoScriptText(EMOTE_LIGHT_OF_DAWN07, pTemp); + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[25].x, LightofDawnLoc[25].y, LightofDawnLoc[25].z); + } + JumpToNextStep(4000); + break; + + case 20: + if (Creature* pTemp = Unit::GetCreature(*me, uiDarionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN36, pTemp); + JumpToNextStep(4000); + break; + + case 21: + if (Creature* pTemp = Unit::GetCreature(*me, uiDarionGUID)) + DoScriptText(EMOTE_LIGHT_OF_DAWN08, pTemp); + JumpToNextStep(4000); + break; + + case 22: + if (Creature* pTemp = Unit::GetCreature(*me, uiAlexandrosGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN37, pTemp); + JumpToNextStep(8000); + break; + + case 23: + if (Creature* pTemp = Unit::GetCreature(*me, uiDarionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN38, pTemp); + JumpToNextStep(8000); + break; + + case 24: + if (Creature* pTemp = Unit::GetCreature(*me, uiAlexandrosGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN39, pTemp); + + if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) // Tirion moves forward here + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[1].x, LightofDawnLoc[1].y, LightofDawnLoc[1].z); + + JumpToNextStep(15000); + break; + + case 25: + if (Creature* pTemp = Unit::GetCreature(*me, uiDarionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN40, pTemp); + JumpToNextStep(11000); + break; + + case 26: + if (Creature* pTemp = Unit::GetCreature(*me, uiAlexandrosGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN41, pTemp); + JumpToNextStep(5000); + break; + + case 27: + if (Creature* pTemp = Unit::GetCreature(*me, uiDarionGUID)) + pTemp->setDeathState(JUST_DIED); + JumpToNextStep(24000); + break; + + case 28: + if (Creature* pTemp = Unit::GetCreature(*me, uiAlexandrosGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN42, pTemp); + JumpToNextStep(6000); + break; + + case 29: // lich king spawns + if (Unit* pTemp = me->SummonCreature(NPC_THE_LICH_KING, LightofDawnLoc[26].x, LightofDawnLoc[26].y, LightofDawnLoc[26].z, LightofDawnLoc[26].o, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000)) + { + DoScriptText(SAY_LIGHT_OF_DAWN43, pTemp); + uiLichKingGUID = pTemp->GetGUID(); + if (Unit* pAlex = Unit::GetCreature(*me, uiAlexandrosGUID)) + pTemp->CastSpell(pAlex, SPELL_SOUL_FEAST_ALEX, false); + } + JumpToNextStep(2000); + break; + + case 30: + if (Creature* pTemp = Unit::GetCreature(*me, uiAlexandrosGUID)) // just hide him + { + DoScriptText(EMOTE_LIGHT_OF_DAWN09, pTemp); + pTemp->SetVisibility(VISIBILITY_OFF); + } + if (Creature* pTemp = Unit::GetCreature(*me, uiLichKingGUID)) + { + pTemp->InterruptNonMeleeSpells(false); + DoScriptText(SAY_LIGHT_OF_DAWN45, pTemp); + } + JumpToNextStep(3000); + break; + + case 31: + me->SetStandState(UNIT_STAND_STATE_STAND); + DoScriptText(EMOTE_LIGHT_OF_DAWN10, me); + DoScriptText(SAY_LIGHT_OF_DAWN44, me); + JumpToNextStep(3000); + break; + + case 32: + if (Creature* pTemp = Unit::GetCreature(*me, uiLichKingGUID)) + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[27].x, LightofDawnLoc[27].y, LightofDawnLoc[27].z); + JumpToNextStep(6000); + break; + + case 33: // Darion supports to jump to lich king here + if (Creature* pTemp = Unit::GetCreature(*me, uiLichKingGUID)) + DoCast(me, SPELL_MOGRAINE_CHARGE); // jumping charge +// doesn't make it looks well, so workarounds, Darion charges, looks better + me->SetSpeed(MOVE_RUN, 3.0f); + me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + SetHoldState(false); + JumpToNextStep(0); + break; + + case 35: // Lich king counterattacks + if (Creature* pTemp = Unit::GetCreature(*me, uiLichKingGUID)) + { + pTemp->HandleEmoteCommand(EMOTE_ONESHOT_KICK); + DoScriptText(SAY_LIGHT_OF_DAWN46, pTemp); + } + me->SetSpeed(MOVE_RUN, 6.0f); + me->SetStandState(UNIT_STAND_STATE_DEAD); + SetHoldState(false); // Darion got kicked by lich king + JumpToNextStep(0); + break; + + case 37: // Lich king counterattacks + me->SetStandState(UNIT_STAND_STATE_KNEEL); + JumpToNextStep(3000); + break; + + case 38: + if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN47, pTemp); + JumpToNextStep(8000); + break; + + case 39: + if (Creature* pTemp = Unit::GetCreature(*me, uiLichKingGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN48, pTemp); + JumpToNextStep(15000); + break; + + case 40: + if (Creature* pTemp = Unit::GetCreature(*me, uiLichKingGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN49, pTemp); + JumpToNextStep(17000); + break; + + case 41: // Lich king - Apocalypse + if (Creature* pTemp = Unit::GetCreature(*me, uiLichKingGUID)) + { + DoScriptText(EMOTE_LIGHT_OF_DAWN11, pTemp); + DoScriptText(SAY_LIGHT_OF_DAWN51, pTemp); + if (Unit* pTirion = Unit::GetCreature(*me, uiTirionGUID)) + { + pTirion->SetStandState(UNIT_STAND_STATE_KNEEL); + //pTemp->CastSpell(pTirion, SPELL_APOCALYPSE, false); // not working + pTemp->CastSpell(pTirion, SPELL_SOUL_FEAST_TIRION, false); + DoScriptText(EMOTE_LIGHT_OF_DAWN12, pTirion); + } + } + JumpToNextStep(2000); + break; + + case 42: // Maxwell yells for attack + { + float fLichPositionX = 0, + fLichPositionY = 0, + fLichPositionZ = 0; + if (Creature* pTemp = Unit::GetCreature(*me, uiLichKingGUID)) + { + fLichPositionX = pTemp->GetPositionX(); + fLichPositionY = pTemp->GetPositionY(); + fLichPositionZ = pTemp->GetPositionZ(); + } + + if (fLichPositionX && fLichPositionY) + { + Unit* pTemp; + pTemp = me->SummonCreature(NPC_DEFENDER_OF_THE_LIGHT, LightofDawnLoc[0].x+rand()%10, LightofDawnLoc[0].y+rand()%10, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000); + pTemp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED); + pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + pTemp->SetSpeed(MOVE_RUN, 2.0f); + pTemp->setFaction(me->getFaction()); + pTemp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ); + uiDefenderGUID[0] = pTemp->GetGUID(); + + pTemp = me->SummonCreature(NPC_RIMBLAT_EARTHSHATTER, LightofDawnLoc[0].x+rand()%10, LightofDawnLoc[0].y+rand()%10, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000); + pTemp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED); + pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + pTemp->SetSpeed(MOVE_RUN, 2.0f); + pTemp->setFaction(me->getFaction()); + pTemp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ); + uiEarthshatterGUID[0] = pTemp->GetGUID(); + } + if (Creature* pTemp = Unit::GetCreature(*me, uiMaxwellGUID)) + { + pTemp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED); + pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + pTemp->SetSpeed(MOVE_RUN, 2.0f); + pTemp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ); + DoScriptText(SAY_LIGHT_OF_DAWN50, pTemp); + } + if (Creature* pTemp = Unit::GetCreature(*me, uiKorfaxGUID)) + { + pTemp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED); + pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + pTemp->SetSpeed(MOVE_RUN, 2.0f); + pTemp->HandleEmoteCommand(EMOTE_STATE_ATTACK_UNARMED); + pTemp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ); + } + if (Creature* pTemp = Unit::GetCreature(*me, uiEligorGUID)) + { + pTemp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED); + pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + pTemp->SetSpeed(MOVE_RUN, 2.0f); + pTemp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ); + } + } + JumpToNextStep(4500); + break; + + case 43: // They all got kicked + if (Creature* pTemp = Unit::GetCreature(*me, uiLichKingGUID)) + DoScriptText(EMOTE_LIGHT_OF_DAWN13, pTemp); + + if (Creature* pTemp = Unit::GetCreature(*me, uiMaxwellGUID)) + { + pTemp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE); + pTemp->SetSpeed(MOVE_RUN, 6.0f); + pTemp->SetStandState(UNIT_STAND_STATE_DEAD); + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[14].x, LightofDawnLoc[14].y, LightofDawnLoc[14].z); + } + if (Creature* pTemp = Unit::GetCreature(*me, uiKorfaxGUID)) + { + pTemp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE); + pTemp->SetSpeed(MOVE_RUN, 6.0f); + pTemp->SetStandState(UNIT_STAND_STATE_DEAD); + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[11].x, LightofDawnLoc[11].y, LightofDawnLoc[11].z); + } + if (Creature* pTemp = Unit::GetCreature(*me, uiEligorGUID)) + { + pTemp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE); + pTemp->SetSpeed(MOVE_RUN, 6.0f); + pTemp->SetStandState(UNIT_STAND_STATE_DEAD); + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[17].x, LightofDawnLoc[17].y, LightofDawnLoc[17].z); + } + if (Creature* pTemp = Unit::GetCreature(*me, uiDefenderGUID[0])) + { + pTemp->SetSpeed(MOVE_RUN, 6.0f); + pTemp->SetStandState(UNIT_STAND_STATE_DEAD); + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%10, LightofDawnLoc[0].y+rand()%10, LightofDawnLoc[0].z); + } + if (Creature* pTemp = Unit::GetCreature(*me, uiEarthshatterGUID[0])) + { + pTemp->SetSpeed(MOVE_RUN, 6.0f); + pTemp->SetStandState(UNIT_STAND_STATE_DEAD); + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%10, LightofDawnLoc[0].y+rand()%10, LightofDawnLoc[0].z); + } + JumpToNextStep(3000); + break; + + case 44: // make them stand up + if (Creature* pTemp = Unit::GetCreature(*me, uiMaxwellGUID)) + pTemp->SetStandState(UNIT_STAND_STATE_STAND); + if (Creature* pTemp = Unit::GetCreature(*me, uiKorfaxGUID)) + pTemp->SetStandState(UNIT_STAND_STATE_STAND); + if (Creature* pTemp = Unit::GetCreature(*me, uiEligorGUID)) + pTemp->SetStandState(UNIT_STAND_STATE_STAND); + JumpToNextStep(1000); + break; + + case 45: + DoScriptText(SAY_LIGHT_OF_DAWN52, me); + JumpToNextStep(5000); + break; + + case 46: // Darion stand up, "not today" + me->SetSpeed(MOVE_RUN, 1.0f); + me->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + me->SetStandState(UNIT_STAND_STATE_STAND); + DoScriptText(SAY_LIGHT_OF_DAWN53, me); + SetHoldState(false); // Darion throws sword + JumpToNextStep(7000); + break; + + case 47: // Ashbringer rebirth + me->SetStandState(UNIT_STAND_STATE_KNEEL); + DoScriptText(EMOTE_LIGHT_OF_DAWN15, me); + if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) + { + pTemp->SetStandState(UNIT_STAND_STATE_STAND); + pTemp->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(EQUIP_HIGHLORD_TIRION_FORDRING)); + pTemp->CastSpell(pTemp, SPELL_REBIRTH_OF_THE_ASHBRINGER, false); + } + JumpToNextStep(1000); + break; + + case 48: // Show the cleansing effect (dawn of light) + //if (GameObject* pGo = me->GetMap()->GetGameObject(uiDawnofLightGUID)) + // pGo->SetPhaseMask(128, true); + me->SummonGameObject(GO_LIGHT_OF_DAWN, 2283.896, -5287.914, 83.066, 0, 0, 0, 0, 0, 30000); + if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) + { + if (pTemp->HasAura(SPELL_REBIRTH_OF_THE_ASHBRINGER, 0)) + pTemp->RemoveAurasDueToSpell(SPELL_REBIRTH_OF_THE_ASHBRINGER); + pTemp->CastSpell(pTemp, 41542, false); // workarounds, light expoded, makes it cool + pTemp->HandleEmoteCommand(EMOTE_ONESHOT_ROAR); + } + if (Creature* pTemp = Unit::GetCreature(*me, uiLichKingGUID)) + pTemp->InterruptNonMeleeSpells(false); + JumpToNextStep(2500); + break; + + case 49: + if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN54, pTemp); + JumpToNextStep(4000); + break; + + case 50: + if (Creature* pTemp = Unit::GetCreature(*me, uiLichKingGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN55, pTemp); + JumpToNextStep(5000); + break; + + case 51: + if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN56, pTemp); + JumpToNextStep(1000); + break; + + case 52: // Tiron charges + if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) + { + DoScriptText(EMOTE_LIGHT_OF_DAWN16, pTemp); + pTemp->CastSpell(pTemp, SPELL_TIRION_CHARGE, false); // jumping charge + pTemp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY2H); + pTemp->SetSpeed(MOVE_RUN, 3.0f); // workarounds, make Tirion still running + pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[2].x, LightofDawnLoc[2].y, LightofDawnLoc[2].z); + if (Creature* pTemp = Unit::GetCreature(*me, uiLichKingGUID)) + pTemp->Relocate(LightofDawnLoc[28].x, LightofDawnLoc[28].y, LightofDawnLoc[28].z); // workarounds, he should kick back by Tirion, but here we relocate him + } + JumpToNextStep(1500); + break; + + case 53: + if (Creature* pTemp = Unit::GetCreature(*me, uiLichKingGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN57, pTemp); + JumpToNextStep(1000); + break; + + case 54: + if (Creature* pTemp = Unit::GetCreature(*me, uiLichKingGUID)) + { + pTemp->SetSpeed(MOVE_RUN, 1.0f); + me->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[29].x, LightofDawnLoc[29].y, LightofDawnLoc[29].z); // 26 + } + JumpToNextStep(4000); + break; + + case 55: + if (Creature* pTemp = Unit::GetCreature(*me, uiLichKingGUID)) + pTemp->SetStandState(UNIT_STAND_STATE_KNEEL); + JumpToNextStep(2000); + break; + + case 56: + if (Creature* pTemp = Unit::GetCreature(*me, uiLichKingGUID)) + pTemp->SetStandState(UNIT_STAND_STATE_STAND); + JumpToNextStep(1500); + break; + + case 57: + if (Creature* pTemp = Unit::GetCreature(*me, uiLichKingGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN58, pTemp); + JumpToNextStep(10000); + break; + + case 58: + if (Creature* pTemp = Unit::GetCreature(*me, uiLichKingGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN59, pTemp); + JumpToNextStep(10000); + break; + + case 59: + if (Creature* pTemp = Unit::GetCreature(*me, uiLichKingGUID)) + pTemp->CastSpell(pTemp, SPELL_TELEPORT_VISUAL, false); + if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) // Tirion runs to Darion + { + pTemp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE); + pTemp->SetSpeed(MOVE_RUN, 1.0f); + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[6].x, LightofDawnLoc[6].y, LightofDawnLoc[6].z); + } + JumpToNextStep(2500); + break; + + case 60: + if (Creature* pTemp = Unit::GetCreature(*me, uiLichKingGUID)) // Lich king disappears here + { + DoScriptText(EMOTE_LIGHT_OF_DAWN17, pTemp); + pTemp->Kill(pTemp); + } + JumpToNextStep(10000); + break; + + case 61: + if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN60, pTemp); + JumpToNextStep(3000); + break; + + case 62: + if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) + { + pTemp->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[7].x, LightofDawnLoc[7].y, LightofDawnLoc[7].z); + } + JumpToNextStep(5500); + break; + + case 63: + if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) + { + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[8].x, LightofDawnLoc[8].y, LightofDawnLoc[8].z); + DoScriptText(SAY_LIGHT_OF_DAWN61, pTemp); + } + JumpToNextStep(15000); + break; + + case 64: + if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN62, pTemp); + JumpToNextStep(7000); + break; + + case 65: + if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN63, pTemp); + JumpToNextStep(10000); + break; + + case 66: + if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN64, pTemp); + JumpToNextStep(11000); + break; + + case 67: + if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN65, pTemp); + JumpToNextStep(10000); + break; + + case 68: + if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN66, pTemp); + JumpToNextStep(8000); + break; + + case 69: + if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN67, pTemp); + JumpToNextStep(10000); + break; + + case 70: + me->SetStandState(UNIT_STAND_STATE_STAND); + DoScriptText(SAY_LIGHT_OF_DAWN68, me); + JumpToNextStep(10000); + break; + + case 71: + //if (GameObject* pGo = me->GetMap()->GetGameObject(uiDawnofLightGUID)) // Turn off dawn of light + // pGo->SetPhaseMask(0, true); + + { + Map *map = me->GetMap(); // search players with in 50 yards for quest credit + Map::PlayerList const &PlayerList = map->GetPlayers(); + if (!PlayerList.isEmpty()) + { + for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) + if (i->getSource()->isAlive() && me->IsWithinDistInMap(i->getSource(), 50)) + i->getSource()->CastSpell(i->getSource(), SPELL_THE_LIGHT_OF_DAWN_Q, false); + } + } + me->SetVisibility(VISIBILITY_OFF); // respawns another Darion for quest turn in + me->SummonCreature(NPC_HIGHLORD_DARION_MOGRAINE, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 180000); + JumpToNextStep(1000); + break; + + case 72: + SetHoldState(false); // Escort ends + JumpToNextStep(25000); + break; + + case 73: + me->ForcedDespawn(); + break; + } + + } else uiPhase_timer -= diff; + } + + // ******* During battle ***************************************************************** + else + { + if (uiAnti_magic_zone <= diff) + { + DoCast(me, SPELL_ANTI_MAGIC_ZONE1); + uiAnti_magic_zone = 25000 + rand()%5000; + } else uiAnti_magic_zone -= diff; + + if (uiDeath_strike <= diff) + { + DoCast(me->getVictim(), SPELL_DEATH_STRIKE); + uiDeath_strike = 5000 + rand()%5000; + } else uiDeath_strike -= diff; + + if (uiDeath_embrace <= diff) + { + DoCast(me->getVictim(), SPELL_DEATH_EMBRACE); + uiDeath_embrace = 5000 + rand()%5000; + } else uiDeath_embrace -= diff; + + if (uiIcy_touch <= diff) + { + DoCast(me->getVictim(), SPELL_ICY_TOUCH1); + uiIcy_touch = 5000 + rand()%5000; + } else uiIcy_touch -= diff; + + if (uiUnholy_blight <= diff) + { + DoCast(me->getVictim(), SPELL_UNHOLY_BLIGHT); + uiUnholy_blight = 5000 + rand()%5000; + } else uiUnholy_blight -= diff; + + if (uiFight_speech <= diff) + { + DoScriptText(RAND(SAY_LIGHT_OF_DAWN09,SAY_LIGHT_OF_DAWN10,SAY_LIGHT_OF_DAWN11, + SAY_LIGHT_OF_DAWN12,SAY_LIGHT_OF_DAWN13,SAY_LIGHT_OF_DAWN14, + SAY_LIGHT_OF_DAWN15,SAY_LIGHT_OF_DAWN16,SAY_LIGHT_OF_DAWN17, + SAY_LIGHT_OF_DAWN18,SAY_LIGHT_OF_DAWN19,SAY_LIGHT_OF_DAWN20, + SAY_LIGHT_OF_DAWN21,SAY_LIGHT_OF_DAWN22,SAY_LIGHT_OF_DAWN23, + SAY_LIGHT_OF_DAWN24), me); + uiFight_speech = 15000 + rand()%5000; + } else uiFight_speech -= diff; + + // Check spawns + if (uiSpawncheck <= diff) + { + SpawnNPC(); + uiSpawncheck = 1000; + } else uiSpawncheck -= diff; + + // Check targets + if (uiTargetcheck <= diff) + { + for (uint8 i = 0; i < ENCOUNTER_GHOUL_NUMBER; ++i) + NPCChangeTarget(uiGhoulGUID[i]); + for (uint8 i = 0; i < ENCOUNTER_WARRIOR_NUMBER; ++i) + NPCChangeTarget(uiWarriorGUID[i]); + for (uint8 i = 0; i < ENCOUNTER_ABOMINATION_NUMBER; ++i) + NPCChangeTarget(uiAbominationGUID[i]); + for (uint8 i = 0; i < ENCOUNTER_BEHEMOTH_NUMBER; ++i) + NPCChangeTarget(uiBehemothGUID[i]); + NPCChangeTarget(uiKoltiraGUID); + NPCChangeTarget(uiOrbazGUID); + NPCChangeTarget(uiThassarianGUID); + + uiTargetcheck = 10000; + } else uiTargetcheck -= diff; + + // Battle end + if (uiFight_duration <= diff + 5000) + { + if (!uiTirionGUID) + if (Unit* pTemp = me->SummonCreature(NPC_HIGHLORD_TIRION_FORDRING, LightofDawnLoc[0].x, LightofDawnLoc[0].y, LightofDawnLoc[0].z, 1.528, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 600000)) + { + pTemp->setFaction(me->getFaction()); + pTemp->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(EQUIP_UNEQUIP)); + DoScriptText(SAY_LIGHT_OF_DAWN25, pTemp); + uiTirionGUID = pTemp->GetGUID(); + } + } + if (uiFight_duration <= diff) + { + bIsBattle = false; + uiFight_duration = 300000; + + if (me->HasAura(SPELL_THE_MIGHT_OF_MOGRAINE, 0)) + me->RemoveAurasDueToSpell(SPELL_THE_MIGHT_OF_MOGRAINE); + me->RemoveAllAuras(); + me->DeleteThreatList(); + me->CombatStop(true); + me->InterruptNonMeleeSpells(false); + me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + + for (uint8 i = 0; i < ENCOUNTER_DEFENDER_NUMBER; ++i) + DespawnNPC(uiDefenderGUID[i]); + for (uint8 i = 0; i < ENCOUNTER_EARTHSHATTER_NUMBER; ++i) + DespawnNPC(uiEarthshatterGUID[i]); + for (uint8 i = 0; i < ENCOUNTER_ABOMINATION_NUMBER; ++i) + DespawnNPC(uiAbominationGUID[i]); + for (uint8 i = 0; i < ENCOUNTER_BEHEMOTH_NUMBER; ++i) + DespawnNPC(uiBehemothGUID[i]); + for (uint8 i = 0; i < ENCOUNTER_GHOUL_NUMBER; ++i) + DespawnNPC(uiGhoulGUID[i]); + for (uint8 i = 0; i < ENCOUNTER_WARRIOR_NUMBER; ++i) + DespawnNPC(uiWarriorGUID[i]); + + if (Creature* pTemp = Unit::GetCreature(*me, uiKorfaxGUID)) + { + pTemp->RemoveAllAuras(); + pTemp->DeleteThreatList(); + pTemp->CombatStop(true); + pTemp->AttackStop(); + pTemp->setFaction(me->getFaction()); + pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[9].x, LightofDawnLoc[9].y, LightofDawnLoc[9].z); + } + + if (Creature* pTemp = Unit::GetCreature(*me, uiMaxwellGUID)) + { + pTemp->RemoveAllAuras(); + pTemp->DeleteThreatList(); + pTemp->CombatStop(true); + pTemp->AttackStop(); + pTemp->setFaction(me->getFaction()); + pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[12].x, LightofDawnLoc[12].y, LightofDawnLoc[12].z); + } + + if (Creature* pTemp = Unit::GetCreature(*me, uiEligorGUID)) + { + pTemp->RemoveAllAuras(); + pTemp->DeleteThreatList(); + pTemp->CombatStop(true); + pTemp->AttackStop(); + pTemp->setFaction(me->getFaction()); + pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[15].x, LightofDawnLoc[15].y, LightofDawnLoc[15].z); + } + DespawnNPC(uiRayneGUID); + + if (Creature* pTemp = Unit::GetCreature(*me, uiKoltiraGUID)) + { + pTemp->RemoveAllAuras(); + pTemp->DeleteThreatList(); + pTemp->CombatStop(true); + pTemp->AttackStop(); + pTemp->setFaction(me->getFaction()); + pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[18].x, LightofDawnLoc[18].y, LightofDawnLoc[18].z); + pTemp->CastSpell(pTemp, SPELL_THE_LIGHT_OF_DAWN, false); + } + + if (Creature* pTemp = Unit::GetCreature(*me, uiOrbazGUID)) + DoScriptText(EMOTE_LIGHT_OF_DAWN04, pTemp); + + if (Creature* pTemp = Unit::GetCreature(*me, uiThassarianGUID)) + { + pTemp->RemoveAllAuras(); + pTemp->DeleteThreatList(); + pTemp->CombatStop(true); + pTemp->AttackStop(); + pTemp->setFaction(me->getFaction()); + pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[20].x, LightofDawnLoc[20].y, LightofDawnLoc[20].z); + pTemp->CastSpell(pTemp, SPELL_THE_LIGHT_OF_DAWN, false); + } + + if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN26, pTemp); + + SetHoldState(false); + + } else uiFight_duration -= diff; + + DoMeleeAttackIfReady(); + } + } + + void JumpToNextStep(uint32 uiTimer) + { + uiPhase_timer = uiTimer; + ++uiStep; + } + + void NPCChangeTarget(uint64 ui_GUID) + { + if (Creature* pTemp = Unit::GetCreature(*me, ui_GUID)) + if (pTemp->isAlive()) + if (Unit* pTarger = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (pTarger->isAlive()) + { + // pTemp->DeleteThreatList(); + pTemp->AddThreat(pTarger, 0.0f); + pTemp->AI()->AttackStart(pTarger); + pTemp->SetInCombatWith(pTarger); + pTarger->SetInCombatWith(pTemp); + // pTemp->GetMotionMaster()->MoveChase(pTarger, 20.0f); + } + } + + void SpawnNPC() + { + Unit* pTemp = NULL; + + // Death + for (uint8 i = 0; i < ENCOUNTER_GHOUL_NUMBER; ++i) + { + pTemp = Unit::GetCreature(*me, uiGhoulGUID[i]); + if (!pTemp) + { + pTemp = me->SummonCreature(NPC_ACHERUS_GHOUL, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); + pTemp->setFaction(2084); + uiGhoulGUID[i] = pTemp->GetGUID(); + } + } + for (uint8 i = 0; i < ENCOUNTER_ABOMINATION_NUMBER; ++i) + { + pTemp = Unit::GetCreature(*me, uiAbominationGUID[i]); + if (!pTemp) + { + pTemp = me->SummonCreature(NPC_WARRIOR_OF_THE_FROZEN_WASTES, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); + pTemp->setFaction(2084); + uiAbominationGUID[i] = pTemp->GetGUID(); + } + } + for (uint8 i = 0; i < ENCOUNTER_WARRIOR_NUMBER; ++i) + { + pTemp = Unit::GetCreature(*me, uiWarriorGUID[i]); + if (!pTemp) + { + pTemp = me->SummonCreature(NPC_RAMPAGING_ABOMINATION, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); + pTemp->setFaction(2084); + uiWarriorGUID[i] = pTemp->GetGUID(); + } + } + for (uint8 i = 0; i < ENCOUNTER_BEHEMOTH_NUMBER; ++i) + { + pTemp = Unit::GetCreature(*me, uiBehemothGUID[i]); + if (!pTemp) + { + pTemp = me->SummonCreature(NPC_FLESH_BEHEMOTH, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); + pTemp->setFaction(2084); + uiBehemothGUID[i] = pTemp->GetGUID(); + } + } + + // Dawn + for (uint8 i = 0; i < ENCOUNTER_DEFENDER_NUMBER; ++i) + { + pTemp = Unit::GetCreature(*me, uiDefenderGUID[i]); + if (!pTemp) + { + pTemp = me->SummonCreature(NPC_DEFENDER_OF_THE_LIGHT, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); + pTemp->setFaction(2089); + me->AddThreat(pTemp, 0.0f); + uiDefenderGUID[i] = pTemp->GetGUID(); + } + } + for (uint8 i = 0; i < ENCOUNTER_EARTHSHATTER_NUMBER; ++i) + { + pTemp = Unit::GetCreature(*me, uiEarthshatterGUID[i]); + if (!pTemp) + { + pTemp = me->SummonCreature(NPC_RIMBLAT_EARTHSHATTER, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); + pTemp->setFaction(2089); + me->AddThreat(pTemp, 0.0f); + uiEarthshatterGUID[i] = pTemp->GetGUID(); + } + } + pTemp = Unit::GetCreature(*me, uiKorfaxGUID); + if (!pTemp) + { + pTemp = me->SummonCreature(NPC_KORFAX_CHAMPION_OF_THE_LIGHT, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 600000); + pTemp->setFaction(2089); + me->AddThreat(pTemp, 0.0f); + uiKorfaxGUID = pTemp->GetGUID(); + } + pTemp = Unit::GetCreature(*me, uiMaxwellGUID); + if (!pTemp) + { + pTemp = me->SummonCreature(NPC_LORD_MAXWELL_TYROSUS, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 600000); + pTemp->setFaction(2089); + me->AddThreat(pTemp, 0.0f); + uiMaxwellGUID = pTemp->GetGUID(); + } + pTemp = Unit::GetCreature(*me, uiEligorGUID); + if (!pTemp) + { + pTemp = me->SummonCreature(NPC_COMMANDER_ELIGOR_DAWNBRINGER, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 600000); + pTemp->setFaction(2089); + me->AddThreat(pTemp, 0.0f); + uiEligorGUID = pTemp->GetGUID(); + } + pTemp = Unit::GetCreature(*me, uiRayneGUID); + if (!pTemp) + { + pTemp = me->SummonCreature(NPC_RAYNE, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); + pTemp->setFaction(2089); + me->AddThreat(pTemp, 0.0f); + uiRayneGUID = pTemp->GetGUID(); + } + } + + void DespawnNPC(uint64 pGUID) + { + if (Creature* pTemp = Unit::GetCreature(*me, pGUID)) + if (pTemp->isAlive()) + { + pTemp->SetVisibility(VISIBILITY_OFF); + pTemp->Kill(pTemp); + } + } +}; + +bool GossipHello_npc_highlord_darion_mograine(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(12801) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(0, "I am ready.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_highlord_darion_mograine(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction) +{ + switch (uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->CLOSE_GOSSIP_MENU(); + CAST_AI(npc_highlord_darion_mograineAI, pCreature->AI())->uiStep = 1; + CAST_AI(npc_highlord_darion_mograineAI, pCreature->AI())->Start(true, false, pPlayer->GetGUID()); + break; + } + return true; +} + +/*###### +## npc the lich king in dawn of light +######*/ +struct npc_the_lich_king_tirion_dawnAI : public ScriptedAI +{ + npc_the_lich_king_tirion_dawnAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); } + void Reset() {} + void AttackStart(Unit * /*who*/) {} // very sample, just don't make them aggreesive + void UpdateAI(const uint32 /*diff*/) {} + void JustDied(Unit* /*killer*/) {} +}; + +CreatureAI* GetAI_npc_highlord_darion_mograine(Creature* pCreature) +{ + return new npc_highlord_darion_mograineAI(pCreature); +} + +CreatureAI* GetAI_npc_the_lich_king_tirion_dawn(Creature* pCreature) +{ + return new npc_the_lich_king_tirion_dawnAI (pCreature); +} + +void AddSC_the_scarlet_enclave_c5() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_highlord_darion_mograine"; + newscript->GetAI = &GetAI_npc_highlord_darion_mograine; + newscript->pGossipHello = &GossipHello_npc_highlord_darion_mograine; + newscript->pGossipSelect = &GossipSelect_npc_highlord_darion_mograine; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_the_lich_king_tirion_dawn"; + newscript->GetAI = &GetAI_npc_the_lich_king_tirion_dawn; + newscript->RegisterSelf(); +} diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp new file mode 100644 index 00000000000..cdfd69234fb --- /dev/null +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2009 Trinity + * + * 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 + */ + +#include "ScriptedPch.h" + +/*#### +## npc_valkyr_battle_maiden +####*/ +#define SPELL_REVIVE 51918 +#define VALK_WHISPER "It is not yet your time, champion. Rise! Rise and fight once more!" + +struct npc_valkyr_battle_maidenAI : public PassiveAI +{ + npc_valkyr_battle_maidenAI(Creature *c) : PassiveAI(c) {} + + uint32 FlyBackTimer; + float x, y, z; + uint32 phase; + + void Reset() + { + me->setActive(true); + me->SetVisibility(VISIBILITY_OFF); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + me->SetFlying(true); + FlyBackTimer = 500; + phase = 0; + + me->GetPosition(x, y, z); + z += 4; x -= 3.5; y -= 5; + me->GetMotionMaster()->Clear(false); + me->GetMap()->CreatureRelocation(me, x, y, z, 0.0f); + } + + void UpdateAI(const uint32 diff) + { + if (FlyBackTimer <= diff) + { + Player *plr = NULL; + if (me->isSummon()) + if (Unit *summoner = CAST_SUM(me)->GetSummoner()) + if (summoner->GetTypeId() == TYPEID_PLAYER) + plr = CAST_PLR(summoner); + + if (!plr) + phase = 3; + + switch(phase) + { + case 0: + me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + me->HandleEmoteCommand(EMOTE_STATE_FLYGRABCLOSED); + FlyBackTimer = 500; + break; + case 1: + plr->GetClosePoint(x,y,z, me->GetObjectSize()); + z += 2.5; x -= 2; y -= 1.5; + me->GetMotionMaster()->MovePoint(0, x, y, z); + me->SetUInt64Value(UNIT_FIELD_TARGET, plr->GetGUID()); + me->SetVisibility(VISIBILITY_ON); + FlyBackTimer = 4500; + break; + case 2: + if (!plr->isRessurectRequested()) + { + me->HandleEmoteCommand(EMOTE_ONESHOT_CUSTOMSPELL01); + DoCast(plr, SPELL_REVIVE, true); + me->MonsterWhisper(VALK_WHISPER, plr->GetGUID()); + } + FlyBackTimer = 5000; + break; + case 3: + me->SetVisibility(VISIBILITY_OFF); + FlyBackTimer = 3000; + break; + case 4: + me->DisappearAndDie(); + break; + default: + //Nothing To DO + break; + } + ++phase; + } else FlyBackTimer-=diff; + } +}; + +CreatureAI* GetAI_npc_valkyr_battle_maiden(Creature* pCreature) +{ + return new npc_valkyr_battle_maidenAI (pCreature); +} + +void AddSC_the_scarlet_enclave() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_valkyr_battle_maiden"; + newscript->GetAI = &GetAI_npc_valkyr_battle_maiden; + newscript->RegisterSelf(); + + // Chapter 3: Scarlet Armies Approach... - An End To All Things... + // Chapter 4: An End To All Things... - An End To All Things... +} diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_arcanist_doan.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_arcanist_doan.cpp new file mode 100644 index 00000000000..cb6ed1daf22 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_arcanist_doan.cpp @@ -0,0 +1,128 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 .sourceforge.net/> + * 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_Arcanist_Doan +SD%Complete: 100 +SDComment: +SDCategory: Scarlet Monastery +EndScriptData */ + +#include "ScriptedPch.h" + +enum eEnums +{ + SAY_AGGRO = -1189019, + SAY_SPECIALAE = -1189020, + + SPELL_POLYMORPH = 13323, + SPELL_AOESILENCE = 8988, + SPELL_ARCANEEXPLOSION = 9433, + SPELL_FIREAOE = 9435, + SPELL_ARCANEBUBBLE = 9438, +}; + +struct boss_arcanist_doanAI : public ScriptedAI +{ + boss_arcanist_doanAI(Creature *c) : ScriptedAI(c) {} + + uint32 Polymorph_Timer; + uint32 AoESilence_Timer; + uint32 ArcaneExplosion_Timer; + bool bCanDetonate; + bool bShielded; + + void Reset() + { + Polymorph_Timer = 20000; + AoESilence_Timer = 15000; + ArcaneExplosion_Timer = 3000; + bCanDetonate = false; + bShielded = false; + } + + void EnterCombat(Unit * /*who*/) + { + DoScriptText(SAY_AGGRO, me); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (bShielded && bCanDetonate) + { + DoCast(me, SPELL_FIREAOE); + bCanDetonate = false; + } + + if (me->HasAura(SPELL_ARCANEBUBBLE)) + return; + + //If we are <50% hp cast Arcane Bubble + if (!bShielded && me->GetHealth()*100 / me->GetMaxHealth() <= 50) + { + //wait if we already casting + if (me->IsNonMeleeSpellCasted(false)) + return; + + DoScriptText(SAY_SPECIALAE, me); + DoCast(me, SPELL_ARCANEBUBBLE); + + bCanDetonate = true; + bShielded = true; + } + + if (Polymorph_Timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1)) + DoCast(pTarget, SPELL_POLYMORPH); + + Polymorph_Timer = 20000; + } else Polymorph_Timer -= diff; + + //AoESilence_Timer + if (AoESilence_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_AOESILENCE); + AoESilence_Timer = 15000 + rand()%5000; + } else AoESilence_Timer -= diff; + + //ArcaneExplosion_Timer + if (ArcaneExplosion_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_ARCANEEXPLOSION); + ArcaneExplosion_Timer = 8000; + } else ArcaneExplosion_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_arcanist_doan(Creature* pCreature) +{ + return new boss_arcanist_doanAI (pCreature); +} + +void AddSC_boss_arcanist_doan() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_arcanist_doan"; + newscript->GetAI = &GetAI_boss_arcanist_doan; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_azshir_the_sleepless.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_azshir_the_sleepless.cpp new file mode 100644 index 00000000000..6b6efa0f934 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_azshir_the_sleepless.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: Boss_Azshir_the_Sleepless +SD%Complete: 80 +SDComment: +SDCategory: Scarlet Monastery +EndScriptData */ + +#include "ScriptedPch.h" + +#define SPELL_CALLOFTHEGRAVE 17831 +#define SPELL_TERRIFY 7399 +#define SPELL_SOULSIPHON 7290 + +struct boss_azshir_the_sleeplessAI : public ScriptedAI +{ + boss_azshir_the_sleeplessAI(Creature *c) : ScriptedAI(c) {} + + uint32 SoulSiphon_Timer; + uint32 CallOftheGrave_Timer; + uint32 Terrify_Timer; + + void Reset() + { + SoulSiphon_Timer = 1; + CallOftheGrave_Timer = 30000; + Terrify_Timer = 20000; + } + + void EnterCombat(Unit * /*who*/) + { + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //If we are <50% hp cast Soul Siphon rank 1 + if (me->GetHealth()*100 / me->GetMaxHealth() <= 50 && !me->IsNonMeleeSpellCasted(false)) + { + //SoulSiphon_Timer + if (SoulSiphon_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_SOULSIPHON); + return; + + //SoulSiphon_Timer = 20000; + } else SoulSiphon_Timer -= diff; + } + + //CallOfTheGrave_Timer + if (CallOftheGrave_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_CALLOFTHEGRAVE); + CallOftheGrave_Timer = 30000; + } else CallOftheGrave_Timer -= diff; + + //Terrify_Timer + if (Terrify_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_TERRIFY); + Terrify_Timer = 20000; + } else Terrify_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_azshir_the_sleepless(Creature* pCreature) +{ + return new boss_azshir_the_sleeplessAI (pCreature); +} + +void AddSC_boss_azshir_the_sleepless() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_azshir_the_sleepless"; + newscript->GetAI = &GetAI_boss_azshir_the_sleepless; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_bloodmage_thalnos.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_bloodmage_thalnos.cpp new file mode 100644 index 00000000000..f7b6b7cce4b --- /dev/null +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_bloodmage_thalnos.cpp @@ -0,0 +1,124 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 .sourceforge.net/> + * 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_Bloodmage_Thalnos +SD%Complete: 100 +SDComment: +SDCategory: Scarlet Monastery +EndScriptData */ + +#include "ScriptedPch.h" + +enum eEnums +{ + SAY_AGGRO = -1189016, + SAY_HEALTH = -1189017, + SAY_KILL = -1189018, + + SPELL_FLAMESHOCK = 8053, + SPELL_SHADOWBOLT = 1106, + SPELL_FLAMESPIKE = 8814, + SPELL_FIRENOVA = 16079, +}; + +struct boss_bloodmage_thalnosAI : public ScriptedAI +{ + boss_bloodmage_thalnosAI(Creature *c) : ScriptedAI(c) {} + + bool HpYell; + uint32 FlameShock_Timer; + uint32 ShadowBolt_Timer; + uint32 FlameSpike_Timer; + uint32 FireNova_Timer; + + void Reset() + { + HpYell = false; + FlameShock_Timer = 10000; + ShadowBolt_Timer = 2000; + FlameSpike_Timer = 8000; + FireNova_Timer = 40000; + } + + void EnterCombat(Unit * /*who*/) + { + DoScriptText(SAY_AGGRO, me); + } + + void KilledUnit(Unit* /*Victim*/) + { + DoScriptText(SAY_KILL, me); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //If we are <35% hp + if (!HpYell && ((me->GetHealth()*100) / me->GetMaxHealth() <= 35)) + { + DoScriptText(SAY_HEALTH, me); + HpYell = true; + } + + //FlameShock_Timer + if (FlameShock_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_FLAMESHOCK); + FlameShock_Timer = 10000 + rand()%5000; + } else FlameShock_Timer -= diff; + + //FlameSpike_Timer + if (FlameSpike_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_FLAMESPIKE); + FlameSpike_Timer = 30000; + } else FlameSpike_Timer -= diff; + + //FireNova_Timer + if (FireNova_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_FIRENOVA); + FireNova_Timer = 40000; + } else FireNova_Timer -= diff; + + //ShadowBolt_Timer + if (ShadowBolt_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_SHADOWBOLT); + ShadowBolt_Timer = 2000; + } else ShadowBolt_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_bloodmage_thalnos(Creature* pCreature) +{ + return new boss_bloodmage_thalnosAI (pCreature); +} + +void AddSC_boss_bloodmage_thalnos() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_bloodmage_thalnos"; + newscript->GetAI = &GetAI_boss_bloodmage_thalnos; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp new file mode 100644 index 00000000000..17bbf0c23c6 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp @@ -0,0 +1,892 @@ +/* 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_Headless_Horseman +SD%Complete: +SDComment: +SDCategory: Scarlet Monastery +EndScriptData */ + +#include "ScriptedPch.h" +#include "SpellMgr.h" +#include "scarlet_monastery.h" + +//this texts are already used by 3975 and 3976 +#define SAY_ENTRANCE -1189001 +#define SAY_REJOINED -1189002 +#define SAY_LOST_HEAD -1189003 +#define SAY_CONFLAGRATION -1189004 +#define SAY_SPROUTING_PUMPKINS -1189005 +#define SAY_PLAYER_DEATH -1189006 +#define SAY_DEATH -1189007 + +uint32 RandomLaugh[] = {11965, 11975, 11976}; + + // Entryes +#define HH_MOUNTED 23682 +#define HH_UNHORSED 23800 +#define HEAD 23775 +#define PULSING_PUMPKIN 23694 +#define PUMPKIN_FIEND 23545 +#define HELPER 23686 +#define WISP_INVIS 24034 + + //Spells +#define SPELL_CLEAVE 42587 +#define SPELL_CONFLAGRATION 42380 //Phase 2, can't find real spell(Dim Fire?) +//#define SPELL_CONFL_SPEED 22587 //8% increase speed, value 22587 from SPELL_CONFLAGRATION mains that spell? +#define SPELL_SUMMON_PUMPKIN 42394 + +#define SPELL_WHIRLWIND 43116 +#define SPELL_IMMUNE 42556 +#define SPELL_BODY_REGEN 42403 +#define SPELL_CONFUSE 43105 + +#define SPELL_FLYING_HEAD 42399 //visual flying head +#define SPELL_HEAD 42413 //visual buff, "head" +#define SPELL_HEAD_IS_DEAD 42428 //at killing head, Phase 3 + +#define SPELL_PUMPKIN_AURA 42280 +#define SPELL_PUMPKIN_AURA_GREEN 42294 +#define SPELL_SQUASH_SOUL 42514 +#define SPELL_SPROUTING 42281 +#define SPELL_SPROUT_BODY 42285 + + //Effects +#define SPELL_RHYME_BIG 42909 +//#define SPELL_RHYME_SMALL 42910 +#define SPELL_HEAD_SPEAKS 43129 +#define SPELL_HEAD_LANDS 42400 +#define SPELL_BODY_FLAME 42074 +#define SPELL_HEAD_FLAME 42971 +//#define SPELL_ENRAGE_VISUAL 42438 // he uses this spell? +#define SPELL_WISP_BLUE 42821 +#define SPELL_WISP_FLIGHT_PORT 42818 +//#define SPELL_WISP_INVIS 42823 +#define SPELL_SMOKE 42355 +#define SPELL_DEATH 42566 //not correct spell + +struct Locations +{ + float x, y, z; +}; + +static Locations FlightPoint[]= +{ + {1754.00,1346.00,17.50}, + {1765.00,1347.00,19.00}, + {1784.00,1346.80,25.40}, + {1803.30,1347.60,33.00}, + {1824.00,1350.00,42.60}, + {1838.80,1353.20,49.80}, + {1852.00,1357.60,55.70}, + {1861.30,1364.00,59.40}, + {1866.30,1374.80,61.70}, + {1864.00,1387.30,63.20}, + {1854.80,1399.40,64.10}, + {1844.00,1406.90,64.10}, + {1824.30,1411.40,63.30}, + {1801.00,1412.30,60.40}, + {1782.00,1410.10,55.50}, + {1770.50,1405.20,50.30}, + {1765.20,1400.70,46.60}, + {1761.40,1393.40,41.70}, + {1759.10,1386.70,36.60}, + {1757.80,1378.20,29.00}, + {1758.00,1367.00,19.51} +}; + +static Locations Spawn[]= +{ + {1776.27,1348.74,19.20}, //spawn point for pumpkin shrine mob + {1765.28,1347.46,17.55} //spawn point for smoke +}; + +static const char* Text[]= +{ + "Horseman rise...", + "Your time is nigh...", + "You felt death once...", + "Now, know demise!" +}; + +#define EMOTE_LAUGHS "Headless Horseman laughs" + +struct mob_wisp_invisAI : public ScriptedAI +{ + mob_wisp_invisAI(Creature *c) : ScriptedAI(c) + { + Creaturetype = delay = spell = spell2 = 0; + //that's hack but there are no info about range of this spells in dbc + SpellEntry *wisp = GET_SPELL(SPELL_WISP_BLUE); + if (wisp) + wisp->rangeIndex = 6; //100 yards + SpellEntry *port = GET_SPELL(SPELL_WISP_FLIGHT_PORT); + if (port) + port->rangeIndex = 6; + } + + uint32 Creaturetype; + uint32 delay; + uint32 spell; + uint32 spell2; + void Reset(){} + void EnterCombat(Unit * /*who*/){} + void SetType(uint32 _type) + { + switch(Creaturetype = _type) + { + case 1: + spell = SPELL_PUMPKIN_AURA_GREEN; + break; + case 2: + delay = 15000; + spell = SPELL_BODY_FLAME; + spell2 = SPELL_DEATH; + break; + case 3: + delay = 15000; + spell = SPELL_SMOKE; + break; + case 4: + delay = 7000; + spell2 = SPELL_WISP_BLUE; + break; + } + if (spell) + DoCast(me, spell); + } + + void SpellHit(Unit* /*caster*/, const SpellEntry *spell) + { + if (spell->Id == SPELL_WISP_FLIGHT_PORT && Creaturetype == 4) + me->SetDisplayId(2027); + } + + void MoveInLineOfSight(Unit *who) + { + if (!who || Creaturetype != 1 || !who->isTargetableForAttack()) + return; + + if (me->IsWithinDist(who, 0.1, false) && !who->HasAura(SPELL_SQUASH_SOUL)) + DoCast(who, SPELL_SQUASH_SOUL); + } + + void UpdateAI(const uint32 diff) + { + if (delay) + { + if (delay <= diff) + { + me->RemoveAurasDueToSpell(SPELL_SMOKE); + if (spell2) + DoCast(me, spell2); + delay = 0; + } else delay -= diff; + } + } +}; + +struct mob_headAI : public ScriptedAI +{ + mob_headAI(Creature *c) : ScriptedAI(c) {} + + uint64 bodyGUID; + + uint32 Phase; + uint32 laugh; + uint32 wait; + + bool withbody; + bool die; + + void Reset() + { + Phase = 0; + bodyGUID = 0; + die = false; + withbody = true; + wait = 1000; + laugh = urand(15000,30000); + } + + void EnterCombat(Unit * /*who*/) {} + void SaySound(int32 textEntry, Unit *pTarget = 0) + { + DoScriptText(textEntry, me, pTarget); + //DoCast(me, SPELL_HEAD_SPEAKS, true); + Creature *speaker = DoSpawnCreature(HELPER,0,0,0,0,TEMPSUMMON_TIMED_DESPAWN,1000); + if (speaker) + speaker->CastSpell(speaker,SPELL_HEAD_SPEAKS,false); + laugh += 3000; + } + + void DamageTaken(Unit* /*done_by*/,uint32 &damage) + { + if (withbody) + return; + + switch(Phase) + { + case 1: + if (((me->GetHealth() - damage)*100)/me->GetMaxHealth() < 67) + Disappear(); + break; + case 2: + if (((me->GetHealth() - damage)*100)/me->GetMaxHealth() < 34) + Disappear(); + break; + case 3: + if (damage >= me->GetHealth()) + { + die = true; + withbody = true; + wait = 300; + damage = me->GetHealth() - me->GetMaxHealth()/100; + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + me->StopMoving(); + //me->GetMotionMaster()->MoveIdle(); + DoCast(me, SPELL_HEAD_IS_DEAD); + } + break; + } + } + + void SpellHit(Unit *caster, const SpellEntry* spell) + { + if (!withbody) + return; + + if (spell->Id == SPELL_FLYING_HEAD) + { + if (Phase < 3) ++Phase; + else Phase = 3; + withbody = false; + if (!bodyGUID) + bodyGUID = caster->GetGUID(); + me->RemoveAllAuras(); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + DoCast(me, SPELL_HEAD_LANDS, true); + DoCast(me, SPELL_HEAD, false); + SaySound(SAY_LOST_HEAD); + me->GetMotionMaster()->Clear(false); + me->GetMotionMaster()->MoveFleeing(caster->getVictim()); + } + } + void Disappear();//we must set returned=true(this will prevent from "body calls head" while head flying to body), see function below + void UpdateAI(const uint32 diff) + { + if (!withbody) + { + if (wait <= diff) + { + wait = 1000; + if (!me->getVictim()) return; + me->GetMotionMaster()->Clear(false); + me->GetMotionMaster()->MoveFleeing(me->getVictim()); + } else wait -= diff; + + if (laugh <= diff) + { + laugh = urand(15000,30000); + DoPlaySoundToSet(me, RandomLaugh[urand(0,2)]); + //DoCast(me, SPELL_HEAD_SPEAKS, true); //this spell remove buff "head" + Creature *speaker = DoSpawnCreature(HELPER,0,0,0,0,TEMPSUMMON_TIMED_DESPAWN,1000); + if (speaker) + speaker->CastSpell(speaker,SPELL_HEAD_SPEAKS,false); + me->MonsterTextEmote(EMOTE_LAUGHS,NULL); + } else laugh -= diff; + } + else + { + if (die) + { + if (wait <= diff) + { + die = false; + if (Unit *body = Unit::GetUnit((*me), bodyGUID)) + body->Kill(body); + me->Kill(me); + } else wait -= diff; + } + } + } +}; + +struct boss_headless_horsemanAI : public ScriptedAI +{ + boss_headless_horsemanAI(Creature *c) : ScriptedAI(c) + { + SpellEntry *confl = GET_SPELL(SPELL_CONFLAGRATION); + if (confl) + { + confl->EffectApplyAuraName[0] = SPELL_AURA_PERIODIC_DAMAGE_PERCENT; + confl->EffectBasePoints[0] = 10; + //confl->EffectBaseDice[0] = 10; + confl->DmgMultiplier[0] = 1; + } +/* + if (SpellEntry *confl = GET_SPELL(SPELL_CONFLAGRATION)) + confl->EffectTriggerSpell[1] = 22587; + + if (SpellEntry *speed = GET_SPELL(22587)) + { + speed->Effect[1] = SPELL_EFFECT_APPLY_AURA; + speed->EffectApplyAuraName[1] = SPELL_AURA_MOD_CONFUSE; + } +*/ + pInstance = c->GetInstanceData(); + } + + ScriptedInstance *pInstance; + + uint64 headGUID; + uint64 PlayerGUID; + + uint32 Phase; + uint32 id; + uint32 count; + uint32 say_timer; + + uint32 conflagrate; + uint32 summonadds; + uint32 cleave; + uint32 regen; + uint32 whirlwind; + uint32 laugh; + uint32 burn; + + bool withhead; + bool returned; + bool IsFlying; + bool wp_reached; + bool burned; + + void Reset() + { + Phase = 1; + conflagrate = 15000; + summonadds = 15000; + laugh = urand(16000,20000); + cleave = 2000; + regen = 1000; + burn = 6000; + count = 0; + say_timer = 3000; + + withhead = true; + returned = true; + burned = false; + IsFlying = false; + DoCast(me, SPELL_HEAD); + if (headGUID) + { + if (Creature* Head = Unit::GetCreature((*me), headGUID)) + Head->DisappearAndDie(); + + headGUID = 0; + } + + //if (pInstance) + // pInstance->SetData(DATA_HORSEMAN_EVENT, NOT_STARTED); + } + + void FlyMode() + { + me->SetVisibility(VISIBILITY_OFF); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + me->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_LEVITATING); + me->SetSpeed(MOVE_WALK,5.0f,true); + wp_reached = false; + count = 0; + say_timer = 3000; + id = 0; + Phase = 0; + } + + void MovementInform(uint32 type, uint32 i) + { + if (type != POINT_MOTION_TYPE || !IsFlying || i != id) + return; + + wp_reached = true; + + switch (id) + { + case 0: + me->SetVisibility(VISIBILITY_ON); + break; + case 1: + { + if (Creature *smoke = me->SummonCreature(HELPER,Spawn[1].x,Spawn[1].y,Spawn[1].z,0,TEMPSUMMON_TIMED_DESPAWN,20000)) + CAST_AI(mob_wisp_invisAI, smoke->AI())->SetType(3); + DoCast(me, SPELL_RHYME_BIG); + break; + } + case 6: + if (pInstance) + pInstance->SetData(GAMEOBJECT_PUMPKIN_SHRINE, 0); //hide gameobject + break; + case 19: + me->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_LEVITATING); + break; + case 20: + { + Phase = 1; + IsFlying = false; + wp_reached = false; + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + SaySound(SAY_ENTRANCE); + if (Unit *plr = Unit::GetUnit((*me),PlayerGUID)) + DoStartMovement(plr); + break; + } + } + ++id; + } + + void EnterCombat(Unit * /*who*/) + { + if (pInstance) + pInstance->SetData(DATA_HORSEMAN_EVENT, IN_PROGRESS); + DoZoneInCombat(); + } + void AttackStart(Unit* who) {ScriptedAI::AttackStart(who);} + void MoveInLineOfSight(Unit *who) + { + if (withhead && Phase != 0) + ScriptedAI::MoveInLineOfSight(who); + } + void KilledUnit(Unit *plr) + { + if (plr->GetTypeId() == TYPEID_PLAYER) + { + if (withhead) + SaySound(SAY_PLAYER_DEATH); + //maybe possible when player dies from conflagration + else if (Creature *Head = Unit::GetCreature((*me), headGUID)) + CAST_AI(mob_headAI, Head->AI())->SaySound(SAY_PLAYER_DEATH); + } + } + + void SaySound(int32 textEntry, Unit *pTarget = 0) + { + DoScriptText(textEntry, me, pTarget); + laugh += 4000; + } + + Player* SelectRandomPlayer(float range = 0.0f, bool checkLoS = true) + { + Map* pMap = me->GetMap(); + if (!pMap->IsDungeon()) return NULL; + + Map::PlayerList const &PlayerList = pMap->GetPlayers(); + Map::PlayerList::const_iterator i; + if (PlayerList.isEmpty()) return NULL; + + std::list temp; + std::list::const_iterator j; + + for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) + if ((me->IsWithinLOSInMap(i->getSource()) || !checkLoS) && me->getVictim() != i->getSource() && + me->IsWithinDistInMap(i->getSource(), range) && i->getSource()->isAlive()) + temp.push_back(i->getSource()); + + if (temp.size()) + { + j = temp.begin(); + advance(j, rand()%temp.size()); + return (*j); + } + return NULL; + } + + void SpellHitTarget(Unit* unit, const SpellEntry* spell) + { + if (spell->Id == SPELL_CONFLAGRATION && unit->HasAura(SPELL_CONFLAGRATION)) + SaySound(SAY_CONFLAGRATION,unit); + } + + void JustDied(Unit* /*killer*/) + { + me->StopMoving(); + //me->GetMotionMaster()->MoveIdle(); + SaySound(SAY_DEATH); + if (Creature *flame = DoSpawnCreature(HELPER,0,0,0,0,TEMPSUMMON_TIMED_DESPAWN,60000)) + flame->CastSpell(flame,SPELL_BODY_FLAME,false); + if (Creature *wisp = DoSpawnCreature(WISP_INVIS,0,0,0,0,TEMPSUMMON_TIMED_DESPAWN,60000)) + CAST_AI(mob_wisp_invisAI, wisp->AI())->SetType(4); + if (pInstance) + pInstance->SetData(DATA_HORSEMAN_EVENT, DONE); + } + + void SpellHit(Unit *caster, const SpellEntry* spell) + { + if (withhead) + return; + + if (spell->Id == SPELL_FLYING_HEAD) + { + if (Phase < 3) + ++Phase; + else + Phase = 3; + withhead = true; + me->RemoveAllAuras(); + me->SetName("Headless Horseman"); + me->SetHealth(me->GetMaxHealth()); + SaySound(SAY_REJOINED); + DoCast(me, SPELL_HEAD); + caster->GetMotionMaster()->Clear(false); + caster->GetMotionMaster()->MoveFollow(me,6,urand(0,5)); + //DoResetThreat();//not sure if need + std::list::const_iterator itr; + for (itr = caster->getThreatManager().getThreatList().begin(); itr != caster->getThreatManager().getThreatList().end(); ++itr) + { + Unit* pUnit = Unit::GetUnit((*me), (*itr)->getUnitGuid()); + if (pUnit && pUnit->isAlive() && pUnit != caster) + me->AddThreat(pUnit,caster->getThreatManager().getThreat(pUnit)); + } + } + } + + void DamageTaken(Unit *done_by, uint32 &damage) + { + if (damage >= me->GetHealth() && withhead) + { + withhead = false; + returned = false; + damage = me->GetHealth() - me->GetMaxHealth()/100; + me->RemoveAllAuras(); + me->SetName("Headless Horseman, Unhorsed"); + + if (!headGUID) + headGUID = DoSpawnCreature(HEAD,rand()%6,rand()%6,0,0,TEMPSUMMON_DEAD_DESPAWN,0)->GetGUID(); + Unit* Head = Unit::GetUnit((*me), headGUID); + if (Head && Head->isAlive()) + { + Head->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + //Head->CastSpell(Head,SPELL_HEAD_INVIS,false); + me->InterruptNonMeleeSpells(false); + DoCast(me, SPELL_IMMUNE, true); + DoCast(me, SPELL_BODY_REGEN, true); + DoCast(Head, SPELL_FLYING_HEAD, true); + DoCast(me, SPELL_CONFUSE, false); //test + done_by->ProcDamageAndSpell(me,PROC_FLAG_KILL,PROC_FLAG_KILLED,PROC_EX_NONE,0); + whirlwind = urand(4000,8000); + regen = 0; + } + } + } + + void UpdateAI(const uint32 diff) + { + if (withhead) + { + switch(Phase) + { + case 0: + { + if (!IsFlying) + { + if (say_timer <= diff) + { + say_timer = 3000; + Player *plr = SelectRandomPlayer(100.0f,false); + if (count < 3) + { + if (plr) + plr->Say(Text[count],0); + } + else + { + DoCast(me, SPELL_RHYME_BIG); + if (plr) + { + plr->Say(Text[count],0); + plr->HandleEmoteCommand(ANIM_EMOTE_SHOUT); + } + wp_reached = true; + IsFlying = true; + count = 0; + break; + } + ++count; + } else say_timer -= diff; + } + else + { + if (wp_reached) + { + wp_reached = false; + me->GetMotionMaster()->Clear(false); + me->GetMotionMaster()->MovePoint(id,FlightPoint[id].x,FlightPoint[id].y,FlightPoint[id].z); + } + } + } + break; + case 1: + if (burned) + break; + if (burn <= diff) + { + if (Creature *flame = me->SummonCreature(HELPER,Spawn[0].x,Spawn[0].y,Spawn[0].z,0,TEMPSUMMON_TIMED_DESPAWN,17000)) + CAST_AI(mob_wisp_invisAI, flame->AI())->SetType(2); + burned = true; + } else burn -= diff; + break; + case 2: + if (conflagrate <= diff) + { + if (Unit *plr = SelectRandomPlayer(30.0f)) + DoCast(plr, SPELL_CONFLAGRATION, false); + conflagrate = urand(10000,16000); + } else conflagrate -= diff; + break; + case 3: + if (summonadds <= diff) + { + me->InterruptNonMeleeSpells(false); + DoCast(me, SPELL_SUMMON_PUMPKIN); + SaySound(SAY_SPROUTING_PUMPKINS); + summonadds = urand(25000,35000); + } else summonadds -= diff; + break; + } + + if (laugh <= diff) + { + laugh = urand(11000,22000); + me->MonsterTextEmote(EMOTE_LAUGHS,NULL); + DoPlaySoundToSet(me, RandomLaugh[rand()%3]); + } else laugh -= diff; + + if (UpdateVictim()) + { + DoMeleeAttackIfReady(); + if (cleave <= diff) + { + DoCast(me->getVictim(), SPELL_CLEAVE); + cleave = urand(2000,6000); //1 cleave per 2.0-6.0sec + } else cleave -= diff; + } + } + else + { + if (regen <= diff) + { + regen = 1000; //"body calls head" + if (me->GetHealth()/me->GetMaxHealth() == 1 && !returned) + { + if (Phase > 1) + --Phase; + else + Phase = 1; + Creature* Head = Unit::GetCreature((*me), headGUID); + if (Head && Head->isAlive()) + { + CAST_AI(mob_headAI, Head->AI())->Phase = Phase; + CAST_AI(mob_headAI, Head->AI())->Disappear(); + } + return; + } + } + else regen -= diff; + + if (whirlwind <= diff) + { + whirlwind = urand(4000,8000); + if (urand(0,1)) + { + me->RemoveAurasDueToSpell(SPELL_CONFUSE); + DoCast(me, SPELL_WHIRLWIND, true); + DoCast(me, SPELL_CONFUSE); + } else + me->RemoveAurasDueToSpell(SPELL_WHIRLWIND); + } else whirlwind -= diff; + } + } +}; + +void mob_headAI::Disappear() +{ + if (withbody) + return; + if (bodyGUID) + { + Creature *body = Unit::GetCreature((*me), bodyGUID); + if (body && body->isAlive()) + { + withbody = true; + me->RemoveAllAuras(); + body->RemoveAurasDueToSpell(SPELL_IMMUNE);//hack, SpellHit doesn't calls if body has immune aura + DoCast(body, SPELL_FLYING_HEAD); + me->SetHealth(me->GetMaxHealth()); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->GetMotionMaster()->MoveIdle(); + CAST_AI(boss_headless_horsemanAI, body->AI())->returned = true; + } + } +} + +struct mob_pulsing_pumpkinAI : public ScriptedAI +{ + mob_pulsing_pumpkinAI(Creature *c) : ScriptedAI(c) {} + + bool sprouted; + uint64 debuffGUID; + + void Reset() + { + float x, y, z; + me->GetPosition(x, y, z); //this visual aura some under ground + me->GetMap()->CreatureRelocation(me, x,y,z + 0.35f, 0.0f); + Despawn(); + Creature *debuff = DoSpawnCreature(HELPER,0,0,0,0,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,14500); + if (debuff) + { + debuff->SetDisplayId(me->GetDisplayId()); + debuff->CastSpell(debuff,SPELL_PUMPKIN_AURA_GREEN,false); + CAST_AI(mob_wisp_invisAI, debuff->AI())->SetType(1); + debuffGUID = debuff->GetGUID(); + } + sprouted = false; + DoCast(me, SPELL_PUMPKIN_AURA, true); + DoCast(me, SPELL_SPROUTING); + me->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_STUNNED); + } + + void EnterCombat(Unit * /*who*/){} + + void SpellHit(Unit * /*caster*/, const SpellEntry *spell) + { + if (spell->Id == SPELL_SPROUTING) + { + sprouted = true; + me->RemoveAllAuras(); + me->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_STUNNED); + DoCast(me, SPELL_SPROUT_BODY, true); + me->UpdateEntry(PUMPKIN_FIEND); + DoStartMovement(me->getVictim()); + } + } + + void Despawn() + { + if (!debuffGUID) return; + Unit *debuff = Unit::GetUnit((*me),debuffGUID); + if (debuff) + debuff->SetVisibility(VISIBILITY_OFF); + debuffGUID = 0; + } + + void JustDied(Unit * /*killer*/) { if (!sprouted) Despawn(); } + + void MoveInLineOfSight(Unit *who) + { + if (!who || !who->isTargetableForAttack() || !me->IsHostileTo(who) || me->getVictim()) + return; + + me->AddThreat(who,0.0f); + if (sprouted) + DoStartMovement(who); + } + + void UpdateAI(const uint32 /*diff*/) + { + if (sprouted && UpdateVictim()) + DoMeleeAttackIfReady(); + } +}; + +bool GOHello_go_loosely_turned_soil(Player* pPlayer, GameObject* soil) +{ + ScriptedInstance* pInstance = pPlayer->GetInstanceData(); + if (pInstance) + { + if (pInstance->GetData(DATA_HORSEMAN_EVENT) != NOT_STARTED) + return true; + pInstance->SetData(DATA_HORSEMAN_EVENT, IN_PROGRESS); + } +/* if (soil->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER && plr->getLevel() > 64) + { + plr->PrepareQuestMenu(soil->GetGUID()); + plr->SendPreparedQuest(soil->GetGUID()); + } + if (plr->GetQuestStatus(11405) == QUEST_STATUS_INCOMPLETE && plr->getLevel() > 64) + { */ + pPlayer->AreaExploredOrEventHappens(11405); + if (Creature *horseman = soil->SummonCreature(HH_MOUNTED,FlightPoint[20].x,FlightPoint[20].y,FlightPoint[20].z,0,TEMPSUMMON_MANUAL_DESPAWN,0)) + { + CAST_AI(boss_headless_horsemanAI, horseman->AI())->PlayerGUID = pPlayer->GetGUID(); + CAST_AI(boss_headless_horsemanAI, horseman->AI())->FlyMode(); + } + //} + return true; +} + +CreatureAI* GetAI_mob_head(Creature* pCreature) +{ + return new mob_headAI (pCreature); +} + +CreatureAI* GetAI_boss_headless_horseman(Creature* pCreature) +{ + return new boss_headless_horsemanAI (pCreature); +} + +CreatureAI* GetAI_mob_pulsing_pumpkin(Creature* pCreature) +{ + return new mob_pulsing_pumpkinAI (pCreature); +} + +CreatureAI* GetAI_mob_wisp_invis(Creature* pCreature) +{ + return new mob_wisp_invisAI (pCreature); +} + +void AddSC_boss_headless_horseman() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_headless_horseman"; + newscript->GetAI = &GetAI_boss_headless_horseman; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_head"; + newscript->GetAI = &GetAI_mob_head; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_pulsing_pumpkin"; + newscript->GetAI = &GetAI_mob_pulsing_pumpkin; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_wisp_invis"; + newscript->GetAI = &GetAI_mob_wisp_invis; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "go_loosely_turned_soil"; + newscript->pGOHello = &GOHello_go_loosely_turned_soil; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp new file mode 100644 index 00000000000..e0db29aa240 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp @@ -0,0 +1,158 @@ +/* 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_Herod +SD%Complete: 95 +SDComment: Should in addition spawn Myrmidons in the hallway outside +SDCategory: Scarlet Monastery +EndScriptData */ + +#include "ScriptedPch.h" +#include "ScriptedEscortAI.h" + +#define SAY_AGGRO -1189000 +#define SAY_WHIRLWIND -1189001 +#define SAY_ENRAGE -1189002 +#define SAY_KILL -1189003 +#define EMOTE_ENRAGE -1189004 + +#define SPELL_RUSHINGCHARGE 8260 +#define SPELL_CLEAVE 15496 +#define SPELL_WHIRLWIND 8989 +#define SPELL_FRENZY 8269 + +#define ENTRY_SCARLET_TRAINEE 6575 +#define ENTRY_SCARLET_MYRMIDON 4295 + +struct boss_herodAI : public ScriptedAI +{ + boss_herodAI(Creature *c) : ScriptedAI(c) {} + + bool Enrage; + + uint32 Cleave_Timer; + uint32 Whirlwind_Timer; + + void Reset() + { + Enrage = false; + Cleave_Timer = 12000; + Whirlwind_Timer = 60000; + } + + void EnterCombat(Unit * /*who*/) + { + DoScriptText(SAY_AGGRO, me); + DoCast(me, SPELL_RUSHINGCHARGE); + } + + void KilledUnit(Unit * /*victim*/) + { + DoScriptText(SAY_KILL, me); + } + + void JustDied(Unit* /*killer*/) + { + for (uint8 i = 0; i < 20; ++i) + me->SummonCreature(ENTRY_SCARLET_TRAINEE, 1939.18, -431.58, 17.09, 6.22, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //If we are <30% hp goes Enraged + if (!Enrage && me->GetHealth()*100 / me->GetMaxHealth() <= 30 && !me->IsNonMeleeSpellCasted(false)) + { + DoScriptText(EMOTE_ENRAGE, me); + DoScriptText(SAY_ENRAGE, me); + DoCast(me, SPELL_FRENZY); + Enrage = true; + } + + //Cleave_Timer + if (Cleave_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_CLEAVE); + Cleave_Timer = 12000; + } else Cleave_Timer -= diff; + + // Whirlwind_Timer + if (Whirlwind_Timer <= diff) + { + DoScriptText(SAY_WHIRLWIND, me); + DoCast(me->getVictim(), SPELL_WHIRLWIND); + Whirlwind_Timer = 30000; + } else Whirlwind_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_herod(Creature* pCreature) +{ + return new boss_herodAI(pCreature); +} + +struct mob_scarlet_traineeAI : public npc_escortAI +{ + mob_scarlet_traineeAI(Creature *c) : npc_escortAI(c) + { + Start_Timer = urand(1000,6000); + } + + uint32 Start_Timer; + + void Reset() {} + void WaypointReached(uint32 /*uiPoint*/) {} + void EnterCombat(Unit* /*who*/) {} + + void UpdateAI(const uint32 diff) + { + if (Start_Timer) + { + if (Start_Timer <= diff) + { + Start(true,true); + Start_Timer = 0; + } else Start_Timer -= diff; + } + + npc_escortAI::UpdateAI(diff); + } +}; + +CreatureAI* GetAI_mob_scarlet_trainee(Creature* pCreature) +{ + return new mob_scarlet_traineeAI(pCreature); +} + +void AddSC_boss_herod() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_herod"; + newscript->GetAI = &GetAI_boss_herod; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_scarlet_trainee"; + newscript->GetAI = &GetAI_mob_scarlet_trainee; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp new file mode 100644 index 00000000000..b9b15f34508 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp @@ -0,0 +1,133 @@ +/* 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_Inquisitor_Fairbanks +SD%Complete: 100 +SDComment: TODO: if this guy not involved in some special event, remove (and let ACID script) +SDCategory: Scarlet Monastery +EndScriptData */ + +#include "ScriptedPch.h" + +enum eSpells +{ + SPELL_CURSEOFBLOOD = 8282, + SPELL_DISPELMAGIC = 15090, + SPELL_FEAR = 12096, + SPELL_HEAL = 12039, + SPELL_POWERWORDSHIELD = 11647, + SPELL_SLEEP = 8399 +}; + +struct boss_high_inquisitor_fairbanksAI : public ScriptedAI +{ + boss_high_inquisitor_fairbanksAI(Creature *c) : ScriptedAI(c) {} + + uint32 CurseOfBlood_Timer; + uint32 DispelMagic_Timer; + uint32 Fear_Timer; + uint32 Heal_Timer; + uint32 Sleep_Timer; + uint32 Dispel_Timer; + bool PowerWordShield; + + void Reset() + { + CurseOfBlood_Timer = 10000; + DispelMagic_Timer = 30000; + Fear_Timer = 40000; + Heal_Timer = 30000; + Sleep_Timer = 30000; + Dispel_Timer = 20000; + PowerWordShield = false; + } + + void EnterCombat(Unit * /*who*/) + { + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //If we are <25% hp cast Heal + if (me->GetHealth()*100 / me->GetMaxHealth() <= 25 && !me->IsNonMeleeSpellCasted(false) && Heal_Timer <= diff) + { + DoCast(me, SPELL_HEAL); + Heal_Timer = 30000; + } else Heal_Timer -= diff; + + //Fear_Timer + if (Fear_Timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1)) + DoCast(pTarget, SPELL_FEAR); + + Fear_Timer = 40000; + } else Fear_Timer -= diff; + + //Sleep_Timer + if (Sleep_Timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO,0)) + DoCast(pTarget, SPELL_SLEEP); + + Sleep_Timer = 30000; + } else Sleep_Timer -= diff; + + //PowerWordShield_Timer + if (!PowerWordShield && me->GetHealth()*100 / me->GetMaxHealth() <= 25) + { + DoCast(me, SPELL_POWERWORDSHIELD); + PowerWordShield = true; + } + + //Dispel_Timer + if (Dispel_Timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(pTarget, SPELL_DISPELMAGIC); + + DispelMagic_Timer = 30000; + } else DispelMagic_Timer -= diff; + + //CurseOfBlood_Timer + if (CurseOfBlood_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_CURSEOFBLOOD); + CurseOfBlood_Timer = 25000; + } else CurseOfBlood_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_high_inquisitor_fairbanks(Creature* pCreature) +{ + return new boss_high_inquisitor_fairbanksAI (pCreature); +} + +void AddSC_boss_high_inquisitor_fairbanks() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_high_inquisitor_fairbanks"; + newscript->GetAI = &GetAI_boss_high_inquisitor_fairbanks; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_houndmaster_loksey.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_houndmaster_loksey.cpp new file mode 100644 index 00000000000..300e69611cd --- /dev/null +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_houndmaster_loksey.cpp @@ -0,0 +1,77 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 .sourceforge.net/> + * 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_Houndmaster_Loksey +SD%Complete: 100 +SDComment: +SDCategory: Scarlet Monastery +EndScriptData */ + +#include "ScriptedPch.h" + +enum eEnums +{ + SAY_AGGRO = -1189021, + SPELL_SUMMONSCARLETHOUND = 17164, + SPELL_BLOODLUST = 6742 +}; + +struct boss_houndmaster_lokseyAI : public ScriptedAI +{ + boss_houndmaster_lokseyAI(Creature *c) : ScriptedAI(c) {} + + uint32 BloodLust_Timer; + + void Reset() + { + BloodLust_Timer = 20000; + } + + void EnterCombat(Unit * /*who*/) + { + DoScriptText(SAY_AGGRO, me); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (BloodLust_Timer <= diff) + { + DoCast(me, SPELL_BLOODLUST); + BloodLust_Timer = 20000; + } else BloodLust_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_houndmaster_loksey(Creature* pCreature) +{ + return new boss_houndmaster_lokseyAI (pCreature); +} + +void AddSC_boss_houndmaster_loksey() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_houndmaster_loksey"; + newscript->GetAI = &GetAI_boss_houndmaster_loksey; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp new file mode 100644 index 00000000000..b4b84fc8059 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp @@ -0,0 +1,118 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 .sourceforge.net/> + * 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_Interrogator_Vishas +SD%Complete: 100 +SDComment: +SDCategory: Scarlet Monastery +EndScriptData */ + +#include "ScriptedPch.h" +#include "scarlet_monastery.h" + +enum eEnums +{ + SAY_AGGRO = -1189011, + SAY_HEALTH1 = -1189012, + SAY_HEALTH2 = -1189013, + SAY_KILL = -1189014, + SAY_TRIGGER_VORREL = -1189015, + + SPELL_SHADOWWORDPAIN = 2767, +}; + +struct boss_interrogator_vishasAI : public ScriptedAI +{ + boss_interrogator_vishasAI(Creature *c) : ScriptedAI(c) + { + pInstance = me->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + bool Yell30; + bool Yell60; + uint32 ShadowWordPain_Timer; + + void Reset() + { + ShadowWordPain_Timer = 5000; + } + + void EnterCombat(Unit * /*who*/) + { + DoScriptText(SAY_AGGRO, me); + } + + void KilledUnit(Unit* /*Victim*/) + { + DoScriptText(SAY_KILL, me); + } + + void JustDied(Unit* /*Killer*/) + { + if (!pInstance) + return; + + //Any other actions to do with vorrel? setStandState? + if (Unit *vorrel = Unit::GetUnit(*me,pInstance->GetData64(DATA_VORREL))) + DoScriptText(SAY_TRIGGER_VORREL, vorrel); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //If we are low on hp Do sayings + if (!Yell60 && ((me->GetHealth()*100) / me->GetMaxHealth() <= 60)) + { + DoScriptText(SAY_HEALTH1, me); + Yell60 = true; + } + + if (!Yell30 && ((me->GetHealth()*100) / me->GetMaxHealth() <= 30)) + { + DoScriptText(SAY_HEALTH2, me); + Yell30 = true; + } + + //ShadowWordPain_Timer + if (ShadowWordPain_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_SHADOWWORDPAIN); + ShadowWordPain_Timer = 5000 + rand()%10000; + } else ShadowWordPain_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_interrogator_vishas(Creature* pCreature) +{ + return new boss_interrogator_vishasAI (pCreature); +} + +void AddSC_boss_interrogator_vishas() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_interrogator_vishas"; + newscript->GetAI = &GetAI_boss_interrogator_vishas; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp new file mode 100644 index 00000000000..32b85e214a0 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp @@ -0,0 +1,359 @@ +/* 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_Mograine_And_Whitemane +SD%Complete: 90 +SDComment: +SDCategory: Scarlet Monastery +EndScriptData */ + +#include "ScriptedPch.h" +#include "scarlet_monastery.h" + +enum eEnums +{ + //Mograine says + SAY_MO_AGGRO = -1189005, + SAY_MO_KILL = -1189006, + SAY_MO_RESSURECTED = -1189007, + + //Whitemane says + SAY_WH_INTRO = -1189008, + SAY_WH_KILL = -1189009, + SAY_WH_RESSURECT = -1189010, + + //Mograine Spells + SPELL_CRUSADERSTRIKE = 14518, + SPELL_HAMMEROFJUSTICE = 5589, + SPELL_LAYONHANDS = 9257, + SPELL_RETRIBUTIONAURA = 8990, + + //Whitemanes Spells + SPELL_DEEPSLEEP = 9256, + SPELL_SCARLETRESURRECTION = 9232, + SPELL_DOMINATEMIND = 14515, + SPELL_HOLYSMITE = 9481, + SPELL_HEAL = 12039, + SPELL_POWERWORDSHIELD = 22187 +}; + +struct boss_scarlet_commander_mograineAI : public ScriptedAI +{ + boss_scarlet_commander_mograineAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = pCreature->GetInstanceData(); + } + + ScriptedInstance* m_pInstance; + + uint32 m_uiCrusaderStrike_Timer; + uint32 m_uiHammerOfJustice_Timer; + + bool m_bHasDied; + bool m_bHeal; + bool m_bFakeDeath; + + void Reset() + { + m_uiCrusaderStrike_Timer = 10000; + m_uiHammerOfJustice_Timer = 10000; + + //Incase wipe during phase that mograine fake death + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetStandState(UNIT_STAND_STATE_STAND); + + if (m_pInstance) + if (me->isAlive()) + m_pInstance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT,NOT_STARTED); + + m_bHasDied = false; + m_bHeal = false; + m_bFakeDeath = false; + } + + void JustReachedHome() + { + if (m_pInstance) + { + if (m_pInstance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT != NOT_STARTED)) + m_pInstance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, FAIL); + } + } + + void EnterCombat(Unit* /*pWho*/) + { + DoScriptText(SAY_MO_AGGRO, me); + DoCast(me, SPELL_RETRIBUTIONAURA); + + me->CallForHelp(VISIBLE_RANGE); + } + + void KilledUnit(Unit* /*pVictim*/) + { + DoScriptText(SAY_MO_KILL, me); + } + + void DamageTaken(Unit* /*pDoneBy*/, uint32 &uiDamage) + { + if (uiDamage < me->GetHealth() || m_bHasDied || m_bFakeDeath) + return; + + if (!m_pInstance) + return; + + //On first death, fake death and open door, as well as initiate whitemane if exist + if (Unit* Whitemane = Unit::GetUnit((*me), m_pInstance->GetData64(DATA_WHITEMANE))) + { + m_pInstance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, IN_PROGRESS); + + Whitemane->GetMotionMaster()->MovePoint(1,1163.113370,1398.856812,32.527786); + + me->GetMotionMaster()->MovementExpired(); + me->GetMotionMaster()->MoveIdle(); + + me->SetHealth(0); + + if (me->IsNonMeleeSpellCasted(false)) + me->InterruptNonMeleeSpells(false); + + me->ClearComboPointHolders(); + me->RemoveAllAuras(); + me->ClearAllReactives(); + + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetStandState(UNIT_STAND_STATE_DEAD); + + m_bHasDied = true; + m_bFakeDeath = true; + + uiDamage = 0; + } + } + + void SpellHit(Unit* /*pWho*/, const SpellEntry* pSpell) + { + //When hit with ressurection say text + if (pSpell->Id == SPELL_SCARLETRESURRECTION) + { + DoScriptText(SAY_MO_RESSURECTED, me); + m_bFakeDeath = false; + + if (m_pInstance) + m_pInstance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, SPECIAL); + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (!UpdateVictim()) + return; + + if (m_bHasDied && !m_bHeal && m_pInstance && m_pInstance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) == SPECIAL) + { + //On ressurection, stop fake death and heal whitemane and resume fight + if (Unit* Whitemane = Unit::GetUnit((*me), m_pInstance->GetData64(DATA_WHITEMANE))) + { + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetStandState(UNIT_STAND_STATE_STAND); + DoCast(Whitemane, SPELL_LAYONHANDS); + + m_uiCrusaderStrike_Timer = 10000; + m_uiHammerOfJustice_Timer = 10000; + + if (me->getVictim()) + me->GetMotionMaster()->MoveChase(me->getVictim()); + + m_bHeal = true; + } + } + + //This if-check to make sure mograine does not attack while fake death + if (m_bFakeDeath) + return; + + //m_uiCrusaderStrike_Timer + if (m_uiCrusaderStrike_Timer <= uiDiff) + { + DoCast(me->getVictim(), SPELL_CRUSADERSTRIKE); + m_uiCrusaderStrike_Timer = 10000; + } else m_uiCrusaderStrike_Timer -= uiDiff; + + //m_uiHammerOfJustice_Timer + if (m_uiHammerOfJustice_Timer <= uiDiff) + { + DoCast(me->getVictim(), SPELL_HAMMEROFJUSTICE); + m_uiHammerOfJustice_Timer = 60000; + } else m_uiHammerOfJustice_Timer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +struct boss_high_inquisitor_whitemaneAI : public ScriptedAI +{ + boss_high_inquisitor_whitemaneAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = pCreature->GetInstanceData(); + } + + ScriptedInstance* m_pInstance; + + uint32 m_uiHeal_Timer; + uint32 m_uiPowerWordShield_Timer; + uint32 m_uiHolySmite_Timer; + uint32 m_uiWait_Timer; + + bool m_bCanResurrectCheck; + bool m_bCanResurrect; + + void Reset() + { + m_uiWait_Timer = 7000; + m_uiHeal_Timer = 10000; + m_uiPowerWordShield_Timer = 15000; + m_uiHolySmite_Timer = 6000; + + m_bCanResurrectCheck = false; + m_bCanResurrect = false; + + if (m_pInstance) + if (me->isAlive()) + m_pInstance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, NOT_STARTED); + } + + void AttackStart(Unit* pWho) + { + if (m_pInstance && m_pInstance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) == NOT_STARTED) + return; + + ScriptedAI::AttackStart(pWho); + } + + void EnterCombat(Unit* /*pWho*/) + { + DoScriptText(SAY_WH_INTRO, me); + } + + void KilledUnit(Unit* /*pVictim*/) + { + DoScriptText(SAY_WH_KILL, me); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!UpdateVictim()) + return; + + if (m_bCanResurrect) + { + //When casting resuruction make sure to delay so on rez when reinstate battle deepsleep runs out + if (m_pInstance && m_uiWait_Timer <= uiDiff) + { + if (Unit* Mograine = Unit::GetUnit((*me), m_pInstance->GetData64(DATA_MOGRAINE))) + { + DoCast(Mograine, SPELL_SCARLETRESURRECTION); + DoScriptText(SAY_WH_RESSURECT, me); + m_bCanResurrect = false; + } + } + else m_uiWait_Timer -= uiDiff; + } + + //Cast Deep sleep when health is less than 50% + if (!m_bCanResurrectCheck && me->GetHealth()*100 / me->GetMaxHealth() <= 50) + { + if (me->IsNonMeleeSpellCasted(false)) + me->InterruptNonMeleeSpells(false); + + DoCast(me->getVictim(), SPELL_DEEPSLEEP); + m_bCanResurrectCheck = true; + m_bCanResurrect = true; + return; + } + + //while in "resurrect-mode", don't do anything + if (m_bCanResurrect) + return; + + //If we are <75% hp cast healing spells at self or Mograine + if (m_uiHeal_Timer <= uiDiff) + { + Creature* pTarget = NULL; + + if (me->GetHealth() <= me->GetMaxHealth()*0.75f) + pTarget = me; + + if (m_pInstance) + { + if (Creature* pMograine = Unit::GetCreature((*me), m_pInstance->GetData64(DATA_MOGRAINE))) + { + // checking m_bCanResurrectCheck prevents her healing Mograine while he is "faking death" + if (m_bCanResurrectCheck && pMograine->isAlive() && pMograine->GetHealth() <= pMograine->GetMaxHealth()*0.75f) + pTarget = pMograine; + } + } + + if (pTarget) + DoCast(pTarget, SPELL_HEAL); + + m_uiHeal_Timer = 13000; + } else m_uiHeal_Timer -= uiDiff; + + //m_uiPowerWordShield_Timer + if (m_uiPowerWordShield_Timer <= uiDiff) + { + DoCast(me, SPELL_POWERWORDSHIELD); + m_uiPowerWordShield_Timer = 15000; + } else m_uiPowerWordShield_Timer -= uiDiff; + + //m_uiHolySmite_Timer + if (m_uiHolySmite_Timer <= uiDiff) + { + DoCast(me->getVictim(), SPELL_HOLYSMITE); + m_uiHolySmite_Timer = 6000; + } else m_uiHolySmite_Timer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_scarlet_commander_mograine(Creature* pCreature) +{ + return new boss_scarlet_commander_mograineAI (pCreature); +} + +CreatureAI* GetAI_boss_high_inquisitor_whitemane(Creature* pCreature) +{ + return new boss_high_inquisitor_whitemaneAI (pCreature); +} + +void AddSC_boss_mograine_and_whitemane() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_scarlet_commander_mograine"; + newscript->GetAI = &GetAI_boss_scarlet_commander_mograine; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_high_inquisitor_whitemane"; + newscript->GetAI = &GetAI_boss_high_inquisitor_whitemane; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_scorn.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_scorn.cpp new file mode 100644 index 00000000000..5d0a3b3792f --- /dev/null +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_scorn.cpp @@ -0,0 +1,101 @@ +/* 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_Scorn +SD%Complete: 100 +SDComment: +SDCategory: Scarlet Monastery +EndScriptData */ + +#include "ScriptedPch.h" + +#define SPELL_LICHSLAP 28873 +#define SPELL_FROSTBOLTVOLLEY 8398 +#define SPELL_MINDFLAY 17313 +#define SPELL_FROSTNOVA 15531 + +struct boss_scornAI : public ScriptedAI +{ + boss_scornAI(Creature *c) : ScriptedAI(c) {} + + uint32 LichSlap_Timer; + uint32 FrostboltVolley_Timer; + uint32 MindFlay_Timer; + uint32 FrostNova_Timer; + + void Reset() + { + LichSlap_Timer = 45000; + FrostboltVolley_Timer = 30000; + MindFlay_Timer = 30000; + FrostNova_Timer = 30000; + } + + void EnterCombat(Unit * /*who*/) + { + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //LichSlap_Timer + if (LichSlap_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_LICHSLAP); + LichSlap_Timer = 45000; + } else LichSlap_Timer -= diff; + + //FrostboltVolley_Timer + if (FrostboltVolley_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_FROSTBOLTVOLLEY); + FrostboltVolley_Timer = 20000; + } else FrostboltVolley_Timer -= diff; + + //MindFlay_Timer + if (MindFlay_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_MINDFLAY); + MindFlay_Timer = 20000; + } else MindFlay_Timer -= diff; + + //FrostNova_Timer + if (FrostNova_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_FROSTNOVA); + FrostNova_Timer = 15000; + } else FrostNova_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_scorn(Creature* pCreature) +{ + return new boss_scornAI (pCreature); +} + +void AddSC_boss_scorn() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_scorn"; + newscript->GetAI = &GetAI_boss_scorn; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp new file mode 100644 index 00000000000..33642d4511c --- /dev/null +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -0,0 +1,157 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 .sourceforge.net/> +* 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_Scarlet_Monastery +SD%Complete: 50 +SDComment: +SDCategory: Scarlet Monastery +EndScriptData */ + +#include "ScriptedPch.h" +#include "scarlet_monastery.h" + +#define ENTRY_PUMPKIN_SHRINE 186267 +#define ENTRY_HORSEMAN 23682 +#define ENTRY_HEAD 23775 +#define ENTRY_PUMPKIN 23694 + +#define MAX_ENCOUNTER 2 + +struct instance_scarlet_monastery : public ScriptedInstance +{ + instance_scarlet_monastery(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint64 PumpkinShrineGUID; + uint64 HorsemanGUID; + uint64 HeadGUID; + std::set HorsemanAdds; + + uint64 MograineGUID; + uint64 WhitemaneGUID; + uint64 VorrelGUID; + uint64 DoorHighInquisitorGUID; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + PumpkinShrineGUID = 0; + HorsemanGUID = 0; + HeadGUID = 0; + HorsemanAdds.clear(); + + MograineGUID = 0; + WhitemaneGUID = 0; + VorrelGUID = 0; + DoorHighInquisitorGUID = 0; + } + + void OnGameObjectCreate(GameObject* pGo, bool /*add*/) + { + switch(pGo->GetEntry()) + { + case ENTRY_PUMPKIN_SHRINE: PumpkinShrineGUID = pGo->GetGUID();break; + case 104600: DoorHighInquisitorGUID = pGo->GetGUID(); break; + } + } + + void OnCreatureCreate(Creature* pCreature, bool /*add*/) + { + switch(pCreature->GetEntry()) + { + case ENTRY_HORSEMAN: HorsemanGUID = pCreature->GetGUID(); break; + case ENTRY_HEAD: HeadGUID = pCreature->GetGUID(); break; + case ENTRY_PUMPKIN: HorsemanAdds.insert(pCreature->GetGUID());break; + case 3976: MograineGUID = pCreature->GetGUID(); break; + case 3977: WhitemaneGUID = pCreature->GetGUID(); break; + case 3981: VorrelGUID = pCreature->GetGUID(); break; + } + } + + void SetData(uint32 type, uint32 data) + { + switch(type) + { + case TYPE_MOGRAINE_AND_WHITE_EVENT: + if (data == IN_PROGRESS) + DoUseDoorOrButton(DoorHighInquisitorGUID); + if (data == FAIL) + DoUseDoorOrButton(DoorHighInquisitorGUID); + + m_auiEncounter[0] = data; + break; + case GAMEOBJECT_PUMPKIN_SHRINE: + HandleGameObject(PumpkinShrineGUID, false); + break; + case DATA_HORSEMAN_EVENT: + m_auiEncounter[1] = data; + if (data == DONE) + { + for (std::set::const_iterator itr = HorsemanAdds.begin(); itr != HorsemanAdds.end(); ++itr) + { + Creature* add = instance->GetCreature(*itr); + if (add && add->isAlive()) + add->Kill(add); + } + HorsemanAdds.clear(); + HandleGameObject(PumpkinShrineGUID, false); + } + break; + } + } + + uint64 GetData64(uint32 type) + { + switch(type) + { + //case GAMEOBJECT_PUMPKIN_SHRINE: return PumpkinShrineGUID; + //case DATA_HORSEMAN: return HorsemanGUID; + //case DATA_HEAD: return HeadGUID; + case DATA_MOGRAINE: return MograineGUID; + case DATA_WHITEMANE: return WhitemaneGUID; + case DATA_VORREL: return VorrelGUID; + case DATA_DOOR_WHITEMANE: return DoorHighInquisitorGUID; + } + return 0; + } + + uint32 GetData(uint32 type) + { + if (type == TYPE_MOGRAINE_AND_WHITE_EVENT) + return m_auiEncounter[0]; + if (type == DATA_HORSEMAN_EVENT) + return m_auiEncounter[1]; + return 0; + } +}; + +InstanceData* GetInstanceData_instance_scarlet_monastery(Map* pMap) +{ + return new instance_scarlet_monastery(pMap); +} + +void AddSC_instance_scarlet_monastery() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_scarlet_monastery"; + newscript->GetInstanceData = &GetInstanceData_instance_scarlet_monastery; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/scarlet_monastery.h b/src/server/scripts/EasternKingdoms/ScarletMonastery/scarlet_monastery.h new file mode 100644 index 00000000000..2b6399ae3e4 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/scarlet_monastery.h @@ -0,0 +1,18 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 .sourceforge.net/> + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_SCARLET_M +#define DEF_SCARLET_M + +#define TYPE_MOGRAINE_AND_WHITE_EVENT 1 +#define DATA_MOGRAINE 2 +#define DATA_WHITEMANE 3 +#define DATA_DOOR_WHITEMANE 4 + +#define DATA_HORSEMAN_EVENT 5 +#define GAMEOBJECT_PUMPKIN_SHRINE 6 + +#define DATA_VORREL 7 +#endif + diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp new file mode 100644 index 00000000000..50a9e204566 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp @@ -0,0 +1,225 @@ +/* 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_Darkmaster_Gandling +SD%Complete: 75 +SDComment: Doors missing in instance script. +SDCategory: Scholomance +EndScriptData */ + +#include "ScriptedPch.h" +#include "scholomance.h" + +#define SPELL_ARCANEMISSILES 22272 +#define SPELL_SHADOWSHIELD 22417 //Not right ID. But 12040 is wrong either. +#define SPELL_CURSE 18702 + +#define ADD_1X 170.205 +#define ADD_1Y 99.413 +#define ADD_1Z 104.733 +#define ADD_1O 3.16 + +#define ADD_2X 170.813 +#define ADD_2Y 97.857 +#define ADD_2Z 104.713 +#define ADD_2O 3.16 + +#define ADD_3X 170.720 +#define ADD_3Y 100.900 +#define ADD_3Z 104.739 +#define ADD_3O 3.16 + +#define ADD_4X 171.866 +#define ADD_4Y 99.373 +#define ADD_4Z 104.732 +#define ADD_4O 3.16 + +struct boss_darkmaster_gandlingAI : public ScriptedAI +{ + boss_darkmaster_gandlingAI(Creature *c) : ScriptedAI(c) + { + pInstance = me->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint32 ArcaneMissiles_Timer; + uint32 ShadowShield_Timer; + uint32 Curse_Timer; + uint32 Teleport_Timer; + + void Reset() + { + ArcaneMissiles_Timer = 4500; + ShadowShield_Timer = 12000; + Curse_Timer = 2000; + Teleport_Timer = 16000; + } + + void EnterCombat(Unit * /*who*/) + { + } + + void JustDied(Unit * /*killer*/) + { + if (pInstance) + pInstance->SetData(TYPE_GANDLING, DONE); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //ArcaneMissiles_Timer + if (ArcaneMissiles_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_ARCANEMISSILES); + ArcaneMissiles_Timer = 8000; + } else ArcaneMissiles_Timer -= diff; + + //ShadowShield_Timer + if (ShadowShield_Timer <= diff) + { + DoCast(me, SPELL_SHADOWSHIELD); + ShadowShield_Timer = 14000 + rand()%14000; + } else ShadowShield_Timer -= diff; + + //Curse_Timer + if (Curse_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_CURSE); + Curse_Timer = 15000 + rand()%12000; + } else Curse_Timer -= diff; + + //Teleporting Random Target to one of the six pre boss rooms and spawn 3-4 skeletons near the gamer. + //We will only telport if gandling has more than 3% of hp so teleported gamers can always loot. + if (me->GetHealth()*100 / me->GetMaxHealth() > 3) + { + if (Teleport_Timer <= diff) + { + Unit *pTarget = NULL; + pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); + if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER) + { + if (DoGetThreat(pTarget)) + DoModifyThreatPercent(pTarget, -100); + + Creature *Summoned = NULL; + switch(rand()%6) + { + case 0: + DoTeleportPlayer(pTarget, 250.0696,0.3921,84.8408,3.149); + Summoned = me->SummonCreature(16119,254.2325,0.3417,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) + Summoned->AI()->AttackStart(pTarget); + Summoned = me->SummonCreature(16119,257.7133,4.0226,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) + Summoned->AI()->AttackStart(pTarget); + Summoned = me->SummonCreature(16119,258.6702,-2.60656,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) + Summoned->AI()->AttackStart(pTarget); + break; + case 1: + DoTeleportPlayer(pTarget, 181.4220,-91.9481,84.8410,1.608); + Summoned = me->SummonCreature(16119,184.0519,-73.5649,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) + Summoned->AI()->AttackStart(pTarget); + Summoned = me->SummonCreature(16119,179.5951,-73.7045,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) + Summoned->AI()->AttackStart(pTarget); + Summoned = me->SummonCreature(16119,180.6452,-78.2143,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) + Summoned->AI()->AttackStart(pTarget); + Summoned = me->SummonCreature(16119,283.2274,-78.1518,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) + Summoned->AI()->AttackStart(pTarget); + break; + case 2: + DoTeleportPlayer(pTarget, 95.1547,-1.8173,85.2289,0.043); + Summoned = me->SummonCreature(16119,100.9404,-1.8016,85.2289,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) + Summoned->AI()->AttackStart(pTarget); + Summoned = me->SummonCreature(16119,101.3729,0.4882,85.2289,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) + Summoned->AI()->AttackStart(pTarget); + Summoned = me->SummonCreature(16119,101.4596,-4.4740,85.2289,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) + Summoned->AI()->AttackStart(pTarget); + break; + case 3: + DoTeleportPlayer(pTarget, 250.0696,0.3921,72.6722,3.149); + Summoned = me->SummonCreature(16119,240.34481,0.7368,72.6722,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) + Summoned->AI()->AttackStart(pTarget); + Summoned = me->SummonCreature(16119,240.3633,-2.9520,72.6722,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) + Summoned->AI()->AttackStart(pTarget); + Summoned = me->SummonCreature(16119,240.6702,3.34949,72.6722,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) + Summoned->AI()->AttackStart(pTarget); + break; + case 4: + DoTeleportPlayer(pTarget, 181.4220,-91.9481,70.7734,1.608); + Summoned = me->SummonCreature(16119,184.0519,-73.5649,70.7734,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) + Summoned->AI()->AttackStart(pTarget); + Summoned = me->SummonCreature(16119,179.5951,-73.7045,70.7734,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) + Summoned->AI()->AttackStart(pTarget); + Summoned = me->SummonCreature(16119,180.6452,-78.2143,70.7734,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) + Summoned->AI()->AttackStart(pTarget); + Summoned = me->SummonCreature(16119,283.2274,-78.1518,70.7734,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) + Summoned->AI()->AttackStart(pTarget); + break; + case 5: + DoTeleportPlayer(pTarget, 106.1541,-1.8994,75.3663,0.043); + Summoned = me->SummonCreature(16119,115.3945,-1.5555,75.3663,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) + Summoned->AI()->AttackStart(pTarget); + Summoned = me->SummonCreature(16119,257.7133,1.8066,75.3663,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) + Summoned->AI()->AttackStart(pTarget); + Summoned = me->SummonCreature(16119,258.6702,-5.1001,75.3663,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) + Summoned->AI()->AttackStart(pTarget); + break; + } + } + Teleport_Timer = 20000 + rand()%15000; + } else Teleport_Timer -= diff; + } + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_darkmaster_gandling(Creature* pCreature) +{ + return new boss_darkmaster_gandlingAI (pCreature); +} + +void AddSC_boss_darkmaster_gandling() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_darkmaster_gandling"; + newscript->GetAI = &GetAI_boss_darkmaster_gandling; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_death_knight_darkreaver.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_death_knight_darkreaver.cpp new file mode 100644 index 00000000000..8bb9ec68aca --- /dev/null +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_death_knight_darkreaver.cpp @@ -0,0 +1,58 @@ +/* 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_Death_knight_darkreaver +SD%Complete: 100 +SDComment: +SDCategory: Scholomance +EndScriptData */ + +#include "ScriptedPch.h" + +struct boss_death_knight_darkreaverAI : public ScriptedAI +{ + boss_death_knight_darkreaverAI(Creature *c) : ScriptedAI(c) {} + + void Reset() + { + } + + void DamageTaken(Unit * /*done_by*/, uint32 &damage) + { + if (me->GetHealth() <= damage) + DoCast(me, 23261, true); //Summon Darkreaver's Fallen Charger + } + + void EnterCombat(Unit * /*who*/) + { + } +}; +CreatureAI* GetAI_boss_death_knight_darkreaver(Creature* pCreature) +{ + return new boss_death_knight_darkreaverAI (pCreature); +} + +void AddSC_boss_death_knight_darkreaver() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_death_knight_darkreaver"; + newscript->GetAI = &GetAI_boss_death_knight_darkreaver; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_doctor_theolen_krastinov.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_doctor_theolen_krastinov.cpp new file mode 100644 index 00000000000..5ff01d48623 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_doctor_theolen_krastinov.cpp @@ -0,0 +1,117 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 .sourceforge.net/> + * 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_Doctor_Theolen_Krastinov +SD%Complete: 100 +SDComment: +SDCategory: Scholomance +EndScriptData */ + +#include "ScriptedPch.h" +#include "scholomance.h" + +enum eEnums +{ + EMOTE_GENERIC_FRENZY_KILL = -1000001, + + SPELL_REND = 16509, + SPELL_BACKHAND = 18103, + SPELL_FRENZY = 8269 +}; + +struct boss_theolenkrastinovAI : public ScriptedAI +{ + boss_theolenkrastinovAI(Creature *c) : ScriptedAI(c) {} + + uint32 m_uiRend_Timer; + uint32 m_uiBackhand_Timer; + uint32 m_uiFrenzy_Timer; + + void Reset() + { + m_uiRend_Timer = 8000; + m_uiBackhand_Timer = 9000; + m_uiFrenzy_Timer = 1000; + } + + void JustDied(Unit* /*pKiller*/) + { + ScriptedInstance* pInstance = me->GetInstanceData(); + if (pInstance) + { + pInstance->SetData(DATA_DOCTORTHEOLENKRASTINOV_DEATH, 0); + + if (pInstance->GetData(TYPE_GANDLING) == IN_PROGRESS) + me->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0); + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (!UpdateVictim()) + return; + + //Rend_Timer + if (m_uiRend_Timer <= uiDiff) + { + DoCast(me->getVictim(), SPELL_REND); + m_uiRend_Timer = 10000; + } + else + m_uiRend_Timer -= uiDiff; + + //Backhand_Timer + if (m_uiBackhand_Timer <= uiDiff) + { + DoCast(me->getVictim(), SPELL_BACKHAND); + m_uiBackhand_Timer = 10000; + } + else + m_uiBackhand_Timer -= uiDiff; + + //Frenzy_Timer + if (me->GetHealth()*100 / me->GetMaxHealth() < 26) + { + if (m_uiFrenzy_Timer <= uiDiff) + { + DoCast(me, SPELL_FRENZY); + DoScriptText(EMOTE_GENERIC_FRENZY_KILL, me); + + m_uiFrenzy_Timer = 120000; + } + else + m_uiFrenzy_Timer -= uiDiff; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_theolenkrastinov(Creature* pCreature) +{ + return new boss_theolenkrastinovAI (pCreature); +} + +void AddSC_boss_theolenkrastinov() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_doctor_theolen_krastinov"; + newscript->GetAI = &GetAI_boss_theolenkrastinov; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_illucia_barov.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_illucia_barov.cpp new file mode 100644 index 00000000000..a038fc7a0b8 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_illucia_barov.cpp @@ -0,0 +1,117 @@ +/* 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_Illucia_Barov +SD%Complete: 100 +SDComment: +SDCategory: Scholomance +EndScriptData */ + +#include "ScriptedPch.h" +#include "scholomance.h" + +#define SPELL_CURSEOFAGONY 18671 +#define SPELL_SHADOWSHOCK 20603 +#define SPELL_SILENCE 15487 +#define SPELL_FEAR 6215 + +struct boss_illuciabarovAI : public ScriptedAI +{ + boss_illuciabarovAI(Creature *c) : ScriptedAI(c) {} + + uint32 CurseOfAgony_Timer; + uint32 ShadowShock_Timer; + uint32 Silence_Timer; + uint32 Fear_Timer; + + void Reset() + { + CurseOfAgony_Timer = 18000; + ShadowShock_Timer = 9000; + Silence_Timer = 5000; + Fear_Timer = 30000; + } + + void JustDied(Unit * /*killer*/) + { + ScriptedInstance *pInstance = me->GetInstanceData(); + if (pInstance) + { + pInstance->SetData(DATA_LADYILLUCIABAROV_DEATH, 0); + + if (pInstance->GetData(TYPE_GANDLING) == IN_PROGRESS) + me->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0); + } + } + + void EnterCombat(Unit * /*who*/) + { + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //CurseOfAgony_Timer + if (CurseOfAgony_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_CURSEOFAGONY); + CurseOfAgony_Timer = 30000; + } else CurseOfAgony_Timer -= diff; + + //ShadowShock_Timer + if (ShadowShock_Timer <= diff) + { + Unit *pTarget = NULL; + pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); + if (pTarget) DoCast(pTarget, SPELL_SHADOWSHOCK); + + ShadowShock_Timer = 12000; + } else ShadowShock_Timer -= diff; + + //Silence_Timer + if (Silence_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_SILENCE); + Silence_Timer = 14000; + } else Silence_Timer -= diff; + + //Fear_Timer + if (Fear_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_FEAR); + Fear_Timer = 30000; + } else Fear_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_illuciabarov(Creature* pCreature) +{ + return new boss_illuciabarovAI (pCreature); +} + +void AddSC_boss_illuciabarov() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_illucia_barov"; + newscript->GetAI = &GetAI_boss_illuciabarov; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp new file mode 100644 index 00000000000..c4c0f95d8d1 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp @@ -0,0 +1,153 @@ +/* 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_instructormalicia +SD%Complete: 100 +SDComment: +SDCategory: Scholomance +EndScriptData */ + +#include "ScriptedPch.h" +#include "scholomance.h" + +#define SPELL_CALLOFGRAVES 17831 +#define SPELL_CORRUPTION 11672 +#define SPELL_FLASHHEAL 10917 +#define SPELL_RENEW 10929 +#define SPELL_HEALINGTOUCH 9889 + +struct boss_instructormaliciaAI : public ScriptedAI +{ + boss_instructormaliciaAI(Creature *c) : ScriptedAI(c) {} + + uint32 CallOfGraves_Timer; + uint32 Corruption_Timer; + uint32 FlashHeal_Timer; + uint32 Renew_Timer; + uint32 HealingTouch_Timer; + uint32 FlashCounter; + uint32 TouchCounter; + + void Reset() + { + CallOfGraves_Timer = 4000; + Corruption_Timer = 8000; + FlashHeal_Timer = 38000; + Renew_Timer = 32000; + HealingTouch_Timer = 45000; + FlashCounter = 0; + TouchCounter = 0; + } + + void JustDied(Unit * /*killer*/) + { + ScriptedInstance *pInstance = me->GetInstanceData(); + if (pInstance) + { + pInstance->SetData(DATA_INSTRUCTORMALICIA_DEATH, 0); + + if (pInstance->GetData(TYPE_GANDLING) == IN_PROGRESS) + me->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0); + } + } + + void EnterCombat(Unit * /*who*/) + { + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //CallOfGraves_Timer + if (CallOfGraves_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_CALLOFGRAVES); + CallOfGraves_Timer = 65000; + } else CallOfGraves_Timer -= diff; + + //Corruption_Timer + if (Corruption_Timer <= diff) + { + Unit *pTarget = NULL; + pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); + if (pTarget) DoCast(pTarget, SPELL_CORRUPTION); + + Corruption_Timer = 24000; + } else Corruption_Timer -= diff; + + //Renew_Timer + if (Renew_Timer <= diff) + { + DoCast(me, SPELL_RENEW); + Renew_Timer = 10000; + } else Renew_Timer -= diff; + + //FlashHeal_Timer + if (FlashHeal_Timer <= diff) + { + DoCast(me, SPELL_FLASHHEAL); + + //5 Flashheals will be casted + if (FlashCounter < 2) + { + FlashHeal_Timer = 5000; + ++FlashCounter; + } + else + { + FlashCounter=0; + FlashHeal_Timer = 30000; + } + } else FlashHeal_Timer -= diff; + + //HealingTouch_Timer + if (HealingTouch_Timer <= diff) + { + DoCast(me, SPELL_HEALINGTOUCH); + + //3 Healingtouchs will be casted + if (HealingTouch_Timer < 2) + { + HealingTouch_Timer = 5500; + ++TouchCounter; + } + else + { + TouchCounter=0; + HealingTouch_Timer = 30000; + } + } else HealingTouch_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_instructormalicia(Creature* pCreature) +{ + return new boss_instructormaliciaAI (pCreature); +} + +void AddSC_boss_instructormalicia() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_instructor_malicia"; + newscript->GetAI = &GetAI_boss_instructormalicia; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_jandice_barov.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_jandice_barov.cpp new file mode 100644 index 00000000000..f8d8520e394 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_jandice_barov.cpp @@ -0,0 +1,201 @@ +/* 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_jandicebarov +SD%Complete: 100 +SDComment: +SDCategory: Scholomance +EndScriptData */ + +#include "ScriptedPch.h" + +#define SPELL_CURSEOFBLOOD 24673 +//#define SPELL_ILLUSION 17773 + +//Spells of Illusion of Jandice Barov +#define SPELL_CLEAVE 15584 + +struct boss_jandicebarovAI : public ScriptedAI +{ + boss_jandicebarovAI(Creature *c) : ScriptedAI(c) {} + + uint32 CurseOfBlood_Timer; + uint32 Illusion_Timer; + //uint32 Illusioncounter; + uint32 Invisible_Timer; + bool Invisible; + + void Reset() + { + CurseOfBlood_Timer = 15000; + Illusion_Timer = 30000; + Invisible_Timer = 3000; //Too much too low? + Invisible = false; + } + + void EnterCombat(Unit * /*who*/) + { + } + + void SummonIllusions(Unit* victim) + { + if (Creature *Illusion = DoSpawnCreature(11439, irand(-9,9), irand(-9,9), 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000)) + Illusion->AI()->AttackStart(victim); + } + + void UpdateAI(const uint32 diff) + { + if (Invisible && Invisible_Timer <= diff) + { + //Become visible again + me->setFaction(14); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetDisplayId(11073); //Jandice Model + Invisible = false; + } else if (Invisible) + { + Invisible_Timer -= diff; + //Do nothing while invisible + return; + } + + //Return since we have no target + if (!UpdateVictim()) + return; + + //CurseOfBlood_Timer + if (CurseOfBlood_Timer <= diff) + { + //Cast + DoCast(me->getVictim(), SPELL_CURSEOFBLOOD); + + //45 seconds + CurseOfBlood_Timer = 30000; + } else CurseOfBlood_Timer -= diff; + + //Illusion_Timer + if (!Invisible && Illusion_Timer <= diff) + { + + //Inturrupt any spell casting + me->InterruptNonMeleeSpells(false); + me->setFaction(35); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetDisplayId(11686); // Invisible Model + DoModifyThreatPercent(me->getVictim(),-99); + + //Summon 10 Illusions attacking random gamers + Unit *pTarget = NULL; + for (uint8 i = 0; i < 10; ++i) + { + pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); + if (pTarget) + SummonIllusions(pTarget); + } + Invisible = true; + Invisible_Timer = 3000; + + //25 seconds until we should cast this agian + Illusion_Timer = 25000; + } else Illusion_Timer -= diff; + + // //Illusion_Timer + // if (Illusion_Timer <= diff) + // { + // //Cast + // DoCast(me->getVictim(), SPELL_ILLUSION); + // + // //3 Illusion will be summoned + // if (Illusioncounter < 3) + // { + // Illusion_Timer = 500; + // ++Illusioncounter; + // } + // else { + // //15 seconds until we should cast this again + // Illusion_Timer = 15000; + // Illusioncounter = 0; + // } + // + // } else Illusion_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +// Illusion of Jandice Barov Script + +struct mob_illusionofjandicebarovAI : public ScriptedAI +{ + mob_illusionofjandicebarovAI(Creature *c) : ScriptedAI(c) {} + + uint32 Cleave_Timer; + + void Reset() + { + Cleave_Timer = 2000 + rand()%6000; + me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, true); + } + + void EnterCombat(Unit * /*who*/) + { + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //Cleave_Timer + if (Cleave_Timer <= diff) + { + //Cast + DoCast(me->getVictim(), SPELL_CLEAVE); + + //5-8 seconds + Cleave_Timer = 5000 + rand()%3000; + } else Cleave_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_jandicebarov(Creature* pCreature) +{ + return new boss_jandicebarovAI (pCreature); +} + +CreatureAI* GetAI_mob_illusionofjandicebarov(Creature* pCreature) +{ + return new mob_illusionofjandicebarovAI (pCreature); +} + +void AddSC_boss_jandicebarov() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_jandice_barov"; + newscript->GetAI = &GetAI_boss_jandicebarov; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_illusionofjandicebarov"; + newscript->GetAI = &GetAI_mob_illusionofjandicebarov; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_kormok.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_kormok.cpp new file mode 100644 index 00000000000..c4ae5cc490e --- /dev/null +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_kormok.cpp @@ -0,0 +1,120 @@ +/* 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_Kormok +SD%Complete: 100 +SDComment: +SDCategory: Scholomance +EndScriptData */ + +#include "ScriptedPch.h" + +#define SPELL_SHADOWBOLTVOLLEY 20741 +#define SPELL_BONESHIELD 27688 + +struct boss_kormokAI : public ScriptedAI +{ + boss_kormokAI(Creature *c) : ScriptedAI(c) {} + + uint32 ShadowVolley_Timer; + uint32 BoneShield_Timer; + uint32 Minion_Timer; + uint32 Mage_Timer; + bool Mages; + + void Reset() + { + ShadowVolley_Timer = 10000; + BoneShield_Timer = 2000; + Minion_Timer = 15000; + Mage_Timer = 0; + Mages = false; + } + + void EnterCombat(Unit * /*who*/) + { + } + + void SummonMinions(Unit* victim) + { + if (Creature *SummonedMinion = DoSpawnCreature(16119, irand(-7,7), irand(-7,7), 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 120000)) + SummonedMinion->AI()->AttackStart(victim); + } + + void SummonMages(Unit* victim) + { + if (Creature *SummonedMage = DoSpawnCreature(16120, irand(-9,9), irand(-9,9), 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 120000)) + SummonedMage->AI()->AttackStart(victim); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //ShadowVolley_Timer + if (ShadowVolley_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_SHADOWBOLTVOLLEY); + ShadowVolley_Timer = 15000; + } else ShadowVolley_Timer -= diff; + + //BoneShield_Timer + if (BoneShield_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_BONESHIELD); + BoneShield_Timer = 45000; + } else BoneShield_Timer -= diff; + + //Minion_Timer + if (Minion_Timer <= diff) + { + //Cast + SummonMinions(me->getVictim()); + SummonMinions(me->getVictim()); + SummonMinions(me->getVictim()); + SummonMinions(me->getVictim()); + + Minion_Timer = 12000; + } else Minion_Timer -= diff; + + //Summon 2 Bone Mages + if (!Mages && me->GetHealth()*100 / me->GetMaxHealth() < 26) + { + //Cast + SummonMages(me->getVictim()); + SummonMages(me->getVictim()); + Mages = true; + } + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_kormok(Creature* pCreature) +{ + return new boss_kormokAI (pCreature); +} + +void AddSC_boss_kormok() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_kormok"; + newscript->GetAI = &GetAI_boss_kormok; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_lord_alexei_barov.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_lord_alexei_barov.cpp new file mode 100644 index 00000000000..0956a04d824 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_lord_alexei_barov.cpp @@ -0,0 +1,99 @@ +/* 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_Lord_Alexei_Barov +SD%Complete: 100 +SDComment: aura applied/defined in database +SDCategory: Scholomance +EndScriptData */ + +#include "ScriptedPch.h" +#include "scholomance.h" + +#define SPELL_IMMOLATE 20294 // Old ID was 15570 +#define SPELL_VEILOFSHADOW 17820 + +struct boss_lordalexeibarovAI : public ScriptedAI +{ + boss_lordalexeibarovAI(Creature *c) : ScriptedAI(c) {} + + uint32 Immolate_Timer; + uint32 VeilofShadow_Timer; + + void Reset() + { + Immolate_Timer = 7000; + VeilofShadow_Timer = 15000; + + me->LoadCreaturesAddon(); + } + + void JustDied(Unit * /*killer*/) + { + ScriptedInstance *pInstance = me->GetInstanceData(); + if (pInstance) + { + pInstance->SetData(DATA_LORDALEXEIBAROV_DEATH, 0); + + if (pInstance->GetData(TYPE_GANDLING) == IN_PROGRESS) + me->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0); + } + } + + void EnterCombat(Unit * /*who*/) + { + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //Immolate_Timer + if (Immolate_Timer <= diff) + { + Unit *pTarget = NULL; + pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); + if (pTarget) DoCast(pTarget, SPELL_IMMOLATE); + + Immolate_Timer = 12000; + } else Immolate_Timer -= diff; + + //VeilofShadow_Timer + if (VeilofShadow_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_VEILOFSHADOW); + VeilofShadow_Timer = 20000; + } else VeilofShadow_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_lordalexeibarov(Creature* pCreature) +{ + return new boss_lordalexeibarovAI (pCreature); +} + +void AddSC_boss_lordalexeibarov() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_lord_alexei_barov"; + newscript->GetAI = &GetAI_boss_lordalexeibarov; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_lorekeeper_polkelt.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_lorekeeper_polkelt.cpp new file mode 100644 index 00000000000..d3b75900202 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_lorekeeper_polkelt.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: Boss_Lorekeeper_Polkelt +SD%Complete: 100 +SDComment: +SDCategory: Scholomance +EndScriptData */ + +#include "ScriptedPch.h" +#include "scholomance.h" + +#define SPELL_VOLATILEINFECTION 24928 +#define SPELL_DARKPLAGUE 18270 +#define SPELL_CORROSIVEACID 23313 +#define SPELL_NOXIOUSCATALYST 18151 + +struct boss_lorekeeperpolkeltAI : public ScriptedAI +{ + boss_lorekeeperpolkeltAI(Creature *c) : ScriptedAI(c) {} + + uint32 VolatileInfection_Timer; + uint32 Darkplague_Timer; + uint32 CorrosiveAcid_Timer; + uint32 NoxiousCatalyst_Timer; + + void Reset() + { + VolatileInfection_Timer = 38000; + Darkplague_Timer = 8000; + CorrosiveAcid_Timer = 45000; + NoxiousCatalyst_Timer = 35000; + } + + void JustDied(Unit * /*killer*/) + { + ScriptedInstance *pInstance = me->GetInstanceData(); + if (pInstance) + { + pInstance->SetData(DATA_LOREKEEPERPOLKELT_DEATH, 0); + + if (pInstance->GetData(TYPE_GANDLING) == IN_PROGRESS) + me->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0); + } + } + + void EnterCombat(Unit * /*who*/) + { + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //VolatileInfection_Timer + if (VolatileInfection_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_VOLATILEINFECTION); + VolatileInfection_Timer = 32000; + } else VolatileInfection_Timer -= diff; + + //Darkplague_Timer + if (Darkplague_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_DARKPLAGUE); + Darkplague_Timer = 8000; + } else Darkplague_Timer -= diff; + + //CorrosiveAcid_Timer + if (CorrosiveAcid_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_CORROSIVEACID); + CorrosiveAcid_Timer = 25000; + } else CorrosiveAcid_Timer -= diff; + + //NoxiousCatalyst_Timer + if (NoxiousCatalyst_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_NOXIOUSCATALYST); + NoxiousCatalyst_Timer = 38000; + } else NoxiousCatalyst_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_lorekeeperpolkelt(Creature* pCreature) +{ + return new boss_lorekeeperpolkeltAI (pCreature); +} + +void AddSC_boss_lorekeeperpolkelt() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_lorekeeper_polkelt"; + newscript->GetAI = &GetAI_boss_lorekeeperpolkelt; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp new file mode 100644 index 00000000000..63837e04ad5 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp @@ -0,0 +1,123 @@ +/* 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_Ras_Frostwhisper +SD%Complete: 100 +SDComment: +SDCategory: Scholomance +EndScriptData */ + +#include "ScriptedPch.h" + +#define SPELL_FROSTBOLT 21369 +#define SPELL_ICEARMOR 18100 //This is actually a buff he gives himself +#define SPELL_FREEZE 18763 +#define SPELL_FEAR 26070 +#define SPELL_CHILLNOVA 18099 +#define SPELL_FROSTVOLLEY 8398 + +struct boss_rasfrostAI : public ScriptedAI +{ + boss_rasfrostAI(Creature *c) : ScriptedAI(c) {} + + uint32 IceArmor_Timer; + uint32 Frostbolt_Timer; + uint32 Freeze_Timer; + uint32 Fear_Timer; + uint32 ChillNova_Timer; + uint32 FrostVolley_Timer; + + void Reset() + { + IceArmor_Timer = 2000; + Frostbolt_Timer = 8000; + ChillNova_Timer = 12000; + Freeze_Timer = 18000; + FrostVolley_Timer = 24000; + Fear_Timer = 45000; + + DoCast(me, SPELL_ICEARMOR, true); + } + + void EnterCombat(Unit * /*who*/){} + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //IceArmor_Timer + if (IceArmor_Timer <= diff) + { + DoCast(me, SPELL_ICEARMOR); + IceArmor_Timer = 180000; + } else IceArmor_Timer -= diff; + + //Frostbolt_Timer + if (Frostbolt_Timer <= diff) + { + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) + DoCast(pTarget, SPELL_FROSTBOLT); + + Frostbolt_Timer = 8000; + } else Frostbolt_Timer -= diff; + + //Freeze_Timer + if (Freeze_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_FREEZE); + Freeze_Timer = 24000; + } else Freeze_Timer -= diff; + + //Fear_Timer + if (Fear_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_FEAR); + Fear_Timer = 30000; + } else Fear_Timer -= diff; + + //ChillNova_Timer + if (ChillNova_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_CHILLNOVA); + ChillNova_Timer = 14000; + } else ChillNova_Timer -= diff; + + //FrostVolley_Timer + if (FrostVolley_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_FROSTVOLLEY); + FrostVolley_Timer = 15000; + } else FrostVolley_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_rasfrost(Creature* pCreature) +{ + return new boss_rasfrostAI (pCreature); +} + +void AddSC_boss_rasfrost() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_boss_ras_frostwhisper"; + newscript->GetAI = &GetAI_boss_rasfrost; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_the_ravenian.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_the_ravenian.cpp new file mode 100644 index 00000000000..6340f2b0e2d --- /dev/null +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_the_ravenian.cpp @@ -0,0 +1,117 @@ +/* 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_ravenian +SD%Complete: 100 +SDComment: +SDCategory: Scholomance +EndScriptData */ + +#include "ScriptedPch.h" +#include "scholomance.h" + +#define SPELL_TRAMPLE 15550 +#define SPELL_CLEAVE 20691 +#define SPELL_SUNDERINCLEAVE 25174 +#define SPELL_KNOCKAWAY 10101 + +struct boss_theravenianAI : public ScriptedAI +{ + boss_theravenianAI(Creature *c) : ScriptedAI(c) {} + + uint32 Trample_Timer; + uint32 Cleave_Timer; + uint32 SunderingCleave_Timer; + uint32 KnockAway_Timer; + bool HasYelled; + + void Reset() + { + Trample_Timer = 24000; + Cleave_Timer = 15000; + SunderingCleave_Timer = 40000; + KnockAway_Timer = 32000; + HasYelled = false; + } + + void JustDied(Unit * /*killer*/) + { + ScriptedInstance *pInstance = me->GetInstanceData(); + if (pInstance) + { + pInstance->SetData(DATA_THERAVENIAN_DEATH, 0); + + if (pInstance->GetData(TYPE_GANDLING) == IN_PROGRESS) + me->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0); + } + } + + void EnterCombat(Unit * /*who*/) + { + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //Trample_Timer + if (Trample_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_TRAMPLE); + Trample_Timer = 10000; + } else Trample_Timer -= diff; + + //Cleave_Timer + if (Cleave_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_CLEAVE); + Cleave_Timer = 7000; + } else Cleave_Timer -= diff; + + //SunderingCleave_Timer + if (SunderingCleave_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_SUNDERINCLEAVE); + SunderingCleave_Timer = 20000; + } else SunderingCleave_Timer -= diff; + + //KnockAway_Timer + if (KnockAway_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_KNOCKAWAY); + KnockAway_Timer = 12000; + } else KnockAway_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_theravenian(Creature* pCreature) +{ + return new boss_theravenianAI (pCreature); +} + +void AddSC_boss_theravenian() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_the_ravenian"; + newscript->GetAI = &GetAI_boss_theravenian; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_vectus.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_vectus.cpp new file mode 100644 index 00000000000..a38369faab0 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_vectus.cpp @@ -0,0 +1,105 @@ +/* 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_Vectus +SD%Complete: 100 +SDComment: +SDCategory: Scholomance +EndScriptData */ + +#include "ScriptedPch.h" + +enum eEnums +{ + EMOTE_GENERIC_FRENZY_KILL = -1000001, + + SPELL_FLAMESTRIKE = 18399, + SPELL_BLAST_WAVE = 16046, + SPELL_FIRESHIELD = 19626, + SPELL_FRENZY = 8269 //28371, +}; + +struct boss_vectusAI : public ScriptedAI +{ + boss_vectusAI(Creature *c) : ScriptedAI(c) {} + + uint32 m_uiFireShield_Timer; + uint32 m_uiBlastWave_Timer; + uint32 m_uiFrenzy_Timer; + + void Reset() + { + m_uiFireShield_Timer = 2000; + m_uiBlastWave_Timer = 14000; + m_uiFrenzy_Timer = 0; + } + + void UpdateAI(const uint32 uiDiff) + { + if (!UpdateVictim()) + return; + + //FireShield_Timer + if (m_uiFireShield_Timer <= uiDiff) + { + DoCast(me, SPELL_FIRESHIELD); + m_uiFireShield_Timer = 90000; + } + else + m_uiFireShield_Timer -= uiDiff; + + //BlastWave_Timer + if (m_uiBlastWave_Timer <= uiDiff) + { + DoCast(me->getVictim(), SPELL_BLAST_WAVE); + m_uiBlastWave_Timer = 12000; + } + else + m_uiBlastWave_Timer -= uiDiff; + + //Frenzy_Timer + if (me->GetHealth()*100 / me->GetMaxHealth() < 25) + { + if (m_uiFrenzy_Timer <= uiDiff) + { + DoCast(me, SPELL_FRENZY); + DoScriptText(EMOTE_GENERIC_FRENZY_KILL, me); + + m_uiFrenzy_Timer = 24000; + } + else + m_uiFrenzy_Timer -= uiDiff; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_vectus(Creature* pCreature) +{ + return new boss_vectusAI (pCreature); +} + +void AddSC_boss_vectus() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_vectus"; + newscript->GetAI = &GetAI_boss_vectus; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/Scholomance/instance_scholomance.cpp b/src/server/scripts/EasternKingdoms/Scholomance/instance_scholomance.cpp new file mode 100644 index 00000000000..992849cff1b --- /dev/null +++ b/src/server/scripts/EasternKingdoms/Scholomance/instance_scholomance.cpp @@ -0,0 +1,146 @@ +/* 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_Scholomance +SD%Complete: 100 +SDComment: +SDCategory: Scholomance +EndScriptData */ + +#include "ScriptedPch.h" +#include "scholomance.h" + +#define GO_GATE_KIRTONOS 175570 +#define GO_GATE_GANDLING 177374 +#define GO_GATE_MALICIA 177375 +#define GO_GATE_THEOLEN 177377 +#define GO_GATE_POLKELT 177376 +#define GO_GATE_RAVENIAN 177372 +#define GO_GATE_BAROV 177373 +#define GO_GATE_ILLUCIA 177371 + +#define MAX_ENCOUNTER 2 + +struct instance_scholomance : public ScriptedInstance +{ + instance_scholomance(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + //Lord Alexei Barov, Doctor Theolen Krastinov, The Ravenian, Lorekeeper Polkelt, Instructor Malicia and the Lady Illucia Barov. + bool IsBossDied[6]; + uint32 m_auiEncounter[MAX_ENCOUNTER]; + + uint64 GateKirtonosGUID; + uint64 GateGandlingGUID; + uint64 GateMiliciaGUID; + uint64 GateTheolenGUID; + uint64 GatePolkeltGUID; + uint64 GateRavenianGUID; + uint64 GateBarovGUID; + uint64 GateIlluciaGUID; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + GateKirtonosGUID = 0; + GateGandlingGUID = 0; + GateMiliciaGUID = 0; + GateTheolenGUID = 0; + GatePolkeltGUID = 0; + GateRavenianGUID = 0; + GateBarovGUID = 0; + GateIlluciaGUID = 0; + + for (uint8 i = 0; i < 6; ++i) + IsBossDied[i] = false; + } + + void OnGameObjectCreate(GameObject* pGo, bool /*add*/) + { + switch(pGo->GetEntry()) + { + case GO_GATE_KIRTONOS: GateKirtonosGUID = pGo->GetGUID(); break; + case GO_GATE_GANDLING: GateGandlingGUID = pGo->GetGUID(); break; + case GO_GATE_MALICIA: GateMiliciaGUID = pGo->GetGUID(); break; + case GO_GATE_THEOLEN: GateTheolenGUID = pGo->GetGUID(); break; + case GO_GATE_POLKELT: GatePolkeltGUID = pGo->GetGUID(); break; + case GO_GATE_RAVENIAN: GateRavenianGUID = pGo->GetGUID(); break; + case GO_GATE_BAROV: GateBarovGUID = pGo->GetGUID(); break; + case GO_GATE_ILLUCIA: GateIlluciaGUID = pGo->GetGUID(); break; + } + } + + void SetData(uint32 type, uint32 data) + { + switch(type) + { + case DATA_LORDALEXEIBAROV_DEATH: + IsBossDied[0] = true; + break; + case DATA_DOCTORTHEOLENKRASTINOV_DEATH: + IsBossDied[1] = true; + break; + case DATA_THERAVENIAN_DEATH: + IsBossDied[2] = true; + break; + case DATA_LOREKEEPERPOLKELT_DEATH: + IsBossDied[3] = true; + break; + case DATA_INSTRUCTORMALICIA_DEATH: + IsBossDied[4] = true; + break; + case DATA_LADYILLUCIABAROV_DEATH: + IsBossDied[5] = true; + break; + case TYPE_GANDLING: + m_auiEncounter[0] = data; + break; + case TYPE_KIRTONOS: + m_auiEncounter[1] = data; + break; + } + } + + uint32 GetData(uint32 type) + { + if (type == TYPE_GANDLING) + { + if (IsBossDied[0] && IsBossDied[1] && IsBossDied[2] && IsBossDied[3] && IsBossDied[4] && IsBossDied[5]) + { + m_auiEncounter[0] = IN_PROGRESS; + return IN_PROGRESS; + } + } + + return 0; + } +}; + +InstanceData* GetInstanceData_instance_scholomance(Map* pMap) +{ + return new instance_scholomance(pMap); +} + +void AddSC_instance_scholomance() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_scholomance"; + newscript->GetInstanceData = &GetInstanceData_instance_scholomance; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/Scholomance/scholomance.h b/src/server/scripts/EasternKingdoms/Scholomance/scholomance.h new file mode 100644 index 00000000000..83ce26c9687 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/Scholomance/scholomance.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_SCHOLOMANCE_H +#define DEF_SCHOLOMANCE_H + +#define TYPE_GANDLING 1 +#define DATA_DOCTORTHEOLENKRASTINOV_DEATH 2 +#define DATA_INSTRUCTORMALICIA_DEATH 3 +#define DATA_LADYILLUCIABAROV_DEATH 4 +#define DATA_LORDALEXEIBAROV_DEATH 5 +#define DATA_LOREKEEPERPOLKELT_DEATH 6 +#define DATA_THERAVENIAN_DEATH 7 +#define TYPE_KIRTONOS 8 +#endif + diff --git a/src/server/scripts/EasternKingdoms/ShadowfangKeep/instance_shadowfang_keep.cpp b/src/server/scripts/EasternKingdoms/ShadowfangKeep/instance_shadowfang_keep.cpp new file mode 100644 index 00000000000..20959641889 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/ShadowfangKeep/instance_shadowfang_keep.cpp @@ -0,0 +1,277 @@ +/* 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_Shadowfang_Keep +SD%Complete: 90 +SDComment: +SDCategory: Shadowfang Keep +EndScriptData */ + +#include "ScriptedPch.h" +#include "shadowfang_keep.h" + +#define MAX_ENCOUNTER 4 + +enum eEnums +{ + SAY_BOSS_DIE_AD = -1033007, + SAY_BOSS_DIE_AS = -1033008, + SAY_ARCHMAGE = -1033009, + + NPC_ASH = 3850, + NPC_ADA = 3849, + NPC_ARCHMAGE_ARUGAL = 4275, + NPC_ARUGAL_VOIDWALKER = 4627, + + GO_COURTYARD_DOOR = 18895, //door to open when talking to NPC's + GO_SORCERER_DOOR = 18972, //door to open when Fenrus the Devourer + GO_ARUGAL_DOOR = 18971, //door to open when Wolf Master Nandos + + SPELL_ASHCROMBE_TELEPORT = 15742 +}; + +const Position SpawnLocation[] = +{ + {-148.199,2165.647,128.448,1.026}, + {-153.110,2168.620,128.448,1.026}, + {-145.905,2180.520,128.448,4.183}, + {-140.794,2178.037,128.448,4.090}, + {-138.640,2170.159,136.577,2.737} +}; +struct instance_shadowfang_keep : public ScriptedInstance +{ + instance_shadowfang_keep(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + std::string str_data; + + uint64 uiAshGUID; + uint64 uiAdaGUID; + uint64 uiArchmageArugalGUID; + + uint64 DoorCourtyardGUID; + uint64 DoorSorcererGUID; + uint64 DoorArugalGUID; + + uint8 uiPhase; + uint16 uiTimer; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + uiAshGUID = 0; + uiAdaGUID = 0; + uiArchmageArugalGUID = 0; + + DoorCourtyardGUID = 0; + DoorSorcererGUID = 0; + DoorArugalGUID = 0; + + uiPhase = 0; + uiTimer = 0; + } + + void OnCreatureCreate(Creature* pCreature, bool /*add*/) + { + switch(pCreature->GetEntry()) + { + case NPC_ASH: uiAshGUID = pCreature->GetGUID(); break; + case NPC_ADA: uiAdaGUID = pCreature->GetGUID(); break; + case NPC_ARCHMAGE_ARUGAL: uiArchmageArugalGUID = pCreature->GetGUID(); break; + } + } + + void OnGameObjectCreate(GameObject* pGo, bool /*add*/) + { + switch(pGo->GetEntry()) + { + case GO_COURTYARD_DOOR: + DoorCourtyardGUID = pGo->GetGUID(); + if (m_auiEncounter[0] == DONE) + HandleGameObject(NULL, true, pGo); + break; + case GO_SORCERER_DOOR: + DoorSorcererGUID = pGo->GetGUID(); + if (m_auiEncounter[2] == DONE) + HandleGameObject(NULL, true, pGo); + break; + case GO_ARUGAL_DOOR: + DoorArugalGUID = pGo->GetGUID(); + if (m_auiEncounter[3] == DONE) + HandleGameObject(NULL, true, pGo); + break; + } + } + + void DoSpeech() + { + Creature* pAda = instance->GetCreature(uiAdaGUID); + Creature* pAsh = instance->GetCreature(uiAshGUID); + + if (pAda && pAda->isAlive() && pAsh && pAsh->isAlive()) + { + DoScriptText(SAY_BOSS_DIE_AD,pAda); + DoScriptText(SAY_BOSS_DIE_AS,pAsh); + } + } + + void SetData(uint32 type, uint32 data) + { + switch(type) + { + case TYPE_FREE_NPC: + if (data == DONE) + DoUseDoorOrButton(DoorCourtyardGUID); + m_auiEncounter[0] = data; + break; + case TYPE_RETHILGORE: + if (data == DONE) + DoSpeech(); + m_auiEncounter[1] = data; + break; + case TYPE_FENRUS: + switch(data) + { + case DONE: + uiTimer = 1000; + uiPhase = 1; + break; + case 7: + DoUseDoorOrButton(DoorSorcererGUID); + break; + } + m_auiEncounter[2] = data; + break; + case TYPE_NANDOS: + if (data == DONE) + DoUseDoorOrButton(DoorArugalGUID); + m_auiEncounter[3] = 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]; + + str_data = saveStream.str(); + + SaveToDB(); + OUT_SAVE_INST_DATA_COMPLETE; + } + } + + uint32 GetData(uint32 type) + { + switch(type) + { + case TYPE_FREE_NPC: + return m_auiEncounter[0]; + case TYPE_RETHILGORE: + return m_auiEncounter[1]; + case TYPE_FENRUS: + return m_auiEncounter[2]; + case TYPE_NANDOS: + return m_auiEncounter[3]; + } + 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]; + + for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) + { + if (m_auiEncounter[i] == IN_PROGRESS) + m_auiEncounter[i] = NOT_STARTED; + } + + OUT_LOAD_INST_DATA_COMPLETE; + } + + void Update(uint32 uiDiff) + { + if (GetData(TYPE_FENRUS) != DONE) + return; + + Creature* pArchmage = instance->GetCreature(uiArchmageArugalGUID); + Creature* pSummon = NULL; + + if (!pArchmage || !pArchmage->isAlive()) + return; + + if (uiPhase) + { + if (uiTimer <= uiDiff) + { + switch(uiPhase) + { + case 1: + pSummon = pArchmage->SummonCreature(pArchmage->GetEntry(),SpawnLocation[4],TEMPSUMMON_TIMED_DESPAWN,10000); + pSummon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + pSummon->SetReactState(REACT_DEFENSIVE); + pSummon->CastSpell(pSummon,SPELL_ASHCROMBE_TELEPORT,true); + DoScriptText(SAY_ARCHMAGE,pSummon); + uiTimer = 2000; + uiPhase = 2; + break; + case 2: + pArchmage->SummonCreature(NPC_ARUGAL_VOIDWALKER,SpawnLocation[0],TEMPSUMMON_CORPSE_TIMED_DESPAWN,60000); + pArchmage->SummonCreature(NPC_ARUGAL_VOIDWALKER,SpawnLocation[1],TEMPSUMMON_CORPSE_TIMED_DESPAWN,60000); + pArchmage->SummonCreature(NPC_ARUGAL_VOIDWALKER,SpawnLocation[2],TEMPSUMMON_CORPSE_TIMED_DESPAWN,60000); + pArchmage->SummonCreature(NPC_ARUGAL_VOIDWALKER,SpawnLocation[3],TEMPSUMMON_CORPSE_TIMED_DESPAWN,60000); + uiPhase = 0; + break; + + } + } else uiTimer -= uiDiff; + } + } +}; + +InstanceData* GetInstanceData_instance_shadowfang_keep(Map* pMap) +{ + return new instance_shadowfang_keep(pMap); +} + +void AddSC_instance_shadowfang_keep() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_shadowfang_keep"; + newscript->GetInstanceData = &GetInstanceData_instance_shadowfang_keep; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp b/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp new file mode 100644 index 00000000000..23b8ad89160 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp @@ -0,0 +1,198 @@ + /* 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: Shadowfang_Keep +SD%Complete: 75 +SDComment: npc_shadowfang_prisoner using escortAI for movement to door. Might need additional code in case being attacked. Add proper texts/say(). +SDCategory: Shadowfang Keep +EndScriptData */ + +/* ContentData +npc_shadowfang_prisoner +EndContentData */ + +#include "ScriptedPch.h" +#include "ScriptedEscortAI.h" +#include "shadowfang_keep.h" + +/*###### +## npc_shadowfang_prisoner +######*/ + +enum eEnums +{ + SAY_FREE_AS = -1033000, + SAY_OPEN_DOOR_AS = -1033001, + SAY_POST_DOOR_AS = -1033002, + SAY_FREE_AD = -1033003, + SAY_OPEN_DOOR_AD = -1033004, + SAY_POST1_DOOR_AD = -1033005, + SAY_POST2_DOOR_AD = -1033006, + + SPELL_UNLOCK = 6421, + NPC_ASH = 3850, + + SPELL_DARK_OFFERING = 7154 +}; + +#define GOSSIP_ITEM_DOOR "Thanks, I'll follow you to the door." + +struct npc_shadowfang_prisonerAI : public npc_escortAI +{ + npc_shadowfang_prisonerAI(Creature *c) : npc_escortAI(c) + { + pInstance = c->GetInstanceData(); + uiNpcEntry = c->GetEntry(); + } + + ScriptedInstance *pInstance; + uint32 uiNpcEntry; + + void WaypointReached(uint32 uiPoint) + { + switch(uiPoint) + { + case 0: + if (uiNpcEntry == NPC_ASH) + DoScriptText(SAY_FREE_AS, me); + else + DoScriptText(SAY_FREE_AD, me); + break; + case 10: + if (uiNpcEntry == NPC_ASH) + DoScriptText(SAY_OPEN_DOOR_AS, me); + else + DoScriptText(SAY_OPEN_DOOR_AD, me); + break; + case 11: + if (uiNpcEntry == NPC_ASH) + DoCast(me, SPELL_UNLOCK); + break; + case 12: + if (uiNpcEntry == NPC_ASH) + DoScriptText(SAY_POST_DOOR_AS, me); + else + DoScriptText(SAY_POST1_DOOR_AD, me); + + if (pInstance) + pInstance->SetData(TYPE_FREE_NPC, DONE); + break; + case 13: + if (uiNpcEntry != NPC_ASH) + DoScriptText(SAY_POST2_DOOR_AD, me); + break; + } + } + + void Reset() {} + void EnterCombat(Unit* /*who*/) {} +}; + +CreatureAI* GetAI_npc_shadowfang_prisoner(Creature* pCreature) +{ + return new npc_shadowfang_prisonerAI(pCreature); +} + +bool GossipHello_npc_shadowfang_prisoner(Player* pPlayer, Creature* pCreature) +{ + ScriptedInstance* pInstance = pCreature->GetInstanceData(); + + if (pInstance && pInstance->GetData(TYPE_FREE_NPC) != DONE && pInstance->GetData(TYPE_RETHILGORE) == DONE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_DOOR, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_shadowfang_prisoner(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + pPlayer->CLOSE_GOSSIP_MENU(); + + if (npc_escortAI* pEscortAI = CAST_AI(npc_shadowfang_prisonerAI, pCreature->AI())) + pEscortAI->Start(false, false); + } + return true; +} + +struct npc_arugal_voidwalkerAI : public ScriptedAI +{ + npc_arugal_voidwalkerAI(Creature* pCreature) : ScriptedAI(pCreature) + { + pInstance = pCreature->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint32 uiDarkOffering; + + void Reset() + { + uiDarkOffering = urand(290,10); + } + + void UpdateAI(uint32 const uiDiff) + { + if (!UpdateVictim()) + return; + + if (uiDarkOffering <= uiDiff) + { + if (Creature* pFriend = me->FindNearestCreature(me->GetEntry(),25.0f,true)) + { + if (pFriend) + DoCast(pFriend,SPELL_DARK_OFFERING); + } + else + DoCast(me,SPELL_DARK_OFFERING); + uiDarkOffering = urand(4400,12500); + } else uiDarkOffering -= uiDiff; + + DoMeleeAttackIfReady(); + } + + void JustDied(Unit* /*pKiller*/) + { + if (pInstance) + pInstance->SetData(TYPE_FENRUS, pInstance->GetData(TYPE_FENRUS) + 1); + } +}; + +CreatureAI* GetAI_npc_arugal_voidwalker(Creature* pCreature) +{ + return new npc_arugal_voidwalkerAI(pCreature); +} + +void AddSC_shadowfang_keep() +{ + Script* newscript; + + newscript = new Script; + newscript->Name = "npc_shadowfang_prisoner"; + newscript->pGossipHello = &GossipHello_npc_shadowfang_prisoner; + newscript->pGossipSelect = &GossipSelect_npc_shadowfang_prisoner; + newscript->GetAI = &GetAI_npc_shadowfang_prisoner; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_arugal_voidwalker"; + newscript->GetAI = &GetAI_npc_arugal_voidwalker; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.h b/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.h new file mode 100644 index 00000000000..a1a59789632 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.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_SHADOWFANG_H +#define DEF_SHADOWFANG_H + +enum eData +{ + TYPE_FREE_NPC = 1, + TYPE_RETHILGORE = 2, + TYPE_FENRUS = 3, + TYPE_NANDOS = 4 +}; + +#endif + diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp new file mode 100644 index 00000000000..de17717e289 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp @@ -0,0 +1,190 @@ +/* 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_Baron_Rivendare +SD%Complete: 70 +SDComment: aura applied/defined in database +SDCategory: Stratholme +EndScriptData */ + +#include "ScriptedPch.h" +#include "stratholme.h" + +#define SAY_0 "Intruders! More pawns of the Argent Dawn, no doubt. I already count one of their number among my prisoners. Withdraw from my domain before she is executed!" +#define SAY_1 "You're still here? Your foolishness is amusing! The Argent Dawn wench needn't suffer in vain. Leave at once and she shall be spared!" +#define SAY_2 "I shall take great pleasure in taking this poor wretch's life! It's not too late, she needn't suffer in vain. Turn back and her death shall be merciful!" +#define SAY_3 "May this prisoner's death serve as a warning. None shall defy the Scourge and live!" +#define SAY_4 "So you see fit to toy with the Lich King's creations? Ramstein, be sure to give the intruders a proper greeting." +#define SAY_5 "Time to take matters into my own hands. Come. Enter my domain and challenge the might of the Scourge!" + +#define ADD_1X 4017.403809 +#define ADD_1Y -3339.703369 +#define ADD_1Z 115.057655 +#define ADD_1O 5.487860 + +#define ADD_2X 4013.189209 +#define ADD_2Y -3351.808350 +#define ADD_2Z 115.052254 +#define ADD_2O 0.134280 + +#define ADD_3X 4017.738037 +#define ADD_3Y -3363.478016 +#define ADD_3Z 115.057274 +#define ADD_3O 0.723313 + +#define ADD_4X 4048.877197 +#define ADD_4Y -3363.223633 +#define ADD_4Z 115.054253 +#define ADD_4O 3.627735 + +#define ADD_5X 4051.777588 +#define ADD_5Y -3350.893311 +#define ADD_5Z 115.055351 +#define ADD_5O 3.066176 + +#define ADD_6X 4048.375977 +#define ADD_6Y -3339.966309 +#define ADD_6Z 115.055222 +#define ADD_6O 2.457497 + +#define SPELL_SHADOWBOLT 17393 +#define SPELL_CLEAVE 15284 +#define SPELL_MORTALSTRIKE 15708 + +#define SPELL_UNHOLY_AURA 17467 +#define SPELL_RAISEDEAD 17473 //triggers death pact (17471) + +#define SPELL_RAISE_DEAD1 17475 +#define SPELL_RAISE_DEAD2 17476 +#define SPELL_RAISE_DEAD3 17477 +#define SPELL_RAISE_DEAD4 17478 +#define SPELL_RAISE_DEAD5 17479 +#define SPELL_RAISE_DEAD6 17480 + +struct boss_baron_rivendareAI : public ScriptedAI +{ + boss_baron_rivendareAI(Creature *c) : ScriptedAI(c) + { + pInstance = me->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint32 ShadowBolt_Timer; + uint32 Cleave_Timer; + uint32 MortalStrike_Timer; + // uint32 RaiseDead_Timer; + uint32 SummonSkeletons_Timer; + + void Reset() + { + ShadowBolt_Timer = 5000; + Cleave_Timer = 8000; + MortalStrike_Timer = 12000; + // RaiseDead_Timer = 30000; + SummonSkeletons_Timer = 34000; + if (pInstance && pInstance->GetData(TYPE_RAMSTEIN) == DONE) + pInstance->SetData(TYPE_BARON,NOT_STARTED); + } + + void AttackStart(Unit* who) + { + if (pInstance)//can't use entercombat(), boss' dmg aura sets near players in combat, before entering the room's door + pInstance->SetData(TYPE_BARON,IN_PROGRESS); + ScriptedAI::AttackStart(who); + } + + void JustSummoned(Creature* summoned) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + summoned->AI()->AttackStart(pTarget); + } + + void JustDied(Unit* /*Killer*/) + { + if (pInstance) + pInstance->SetData(TYPE_BARON,DONE); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //ShadowBolt + if (ShadowBolt_Timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(me->getVictim(), SPELL_SHADOWBOLT); + + ShadowBolt_Timer = 10000; + } else ShadowBolt_Timer -= diff; + + //Cleave + if (Cleave_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_CLEAVE); + //13 seconds until we should cast this again + Cleave_Timer = 7000 + (rand()%10000); + } else Cleave_Timer -= diff; + + //MortalStrike + if (MortalStrike_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_MORTALSTRIKE); + MortalStrike_Timer = 10000 + (rand()%15000); + } else MortalStrike_Timer -= diff; + + //RaiseDead + // if (RaiseDead_Timer <= diff) + // { + // DoCast(me, SPELL_RAISEDEAD); + // RaiseDead_Timer = 45000; + // } else RaiseDead_Timer -= diff; + + //SummonSkeletons + if (SummonSkeletons_Timer <= diff) + { + me->SummonCreature(11197,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,29000); + me->SummonCreature(11197,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,29000); + me->SummonCreature(11197,ADD_3X,ADD_3Y,ADD_3Z,ADD_3O,TEMPSUMMON_TIMED_DESPAWN,29000); + me->SummonCreature(11197,ADD_4X,ADD_4Y,ADD_4Z,ADD_4O,TEMPSUMMON_TIMED_DESPAWN,29000); + me->SummonCreature(11197,ADD_5X,ADD_5Y,ADD_5Z,ADD_5O,TEMPSUMMON_TIMED_DESPAWN,29000); + me->SummonCreature(11197,ADD_6X,ADD_6Y,ADD_6Z,ADD_6O,TEMPSUMMON_TIMED_DESPAWN,29000); + + //34 seconds until we should cast this again + SummonSkeletons_Timer = 40000; + } else SummonSkeletons_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_baron_rivendare(Creature* pCreature) +{ + return new boss_baron_rivendareAI (pCreature); +} + +void AddSC_boss_baron_rivendare() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_baron_rivendare"; + newscript->GetAI = &GetAI_boss_baron_rivendare; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_baroness_anastari.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_baroness_anastari.cpp new file mode 100644 index 00000000000..cff4fe3fbae --- /dev/null +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_baroness_anastari.cpp @@ -0,0 +1,127 @@ +/* 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_Baroness_Anastari +SD%Complete: 90 +SDComment: MC disabled +SDCategory: Stratholme +EndScriptData */ + +#include "ScriptedPch.h" +#include "stratholme.h" + +#define SPELL_BANSHEEWAIL 16565 +#define SPELL_BANSHEECURSE 16867 +#define SPELL_SILENCE 18327 +//#define SPELL_POSSESS 17244 + +struct boss_baroness_anastariAI : public ScriptedAI +{ + boss_baroness_anastariAI(Creature *c) : ScriptedAI(c) + { + pInstance = me->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint32 BansheeWail_Timer; + uint32 BansheeCurse_Timer; + uint32 Silence_Timer; + //uint32 Possess_Timer; + + void Reset() + { + BansheeWail_Timer = 1000; + BansheeCurse_Timer = 11000; + Silence_Timer = 13000; + //Possess_Timer = 35000; + } + + void EnterCombat(Unit * /*who*/) + { + } + + void JustDied(Unit* /*Killer*/) + { + if (pInstance) + pInstance->SetData(TYPE_BARONESS,IN_PROGRESS); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //BansheeWail + if (BansheeWail_Timer <= diff) + { + if (rand()%100 < 95) + DoCast(me->getVictim(), SPELL_BANSHEEWAIL); + //4 seconds until we should cast this again + BansheeWail_Timer = 4000; + } else BansheeWail_Timer -= diff; + + //BansheeCurse + if (BansheeCurse_Timer <= diff) + { + if (rand()%100 < 75) + DoCast(me->getVictim(), SPELL_BANSHEECURSE); + //18 seconds until we should cast this again + BansheeCurse_Timer = 18000; + } else BansheeCurse_Timer -= diff; + + //Silence + if (Silence_Timer <= diff) + { + if (rand()%100 < 80) + DoCast(me->getVictim(), SPELL_SILENCE); + //13 seconds until we should cast this again + Silence_Timer = 13000; + } else Silence_Timer -= diff; + + //Possess + /* if (Possess_Timer <= diff) + { + //Cast + if (rand()%100 < 65) + { + Unit *pTarget = NULL; + pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); + if (pTarget)DoCast(pTarget, SPELL_POSSESS); + } + //50 seconds until we should cast this again + Possess_Timer = 50000; + } else Possess_Timer -= diff; + */ + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_baroness_anastari(Creature* pCreature) +{ + return new boss_baroness_anastariAI (pCreature); +} + +void AddSC_boss_baroness_anastari() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_baroness_anastari"; + newscript->GetAI = &GetAI_boss_baroness_anastari; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_cannon_master_willey.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_cannon_master_willey.cpp new file mode 100644 index 00000000000..c12f7b9ad04 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_cannon_master_willey.cpp @@ -0,0 +1,220 @@ +/* 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_cannon_master_willey +SD%Complete: 100 +SDComment: +SDCategory: Stratholme +EndScriptData */ + +#include "ScriptedPch.h" + +//front, left +#define ADD_1X 3553.851807 +#define ADD_1Y -2945.885986 +#define ADD_1Z 125.001015 +#define ADD_1O 0.592007 +//front, right +#define ADD_2X 3559.206299 +#define ADD_2Y -2952.929932 +#define ADD_2Z 125.001015 +#define ADD_2O 0.592007 +//mid, left +#define ADD_3X 3552.417480 +#define ADD_3Y -2948.667236 +#define ADD_3Z 125.001015 +#define ADD_3O 0.592007 +//mid, right +#define ADD_4X 3555.651855 +#define ADD_4Y -2953.519043 +#define ADD_4Z 125.001015 +#define ADD_4O 0.592007 +//back, left +#define ADD_5X 3547.927246 +#define ADD_5Y -2950.977295 +#define ADD_5Z 125.001015 +#define ADD_5O 0.592007 +//back, mid +#define ADD_6X 3553.094697 +#define ADD_6Y -2952.123291 +#define ADD_6Z 125.001015 +#define ADD_6O 0.592007 +//back, right +#define ADD_7X 3552.727539 +#define ADD_7Y -2957.776123 +#define ADD_7Z 125.001015 +#define ADD_7O 0.592007 +//behind, left +#define ADD_8X 3547.156250 +#define ADD_8Y -2953.162354 +#define ADD_8Z 125.001015 +#define ADD_8O 0.592007 +//behind, right +#define ADD_9X 3550.202148 +#define ADD_9Y -2957.437744 +#define ADD_9Z 125.001015 +#define ADD_9O 0.592007 + +#define SPELL_KNOCKAWAY 10101 +#define SPELL_PUMMEL 15615 +#define SPELL_SHOOT 16496 +//#define SPELL_SUMMONCRIMSONRIFLEMAN 17279 + +struct boss_cannon_master_willeyAI : public ScriptedAI +{ + boss_cannon_master_willeyAI(Creature *c) : ScriptedAI(c) {} + + uint32 KnockAway_Timer; + uint32 Pummel_Timer; + uint32 Shoot_Timer; + uint32 SummonRifleman_Timer; + + void Reset() + { + Shoot_Timer = 1000; + Pummel_Timer = 7000; + KnockAway_Timer = 11000; + SummonRifleman_Timer = 15000; + } + + void JustDied(Unit* /*Victim*/) + { + me->SummonCreature(11054,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,240000); + me->SummonCreature(11054,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,240000); + me->SummonCreature(11054,ADD_3X,ADD_3Y,ADD_3Z,ADD_3O,TEMPSUMMON_TIMED_DESPAWN,240000); + me->SummonCreature(11054,ADD_4X,ADD_4Y,ADD_4Z,ADD_4O,TEMPSUMMON_TIMED_DESPAWN,240000); + me->SummonCreature(11054,ADD_5X,ADD_5Y,ADD_5Z,ADD_5O,TEMPSUMMON_TIMED_DESPAWN,240000); + me->SummonCreature(11054,ADD_7X,ADD_7Y,ADD_7Z,ADD_7O,TEMPSUMMON_TIMED_DESPAWN,240000); + me->SummonCreature(11054,ADD_9X,ADD_9Y,ADD_9Z,ADD_9O,TEMPSUMMON_TIMED_DESPAWN,240000); + } + + void EnterCombat(Unit * /*who*/) + { + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //Pummel + if (Pummel_Timer <= diff) + { + //Cast + if (rand()%100 < 90) //90% chance to cast + { + DoCast(me->getVictim(), SPELL_PUMMEL); + } + //12 seconds until we should cast this again + Pummel_Timer = 12000; + } else Pummel_Timer -= diff; + + //KnockAway + if (KnockAway_Timer <= diff) + { + //Cast + if (rand()%100 < 80) //80% chance to cast + { + DoCast(me->getVictim(), SPELL_KNOCKAWAY); + } + //14 seconds until we should cast this again + KnockAway_Timer = 14000; + } else KnockAway_Timer -= diff; + + //Shoot + if (Shoot_Timer <= diff) + { + //Cast + DoCast(me->getVictim(), SPELL_SHOOT); + //1 seconds until we should cast this again + Shoot_Timer = 1000; + } else Shoot_Timer -= diff; + + //SummonRifleman + if (SummonRifleman_Timer <= diff) + { + //Cast + switch (rand()%9) + { + case 0: + me->SummonCreature(11054,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,240000); + me->SummonCreature(11054,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,240000); + me->SummonCreature(11054,ADD_4X,ADD_4Y,ADD_4Z,ADD_4O,TEMPSUMMON_TIMED_DESPAWN,240000); + break; + case 1: + me->SummonCreature(11054,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,240000); + me->SummonCreature(11054,ADD_3X,ADD_3Y,ADD_3Z,ADD_3O,TEMPSUMMON_TIMED_DESPAWN,240000); + me->SummonCreature(11054,ADD_5X,ADD_5Y,ADD_5Z,ADD_5O,TEMPSUMMON_TIMED_DESPAWN,240000); + break; + case 2: + me->SummonCreature(11054,ADD_3X,ADD_3Y,ADD_3Z,ADD_3O,TEMPSUMMON_TIMED_DESPAWN,240000); + me->SummonCreature(11054,ADD_4X,ADD_4Y,ADD_4Z,ADD_4O,TEMPSUMMON_TIMED_DESPAWN,240000); + me->SummonCreature(11054,ADD_6X,ADD_6Y,ADD_6Z,ADD_6O,TEMPSUMMON_TIMED_DESPAWN,240000); + break; + case 3: + me->SummonCreature(11054,ADD_4X,ADD_4Y,ADD_4Z,ADD_4O,TEMPSUMMON_TIMED_DESPAWN,240000); + me->SummonCreature(11054,ADD_5X,ADD_5Y,ADD_5Z,ADD_5O,TEMPSUMMON_TIMED_DESPAWN,240000); + me->SummonCreature(11054,ADD_7X,ADD_7Y,ADD_7Z,ADD_7O,TEMPSUMMON_TIMED_DESPAWN,240000); + break; + case 4: + me->SummonCreature(11054,ADD_5X,ADD_5Y,ADD_5Z,ADD_5O,TEMPSUMMON_TIMED_DESPAWN,240000); + me->SummonCreature(11054,ADD_6X,ADD_6Y,ADD_6Z,ADD_6O,TEMPSUMMON_TIMED_DESPAWN,240000); + me->SummonCreature(11054,ADD_8X,ADD_8Y,ADD_8Z,ADD_8O,TEMPSUMMON_TIMED_DESPAWN,240000); + break; + case 5: + me->SummonCreature(11054,ADD_6X,ADD_6Y,ADD_6Z,ADD_6O,TEMPSUMMON_TIMED_DESPAWN,240000); + me->SummonCreature(11054,ADD_7X,ADD_7Y,ADD_7Z,ADD_7O,TEMPSUMMON_TIMED_DESPAWN,240000); + me->SummonCreature(11054,ADD_9X,ADD_9Y,ADD_9Z,ADD_9O,TEMPSUMMON_TIMED_DESPAWN,240000); + break; + case 6: + me->SummonCreature(11054,ADD_7X,ADD_7Y,ADD_7Z,ADD_7O,TEMPSUMMON_TIMED_DESPAWN,240000); + me->SummonCreature(11054,ADD_8X,ADD_8Y,ADD_8Z,ADD_8O,TEMPSUMMON_TIMED_DESPAWN,240000); + me->SummonCreature(11054,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,240000); + break; + case 7: + me->SummonCreature(11054,ADD_8X,ADD_8Y,ADD_8Z,ADD_8O,TEMPSUMMON_TIMED_DESPAWN,240000); + me->SummonCreature(11054,ADD_9X,ADD_9Y,ADD_9Z,ADD_9O,TEMPSUMMON_TIMED_DESPAWN,240000); + me->SummonCreature(11054,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,240000); + break; + case 8: + me->SummonCreature(11054,ADD_9X,ADD_9Y,ADD_9Z,ADD_9O,TEMPSUMMON_TIMED_DESPAWN,240000); + me->SummonCreature(11054,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,240000); + me->SummonCreature(11054,ADD_3X,ADD_3Y,ADD_3Z,ADD_3O,TEMPSUMMON_TIMED_DESPAWN,240000); + break; + } + //30 seconds until we should cast this again + SummonRifleman_Timer = 30000; + } else SummonRifleman_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_cannon_master_willey(Creature* pCreature) +{ + return new boss_cannon_master_willeyAI (pCreature); +} + +void AddSC_boss_cannon_master_willey() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_cannon_master_willey"; + newscript->GetAI = &GetAI_boss_cannon_master_willey; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_dathrohan_balnazzar.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_dathrohan_balnazzar.cpp new file mode 100644 index 00000000000..a8489a7f549 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_dathrohan_balnazzar.cpp @@ -0,0 +1,217 @@ +/* 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_Dathrohan_Balnazzar +SD%Complete: 95 +SDComment: Possibly need to fix/improve summons after death +SDCategory: Stratholme +EndScriptData */ + +#include "ScriptedPch.h" + +enum eEnums +{ + //Dathrohan spells + SPELL_CRUSADERSHAMMER = 17286, //AOE stun + SPELL_CRUSADERSTRIKE = 17281, + SPELL_HOLYSTRIKE = 17284, //weapon dmg +3 + + //Transform + SPELL_BALNAZZARTRANSFORM = 17288, //restore full HP/mana, trigger spell Balnazzar Transform Stun + + //Balnazzar spells + SPELL_SHADOWSHOCK = 17399, + SPELL_MINDBLAST = 17287, + SPELL_PSYCHICSCREAM = 13704, + SPELL_SLEEP = 12098, + SPELL_MINDCONTROL = 15690, + + NPC_DATHROHAN = 10812, + NPC_BALNAZZAR = 10813, + NPC_ZOMBIE = 10698 //probably incorrect +}; + +struct SummonDef +{ + float m_fX, m_fY, m_fZ, m_fOrient; +}; + +SummonDef m_aSummonPoint[]= +{ + {3444.156, -3090.626, 135.002, 2.240}, //G1 front, left + {3449.123, -3087.009, 135.002, 2.240}, //G1 front, right + {3446.246, -3093.466, 135.002, 2.240}, //G1 back left + {3451.160, -3089.904, 135.002, 2.240}, //G1 back, right + + {3457.995, -3080.916, 135.002, 3.784}, //G2 front, left + {3454.302, -3076.330, 135.002, 3.784}, //G2 front, right + {3460.975, -3078.901, 135.002, 3.784}, //G2 back left + {3457.338, -3073.979, 135.002, 3.784} //G2 back, right +}; + +struct boss_dathrohan_balnazzarAI : public ScriptedAI +{ + boss_dathrohan_balnazzarAI(Creature *c) : ScriptedAI(c) {} + + uint32 m_uiCrusadersHammer_Timer; + uint32 m_uiCrusaderStrike_Timer; + uint32 m_uiMindBlast_Timer; + uint32 m_uiHolyStrike_Timer; + uint32 m_uiShadowShock_Timer; + uint32 m_uiPsychicScream_Timer; + uint32 m_uiDeepSleep_Timer; + uint32 m_uiMindControl_Timer; + bool m_bTransformed; + + void Reset() + { + m_uiCrusadersHammer_Timer = 8000; + m_uiCrusaderStrike_Timer = 12000; + m_uiMindBlast_Timer = 6000; + m_uiHolyStrike_Timer = 18000; + m_uiShadowShock_Timer = 4000; + m_uiPsychicScream_Timer = 16000; + m_uiDeepSleep_Timer = 20000; + m_uiMindControl_Timer = 10000; + m_bTransformed = false; + + if (me->GetEntry() == NPC_BALNAZZAR) + me->UpdateEntry(NPC_DATHROHAN); + } + + void JustDied(Unit* /*Victim*/) + { + static uint32 uiCount = sizeof(m_aSummonPoint)/sizeof(SummonDef); + + for (uint8 i=0; iSummonCreature(NPC_ZOMBIE, + m_aSummonPoint[i].m_fX, m_aSummonPoint[i].m_fY, m_aSummonPoint[i].m_fZ, m_aSummonPoint[i].m_fOrient, + TEMPSUMMON_TIMED_DESPAWN, HOUR*IN_MILISECONDS); + } + + void EnterCombat(Unit * /*who*/) + { + } + + void UpdateAI(const uint32 uiDiff) + { + if (!UpdateVictim()) + return; + + //START NOT TRANSFORMED + if (!m_bTransformed) + { + //MindBlast + if (m_uiMindBlast_Timer <= uiDiff) + { + DoCast(me->getVictim(), SPELL_MINDBLAST); + m_uiMindBlast_Timer = 15000 + rand()%5000; + } else m_uiMindBlast_Timer -= uiDiff; + + //CrusadersHammer + if (m_uiCrusadersHammer_Timer <= uiDiff) + { + DoCast(me->getVictim(), SPELL_CRUSADERSHAMMER); + m_uiCrusadersHammer_Timer = 12000; + } else m_uiCrusadersHammer_Timer -= uiDiff; + + //CrusaderStrike + if (m_uiCrusaderStrike_Timer <= uiDiff) + { + DoCast(me->getVictim(), SPELL_CRUSADERSTRIKE); + m_uiCrusaderStrike_Timer = 15000; + } else m_uiCrusaderStrike_Timer -= uiDiff; + + //HolyStrike + if (m_uiHolyStrike_Timer <= uiDiff) + { + DoCast(me->getVictim(), SPELL_HOLYSTRIKE); + m_uiHolyStrike_Timer = 15000; + } else m_uiHolyStrike_Timer -= uiDiff; + + //BalnazzarTransform + if (me->GetHealth()*100 / me->GetMaxHealth() < 40) + { + if (me->IsNonMeleeSpellCasted(false)) + me->InterruptNonMeleeSpells(false); + + //restore hp, mana and stun + DoCast(me, SPELL_BALNAZZARTRANSFORM); + me->UpdateEntry(NPC_BALNAZZAR); + m_bTransformed = true; + } + } + else + { + //MindBlast + if (m_uiMindBlast_Timer <= uiDiff) + { + DoCast(me->getVictim(), SPELL_MINDBLAST); + m_uiMindBlast_Timer = 15000 + rand()%5000; + } else m_uiMindBlast_Timer -= uiDiff; + + //ShadowShock + if (m_uiShadowShock_Timer <= uiDiff) + { + DoCast(me->getVictim(), SPELL_SHADOWSHOCK); + m_uiShadowShock_Timer = 11000; + } else m_uiShadowShock_Timer -= uiDiff; + + //PsychicScream + if (m_uiPsychicScream_Timer <= uiDiff) + { + if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(pTarget, SPELL_PSYCHICSCREAM); + + m_uiPsychicScream_Timer = 20000; + } else m_uiPsychicScream_Timer -= uiDiff; + + //DeepSleep + if (m_uiDeepSleep_Timer <= uiDiff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(pTarget, SPELL_SLEEP); + + m_uiDeepSleep_Timer = 15000; + } else m_uiDeepSleep_Timer -= uiDiff; + + //MindControl + if (m_uiMindControl_Timer <= uiDiff) + { + DoCast(me->getVictim(), SPELL_MINDCONTROL); + m_uiMindControl_Timer = 15000; + } else m_uiMindControl_Timer -= uiDiff; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_dathrohan_balnazzar(Creature* pCreature) +{ + return new boss_dathrohan_balnazzarAI (pCreature); +} + +void AddSC_boss_dathrohan_balnazzar() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_dathrohan_balnazzar"; + newscript->GetAI = &GetAI_boss_dathrohan_balnazzar; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_magistrate_barthilas.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_magistrate_barthilas.cpp new file mode 100644 index 00000000000..89de7dbc207 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_magistrate_barthilas.cpp @@ -0,0 +1,128 @@ +/* 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_Magistrate_Barthilas +SD%Complete: 70 +SDComment: +SDCategory: Stratholme +EndScriptData */ + +#include "ScriptedPch.h" +#include "stratholme.h" + +#define SPELL_DRAININGBLOW 16793 +#define SPELL_CROWDPUMMEL 10887 +#define SPELL_MIGHTYBLOW 14099 +#define SPELL_FURIOUS_ANGER 16791 + +#define MODEL_NORMAL 10433 +#define MODEL_HUMAN 3637 + +struct boss_magistrate_barthilasAI : public ScriptedAI +{ + boss_magistrate_barthilasAI(Creature *c) : ScriptedAI(c) {} + + uint32 DrainingBlow_Timer; + uint32 CrowdPummel_Timer; + uint32 MightyBlow_Timer; + uint32 FuriousAnger_Timer; + uint32 AngerCount; + + void Reset() + { + DrainingBlow_Timer = 20000; + CrowdPummel_Timer = 15000; + MightyBlow_Timer = 10000; + FuriousAnger_Timer = 5000; + AngerCount = 0; + + if (me->isAlive()) + me->SetDisplayId(MODEL_NORMAL); + else + me->SetDisplayId(MODEL_HUMAN); + } + + void MoveInLineOfSight(Unit *who) + { + //nothing to see here yet + + ScriptedAI::MoveInLineOfSight(who); + } + + void JustDied(Unit* /*Killer*/) + { + me->SetDisplayId(MODEL_HUMAN); + } + + void EnterCombat(Unit * /*who*/) + { + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + if (FuriousAnger_Timer <= diff) + { + FuriousAnger_Timer = 4000; + if (AngerCount > 25) + return; + + ++AngerCount; + DoCast(me, SPELL_FURIOUS_ANGER, false); + } else FuriousAnger_Timer -= diff; + + //DrainingBlow + if (DrainingBlow_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_DRAININGBLOW); + DrainingBlow_Timer = 15000; + } else DrainingBlow_Timer -= diff; + + //CrowdPummel + if (CrowdPummel_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_CROWDPUMMEL); + CrowdPummel_Timer = 15000; + } else CrowdPummel_Timer -= diff; + + //MightyBlow + if (MightyBlow_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_MIGHTYBLOW); + MightyBlow_Timer = 20000; + } else MightyBlow_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_magistrate_barthilas(Creature* pCreature) +{ + return new boss_magistrate_barthilasAI (pCreature); +} + +void AddSC_boss_magistrate_barthilas() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_magistrate_barthilas"; + newscript->GetAI = &GetAI_boss_magistrate_barthilas; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_maleki_the_pallid.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_maleki_the_pallid.cpp new file mode 100644 index 00000000000..0c1cf011d5e --- /dev/null +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_maleki_the_pallid.cpp @@ -0,0 +1,108 @@ +/* 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_maleki_the_pallid +SD%Complete: 100 +SDComment: +SDCategory: Stratholme +EndScriptData */ + +#include "ScriptedPch.h" +#include "stratholme.h" + +#define SPELL_FROSTBOLT 17503 +#define SPELL_DRAINLIFE 20743 +#define SPELL_DRAIN_MANA 17243 +#define SPELL_ICETOMB 16869 + +struct boss_maleki_the_pallidAI : public ScriptedAI +{ + boss_maleki_the_pallidAI(Creature *c) : ScriptedAI(c) + { + pInstance = me->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint32 Frostbolt_Timer; + uint32 IceTomb_Timer; + uint32 DrainLife_Timer; + + void Reset() + { + Frostbolt_Timer = 1000; + IceTomb_Timer = 16000; + DrainLife_Timer = 31000; + } + + void EnterCombat(Unit * /*who*/) + { + } + + void JustDied(Unit* /*Killer*/) + { + if (pInstance) + pInstance->SetData(TYPE_PALLID,IN_PROGRESS); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //Frostbolt + if (Frostbolt_Timer <= diff) + { + if (rand()%100 < 90) + DoCast(me->getVictim(), SPELL_FROSTBOLT); + Frostbolt_Timer = 3500; + } else Frostbolt_Timer -= diff; + + //IceTomb + if (IceTomb_Timer <= diff) + { + if (rand()%100 < 65) + DoCast(me->getVictim(), SPELL_ICETOMB); + IceTomb_Timer = 28000; + } else IceTomb_Timer -= diff; + + //DrainLife + if (DrainLife_Timer <= diff) + { + if (rand()%100 < 55) + DoCast(me->getVictim(), SPELL_DRAINLIFE); + DrainLife_Timer = 31000; + } else DrainLife_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_maleki_the_pallid(Creature* pCreature) +{ + return new boss_maleki_the_pallidAI (pCreature); +} + +void AddSC_boss_maleki_the_pallid() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_maleki_the_pallid"; + newscript->GetAI = &GetAI_boss_maleki_the_pallid; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_nerubenkan.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_nerubenkan.cpp new file mode 100644 index 00000000000..ae7299071f4 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_nerubenkan.cpp @@ -0,0 +1,121 @@ +/* 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_Nerubenkan +SD%Complete: 70 +SDComment: +SDCategory: Stratholme +EndScriptData */ + +#include "ScriptedPch.h" +#include "stratholme.h" + +#define SPELL_ENCASINGWEBS 4962 +#define SPELL_PIERCEARMOR 6016 +#define SPELL_CRYPT_SCARABS 31602 +#define SPELL_RAISEUNDEADSCARAB 17235 + +struct boss_nerubenkanAI : public ScriptedAI +{ + boss_nerubenkanAI(Creature *c) : ScriptedAI(c) + { + pInstance = me->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint32 EncasingWebs_Timer; + uint32 PierceArmor_Timer; + uint32 CryptScarabs_Timer; + uint32 RaiseUndeadScarab_Timer; + + void Reset() + { + CryptScarabs_Timer = 3000; + EncasingWebs_Timer = 7000; + PierceArmor_Timer = 19000; + RaiseUndeadScarab_Timer = 3000; + } + + void EnterCombat(Unit * /*who*/) + { + } + + void JustDied(Unit* /*Killer*/) + { + if (pInstance) + pInstance->SetData(TYPE_NERUB,IN_PROGRESS); + } + + void RaiseUndeadScarab(Unit* pVictim) + { + if (Creature* pUndeadScarab = DoSpawnCreature(10876, irand(-9,9), irand(-9,9), 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 180000)) + if (pUndeadScarab->AI()) + pUndeadScarab->AI()->AttackStart(pVictim); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //EncasingWebs + if (EncasingWebs_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_ENCASINGWEBS); + EncasingWebs_Timer = 30000; + } else EncasingWebs_Timer -= diff; + + //PierceArmor + if (PierceArmor_Timer <= diff) + { + if (urand(0,3) < 2) + DoCast(me->getVictim(), SPELL_PIERCEARMOR); + PierceArmor_Timer = 35000; + } else PierceArmor_Timer -= diff; + + //CryptScarabs_Timer + if (CryptScarabs_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_CRYPT_SCARABS); + CryptScarabs_Timer = 20000; + } else CryptScarabs_Timer -= diff; + + //RaiseUndeadScarab + if (RaiseUndeadScarab_Timer <= diff) + { + RaiseUndeadScarab(me->getVictim()); + RaiseUndeadScarab_Timer = 16000; + } else RaiseUndeadScarab_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_nerubenkan(Creature* pCreature) +{ + return new boss_nerubenkanAI (pCreature); +} + +void AddSC_boss_nerubenkan() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_nerubenkan"; + newscript->GetAI = &GetAI_boss_nerubenkan; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_order_of_silver_hand.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_order_of_silver_hand.cpp new file mode 100644 index 00000000000..905feb9fffc --- /dev/null +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_order_of_silver_hand.cpp @@ -0,0 +1,157 @@ +/* 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_Silver_Hand_Bosses +SD%Complete: 40 +SDComment: Basic script to have support for Horde paladin epic mount (quest 9737). All 5 members of Order of the Silver Hand running this script (least for now) +SDCategory: Stratholme +EndScriptData */ + +#include "ScriptedPch.h" +#include "stratholme.h" + +/*##### +# Additional: +# Although this is a working solution, the correct would be in addition to check if Aurius is dead. +# Once player extinguish the eternal flame (cast spell 31497->start event 11206) Aurius should become hostile. +# Once Aurius is defeated, he should be the one summoning the ghosts. +#####*/ + +#define SH_GREGOR 17910 +#define SH_CATHELA 17911 +#define SH_NEMAS 17912 +#define SH_AELMAR 17913 +#define SH_VICAR 17914 +#define SH_QUEST_CREDIT 17915 + +#define SPELL_HOLY_LIGHT 25263 +#define SPELL_DIVINE_SHIELD 13874 + +struct boss_silver_hand_bossesAI : public ScriptedAI +{ + boss_silver_hand_bossesAI(Creature* c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance *pInstance; + + uint32 HolyLight_Timer; + uint32 DivineShield_Timer; + + void Reset() + { + HolyLight_Timer = 20000; + DivineShield_Timer = 20000; + + if (pInstance) + { + switch(me->GetEntry()) + { + case SH_AELMAR: + pInstance->SetData(TYPE_SH_AELMAR, 0); + break; + case SH_CATHELA: + pInstance->SetData(TYPE_SH_CATHELA, 0); + break; + case SH_GREGOR: + pInstance->SetData(TYPE_SH_GREGOR, 0); + break; + case SH_NEMAS: + pInstance->SetData(TYPE_SH_NEMAS, 0); + break; + case SH_VICAR: + pInstance->SetData(TYPE_SH_VICAR, 0); + break; + } + } + } + + void EnterCombat(Unit* /*who*/) + { + } + + void JustDied(Unit* Killer) + { + if (pInstance) + { + switch(me->GetEntry()) + { + case SH_AELMAR: + pInstance->SetData(TYPE_SH_AELMAR, 2); + break; + case SH_CATHELA: + pInstance->SetData(TYPE_SH_CATHELA, 2); + break; + case SH_GREGOR: + pInstance->SetData(TYPE_SH_GREGOR, 2); + break; + case SH_NEMAS: + pInstance->SetData(TYPE_SH_NEMAS, 2); + break; + case SH_VICAR: + pInstance->SetData(TYPE_SH_VICAR, 2); + break; + } + if (pInstance->GetData(TYPE_SH_QUEST) && Killer->GetTypeId() == TYPEID_PLAYER) + CAST_PLR(Killer)->KilledMonsterCredit(SH_QUEST_CREDIT,me->GetGUID()); + } + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + if (HolyLight_Timer <= diff) + { + if (me->GetHealth()*5 < me->GetMaxHealth()) + { + DoCast(me, SPELL_HOLY_LIGHT); + HolyLight_Timer = 20000; + } + } else HolyLight_Timer -= diff; + + if (DivineShield_Timer <= diff) + { + if (me->GetHealth()*20 < me->GetMaxHealth()) + { + DoCast(me, SPELL_DIVINE_SHIELD); + DivineShield_Timer = 40000; + } + } else DivineShield_Timer -= diff; + + DoMeleeAttackIfReady(); + } + +}; +CreatureAI* GetAI_boss_silver_hand_bossesAI(Creature* pCreature) +{ + return new boss_silver_hand_bossesAI (pCreature); +} + +void AddSC_boss_order_of_silver_hand() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_silver_hand_bosses"; + newscript->GetAI = &GetAI_boss_silver_hand_bossesAI; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_postmaster_malown.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_postmaster_malown.cpp new file mode 100644 index 00000000000..c04bae15468 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_postmaster_malown.cpp @@ -0,0 +1,144 @@ +/* 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_postmaster_malown +SD%Complete: 50 +SDComment: +SDCategory: Stratholme +EndScriptData */ + +#include "ScriptedPch.h" + +//Spell ID to summon this guy is 24627 "Summon Postmaster Malown" +//He should be spawned along with three other elites once the third postbox has been opened + +#define SAY_MALOWNED "You just got MALOWNED!" + +#define SPELL_WAILINGDEAD 7713 +#define SPELL_BACKHAND 6253 +#define SPELL_CURSEOFWEAKNESS 8552 +#define SPELL_CURSEOFTONGUES 12889 +#define SPELL_CALLOFTHEGRAVE 17831 + +struct boss_postmaster_malownAI : public ScriptedAI +{ + boss_postmaster_malownAI(Creature *c) : ScriptedAI(c) {} + + uint32 WailingDead_Timer; + uint32 Backhand_Timer; + uint32 CurseOfWeakness_Timer; + uint32 CurseOfTongues_Timer; + uint32 CallOfTheGrave_Timer; + bool HasYelled; + + void Reset() + { + WailingDead_Timer = 19000; //lasts 6 sec + Backhand_Timer = 8000; //2 sec stun + CurseOfWeakness_Timer = 20000; //lasts 2 mins + CurseOfTongues_Timer = 22000; + CallOfTheGrave_Timer = 25000; + HasYelled = false; + } + + void EnterCombat(Unit * /*who*/) + { + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //WailingDead + if (WailingDead_Timer <= diff) + { + //Cast + if (rand()%100 < 65) //65% chance to cast + { + DoCast(me->getVictim(), SPELL_WAILINGDEAD); + } + //19 seconds until we should cast this again + WailingDead_Timer = 19000; + } else WailingDead_Timer -= diff; + + //Backhand + if (Backhand_Timer <= diff) + { + //Cast + if (rand()%100 < 45) //45% chance to cast + { + DoCast(me->getVictim(), SPELL_BACKHAND); + } + //8 seconds until we should cast this again + Backhand_Timer = 8000; + } else Backhand_Timer -= diff; + + //CurseOfWeakness + if (CurseOfWeakness_Timer <= diff) + { + //Cast + if (rand()%100 < 3) //3% chance to cast + { + DoCast(me->getVictim(), SPELL_CURSEOFWEAKNESS); + } + //20 seconds until we should cast this again + CurseOfWeakness_Timer = 20000; + } else CurseOfWeakness_Timer -= diff; + + //CurseOfTongues + if (CurseOfTongues_Timer <= diff) + { + //Cast + if (rand()%100 < 3) //3% chance to cast + { + DoCast(me->getVictim(), SPELL_CURSEOFTONGUES); + } + //22 seconds until we should cast this again + CurseOfTongues_Timer = 22000; + } else CurseOfTongues_Timer -= diff; + + //CallOfTheGrave + if (CallOfTheGrave_Timer <= diff) + { + //Cast + if (rand()%100 < 5) //5% chance to cast + { + DoCast(me->getVictim(), SPELL_CALLOFTHEGRAVE); + } + //25 seconds until we should cast this again + CallOfTheGrave_Timer = 25000; + } else CallOfTheGrave_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_postmaster_malown(Creature* pCreature) +{ + return new boss_postmaster_malownAI (pCreature); +} + +void AddSC_boss_postmaster_malown() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_postmaster_malown"; + newscript->GetAI = &GetAI_boss_postmaster_malown; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_ramstein_the_gorger.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_ramstein_the_gorger.cpp new file mode 100644 index 00000000000..3a3ae60c9c9 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_ramstein_the_gorger.cpp @@ -0,0 +1,102 @@ +/* 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_Ramstein_The_Gorger +SD%Complete: 70 +SDComment: +SDCategory: Stratholme +EndScriptData */ + +#include "ScriptedPch.h" +#include "stratholme.h" + +#define SPELL_TRAMPLE 5568 +#define SPELL_KNOCKOUT 17307 + + #define C_MINDLESS_UNDEAD 11030 + +struct boss_ramstein_the_gorgerAI : public ScriptedAI +{ + boss_ramstein_the_gorgerAI(Creature *c) : ScriptedAI(c) + { + pInstance = me->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint32 Trample_Timer; + uint32 Knockout_Timer; + + void Reset() + { + Trample_Timer = 3000; + Knockout_Timer = 12000; + } + + void EnterCombat(Unit * /*who*/) + { + } + + void JustDied(Unit* /*Killer*/) + { + for (uint8 i = 0; i < 30; ++i) + { + if (Creature* mob = me->SummonCreature(C_MINDLESS_UNDEAD,3969.35+irand(-10,10),-3391.87+irand(-10,10),119.11,5.91,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,1800000)) + mob->AI()->AttackStart(me->SelectNearestTarget(500)); + } + + if (pInstance) + pInstance->SetData(TYPE_RAMSTEIN,DONE); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //Trample + if (Trample_Timer <= diff) + { + DoCast(me, SPELL_TRAMPLE); + Trample_Timer = 7000; + } else Trample_Timer -= diff; + + //Knockout + if (Knockout_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_KNOCKOUT); + Knockout_Timer = 10000; + } else Knockout_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_ramstein_the_gorger(Creature* pCreature) +{ + return new boss_ramstein_the_gorgerAI (pCreature); +} + +void AddSC_boss_ramstein_the_gorger() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_ramstein_the_gorger"; + newscript->GetAI = &GetAI_boss_ramstein_the_gorger; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_timmy_the_cruel.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_timmy_the_cruel.cpp new file mode 100644 index 00000000000..f15eb59ba47 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_timmy_the_cruel.cpp @@ -0,0 +1,83 @@ +/* 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_timmy_the_cruel +SD%Complete: 100 +SDComment: +SDCategory: Stratholme +EndScriptData */ + +#include "ScriptedPch.h" + +#define SAY_SPAWN "TIMMY!" + +#define SPELL_RAVENOUSCLAW 17470 + +struct boss_timmy_the_cruelAI : public ScriptedAI +{ + boss_timmy_the_cruelAI(Creature *c) : ScriptedAI(c) {} + + uint32 RavenousClaw_Timer; + bool HasYelled; + + void Reset() + { + RavenousClaw_Timer = 10000; + HasYelled = false; + } + + void EnterCombat(Unit * /*who*/) + { + if (!HasYelled) + { + me->MonsterYell(SAY_SPAWN,LANG_UNIVERSAL,NULL); + HasYelled = true; + } + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //RavenousClaw + if (RavenousClaw_Timer <= diff) + { + //Cast + DoCast(me->getVictim(), SPELL_RAVENOUSCLAW); + //15 seconds until we should cast this again + RavenousClaw_Timer = 15000; + } else RavenousClaw_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_timmy_the_cruel(Creature* pCreature) +{ + return new boss_timmy_the_cruelAI (pCreature); +} + +void AddSC_boss_timmy_the_cruel() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_timmy_the_cruel"; + newscript->GetAI = &GetAI_boss_timmy_the_cruel; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp b/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp new file mode 100644 index 00000000000..ffeaa070a26 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.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: instance_stratholme +SD%Complete: 50 +SDComment: In progress. Undead side 75% implemented. Save/load not implemented. +SDCategory: Stratholme +EndScriptData */ + +#include "ScriptedPch.h" +#include "stratholme.h" + +#define GO_SERVICE_ENTRANCE 175368 +#define GO_GAUNTLET_GATE1 175357 +#define GO_ZIGGURAT1 175380 //baroness +#define GO_ZIGGURAT2 175379 //nerub'enkan +#define GO_ZIGGURAT3 175381 //maleki +#define GO_ZIGGURAT4 175405 //rammstein +#define GO_ZIGGURAT5 175796 //baron +#define GO_PORT_GAUNTLET 175374 //port from gauntlet to slaugther +#define GO_PORT_SLAUGTHER 175373 //port at slaugther +#define GO_PORT_ELDERS 175377 //port at elders square + +#define C_CRYSTAL 10415 //three ziggurat crystals +#define C_BARON 10440 +#define C_YSIDA_TRIGGER 16100 + +#define C_RAMSTEIN 10439 +#define C_ABOM_BILE 10416 +#define C_ABOM_VENOM 10417 +#define C_BLACK_GUARD 10394 +#define C_YSIDA 16031 + +#define MAX_ENCOUNTER 6 + +struct instance_stratholme : public ScriptedInstance +{ + instance_stratholme(Map* pMap) : ScriptedInstance(pMap) {} + + uint32 Encounter[MAX_ENCOUNTER]; + + bool IsSilverHandDead[5]; + + uint32 BaronRun_Timer; + uint32 SlaugtherSquare_Timer; + + uint64 serviceEntranceGUID; + uint64 gauntletGate1GUID; + uint64 ziggurat1GUID; + uint64 ziggurat2GUID; + uint64 ziggurat3GUID; + uint64 ziggurat4GUID; + uint64 ziggurat5GUID; + uint64 portGauntletGUID; + uint64 portSlaugtherGUID; + uint64 portElderGUID; + + uint64 baronGUID; + uint64 ysidaTriggerGUID; + std::set crystalsGUID; + std::set abomnationGUID; + + void Initialize() + { + for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) + Encounter[i] = NOT_STARTED; + + for (uint8 i = 0; i < 5; ++i) + IsSilverHandDead[i] = false; + + BaronRun_Timer = 0; + SlaugtherSquare_Timer = 0; + + serviceEntranceGUID = 0; + gauntletGate1GUID = 0; + ziggurat1GUID = 0; + ziggurat2GUID = 0; + ziggurat3GUID = 0; + ziggurat4GUID = 0; + ziggurat5GUID = 0; + portGauntletGUID = 0; + portSlaugtherGUID = 0; + portElderGUID = 0; + + baronGUID = 0; + ysidaTriggerGUID = 0; + crystalsGUID.clear(); + abomnationGUID.clear(); + } + + bool StartSlaugtherSquare() + { + //change to DONE when crystals implemented + if (Encounter[1] == IN_PROGRESS && Encounter[2] == IN_PROGRESS && Encounter[3] == IN_PROGRESS) + { + HandleGameObject(portGauntletGUID, true); + HandleGameObject(portSlaugtherGUID, true); + return true; + } + + debug_log("TSCR: Instance Stratholme: Cannot open slaugther square yet."); + return false; + } + + //if withRestoreTime true, then newState will be ignored and GO should be restored to original state after 10 seconds + void UpdateGoState(uint64 goGuid, uint32 newState, bool withRestoreTime) + { + if (!goGuid) + return; + + if (GameObject* pGo = instance->GetGameObject(goGuid)) + { + if (withRestoreTime) + pGo->UseDoorOrButton(10); + else + pGo->SetGoState((GOState)newState); + } + } + + void OnCreatureCreate(Creature* pCreature, bool /*add*/) + { + switch(pCreature->GetEntry()) + { + case C_BARON: baronGUID = pCreature->GetGUID(); break; + case C_YSIDA_TRIGGER: ysidaTriggerGUID = pCreature->GetGUID(); break; + case C_CRYSTAL: crystalsGUID.insert(pCreature->GetGUID()); break; + case C_ABOM_BILE: + case C_ABOM_VENOM: abomnationGUID.insert(pCreature->GetGUID()); break; + } + } + + void OnGameObjectCreate(GameObject* pGo, bool /*add*/) + { + switch(pGo->GetEntry()) + { + case GO_SERVICE_ENTRANCE: + serviceEntranceGUID = pGo->GetGUID(); + break; + case GO_GAUNTLET_GATE1: + //weird, but unless flag is set, client will not respond as expected. DB bug? + pGo->SetFlag(GAMEOBJECT_FLAGS,GO_FLAG_LOCKED); + gauntletGate1GUID = pGo->GetGUID(); + break; + case GO_ZIGGURAT1: + ziggurat1GUID = pGo->GetGUID(); + if (GetData(TYPE_BARONESS) == IN_PROGRESS) + HandleGameObject(0, true, pGo); + break; + case GO_ZIGGURAT2: + ziggurat2GUID = pGo->GetGUID(); + if (GetData(TYPE_NERUB) == IN_PROGRESS) + HandleGameObject(0, true, pGo); + break; + case GO_ZIGGURAT3: + ziggurat3GUID = pGo->GetGUID(); + if (GetData(TYPE_PALLID) == IN_PROGRESS) + HandleGameObject(0, true, pGo); + break; + case GO_ZIGGURAT4: + ziggurat4GUID = pGo->GetGUID(); + if (GetData(TYPE_BARON) == DONE || GetData(TYPE_RAMSTEIN) == DONE) + HandleGameObject(0, true, pGo); + break; + case GO_ZIGGURAT5: + ziggurat5GUID = pGo->GetGUID(); + if (GetData(TYPE_BARON) == DONE || GetData(TYPE_RAMSTEIN) == DONE) + HandleGameObject(0, true, pGo); + break; + case GO_PORT_GAUNTLET: + portGauntletGUID = pGo->GetGUID(); + if (GetData(TYPE_BARONESS) == IN_PROGRESS && GetData(TYPE_NERUB) == IN_PROGRESS && GetData(TYPE_PALLID) == IN_PROGRESS) + HandleGameObject(0, true, pGo); + break; + case GO_PORT_SLAUGTHER: + portSlaugtherGUID = pGo->GetGUID(); + if (GetData(TYPE_BARONESS) == IN_PROGRESS && GetData(TYPE_NERUB) == IN_PROGRESS && GetData(TYPE_PALLID) == IN_PROGRESS) + HandleGameObject(0, true, pGo); + break; + case GO_PORT_ELDERS: + portElderGUID = pGo->GetGUID(); + break; + } + } + + void SetData(uint32 type, uint32 data) + { + switch(type) + { + case TYPE_BARON_RUN: + switch(data) + { + case IN_PROGRESS: + if (Encounter[0] == IN_PROGRESS || Encounter[0] == FAIL) + break; + Encounter[0] = data; + BaronRun_Timer = 2700000; + debug_log("TSCR: Instance Stratholme: Baron run in progress."); + break; + case FAIL: + //may add code to remove aura from players, but in theory the time should be up already and removed. + Encounter[0] = data; + break; + case DONE: + Encounter[0] = data; + if (Creature* pYsidaT = instance->GetCreature(ysidaTriggerGUID)) + pYsidaT->SummonCreature(C_YSIDA, + pYsidaT->GetPositionX(),pYsidaT->GetPositionY(),pYsidaT->GetPositionZ(),pYsidaT->GetOrientation(), + TEMPSUMMON_TIMED_DESPAWN,1800000); + BaronRun_Timer = 0; + break; + } + break; + case TYPE_BARONESS: + Encounter[1] = data; + if (data == IN_PROGRESS) + HandleGameObject(ziggurat1GUID, true); + if (data == IN_PROGRESS) //change to DONE when crystals implemented + StartSlaugtherSquare(); + break; + case TYPE_NERUB: + Encounter[2] = data; + if (data == IN_PROGRESS) + HandleGameObject(ziggurat2GUID, true); + if (data == IN_PROGRESS) //change to DONE when crystals implemented + StartSlaugtherSquare(); + break; + case TYPE_PALLID: + Encounter[3] = data; + if (data == IN_PROGRESS) + HandleGameObject(ziggurat3GUID, true); + if (data == IN_PROGRESS) //change to DONE when crystals implemented + StartSlaugtherSquare(); + break; + case TYPE_RAMSTEIN: + if (data == IN_PROGRESS) + { + HandleGameObject(portGauntletGUID, false); + + uint32 count = abomnationGUID.size(); + for (std::set::const_iterator i = abomnationGUID.begin(); i != abomnationGUID.end(); ++i) + { + if (Creature* pAbom = instance->GetCreature(*i)) + { + if (!pAbom->isAlive()) + --count; + } + } + + if (!count) + { + //a bit itchy, it should close the door after 10 secs, but it doesn't. skipping it for now. + //UpdateGoState(ziggurat4GUID,0,true); + if (Creature* pBaron = instance->GetCreature(baronGUID)) + pBaron->SummonCreature(C_RAMSTEIN,4032.84,-3390.24,119.73,4.71,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,1800000); + debug_log("TSCR: Instance Stratholme: Ramstein spawned."); + } + else + debug_log("TSCR: Instance Stratholme: %u Abomnation left to kill.",count); + } + + if (data == NOT_STARTED) + HandleGameObject(portGauntletGUID, true); + + if (data == DONE) + { + SlaugtherSquare_Timer = 300000; + debug_log("TSCR: Instance Stratholme: Slaugther event will continue in 5 minutes."); + } + Encounter[4] = data; + break; + case TYPE_BARON: + if (data == IN_PROGRESS) + { + HandleGameObject(ziggurat4GUID, false); + HandleGameObject(ziggurat5GUID, false); + if (GetData(TYPE_BARON_RUN) == IN_PROGRESS) + { + Map::PlayerList const& players = instance->GetPlayers(); + + if (!players.isEmpty()) + { + for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + { + if (Player* pPlayer = itr->getSource()) + { + if (pPlayer->HasAura(SPELL_BARON_ULTIMATUM)) + pPlayer->RemoveAurasDueToSpell(SPELL_BARON_ULTIMATUM); + + if (pPlayer->GetQuestStatus(QUEST_DEAD_MAN_PLEA) == QUEST_STATUS_INCOMPLETE) + pPlayer->AreaExploredOrEventHappens(QUEST_DEAD_MAN_PLEA); + } + } + } + + SetData(TYPE_BARON_RUN,DONE); + } + } + if (data == DONE || data == NOT_STARTED) + { + HandleGameObject(ziggurat4GUID, true); + HandleGameObject(ziggurat5GUID, true); + } + if (data == DONE) + HandleGameObject(portGauntletGUID, true); + Encounter[5] = data; + break; + case TYPE_SH_AELMAR: + IsSilverHandDead[0] = (data) ? true : false; + break; + case TYPE_SH_CATHELA: + IsSilverHandDead[1] = (data) ? true : false; + break; + case TYPE_SH_GREGOR: + IsSilverHandDead[2] = (data) ? true : false; + break; + case TYPE_SH_NEMAS: + IsSilverHandDead[3] = (data) ? true : false; + break; + case TYPE_SH_VICAR: + IsSilverHandDead[4] = (data) ? true : false; + break; + } + if (data == DONE)SaveToDB(); + } + + std::string GetSaveData() + { + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << Encounter[0] << " " << Encounter[1] << " " << Encounter[2] << " " + << Encounter[3] << " " << Encounter[4] << " " << Encounter[5]; + + OUT_SAVE_INST_DATA_COMPLETE; + return saveStream.str(); + } + + void Load(const char* in) + { + if (!in) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(in); + + std::istringstream loadStream(in); + loadStream >> Encounter[0] >> Encounter[1] >> Encounter[2] >> Encounter[3] + >> Encounter[4] >> Encounter[5]; + + // Do not reset 1, 2 and 3. they are not set to done, yet . + if (Encounter[0] == IN_PROGRESS) + Encounter[0] = NOT_STARTED; + if (Encounter[4] == IN_PROGRESS) + Encounter[4] = NOT_STARTED; + if (Encounter[5] == IN_PROGRESS) + Encounter[5] = NOT_STARTED; + + OUT_LOAD_INST_DATA_COMPLETE; + } + + uint32 GetData(uint32 type) + { + switch(type) + { + case TYPE_SH_QUEST: + if (IsSilverHandDead[0] && IsSilverHandDead[1] && IsSilverHandDead[2] && IsSilverHandDead[3] && IsSilverHandDead[4]) + return 1; + return 0; + case TYPE_BARON_RUN: + return Encounter[0]; + case TYPE_BARONESS: + return Encounter[1]; + case TYPE_NERUB: + return Encounter[2]; + case TYPE_PALLID: + return Encounter[3]; + case TYPE_RAMSTEIN: + return Encounter[4]; + case TYPE_BARON: + return Encounter[5]; + } + return 0; + } + + uint64 GetData64(uint32 data) + { + switch(data) + { + case DATA_BARON: + return baronGUID; + case DATA_YSIDA_TRIGGER: + return ysidaTriggerGUID; + } + return 0; + } + + void Update(uint32 diff) + { + if (BaronRun_Timer) + { + if (BaronRun_Timer <= diff) + { + if (GetData(TYPE_BARON_RUN) != DONE) + SetData(TYPE_BARON_RUN, FAIL); + BaronRun_Timer = 0; + debug_log("TSCR: Instance Stratholme: Baron run event reached end. Event has state %u.",GetData(TYPE_BARON_RUN)); + } else BaronRun_Timer -= diff; + } + + if (SlaugtherSquare_Timer) + { + if (SlaugtherSquare_Timer <= diff) + { + if (Creature* pBaron = instance->GetCreature(baronGUID)) + { + for (uint8 i = 0; i < 4; ++i) + pBaron->SummonCreature(C_BLACK_GUARD,4032.84,-3390.24,119.73,4.71,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,1800000); + + HandleGameObject(ziggurat4GUID, true); + HandleGameObject(ziggurat5GUID, true); + debug_log("TSCR: Instance Stratholme: Black guard sentries spawned. Opening gates to baron."); + } + SlaugtherSquare_Timer = 0; + } else SlaugtherSquare_Timer -= diff; + } + } +}; + +InstanceData* GetInstanceData_instance_stratholme(Map* pMap) +{ + return new instance_stratholme(pMap); +} + +void AddSC_instance_stratholme() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_stratholme"; + newscript->GetInstanceData = &GetInstanceData_instance_stratholme; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp b/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp new file mode 100644 index 00000000000..035fca68b95 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp @@ -0,0 +1,282 @@ +/* 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: Stratholme +SD%Complete: 100 +SDComment: Misc mobs for instance. pGo-script to apply aura and start event for quest 8945 +SDCategory: Stratholme +EndScriptData */ + +/* ContentData +go_gauntlet_gate +mob_freed_soul +mob_restless_soul +mobs_spectral_ghostly_citizen +EndContentData */ + +#include "ScriptedPch.h" +#include "stratholme.h" + +/*###### +## go_gauntlet_gate (this is the _first_ of the gauntlet gates, two exist) +######*/ + +bool GOHello_go_gauntlet_gate(Player* pPlayer, GameObject* pGo) +{ + ScriptedInstance* pInstance = pGo->GetInstanceData(); + + if (!pInstance) + return false; + + if (pInstance->GetData(TYPE_BARON_RUN) != NOT_STARTED) + return false; + + if (Group *pGroup = pPlayer->GetGroup()) + { + for (GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next()) + { + Player* pGroupie = itr->getSource(); + if (!pGroupie) + continue; + + if (pGroupie->GetQuestStatus(QUEST_DEAD_MAN_PLEA) == QUEST_STATUS_INCOMPLETE && + !pGroupie->HasAura(SPELL_BARON_ULTIMATUM) && + pGroupie->GetMap() == pGo->GetMap()) + pGroupie->CastSpell(pGroupie,SPELL_BARON_ULTIMATUM,true); + } + } else if (pPlayer->GetQuestStatus(QUEST_DEAD_MAN_PLEA) == QUEST_STATUS_INCOMPLETE && + !pPlayer->HasAura(SPELL_BARON_ULTIMATUM) && + pPlayer->GetMap() == pGo->GetMap()) + pPlayer->CastSpell(pPlayer,SPELL_BARON_ULTIMATUM,true); + + pInstance->SetData(TYPE_BARON_RUN,IN_PROGRESS); + return false; +} + +/*###### +## mob_freed_soul +######*/ + +//Possibly more of these quotes around. +#define SAY_ZAPPED0 -1329000 +#define SAY_ZAPPED1 -1329001 +#define SAY_ZAPPED2 -1329002 +#define SAY_ZAPPED3 -1329003 + +struct mob_freed_soulAI : public ScriptedAI +{ + mob_freed_soulAI(Creature *c) : ScriptedAI(c) {} + + void Reset() + { + DoScriptText(RAND(SAY_ZAPPED0,SAY_ZAPPED1,SAY_ZAPPED2,SAY_ZAPPED3), me); + } + + void EnterCombat(Unit* /*who*/) {} +}; + +CreatureAI* GetAI_mob_freed_soul(Creature* pCreature) +{ + return new mob_freed_soulAI (pCreature); +} + +/*###### +## mob_restless_soul +######*/ + +#define SPELL_EGAN_BLASTER 17368 +#define SPELL_SOUL_FREED 17370 +#define QUEST_RESTLESS_SOUL 5282 +#define ENTRY_RESTLESS 11122 +#define ENTRY_FREED 11136 + +struct mob_restless_soulAI : public ScriptedAI +{ + mob_restless_soulAI(Creature *c) : ScriptedAI(c) {} + + uint64 Tagger; + uint32 Die_Timer; + bool Tagged; + + void Reset() + { + Tagger = 0; + Die_Timer = 5000; + Tagged = false; + } + + void EnterCombat(Unit* /*who*/) {} + + void SpellHit(Unit *caster, const SpellEntry *spell) + { + if (caster->GetTypeId() == TYPEID_PLAYER) + { + if (!Tagged && spell->Id == SPELL_EGAN_BLASTER && CAST_PLR(caster)->GetQuestStatus(QUEST_RESTLESS_SOUL) == QUEST_STATUS_INCOMPLETE) + { + Tagged = true; + Tagger = caster->GetGUID(); + } + } + } + + void JustSummoned(Creature *summoned) + { + summoned->CastSpell(summoned,SPELL_SOUL_FREED,false); + } + + void JustDied(Unit* /*Killer*/) + { + if (Tagged) + me->SummonCreature(ENTRY_FREED, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN, 300000); + } + + void UpdateAI(const uint32 diff) + { + if (Tagged) + { + if (Die_Timer <= diff) + { + if (Unit* pTemp = Unit::GetUnit(*me,Tagger)) + { + CAST_PLR(pTemp)->KilledMonsterCredit(ENTRY_RESTLESS, me->GetGUID()); + me->Kill(me); + } + } else Die_Timer -= diff; + } + } +}; + +CreatureAI* GetAI_mob_restless_soul(Creature* pCreature) +{ + return new mob_restless_soulAI (pCreature); +} + +/*###### +## mobs_spectral_ghostly_citizen +######*/ + +enum eGhostlyCitizenSpells +{ + SPELL_HAUNTING_PHANTOM = 16336, + SPELL_SLAP = 6754 +}; + +struct mobs_spectral_ghostly_citizenAI : public ScriptedAI +{ + mobs_spectral_ghostly_citizenAI(Creature *c) : ScriptedAI(c) {} + + uint32 Die_Timer; + bool Tagged; + + void Reset() + { + Die_Timer = 5000; + Tagged = false; + } + + void EnterCombat(Unit* /*who*/) {} + + void SpellHit(Unit * /*caster*/, const SpellEntry *spell) + { + if (!Tagged && spell->Id == SPELL_EGAN_BLASTER) + Tagged = true; + } + + void JustDied(Unit* /*Killer*/) + { + if (Tagged) + { + for (uint32 i = 1; i <= 4; ++i) + { + //100%, 50%, 33%, 25% chance to spawn + if (urand(1,i) == 1) + DoSummon(ENTRY_RESTLESS, me, 20.0f, 600000); + } + } + } + + void UpdateAI(const uint32 diff) + { + if (Tagged) + { + if (Die_Timer <= diff) + me->Kill(me); + else Die_Timer -= diff; + } + + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + + void ReceiveEmote(Player* pPlayer, uint32 emote) + { + switch(emote) + { + case TEXTEMOTE_DANCE: + EnterEvadeMode(); + break; + case TEXTEMOTE_RUDE: + if (me->IsWithinDistInMap(pPlayer, 5)) + DoCast(pPlayer, SPELL_SLAP, false); + else + me->HandleEmoteCommand(EMOTE_ONESHOT_RUDE); + break; + case TEXTEMOTE_WAVE: + me->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); + break; + case TEXTEMOTE_BOW: + me->HandleEmoteCommand(EMOTE_ONESHOT_BOW); + break; + case TEXTEMOTE_KISS: + me->HandleEmoteCommand(EMOTE_ONESHOT_FLEX); + break; + } + } +}; + +CreatureAI* GetAI_mobs_spectral_ghostly_citizen(Creature* pCreature) +{ + return new mobs_spectral_ghostly_citizenAI (pCreature); +} + +void AddSC_stratholme() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "go_gauntlet_gate"; + newscript->pGOHello = &GOHello_go_gauntlet_gate; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_freed_soul"; + newscript->GetAI = &GetAI_mob_freed_soul; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_restless_soul"; + newscript->GetAI = &GetAI_mob_restless_soul; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mobs_spectral_ghostly_citizen"; + newscript->GetAI = &GetAI_mobs_spectral_ghostly_citizen; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/Stratholme/stratholme.h b/src/server/scripts/EasternKingdoms/Stratholme/stratholme.h new file mode 100644 index 00000000000..b9246091a7c --- /dev/null +++ b/src/server/scripts/EasternKingdoms/Stratholme/stratholme.h @@ -0,0 +1,28 @@ +/* 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_STRATHOLME_H +#define DEF_STRATHOLME_H + +#define TYPE_BARON_RUN 1 +#define TYPE_BARONESS 2 +#define TYPE_NERUB 3 +#define TYPE_PALLID 4 +#define TYPE_RAMSTEIN 5 +#define TYPE_BARON 6 + +#define DATA_BARON 10 +#define DATA_YSIDA_TRIGGER 11 + +#define TYPE_SH_QUEST 20 +#define TYPE_SH_CATHELA 21 +#define TYPE_SH_GREGOR 22 +#define TYPE_SH_NEMAS 23 +#define TYPE_SH_VICAR 24 +#define TYPE_SH_AELMAR 25 + +#define QUEST_DEAD_MAN_PLEA 8945 +#define SPELL_BARON_ULTIMATUM 27861 +#endif + diff --git a/src/server/scripts/EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp b/src/server/scripts/EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp new file mode 100644 index 00000000000..6fe65cf963d --- /dev/null +++ b/src/server/scripts/EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp @@ -0,0 +1,204 @@ +/* Copyright (C) 2006 - 2009 kb_z + * 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_Sunken_Temple +SD%Complete: 100 +SDComment:Place Holder +SDCategory: Sunken Temple +EndScriptData */ + +#include "ScriptedPch.h" +#include "sunken_temple.h" + +#define GO_ATALAI_STATUE1 148830 +#define GO_ATALAI_STATUE2 148831 +#define GO_ATALAI_STATUE3 148832 +#define GO_ATALAI_STATUE4 148833 +#define GO_ATALAI_STATUE5 148834 +#define GO_ATALAI_STATUE6 148835 +#define GO_ATALAI_IDOL 148836 + +#define GO_ATALAI_LIGHT1 148883 +#define GO_ATALAI_LIGHT2 148937 + +#define NPC_MALFURION_STORMRAGE 15362 + +struct instance_sunken_temple : public ScriptedInstance +{ + instance_sunken_temple(Map* pMap) : ScriptedInstance(pMap) + { + Initialize(); + }; + + uint64 GOAtalaiStatue1; + uint64 GOAtalaiStatue2; + uint64 GOAtalaiStatue3; + uint64 GOAtalaiStatue4; + uint64 GOAtalaiStatue5; + uint64 GOAtalaiStatue6; + uint64 GOAtalaiIdol; + + uint32 State; + + bool s1; + bool s2; + bool s3; + bool s4; + bool s5; + bool s6; + + void Initialize() + { + GOAtalaiStatue1 = 0; + GOAtalaiStatue2 = 0; + GOAtalaiStatue3 = 0; + GOAtalaiStatue4 = 0; + GOAtalaiStatue5 = 0; + GOAtalaiStatue6 = 0; + GOAtalaiIdol = 0; + + State = 0; + + s1 = false; + s2 = false; + s3 = false; + s4 = false; + s5 = false; + s6 = false; + } + + void OnGameObjectCreate(GameObject* pGo, bool /*add*/) + { + switch(pGo->GetEntry()) + { + case GO_ATALAI_STATUE1: GOAtalaiStatue1 = pGo->GetGUID(); break; + case GO_ATALAI_STATUE2: GOAtalaiStatue2 = pGo->GetGUID(); break; + case GO_ATALAI_STATUE3: GOAtalaiStatue3 = pGo->GetGUID(); break; + case GO_ATALAI_STATUE4: GOAtalaiStatue4 = pGo->GetGUID(); break; + case GO_ATALAI_STATUE5: GOAtalaiStatue5 = pGo->GetGUID(); break; + case GO_ATALAI_STATUE6: GOAtalaiStatue6 = pGo->GetGUID(); break; + case GO_ATALAI_IDOL: GOAtalaiIdol = pGo->GetGUID(); break; + } + } + + virtual void Update(uint32 /*diff*/) // correct order goes form 1-6 + { + switch(State) + { + case GO_ATALAI_STATUE1: + if (!s1 && !s2 && !s3 && !s4 && !s5 && !s6) + { + if (GameObject *pAtalaiStatue1 = instance->GetGameObject(GOAtalaiStatue1)) + UseStatue(pAtalaiStatue1); + s1 = true; + State = 0; + }; + break; + case GO_ATALAI_STATUE2: + if (s1 && !s2 && !s3 && !s4 && !s5 && !s6) + { + if (GameObject *pAtalaiStatue2 = instance->GetGameObject(GOAtalaiStatue2)) + UseStatue(pAtalaiStatue2); + s2 = true; + State = 0; + }; + break; + case GO_ATALAI_STATUE3: + if (s1 && s2 && !s3 && !s4 && !s5 && !s6) + { + if (GameObject *pAtalaiStatue3 = instance->GetGameObject(GOAtalaiStatue3)) + UseStatue(pAtalaiStatue3); + s3 = true; + State = 0; + }; + break; + case GO_ATALAI_STATUE4: + if (s1 && s2 && s3 && !s4 && !s5 && !s6) + { + if (GameObject *pAtalaiStatue4 = instance->GetGameObject(GOAtalaiStatue4)) + UseStatue(pAtalaiStatue4); + s4 = true; + State = 0; + } + break; + case GO_ATALAI_STATUE5: + if (s1 && s2 && s3 && s4 && !s5 && !s6) + { + if (GameObject *pAtalaiStatue5 = instance->GetGameObject(GOAtalaiStatue5)) + UseStatue(pAtalaiStatue5); + s5 = true; + State = 0; + } + break; + case GO_ATALAI_STATUE6: + if (s1 && s2 && s3 && s4 && s5 && !s6) + { + if (GameObject *pAtalaiStatue6 = instance->GetGameObject(GOAtalaiStatue6)) + UseStatue(pAtalaiStatue6); + s6 = true; + State = 0; + } + break; + } + }; + + void UseStatue(GameObject* pGo) + { + pGo->SummonGameObject(GO_ATALAI_LIGHT1,pGo->GetPositionX(),pGo->GetPositionY(),pGo->GetPositionZ(),0,0,0,0,0,0); + pGo->SetUInt32Value(GAMEOBJECT_FLAGS, 4); + } + + /* + void UseLastStatue(GameObject* pGo) + { + AtalaiStatue1->SummonGameObject(GO_ATALAI_LIGHT2,AtalaiStatue1->GetPositionX(),AtalaiStatue1->GetPositionY(),AtalaiStatue1->GetPositionZ(),0,0,0,0,0,100000); + AtalaiStatue2->SummonGameObject(GO_ATALAI_LIGHT2,AtalaiStatue2->GetPositionX(),AtalaiStatue2->GetPositionY(),AtalaiStatue2->GetPositionZ(),0,0,0,0,0,100000); + AtalaiStatue3->SummonGameObject(GO_ATALAI_LIGHT2,AtalaiStatue3->GetPositionX(),AtalaiStatue3->GetPositionY(),AtalaiStatue3->GetPositionZ(),0,0,0,0,0,100000); + AtalaiStatue4->SummonGameObject(GO_ATALAI_LIGHT2,AtalaiStatue4->GetPositionX(),AtalaiStatue4->GetPositionY(),AtalaiStatue4->GetPositionZ(),0,0,0,0,0,100000); + AtalaiStatue5->SummonGameObject(GO_ATALAI_LIGHT2,AtalaiStatue5->GetPositionX(),AtalaiStatue5->GetPositionY(),AtalaiStatue5->GetPositionZ(),0,0,0,0,0,100000); + AtalaiStatue6->SummonGameObject(GO_ATALAI_LIGHT2,AtalaiStatue6->GetPositionX(),AtalaiStatue6->GetPositionY(),AtalaiStatue6->GetPositionZ(),0,0,0,0,0,100000); + pGo->SummonGameObject(148838,-488.997,96.61,-189.019,-1.52,0,0,0,0,100000); + } + */ + + void SetData(uint32 type, uint32 data) + { + if (type == EVENT_STATE) + State = data; + } + + uint32 GetData(uint32 type) + { + if (type == EVENT_STATE) + return State; + return 0; + } +}; + +InstanceData* GetInstanceData_instance_sunken_temple(Map* pMap) +{ + return new instance_sunken_temple(pMap); +} + +void AddSC_instance_sunken_temple() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_sunken_temple"; + newscript->GetInstanceData = &GetInstanceData_instance_sunken_temple; + newscript->RegisterSelf(); +} diff --git a/src/server/scripts/EasternKingdoms/SunkenTemple/sunken_temple.cpp b/src/server/scripts/EasternKingdoms/SunkenTemple/sunken_temple.cpp new file mode 100644 index 00000000000..7f0ca126d78 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/SunkenTemple/sunken_temple.cpp @@ -0,0 +1,71 @@ +/* Copyright (C) 2006 - 2009 kb_z + * 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: Sunken_Temple +SD%Complete: 100 +SDComment: Area Trigger + Puzzle event support +SDCategory: Sunken Temple +EndScriptData */ + +/* ContentData +at_malfurion_Stormrage_trigger +EndContentData */ + +#include "ScriptedPch.h" +#include "sunken_temple.h" + +/*##### +# at_malfurion_Stormrage_trigger +#####*/ + +bool AreaTrigger_at_malfurion_stormrage(Player* pPlayer, const AreaTriggerEntry * /*at*/) +{ + if (ScriptedInstance* pInstance = pPlayer->GetInstanceData()) + { + if (!pPlayer->FindNearestCreature(15362,15)) + pPlayer->SummonCreature(15362, pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), -1.52, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 100000); + return false; + } +return false; +} +/*##### +# go_atalai_statue +#####*/ + +bool GOHello_go_atalai_statue(Player* pPlayer, GameObject* pGo) +{ + ScriptedInstance* pInstance = pPlayer->GetInstanceData(); + if (!pInstance) + return false; + pInstance->SetData(EVENT_STATE,pGo->GetEntry()); + return false; +} + +void AddSC_sunken_temple() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "at_malfurion_stormrage"; + newscript->pAreaTrigger = &AreaTrigger_at_malfurion_stormrage; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "go_atalai_statue"; + newscript->pGOHello = &GOHello_go_atalai_statue; + newscript->RegisterSelf(); +} diff --git a/src/server/scripts/EasternKingdoms/SunkenTemple/sunken_temple.h b/src/server/scripts/EasternKingdoms/SunkenTemple/sunken_temple.h new file mode 100644 index 00000000000..82245095c31 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/SunkenTemple/sunken_temple.h @@ -0,0 +1,22 @@ +/* Copyright (C) 2006 - 2009 kb_z + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_SUNKEN_TEMPLE_H +#define DEF_SUNKEN_TEMPLE_H + +#define TROLLBOSS1_DEATH 1 +#define TROLLBOSS2_DEATH 2 +#define TROLLBOSS3_DEATH 3 +#define TROLLBOSS4_DEATH 4 +#define TROLLBOSS5_DEATH 5 +#define TROLLBOSS6_DEATH 6 +#define JAMMALAN_DEATH 7 +#define MORPHAZ_DEATH 8 +#define HAZZAS_DEATH 9 +#define ERANIKUS_DEATH 10 +#define ATALALARION_DEATH 11 //optional + +#define EVENT_STATE 1 +#endif + diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp new file mode 100644 index 00000000000..59e58d6df1a --- /dev/null +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp @@ -0,0 +1,349 @@ +/* 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_Brutallus +SD%Complete: 80 +SDComment: Find a way to start the intro, best code for the intro +EndScriptData */ + +#include "ScriptedPch.h" +#include "sunwell_plateau.h" + +enum Quotes +{ + YELL_INTRO = -1580017, + YELL_INTRO_BREAK_ICE = -1580018, + YELL_INTRO_CHARGE = -1580019, + YELL_INTRO_KILL_MADRIGOSA = -1580020, + YELL_INTRO_TAUNT = -1580021, + + YELL_MADR_ICE_BARRIER = -1580031, + YELL_MADR_INTRO = -1580032, + YELL_MADR_ICE_BLOCK = -1580033, + YELL_MADR_TRAP = -1580034, + YELL_MADR_DEATH = -1580035, + + YELL_AGGRO = -1580022, + YELL_KILL1 = -1580023, + YELL_KILL2 = -1580024, + YELL_KILL3 = -1580025, + YELL_LOVE1 = -1580026, + YELL_LOVE2 = -1580027, + YELL_LOVE3 = -1580028, + YELL_BERSERK = -1580029, + YELL_DEATH = -1580030 +}; + +enum Spells +{ + SPELL_METEOR_SLASH = 45150, + SPELL_BURN = 46394, + SPELL_STOMP = 45185, + SPELL_BERSERK = 26662, + SPELL_DUAL_WIELD = 42459, + + SPELL_INTRO_FROST_BLAST = 45203, + SPELL_INTRO_FROSTBOLT = 44843, + SPELL_INTRO_ENCAPSULATE = 45665, + SPELL_INTRO_ENCAPSULATE_CHANELLING = 45661 +}; + +#define FELMYST 25038 + +struct boss_brutallusAI : public ScriptedAI +{ + boss_brutallusAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + Intro = true; + } + + ScriptedInstance* pInstance; + + uint32 SlashTimer; + uint32 BurnTimer; + uint32 StompTimer; + uint32 BerserkTimer; + + uint32 IntroPhase; + uint32 IntroPhaseTimer; + uint32 IntroFrostBoltTimer; + + bool Intro; + bool IsIntro; + bool Enraged; + + void Reset() + { + SlashTimer = 11000; + StompTimer = 30000; + BurnTimer = 60000; + BerserkTimer = 360000; + + IntroPhase = 0; + IntroPhaseTimer = 0; + IntroFrostBoltTimer = 0; + + IsIntro = false; + Enraged = false; + + DoCast(me, SPELL_DUAL_WIELD, true); + + if (pInstance) + pInstance->SetData(DATA_BRUTALLUS_EVENT, NOT_STARTED); + } + + void EnterCombat(Unit * /*who*/) + { + DoScriptText(YELL_AGGRO, me); + + if (pInstance) + pInstance->SetData(DATA_BRUTALLUS_EVENT, IN_PROGRESS); + } + + void KilledUnit(Unit* /*victim*/) + { + DoScriptText(RAND(YELL_KILL1,YELL_KILL2,YELL_KILL3), me); + } + + void JustDied(Unit* /*Killer*/) + { + DoScriptText(YELL_DEATH, me); + + if (pInstance) + { + pInstance->SetData(DATA_BRUTALLUS_EVENT, DONE); + float x,y,z; + me->GetPosition(x,y,z); + me->SummonCreature(FELMYST, x,y, z+30, me->GetOrientation(), TEMPSUMMON_MANUAL_DESPAWN, 0); + } + } + + void EnterEvadeMode() + { + if (!Intro) + ScriptedAI::EnterEvadeMode(); + } + + void StartIntro() + { + if (!Intro || IsIntro) + return; + error_log("Start Intro"); + Creature *Madrigosa = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_MADRIGOSA) : 0); + if (Madrigosa) + { + Madrigosa->Respawn(); + Madrigosa->setActive(true); + IsIntro = true; + Madrigosa->SetMaxHealth(me->GetMaxHealth()); + Madrigosa->SetHealth(me->GetMaxHealth()); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + me->Attack(Madrigosa, true); + Madrigosa->Attack(me, true); + }else + { + //Madrigosa not found, end intro + error_log("Madrigosa was not found"); + EndIntro(); + } + } + + void EndIntro() + { + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + Intro = false; + IsIntro = false; + error_log("End Intro"); + } + + void AttackStart(Unit* pWho) + { + if (!pWho || Intro || IsIntro) + return; + ScriptedAI::AttackStart(pWho); + } + + void DoIntro() + { + Creature *Madrigosa = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_MADRIGOSA) : 0); + if (!Madrigosa) + return; + + switch (IntroPhase) + { + case 0: + DoScriptText(YELL_MADR_ICE_BARRIER, Madrigosa); + IntroPhaseTimer = 7000; + ++IntroPhase; + break; + case 1: + me->SetInFront(Madrigosa); + Madrigosa->SetInFront(me); + DoScriptText(YELL_MADR_INTRO, Madrigosa, me); + IntroPhaseTimer = 9000; + ++IntroPhase; + break; + case 2: + DoScriptText(YELL_INTRO, me, Madrigosa); + IntroPhaseTimer = 13000; + ++IntroPhase; + break; + case 3: + DoCast(me, SPELL_INTRO_FROST_BLAST); + Madrigosa->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->AttackStop(); + Madrigosa->AttackStop(); + IntroFrostBoltTimer = 3000; + IntroPhaseTimer = 28000; + ++IntroPhase; + break; + case 4: + DoScriptText(YELL_INTRO_BREAK_ICE, me); + IntroPhaseTimer = 6000; + ++IntroPhase; + break; + case 5: + Madrigosa->CastSpell(me, SPELL_INTRO_ENCAPSULATE_CHANELLING, false); + DoScriptText(YELL_MADR_TRAP, Madrigosa); + DoCast(me, SPELL_INTRO_ENCAPSULATE); + IntroPhaseTimer = 11000; + ++IntroPhase; + break; + case 6: + DoScriptText(YELL_INTRO_CHARGE, me); + IntroPhaseTimer = 5000; + ++IntroPhase; + break; + case 7: + me->Kill(Madrigosa); + DoScriptText(YELL_MADR_DEATH, Madrigosa); + me->SetHealth(me->GetMaxHealth()); + me->AttackStop(); + IntroPhaseTimer = 4000; + ++IntroPhase; + break; + case 8: + DoScriptText(YELL_INTRO_KILL_MADRIGOSA, me); + me->SetOrientation(0.14f); + me->StopMoving(); + Madrigosa->setDeathState(CORPSE); + IntroPhaseTimer = 8000; + ++IntroPhase; + break; + case 9: + DoScriptText(YELL_INTRO_TAUNT, me); + IntroPhaseTimer = 5000; + ++IntroPhase; + break; + case 10: + EndIntro(); + break; + } + } + + void MoveInLineOfSight(Unit *who) + { + if (!who->isTargetableForAttack() || !me->IsHostileTo(who)) + return; + if (pInstance && Intro) + pInstance->SetData(DATA_BRUTALLUS_EVENT, SPECIAL); + + if (Intro && !IsIntro) + StartIntro(); + if (!Intro) + ScriptedAI::MoveInLineOfSight(who); + } + + void UpdateAI(const uint32 diff) + { + if (IsIntro) + { + if (IntroPhaseTimer <= diff) + DoIntro(); + else IntroPhaseTimer -= diff; + + if (IntroPhase == 3 + 1) + { + if (IntroFrostBoltTimer <= diff) + { + if (Creature *Madrigosa = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_MADRIGOSA) : 0)) + { + Madrigosa->CastSpell(me, SPELL_INTRO_FROSTBOLT, true); + IntroFrostBoltTimer = 2000; + } + } else IntroFrostBoltTimer -= diff; + } + if (!UpdateVictim()) + return; + DoMeleeAttackIfReady(); + } + + if (!UpdateVictim() || IsIntro) + return; + + if (SlashTimer <= diff) + { + DoCast(me->getVictim(), SPELL_METEOR_SLASH); + SlashTimer = 11000; + } else SlashTimer -= diff; + + if (StompTimer <= diff) + { + DoScriptText(RAND(YELL_LOVE1,YELL_LOVE2,YELL_LOVE3), me); + DoCast(me->getVictim(), SPELL_STOMP); + StompTimer = 30000; + } else StompTimer -= diff; + + if (BurnTimer <= diff) + { + std::list pTargets; + SelectTargetList(pTargets, 10, SELECT_TARGET_RANDOM, 100, true); + for (std::list::const_iterator i = pTargets.begin(); i != pTargets.end(); ++i) + if (!(*i)->HasAura(SPELL_BURN)) + { + (*i)->CastSpell((*i), SPELL_BURN, true); + break; + } + BurnTimer = urand(60000,180000); + } else BurnTimer -= diff; + + if (BerserkTimer < diff && !Enraged) + { + DoScriptText(YELL_BERSERK, me); + DoCast(me, SPELL_BERSERK); + Enraged = true; + } else BerserkTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_brutallus(Creature* pCreature) +{ + return new boss_brutallusAI (pCreature); +} + +void AddSC_boss_brutallus() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_brutallus"; + newscript->GetAI = &GetAI_boss_brutallus; + newscript->RegisterSelf(); +} diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp new file mode 100644 index 00000000000..602f12065fa --- /dev/null +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp @@ -0,0 +1,762 @@ +/* Copyright (C) 2009 Trinity +* 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_Eredar_Twins +SD%Complete: 100 +SDComment: +EndScriptData */ + +#include "ScriptedPch.h" +#include "sunwell_plateau.h" + +enum Quotes +{ + //Alytesh + YELL_CANFLAGRATION = -1580044, + YELL_SISTER_SACROLASH_DEAD = -1580045, + YELL_ALY_KILL_1 = -1580046, + YELL_ALY_KILL_2 = -1580047, + YELL_ALY_DEAD = -1580048, + YELL_BERSERK = -1580049, + + //Sacrolash + YELL_SHADOW_NOVA = -1580050, + YELL_SISTER_ALYTHESS_DEAD = -1580051, + YELL_SAC_KILL_1 = -1580052, + YELL_SAC_KILL_2 = -1580053, + SAY_SAC_DEAD = -1580054, + YELL_ENRAGE = -1580055, + + //Intro + YELL_INTRO_SAC_1 = -1580056, + YELL_INTRO_ALY_2 = -1580057, + YELL_INTRO_SAC_3 = -1580058, + YELL_INTRO_ALY_4 = -1580059, + YELL_INTRO_SAC_5 = -1580060, + YELL_INTRO_ALY_6 = -1580061, + YELL_INTRO_SAC_7 = -1580062, + YELL_INTRO_ALY_8 = -1580063, + + //Emote + EMOTE_SHADOW_NOVA = -1580064, + EMOTE_CONFLAGRATION = -1580065 +}; + +enum Spells +{ + //Lady Sacrolash spells + SPELL_DARK_TOUCHED = 45347, + SPELL_SHADOW_BLADES = 45248, //10 secs + SPELL_DARK_STRIKE = 45271, + SPELL_SHADOW_NOVA = 45329, //30-35 secs + SPELL_CONFOUNDING_BLOW = 45256, //25 secs + + //Shadow Image spells + SPELL_SHADOW_FURY = 45270, + SPELL_IMAGE_VISUAL = 45263, + + //Misc spells + SPELL_ENRAGE = 46587, + SPELL_EMPOWER = 45366, + SPELL_DARK_FLAME = 45345, + + //Grand Warlock Alythess spells + SPELL_PYROGENICS = 45230, //15secs + SPELL_FLAME_TOUCHED = 45348, + SPELL_CONFLAGRATION = 45342, //30-35 secs + SPELL_BLAZE = 45235, //on main target every 3 secs + SPELL_FLAME_SEAR = 46771, + SPELL_BLAZE_SUMMON = 45236, //187366 GO + SPELL_BLAZE_BURN = 45246 +}; + +struct boss_sacrolashAI : public ScriptedAI +{ + boss_sacrolashAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance *pInstance; + + bool SisterDeath; + bool Enraged; + + uint32 ShadowbladesTimer; + uint32 ShadownovaTimer; + uint32 ConfoundingblowTimer; + uint32 ShadowimageTimer; + uint32 ConflagrationTimer; + uint32 EnrageTimer; + + void Reset() + { + Enraged = false; + + if (pInstance) + { + Unit* Temp = Unit::GetUnit((*me),pInstance->GetData64(DATA_ALYTHESS)); + if (Temp) + if (Temp->isDead()) + { + CAST_CRE(Temp)->Respawn(); + }else + { + if (Temp->getVictim()) + { + me->getThreatManager().addThreat(Temp->getVictim(),0.0f); + } + } + } + + if (!me->isInCombat()) + { + ShadowbladesTimer = 10000; + ShadownovaTimer = 30000; + ConfoundingblowTimer = 25000; + ShadowimageTimer = 20000; + ConflagrationTimer = 30000; + EnrageTimer = 360000; + + SisterDeath = false; + } + + if (pInstance) + pInstance->SetData(DATA_EREDAR_TWINS_EVENT, NOT_STARTED); + } + + void EnterCombat(Unit * who) + { + DoZoneInCombat(); + + if (pInstance) + { + Unit* Temp = Unit::GetUnit((*me),pInstance->GetData64(DATA_ALYTHESS)); + if (Temp && Temp->isAlive() && !(Temp->getVictim())) + CAST_CRE(Temp)->AI()->AttackStart(who); + } + + if (pInstance) + pInstance->SetData(DATA_EREDAR_TWINS_EVENT, IN_PROGRESS); + } + + void KilledUnit(Unit * /*victim*/) + { + if (rand()%4 == 0) + DoScriptText(RAND(YELL_SAC_KILL_1,YELL_SAC_KILL_2), me); + } + + void JustDied(Unit* /*Killer*/) + { + // only if ALY death + if (SisterDeath) + { + DoScriptText(SAY_SAC_DEAD, me); + + if (pInstance) + pInstance->SetData(DATA_EREDAR_TWINS_EVENT, DONE); + } + else + me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); + } + + void SpellHitTarget(Unit *pTarget,const SpellEntry* spell) + { + switch(spell->Id) + { + case SPELL_SHADOW_BLADES: + case SPELL_SHADOW_NOVA: + case SPELL_CONFOUNDING_BLOW: + case SPELL_SHADOW_FURY: + HandleTouchedSpells(pTarget, SPELL_DARK_TOUCHED); + break; + case SPELL_CONFLAGRATION: + HandleTouchedSpells(pTarget, SPELL_FLAME_TOUCHED); + break; + } + } + + void HandleTouchedSpells(Unit *pTarget, uint32 TouchedType) + { + switch(TouchedType) + { + case SPELL_FLAME_TOUCHED: + if (!pTarget->HasAura(SPELL_DARK_FLAME)) + { + if (pTarget->HasAura(SPELL_DARK_TOUCHED)) + { + pTarget->RemoveAurasDueToSpell(SPELL_DARK_TOUCHED); + pTarget->CastSpell(pTarget, SPELL_DARK_FLAME, true); + } else pTarget->CastSpell(pTarget, SPELL_FLAME_TOUCHED, true); + } + break; + case SPELL_DARK_TOUCHED: + if (!pTarget->HasAura(SPELL_DARK_FLAME)) + { + if (pTarget->HasAura(SPELL_FLAME_TOUCHED)) + { + pTarget->RemoveAurasDueToSpell(SPELL_FLAME_TOUCHED); + pTarget->CastSpell(pTarget, SPELL_DARK_FLAME, true); + } else pTarget->CastSpell(pTarget, SPELL_DARK_TOUCHED, true); + } + break; + } + } + + void UpdateAI(const uint32 diff) + { + if (!SisterDeath) + { + if (pInstance) + { + Unit* Temp = NULL; + Temp = Unit::GetUnit((*me),pInstance->GetData64(DATA_ALYTHESS)); + if (Temp && Temp->isDead()) + { + DoScriptText(YELL_SISTER_ALYTHESS_DEAD, me); + DoCast(me, SPELL_EMPOWER); + me->InterruptSpell(CURRENT_GENERIC_SPELL); + SisterDeath = true; + } + } + } + + if (!UpdateVictim()) + return; + + if (SisterDeath) + { + if (ConflagrationTimer <= diff) + { + if (!me->IsNonMeleeSpellCasted(false)) + { + me->InterruptSpell(CURRENT_GENERIC_SPELL); + Unit *pTarget = NULL; + pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (pTarget) + DoCast(pTarget, SPELL_CONFLAGRATION); + ConflagrationTimer = 30000+(rand()%5000); + } + } else ConflagrationTimer -= diff; + } + else + { + if (ShadownovaTimer <= diff) + { + if (!me->IsNonMeleeSpellCasted(false)) + { + Unit *pTarget = NULL; + pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (pTarget) + DoCast(pTarget, SPELL_SHADOW_NOVA); + + if (!SisterDeath) + { + if (pTarget) + DoScriptText(EMOTE_SHADOW_NOVA, me, pTarget); + DoScriptText(YELL_SHADOW_NOVA, me); + } + ShadownovaTimer = 30000+(rand()%5000); + } + } else ShadownovaTimer -=diff; + } + + if (ConfoundingblowTimer <= diff) + { + if (!me->IsNonMeleeSpellCasted(false)) + { + Unit *pTarget = NULL; + pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (pTarget) + DoCast(pTarget, SPELL_CONFOUNDING_BLOW); + ConfoundingblowTimer = 20000 + (rand()%5000); + } + } else ConfoundingblowTimer -=diff; + + if (ShadowimageTimer <= diff) + { + Unit *pTarget = NULL; + Creature* temp = NULL; + for (uint8 i = 0; i<3; ++i) + { + pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + temp = DoSpawnCreature(MOB_SHADOW_IMAGE,0,0,0,0,TEMPSUMMON_CORPSE_DESPAWN,10000); + if (temp && pTarget) + { + temp->AddThreat(pTarget,1000000);//don't change target(healers) + temp->AI()->AttackStart(pTarget); + } + } + ShadowimageTimer = 20000; + } else ShadowimageTimer -=diff; + + if (ShadowbladesTimer <= diff) + { + if (!me->IsNonMeleeSpellCasted(false)) + { + DoCast(me, SPELL_SHADOW_BLADES); + ShadowbladesTimer = 10000; + } + } else ShadowbladesTimer -=diff; + + if (EnrageTimer < diff && !Enraged) + { + me->InterruptSpell(CURRENT_GENERIC_SPELL); + DoScriptText(YELL_ENRAGE, me); + DoCast(me, SPELL_ENRAGE); + Enraged = true; + } else EnrageTimer -= diff; + + if (me->isAttackReady() && !me->IsNonMeleeSpellCasted(false)) + { + //If we are within range melee the target + if (me->IsWithinMeleeRange(me->getVictim())) + { + HandleTouchedSpells(me->getVictim(), SPELL_DARK_TOUCHED); + me->AttackerStateUpdate(me->getVictim()); + me->resetAttackTimer(); + } + } + } +}; + +CreatureAI* GetAI_boss_sacrolash(Creature* pCreature) +{ + return new boss_sacrolashAI (pCreature); +}; + +struct boss_alythessAI : public Scripted_NoMovementAI +{ + boss_alythessAI(Creature *c) : Scripted_NoMovementAI(c) + { + pInstance = c->GetInstanceData(); + IntroStepCounter = 10; + } + + ScriptedInstance *pInstance; + + bool SisterDeath; + bool Enraged; + + uint32 IntroStepCounter; + uint32 IntroYellTimer; + + uint32 ConflagrationTimer; + uint32 BlazeTimer; + uint32 PyrogenicsTimer; + uint32 ShadownovaTimer; + uint32 FlamesearTimer; + uint32 EnrageTimer; + + void Reset() + { + Enraged = false; + + if (pInstance) + { + Unit* Temp = Unit::GetUnit((*me),pInstance->GetData64(DATA_SACROLASH)); + if (Temp) + if (Temp->isDead()) + { + CAST_CRE(Temp)->Respawn(); + }else + { + if (Temp->getVictim()) + { + me->getThreatManager().addThreat(Temp->getVictim(),0.0f); + } + } + } + + if (!me->isInCombat()) + { + ConflagrationTimer = 45000; + BlazeTimer = 100; + PyrogenicsTimer = 15000; + ShadownovaTimer = 40000; + EnrageTimer = 360000; + FlamesearTimer = 15000; + IntroYellTimer = 10000; + + SisterDeath = false; + } + + if (pInstance) + pInstance->SetData(DATA_EREDAR_TWINS_EVENT, NOT_STARTED); + } + + void EnterCombat(Unit * who) + { + DoZoneInCombat(); + + if (pInstance) + { + Unit* Temp = Unit::GetUnit((*me),pInstance->GetData64(DATA_SACROLASH)); + if (Temp && Temp->isAlive() && !(Temp->getVictim())) + CAST_CRE(Temp)->AI()->AttackStart(who); + } + + if (pInstance) + pInstance->SetData(DATA_EREDAR_TWINS_EVENT, IN_PROGRESS); + } + + void AttackStart(Unit *who) + { + if (!me->isInCombat()) + { + Scripted_NoMovementAI::AttackStart(who); + } + } + + void MoveInLineOfSight(Unit *who) + { + 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 (!me->isInCombat()) + { + DoStartNoMovement(who); + } + } + } + else if (IntroStepCounter == 10 && me->IsWithinLOSInMap(who)&& me->IsWithinDistInMap(who, 30)) + { + IntroStepCounter = 0; + } + } + + void KilledUnit(Unit * /*victim*/) + { + if (rand()%4 == 0) + { + DoScriptText(RAND(YELL_ALY_KILL_1,YELL_ALY_KILL_2), me); + } + } + + void JustDied(Unit* /*Killer*/) + { + if (SisterDeath) + { + DoScriptText(YELL_ALY_DEAD, me); + + if (pInstance) + pInstance->SetData(DATA_EREDAR_TWINS_EVENT, DONE); + } + else + me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); + } + + void SpellHitTarget(Unit *pTarget,const SpellEntry* spell) + { + switch(spell->Id) + { + + case SPELL_BLAZE: + pTarget->CastSpell(pTarget, SPELL_BLAZE_SUMMON, true); + case SPELL_CONFLAGRATION: + case SPELL_FLAME_SEAR: + HandleTouchedSpells(pTarget, SPELL_FLAME_TOUCHED); + break; + case SPELL_SHADOW_NOVA: + HandleTouchedSpells(pTarget, SPELL_DARK_TOUCHED); + break; + } + } + + void HandleTouchedSpells(Unit *pTarget, uint32 TouchedType) + { + switch(TouchedType) + { + case SPELL_FLAME_TOUCHED: + if (!pTarget->HasAura(SPELL_DARK_FLAME)) + { + if (pTarget->HasAura(SPELL_DARK_TOUCHED)) + { + pTarget->RemoveAurasDueToSpell(SPELL_DARK_TOUCHED); + pTarget->CastSpell(pTarget, SPELL_DARK_FLAME, true); + }else + { + pTarget->CastSpell(pTarget, SPELL_FLAME_TOUCHED, true); + } + } + break; + case SPELL_DARK_TOUCHED: + if (!pTarget->HasAura(SPELL_DARK_FLAME)) + { + if (pTarget->HasAura(SPELL_FLAME_TOUCHED)) + { + pTarget->RemoveAurasDueToSpell(SPELL_FLAME_TOUCHED); + pTarget->CastSpell(pTarget, SPELL_DARK_FLAME, true); + } else pTarget->CastSpell(pTarget, SPELL_DARK_TOUCHED, true); + } + break; + } + } + + uint32 IntroStep(uint32 step) + { + Creature* Sacrolash = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_SACROLASH) : 0); + switch (step) + { + case 0: return 0; + case 1: + if (Sacrolash) + DoScriptText(YELL_INTRO_SAC_1, Sacrolash); + return 1000; + case 2: DoScriptText(YELL_INTRO_ALY_2, me); return 1000; + case 3: + if (Sacrolash) + DoScriptText(YELL_INTRO_SAC_3, Sacrolash); + return 2000; + case 4: DoScriptText(YELL_INTRO_ALY_4, me); return 1000; + case 5: + if (Sacrolash) + DoScriptText(YELL_INTRO_SAC_5, Sacrolash); + return 2000; + case 6: DoScriptText(YELL_INTRO_ALY_6, me); return 1000; + case 7: + if (Sacrolash) + DoScriptText(YELL_INTRO_SAC_7, Sacrolash); + return 3000; + case 8: DoScriptText(YELL_INTRO_ALY_8, me); return 900000; + } + return 10000; + } + + void UpdateAI(const uint32 diff) + { + if (IntroStepCounter < 9) + { + if (IntroYellTimer <= diff) + { + IntroYellTimer = IntroStep(++IntroStepCounter); + } else IntroYellTimer -= diff; + } + + if (!SisterDeath) + { + if (pInstance) + { + Unit* Temp = NULL; + Temp = Unit::GetUnit((*me),pInstance->GetData64(DATA_SACROLASH)); + if (Temp && Temp->isDead()) + { + DoScriptText(YELL_SISTER_SACROLASH_DEAD, me); + DoCast(me, SPELL_EMPOWER); + me->InterruptSpell(CURRENT_GENERIC_SPELL); + SisterDeath = true; + } + } + } + if (!me->getVictim()) + { + if (pInstance) + { + Creature* sisiter = Unit::GetCreature((*me),pInstance->GetData64(DATA_SACROLASH)); + if (sisiter && !sisiter->isDead() && sisiter->getVictim()) + { + me->AddThreat(sisiter->getVictim(),0.0f); + DoStartNoMovement(sisiter->getVictim()); + me->Attack(sisiter->getVictim(),false); + } + } + } + + if (!UpdateVictim()) + return; + + if (SisterDeath) + { + if (ShadownovaTimer <= diff) + { + if (!me->IsNonMeleeSpellCasted(false)) + { + Unit *pTarget = NULL; + pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (pTarget) + DoCast(pTarget, SPELL_SHADOW_NOVA); + ShadownovaTimer= 30000+(rand()%5000); + } + } else ShadownovaTimer -=diff; + } + else + { + if (ConflagrationTimer <= diff) + { + if (!me->IsNonMeleeSpellCasted(false)) + { + me->InterruptSpell(CURRENT_GENERIC_SPELL); + Unit *pTarget = NULL; + pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (pTarget) + DoCast(pTarget, SPELL_CONFLAGRATION); + ConflagrationTimer = 30000+(rand()%5000); + + if (!SisterDeath) + { + if (pTarget) + DoScriptText(EMOTE_CONFLAGRATION, me, pTarget); + DoScriptText(YELL_CANFLAGRATION, me); + } + + BlazeTimer = 4000; + } + } else ConflagrationTimer -= diff; + } + + if (FlamesearTimer <= diff) + { + if (!me->IsNonMeleeSpellCasted(false)) + { + DoCast(me, SPELL_FLAME_SEAR); + FlamesearTimer = 15000; + } + } else FlamesearTimer -=diff; + + if (PyrogenicsTimer <= diff) + { + if (!me->IsNonMeleeSpellCasted(false)) + { + DoCast(me, SPELL_PYROGENICS, true); + PyrogenicsTimer = 15000; + } + } else PyrogenicsTimer -= diff; + + if (BlazeTimer <= diff) + { + if (!me->IsNonMeleeSpellCasted(false)) + { + DoCast(me->getVictim(), SPELL_BLAZE); + BlazeTimer = 3800; + } + } else BlazeTimer -= diff; + + if (EnrageTimer < diff && !Enraged) + { + me->InterruptSpell(CURRENT_GENERIC_SPELL); + DoScriptText(YELL_BERSERK, me); + DoCast(me, SPELL_ENRAGE); + Enraged = true; + } else EnrageTimer -= diff; + } +}; + +CreatureAI* GetAI_boss_alythess(Creature* pCreature) +{ + return new boss_alythessAI (pCreature); +}; + +struct mob_shadow_imageAI : public ScriptedAI +{ + mob_shadow_imageAI(Creature *c) : ScriptedAI(c) {} + + uint32 ShadowfuryTimer; + uint32 KillTimer; + uint32 DarkstrikeTimer; + + void Reset() + { + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + ShadowfuryTimer = 5000 + (rand()%15000); + DarkstrikeTimer = 3000; + KillTimer = 15000; + } + + void EnterCombat(Unit * /*who*/){} + + void SpellHitTarget(Unit *pTarget,const SpellEntry* spell) + { + switch(spell->Id) + { + + case SPELL_SHADOW_FURY: + case SPELL_DARK_STRIKE: + if (!pTarget->HasAura(SPELL_DARK_FLAME)) + { + if (pTarget->HasAura(SPELL_FLAME_TOUCHED)) + { + pTarget->RemoveAurasDueToSpell(SPELL_FLAME_TOUCHED); + pTarget->CastSpell(pTarget, SPELL_DARK_FLAME, true); + } else pTarget->CastSpell(pTarget,SPELL_DARK_TOUCHED,true); + } + break; + } + } + + void UpdateAI(const uint32 diff) + { + if (!me->HasAura(SPELL_IMAGE_VISUAL)) + DoCast(me, SPELL_IMAGE_VISUAL); + + if (KillTimer <= diff) + { + me->Kill(me); + KillTimer = 9999999; + } else KillTimer -= diff; + + if (!UpdateVictim()) + return; + + if (ShadowfuryTimer <= diff) + { + DoCast(me, SPELL_SHADOW_FURY); + ShadowfuryTimer = 10000; + } else ShadowfuryTimer -=diff; + + if (DarkstrikeTimer <= diff) + { + if (!me->IsNonMeleeSpellCasted(false)) + { + //If we are within range melee the target + if (me->IsWithinMeleeRange(me->getVictim())) + DoCast(me->getVictim(), SPELL_DARK_STRIKE); + } + DarkstrikeTimer = 3000; + } else DarkstrikeTimer -= diff; + } +}; + +CreatureAI* GetAI_mob_shadow_image(Creature* pCreature) +{ + return new mob_shadow_imageAI (pCreature); +}; + +void AddSC_boss_eredar_twins() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_sacrolash"; + newscript->GetAI = &GetAI_boss_sacrolash; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_alythess"; + newscript->GetAI = &GetAI_boss_alythess; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_shadow_image"; + newscript->GetAI = &GetAI_mob_shadow_image; + newscript->RegisterSelf(); +} diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp new file mode 100644 index 00000000000..88ad2dbab11 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp @@ -0,0 +1,579 @@ +/* Copyright (C) 2009 Trinity +* 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_Felmyst +SD%Complete: 0 +SDComment: +EndScriptData */ + +#include "ScriptedPch.h" +#include "sunwell_plateau.h" + +enum Yells +{ + YELL_BIRTH = -1580036, + YELL_KILL1 = -1580037, + YELL_KILL2 = -1580038, + YELL_BREATH = -1580039, + YELL_TAKEOFF = -1580040, + YELL_BERSERK = -1580041, + YELL_DEATH = -1580042, + YELL_KALECGOS = -1580043, // after felmyst's death spawned and say this +}; + +enum Spells +{ + //Aura + AURA_SUNWELL_RADIANCE = 45769, + AURA_NOXIOUS_FUMES = 47002, + + //Land phase + SPELL_CLEAVE = 19983, + SPELL_CORROSION = 45866, + SPELL_GAS_NOVA = 45855, + SPELL_ENCAPSULATE_CHANNEL = 45661, + // SPELL_ENCAPSULATE_EFFECT = 45665, + // SPELL_ENCAPSULATE_AOE = 45662, + + //Flight phase + SPELL_VAPOR_SELECT = 45391, // fel to player, force cast 45392, 50000y selete target + SPELL_VAPOR_SUMMON = 45392, // player summon vapor, radius around caster, 5y, + SPELL_VAPOR_FORCE = 45388, // vapor to fel, force cast 45389 + SPELL_VAPOR_CHANNEL = 45389, // fel to vapor, green beam channel + SPELL_VAPOR_TRIGGER = 45411, // linked to 45389, vapor to self, trigger 45410 and 46931 + SPELL_VAPOR_DAMAGE = 46931, // vapor damage, 4000 + SPELL_TRAIL_SUMMON = 45410, // vapor summon trail + SPELL_TRAIL_TRIGGER = 45399, // trail to self, trigger 45402 + SPELL_TRAIL_DAMAGE = 45402, // trail damage, 2000 + 2000 dot + SPELL_DEAD_SUMMON = 45400, // summon blazing dead, 5min + SPELL_DEAD_PASSIVE = 45415, + SPELL_FOG_BREATH = 45495, // fel to self, speed burst + SPELL_FOG_TRIGGER = 45582, // fog to self, trigger 45782 + SPELL_FOG_FORCE = 45782, // fog to player, force cast 45714 + SPELL_FOG_INFORM = 45714, // player let fel cast 45717, script effect + SPELL_FOG_CHARM = 45717, // fel to player + SPELL_FOG_CHARM2 = 45726, // link to 45717 + + SPELL_TRANSFORM_TRIGGER = 44885, // madrigosa to self, trigger 46350 + SPELL_TRANSFORM_VISUAL = 46350, // 46411stun? + SPELL_TRANSFORM_FELMYST = 45068, // become fel + SPELL_FELMYST_SUMMON = 45069, + + //Other + SPELL_BERSERK = 45078, + SPELL_CLOUD_VISUAL = 45212, + SPELL_CLOUD_SUMMON = 45884, +}; + +enum PhaseFelmyst +{ + PHASE_NONE, + PHASE_GROUND, + PHASE_FLIGHT, +}; + +enum EventFelmyst +{ + EVENT_NONE, + EVENT_BERSERK, + + EVENT_CLEAVE, + EVENT_CORROSION, + EVENT_GAS_NOVA, + EVENT_ENCAPSULATE, + EVENT_FLIGHT, + + EVENT_FLIGHT_SEQUENCE, + EVENT_SUMMON_DEAD, + EVENT_SUMMON_FOG, +}; + +struct boss_felmystAI : public ScriptedAI +{ + boss_felmystAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + + // wait for core patch be accepted + /*SpellEntry *TempSpell = GET_SPELL(SPELL_ENCAPSULATE_EFFECT); + if (TempSpell->SpellIconID == 2294) + TempSpell->SpellIconID = 2295; + TempSpell = GET_SPELL(SPELL_VAPOR_TRIGGER); + if ((TempSpell->Attributes & SPELL_ATTR_PASSIVE) == 0) + TempSpell->Attributes |= SPELL_ATTR_PASSIVE; + TempSpell = GET_SPELL(SPELL_FOG_CHARM2); + if ((TempSpell->Attributes & SPELL_ATTR_PASSIVE) == 0) + TempSpell->Attributes |= SPELL_ATTR_PASSIVE;*/ + } + + ScriptedInstance *pInstance; + PhaseFelmyst phase; + EventMap events; + + uint32 uiFlightCount; + uint32 uiBreathCount; + + float breathX, breathY; + + void Reset() + { + phase = PHASE_NONE; + + events.Reset(); + + uiFlightCount = 0; + + me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 10); + me->SetFloatValue(UNIT_FIELD_COMBATREACH, 10); + + DespawnSummons(MOB_VAPOR_TRAIL); + me->setActive(false); + + if (pInstance) + pInstance->SetData(DATA_FELMYST_EVENT, NOT_STARTED); + } + + void EnterCombat(Unit * /*who*/) + { + events.ScheduleEvent(EVENT_BERSERK, 600000); + + me->setActive(true); + DoZoneInCombat(); + DoCast(me, AURA_SUNWELL_RADIANCE, true); + DoCast(me, AURA_NOXIOUS_FUMES, true); + EnterPhase(PHASE_GROUND); + + if (pInstance) + pInstance->SetData(DATA_FELMYST_EVENT, IN_PROGRESS); + } + + void AttackStart(Unit *who) + { + if (phase != PHASE_FLIGHT) + ScriptedAI::AttackStart(who); + } + + void MoveInLineOfSight(Unit *who) + { + if (phase != PHASE_FLIGHT) + ScriptedAI::MoveInLineOfSight(who); + } + + void KilledUnit(Unit* /*victim*/) + { + DoScriptText(RAND(YELL_KILL1,YELL_KILL2), me); + } + + void JustRespawned() + { + DoScriptText(YELL_BIRTH, me); + } + + void JustDied(Unit* /*Killer*/) + { + DoScriptText(YELL_DEATH, me); + + if (pInstance) + pInstance->SetData(DATA_FELMYST_EVENT, DONE); + } + + void SpellHit(Unit *caster, const SpellEntry *spell) + { + // workaround for linked aura + /*if (spell->Id == SPELL_VAPOR_FORCE) + { + caster->CastSpell(caster, SPELL_VAPOR_TRIGGER, true); + }*/ + // workaround for mind control + if (spell->Id == SPELL_FOG_INFORM) + { + float x, y, z; + caster->GetPosition(x, y, z); + if (Unit* summon = me->SummonCreature(MOB_DEAD, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000)) + { + summon->SetMaxHealth(caster->GetMaxHealth()); + summon->SetHealth(caster->GetMaxHealth()); + summon->CastSpell(summon, SPELL_FOG_CHARM, true); + summon->CastSpell(summon, SPELL_FOG_CHARM2, true); + } + me->DealDamage(caster, caster->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + } + + void JustSummoned(Creature *summon) + { + if (summon->GetEntry() == MOB_DEAD) + { + summon->AI()->AttackStart(SelectTarget(SELECT_TARGET_RANDOM)); + DoZoneInCombat(summon); + summon->CastSpell(summon, SPELL_DEAD_PASSIVE, true); + } + } + + void MovementInform(uint32, uint32) + { + if (phase == PHASE_FLIGHT) + events.ScheduleEvent(EVENT_FLIGHT_SEQUENCE, 1); + } + + void DamageTaken(Unit*, uint32 &damage) + { + if (phase != PHASE_GROUND && damage >= me->GetHealth()) + damage = 0; + } + + void EnterPhase(PhaseFelmyst NextPhase) + { + switch(NextPhase) + { + case PHASE_GROUND: + me->CastStop(SPELL_FOG_BREATH); + me->RemoveAurasDueToSpell(SPELL_FOG_BREATH); + me->SetUnitMovementFlags(MOVEMENTFLAG_NONE); + me->SetSpeed(MOVE_RUN, 2.0); + + events.ScheduleEvent(EVENT_CLEAVE, urand(5000, 10000)); + events.ScheduleEvent(EVENT_CORROSION, urand(10000, 20000)); + events.ScheduleEvent(EVENT_GAS_NOVA, urand(15000, 20000)); + events.ScheduleEvent(EVENT_ENCAPSULATE, urand(20000, 25000)); + events.ScheduleEvent(EVENT_FLIGHT, 60000); + break; + case PHASE_FLIGHT: + me->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); + events.ScheduleEvent(EVENT_FLIGHT_SEQUENCE, 1000); + uiFlightCount = 0; + uiBreathCount = 0; + break; + } + phase = NextPhase; + } + + void HandleFlightSequence() + { + switch(uiFlightCount) + { + case 0: + //me->AttackStop(); + me->GetMotionMaster()->Clear(false); + me->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); + me->StopMoving(); + DoScriptText(YELL_TAKEOFF, me); + events.ScheduleEvent(EVENT_FLIGHT_SEQUENCE, 2000); + break; + case 1: + me->GetMotionMaster()->MovePoint(0, me->GetPositionX()+1, me->GetPositionY(), me->GetPositionZ()+10); + break; + case 2: + { + Unit *pTarget = pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 150, true); + if (!pTarget) + pTarget = Unit::GetUnit(*me, pInstance ? pInstance->GetData64(DATA_PLAYER_GUID) : 0); + + if (!pTarget) + { + EnterEvadeMode(); + return; + } + + Creature* Vapor = me->SummonCreature(MOB_VAPOR, pTarget->GetPositionX()-5+rand()%10, pTarget->GetPositionY()-5+rand()%10, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 9000); + if (Vapor) + { + Vapor->AI()->AttackStart(pTarget); + me->InterruptNonMeleeSpells(false); + DoCast(Vapor, SPELL_VAPOR_CHANNEL, false); // core bug + Vapor->CastSpell(Vapor, SPELL_VAPOR_TRIGGER, true); + } + + events.ScheduleEvent(EVENT_FLIGHT_SEQUENCE, 10000); + break; + } + case 3: + { + DespawnSummons(MOB_VAPOR_TRAIL); + //DoCast(me, SPELL_VAPOR_SELECT); need core support + + Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 150, true); + if (!pTarget) + pTarget = Unit::GetUnit(*me, pInstance ? pInstance->GetData64(DATA_PLAYER_GUID) : 0); + + if (!pTarget) + { + EnterEvadeMode(); + return; + } + + //pTarget->CastSpell(pTarget, SPELL_VAPOR_SUMMON, true); need core support + Creature* pVapor = me->SummonCreature(MOB_VAPOR, pTarget->GetPositionX()-5+rand()%10, pTarget->GetPositionY()-5+rand()%10, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 9000); + if (pVapor) + { + if (pVapor->AI()) + pVapor->AI()->AttackStart(pTarget); + me->InterruptNonMeleeSpells(false); + DoCast(pVapor, SPELL_VAPOR_CHANNEL, false); // core bug + pVapor->CastSpell(pVapor, SPELL_VAPOR_TRIGGER, true); + } + + events.ScheduleEvent(EVENT_FLIGHT_SEQUENCE, 10000); + break; + } + case 4: + DespawnSummons(MOB_VAPOR_TRAIL); + events.ScheduleEvent(EVENT_FLIGHT_SEQUENCE, 1); + break; + case 5: + { + Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 150, true); + if (!pTarget) + pTarget = Unit::GetUnit(*me, pInstance ? pInstance->GetData64(DATA_PLAYER_GUID) : 0); + + if (!pTarget) + { + EnterEvadeMode(); + return; + } + + breathX = pTarget->GetPositionX(); + breathY = pTarget->GetPositionY(); + float x, y, z; + pTarget->GetContactPoint(me, x, y, z, 70); + me->GetMotionMaster()->MovePoint(0, x, y, z+10); + break; + } + case 6: + me->SetOrientation(me->GetAngle(breathX, breathY)); + me->StopMoving(); + //DoTextEmote("takes a deep breath.", NULL); + events.ScheduleEvent(EVENT_FLIGHT_SEQUENCE, 10000); + break; + case 7: + { + DoCast(me, SPELL_FOG_BREATH, true); + float x, y, z; + me->GetPosition(x, y, z); + x = 2 * breathX - x; + y = 2 * breathY - y; + me->GetMotionMaster()->MovePoint(0, x, y, z); + events.ScheduleEvent(EVENT_SUMMON_FOG, 1); + break; + } + case 8: + me->CastStop(SPELL_FOG_BREATH); + me->RemoveAurasDueToSpell(SPELL_FOG_BREATH); + ++uiBreathCount; + events.ScheduleEvent(EVENT_FLIGHT_SEQUENCE, 1); + if (uiBreathCount < 3) + uiFlightCount = 4; + break; + case 9: + if (Unit *pTarget = SelectTarget(SELECT_TARGET_TOPAGGRO)) + DoStartMovement(pTarget); + else + { + EnterEvadeMode(); + return; + } + break; + case 10: + me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->HandleEmoteCommand(EMOTE_ONESHOT_LAND); + EnterPhase(PHASE_GROUND); + AttackStart(SelectTarget(SELECT_TARGET_TOPAGGRO)); + break; + } + ++uiFlightCount; + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + { + if (phase == PHASE_FLIGHT && !me->IsInEvadeMode()) + EnterEvadeMode(); + return; + } + + events.Update(diff); + + if (me->IsNonMeleeSpellCasted(false)) + return; + + if (phase == PHASE_GROUND) + { + switch(events.ExecuteEvent()) + { + case EVENT_BERSERK: + DoScriptText(YELL_BERSERK, me); + DoCast(me, SPELL_BERSERK, true); + events.ScheduleEvent(EVENT_BERSERK, 10000); + break; + case EVENT_CLEAVE: + DoCast(me->getVictim(), SPELL_CLEAVE, false); + events.ScheduleEvent(EVENT_CLEAVE, urand(5000,10000)); + break; + case EVENT_CORROSION: + DoCast(me->getVictim(), SPELL_CORROSION, false); + events.ScheduleEvent(EVENT_CORROSION, urand(20000,30000)); + break; + case EVENT_GAS_NOVA: + DoCast(me, SPELL_GAS_NOVA, false); + events.ScheduleEvent(EVENT_GAS_NOVA, urand(20000,25000)); + break; + case EVENT_ENCAPSULATE: + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 150, true)) + DoCast(pTarget, SPELL_ENCAPSULATE_CHANNEL, false); + events.ScheduleEvent(EVENT_ENCAPSULATE, urand(25000,30000)); + break; + case EVENT_FLIGHT: + EnterPhase(PHASE_FLIGHT); + break; + default: + DoMeleeAttackIfReady(); + break; + } + } + + if (phase == PHASE_FLIGHT) + { + switch(events.ExecuteEvent()) + { + case EVENT_BERSERK: + DoScriptText(YELL_BERSERK, me); + DoCast(me, SPELL_BERSERK, true); + break; + case EVENT_FLIGHT_SEQUENCE: + HandleFlightSequence(); + break; + case EVENT_SUMMON_FOG: + { + float x, y, z; + me->GetPosition(x, y, z); + me->UpdateGroundPositionZ(x, y, z); + if (Creature *Fog = me->SummonCreature(MOB_VAPOR_TRAIL, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN, 10000)) + { + Fog->RemoveAurasDueToSpell(SPELL_TRAIL_TRIGGER); + Fog->CastSpell(Fog, SPELL_FOG_TRIGGER, true); + me->CastSpell(Fog, SPELL_FOG_FORCE, true); + } + } + events.ScheduleEvent(EVENT_SUMMON_FOG, 1000); + break; + } + } + } + + void DespawnSummons(uint32 entry) + { + std::list templist; + float x, y, z; + me->GetPosition(x, y, z); + + CellPair pair(Trinity::ComputeCellPair(x, y)); + Cell cell(pair); + cell.data.Part.reserved = ALL_DISTRICT; + cell.SetNoCreate(); + + Trinity::AllCreaturesOfEntryInRange check(me, entry, 100); + Trinity::CreatureListSearcher searcher(me, templist, check); + TypeContainerVisitor, GridTypeMapContainer> cSearcher(searcher); + cell.Visit(pair, cSearcher, *(me->GetMap())); + + for (std::list::const_iterator i = templist.begin(); i != templist.end(); ++i) + { + if (entry == MOB_VAPOR_TRAIL && phase == PHASE_FLIGHT) + { + (*i)->GetPosition(x, y, z); + me->SummonCreature(MOB_DEAD, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + } + (*i)->SetVisibility(VISIBILITY_OFF); + (*i)->setDeathState(JUST_DIED); + if ((*i)->getDeathState() == CORPSE) + (*i)->RemoveCorpse(); + } + } +}; + +struct mob_felmyst_vaporAI : public ScriptedAI +{ + mob_felmyst_vaporAI(Creature *c) : ScriptedAI(c) + { + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetSpeed(MOVE_RUN, 0.8); + } + void Reset() {} + void EnterCombat(Unit* /*who*/) + { + DoZoneInCombat(); + //DoCast(me, SPELL_VAPOR_FORCE, true); core bug + } + void UpdateAI(const uint32 /*diff*/) + { + if (!me->getVictim()) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) + AttackStart(pTarget); + } +}; + +struct mob_felmyst_trailAI : public ScriptedAI +{ + mob_felmyst_trailAI(Creature *c) : ScriptedAI(c) + { + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + DoCast(me, SPELL_TRAIL_TRIGGER, true); + me->SetUInt64Value(UNIT_FIELD_TARGET, me->GetGUID()); + me->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 0.01); // core bug + } + void Reset() {} + void EnterCombat(Unit* /*who*/) {} + void AttackStart(Unit* /*who*/) {} + void MoveInLineOfSight(Unit* /*who*/) {} + void UpdateAI(const uint32 /*diff*/) {} +}; + +CreatureAI* GetAI_boss_felmyst(Creature* pCreature) +{ + return new boss_felmystAI(pCreature); +} + +CreatureAI* GetAI_mob_felmyst_vapor(Creature* pCreature) +{ + return new mob_felmyst_vaporAI(pCreature); +} + +CreatureAI* GetAI_mob_felmyst_trail(Creature* pCreature) +{ + return new mob_felmyst_trailAI(pCreature); +} + +void AddSC_boss_felmyst() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_felmyst"; + newscript->GetAI = &GetAI_boss_felmyst; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_felmyst_vapor"; + newscript->GetAI = &GetAI_mob_felmyst_vapor; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_felmyst_trail"; + newscript->GetAI = &GetAI_mob_felmyst_trail; + newscript->RegisterSelf(); +} diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp new file mode 100644 index 00000000000..146771325eb --- /dev/null +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp @@ -0,0 +1,794 @@ +/* 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_Kalecgos +SD%Complete: 95 +SDComment: +SDCategory: Sunwell_Plateau +EndScriptData */ + +#include "ScriptedPch.h" +#include "sunwell_plateau.h" + +enum Yells +{ + //Kalecgos dragon form + SAY_EVIL_AGGRO = -1580000, + SAY_EVIL_SPELL1 = -1580001, + SAY_EVIL_SPELL2 = -1580002, + SAY_EVIL_SLAY1 = -1580003, + SAY_EVIL_SLAY2 = -1580004, + SAY_EVIL_ENRAGE = -1580005, + + //Kalecgos humanoid form + SAY_GOOD_AGGRO = -1580006, + SAY_GOOD_NEAR_DEATH = -1580007, + SAY_GOOD_NEAR_DEATH2 = -1580008, + SAY_GOOD_PLRWIN = -1580009, + + //Sathrovarr + SAY_SATH_AGGRO = -1580010, + SAY_SATH_DEATH = -1580011, + SAY_SATH_SPELL1 = -1580012, + SAY_SATH_SPELL2 = -1580013, + SAY_SATH_SLAY1 = -1580014, + SAY_SATH_SLAY2 = -1580015, + SAY_SATH_ENRAGE = -1580016, +}; + +enum Spells +{ + AURA_SUNWELL_RADIANCE = 45769, + AURA_SPECTRAL_EXHAUSTION = 44867, + AURA_SPECTRAL_REALM = 46021, + AURA_SPECTRAL_INVISIBILITY = 44801, + AURA_DEMONIC_VISUAL = 44800, + + SPELL_SPECTRAL_BLAST = 44869, + SPELL_TELEPORT_SPECTRAL = 46019, + SPELL_ARCANE_BUFFET = 45018, + SPELL_FROST_BREATH = 44799, + SPELL_TAIL_LASH = 45122, + + SPELL_BANISH = 44836, + SPELL_TRANSFORM_KALEC = 44670, + SPELL_ENRAGE = 44807, + + SPELL_CORRUPTION_STRIKE = 45029, + SPELL_AGONY_CURSE = 45032, + SPELL_SHADOW_BOLT = 45031, + + SPELL_HEROIC_STRIKE = 45026, + SPELL_REVITALIZE = 45027 +}; + +enum SWPActions +{ + DO_ENRAGE = 1, + DO_BANISH = 2, +}; + +#define GO_FAILED "You are unable to use this currently." + +#define EMOTE_UNABLE_TO_FIND "is unable to find Kalecgos" + +#define FLY_X 1679 +#define FLY_Y 900 +#define FLY_Z 82 + +#define CENTER_X 1705 +#define CENTER_Y 930 +#define RADIUS 30 + +#define DRAGON_REALM_Z 53.079 +#define DEMON_REALM_Z -74.558 + +#define MAX_PLAYERS_IN_SPECTRAL_REALM 0 //over this, teleport object won't work, 0 disables check + +uint32 WildMagic[] = { 44978, 45001, 45002, 45004, 45006, 45010 }; + +struct boss_kalecgosAI : public ScriptedAI +{ + boss_kalecgosAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + SathGUID = 0; + DoorGUID = 0; + bJustReset = false; + me->setActive(true); + SpellEntry *TempSpell = GET_SPELL(SPELL_SPECTRAL_BLAST); + if (TempSpell) + TempSpell->EffectImplicitTargetB[0] = TARGET_UNIT_TARGET_ENEMY; + } + + ScriptedInstance *pInstance; + + uint32 ArcaneBuffetTimer; + uint32 FrostBreathTimer; + uint32 WildMagicTimer; + uint32 SpectralBlastTimer; + uint32 TailLashTimer; + uint32 CheckTimer; + uint32 TalkTimer; + uint32 TalkSequence; + uint32 ResetTimer; + + bool isFriendly; + bool isEnraged; + bool isBanished; + bool bJustReset; + + uint64 SathGUID; + uint64 DoorGUID; + + void Reset() + { + if (pInstance) + { + SathGUID = pInstance->GetData64(DATA_SATHROVARR); + pInstance->SetData(DATA_KALECGOS_EVENT, NOT_STARTED); + } + + if (Creature *Sath = Unit::GetCreature(*me, SathGUID)) + Sath->AI()->EnterEvadeMode(); + + me->setFaction(14); + if (!bJustReset) //first reset at create + { + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE); + me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetVisibility(VISIBILITY_ON); + me->SetStandState(UNIT_STAND_STATE_SLEEP); + } + me->SetHealth(me->GetMaxHealth());//dunno why it does not resets health at evade.. + ArcaneBuffetTimer = 8000; + FrostBreathTimer = 15000; + WildMagicTimer = 10000; + TailLashTimer = 25000; + SpectralBlastTimer = urand(20000,25000); + CheckTimer = 1000; + ResetTimer = 30000; + + TalkTimer = 0; + TalkSequence = 0; + isFriendly = false; + isEnraged = false; + isBanished = false; + } + + void EnterEvadeMode() + { + bJustReset = true; + me->SetVisibility(VISIBILITY_OFF); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE); + ScriptedAI::EnterEvadeMode(); + } + + void DoAction(const int32 param) + { + switch (param) + { + case DO_ENRAGE: + isEnraged = true; + me->CastSpell(me, SPELL_ENRAGE, true); + break; + case DO_BANISH: + isBanished = true; + me->CastSpell(me, SPELL_BANISH, true); + break; + } + } + + void UpdateAI(const uint32 diff) + { + if (TalkTimer) + { + if (!TalkSequence) + { + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE); + me->InterruptNonMeleeSpells(true); + me->RemoveAllAuras(); + me->DeleteThreatList(); + me->CombatStop(); + ++TalkSequence; + } + if (TalkTimer <= diff) + { + if (isFriendly) + GoodEnding(); + else + BadEnding(); + ++TalkSequence; + } else TalkTimer -= diff; + } + else + { + if (bJustReset) + { + if (ResetTimer <= diff) + { + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE); + me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetVisibility(VISIBILITY_ON); + me->SetStandState(UNIT_STAND_STATE_SLEEP); + ResetTimer = 10000; + bJustReset = false; + } else ResetTimer -= diff; + return; + } + if (!UpdateVictim()) + return; + + if (CheckTimer <= diff) + { + if (me->GetDistance(CENTER_X, CENTER_Y, DRAGON_REALM_Z) >= 75) + { + me->AI()->EnterEvadeMode(); + return; + } + if (HealthBelowPct(10) && !isEnraged) + { + if (Creature* Sath = Unit::GetCreature(*me, SathGUID)) + Sath->AI()->DoAction(DO_ENRAGE); + DoAction(DO_ENRAGE); + } + if (!isBanished && HealthBelowPct(1)) + { + if (Creature* Sath = Unit::GetCreature(*me, SathGUID)) + { + if (Sath->HasAura(SPELL_BANISH)) + { + Sath->DealDamage(Sath, Sath->GetHealth()); + return; + } + else + DoAction(DO_BANISH); + } + else + { + error_log("TSCR: Didn't find Shathrowar. Kalecgos event reseted."); + EnterEvadeMode(); + return; + } + } + CheckTimer = 1000; + } else CheckTimer -= diff; + + if (ArcaneBuffetTimer <= diff) + { + DoCastAOE(SPELL_ARCANE_BUFFET); + ArcaneBuffetTimer = 8000; + } else ArcaneBuffetTimer -= diff; + + if (FrostBreathTimer <= diff) + { + DoCastAOE(SPELL_FROST_BREATH); + FrostBreathTimer = 15000; + } else FrostBreathTimer -= diff; + + if (TailLashTimer <= diff) + { + DoCastAOE(SPELL_TAIL_LASH); + TailLashTimer = 15000; + } else TailLashTimer -= diff; + + if (WildMagicTimer <= diff) + { + DoCastAOE(WildMagic[rand()%6]); + WildMagicTimer = 20000; + } else WildMagicTimer -= diff; + + if (SpectralBlastTimer <= diff) + { + std::list &m_threatlist = me->getThreatManager().getThreatList(); + std::list targetList; + for (std::list::const_iterator itr = m_threatlist.begin(); itr!= m_threatlist.end(); ++itr) + if ((*itr)->getTarget() && (*itr)->getTarget()->GetTypeId() == TYPEID_PLAYER && (*itr)->getTarget()->GetGUID() != me->getVictim()->GetGUID() && !(*itr)->getTarget()->HasAura(AURA_SPECTRAL_EXHAUSTION) && (*itr)->getTarget()->GetPositionZ() > me->GetPositionZ()-5) + targetList.push_back((*itr)->getTarget()); + if (targetList.empty()) + { + SpectralBlastTimer = 1000; + return; + } + std::list::const_iterator i = targetList.begin(); + advance(i, rand()%targetList.size()); + if ((*i)) + { + (*i)->CastSpell((*i), SPELL_SPECTRAL_BLAST,true); + SpectralBlastTimer = 20000+rand()%5000; + } else SpectralBlastTimer = 1000; + } else SpectralBlastTimer -= diff; + + DoMeleeAttackIfReady(); + } + } + + void MoveInLineOfSight(Unit *who) + { + if (bJustReset)//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 DamageTaken(Unit *done_by, uint32 &damage) + { + if (damage >= me->GetHealth() && done_by != me) + damage = 0; + } + + void EnterCombat(Unit* /*who*/) + { + me->SetStandState(UNIT_STAND_STATE_STAND); + DoScriptText(SAY_EVIL_AGGRO, me); + DoZoneInCombat(); + + if (pInstance) + pInstance->SetData(DATA_KALECGOS_EVENT, IN_PROGRESS); + } + + void KilledUnit(Unit * /*victim*/) + { + DoScriptText(RAND(SAY_EVIL_SLAY1,SAY_EVIL_SLAY2), me); + } + + void MovementInform(uint32 type,uint32 /*id*/) + { + if (type != POINT_MOTION_TYPE) + return; + me->SetVisibility(VISIBILITY_OFF); + if (isFriendly) + { + me->setDeathState(JUST_DIED); + + Map::PlayerList const& players = me->GetMap()->GetPlayers(); + if (!players.isEmpty()) + { + for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + { + Player* pPlayer = itr->getSource(); + if (pPlayer) + ((InstanceMap*)me->GetMap())->PermBindAllPlayers(pPlayer); + } + } + } + else + { + me->GetMotionMaster()->MoveTargetedHome(); + TalkTimer = 1000; + } + } + + void GoodEnding() + { + switch(TalkSequence) + { + case 1: + me->setFaction(35); + TalkTimer = 1000; + break; + case 2: + DoScriptText(SAY_GOOD_PLRWIN, me); + TalkTimer = 10000; + break; + case 3: + me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->GetMotionMaster()->MovePoint(0,FLY_X,FLY_Y,FLY_Z); + TalkTimer = 600000; + break; + default: + break; + } + } + + void BadEnding() + { + switch(TalkSequence) + { + case 1: + DoScriptText(SAY_EVIL_ENRAGE, me); + TalkTimer = 3000; + break; + case 2: + me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->GetMotionMaster()->MovePoint(0,FLY_X,FLY_Y,FLY_Z); + TalkTimer = 15000; + break; + case 3: + EnterEvadeMode(); + break; + default: + break; + } + } +}; + +struct boss_sathrovarrAI : public ScriptedAI +{ + boss_sathrovarrAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + KalecGUID = 0; + KalecgosGUID = 0; + } + + ScriptedInstance *pInstance; + + uint32 CorruptionStrikeTimer; + uint32 AgonyCurseTimer; + uint32 ShadowBoltTimer; + uint32 CheckTimer; + uint32 ResetThreat; + + uint64 KalecGUID; + uint64 KalecgosGUID; + + bool isEnraged; + bool isBanished; + + void Reset() + { + me->SetHealth(me->GetMaxHealth());//dunno why it does not resets health at evade.. + me->setActive(true); + if (pInstance) + { + KalecgosGUID = pInstance->GetData64(DATA_KALECGOS_DRAGON); + pInstance->SetData(DATA_KALECGOS_EVENT, NOT_STARTED); + } + if (KalecGUID) + { + if (Creature* Kalec = Unit::GetCreature(*me, KalecGUID)) + Kalec->setDeathState(JUST_DIED); + KalecGUID = 0; + } + + ShadowBoltTimer = 7000 + rand()%3 * 1000; + AgonyCurseTimer = 20000; + CorruptionStrikeTimer = 13000; + CheckTimer = 1000; + ResetThreat = 1000; + isEnraged = false; + isBanished = false; + + me->CastSpell(me, AURA_DEMONIC_VISUAL, true); + TeleportAllPlayersBack(); + } + + void EnterCombat(Unit* /*who*/) + { + if (Creature *Kalec = me->SummonCreature(MOB_KALEC, me->GetPositionX() + 10, me->GetPositionY() + 5, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 0)) + { + KalecGUID = Kalec->GetGUID(); + me->CombatStart(Kalec); + me->AddThreat(Kalec, 100.0f); + Kalec->setActive(true); + } + DoScriptText(SAY_SATH_AGGRO, me); + } + + void DamageTaken(Unit *done_by, uint32 &damage) + { + if (damage >= me->GetHealth() && done_by != me) + damage = 0; + } + + void KilledUnit(Unit *pTarget) + { + if (pTarget->GetGUID() == KalecGUID) + { + TeleportAllPlayersBack(); + if (Creature *Kalecgos = Unit::GetCreature(*me, KalecgosGUID)) + { + CAST_AI(boss_kalecgosAI, Kalecgos->AI())->TalkTimer = 1; + CAST_AI(boss_kalecgosAI, Kalecgos->AI())->isFriendly = false; + } + EnterEvadeMode(); + return; + } + DoScriptText(RAND(SAY_SATH_SLAY1,SAY_SATH_SLAY2), me); + } + + void JustDied(Unit * /*killer*/) + { + DoScriptText(SAY_SATH_DEATH, me); + me->GetMap()->CreatureRelocation(me, me->GetPositionX(), me->GetPositionY(), DRAGON_REALM_Z, me->GetOrientation()); + TeleportAllPlayersBack(); + if (Creature *Kalecgos = Unit::GetCreature(*me, KalecgosGUID)) + { + CAST_AI(boss_kalecgosAI, Kalecgos->AI())->TalkTimer = 1; + CAST_AI(boss_kalecgosAI, Kalecgos->AI())->isFriendly = true; + } + + if (pInstance) + pInstance->SetData(DATA_KALECGOS_EVENT, DONE); + } + + void TeleportAllPlayersBack() + { + Map* pMap = me->GetMap(); + if (!pMap->IsDungeon()) return; + Map::PlayerList const &PlayerList = pMap->GetPlayers(); + for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) + { + if (i->getSource()->GetPositionZ() <= DRAGON_REALM_Z-5) + { + i->getSource()->RemoveAura(AURA_SPECTRAL_REALM); + i->getSource()->TeleportTo(me->GetMap()->GetId(),i->getSource()->GetPositionX(),i->getSource()->GetPositionY(),DRAGON_REALM_Z+5,i->getSource()->GetOrientation()); + } + } + } + + void DoAction(const int32 param) + { + switch (param) + { + case DO_ENRAGE: + isEnraged = true; + me->CastSpell(me, SPELL_ENRAGE, true); + break; + case DO_BANISH: + isBanished = true; + me->CastSpell(me, SPELL_BANISH, true); + break; + } + } + + void UpdateAI(const uint32 diff) + { + if (!me->HasAura(AURA_SPECTRAL_INVISIBILITY)) + me->CastSpell(me, AURA_SPECTRAL_INVISIBILITY, true); + if (!UpdateVictim()) + return; + + if (CheckTimer <= diff) + { + Creature *Kalec = Unit::GetCreature(*me, KalecGUID); + if (!Kalec || (Kalec && !Kalec->isAlive())) + { + if (Creature *Kalecgos = Unit::GetCreature(*me, KalecgosGUID)) + Kalecgos->AI()->EnterEvadeMode(); + return; + } + if (HealthBelowPct(10) && !isEnraged) + { + if (Creature* Kalecgos = Unit::GetCreature(*me, KalecgosGUID)) + Kalecgos->AI()->DoAction(DO_ENRAGE); + DoAction(DO_ENRAGE); + } + Creature *Kalecgos = Unit::GetCreature(*me, KalecgosGUID); + if (Kalecgos) + { + if (!Kalecgos->isInCombat()) + { + me->AI()->EnterEvadeMode(); + return; + } + } + if (!isBanished && HealthBelowPct(1)) + { + if (Kalecgos) + { + if (Kalecgos->HasAura(SPELL_BANISH)) + { + me->DealDamage(me, me->GetHealth()); + return; + } + else + DoAction(DO_BANISH); + } + else + { + me->MonsterTextEmote(EMOTE_UNABLE_TO_FIND, NULL); + EnterEvadeMode(); + return; + } + } + CheckTimer = 1000; + } else CheckTimer -= diff; + + if (ResetThreat <= diff) + { + for (std::list::const_iterator itr = me->getThreatManager().getThreatList().begin(); itr != me->getThreatManager().getThreatList().end(); ++itr) + { + if (Unit* pUnit = Unit::GetUnit(*me, (*itr)->getUnitGuid())) + { + if (pUnit->GetPositionZ() > me->GetPositionZ()+5) + { + me->getThreatManager().modifyThreatPercent(pUnit,-100); + } + } + } + ResetThreat = 1000; + } else ResetThreat -= diff; + + if (ShadowBoltTimer <= diff) + { + if (!(rand()%5))DoScriptText(SAY_SATH_SPELL1, me); + DoCast(me, SPELL_SHADOW_BOLT); + ShadowBoltTimer = 7000+(rand()%3000); + } else ShadowBoltTimer -= diff; + + if (AgonyCurseTimer <= diff) + { + Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (!pTarget) pTarget = me->getVictim(); + DoCast(pTarget, SPELL_AGONY_CURSE); + AgonyCurseTimer = 20000; + } else AgonyCurseTimer -= diff; + + if (CorruptionStrikeTimer <= diff) + { + if (!(rand()%5))DoScriptText(SAY_SATH_SPELL2, me); + DoCast(me->getVictim(), SPELL_CORRUPTION_STRIKE); + CorruptionStrikeTimer = 13000; + } else CorruptionStrikeTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct boss_kalecAI : public ScriptedAI +{ + ScriptedInstance *pInstance; + + uint32 RevitalizeTimer; + uint32 HeroicStrikeTimer; + uint32 YellTimer; + uint32 YellSequence; + + uint64 SathGUID; + + bool isEnraged; // if demon is enraged + + boss_kalecAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + void Reset() + { + if (pInstance) + SathGUID = pInstance->GetData64(DATA_SATHROVARR); + + RevitalizeTimer = 5000; + HeroicStrikeTimer = 3000; + YellTimer = 5000; + YellSequence = 0; + + isEnraged = false; + } + + void DamageTaken(Unit *done_by, uint32 &damage) + { + if (done_by->GetGUID() != SathGUID) + damage = 0; + else if (isEnraged) + damage *= 3; + } + + void UpdateAI(const uint32 diff) + { + if (!me->HasAura(AURA_SPECTRAL_INVISIBILITY)) + me->CastSpell(me, AURA_SPECTRAL_INVISIBILITY, true); + if (!UpdateVictim()) + return; + + if (YellTimer <= diff) + { + switch(YellSequence) + { + case 0: + DoScriptText(SAY_GOOD_AGGRO, me); + ++YellSequence; + break; + case 1: + if (HealthBelowPct(50)) + { + DoScriptText(SAY_GOOD_NEAR_DEATH, me); + ++YellSequence; + } + break; + case 2: + if (HealthBelowPct(10)) + { + DoScriptText(SAY_GOOD_NEAR_DEATH2, me); + ++YellSequence; + } + break; + default: + break; + } + YellTimer = 5000; + } + + if (RevitalizeTimer <= diff) + { + DoCast(me, SPELL_REVITALIZE); + RevitalizeTimer = 5000; + } else RevitalizeTimer -= diff; + + if (HeroicStrikeTimer <= diff) + { + DoCast(me->getVictim(), SPELL_HEROIC_STRIKE); + HeroicStrikeTimer = 2000; + } else HeroicStrikeTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +bool GOkalecgos_teleporter(Player* pPlayer, GameObject* pGo) +{ + uint32 SpectralPlayers = 0; + Map* pMap = pGo->GetMap(); + if (!pMap->IsDungeon()) return true; + Map::PlayerList const &PlayerList = pMap->GetPlayers(); + for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) + { + if (i->getSource() && i->getSource()->GetPositionZ() < DEMON_REALM_Z + 5) + ++SpectralPlayers; + } + if (pPlayer->HasAura(AURA_SPECTRAL_EXHAUSTION) || (MAX_PLAYERS_IN_SPECTRAL_REALM && SpectralPlayers >= MAX_PLAYERS_IN_SPECTRAL_REALM)) + pPlayer->GetSession()->SendNotification(GO_FAILED); + else + pPlayer->CastSpell(pPlayer, SPELL_TELEPORT_SPECTRAL, true); + return true; +} + +CreatureAI* GetAI_boss_kalecgos(Creature* pCreature) +{ + return new boss_kalecgosAI (pCreature); +} + +CreatureAI* GetAI_boss_Sathrovarr(Creature* pCreature) +{ + return new boss_sathrovarrAI (pCreature); +} + +CreatureAI* GetAI_boss_kalec(Creature* pCreature) +{ + return new boss_kalecAI (pCreature); +} + +void AddSC_boss_kalecgos() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_kalecgos"; + newscript->GetAI = &GetAI_boss_kalecgos; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_sathrovarr"; + newscript->GetAI = &GetAI_boss_Sathrovarr; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_kalec"; + newscript->GetAI = &GetAI_boss_kalec; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "kalecgos_teleporter"; + newscript->pGOHello = &GOkalecgos_teleporter; + newscript->RegisterSelf(); +} diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp new file mode 100644 index 00000000000..f1c3a769b28 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp @@ -0,0 +1,1408 @@ +/* Copyright (C) 2009 Trinity + * 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_Kiljaeden +SD%Complete: 80 +SDComment: Sinister Reflection Model, Armageddon Visual, SAY_KJ_SHADOWSPIKE3, Emote, End Sequence +SDCategory: Sunwell_Plateau +EndScriptData */ + +//TODO rewrite Armageddon + +#include "ScriptedPch.h" +#include "sunwell_plateau.h" +#include + +/*** Speech and sounds***/ +enum Yells +{ + // These are used throughout Sunwell and Magisters(?). Players can hear this while running through the instances. + SAY_KJ_OFFCOMBAT1 = -1580066, + SAY_KJ_OFFCOMBAT2 = -1580067, + SAY_KJ_OFFCOMBAT3 = -1580068, + SAY_KJ_OFFCOMBAT4 = -1580069, + SAY_KJ_OFFCOMBAT5 = -1580070, + + // Encounter speech and sounds + SAY_KJ_EMERGE = -1580071, + SAY_KJ_SLAY1 = -1580072, + SAY_KJ_SLAY2 = -1580073, + SAY_KJ_REFLECTION1 = -1580074, + SAY_KJ_REFLECTION2 = -1580075, + SAY_KJ_DARKNESS1 = -1580076, + SAY_KJ_DARKNESS2 = -1580077, + SAY_KJ_DARKNESS3 = -1580078, + SAY_KJ_PHASE3 = -1580079, + SAY_KJ_PHASE4 = -1580080, + SAY_KJ_PHASE5 = -1580081, + SAY_KJ_DEATH = -1580093, + EMOTE_KJ_DARKNESS = -1580094, + + /*** Kalecgos - Anveena speech at the beginning of Phase 5; Anveena's sacrifice ***/ + SAY_KALECGOS_AWAKEN = -1580082, + SAY_ANVEENA_IMPRISONED = -1580083, + SAY_KALECGOS_LETGO = -1580084, + SAY_ANVEENA_LOST = -1580085, + SAY_KALECGOS_FOCUS = -1580086, + SAY_ANVEENA_KALEC = -1580087, + SAY_KALECGOS_FATE = -1580088, + SAY_ANVEENA_GOODBYE = -1580089, + SAY_KALECGOS_GOODBYE = -1580090, + SAY_KALECGOS_ENCOURAGE = -1580091, + + /*** Kalecgos says throughout the fight ***/ + SAY_KALECGOS_JOIN = -1580092, + SAY_KALEC_ORB_READY1 = -1580095, + SAY_KALEC_ORB_READY2 = -1580096, + SAY_KALEC_ORB_READY3 = -1580097, + SAY_KALEC_ORB_READY4 = -1580098 +}; + +/*** Spells used during the encounter ***/ +enum Spells +{ + /* Hand of the Deceiver's spells and cosmetics */ + SPELL_SHADOW_BOLT_VOLLEY = 45770, // ~30 yard range Shadow Bolt Volley for ~2k(?) damage + SPELL_SHADOW_INFUSION = 45772, // They gain this at 20% - Immunity to Stun/Silence and makes them look angry! + SPELL_FELFIRE_PORTAL = 46875, // Creates a portal that spawns Felfire Fiends (LIVE FOR THE SWARM!1 FOR THE OVERMIND!) + SPELL_SHADOW_CHANNELING = 46757, // Channeling animation out of combat + + /* Volatile Felfire Fiend's spells */ + SPELL_FELFIRE_FISSION = 45779, // Felfire Fiends explode when they die or get close to target. + + /* Kil'Jaeden's spells and cosmetics */ + SPELL_TRANS = 23188, // Surprisingly, this seems to be the right spell.. (Where is it used?) + SPELL_REBIRTH = 44200, // Emerge from the Sunwell + SPELL_SOUL_FLAY = 45442, // 9k Shadow damage over 3 seconds. Spammed throughout all the fight. + SPELL_SOUL_FLAY_SLOW = 47106, + SPELL_LEGION_LIGHTNING = 45664, // Chain Lightning, 4 targets, ~3k Shadow damage, 1.5k mana burn + SPELL_FIRE_BLOOM = 45641, // Places a debuff on 5 raid members, which causes them to deal 2k Fire damage to nearby allies and selves. MIGHT NOT WORK + SPELL_DESTROY_ALL_DRAKES = 46707, // when he use it? + + SPELL_SINISTER_REFLECTION = 45785, // Summon shadow copies of 5 raid members that fight against KJ's enemies//dont work + // 45892 // right one for SPELL_SINISTER_REFLECTION but no EffectScriptEffect + SPELL_COPY_WEAPON = 41055, // } + SPELL_COPY_WEAPON2 = 41054, // } + SPELL_COPY_OFFHAND = 45206, // }- Spells used in Sinister Reflection creation + SPELL_COPY_OFFHAND_WEAPON = 45205, // } + + SPELL_SHADOW_SPIKE = 46680, // Bombard random raid members with Shadow Spikes (Very similar to Void Reaver orbs) + SPELL_FLAME_DART = 45737, // Bombards the raid with flames every 3(?) seconds + SPELL_DARKNESS_OF_A_THOUSAND_SOULS = 46605, // Begins a 8-second channeling, after which he will deal 50'000 damage to the raid + SPELL_DARKNESS_OF_A_THOUSAND_SOULS_DAMAGE = 45657, + + /* Armageddon spells wrong visual */ + SPELL_ARMAGEDDON_TRIGGER = 45909, // Meteor spell trigger missile should cast Creature on himself + SPELL_ARMAGEDDON_VISUAL = 45911, // Does the hellfire visual to indicate where the meteor missle lands + SPELL_ARMAGEDDON_VISUAL2 = 45914, // Does the light visual to indicate where the meteor missle lands + SPELL_ARMAGEDDON_VISUAL3 = 24207, // This shouldn't correct but same as seen on the movie + SPELL_ARMAGEDDON_SUMMON_TRIGGER = 45921, // Summons the triggers that cast the spells on himself need random target select + SPELL_ARMAGEDDON_DAMAGE = 45915, // This does the area damage + + /* Shield Orb Spells*/ + SPELL_SHADOW_BOLT = 45680, //45679 would be correct but triggers to often //TODO fix console error + + /* Anveena's spells and cosmetics (Or, generally, everything that has "Anveena" in name) */ + SPELL_ANVEENA_PRISON = 46367, // She hovers locked within a bubble + SPELL_ANVEENA_ENERGY_DRAIN = 46410, // Sunwell energy glow animation (Control mob uses this) + SPELL_SACRIFICE_OF_ANVEENA = 46474, // This is cast on Kil'Jaeden when Anveena sacrifices herself into the Sunwell + + /* Sinister Reflection Spells */ + SPELL_SR_CURSE_OF_AGONY = 46190, + SPELL_SR_SHADOW_BOLT = 47076, + + SPELL_SR_EARTH_SHOCK = 47071, + + SPELL_SR_FIREBALL = 47074, + + SPELL_SR_HEMORRHAGE = 45897, + + SPELL_SR_HOLY_SHOCK = 38921, + SPELL_SR_HAMMER_OF_JUSTICE = 37369, + + SPELL_SR_HOLY_SMITE = 47077, + SPELL_SR_RENEW = 47079, + + SPELL_SR_SHOOT = 16496, + SPELL_SR_MULTI_SHOT = 48098, + SPELL_SR_WING_CLIP = 40652, + + SPELL_SR_WHIRLWIND = 17207, + + SPELL_SR_MOONFIRE = 47072, + //SPELL_SR_PLAGU STRIKE = 58843, Dk Spell! + + /*** Other Spells (used by players, etc) ***/ + SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT = 45839, // Possess the blue dragon from the orb to help the raid. + SPELL_ENTROPIUS_BODY = 46819, // Visual for Entropius at the Epilogue + SPELL_RING_OF_BLUE_FLAMES = 45825 //Cast this spell when the go is activated +}; + +/*** Error messages ***/ +#define ERROR_KJ_NOT_SUMMONED "TSCR ERROR: Unable to summon Kil'Jaeden for some reason" + +/*** Others ***/ +#define FLOOR_Z 28.050388 +#define SHIELD_ORB_Z 45.000 + +enum Phase +{ + PHASE_DECEIVERS = 1, // Fight 3 adds + PHASE_NORMAL = 2, // Kil'Jaeden emerges from the sunwell + PHASE_DARKNESS = 3, // At 85%, he gains few abilities; Kalecgos joins the fight + PHASE_ARMAGEDDON = 4, // At 55%, he gains even more abilities + PHASE_SACRIFICE = 5, // At 25%, Anveena sacrifices herself into the Sunwell; at this point he becomes enraged and has *significally* shorter cooldowns. +}; + +//Timers +enum KilJaedenTimers +{ + TIMER_SPEECH = 0, + + //Phase 2 Timer + TIMER_SOUL_FLAY = 1, + TIMER_LEGION_LIGHTNING = 2, + TIMER_FIRE_BLOOM = 3, + TIMER_SUMMON_SHILEDORB = 4, + + //Phase 3 Timer + TIMER_SHADOW_SPIKE = 5, + TIMER_FLAME_DART = 6, + TIMER_DARKNESS = 7, + TIMER_ORBS_EMPOWER = 8, + + //Phase 4 Timer + TIMER_ARMAGEDDON = 9 +}; + +// Locations of the Hand of Deceiver adds +Position DeceiverLocations[3]= +{ + {1682.045, 631.299, 5.936}, + {1684.099, 618.848, 0.589}, + {1694.170, 612.272, 1.416}, +}; + +// Locations, where Shield Orbs will spawn +float ShieldOrbLocations[4][2]= +{ + {1698.900, 627.870}, // middle pont of Sunwell + {12, 3.14}, // First one spawns northeast of KJ + {12, 3.14/0.7}, // Second one spawns southeast + {12, 3.14*3.8} // Third one spawns (?) +}; + +struct Speech +{ + int32 textid; + uint32 pCreature, timer; +}; + +// Timers +static Speech Speeches[]= +{ + //Kil Phase 1 -> Phase 2 + {SAY_KJ_EMERGE, DATA_KILJAEDEN, 0}, + {SAY_KALECGOS_JOIN, DATA_KALECGOS_KJ, 26000}, + //Kil Phase 2 -> Phase 3 + {SAY_KALECGOS_AWAKEN, DATA_KALECGOS_KJ, 10000}, + {SAY_ANVEENA_IMPRISONED, DATA_ANVEENA, 5000}, + {SAY_KJ_PHASE3, DATA_KILJAEDEN, 5000}, + //Kil Phase 3 -> Phase 4 + {SAY_KALECGOS_LETGO, DATA_KALECGOS_KJ, 10000}, + {SAY_ANVEENA_LOST, DATA_ANVEENA, 8000}, + {SAY_KJ_PHASE4, DATA_KILJAEDEN, 7000}, + //Kil Phase 4 -> Phase 5 + {SAY_KALECGOS_FOCUS, DATA_KALECGOS_KJ, 4000}, + {SAY_ANVEENA_KALEC, DATA_ANVEENA, 11000}, + {SAY_KALECGOS_FATE, DATA_KALECGOS_KJ, 2000}, + {SAY_ANVEENA_GOODBYE, DATA_ANVEENA, 6000}, + {SAY_KJ_PHASE5, DATA_KILJAEDEN, 5500}, + + // use in End sequence? + {SAY_KALECGOS_GOODBYE, DATA_KALECGOS_KJ, 12000}, +}; + +//AI for Kalecgos +struct boss_kalecgos_kjAI : public ScriptedAI +{ + boss_kalecgos_kjAI(Creature* c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + uint8 OrbsEmpowered; + uint8 EmpowerCount; + + void Reset() + { + OrbsEmpowered = 0; + EmpowerCount = 0; + me->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_LEVITATING); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->setActive(true); + + for (uint8 i = 0; i < 4; ++i) + if (GameObject* pOrb = GetOrb(i)) + pOrb->SetGoType(GAMEOBJECT_TYPE_BUTTON); + } + + GameObject* GetOrb(int32 index) + { + if (!pInstance) + return NULL; + + switch(index) + { + case 0: + return pInstance->instance->GetGameObject(pInstance->GetData64(DATA_ORB_OF_THE_BLUE_DRAGONFLIGHT_1)); + case 1: + return pInstance->instance->GetGameObject(pInstance->GetData64(DATA_ORB_OF_THE_BLUE_DRAGONFLIGHT_2)); + case 2: + return pInstance->instance->GetGameObject(pInstance->GetData64(DATA_ORB_OF_THE_BLUE_DRAGONFLIGHT_3)); + case 3: + return pInstance->instance->GetGameObject(pInstance->GetData64(DATA_ORB_OF_THE_BLUE_DRAGONFLIGHT_4)); + } + + return NULL; + } + + void ResetOrbs() + { + me->RemoveDynObject(SPELL_RING_OF_BLUE_FLAMES); + for (uint8 i = 0; i < 4; ++i) + if (GameObject* pOrb = GetOrb(i)) + pOrb->SetUInt32Value(GAMEOBJECT_FACTION, 0); + } + + void EmpowerOrb(bool all) + { + GameObject* pOrbEmpowered = GetOrb(OrbsEmpowered); + if (!pOrbEmpowered) + return; + + if (all) + { + me->RemoveDynObject(SPELL_RING_OF_BLUE_FLAMES); + for (uint8 i = 0; i < 4; ++i) + { + if (GameObject* pOrb = GetOrb(i)) + { + pOrb->CastSpell(me, SPELL_RING_OF_BLUE_FLAMES); + pOrb->SetUInt32Value(GAMEOBJECT_FACTION, 35); + pOrb->setActive(true); + pOrb->Refresh(); + } + } + DoScriptText(SAY_KALECGOS_ENCOURAGE, me); + } + else + { + if (GameObject* pOrb = GetOrb(urand(0,3))) + { + pOrb->CastSpell(me, SPELL_RING_OF_BLUE_FLAMES); + pOrb->SetUInt32Value(GAMEOBJECT_FACTION, 35); + pOrb->setActive(true); + pOrb->Refresh(); + + OrbsEmpowered = (OrbsEmpowered+1)%4; + + ++EmpowerCount; + switch(EmpowerCount) + { + case 1: DoScriptText(SAY_KALEC_ORB_READY1, me); break; + case 2: DoScriptText(SAY_KALEC_ORB_READY2, me); break; + case 3: DoScriptText(SAY_KALEC_ORB_READY3, me); break; + case 4: DoScriptText(SAY_KALEC_ORB_READY4, me); break; + } + } + } + } + + void UpdateAI(const uint32 diff) + { + } + + void SetRingOfBlueFlames() + { + me->RemoveDynObject(SPELL_RING_OF_BLUE_FLAMES); + for (uint8 i = 0; i < 4; ++i) + { + if (GameObject* pOrb = GetOrb(i)) + { + if (pOrb->GetUInt32Value(GAMEOBJECT_FACTION) == 35) + { + pOrb->CastSpell(me, SPELL_RING_OF_BLUE_FLAMES); + pOrb->setActive(true); + pOrb->Refresh(); + } + } + } + } +}; + +CreatureAI* GetAI_boss_kalecgos_kj(Creature* pCreature) +{ + return new boss_kalecgos_kjAI (pCreature); +} + +bool GOHello_go_orb_of_the_blue_flight(Player* pPlayer, GameObject* pGo) +{ + if (pGo->GetUInt32Value(GAMEOBJECT_FACTION) == 35) + { + ScriptedInstance* pInstance = pGo->GetInstanceData(); + pPlayer->SummonCreature(CREATURE_POWER_OF_THE_BLUE_DRAGONFLIGHT, pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN, 121000); + pPlayer->CastSpell(pPlayer, SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT, false); + pGo->SetUInt32Value(GAMEOBJECT_FACTION, 0); + + if (Creature* pKalec = Unit::GetCreature(*pPlayer, pInstance->GetData64(DATA_KALECGOS_KJ))) + CAST_AI(boss_kalecgos_kjAI, pKalec->AI())->SetRingOfBlueFlames(); + + pGo->Refresh(); + } + return true; +} + +//AI for Kil'jaeden Event Controller +struct mob_kiljaeden_controllerAI : public Scripted_NoMovementAI +{ + mob_kiljaeden_controllerAI(Creature* c) : Scripted_NoMovementAI(c), summons(me) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + SummonList summons; + + bool bSummonedDeceivers; + bool bKiljaedenDeath; + + uint32 uiRandomSayTimer; + uint32 phase; + uint8 deceiverDeathCount; + + void InitializeAI() + { + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + me->addUnitState(UNIT_STAT_STUNNED); + + ScriptedAI::InitializeAI(); + } + + void Reset() + { + phase = PHASE_DECEIVERS; + + if (Creature* pKalecKJ = Unit::GetCreature((*me), pInstance->GetData64(DATA_KALECGOS_KJ))) + CAST_AI(boss_kalecgos_kjAI, pKalecKJ->AI())->ResetOrbs(); + deceiverDeathCount = 0; + bSummonedDeceivers = false; + bKiljaedenDeath = false; + uiRandomSayTimer = 30000; + summons.DespawnAll(); + } + + void JustSummoned(Creature* summoned) + { + switch(summoned->GetEntry()) + { + case CREATURE_HAND_OF_THE_DECEIVER: + summoned->CastSpell(summoned, SPELL_SHADOW_CHANNELING, false); + break; + case CREATURE_ANVEENA: + summoned->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_LEVITATING); + summoned->CastSpell(summoned, SPELL_ANVEENA_PRISON, true); + summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + break; + case CREATURE_KILJAEDEN: + summoned->CastSpell(summoned, SPELL_REBIRTH, false); + summoned->AddThreat(me->getVictim(), 1.0f); + break; + } + summons.Summon(summoned); + } + + void UpdateAI(const uint32 diff) + { + if (uiRandomSayTimer < diff) + { + if (pInstance && pInstance->GetData(DATA_MURU_EVENT) != DONE && pInstance->GetData(DATA_KILJAEDEN_EVENT) == NOT_STARTED) + DoScriptText(RAND(SAY_KJ_OFFCOMBAT1,SAY_KJ_OFFCOMBAT2,SAY_KJ_OFFCOMBAT3,SAY_KJ_OFFCOMBAT4,SAY_KJ_OFFCOMBAT5), me); + uiRandomSayTimer = 30000; + } else uiRandomSayTimer -= diff; + + if (!bSummonedDeceivers) + { + for (uint8 i = 0; i < 3; ++i) + me->SummonCreature(CREATURE_HAND_OF_THE_DECEIVER, DeceiverLocations[i], TEMPSUMMON_DEAD_DESPAWN, 0); + + DoSpawnCreature(CREATURE_ANVEENA, 0, 0, 40, 0, TEMPSUMMON_DEAD_DESPAWN, 0); + DoCast(me, SPELL_ANVEENA_ENERGY_DRAIN); + bSummonedDeceivers = true; + } + + if (deceiverDeathCount > 2 && phase == PHASE_DECEIVERS) + { + me->RemoveAurasDueToSpell(SPELL_ANVEENA_ENERGY_DRAIN); + phase = PHASE_NORMAL; + DoSpawnCreature(CREATURE_KILJAEDEN, 0, 0,0, 0, TEMPSUMMON_MANUAL_DESPAWN, 0); + } + } +}; + +CreatureAI* GetAI_mob_kiljaeden_controller(Creature* pCreature) +{ + return new mob_kiljaeden_controllerAI (pCreature); +} + +//AI for Kil'jaeden +struct boss_kiljaedenAI : public Scripted_NoMovementAI +{ + boss_kiljaedenAI(Creature* c) : Scripted_NoMovementAI(c), summons(me) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + SummonList summons; + + uint8 Phase; + uint8 ActiveTimers; + uint32 SpeechTimer; + + uint32 Timer[10]; + uint32 WaitTimer; + uint8 speechCount; + uint8 speechPhaseEnd; + + /* Boolean */ + bool IsInDarkness; + bool TimerIsDeactivated[10]; + bool IsWaiting; + bool OrbActivated; + bool SpeechBegins; + + void InitializeAI() + { + Scripted_NoMovementAI::InitializeAI(); + } + + void Reset() + { + TimerIsDeactivated[TIMER_SPEECH] = false; + Timer[TIMER_SPEECH] = 0; + + //Phase 2 Timer + Timer[TIMER_SOUL_FLAY] = 11000; + Timer[TIMER_LEGION_LIGHTNING] = 30000; + Timer[TIMER_FIRE_BLOOM] = 20000; + Timer[TIMER_SUMMON_SHILEDORB] = 35000; + + //Phase 3 Timer + Timer[TIMER_SHADOW_SPIKE] = 4000; + Timer[TIMER_FLAME_DART] = 3000; + Timer[TIMER_DARKNESS] = 45000; + Timer[TIMER_ORBS_EMPOWER] = 35000; + + //Phase 4 Timer + Timer[TIMER_ARMAGEDDON] = 2000; + + ActiveTimers = 5; + WaitTimer = 0; + speechCount = 0; + SpeechTimer = 0; + + Phase = PHASE_NORMAL; + + IsInDarkness = false; + IsWaiting = false; + OrbActivated = false; + SpeechBegins = true; + + if (pInstance) + { + if (Creature* pKalec = Unit::GetCreature(*me, pInstance->GetData64(DATA_KALECGOS_KJ))) + pKalec->RemoveDynObject(SPELL_RING_OF_BLUE_FLAMES); + } + me->SetFloatValue(UNIT_FIELD_COMBATREACH, 12); + ChangeTimers(false, 0); + summons.DespawnAll(); + } + + void ChangeTimers(bool status, uint32 WTimer) + { + for (uint8 i = 1; i < ActiveTimers; ++i) + TimerIsDeactivated[i] = status; + + if (WTimer > 0) + { + IsWaiting = true; + WaitTimer = WTimer; + } + + if (OrbActivated) + TimerIsDeactivated[TIMER_ORBS_EMPOWER] = true; + if (Timer[TIMER_SHADOW_SPIKE] == 0) + TimerIsDeactivated[TIMER_SHADOW_SPIKE] = true; + if (Phase == PHASE_SACRIFICE) + TimerIsDeactivated[TIMER_SUMMON_SHILEDORB] = true; + } + + void JustSummoned(Creature* summoned) + { + if (summoned->GetEntry() == CREATURE_ARMAGEDDON_TARGET) + { + summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + // summoned->SetVisibility(VISIBILITY_OFF); //with this we cant see the armageddon visuals + } + else + summoned->SetLevel(me->getLevel()); + + summoned->setFaction(me->getFaction()); + summons.Summon(summoned); + } + + void JustDied(Unit* killer) + { + DoScriptText(SAY_KJ_DEATH, me); + summons.DespawnAll(); + + if (pInstance) + pInstance->SetData(DATA_KILJAEDEN_EVENT, DONE); + } + + void KilledUnit(Unit* victim) + { + DoScriptText(RAND(SAY_KJ_SLAY1,SAY_KJ_SLAY2), me); + } + + void EnterEvadeMode() + { + Scripted_NoMovementAI::EnterEvadeMode(); + summons.DespawnAll(); + + // Reset the controller + if (pInstance) + { + if (Creature* pControl = Unit::GetCreature(*me, pInstance->GetData64(DATA_KILJAEDEN_CONTROLLER))) + CAST_AI(mob_kiljaeden_controllerAI, pControl->AI())->Reset(); + } + } + + void EnterCombat(Unit* who) + { + DoZoneInCombat(); + } + + void EnterNextPhase() + { + SpeechBegins = true; + OrbActivated = false; + ChangeTimers(true, 0);//stop every cast Shadow spike will reactivate em all + TimerIsDeactivated[TIMER_SHADOW_SPIKE] = false; + Timer[TIMER_SHADOW_SPIKE] = 100; + // empowered orbs before darkness + Timer[TIMER_DARKNESS] = (Phase == PHASE_SACRIFICE) ? 15000 : urand(10000,40000); + Timer[TIMER_ORBS_EMPOWER] = (Phase == PHASE_SACRIFICE) ? 10000 : 5000; + } + + void CastSinisterReflection() + { + DoScriptText(RAND(SAY_KJ_REFLECTION1,SAY_KJ_REFLECTION2), me); + for (uint8 i = 0; i < 4; ++i) + { + float x,y,z; + Unit *pTarget; + for (uint8 z = 0; z < 6; ++z) + { + pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); + if (!pTarget->HasAura(SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT,0))break; + } + if (pTarget) + { + pTarget->GetPosition(x,y,z); + if (Creature* pSinisterReflection = me->SummonCreature(CREATURE_SINISTER_REFLECTION, x,y,z,0, TEMPSUMMON_CORPSE_DESPAWN, 0)) + { + pSinisterReflection->SetDisplayId(pTarget->GetDisplayId()); + pSinisterReflection->AI()->AttackStart(pTarget); + } + } + } + } + + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim() || Phase < PHASE_NORMAL) + return; + + if (IsWaiting) + { + if (WaitTimer <= diff) + { + IsWaiting = false; + ChangeTimers(false, 0); + } else WaitTimer -= diff; + } + + for (uint8 t = 0; t < ActiveTimers; ++t) + { + if (Timer[t] < diff && !TimerIsDeactivated[t]) + { + switch(t) + { + case TIMER_SPEECH: + if (SpeechBegins) + { + SpeechBegins=false; + switch(Phase) + { + case PHASE_NORMAL: + speechPhaseEnd=1; + break; + case PHASE_DARKNESS: + speechPhaseEnd=4; + break; + case PHASE_ARMAGEDDON: + speechPhaseEnd=7; + break; + case PHASE_SACRIFICE: + speechPhaseEnd=12; + break; + } + } + if (Speeches[speechCount].timer < SpeechTimer) + { + SpeechTimer = 0; + if (Creature* pSpeechCreature = Unit::GetCreature(*me, pInstance->GetData64(Speeches[speechCount].pCreature))) + DoScriptText(Speeches[speechCount].textid, pSpeechCreature); + if (speechCount == 12) + if (Creature* pAnveena = Unit::GetCreature(*me, pInstance->GetData64(DATA_ANVEENA))) + pAnveena->CastSpell(me, SPELL_SACRIFICE_OF_ANVEENA, false); + // ChangeTimers(true, 10000); // Kil should do an emote while screaming without attacking for 10 seconds + if (speechCount == speechPhaseEnd) + TimerIsDeactivated[TIMER_SPEECH]=true; + speechCount++; + } + SpeechTimer += diff; + break; + case TIMER_SOUL_FLAY: + if (!me->IsNonMeleeSpellCasted(false)) + { + DoCast(me->getVictim(), SPELL_SOUL_FLAY_SLOW, false); + DoCast(me->getVictim(), SPELL_SOUL_FLAY, false); + Timer[TIMER_SOUL_FLAY] = 3500; + } + break; + case TIMER_LEGION_LIGHTNING: + if (!me->IsNonMeleeSpellCasted(false)) + { + Unit* pRandomPlayer; + + me->RemoveAurasDueToSpell(SPELL_SOUL_FLAY); + for (uint8 z = 0; z < 6; ++z) + { + pRandomPlayer = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); + if (!pRandomPlayer->HasAura(SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT,0)) + break; + } + + if (pRandomPlayer) + DoCast(pRandomPlayer, SPELL_LEGION_LIGHTNING, false); + else + error_log("try to cast SPELL_LEGION_LIGHTNING on invalid target"); + + Timer[TIMER_LEGION_LIGHTNING] = (Phase == PHASE_SACRIFICE) ? 18000 : 30000; // 18 seconds in PHASE_SACRIFICE + Timer[TIMER_SOUL_FLAY] = 2500; + } + break; + case TIMER_FIRE_BLOOM: + if (!me->IsNonMeleeSpellCasted(false)) + { + me->RemoveAurasDueToSpell(SPELL_SOUL_FLAY); + DoCastAOE(SPELL_FIRE_BLOOM, false); + Timer[TIMER_FIRE_BLOOM] = (Phase == PHASE_SACRIFICE) ? 25000 : 40000; // 25 seconds in PHASE_SACRIFICE + Timer[TIMER_SOUL_FLAY] = 1000; + } + break; + case TIMER_SUMMON_SHILEDORB: + for (uint8 i = 1; i < Phase; ++i) + { + float sx, sy; + sx = ShieldOrbLocations[0][0] + sin(ShieldOrbLocations[i][0]); + sy = ShieldOrbLocations[0][1] + sin(ShieldOrbLocations[i][1]); + me->SummonCreature(CREATURE_SHIELD_ORB, sx, sy, SHIELD_ORB_Z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000); + } + Timer[TIMER_SUMMON_SHILEDORB] = urand(30000,60000); // 30-60seconds cooldown + Timer[TIMER_SOUL_FLAY] = 2000; + break; + case TIMER_SHADOW_SPIKE: //Phase 3 + if (!me->IsNonMeleeSpellCasted(false)) + { + CastSinisterReflection(); + DoCastAOE(SPELL_SHADOW_SPIKE, false); + ChangeTimers(true, 30000); + Timer[TIMER_SHADOW_SPIKE] = 0; + TimerIsDeactivated[TIMER_SPEECH] = false; + } + break; + case TIMER_FLAME_DART: //Phase 3 + DoCastAOE(SPELL_FLAME_DART, false); + Timer[TIMER_FLAME_DART] = 3000; //TODO Timer + break; + case TIMER_DARKNESS: //Phase 3 + if (!me->IsNonMeleeSpellCasted(false)) + { + // Begins to channel for 8 seconds, then deals 50'000 damage to all raid members. + if (!IsInDarkness) + { + DoScriptText(EMOTE_KJ_DARKNESS, me); + DoCastAOE(SPELL_DARKNESS_OF_A_THOUSAND_SOULS, false); + ChangeTimers(true, 9000); + Timer[TIMER_DARKNESS] = 8750; + TimerIsDeactivated[TIMER_DARKNESS] = false; + if (Phase == PHASE_SACRIFICE) + TimerIsDeactivated[TIMER_ARMAGEDDON] = false; + IsInDarkness = true; + } + else + { + Timer[TIMER_DARKNESS] = (Phase == PHASE_SACRIFICE) ? 15000 : urand(40000,70000); + IsInDarkness = false; + DoCastAOE(SPELL_DARKNESS_OF_A_THOUSAND_SOULS_DAMAGE); + DoScriptText(RAND(SAY_KJ_DARKNESS1,SAY_KJ_DARKNESS2,SAY_KJ_DARKNESS3), me); + } + Timer[TIMER_SOUL_FLAY] = 9000; + } + break; + case TIMER_ORBS_EMPOWER: //Phase 3 + if (Creature* pKalec = Unit::GetCreature(*me, pInstance->GetData64(DATA_KALECGOS_KJ))) + { + switch (Phase) + { + case PHASE_SACRIFICE: + CAST_AI(boss_kalecgos_kjAI, pKalec->AI())->EmpowerOrb(true); + break; + default: + CAST_AI(boss_kalecgos_kjAI, pKalec->AI())->EmpowerOrb(false); + break; + } + } + OrbActivated = true; + TimerIsDeactivated[TIMER_ORBS_EMPOWER] = true; + break; + case TIMER_ARMAGEDDON: //Phase 4 + Unit *pTarget; + for (uint8 z = 0; z < 6; ++z) + { + pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); + if (!pTarget->HasAura(SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT,0)) break; + } + if (pTarget) + { + float x, y, z; + pTarget->GetPosition(x, y, z); + me->SummonCreature(CREATURE_ARMAGEDDON_TARGET, x,y,z,0, TEMPSUMMON_TIMED_DESPAWN,15000); + } + Timer[TIMER_ARMAGEDDON] = 2000; // No, I'm not kidding + break; + } + } + } + DoMeleeAttackIfReady(); + //Time runs over! + for (uint8 i = 0; i < ActiveTimers; ++i) + if (!TimerIsDeactivated[i]) + { + Timer[i] -= diff; + if (((int32)Timer[i]) < 0) Timer[i] = 0; + } + + //Phase 3 + if (Phase <= PHASE_NORMAL && !IsInDarkness) + { + if (Phase == PHASE_NORMAL && HealthBelowPct(85)) + { + Phase = PHASE_DARKNESS; + ActiveTimers = 9; + EnterNextPhase(); + } + else return; + } + + //Phase 4 + if (Phase <= PHASE_DARKNESS && !IsInDarkness) + { + if (Phase == PHASE_DARKNESS && HealthBelowPct(55)) + { + Phase = PHASE_ARMAGEDDON; + ActiveTimers = 10; + EnterNextPhase(); + } + else return; + } + + //Phase 5 specific spells all we can + if (Phase <= PHASE_ARMAGEDDON && !IsInDarkness) + { + if (Phase == PHASE_ARMAGEDDON && HealthBelowPct(25)) + { + Phase = PHASE_SACRIFICE; + EnterNextPhase(); + } + else return; + } + } +}; + +CreatureAI* GetAI_boss_kiljaeden(Creature* pCreature) +{ + return new boss_kiljaedenAI (pCreature); +} + +//AI for Hand of the Deceiver +struct mob_hand_of_the_deceiverAI : public ScriptedAI +{ + mob_hand_of_the_deceiverAI(Creature* c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint32 ShadowBoltVolleyTimer; + uint32 FelfirePortalTimer; + + void Reset() + { + // TODO: Timers! + ShadowBoltVolleyTimer = urand(8000,14000); // So they don't all cast it in the same moment. + FelfirePortalTimer = 20000; + if (pInstance) + pInstance->SetData(DATA_KILJAEDEN_EVENT, NOT_STARTED); + } + + void JustSummoned(Creature* summoned) + { + summoned->setFaction(me->getFaction()); + summoned->SetLevel(me->getLevel()); + } + + void EnterCombat(Unit* who) + { + if (pInstance) + { + pInstance->SetData(DATA_KILJAEDEN_EVENT, IN_PROGRESS); + if (Creature* pControl = Unit::GetCreature(*me, pInstance->GetData64(DATA_KILJAEDEN_CONTROLLER))) + pControl->AddThreat(who, 1.0f); + } + me->InterruptNonMeleeSpells(true); + } + + void JustDied(Unit* killer) + { + if (!pInstance) + return; + + if (Creature* pControl = Unit::GetCreature(*me, pInstance->GetData64(DATA_KILJAEDEN_CONTROLLER))) + ++(CAST_AI(mob_kiljaeden_controllerAI, pControl->AI())->deceiverDeathCount); + } + + void UpdateAI(const uint32 diff) + { + if (!me->isInCombat()) + DoCast(me, SPELL_SHADOW_CHANNELING); + + if (!UpdateVictim()) + return; + + // Gain Shadow Infusion at 20% health + if (HealthBelowPct(20) && !me->HasAura(SPELL_SHADOW_INFUSION, 0)) + DoCast(me, SPELL_SHADOW_INFUSION, true); + + // Shadow Bolt Volley - Shoots Shadow Bolts at all enemies within 30 yards, for ~2k Shadow damage. + if (ShadowBoltVolleyTimer <= diff) + { + DoCast(me->getVictim(), SPELL_SHADOW_BOLT_VOLLEY); + ShadowBoltVolleyTimer = 12000; + } + else + ShadowBoltVolleyTimer -= diff; + + // Felfire Portal - Creatres a portal, that spawns Volatile Felfire Fiends, which do suicide bombing. + if (FelfirePortalTimer <= diff) + { + if (Creature* pPortal = DoSpawnCreature(CREATURE_FELFIRE_PORTAL, 0, 0,0, 0, TEMPSUMMON_TIMED_DESPAWN, 20000)) + { + std::list::iterator itr; + for (itr = me->getThreatManager().getThreatList().begin(); itr != me->getThreatManager().getThreatList().end(); ++itr) + { + Unit* pUnit = Unit::GetUnit(*me, (*itr)->getUnitGuid()); + if (pUnit) + pPortal->AddThreat(pUnit, 1.0f); + } + } + FelfirePortalTimer = 20000; + } else FelfirePortalTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_hand_of_the_deceiver(Creature* pCreature) +{ + return new mob_hand_of_the_deceiverAI (pCreature); +} + +//AI for Felfire Portal +struct mob_felfire_portalAI : public Scripted_NoMovementAI +{ + mob_felfire_portalAI(Creature* c) : Scripted_NoMovementAI(c) {} + + uint32 uiSpawnFiendTimer; + + void Reset() + { + uiSpawnFiendTimer = 5000; + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_NON_ATTACKABLE); + } + + void JustSummoned(Creature* summoned) + { + summoned->setFaction(me->getFaction()); + summoned->SetLevel(me->getLevel()); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (uiSpawnFiendTimer <= diff) + { + if (Creature* pFiend = DoSpawnCreature(CREATURE_VOLATILE_FELFIRE_FIEND, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 20000)) + pFiend->AddThreat(SelectUnit(SELECT_TARGET_RANDOM,0), 100000.0f); + uiSpawnFiendTimer = urand(4000,8000); + } else uiSpawnFiendTimer -= diff; + } +}; + +CreatureAI* GetAI_mob_felfire_portal(Creature* pCreature) +{ + return new mob_felfire_portalAI (pCreature); +} + +//AI for Felfire Fiend +struct mob_volatile_felfire_fiendAI : public ScriptedAI +{ + mob_volatile_felfire_fiendAI(Creature* c) : ScriptedAI(c) {} + + uint32 uiExplodeTimer; + + bool bLockedTarget; + + void Reset() + { + uiExplodeTimer = 2000; + bLockedTarget = false; + } + + void DamageTaken(Unit *done_by, uint32 &damage) + { + if (damage > me->GetHealth()) + DoCast(me, SPELL_FELFIRE_FISSION, true); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (!bLockedTarget) + { + me->AddThreat(me->getVictim(), 10000000.0f); + bLockedTarget = true; + } + + if (uiExplodeTimer) + { + if (uiExplodeTimer <= diff) + uiExplodeTimer = 0; + else uiExplodeTimer -= diff; + } + else if (me->IsWithinDistInMap(me->getVictim(), 3)) // Explode if it's close enough to it's target + { + DoCast(me->getVictim(), SPELL_FELFIRE_FISSION); + me->Kill(me); + } + } +}; + +CreatureAI* GetAI_mob_volatile_felfire_fiend(Creature* pCreature) +{ + return new mob_volatile_felfire_fiendAI (pCreature); +} + +//AI for Armageddon target +struct mob_armageddonAI : public Scripted_NoMovementAI +{ + mob_armageddonAI(Creature* c) : Scripted_NoMovementAI(c) {} + + uint8 spell; + uint32 uiTimer; + + void Reset() + { + spell = 0; + uiTimer = 0; + } + + void UpdateAI(const uint32 diff) + { + if (uiTimer <= diff) + { + switch(spell) + { + case 0: + DoCast(me, SPELL_ARMAGEDDON_VISUAL, true); + ++spell; + break; + case 1: + DoCast(me, SPELL_ARMAGEDDON_VISUAL2, true); + uiTimer = 9000; + ++spell; + break; + case 2: + DoCast(me, SPELL_ARMAGEDDON_TRIGGER, true); + ++spell; + uiTimer = 5000; + break; + case 3: + me->Kill(me); + me->RemoveCorpse(); + break; + } + } else uiTimer -=diff; + } +}; + +CreatureAI* GetAI_mob_armageddon(Creature* pCreature) +{ + return new mob_armageddonAI (pCreature); +} + +//AI for Shield Orbs +struct mob_shield_orbAI : public ScriptedAI +{ + mob_shield_orbAI(Creature* c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + bool bPointReached; + bool bClockwise; + uint32 uiTimer; + uint32 uiCheckTimer; + float x, y, r, c, mx, my; + + void Reset() + { + me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + bPointReached = true; + uiTimer = urand(500,1000); + uiCheckTimer = 1000; + r = 17; + c = 0; + mx = ShieldOrbLocations[0][0]; + my = ShieldOrbLocations[0][1]; + bClockwise = urand(0,1); + } + + void UpdateAI(const uint32 diff) + { + if (bPointReached) + { + if (bClockwise) + { + y = my - r * sin(c); + x = mx - r * cos(c); + } + else + { + y = my + r * sin(c); + x = mx + r * cos(c); + } + bPointReached = false; + uiCheckTimer = 1000; + me->GetMotionMaster()->MovePoint(1,x, y, SHIELD_ORB_Z); + c += M_PI/32; + if (c >= 2*M_PI) c = 0; + } + else + { + if (uiCheckTimer <= diff) + { + DoTeleportTo(x,y,SHIELD_ORB_Z); + bPointReached = true; + } + else uiCheckTimer -= diff; + } + + if (uiTimer <= diff) + { + if (Unit* random = Unit::GetUnit(*me, pInstance ? pInstance->GetData64(DATA_PLAYER_GUID) : 0)) + DoCast(random, SPELL_SHADOW_BOLT, false); + uiTimer = urand(500,1000); + } else uiTimer -= diff; + } + + void MovementInform(uint32 type, uint32 id) + { + if (type != POINT_MOTION_TYPE) + return; + + bPointReached = true; + } +}; + +CreatureAI* GetAI_mob_shield_orb(Creature* pCreature) +{ + return new mob_shield_orbAI (pCreature); +} + +//AI for Sinister Reflection +struct mob_sinster_reflectionAI : public ScriptedAI +{ + mob_sinster_reflectionAI(Creature* c) : ScriptedAI(c) {} + + uint8 victimClass; + uint32 uiTimer[3]; + + void Reset() + { + uiTimer[0] = 0; + uiTimer[1] = 0; + uiTimer[2] = 0; + victimClass = 0; + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if ((victimClass == 0) && me->getVictim()) + { + victimClass = me->getVictim()->getClass(); + switch (victimClass) + { + case CLASS_DRUID: + break; + case CLASS_HUNTER: + break; + case CLASS_MAGE: + break; + case CLASS_WARLOCK: + break; + case CLASS_WARRIOR: + me->SetCanDualWield(true); + break; + case CLASS_PALADIN: + break; + case CLASS_PRIEST: + break; + case CLASS_SHAMAN: + me->SetCanDualWield(true); + break; + case CLASS_ROGUE: + me->SetCanDualWield(true); + break; + } + } + + switch(victimClass) { + case CLASS_DRUID: + if (uiTimer[1] <= diff) + { + DoCast(me->getVictim(), SPELL_SR_MOONFIRE, false); + uiTimer[1] = urand(2000,4000); + } + DoMeleeAttackIfReady(); + break; + case CLASS_HUNTER: + if (uiTimer[1] <= diff) + { + DoCast(me->getVictim(), SPELL_SR_MULTI_SHOT, false); + uiTimer[1] = urand(8000,10000); + } + if (uiTimer[2] <= diff) + { + DoCast(me->getVictim(), SPELL_SR_SHOOT, false); + uiTimer[2] = urand(4000,6000); + } + if (me->IsWithinMeleeRange(me->getVictim(), 6)) + { + if (uiTimer[0] <= diff) + { + DoCast(me->getVictim(), SPELL_SR_MULTI_SHOT, false); + uiTimer[0] = urand(6000,8000); + } + DoMeleeAttackIfReady(); + } + break; + case CLASS_MAGE: + if (uiTimer[1] <= diff) + { + DoCast(me->getVictim(), SPELL_SR_FIREBALL, false); + uiTimer[1] = urand(2000,4000); + } + DoMeleeAttackIfReady(); + break; + case CLASS_WARLOCK: + if (uiTimer[1] <= diff) + { + DoCast(me->getVictim(), SPELL_SR_SHADOW_BOLT, false); + uiTimer[1] = urand(3000,5000); + } + if (uiTimer[2] <= diff) + { + DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true), SPELL_SR_CURSE_OF_AGONY, true); + uiTimer[2] = urand(2000,4000); + } + DoMeleeAttackIfReady(); + break; + case CLASS_WARRIOR: + if (uiTimer[1] <= diff) + { + DoCast(me->getVictim(), SPELL_SR_WHIRLWIND, false); + uiTimer[1] = urand(9000,11000); + } + DoMeleeAttackIfReady(); + break; + case CLASS_PALADIN: + if (uiTimer[1] <= diff) + { + DoCast(me->getVictim(), SPELL_SR_HAMMER_OF_JUSTICE, false); + uiTimer[1] = urand(6000,8000); + } + if (uiTimer[2] <= diff) + { + DoCast(me->getVictim(), SPELL_SR_HOLY_SHOCK, false); + uiTimer[2] = urand(2000,4000); + } + DoMeleeAttackIfReady(); + break; + case CLASS_PRIEST: + if (uiTimer[1] <= diff) + { + DoCast(me->getVictim(), SPELL_SR_HOLY_SMITE, false); + uiTimer[1] = urand(4000,6000); + } + if (uiTimer[2] <= diff) + { + DoCast(me, SPELL_SR_RENEW, false); + uiTimer[2] = urand(6000,8000); + } + DoMeleeAttackIfReady(); + break; + case CLASS_SHAMAN: + if (uiTimer[1] <= diff) + { + DoCast(me->getVictim(), SPELL_SR_EARTH_SHOCK, false); + uiTimer[1] = urand(4000,6000); + } + DoMeleeAttackIfReady(); + break; + case CLASS_ROGUE: + if (uiTimer[1] <= diff) + { + DoCast(me->getVictim(), SPELL_SR_HEMORRHAGE, true); + uiTimer[1] = urand(4000,6000); + } + DoMeleeAttackIfReady(); + break; + } + debug_log("Sinister-Timer"); + for (uint8 i = 0; i < 3; ++i) + uiTimer[i] -= diff; + } +}; + +CreatureAI* GetAI_mob_sinster_reflection(Creature* pCreature) +{ + return new mob_sinster_reflectionAI (pCreature); +} + +void AddSC_boss_kiljaeden() +{ + Script* newscript; + + newscript = new Script; + newscript->pGOHello = &GOHello_go_orb_of_the_blue_flight; + newscript->Name = "go_orb_of_the_blue_flight"; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->GetAI = &GetAI_boss_kalecgos_kj; + newscript->Name = "boss_kalecgos_kj"; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->GetAI = &GetAI_boss_kiljaeden; + newscript->Name = "boss_kiljaeden"; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->GetAI = &GetAI_mob_kiljaeden_controller; + newscript->Name = "mob_kiljaeden_controller"; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->GetAI = &GetAI_mob_hand_of_the_deceiver; + newscript->Name = "mob_hand_of_the_deceiver"; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->GetAI = &GetAI_mob_felfire_portal; + newscript->Name = "mob_felfire_portal"; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->GetAI = &GetAI_mob_volatile_felfire_fiend; + newscript->Name = "mob_volatile_felfire_fiend"; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->GetAI = &GetAI_mob_armageddon; + newscript->Name = "mob_armageddon"; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->GetAI = &GetAI_mob_shield_orb; + newscript->Name = "mob_shield_orb"; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->GetAI = &GetAI_mob_sinster_reflection; + newscript->Name = "mob_sinster_reflection"; + newscript->RegisterSelf(); +} diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp new file mode 100644 index 00000000000..9dca453ade6 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp @@ -0,0 +1,640 @@ +/* Copyright (C) 2009 Trinity +* 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_Muru +SD%Complete: 80 +SDComment: all sounds, black hole effect triggers to often (46228) +*/ + +#include "ScriptedPch.h" +#include "sunwell_plateau.h" + +// Muru & Entropius's spells +enum Spells +{ + SPELL_ENRAGE = 26662, + + // Muru's spells + SPELL_NEGATIVE_ENERGY = 46009, //(this trigger 46008) + SPELL_DARKNESS = 45999, + SPELL_OPEN_ALL_PORTALS = 46177, + SPELL_OPEN_PORTAL = 45977, + SPELL_OPEN_PORTAL_2 = 45976, + SPELL_SUMMON_BERSERKER = 46037, + SPELL_SUMNON_FURY_MAGE = 46038, + SPELL_SUMMON_VOID_SENTINEL = 45988, + SPELL_SUMMON_ENTROPIUS = 46217, + + // Entropius's spells + SPELL_DARKNESS_E = 46269, + SPELL_BLACKHOLE = 46282, + SPELL_NEGATIVE_ENERGY_E = 46284, + SPELL_ENTROPIUS_SPAWN = 46223, + + // Shadowsword Berserker's spells + SPELL_FLURRY = 46160, + SPELL_DUAL_WIELD = 29651, + + // Shadowsword Fury Mage's spells + SPELL_FEL_FIREBALL = 46101, + SPELL_SPELL_FURY = 46102, + + // Void Sentinel's spells + SPELL_SHADOW_PULSE = 46087, + SPELL_VOID_BLAST = 46161, + + // Void Spawn's spells + SPELL_SHADOW_BOLT_VOLLEY = 46082, + + //Dark Fiend Spells + SPELL_DARKFIEND_AOE = 45944, + SPELL_DARKFIEND_VISUAL = 45936, + SPELL_DARKFIEND_SKIN = 45934, + + //Black Hole Spells + SPELL_BLACKHOLE_SPAWN = 46242, + SPELL_BLACKHOLE_GROW = 46228 +}; + +enum BossTimers{ + TIMER_DARKNESS = 0, + TIMER_HUMANOIDES = 1, + TIMER_PHASE = 2, + TIMER_SENTINEL = 3 +}; + +float DarkFiends[8][4] = +{ + {1819.9, 609.80, 69.74, 1.94}, + {1829.39, 617.89, 69.73, 2.61}, + {1801.98, 633.62, 69.74, 5.71}, + {1830.88, 629.99, 69.73, 3.52}, + {1800.38, 621.41, 69.74, 0.22}, + {1808.3 , 612.45, 69.73, 1.02}, + {1823.9 , 639.69, 69.74, 4.12}, + {1811.85, 640.46, 69.73, 4.97} +}; + +float Humanoides[6][5] = +{ + {CREATURE_FURY_MAGE, 1780.16, 666.83, 71.19, 5.21}, + {CREATURE_FURY_MAGE, 1847.93, 600.30, 71.30, 2.57}, + {CREATURE_BERSERKER, 1779.97, 660.64, 71.19, 5.28}, + {CREATURE_BERSERKER, 1786.2 , 661.01, 71.19, 4.51}, + {CREATURE_BERSERKER, 1845.17, 602.63, 71.28, 2.43}, + {CREATURE_BERSERKER, 1842.91, 599.93, 71.23, 2.44} +}; + +uint32 EnrageTimer = 600000; +struct boss_entropiusAI : public ScriptedAI +{ + boss_entropiusAI(Creature *c) : ScriptedAI(c), Summons(me) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + SummonList Summons; + + uint32 BlackHoleSummonTimer; + + void Reset() + { + BlackHoleSummonTimer = 15000; + DoCastAOE(SPELL_NEGATIVE_ENERGY_E, false); + + Summons.DespawnAll(); + + if (pInstance) + pInstance->SetData(DATA_MURU_EVENT, NOT_STARTED); + } + + void EnterCombat(Unit * /*who*/) + { + DoCastAOE(SPELL_NEGATIVE_ENERGY_E, true); + DoCast(me, SPELL_ENTROPIUS_SPAWN, false); + + if (pInstance) + pInstance->SetData(DATA_MURU_EVENT, IN_PROGRESS); + } + + void JustSummoned(Creature* summoned) + { + switch(summoned->GetEntry()) + { + case CREATURE_DARK_FIENDS: + summoned->CastSpell(summoned,SPELL_DARKFIEND_VISUAL,false); + break; + case CREATURE_DARKNESS: + summoned->addUnitState(UNIT_STAT_STUNNED); + float x,y,z,o; + summoned->GetHomePosition(x,y,z,o); + me->SummonCreature(CREATURE_DARK_FIENDS, x,y,z,o, TEMPSUMMON_CORPSE_DESPAWN, 0); + break; + } + summoned->AI()->AttackStart(SelectTarget(SELECT_TARGET_RANDOM,0, 50, true)); + Summons.Summon(summoned); + } + + void JustDied(Unit* /*killer*/) + { + Summons.DespawnAll(); + + if (pInstance) + pInstance->SetData(DATA_MURU_EVENT, DONE); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (EnrageTimer < diff && !me->HasAura(SPELL_ENRAGE, 0)) + { + DoCast(me, SPELL_ENRAGE, false); + } else EnrageTimer -= diff; + + if (BlackHoleSummonTimer <= diff) + { + Unit* random = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); + if (!random) + return; + + DoCast(random, SPELL_DARKNESS_E, false); + + random = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); + if (!random) + return; + + random->CastSpell(random, SPELL_BLACKHOLE, false); + BlackHoleSummonTimer = 15000; + } else BlackHoleSummonTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_entropius(Creature* pCreature) +{ + return new boss_entropiusAI (pCreature); +} + +struct boss_muruAI : public Scripted_NoMovementAI +{ + boss_muruAI(Creature *c) : Scripted_NoMovementAI(c), Summons(me) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + SummonList Summons; + + uint8 Phase; + uint32 Timer[4]; + + bool DarkFiend; + + void Reset() + { + DarkFiend = false; + Phase = 1; + + EnrageTimer = 600000; + Timer[TIMER_DARKNESS] = 45000; + Timer[TIMER_HUMANOIDES] = 10000; + Timer[TIMER_PHASE] = 2000; + Timer[TIMER_SENTINEL] = 31500; + + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetVisibility(VISIBILITY_ON); + + Summons.DespawnAll(); + + if (pInstance) + pInstance->SetData(DATA_MURU_EVENT, NOT_STARTED); + } + + void EnterCombat(Unit * /*who*/) + { + DoCastAOE(SPELL_NEGATIVE_ENERGY,false); + + if (pInstance) + pInstance->SetData(DATA_MURU_EVENT, IN_PROGRESS); + } + + void DamageTaken(Unit * /*done_by*/, uint32 &damage) + { + if (damage > me->GetHealth() && Phase == 1) + { + damage = 0; + Phase = 2; + me->RemoveAllAuras(); + DoCast(me, SPELL_OPEN_ALL_PORTALS, false); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + } + if (Phase > 1 && Phase < 4) + damage = 0; + } + + void JustSummoned(Creature* summoned) + { + switch(summoned->GetEntry()) + { + case BOSS_ENTROPIUS: + me->SetVisibility(VISIBILITY_OFF); + break; + case CREATURE_DARK_FIENDS: + summoned->CastSpell(summoned,SPELL_DARKFIEND_VISUAL,false); + break; + } + summoned->AI()->AttackStart(SelectTarget(SELECT_TARGET_RANDOM,0, 50, true)); + Summons.Summon(summoned); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (Phase == 3) + { + if (Timer[TIMER_PHASE] <= diff) + { + if (!pInstance) + return; + switch(pInstance->GetData(DATA_MURU_EVENT)) + { + case NOT_STARTED: + Reset(); + break; + case DONE: + Phase = 4; + me->DisappearAndDie(); + break; + } + Timer[TIMER_PHASE] = 3000; + } else Timer[TIMER_PHASE] -= diff; + return; + } + + if (EnrageTimer < diff && !me->HasAura(SPELL_ENRAGE, 0)) + { + DoCast(me, SPELL_ENRAGE, false); + } else EnrageTimer -= diff; + + for (uint8 i = 0; i < 4; ++i) + { + if (Timer[i] <= diff) + { + switch(i) + { + case TIMER_DARKNESS: + if (!DarkFiend) + { + DoCastAOE(SPELL_DARKNESS, false); + Timer[TIMER_DARKNESS] = 3000; + DarkFiend = true; + } + else + { + DarkFiend = false; + for (uint8 i = 0; i < 8; ++i) + me->SummonCreature(CREATURE_DARK_FIENDS,DarkFiends[i][0],DarkFiends[i][1],DarkFiends[i][2], DarkFiends[i][3], TEMPSUMMON_CORPSE_DESPAWN, 0); + Timer[TIMER_DARKNESS] = 42000; + } + break; + case TIMER_HUMANOIDES: + for (uint8 i = 0; i < 6; ++i) + me->SummonCreature(Humanoides[i][0],Humanoides[i][1],Humanoides[i][2],Humanoides[i][3], Humanoides[i][4], TEMPSUMMON_CORPSE_DESPAWN, 0); + Timer[TIMER_HUMANOIDES] = 60000; + break; + case TIMER_PHASE: + me->RemoveAllAuras(); + DoCast(me, SPELL_SUMMON_ENTROPIUS, false); + Timer[TIMER_PHASE] = 3000; + Phase = 3; + return; + case TIMER_SENTINEL: + DoCastAOE(SPELL_OPEN_PORTAL_2, false); + Timer[TIMER_SENTINEL] = 30000; + break; + } + break; + } + } + + //Timer + for (uint8 i = 0; i < 4; ++i) + { + if (i != TIMER_PHASE)Timer[i] -= diff; + else if (Phase == 2) Timer[i] -= diff; + } + } +}; + +CreatureAI* GetAI_boss_muru(Creature* pCreature) +{ + return new boss_muruAI (pCreature); +} + +struct npc_muru_portalAI : public Scripted_NoMovementAI +{ + npc_muru_portalAI(Creature *c) : Scripted_NoMovementAI(c), Summons(me) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + SummonList Summons; + + bool SummonSentinel; + bool InAction; + + uint32 SummonTimer; + + void Reset() + { + SummonTimer = 5000; + + InAction = false; + SummonSentinel = false; + + me->addUnitState(UNIT_STAT_STUNNED); + + Summons.DespawnAll(); + } + + void JustSummoned(Creature* summoned) + { + if (pInstance) + if (Player* Target = Unit::GetPlayer(pInstance->GetData64(DATA_PLAYER_GUID))) + summoned->AI()->AttackStart(Target); + + Summons.Summon(summoned); + } + + void SpellHit(Unit* /*caster*/, const SpellEntry* Spell) + { + float x,y,z,o; + me->GetHomePosition(x,y,z,o); + DoTeleportTo(x,y,z); + InAction = true; + switch(Spell->Id) + { + case SPELL_OPEN_ALL_PORTALS: + DoCastAOE(SPELL_OPEN_PORTAL, false); + break; + case SPELL_OPEN_PORTAL_2: + DoCastAOE(SPELL_OPEN_PORTAL, false); + SummonSentinel = true; + break; + } + } + + void UpdateAI(const uint32 diff) + { + if (!SummonSentinel) + { + if (InAction && pInstance && pInstance->GetData(DATA_MURU_EVENT) == NOT_STARTED) + Reset(); + return; + } + if (SummonTimer <= diff) + { + DoCastAOE(SPELL_SUMMON_VOID_SENTINEL, false); + SummonTimer = 5000; + SummonSentinel = false; + } else SummonTimer -= diff; + } +}; + +CreatureAI* GetAI_npc_muru_portal(Creature* pCreature) +{ + return new npc_muru_portalAI (pCreature); +} + +struct npc_dark_fiendAI : public ScriptedAI +{ + npc_dark_fiendAI(Creature *c) : ScriptedAI(c) {} + + uint32 WaitTimer; + bool InAction; + + void Reset() + { + WaitTimer = 2000; + InAction = false; + + me->addUnitState(UNIT_STAT_STUNNED); + } + + void SpellHit(Unit* /*caster*/, const SpellEntry* Spell) + { + for (uint8 i = 0; i < 3; ++i) + if (Spell->Effect[i] == 38) + me->DisappearAndDie(); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (WaitTimer <= diff) + { + if (!InAction) + { + me->clearUnitState(UNIT_STAT_STUNNED); + DoCastAOE(SPELL_DARKFIEND_SKIN, false); + AttackStart(SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)); + InAction = true; + WaitTimer = 500; + } + else + { + + if (me->IsWithinDist(me->getVictim(), 5)) + { + DoCastAOE(SPELL_DARKFIEND_AOE, false); + me->DisappearAndDie(); + } + WaitTimer = 500; + } + } else WaitTimer -= diff; + } +}; + +CreatureAI* GetAI_npc_dark_fiend(Creature* pCreature) +{ + return new npc_dark_fiendAI (pCreature); +} + +struct npc_void_sentinelAI : public ScriptedAI +{ + npc_void_sentinelAI(Creature *c) : ScriptedAI(c){} + + uint32 PulseTimer; + uint32 VoidBlastTimer; + + void Reset() + { + PulseTimer = 3000; + VoidBlastTimer = 45000; //is this a correct timer? + + float x,y,z,o; + me->GetHomePosition(x,y,z,o); + DoTeleportTo(x,y,71); + } + + void JustDied(Unit* /*killer*/) + { + for (uint8 i = 0; i < 8; ++i) + me->SummonCreature(CREATURE_VOID_SPAWN, me->GetPositionX(),me->GetPositionY(),me->GetPositionZ(), rand()%6, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 180000); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (PulseTimer <= diff) + { + DoCastAOE(SPELL_SHADOW_PULSE, true); + PulseTimer = 3000; + } else PulseTimer -= diff; + + if (VoidBlastTimer <= diff) + { + DoCast(me->getVictim(), SPELL_VOID_BLAST, false); + VoidBlastTimer = 45000; + } else VoidBlastTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_npc_void_sentinel(Creature* pCreature) +{ + return new npc_void_sentinelAI (pCreature); +} + +struct npc_blackholeAI : public ScriptedAI +{ + npc_blackholeAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint32 DespawnTimer; + uint32 SpellTimer; + uint8 Phase; + uint8 NeedForAHack; + + void Reset() + { + DespawnTimer = 15000; + SpellTimer = 5000; + Phase = 0; + + me->addUnitState(UNIT_STAT_STUNNED); + DoCastAOE(SPELL_BLACKHOLE_SPAWN, true); + } + + void UpdateAI(const uint32 diff) + { + if (SpellTimer <= diff) + { + Unit* Victim = Unit::GetUnit(*me, pInstance ? pInstance->GetData64(DATA_PLAYER_GUID) : 0); + switch (NeedForAHack) + { + case 0: + me->clearUnitState(UNIT_STAT_STUNNED); + DoCastAOE(SPELL_BLACKHOLE_GROW, false); + if (Victim) + AttackStart(Victim); + SpellTimer = 700; + NeedForAHack = 2; + break; + case 1: + me->AddAura(SPELL_BLACKHOLE_GROW, me); + NeedForAHack = 2; + SpellTimer = 600; + break; + case 2: + SpellTimer = 400; + NeedForAHack = 3; + me->RemoveAura(SPELL_BLACKHOLE_GROW, 1); + break; + case 3: + SpellTimer = urand(400,900); + NeedForAHack = 1; + if (Unit* Temp = me->getVictim()) + { + if (Temp->GetPositionZ() > 73 && Victim) + AttackStart(Victim); + } else + return; + } + } else SpellTimer -= diff; + + if (DespawnTimer <= diff) + me->DisappearAndDie(); + else DespawnTimer -= diff; + } +}; + +CreatureAI* GetAI_npc_blackhole(Creature* pCreature) +{ + return new npc_blackholeAI (pCreature); +} + +void AddSC_boss_muru() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_muru"; + newscript->GetAI = &GetAI_boss_muru; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_entropius"; + newscript->GetAI = &GetAI_boss_entropius; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_muru_portal"; + newscript->GetAI = &GetAI_npc_muru_portal; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_dark_fiend"; + newscript->GetAI = &GetAI_npc_dark_fiend; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_void_sentinel"; + newscript->GetAI = &GetAI_npc_void_sentinel; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_blackhole"; + newscript->GetAI = &GetAI_npc_blackhole; + newscript->RegisterSelf(); +} diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/instance_sunwell_plateau.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/instance_sunwell_plateau.cpp new file mode 100644 index 00000000000..94b7bf4b735 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/instance_sunwell_plateau.cpp @@ -0,0 +1,297 @@ +/* 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 */ + +/* ScriptData +SDName: Instance_Sunwell_Plateau +SD%Complete: 25 +SDComment: VERIFY SCRIPT +SDCategory: Sunwell_Plateau +EndScriptData */ + +#include "ScriptedPch.h" +#include "sunwell_plateau.h" + +#define MAX_ENCOUNTER 6 + +/* Sunwell Plateau: +0 - Kalecgos and Sathrovarr +1 - Brutallus +2 - Felmyst +3 - Eredar Twins (Alythess and Sacrolash) +4 - M'uru +5 - Kil'Jaeden +*/ + +struct instance_sunwell_plateau : public ScriptedInstance +{ + instance_sunwell_plateau(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + + /** Creatures **/ + uint64 Kalecgos_Dragon; + uint64 Kalecgos_Human; + uint64 Sathrovarr; + uint64 Brutallus; + uint64 Madrigosa; + uint64 Felmyst; + uint64 Alythess; + uint64 Sacrolash; + uint64 Muru; + uint64 KilJaeden; + uint64 KilJaedenController; + uint64 Anveena; + uint64 KalecgosKJ; + uint32 SpectralPlayers; + + /** GameObjects **/ + uint64 ForceField; // Kalecgos Encounter + uint64 KalecgosWall[2]; + uint64 FireBarrier; // Felmysts Encounter + uint64 MurusGate[2]; // Murus Encounter + + /*** Misc ***/ + uint32 SpectralRealmTimer; + std::vector SpectralRealmList; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + /*** Creatures ***/ + Kalecgos_Dragon = 0; + Kalecgos_Human = 0; + Sathrovarr = 0; + Brutallus = 0; + Madrigosa = 0; + Felmyst = 0; + Alythess = 0; + Sacrolash = 0; + Muru = 0; + KilJaeden = 0; + KilJaedenController = 0; + Anveena = 0; + KalecgosKJ = 0; + SpectralPlayers = 0; + + /*** GameObjects ***/ + ForceField = 0; + FireBarrier = 0; + MurusGate[0] = 0; + MurusGate[1] = 0; + KalecgosWall[0] = 0; + KalecgosWall[1] = 0; + + /*** Misc ***/ + SpectralRealmTimer = 5000; + } + + 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) + { + Player* plr = itr->getSource(); + if (plr && !plr->HasAura(45839,0)) + return plr; + } + } + + debug_log("TSCR: Instance Sunwell Plateau: GetPlayerInMap, but PlayerList is empty!"); + return NULL; + } + + void OnCreatureCreate(Creature* pCreature, bool /*add*/) + { + switch(pCreature->GetEntry()) + { + case 24850: Kalecgos_Dragon = pCreature->GetGUID(); break; + case 24891: Kalecgos_Human = pCreature->GetGUID(); break; + case 24892: Sathrovarr = pCreature->GetGUID(); break; + case 24882: Brutallus = pCreature->GetGUID(); break; + case 24895: Madrigosa = pCreature->GetGUID(); break; + case 25038: Felmyst = pCreature->GetGUID(); break; + case 25166: Alythess = pCreature->GetGUID(); break; + case 25165: Sacrolash = pCreature->GetGUID(); break; + case 25741: Muru = pCreature->GetGUID(); break; + case 25315: KilJaeden = pCreature->GetGUID(); break; + case 25608: KilJaedenController = pCreature->GetGUID(); break; + case 26046: Anveena = pCreature->GetGUID(); break; + case 25319: KalecgosKJ = pCreature->GetGUID(); break; + } + } + + void OnGameObjectCreate(GameObject* pGo, bool /*add*/) + { + switch(pGo->GetEntry()) + { + case 188421: ForceField = pGo->GetGUID(); break; + case 188523: KalecgosWall[0] = pGo->GetGUID(); break; + case 188524: KalecgosWall[0] = pGo->GetGUID(); break; + case 188075: + if (m_auiEncounter[2] == DONE) + HandleGameObject(NULL, true, pGo); + FireBarrier = pGo->GetGUID(); + break; + case 187990: MurusGate[0] = pGo->GetGUID(); break; + case 188118: + if (m_auiEncounter[4] == DONE) + HandleGameObject(NULL, true, pGo); + MurusGate[1]= pGo->GetGUID(); + break; + } + } + + uint32 GetData(uint32 id) + { + switch(id) + { + case DATA_KALECGOS_EVENT: return m_auiEncounter[0]; + case DATA_BRUTALLUS_EVENT: return m_auiEncounter[1]; + case DATA_FELMYST_EVENT: return m_auiEncounter[2]; + case DATA_EREDAR_TWINS_EVENT: return m_auiEncounter[3]; + case DATA_MURU_EVENT: return m_auiEncounter[4]; + case DATA_KILJAEDEN_EVENT: return m_auiEncounter[5]; + } + return 0; + } + + uint64 GetData64(uint32 id) + { + switch(id) + { + case DATA_KALECGOS_DRAGON: return Kalecgos_Dragon; + case DATA_KALECGOS_HUMAN: return Kalecgos_Human; + case DATA_SATHROVARR: return Sathrovarr; + case DATA_GO_FORCEFIELD: return ForceField; + case DATA_BRUTALLUS: return Brutallus; + case DATA_MADRIGOSA: return Madrigosa; + case DATA_FELMYST: return Felmyst; + case DATA_ALYTHESS: return Alythess; + case DATA_SACROLASH: return Sacrolash; + case DATA_MURU: return Muru; + case DATA_KILJAEDEN: return KilJaeden; + case DATA_KILJAEDEN_CONTROLLER: return KilJaedenController; + case DATA_ANVEENA: return Anveena; + case DATA_KALECGOS_KJ: return KalecgosKJ; + case DATA_PLAYER_GUID: + Player* Target = GetPlayerInMap(); + return Target->GetGUID(); + } + return 0; + } + + void SetData(uint32 id, uint32 data) + { + switch(id) + { + case DATA_KALECGOS_EVENT: + { + if (data == NOT_STARTED || data == DONE) + { + HandleGameObject(ForceField,true); + HandleGameObject(KalecgosWall[0],true); + HandleGameObject(KalecgosWall[1],true); + } + else if (data == IN_PROGRESS) + { + HandleGameObject(ForceField,false); + HandleGameObject(KalecgosWall[0],false); + HandleGameObject(KalecgosWall[1],false); + } + m_auiEncounter[0] = data; + } + break; + case DATA_BRUTALLUS_EVENT: m_auiEncounter[1] = data; break; + case DATA_FELMYST_EVENT: + if (data == DONE) + HandleGameObject(FireBarrier, true); + m_auiEncounter[2] = data; break; + case DATA_EREDAR_TWINS_EVENT: m_auiEncounter[3] = data; break; + case DATA_MURU_EVENT: + switch(data) + { + case DONE: + HandleGameObject(MurusGate[0], true); + HandleGameObject(MurusGate[1], true); + break; + case IN_PROGRESS: + HandleGameObject(MurusGate[0], false); + HandleGameObject(MurusGate[1], false); + break; + case NOT_STARTED: + HandleGameObject(MurusGate[0], true); + HandleGameObject(MurusGate[1], false); + break; + } + m_auiEncounter[4] = data; break; + case DATA_KILJAEDEN_EVENT: m_auiEncounter[5] = data; break; + } + + if (data == DONE) + SaveToDB(); + } + + 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]; + 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]; + 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_sunwell_plateau(Map* pMap) +{ + return new instance_sunwell_plateau(pMap); +} + +void AddSC_instance_sunwell_plateau() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "instance_sunwell_plateau"; + newscript->GetInstanceData = &GetInstanceData_instance_sunwell_plateau; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/sunwell_plateau.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/sunwell_plateau.cpp new file mode 100644 index 00000000000..dbf67d5f26e --- /dev/null +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/sunwell_plateau.cpp @@ -0,0 +1,65 @@ +/* Copyright (C) 2009 Trinity + * 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: Sunwell_Plateau +SD%Complete: 0 +SDComment: Placeholder, Epilogue after Kil'jaeden, Captain Selana Gossips +EndScriptData */ + +/* ContentData +npc_prophet_velen +npc_captain_selana +EndContentData */ + +#include "ScriptedPch.h" +#include "sunwell_plateau.h" + +/*###### +## npc_prophet_velen +######*/ + +enum ProphetSpeeches +{ + PROPHET_SAY1 = -1580099, + PROPHET_SAY2 = -1580100, + PROPHET_SAY3 = -1580101, + PROPHET_SAY4 = -1580102, + PROPHET_SAY5 = -1580103, + PROPHET_SAY6 = -1580104, + PROPHET_SAY7 = -1580105, + PROPHET_SAY8 = -1580106 +}; + +enum LiadrinnSpeeches +{ + LIADRIN_SAY1 = -1580107, + LIADRIN_SAY2 = -1580108, + LIADRIN_SAY3 = -1580109 +}; + +/*###### +## npc_captain_selana +######*/ + +#define CS_GOSSIP1 "Give me a situation report, Captain." +#define CS_GOSSIP2 "What went wrong?" +#define CS_GOSSIP3 "Why did they stop?" +#define CS_GOSSIP4 "Your insight is appreciated." + +void AddSC_sunwell_plateau() +{ +} diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/sunwell_plateau.h b/src/server/scripts/EasternKingdoms/SunwellPlateau/sunwell_plateau.h new file mode 100644 index 00000000000..9f1a2480c96 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/sunwell_plateau.h @@ -0,0 +1,95 @@ +/* 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_SUNWELLPLATEAU_H +#define DEF_SUNWELLPLATEAU_H + +/*** Encounters ***/ +enum Data +{ + DATA_KALECGOS_EVENT, + DATA_BRUTALLUS_EVENT, + DATA_FELMYST_EVENT, + DATA_EREDAR_TWINS_EVENT, + DATA_MURU_EVENT, + DATA_KILJAEDEN_EVENT, +}; + +enum Data64 +{ + /*** Creatures ***/ + DATA_KALECGOS_DRAGON, + DATA_KALECGOS_HUMAN, + DATA_SATHROVARR, + DATA_BRUTALLUS, + DATA_MADRIGOSA, + DATA_FELMYST, + DATA_ALYTHESS, + DATA_SACROLASH, + DATA_MURU, + DATA_KILJAEDEN, + DATA_KILJAEDEN_CONTROLLER, + DATA_ANVEENA, + DATA_KALECGOS_KJ, + + /*** GameObjects ***/ + DATA_GO_FORCEFIELD, + DATA_ORB_OF_THE_BLUE_DRAGONFLIGHT_1, + DATA_ORB_OF_THE_BLUE_DRAGONFLIGHT_2, + DATA_ORB_OF_THE_BLUE_DRAGONFLIGHT_3, + DATA_ORB_OF_THE_BLUE_DRAGONFLIGHT_4, + + /*** Misc ***/ + DATA_PLAYER_GUID, +}; + +enum Creatures +{ + BOSS_MURU = 25741, + BOSS_ENTROPIUS = 25840, + MOB_KALECGOS = 24850, + MOB_KALEC = 24891, + MOB_SATHROVARR = 24892, + + MOB_DEAD = 25268, + MOB_FLIGHT_LEFT = 25357, + MOB_FLIGHT_RIGHT = 25358, + MOB_DEATH_CLOUD = 25703, + MOB_VAPOR = 25265, + MOB_VAPOR_TRAIL = 25267, + + MOB_GRAND_WARLOCK_ALYTHESS = 25166, + MOB_SHADOW_IMAGE = 25214, + MOB_LADY_SACROLASH = 25165, + + CREATURE_ANVEENA = 26046, // Embodiment of the Sunwell + CREATURE_KALECGOS = 25319, // Helps the raid throughout the fight + CREATURE_PROPHET = 26246, // Outro + CREATURE_KILJAEDEN = 25315, // Give it to 'em KJ! + CREATURE_HAND_OF_THE_DECEIVER = 25588, // Adds found before KJ emerges + CREATURE_FELFIRE_PORTAL = 25603, // Portal spawned be Hand of the Deceivers + CREATURE_VOLATILE_FELFIRE_FIEND = 25598, // Fiends spawned by the above portal + CREATURE_ARMAGEDDON_TARGET = 25735, // This mob casts meteor on itself.. I think + CREATURE_SHIELD_ORB = 25502, // Shield orbs circle the room raining shadow bolts on raid + CREATURE_THE_CORE_OF_ENTROPIUS = 26262, // Used in the ending cinematic? + CREATURE_POWER_OF_THE_BLUE_DRAGONFLIGHT = 25653, // NPC that players possess when using the Orb of the Blue Dragonflight + CREATURE_SPIKE_TARGET1 = 30598, // Should summon these under Shadow Spike Channel on targets place + CREATURE_SPIKE_TARGET2 = 30614, + CREATURE_SINISTER_REFLECTION = 25708, // Sinister Relection spawnd on Phase swichtes + + CREATURE_DARKNESS = 25879, + CREATURE_DARK_FIENDS = 25744, + CREATURE_BERSERKER = 25798, + CREATURE_FURY_MAGE = 25799, + CREATURE_VOID_SENTINEL = 25772, + CREATURE_VOID_SPAWN = 25824, + CREATURE_BLACK_HOLE = 25855, +}; + +enum GameObjects +{ + GAMEOBJECT_ORB_OF_THE_BLUE_DRAGONFLIGHT = 188415, +}; + +#endif diff --git a/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp b/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp new file mode 100644 index 00000000000..cd3bc5fc219 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp @@ -0,0 +1,497 @@ +/* Copyright (C) 2006,2007 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_archaedas +SD%Complete: 100 +SDComment: Archaedas is activated when 1 person (was 3, changed in 3.0.8) clicks on his altar. +Every 10 seconds he will awaken one of his minions along the wall. +At 66%, he will awaken the 6 Guardians. +At 33%, he will awaken the Vault Walkers +On his death the vault door opens. +EndScriptData */ + +#include "ScriptedPch.h" + +#define SAY_AGGRO "Who dares awaken Archaedas? Who dares the wrath of the makers!" +#define SOUND_AGGRO 5855 + +#define SAY_SUMMON "Awake ye servants, defend the discs!" +#define SOUND_SUMMON 5856 + +#define SAY_SUMMON2 "To my side, brothers. For the makers!" +#define SOUND_SUMMON2 5857 + +#define SAY_KILL "Reckless mortal." +#define SOUND_KILL 5858 + +#define SPELL_GROUND_TREMOR 6524 +#define SPELL_ARCHAEDAS_AWAKEN 10347 +#define SPELL_BOSS_OBJECT_VISUAL 11206 +#define SPELL_BOSS_AGGRO 10340 +#define SPELL_SUB_BOSS_AGGRO 11568 +#define SPELL_AWAKEN_VAULT_WALKER 10258 +#define SPELL_AWAKEN_EARTHEN_GUARDIAN 10252 + +struct boss_archaedasAI : public ScriptedAI +{ + boss_archaedasAI(Creature *c) : ScriptedAI(c) + { + pInstance = me->GetInstanceData(); + } + + uint32 Tremor_Timer; + int32 Awaken_Timer; + uint32 WallMinionTimer; + bool wakingUp; + + bool guardiansAwake; + bool vaultWalkersAwake; + ScriptedInstance* pInstance; + + void Reset() + { + Tremor_Timer = 60000; + Awaken_Timer = 0; + WallMinionTimer = 10000; + + wakingUp = false; + guardiansAwake = false; + vaultWalkersAwake = false; + + if (pInstance) + pInstance->SetData (NULL, 5); // respawn any dead minions + me->setFaction(35); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE); + + } + + void ActivateMinion (uint64 guid, bool flag) + { + Unit *minion = Unit::GetUnit(*me, guid); + + if (minion && minion->isAlive()) + { + DoCast (minion, SPELL_AWAKEN_VAULT_WALKER, flag); + minion->CastSpell(minion, SPELL_ARCHAEDAS_AWAKEN,true); + } + } + + void EnterCombat(Unit * /*who*/) + { + me->setFaction (14); + me->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->RemoveFlag (UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE); + } + + void SpellHit (Unit* /*caster*/, const SpellEntry *spell) + { + // Being woken up from the altar, start the awaken sequence + if (spell == GetSpellStore()->LookupEntry(SPELL_ARCHAEDAS_AWAKEN)) { + me->MonsterYell(SAY_AGGRO,LANG_UNIVERSAL,NULL); + DoPlaySoundToSet(me,SOUND_AGGRO); + Awaken_Timer = 4000; + wakingUp = true; + } + } + + void KilledUnit(Unit * /*victim*/) + { + me->MonsterYell(SAY_KILL,LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_KILL); + } + + void UpdateAI(const uint32 diff) + { + if (!pInstance) + return; + // we're still doing awaken animation + if (wakingUp && Awaken_Timer >= 0) { + Awaken_Timer -= diff; + return; // dont do anything until we are done + } else if (wakingUp && Awaken_Timer <= 0) { + wakingUp = false; + AttackStart(Unit::GetUnit(*me, pInstance->GetData64(0))); + return; // dont want to continue until we finish the AttackStart method + } + + //Return since we have no target + if (!UpdateVictim()) + return; + + // wake a wall minion + if (WallMinionTimer <= diff) { + pInstance->SetData (NULL, 2); + + WallMinionTimer = 10000; + } else WallMinionTimer -= diff; + + //If we are <66 summon the guardians + if (!guardiansAwake && me->GetHealth()*100 / me->GetMaxHealth() <= 66) { + ActivateMinion(pInstance->GetData64(5),true); // EarthenGuardian1 + ActivateMinion(pInstance->GetData64(6),true); // EarthenGuardian2 + ActivateMinion(pInstance->GetData64(7),true); // EarthenGuardian3 + ActivateMinion(pInstance->GetData64(8),true); // EarthenGuardian4 + ActivateMinion(pInstance->GetData64(9),true); // EarthenGuardian5 + ActivateMinion(pInstance->GetData64(10),false); // EarthenGuardian6 + me->MonsterYell(SAY_SUMMON,LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_SUMMON); + guardiansAwake = true; + } + + //If we are <33 summon the vault walkers + if (!vaultWalkersAwake && me->GetHealth()*100 / me->GetMaxHealth() <= 33) { + ActivateMinion(pInstance->GetData64(1),true); // VaultWalker1 + ActivateMinion(pInstance->GetData64(2),true); // VaultWalker2 + ActivateMinion(pInstance->GetData64(3),true); // VaultWalker3 + ActivateMinion(pInstance->GetData64(4),false); // VaultWalker4 + me->MonsterYell(SAY_SUMMON2, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_SUMMON2); + vaultWalkersAwake = true; + } + + if (Tremor_Timer <= diff) + { + //Cast + DoCast(me->getVictim(), SPELL_GROUND_TREMOR); + + //45 seconds until we should cast this agian + Tremor_Timer = 45000; + } else Tremor_Timer -= diff; + + DoMeleeAttackIfReady(); + } + + void JustDied (Unit * /*killer*/) { + if (pInstance) + { + pInstance->SetData(NULL,3); // open the vault door + pInstance->SetData(NULL,4); // deactivate his minions + } + } + +}; + +CreatureAI* GetAI_boss_archaedas(Creature* pCreature) +{ + return new boss_archaedasAI (pCreature); +} + +/* ScriptData +SDName: mob_archaedas_minions +SD%Complete: 100 +SDComment: These mobs are initially frozen until Archaedas awakens them +one at a time. +EndScriptData */ + +#define SPELL_ARCHAEDAS_AWAKEN 10347 + +struct mob_archaedas_minionsAI : public ScriptedAI +{ + mob_archaedas_minionsAI(Creature *c) : ScriptedAI(c) + { + pInstance = me->GetInstanceData(); + } + + uint32 Arcing_Timer; + int32 Awaken_Timer; + bool wakingUp; + + bool amIAwake; + ScriptedInstance* pInstance; + + void Reset() + { + Arcing_Timer = 3000; + Awaken_Timer = 0; + + wakingUp = false; + amIAwake = false; + + me->setFaction(35); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE); + me->RemoveAllAuras(); + } + + void EnterCombat(Unit * /*who*/) + { + me->setFaction (14); + me->RemoveAllAuras(); + me->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE); + amIAwake = true; + } + + void SpellHit (Unit* /*caster*/, const SpellEntry *spell) { + // time to wake up, start animation + if (spell == GetSpellStore()->LookupEntry(SPELL_ARCHAEDAS_AWAKEN)){ + Awaken_Timer = 5000; + wakingUp = true; + } + } + + void MoveInLineOfSight(Unit *who) + { + if (amIAwake) + ScriptedAI::MoveInLineOfSight(who); + } + + void UpdateAI(const uint32 diff) + { + // we're still in the awaken animation + if (wakingUp && Awaken_Timer >= 0) { + Awaken_Timer -= diff; + return; // dont do anything until we are done + } else if (wakingUp && Awaken_Timer <= 0) { + wakingUp = false; + amIAwake = true; + // AttackStart(Unit::GetUnit(*me, pInstance->GetData64(0))); // whoWokeArchaedasGUID + return; // dont want to continue until we finish the AttackStart method + } + + //Return since we have no target + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_archaedas_minions(Creature* pCreature) +{ + return new mob_archaedas_minionsAI (pCreature); +} + +/* ScriptData +SDName: go_altar_archaedas +SD%Complete: 100 +SDComment: Needs 1 person to activate the Archaedas script +SDCategory: Uldaman +EndScriptData */ + +#define OBJECT_ALTAR_OF_ARCHAEDAS 133234 + +#define NUMBER_NEEDED_TO_ACTIVATE 1 // as of patch 3.0.8 the altars can be opened by a single player (previously 3) + +#define SPELL_BOSS_OBJECT_VISUAL 11206 + +//uint64 altarOfArchaedasCount[5]; +//int32 altarOfArchaedasCounter=0; + +bool GOHello_go_altar_of_archaedas(Player* pPlayer, GameObject* /*pGo*/) +{ + //bool alreadyUsed; + //pGo->AddUse (); + + /* + alreadyUsed = false; + for (uint32 loop=0; loop<5; loop++) { + if (altarOfArchaedasCount[loop] == pPlayer->GetGUID()) alreadyUsed = true; + } + if (!alreadyUsed) + altarOfArchaedasCount[altarOfArchaedasCounter++] = pPlayer->GetGUID(); + */ + + pPlayer->CastSpell (pPlayer, SPELL_BOSS_OBJECT_VISUAL, false); + + /* + if (altarOfArchaedasCounter < NUMBER_NEEDED_TO_ACTIVATE) + return false; // not enough people yet + + // Check to make sure at least three people are still casting + uint8 count = 0; + Unit *pTarget; + for (uint8 x = 0; x <= 5; ++x) + { + pTarget = Unit::GetUnit(*pPlayer, altarOfArchaedasCount[x]); + if (!pTarget) + continue; + if (pTarget->IsNonMeleeSpellCasted(true)) + ++count; + if (count >= NUMBER_NEEDED_TO_ACTIVATE) + break; + } + + if (count < NUMBER_NEEDED_TO_ACTIVATE) + return false; // not enough people + */ + + ScriptedInstance* pInstance = pPlayer->GetInstanceData(); + if (!pInstance) + return false; + + pInstance->SetData(NULL,0); + pInstance->SetData64(0,pPlayer->GetGUID()); // activate archaedas + + return false; +} + +/* ScriptData +SDName: mob_stonekeepers +SD%Complete: 100 +SDComment: After activating the altar of the keepers, the stone keepers will +wake up one by one. +EndScriptData */ + +#include "ScriptedPch.h" + +#define SPELL_SELF_DESTRUCT 9874 + +struct mob_stonekeepersAI : public ScriptedAI +{ + mob_stonekeepersAI(Creature *c) : ScriptedAI(c) + { + pInstance = (me->GetInstanceData()); + } + + ScriptedInstance* pInstance; + + void Reset() + { + me->setFaction(35); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE); + me->RemoveAllAuras(); + } + + void EnterCombat(Unit * /*who*/) + { + me->setFaction (14); + me->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE); + } + + void UpdateAI(const uint32 /*diff*/) + { + + //Return since we have no target + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + + void JustDied(Unit * /*attacker*/) + { + DoCast (me, SPELL_SELF_DESTRUCT,true); + if (pInstance) + pInstance->SetData(NULL, 1); // activate next stonekeeper + } + +}; + +CreatureAI* GetAI_mob_stonekeepers(Creature* pCreature) +{ + return new mob_stonekeepersAI (pCreature); +} + +/* ScriptData +SDName: go_altar_of_the_keepers +SD%Complete: 100 +SDComment: Need 1 person to activate to open the altar. One by one the StoneKeepers will activate. After all four are dead than the door will open. +SDCategory: Uldaman +EndScriptData */ + +#define SPELL_BOSS_OBJECT_VISUAL 11206 + +#define NUMBER_NEEDED_TO_ACTIVATE 1 // as of patch 3.0.8 the altars can be opened by a single player (previously 3) + +//static uint64 altarOfTheKeeperCount[5]; +//static uint32 altarOfTheKeeperCounter=0; + +bool GOHello_go_altar_of_the_keepers(Player* pPlayer, GameObject* /*pGo*/) +{ + ScriptedInstance* pInstance = pPlayer->GetInstanceData(); + if (!pInstance) + return true; + + //bool alreadyUsed; + + //pGo->AddUse(); + + //alreadyUsed = false; + //for (uint32 loop=0; loop<5; ++loop) + //{ + // if (altarOfTheKeeperCount[loop] == pPlayer->GetGUID()) + //alreadyUsed = true; + //} + //if (!alreadyUsed && altarOfTheKeeperCounter < 5) + // altarOfTheKeeperCount[altarOfTheKeeperCounter++] = pPlayer->GetGUID(); + pPlayer->CastSpell (pPlayer, SPELL_BOSS_OBJECT_VISUAL, false); + + //if (altarOfTheKeeperCounter < NUMBER_NEEDED_TO_ACTIVATE) + //{ + //error_log("not enough people yet, altarOfTheKeeperCounter = %d", altarOfTheKeeperCounter); + // return false; // not enough people yet + //} +/* + // Check to make sure at least three people are still casting + uint8 count = 0; + Unit *pTarget; + for (uint8 x = 0; x < 5; ++x) + { + pTarget = Unit::GetUnit(*pPlayer, altarOfTheKeeperCount[x]); + //error_log("number of people currently activating it: %d", x+1); + if (!pTarget) + continue; + if (pTarget->IsNonMeleeSpellCasted(true)) + ++count; + if (count >= NUMBER_NEEDED_TO_ACTIVATE) + break; + } + + if (count < NUMBER_NEEDED_TO_ACTIVATE) + { + //error_log("still not enough people"); + return true; // not enough people + } +*/ + //error_log ("activating stone keepers"); + pInstance->SetData(NULL,1); // activate the Stone Keepers + return true; +} + +void AddSC_boss_archaedas() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_archaedas"; + newscript->GetAI = &GetAI_boss_archaedas; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "go_altar_of_archaedas"; + newscript->pGOHello = &GOHello_go_altar_of_archaedas; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_archaedas_minions"; + newscript->GetAI = &GetAI_mob_archaedas_minions; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "go_altar_of_the_keepers"; + newscript->pGOHello = &GOHello_go_altar_of_the_keepers; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_stonekeepers"; + newscript->GetAI = &GetAI_mob_stonekeepers; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/Uldaman/boss_ironaya.cpp b/src/server/scripts/EasternKingdoms/Uldaman/boss_ironaya.cpp new file mode 100644 index 00000000000..9b6d5dba642 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/Uldaman/boss_ironaya.cpp @@ -0,0 +1,106 @@ +/* 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_Ironaya +SD%Complete: 100 +SDComment: +SDCategory: Uldaman +EndScriptData */ + +#include "ScriptedPch.h" + +#define SAY_AGGRO -1070000 + +#define SPELL_ARCINGSMASH 8374 +#define SPELL_KNOCKAWAY 10101 +#define SPELL_WSTOMP 11876 + +struct boss_ironayaAI : public ScriptedAI +{ + boss_ironayaAI(Creature *c) : ScriptedAI(c) {} + + uint32 Arcing_Timer; + bool hasCastedWstomp; + bool hasCastedKnockaway; + + void Reset() + { + Arcing_Timer = 3000; + hasCastedKnockaway = false; + hasCastedWstomp = false; + } + + void EnterCombat(Unit * /*who*/) + { + DoScriptText(SAY_AGGRO, me); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //If we are <50% hp do knockaway ONCE + if (!hasCastedKnockaway && me->GetHealth()*2 < me->GetMaxHealth()) + { + DoCast(me->getVictim(), SPELL_KNOCKAWAY, true); + + // current aggro target is knocked away pick new target + Unit* Target = SelectUnit(SELECT_TARGET_TOPAGGRO, 0); + + if (!Target || Target == me->getVictim()) + Target = SelectUnit(SELECT_TARGET_TOPAGGRO, 1); + + if (Target) + me->TauntApply(Target); + + //Shouldn't cast this agian + hasCastedKnockaway = true; + } + + //Arcing_Timer + if (Arcing_Timer <= diff) + { + DoCast(me, SPELL_ARCINGSMASH); + Arcing_Timer = 13000; + } else Arcing_Timer -= diff; + + if (!hasCastedWstomp && me->GetHealth()*4 < me->GetMaxHealth()) + { + DoCast(me, SPELL_WSTOMP); + hasCastedWstomp = true; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_ironaya(Creature* pCreature) +{ + return new boss_ironayaAI (pCreature); +} + +void AddSC_boss_ironaya() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_ironaya"; + newscript->GetAI = &GetAI_boss_ironaya; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp b/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp new file mode 100644 index 00000000000..a519ad678b7 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp @@ -0,0 +1,300 @@ +/* Copyright (C) 2006,2007 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 +*/ + +#include "ScriptedPch.h" + +#define SPELL_ARCHAEDAS_AWAKEN 10347 +#define SPELL_AWAKEN_VAULT_WALKER 10258 + +#define ARCHAEDAS_TEMPLE_DOOR 141869 +#define ALTAR_OF_ARCHAEDAS 133234 + +#define ALTAR_OF_THE_KEEPER_TEMPLE_DOOR 124367 +#define ALTAR_OF_THE_KEEPER_TEMPLE 130511 + +#define ANCIENT_VAULT_DOOR 124369 + +struct instance_uldaman : public ScriptedInstance +{ + instance_uldaman(Map* pMap) : ScriptedInstance(pMap) + { + Initialize(); + }; + + void Initialize() + { + archaedasGUID = 0; + altarOfTheKeeperTempleDoor = 0; + archaedasTempleDoor = 0; + ancientVaultDoor = 0; + whoWokeArchaedasGUID = 0; + } + + uint64 archaedasGUID; + uint64 altarOfTheKeeperTempleDoor; + uint64 archaedasTempleDoor; + uint64 ancientVaultDoor; + uint64 whoWokeArchaedasGUID; + + std::vector stoneKeeper; + std::vector altarOfTheKeeperCount; + std::vector vaultWalker; + std::vector earthenGuardian; + std::vector archaedasWallMinions; // minions lined up around the wall + + void OnGameObjectCreate(GameObject* pGo, bool /*add*/) + { + switch (pGo->GetEntry()) + { + case ALTAR_OF_THE_KEEPER_TEMPLE_DOOR: // lock the door + altarOfTheKeeperTempleDoor = pGo->GetGUID(); + break; + + case ARCHAEDAS_TEMPLE_DOOR: + archaedasTempleDoor = pGo->GetGUID(); + break; + + case ANCIENT_VAULT_DOOR: + pGo->SetGoState(GO_STATE_READY); + pGo->SetUInt32Value(GAMEOBJECT_FLAGS, 33); + ancientVaultDoor = pGo->GetGUID(); + break; + } + } + + void SetFrozenState(Creature* pCreature) + { + pCreature->setFaction(35); + pCreature->RemoveAllAuras(); + //creature->RemoveFlag (UNIT_FIELD_FLAGS,UNIT_FLAG_ANIMATION_FROZEN); + pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE); + } + + void OpenDoor(uint64 guid) + { + GameObject* pGo = instance->GetGameObject(guid); + if (!pGo) + return; + + pGo->SetUInt32Value(GAMEOBJECT_FLAGS, 33); + pGo->SetGoState(GO_STATE_ACTIVE); + } + + void ActivateStoneKeepers() + { + for (std::vector::const_iterator i = stoneKeeper.begin(); i != stoneKeeper.end(); ++i) + { + Creature *pTarget = instance->GetCreature(*i); + if (!pTarget || !pTarget->isAlive() || pTarget->getFaction() == 14) + continue; + pTarget->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE); + pTarget->setFaction(14); + pTarget->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + return; // only want the first one we find + } + // if we get this far than all four are dead so open the door + SetData (NULL, 0); + } + + void ActivateWallMinions() + { + Creature *archaedas = instance->GetCreature(archaedasGUID); + if (!archaedas) + return; + + for (std::vector::const_iterator i = archaedasWallMinions.begin(); i != archaedasWallMinions.end(); ++i) + { + Creature *pTarget = instance->GetCreature(*i); + if (!pTarget || !pTarget->isAlive() || pTarget->getFaction() == 14) + continue; + archaedas->CastSpell(pTarget, SPELL_AWAKEN_VAULT_WALKER, true); + pTarget->CastSpell(pTarget, SPELL_ARCHAEDAS_AWAKEN,true); + return; // only want the first one we find + } + } + + // used when Archaedas dies. All active minions must be despawned. + void DeActivateMinions() + { + // first despawn any aggroed wall minions + for (std::vector::const_iterator i = archaedasWallMinions.begin(); i != archaedasWallMinions.end(); ++i) + { + Creature *pTarget = instance->GetCreature(*i); + if (!pTarget || pTarget->isDead() || pTarget->getFaction() != 14) + continue; + pTarget->setDeathState(JUST_DIED); + pTarget->RemoveCorpse(); + } + + // Vault Walkers + for (std::vector::const_iterator i = vaultWalker.begin(); i != vaultWalker.end(); ++i) + { + Creature *pTarget = instance->GetCreature(*i); + if (!pTarget || pTarget->isDead() || pTarget->getFaction() != 14) + continue; + pTarget->setDeathState(JUST_DIED); + pTarget->RemoveCorpse(); + } + + // Earthen Guardians + for (std::vector::const_iterator i = earthenGuardian.begin(); i != earthenGuardian.end(); ++i) + { + Creature *pTarget = instance->GetCreature(*i); + if (!pTarget || pTarget->isDead() || pTarget->getFaction() != 14) + continue; + pTarget->setDeathState(JUST_DIED); + pTarget->RemoveCorpse(); + } + } + + void ActivateArchaedas(uint64 target) + { + Creature *archaedas = instance->GetCreature(archaedasGUID); + if (!archaedas) + return; + + if (Unit *victim = Unit::GetUnit(*archaedas, target)) + { + archaedas->CastSpell(archaedas, SPELL_ARCHAEDAS_AWAKEN,false); + whoWokeArchaedasGUID = target; + } + } + + void RespawnMinions() + { + // first respawn any aggroed wall minions + for (std::vector::const_iterator i = archaedasWallMinions.begin(); i != archaedasWallMinions.end(); ++i) + { + Creature *pTarget = instance->GetCreature(*i); + if (pTarget && pTarget->isDead()) + { + pTarget->Respawn(); + pTarget->GetMotionMaster()->MoveTargetedHome(); + SetFrozenState(pTarget); + } + } + + // Vault Walkers + for (std::vector::const_iterator i = vaultWalker.begin(); i != vaultWalker.end(); ++i) + { + Creature *pTarget = instance->GetCreature(*i); + if (pTarget && pTarget->isDead()) + { + pTarget->Respawn(); + pTarget->GetMotionMaster()->MoveTargetedHome(); + SetFrozenState(pTarget); + } + } + + // Earthen Guardians + for (std::vector::const_iterator i = earthenGuardian.begin(); i != earthenGuardian.end(); ++i) + { + Creature *pTarget = instance->GetCreature(*i); + if (pTarget && pTarget->isDead()) + { + pTarget->Respawn(); + pTarget->GetMotionMaster()->MoveTargetedHome(); + SetFrozenState(pTarget); + } + } + } + + void SetData (uint32 /*type*/, uint32 data) + { + //error_log ("SetData: data = %d", data); + if (data == 0) OpenDoor (altarOfTheKeeperTempleDoor); + if (data == 0) OpenDoor (archaedasTempleDoor); + if (data == 3) OpenDoor (ancientVaultDoor); + if (data == 1) ActivateStoneKeepers(); + if (data == 2) ActivateWallMinions(); + if (data == 4) DeActivateMinions(); + if (data == 5) RespawnMinions(); + } + + void SetData64 (uint32 type, uint64 data) + { + // Archaedas + if (type == 0) + { + ActivateArchaedas (data); + } + } + + void OnCreatureCreate(Creature* pCreature, bool /*add*/) + { + switch (pCreature->GetEntry()) { + case 4857: // Stone Keeper + SetFrozenState (pCreature); + stoneKeeper.push_back(pCreature->GetGUID()); + break; + + case 7309: // Earthen Custodian + archaedasWallMinions.push_back(pCreature->GetGUID()); + break; + + case 7077: // Earthen Hallshaper + archaedasWallMinions.push_back(pCreature->GetGUID()); + break; + + case 7076: // Earthen Guardian + earthenGuardian.push_back(pCreature->GetGUID()); + break; + + case 10120: // Vault Walker + vaultWalker.push_back(pCreature->GetGUID()); + break; + + case 2748: // Archaedas + archaedasGUID = pCreature->GetGUID(); + break; + + } // end switch + } // end OnCreatureCreate + + uint64 GetData64 (uint32 identifier) + { + if (identifier == 0) return whoWokeArchaedasGUID; + if (identifier == 1) return vaultWalker[0]; // VaultWalker1 + if (identifier == 2) return vaultWalker[1]; // VaultWalker2 + if (identifier == 3) return vaultWalker[2]; // VaultWalker3 + if (identifier == 4) return vaultWalker[3]; // VaultWalker4 + + if (identifier == 5) return earthenGuardian[0]; + if (identifier == 6) return earthenGuardian[1]; + if (identifier == 7) return earthenGuardian[2]; + if (identifier == 8) return earthenGuardian[3]; + if (identifier == 9) return earthenGuardian[4]; + if (identifier == 10) return earthenGuardian[5]; + + return 0; + } // end GetData64 +}; + +InstanceData* GetInstanceData_instance_uldaman(Map* pMap) +{ + return new instance_uldaman(pMap); +} + +void AddSC_instance_uldaman() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_uldaman"; + newscript->GetInstanceData = &GetInstanceData_instance_uldaman; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp b/src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp new file mode 100644 index 00000000000..2bd8387efa5 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/Uldaman/uldaman.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: Uldaman +SD%Complete: 100 +SDComment: Quest support: 2278 + 1 trash mob. +SDCategory: Uldaman +EndScriptData */ + +/* ContentData +mob_jadespine_basilisk +npc_lore_keeper_of_norgannon +EndContentData */ + +#include "ScriptedPch.h" + +/*###### +## mob_jadespine_basilisk +######*/ + +#define SPELL_CSLUMBER 3636 + +struct mob_jadespine_basiliskAI : public ScriptedAI +{ + mob_jadespine_basiliskAI(Creature *c) : ScriptedAI(c) {} + + uint32 Cslumber_Timer; + + void Reset() + { + Cslumber_Timer = 2000; + } + + void EnterCombat(Unit * /*who*/) + { + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //Cslumber_Timer + if (Cslumber_Timer <= diff) + { + //Cast + // DoCast(me->getVictim(), SPELL_CSLUMBER); + DoCast(me->getVictim(), SPELL_CSLUMBER, true); + + //Stop attacking target thast asleep and pick new target + Cslumber_Timer = 28000; + + Unit* Target = SelectUnit(SELECT_TARGET_TOPAGGRO, 0); + + if (!Target || Target == me->getVictim()) + Target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); + + if (Target) + me->TauntApply(Target); + + } else Cslumber_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_jadespine_basilisk(Creature* pCreature) +{ + return new mob_jadespine_basiliskAI (pCreature); +} + +/*###### +## npc_lore_keeper_of_norgannon +######*/ + +#define GOSSIP_HELLO_KEEPER "Who are the Earthen?" +#define GOSSIP_SELECT_KEEPER1 "What is a \"subterranean being matrix\"?" +#define GOSSIP_SELECT_KEEPER2 "What are the anomalies you speak of?" +#define GOSSIP_SELECT_KEEPER3 "What is a resilient foundation of construction?" +#define GOSSIP_SELECT_KEEPER4 "So... the Earthen were made out of stone?" +#define GOSSIP_SELECT_KEEPER5 "Anything else I should know about the Earthen?" +#define GOSSIP_SELECT_KEEPER6 "I think I understand the Creators' design intent for the Earthen now. What are the Earthen's anomalies that you spoke of earlier?" +#define GOSSIP_SELECT_KEEPER7 "What high-stress environments would cause the Earthen to destabilize?" +#define GOSSIP_SELECT_KEEPER8 "What happens when the Earthen destabilize?" +#define GOSSIP_SELECT_KEEPER9 "Troggs?! Are the troggs you mention the same as the ones in the world today?" +#define GOSSIP_SELECT_KEEPER10 "You mentioned two results when the Earthen destabilize. What is the second?" +#define GOSSIP_SELECT_KEEPER11 "Dwarves!!! Now you're telling me that dwarves originally came from the Earthen?!" +#define GOSSIP_SELECT_KEEPER12 "These dwarves are the same ones today, yes? Do the dwarves maintain any other links to the Earthen?" +#define GOSSIP_SELECT_KEEPER13 "Who are the Creators?" +#define GOSSIP_SELECT_KEEPER14 "This is a lot to think about." +#define GOSSIP_SELECT_KEEPER15 "I will access the discs now." + +bool GossipHello_npc_lore_keeper_of_norgannon(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetQuestStatus(2278) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO_KEEPER, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(1079, pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_lore_keeper_of_norgannon(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction) +{ + switch (uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + pPlayer->SEND_GOSSIP_MENU(1080, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); + pPlayer->SEND_GOSSIP_MENU(1081, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); + pPlayer->SEND_GOSSIP_MENU(1082, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+4: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); + pPlayer->SEND_GOSSIP_MENU(1083, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+5: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6); + pPlayer->SEND_GOSSIP_MENU(1084, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+6: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+7); + pPlayer->SEND_GOSSIP_MENU(1085, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+7: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+8); + pPlayer->SEND_GOSSIP_MENU(1086, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+8: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER8, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+9); + pPlayer->SEND_GOSSIP_MENU(1087, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+9: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER9, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+10); + pPlayer->SEND_GOSSIP_MENU(1088, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+10: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER10, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+11); + pPlayer->SEND_GOSSIP_MENU(1089, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+11: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER11, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+12); + pPlayer->SEND_GOSSIP_MENU(1090, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+12: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER12, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+13); + pPlayer->SEND_GOSSIP_MENU(1091, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+13: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER13, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+14); + pPlayer->SEND_GOSSIP_MENU(1092, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+14: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER14, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+15); + pPlayer->SEND_GOSSIP_MENU(1093, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+15: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER15, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+16); + pPlayer->SEND_GOSSIP_MENU(1094, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+16: + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->AreaExploredOrEventHappens(2278); + break; + } + return true; +} + +void AddSC_uldaman() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "mob_jadespine_basilisk"; + newscript->GetAI = &GetAI_mob_jadespine_basilisk; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_lore_keeper_of_norgannon"; + newscript->pGossipHello = &GossipHello_npc_lore_keeper_of_norgannon; + newscript->pGossipSelect = &GossipSelect_npc_lore_keeper_of_norgannon; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp new file mode 100644 index 00000000000..f516065cc03 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp @@ -0,0 +1,467 @@ +/* Copyright ?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_Akilzon +SD%Complete: 75% +SDComment: Missing timer for Call Lightning and Sound ID's +SQLUpdate: +#Temporary fix for Soaring Eagles + +EndScriptData */ + +#include "ScriptedPch.h" +#include "zulaman.h" +#include "Weather.h" + +#define SPELL_STATIC_DISRUPTION 43622 +#define SPELL_STATIC_VISUAL 45265 +#define SPELL_CALL_LIGHTNING 43661 //Missing timer +#define SPELL_GUST_OF_WIND 43621 +#define SPELL_ELECTRICAL_STORM 43648 +#define SPELL_BERSERK 45078 +#define SPELL_ELECTRICAL_DAMAGE 43657 +#define SPELL_ELECTRICAL_OVERLOAD 43658 +#define SPELL_EAGLE_SWOOP 44732 + +//"Your death gonna be quick, strangers. You shoulda never have come to this place..." +#define SAY_ONAGGRO "I be da predator! You da prey..." +#define SAY_ONDEATH "You can't... kill... me spirit!" +#define SAY_ONSLAY1 "Ya got nothin'!" +#define SAY_ONSLAY2 "Stop your cryin'!" +#define SAY_ONSUMMON "Feed, me bruddahs!" +#define SAY_ONENRAGE "All you be doing is wasting my time!" +#define SOUND_ONAGGRO 12013 +#define SOUND_ONDEATH 12019 +#define SOUND_ONSLAY1 12017 +#define SOUND_ONSLAY2 12018 +#define SOUND_ONSUMMON 12014 +#define SOUND_ONENRAGE 12016 + +#define MOB_SOARING_EAGLE 24858 +#define SE_LOC_X_MAX 400 +#define SE_LOC_X_MIN 335 +#define SE_LOC_Y_MAX 1435 +#define SE_LOC_Y_MIN 1370 + +struct boss_akilzonAI : public ScriptedAI +{ + boss_akilzonAI(Creature *c) : ScriptedAI(c) + { + SpellEntry *TempSpell = GET_SPELL(SPELL_ELECTRICAL_DAMAGE); + if (TempSpell) + TempSpell->EffectBasePoints[1] = 49;//disable bugged lightning until fixed in core + pInstance = c->GetInstanceData(); + } + ScriptedInstance *pInstance; + + uint64 BirdGUIDs[8]; + uint64 TargetGUID; + uint64 CycloneGUID; + uint64 CloudGUID; + + uint32 StaticDisruption_Timer; + uint32 GustOfWind_Timer; + uint32 CallLighting_Timer; + uint32 ElectricalStorm_Timer; + uint32 SummonEagles_Timer; + uint32 Enrage_Timer; + + uint32 StormCount; + uint32 StormSequenceTimer; + + bool isRaining; + + void Reset() + { + if (pInstance) + pInstance->SetData(DATA_AKILZONEVENT, NOT_STARTED); + + StaticDisruption_Timer = urand(10000,20000); //10 to 20 seconds (bosskillers) + GustOfWind_Timer = urand(20000,30000); //20 to 30 seconds(bosskillers) + CallLighting_Timer = urand(10000,20000); //totaly random timer. can't find any info on this + ElectricalStorm_Timer = 60000; //60 seconds(bosskillers) + Enrage_Timer = 10*MINUTE*IN_MILISECONDS; //10 minutes till enrage(bosskillers) + SummonEagles_Timer = 99999; + + TargetGUID = 0; + CloudGUID = 0; + CycloneGUID = 0; + DespawnSummons(); + for (uint8 i = 0; i < 8; ++i) + BirdGUIDs[i] = 0; + + StormCount = 0; + StormSequenceTimer = 0; + + isRaining = false; + + SetWeather(WEATHER_STATE_FINE, 0.0f); + } + + void EnterCombat(Unit * /*who*/) + { + me->MonsterYell(SAY_ONAGGRO, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_ONAGGRO); + //DoZoneInCombat(); + if (pInstance) + pInstance->SetData(DATA_AKILZONEVENT, IN_PROGRESS); + } + + void JustDied(Unit* /*Killer*/) + { + me->MonsterYell(SAY_ONDEATH,LANG_UNIVERSAL,NULL); + DoPlaySoundToSet(me, SOUND_ONDEATH); + if (pInstance) + pInstance->SetData(DATA_AKILZONEVENT, DONE); + DespawnSummons(); + } + + void KilledUnit(Unit* /*victim*/) + { + switch (urand(0,1)) + { + case 0: + me->MonsterYell(SAY_ONSLAY1, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_ONSLAY1); + break; + case 1: + me->MonsterYell(SAY_ONSLAY2, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_ONSLAY2); + break; + } + } + + void DespawnSummons() + { + for (uint8 i = 0; i < 8; ++i) + { + Unit* bird = Unit::GetUnit(*me,BirdGUIDs[i]); + if (bird && bird->isAlive()) + { + bird->SetVisibility(VISIBILITY_OFF); + bird->setDeathState(JUST_DIED); + } + } + } + + void SetWeather(uint32 weather, float grade) + { + Map* pMap = me->GetMap(); + if (!pMap->IsDungeon()) + return; + + WorldPacket data(SMSG_WEATHER, (4+4+4)); + data << uint32(weather) << float(grade) << uint8(0); + + pMap->SendToPlayers(&data); + } + + void HandleStormSequence(Unit *Cloud) // 1: begin, 2-9: tick, 10: end + { + if (StormCount < 10 && StormCount > 1) + { + // deal damage + int32 bp0 = 800; + for (uint8 i = 2; i < StormCount; ++i) + bp0 *= 2; + + CellPair p(Trinity::ComputeCellPair(me->GetPositionX(), me->GetPositionY())); + Cell cell(p); + cell.data.Part.reserved = ALL_DISTRICT; + cell.SetNoCreate(); + + std::list tempUnitMap; + + { + Trinity::AnyAoETargetUnitInObjectRangeCheck u_check(me, me, 999); + Trinity::UnitListSearcher searcher(me, tempUnitMap, u_check); + + TypeContainerVisitor, WorldTypeMapContainer > world_unit_searcher(searcher); + TypeContainerVisitor, GridTypeMapContainer > grid_unit_searcher(searcher); + + cell.Visit(p, world_unit_searcher, *(me->GetMap())); + cell.Visit(p, grid_unit_searcher, *(me->GetMap())); + } + //dealdamege + for (std::list::const_iterator i = tempUnitMap.begin(); i != tempUnitMap.end(); ++i) + { + if (!Cloud->IsWithinDist(*i, 6, false)) + { + Cloud->CastCustomSpell(*i, 43137, &bp0, NULL, NULL, true, 0, 0, me->GetGUID()); + } + } + // visual + float x,y,z; + z = me->GetPositionZ(); + for (uint8 i = 0; i < 5+rand()%5; ++i) + { + x = 343+rand()%60; + y = 1380+rand()%60; + if (Unit *trigger = me->SummonTrigger(x, y, z, 0, 2000)) + { + trigger->setFaction(35); + trigger->SetMaxHealth(100000); + trigger->SetHealth(100000); + trigger->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + if (Cloud) + Cloud->CastCustomSpell(trigger, /*43661*/43137, &bp0, NULL, NULL,true, 0, 0, Cloud->GetGUID()); + } + } + } + ++StormCount; + if (StormCount > 10) + { + StormCount = 0; // finish + SummonEagles_Timer = 5000; + me->InterruptNonMeleeSpells(false); + CloudGUID = 0; + if (Cloud) + Cloud->DealDamage(Cloud, Cloud->GetHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + SetWeather(WEATHER_STATE_FINE, 0.0f); + isRaining = false; + } + StormSequenceTimer = 1000; + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (StormCount) + { + Unit *pTarget = Unit::GetUnit(*me, CloudGUID); + if (!pTarget || !pTarget->isAlive()) + { + EnterEvadeMode(); + return; + } + else if (Unit* Cyclone = Unit::GetUnit(*me, CycloneGUID)) + Cyclone->CastSpell(pTarget, 25160, true); // keep casting or... + + if (StormSequenceTimer <= diff) + HandleStormSequence(pTarget); + else + StormSequenceTimer -= diff; + + return; + } + + if (Enrage_Timer <= diff) + { + me->MonsterYell(SAY_ONENRAGE, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_ONENRAGE); + DoCast(me, SPELL_BERSERK, true); + Enrage_Timer = 600000; + } else Enrage_Timer -= diff; + + if (StaticDisruption_Timer <= diff) + { + Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1); + if (!pTarget) pTarget = me->getVictim(); + TargetGUID = pTarget->GetGUID(); + DoCast(pTarget, SPELL_STATIC_DISRUPTION, false); + me->SetInFront(me->getVictim()); + StaticDisruption_Timer = (10+rand()%8)*1000; // < 20s + + /*if (float dist = me->IsWithinDist3d(pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 5.0f) dist = 5.0f; + SDisruptAOEVisual_Timer = 1000 + floor(dist / 30 * 1000.0f);*/ + } else StaticDisruption_Timer -= diff; + + if (GustOfWind_Timer <= diff) + { + Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1); + if (!pTarget) pTarget = me->getVictim(); + DoCast(pTarget, SPELL_GUST_OF_WIND); + GustOfWind_Timer = (20+rand()%10)*1000; //20 to 30 seconds(bosskillers) + } else GustOfWind_Timer -= diff; + + if (CallLighting_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_CALL_LIGHTNING); + CallLighting_Timer = (12 + rand()%5)*1000; //totaly random timer. can't find any info on this + } else CallLighting_Timer -= diff; + + if (!isRaining && ElectricalStorm_Timer < 8000 + rand()%5000) + { + SetWeather(WEATHER_STATE_HEAVY_RAIN, 0.9999f); + isRaining = true; + } + + if (ElectricalStorm_Timer <= diff) { + Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 50, true); + if (!pTarget) + { + EnterEvadeMode(); + return; + } + pTarget->CastSpell(pTarget, 44007, true);//cloud visual + DoCast(pTarget, SPELL_ELECTRICAL_STORM, false);//storm cyclon + visual + float x,y,z; + pTarget->GetPosition(x,y,z); + if (pTarget) + { + pTarget->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); + pTarget->SendMonsterMove(x,y,me->GetPositionZ()+15,0); + } + Unit *Cloud = me->SummonTrigger(x, y, me->GetPositionZ()+16, 0, 15000); + if (Cloud) + { + CloudGUID = Cloud->GetGUID(); + Cloud->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); + Cloud->StopMoving(); + Cloud->SetFloatValue(OBJECT_FIELD_SCALE_X, 1.0f); + Cloud->setFaction(35); + Cloud->SetMaxHealth(9999999); + Cloud->SetHealth(9999999); + Cloud->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + } + ElectricalStorm_Timer = 60000; //60 seconds(bosskillers) + StormCount = 1; + StormSequenceTimer = 0; + } else ElectricalStorm_Timer -= diff; + + if (SummonEagles_Timer <= diff) + { + me->MonsterYell(SAY_ONSUMMON, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_ONSUMMON); + + float x, y, z; + me->GetPosition(x, y, z); + + for (uint8 i = 0; i < 8; ++i) + { + Unit* bird = Unit::GetUnit(*me,BirdGUIDs[i]); + if (!bird) //they despawned on die + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + x = pTarget->GetPositionX() + irand(-10,10); + y = pTarget->GetPositionY() + irand(-10,10); + z = pTarget->GetPositionZ() + urand(16,20); + if (z > 95) + z = 95 - urand(0,5); + } + Creature *pCreature = me->SummonCreature(MOB_SOARING_EAGLE, x, y, z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); + if (pCreature) + { + pCreature->AddThreat(me->getVictim(), 1.0f); + pCreature->AI()->AttackStart(me->getVictim()); + BirdGUIDs[i] = pCreature->GetGUID(); + } + } + } + SummonEagles_Timer = 999999; + } else SummonEagles_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct mob_soaring_eagleAI : public ScriptedAI +{ + mob_soaring_eagleAI(Creature *c) : ScriptedAI(c) {} + + uint32 EagleSwoop_Timer; + bool arrived; + uint32 TargetGUID; + + void Reset() + { + EagleSwoop_Timer = 5000 + rand()%5000; + arrived = true; + TargetGUID = 0; + me->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); + } + + void EnterCombat(Unit * /*who*/) {DoZoneInCombat();} + + void MoveInLineOfSight(Unit* /*who*/) {} + + void MovementInform(uint32, uint32) + { + arrived = true; + if (TargetGUID) + { + if (Unit *pTarget = Unit::GetUnit(*me, TargetGUID)) + DoCast(pTarget, SPELL_EAGLE_SWOOP, true); + TargetGUID = 0; + me->SetSpeed(MOVE_RUN, 1.2f); + EagleSwoop_Timer = 5000 + rand()%5000; + } + } + + void UpdateAI(const uint32 diff) + { + if (EagleSwoop_Timer <= diff) + EagleSwoop_Timer = 0; + else + EagleSwoop_Timer -= diff; + + if (arrived) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + float x, y, z; + if (EagleSwoop_Timer) + { + x = pTarget->GetPositionX() + irand(-10,10); + y = pTarget->GetPositionY() + irand(-10,10); + z = pTarget->GetPositionZ() + urand(10,15); + if (z > 95) + z = 95 - urand(0,5); + } + else + { + pTarget->GetContactPoint(me, x, y, z); + z += 2; + me->SetSpeed(MOVE_RUN, 5.0f); + TargetGUID = pTarget->GetGUID(); + } + me->GetMotionMaster()->MovePoint(0, x, y, z); + arrived = false; + } + } + } +}; + +//Soaring Eagle +CreatureAI* GetAI_mob_soaring_eagle(Creature* pCreature) +{ + return new mob_soaring_eagleAI(pCreature); +} + +CreatureAI* GetAI_boss_akilzon(Creature* pCreature) +{ + return new boss_akilzonAI(pCreature); +} + +void AddSC_boss_akilzon() +{ + Script *newscript = NULL; + + newscript = new Script; + newscript->Name = "boss_akilzon"; + newscript->GetAI = &GetAI_boss_akilzon; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_akilzon_eagle"; + newscript->GetAI = &GetAI_mob_soaring_eagle; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp new file mode 100644 index 00000000000..aee0a8a59ea --- /dev/null +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp @@ -0,0 +1,401 @@ +/* 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_Halazzi +SD%Complete: 80 +SDComment: +SDCategory: Zul'Aman +EndScriptData */ + +#include "ScriptedPch.h" +#include "zulaman.h" +//#include "spell.h" + +#define YELL_AGGRO "Get on your knees and bow to da fang and claw!" +#define SOUND_AGGRO 12020 +#define YELL_SABER_ONE "You gonna leave in pieces!" +#define YELL_SABER_TWO "Me gonna carve ya now!" +#define YELL_SPLIT "Me gonna carve ya now!" +#define SOUND_SPLIT 12021 +#define YELL_MERGE "Spirit, come back to me!" +#define SOUND_MERGE 12022 +#define YELL_KILL_ONE "You cant fight the power!" +#define SOUND_KILL_ONE 12026 +#define YELL_KILL_TWO "You gonna fail!" +#define SOUND_KILL_TWO 12027 +#define YELL_DEATH "Chaga... choka'jinn." +#define SOUND_DEATH 12028 +#define YELL_BERSERK "Whatch you be doing? Pissin' yourselves..." +#define SOUND_BERSERK 12025 + +#define SPELL_DUAL_WIELD 29651 +#define SPELL_SABER_LASH 43267 +#define SPELL_FRENZY 43139 +#define SPELL_FLAMESHOCK 43303 +#define SPELL_EARTHSHOCK 43305 +#define SPELL_TRANSFORM_SPLIT 43142 +#define SPELL_TRANSFORM_SPLIT2 43573 +#define SPELL_TRANSFORM_MERGE 43271 +#define SPELL_SUMMON_LYNX 43143 +#define SPELL_SUMMON_TOTEM 43302 +#define SPELL_BERSERK 45078 + +#define MOB_SPIRIT_LYNX 24143 +#define SPELL_LYNX_FRENZY 43290 +#define SPELL_SHRED_ARMOR 43243 + +#define MOB_TOTEM 24224 +#define SPELL_LIGHTNING 43301 + +enum PhaseHalazzi +{ + PHASE_NONE = 0, + PHASE_LYNX = 1, + PHASE_SPLIT = 2, + PHASE_HUMAN = 3, + PHASE_MERGE = 4, + PHASE_ENRAGE = 5 +}; + +struct boss_halazziAI : public ScriptedAI +{ + boss_halazziAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + // need to find out what controls totem's spell cooldown + SpellEntry *TempSpell = GET_SPELL(SPELL_LIGHTNING); + if (TempSpell && TempSpell->CastingTimeIndex != 5) + TempSpell->CastingTimeIndex = 5; // 2000 ms casting time + } + + ScriptedInstance *pInstance; + + uint32 FrenzyTimer; + uint32 SaberlashTimer; + uint32 ShockTimer; + uint32 TotemTimer; + uint32 CheckTimer; + uint32 BerserkTimer; + + uint32 TransformCount; + + PhaseHalazzi Phase; + + uint64 LynxGUID; + + void Reset() + { + if (pInstance) + pInstance->SetData(DATA_HALAZZIEVENT, NOT_STARTED); + + TransformCount = 0; + BerserkTimer = 600000; + CheckTimer = 1000; + + DoCast(me, SPELL_DUAL_WIELD, true); + + Phase = PHASE_NONE; + EnterPhase(PHASE_LYNX); + } + + void EnterCombat(Unit * /*who*/) + { + if (pInstance) + pInstance->SetData(DATA_HALAZZIEVENT, IN_PROGRESS); + + me->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_AGGRO); + + EnterPhase(PHASE_LYNX); + } + + void JustSummoned(Creature* summon) + { + summon->AI()->AttackStart(me->getVictim()); + if (summon->GetEntry() == MOB_SPIRIT_LYNX) + LynxGUID = summon->GetGUID(); + } + + void DamageTaken(Unit * /*done_by*/, uint32 &damage) + { + if (damage >= me->GetHealth() && Phase != PHASE_ENRAGE) + damage = 0; + } + + void SpellHit(Unit*, const SpellEntry *spell) + { + if (spell->Id == SPELL_TRANSFORM_SPLIT2) + EnterPhase(PHASE_HUMAN); + } + + void AttackStart(Unit *who) + { + if (Phase != PHASE_MERGE) ScriptedAI::AttackStart(who); + } + + void EnterPhase(PhaseHalazzi NextPhase) + { + switch(NextPhase) + { + case PHASE_LYNX: + case PHASE_ENRAGE: + if (Phase == PHASE_MERGE) + { + DoCast(me, SPELL_TRANSFORM_MERGE, true); + me->Attack(me->getVictim(), true); + me->GetMotionMaster()->MoveChase(me->getVictim()); + } + if (Creature *Lynx = Unit::GetCreature(*me, LynxGUID)) + Lynx->DisappearAndDie(); + me->SetMaxHealth(600000); + me->SetHealth(600000 - 150000 * TransformCount); + FrenzyTimer = 16000; + SaberlashTimer = 20000; + ShockTimer = 10000; + TotemTimer = 12000; + break; + case PHASE_SPLIT: + me->MonsterYell(YELL_SPLIT, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_SPLIT); + DoCast(me, SPELL_TRANSFORM_SPLIT, true); + break; + case PHASE_HUMAN: + //DoCast(me, SPELL_SUMMON_LYNX, true); + DoSpawnCreature(MOB_SPIRIT_LYNX, 5,5,0,0, TEMPSUMMON_CORPSE_DESPAWN, 0); + me->SetMaxHealth(400000); + me->SetHealth(400000); + ShockTimer = 10000; + TotemTimer = 12000; + break; + case PHASE_MERGE: + if (Unit *pLynx = Unit::GetUnit(*me, LynxGUID)) + { + me->MonsterYell(YELL_MERGE, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_MERGE); + pLynx->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + pLynx->GetMotionMaster()->Clear(); + pLynx->GetMotionMaster()->MoveFollow(me, 0, 0); + me->GetMotionMaster()->Clear(); + me->GetMotionMaster()->MoveFollow(pLynx, 0, 0); + ++TransformCount; + } + break; + default: + break; + } + Phase = NextPhase; + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (BerserkTimer <= diff) + { + me->MonsterYell(YELL_BERSERK, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_BERSERK); + DoCast(me, SPELL_BERSERK, true); + BerserkTimer = 60000; + } else BerserkTimer -= diff; + + if (Phase == PHASE_LYNX || Phase == PHASE_ENRAGE) + { + if (SaberlashTimer <= diff) + { + // A tank with more than 490 defense skills should receive no critical hit + //DoCast(me, 41296, true); + DoCast(me->getVictim(), SPELL_SABER_LASH, true); + //me->RemoveAurasDueToSpell(41296); + SaberlashTimer = 30000; + } else SaberlashTimer -= diff; + + if (FrenzyTimer <= diff) + { + DoCast(me, SPELL_FRENZY); + FrenzyTimer = urand(10000,15000); + } else FrenzyTimer -= diff; + + if (Phase == PHASE_LYNX) + if (CheckTimer <= diff) + { + if (me->GetHealth() * 4 < me->GetMaxHealth() * (3 - TransformCount)) + EnterPhase(PHASE_SPLIT); + CheckTimer = 1000; + } else CheckTimer -= diff; + } + + if (Phase == PHASE_HUMAN || Phase == PHASE_ENRAGE) + { + if (TotemTimer <= diff) + { + DoCast(me, SPELL_SUMMON_TOTEM); + TotemTimer = 20000; + } else TotemTimer -= diff; + + if (ShockTimer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + { + if (pTarget->IsNonMeleeSpellCasted(false)) + DoCast(pTarget, SPELL_EARTHSHOCK); + else + DoCast(pTarget, SPELL_FLAMESHOCK); + ShockTimer = 10000 + rand()%5000; + } + } else ShockTimer -= diff; + + if (Phase == PHASE_HUMAN) + if (CheckTimer <= diff) + { + if (((me->GetHealth()*100) / me->GetMaxHealth() <= 20)/*me->GetHealth() * 10 < me->GetMaxHealth()*/) + EnterPhase(PHASE_MERGE); + else + { + Unit *Lynx = Unit::GetUnit(*me, LynxGUID); + if (Lynx && ((Lynx->GetHealth()*100) / Lynx->GetMaxHealth() <= 20)/*Lynx->GetHealth() * 10 < Lynx->GetMaxHealth()*/) + EnterPhase(PHASE_MERGE); + } + CheckTimer = 1000; + } else CheckTimer -= diff; + } + + if (Phase == PHASE_MERGE) + { + if (CheckTimer <= diff) + { + Unit *Lynx = Unit::GetUnit(*me, LynxGUID); + if (Lynx) + { + Lynx->GetMotionMaster()->MoveFollow(me, 0, 0); + me->GetMotionMaster()->MoveFollow(Lynx, 0, 0); + if (me->IsWithinDistInMap(Lynx, 6.0f)) + { + if (TransformCount < 3) + EnterPhase(PHASE_LYNX); + else + EnterPhase(PHASE_ENRAGE); + } + } + CheckTimer = 1000; + } else CheckTimer -= diff; + } + + DoMeleeAttackIfReady(); + } + + void KilledUnit(Unit* /*victim*/) + { + switch (urand(0,1)) + { + case 0: + me->MonsterYell(YELL_KILL_ONE, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_KILL_ONE); + break; + + case 1: + me->MonsterYell(YELL_KILL_TWO, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_KILL_TWO); + break; + } + } + + void JustDied(Unit* /*Killer*/) + { + if (pInstance) + pInstance->SetData(DATA_HALAZZIEVENT, DONE); + + me->MonsterYell(YELL_DEATH, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_DEATH); + } +}; + +// Spirits Lynx AI + +struct boss_spiritlynxAI : public ScriptedAI +{ + boss_spiritlynxAI(Creature *c) : ScriptedAI(c) {} + + uint32 FrenzyTimer; + uint32 shredder_timer; + + void Reset() + { + FrenzyTimer = urand(30000,50000); //frenzy every 30-50 seconds + shredder_timer = 4000; + } + + void DamageTaken(Unit * /*done_by*/, uint32 &damage) + { + if (damage >= me->GetHealth()) + damage = 0; + } + + void AttackStart(Unit *who) + { + if (!me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + ScriptedAI::AttackStart(who); + } + + void EnterCombat(Unit * /*who*/) {/*DoZoneInCombat();*/} + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (FrenzyTimer <= diff) + { + DoCast(me, SPELL_LYNX_FRENZY); + FrenzyTimer = urand(30000,50000); //frenzy every 30-50 seconds + } else FrenzyTimer -= diff; + + if (shredder_timer <= diff) + { + DoCast(me->getVictim(), SPELL_SHRED_ARMOR); + shredder_timer = 4000; + } else shredder_timer -= diff; + + DoMeleeAttackIfReady(); + } + +}; + +CreatureAI* GetAI_boss_halazziAI(Creature* pCreature) +{ + return new boss_halazziAI (pCreature); +} + +CreatureAI* GetAI_boss_spiritlynxAI(Creature* pCreature) +{ + return new boss_spiritlynxAI (pCreature); +} + +void AddSC_boss_halazzi() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_halazzi"; + newscript->GetAI = &GetAI_boss_halazziAI; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_halazzi_lynx"; + newscript->GetAI = &GetAI_boss_spiritlynxAI; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp new file mode 100644 index 00000000000..7baa9292142 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp @@ -0,0 +1,907 @@ +/* Copyright ?2006,2007 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_Hex_Lord_Malacrass +SD%Complete: +SDComment: +SDCategory: Zul'Aman +EndScriptData */ + +#include "ScriptedPch.h" +#include "zulaman.h" + +#define YELL_AGGRO "Da shadow gonna fall on you... " +#define SOUND_YELL_AGGRO 12041 +#define YELL_SPIRIT_BOLTS "Your soul gonna bleed!" +#define SOUND_YELL_SPIRIT_BOLTS 12047 +#define YELL_DRAIN_POWER "Darkness comin\' for you" +#define SOUND_YELL_DRAIN_POWER 12046 +#define YELL_KILL_ONE "Dis a nightmare ya don\' wake up from!" +#define SOUND_YELL_KILL_ONE 12043 +#define YELL_KILL_TWO "Azzaga choogo zinn!" +#define SOUND_YELL_KILL_TWO 12044 +#define YELL_DEATH "Dis not... da end of me..." +#define SOUND_YELL_DEATH 12051 + +#define SPELL_SPIRIT_BOLTS 43383 +#define SPELL_DRAIN_POWER 44131 +#define SPELL_SIPHON_SOUL 43501 + +#define MOB_TEMP_TRIGGER 23920 + +//Defines for various powers he uses after using soul drain + +//Druid +#define SPELL_DR_LIFEBLOOM 43421 +#define SPELL_DR_THORNS 43420 +#define SPELL_DR_MOONFIRE 43545 + +//Hunter +#define SPELL_HU_EXPLOSIVE_TRAP 43444 +#define SPELL_HU_FREEZING_TRAP 43447 +#define SPELL_HU_SNAKE_TRAP 43449 + +//Mage +#define SPELL_MG_FIREBALL 41383 +#define SPELL_MG_FROSTBOLT 43428 +#define SPELL_MG_FROST_NOVA 43426 +#define SPELL_MG_ICE_LANCE 43427 + +//Paladin +#define SPELL_PA_CONSECRATION 43429 +#define SPELL_PA_HOLY_LIGHT 43451 +#define SPELL_PA_AVENGING_WRATH 43430 + +//Priest +#define SPELL_PR_HEAL 41372 +#define SPELL_PR_MIND_CONTROL 43550 +#define SPELL_PR_MIND_BLAST 41374 +#define SPELL_PR_SW_DEATH 41375 +#define SPELL_PR_PSYCHIC_SCREAM 43432 +#define SPELL_PR_PAIN_SUPP 44416 + +//Rogue +#define SPELL_RO_BLIND 43433 +#define SPELL_RO_SLICE_DICE 43457 +#define SPELL_RO_WOUND_POISON 39665 + +//Shaman +#define SPELL_SH_FIRE_NOVA 43436 +#define SPELL_SH_HEALING_WAVE 43548 +#define SPELL_SH_CHAIN_LIGHT 43435 + +//Warlock +#define SPELL_WL_CURSE_OF_DOOM 43439 +#define SPELL_WL_RAIN_OF_FIRE 43440 +#define SPELL_WL_UNSTABLE_AFFL 35183 + +//Warrior +#define SPELL_WR_SPELL_REFLECT 43443 +#define SPELL_WR_WHIRLWIND 43442 +#define SPELL_WR_MORTAL_STRIKE 43441 + +#define ORIENT 1.5696 +#define POS_Y 921.2795 +#define POS_Z 33.8883 + +static float Pos_X[4] = {112.8827, 107.8827, 122.8827, 127.8827}; + +static uint32 AddEntryList[8]= +{ + 24240, //Alyson Antille + 24241, //Thurg + 24242, //Slither + 24243, //Lord Raadan + 24244, //Gazakroth + 24245, //Fenstalker + 24246, //Darkheart + 24247 //Koragg +}; + +enum AbilityTarget +{ + ABILITY_TARGET_SELF = 0, + ABILITY_TARGET_VICTIM = 1, + ABILITY_TARGET_ENEMY = 2, + ABILITY_TARGET_HEAL = 3, + ABILITY_TARGET_BUFF = 4, + ABILITY_TARGET_SPECIAL = 5 +}; + +struct PlayerAbilityStruct +{ + uint32 spell; + AbilityTarget target; + uint32 cooldown; +}; + +static PlayerAbilityStruct PlayerAbility[][3] = +{ + // 1 warrior + {{SPELL_WR_SPELL_REFLECT, ABILITY_TARGET_SELF, 10000}, + {SPELL_WR_WHIRLWIND, ABILITY_TARGET_SELF, 10000}, + {SPELL_WR_MORTAL_STRIKE, ABILITY_TARGET_VICTIM, 6000}}, + // 2 paladin + {{SPELL_PA_CONSECRATION, ABILITY_TARGET_SELF, 10000}, + {SPELL_PA_HOLY_LIGHT, ABILITY_TARGET_HEAL, 10000}, + {SPELL_PA_AVENGING_WRATH, ABILITY_TARGET_SELF, 10000}}, + // 3 hunter + {{SPELL_HU_EXPLOSIVE_TRAP, ABILITY_TARGET_SELF, 10000}, + {SPELL_HU_FREEZING_TRAP, ABILITY_TARGET_SELF, 10000}, + {SPELL_HU_SNAKE_TRAP, ABILITY_TARGET_SELF, 10000}}, + // 4 rogue + {{SPELL_RO_WOUND_POISON, ABILITY_TARGET_VICTIM, 3000}, + {SPELL_RO_SLICE_DICE, ABILITY_TARGET_SELF, 10000}, + {SPELL_RO_BLIND, ABILITY_TARGET_ENEMY, 10000}}, + // 5 priest + {{SPELL_PR_PAIN_SUPP, ABILITY_TARGET_HEAL, 10000}, + {SPELL_PR_HEAL, ABILITY_TARGET_HEAL, 10000}, + {SPELL_PR_PSYCHIC_SCREAM, ABILITY_TARGET_SELF, 10000}}, + // 5* shadow priest + {{SPELL_PR_MIND_CONTROL, ABILITY_TARGET_ENEMY, 15000}, + {SPELL_PR_MIND_BLAST, ABILITY_TARGET_ENEMY, 5000}, + {SPELL_PR_SW_DEATH, ABILITY_TARGET_ENEMY, 10000}}, + // 7 shaman + {{SPELL_SH_FIRE_NOVA, ABILITY_TARGET_SELF, 10000}, + {SPELL_SH_HEALING_WAVE, ABILITY_TARGET_HEAL, 10000}, + {SPELL_SH_CHAIN_LIGHT, ABILITY_TARGET_ENEMY, 8000}}, + // 8 mage + {{SPELL_MG_FIREBALL, ABILITY_TARGET_ENEMY, 5000}, + {SPELL_MG_FROSTBOLT, ABILITY_TARGET_ENEMY, 5000}, + {SPELL_MG_ICE_LANCE, ABILITY_TARGET_SPECIAL, 2000}}, + // 9 warlock + {{SPELL_WL_CURSE_OF_DOOM, ABILITY_TARGET_ENEMY, 10000}, + {SPELL_WL_RAIN_OF_FIRE, ABILITY_TARGET_ENEMY, 10000}, + {SPELL_WL_UNSTABLE_AFFL, ABILITY_TARGET_ENEMY, 10000}}, + // 11 druid + {{SPELL_DR_LIFEBLOOM, ABILITY_TARGET_HEAL, 10000}, + {SPELL_DR_THORNS, ABILITY_TARGET_SELF, 10000}, + {SPELL_DR_MOONFIRE, ABILITY_TARGET_ENEMY, 8000}} +}; + +struct boss_hexlord_addAI : public ScriptedAI +{ + ScriptedInstance* pInstance; + + boss_hexlord_addAI(Creature* c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + void Reset() {} + + void EnterCombat(Unit* /*who*/) {DoZoneInCombat();} + + void UpdateAI(const uint32 /*diff*/) + { + if (pInstance && pInstance->GetData(DATA_HEXLORDEVENT) != IN_PROGRESS) + { + EnterEvadeMode(); + return; + } + + DoMeleeAttackIfReady(); + } +}; + +struct boss_hex_lord_malacrassAI : public ScriptedAI +{ + boss_hex_lord_malacrassAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + SelectAddEntry(); + for (uint8 i = 0; i < 4; ++i) + AddGUID[i] = 0; + } + + ScriptedInstance *pInstance; + + uint64 AddGUID[4]; + uint32 AddEntry[4]; + + uint64 PlayerGUID; + + uint32 SpiritBolts_Timer; + uint32 DrainPower_Timer; + uint32 SiphonSoul_Timer; + uint32 PlayerAbility_Timer; + uint32 CheckAddState_Timer; + uint32 ResetTimer; + + uint32 PlayerClass; + + void Reset() + { + if (pInstance) + pInstance->SetData(DATA_HEXLORDEVENT, NOT_STARTED); + + SpiritBolts_Timer = 20000; + DrainPower_Timer = 60000; + SiphonSoul_Timer = 100000; + PlayerAbility_Timer = 99999; + CheckAddState_Timer = 5000; + ResetTimer = 5000; + + SpawnAdds(); + + me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 46916); + me->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE); + } + + void EnterCombat(Unit* /*who*/) + { + if (pInstance) + pInstance->SetData(DATA_HEXLORDEVENT, IN_PROGRESS); + + DoZoneInCombat(); + me->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_YELL_AGGRO); + + for (uint8 i = 0; i < 4; ++i) + { + Unit* Temp = Unit::GetUnit((*me),AddGUID[i]); + if (Temp && Temp->isAlive()) + CAST_CRE(Temp)->AI()->AttackStart(me->getVictim()); + else + { + EnterEvadeMode(); + break; + } + } + } + + void KilledUnit(Unit* /*victim*/) + { + switch (urand(0,1)) + { + case 0: + me->MonsterYell(YELL_KILL_ONE, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_YELL_KILL_ONE); + break; + case 1: + me->MonsterYell(YELL_KILL_TWO, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_YELL_KILL_TWO); + break; + } + } + + void JustDied(Unit* /*victim*/) + { + if (pInstance) + pInstance->SetData(DATA_HEXLORDEVENT, DONE); + + me->MonsterYell(YELL_DEATH, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_YELL_DEATH); + + for (uint8 i = 0; i < 4 ; ++i) + { + Unit* Temp = Unit::GetUnit((*me),AddGUID[i]); + if (Temp && Temp->isAlive()) + Temp->DealDamage(Temp, Temp->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + } + + void SelectAddEntry() + { + std::vector AddList; + + for (uint8 i = 0; i < 8; ++i) + AddList.push_back(AddEntryList[i]); + + while (AddList.size() > 4) + AddList.erase(AddList.begin()+rand()%AddList.size()); + + uint8 i = 0; + for (std::vector::const_iterator itr = AddList.begin(); itr != AddList.end(); ++itr, ++i) + AddEntry[i] = *itr; + } + + void SpawnAdds() + { + for (uint8 i = 0; i < 4; ++i) + { + Creature *pCreature = (Unit::GetCreature((*me), AddGUID[i])); + if (!pCreature || !pCreature->isAlive()) + { + if (pCreature) pCreature->setDeathState(DEAD); + pCreature = me->SummonCreature(AddEntry[i], Pos_X[i], POS_Y, POS_Z, ORIENT, TEMPSUMMON_DEAD_DESPAWN, 0); + if (pCreature) AddGUID[i] = pCreature->GetGUID(); + } + else + { + pCreature->AI()->EnterEvadeMode(); + pCreature->GetMap()->CreatureRelocation(me, Pos_X[i], POS_Y, POS_Z, ORIENT); + pCreature->StopMoving(); + } + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (ResetTimer <= diff) + { + if (me->IsWithinDist3d(119.223, 1035.45, 29.4481, 10)) + { + EnterEvadeMode(); + return; + } + ResetTimer = 5000; + } else ResetTimer -= diff; + + if (CheckAddState_Timer <= diff) + { + for (uint8 i = 0; i < 4; ++i) + if (Creature *pTemp = Unit::GetCreature(*me, AddGUID[i])) + if (pTemp->isAlive() && !pTemp->getVictim()) + pTemp->AI()->AttackStart(me->getVictim()); + + CheckAddState_Timer = 5000; + } else CheckAddState_Timer -= diff; + + if (DrainPower_Timer <= diff) + { + DoCast(me, SPELL_DRAIN_POWER, true); + me->MonsterYell(YELL_DRAIN_POWER, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_YELL_DRAIN_POWER); + DrainPower_Timer = urand(40000,55000); // must cast in 60 sec, or buff/debuff will disappear + } else DrainPower_Timer -= diff; + + if (SpiritBolts_Timer <= diff) + { + if (DrainPower_Timer < 12000) // channel 10 sec + SpiritBolts_Timer = 13000; // cast drain power first + else + { + DoCast(me, SPELL_SPIRIT_BOLTS, false); + me->MonsterYell(YELL_SPIRIT_BOLTS, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_YELL_SPIRIT_BOLTS); + SpiritBolts_Timer = 40000; + SiphonSoul_Timer = 10000; // ready to drain + PlayerAbility_Timer = 99999; + } + } else SpiritBolts_Timer -= diff; + + if (SiphonSoul_Timer <= diff) + { + Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 70, true); + Unit *trigger = DoSpawnCreature(MOB_TEMP_TRIGGER, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN, 30000); + if (!pTarget || !trigger) + { + EnterEvadeMode(); + return; + } + else + { + trigger->SetDisplayId(11686); + trigger->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + trigger->CastSpell(pTarget, SPELL_SIPHON_SOUL, true); + trigger->GetMotionMaster()->MoveChase(me); + + //DoCast(pTarget, SPELL_SIPHON_SOUL, true); + //me->SetUInt64Value(UNIT_FIELD_CHANNEL_OBJECT, pTarget->GetGUID()); + //me->SetUInt32Value(UNIT_CHANNEL_SPELL, SPELL_SIPHON_SOUL); + + PlayerGUID = pTarget->GetGUID(); + PlayerAbility_Timer = urand(8000,10000); + PlayerClass = pTarget->getClass() - 1; + + if (PlayerClass == CLASS_DRUID-1) + PlayerClass = CLASS_DRUID; + else if (PlayerClass == CLASS_PRIEST-1 && pTarget->HasSpell(15473)) + PlayerClass = CLASS_PRIEST; // shadow priest + + SiphonSoul_Timer = 99999; // buff lasts 30 sec + } + } else SiphonSoul_Timer -= diff; + + if (PlayerAbility_Timer <= diff) + { + //Unit *pTarget = Unit::GetUnit(*me, PlayerGUID); + //if (pTarget && pTarget->isAlive()) + //{ + UseAbility(); + PlayerAbility_Timer = urand(8000,10000); + //} + } else PlayerAbility_Timer -= diff; + + DoMeleeAttackIfReady(); + } + + void UseAbility() + { + uint8 random = urand(0,2); + Unit *pTarget = NULL; + switch(PlayerAbility[PlayerClass][random].target) + { + case ABILITY_TARGET_SELF: + pTarget = me; + break; + case ABILITY_TARGET_VICTIM: + pTarget = me->getVictim(); + break; + case ABILITY_TARGET_ENEMY: + default: + pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); + break; + case ABILITY_TARGET_HEAL: + pTarget = DoSelectLowestHpFriendly(50, 0); + break; + case ABILITY_TARGET_BUFF: + { + std::list templist = DoFindFriendlyMissingBuff(50, PlayerAbility[PlayerClass][random].spell); + if (!templist.empty()) + pTarget = *(templist.begin()); + } + break; + } + if (pTarget) + DoCast(pTarget, PlayerAbility[PlayerClass][random].spell, false); + } +}; + +#define SPELL_BLOODLUST 43578 +#define SPELL_CLEAVE 15496 + +struct boss_thurgAI : public boss_hexlord_addAI +{ + + boss_thurgAI(Creature *c) : boss_hexlord_addAI(c) {} + + uint32 bloodlust_timer; + uint32 cleave_timer; + + void Reset() + { + bloodlust_timer = 15000; + cleave_timer = 10000; + + boss_hexlord_addAI::Reset(); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (bloodlust_timer <= diff) + { + std::list templist = DoFindFriendlyMissingBuff(50, SPELL_BLOODLUST); + if (!templist.empty()) + { + if (Unit *pTarget = *(templist.begin())) + DoCast(pTarget, SPELL_BLOODLUST, false); + } + bloodlust_timer = 12000; + } else bloodlust_timer -= diff; + + if (cleave_timer <= diff) + { + DoCast(me->getVictim(), SPELL_CLEAVE, false); + cleave_timer = 12000; //3 sec cast + } else cleave_timer -= diff; + + boss_hexlord_addAI::UpdateAI(diff); + } +}; + +#define SPELL_FLASH_HEAL 43575 +#define SPELL_DISPEL_MAGIC 43577 + +struct boss_alyson_antilleAI : public boss_hexlord_addAI +{ + //Holy Priest + boss_alyson_antilleAI(Creature *c) : boss_hexlord_addAI(c) {} + + uint32 flashheal_timer; + uint32 dispelmagic_timer; + + void Reset() + { + flashheal_timer = 2500; + dispelmagic_timer = 10000; + + //AcquireGUID(); + + boss_hexlord_addAI::Reset(); + } + + void AttackStart(Unit* who) + { + if (!who) + return; + + if (who->isTargetableForAttack()) + { + if (me->Attack(who, false)) + { + me->GetMotionMaster()->MoveChase(who, 20); + me->AddThreat(who, 0.0f); + } + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (flashheal_timer <= diff) + { + Unit *pTarget = DoSelectLowestHpFriendly(99, 30000); + if (pTarget) + { + if (pTarget->IsWithinDistInMap(me, 50)) + DoCast(pTarget, SPELL_FLASH_HEAL, false); + else + { + // bugged + //me->GetMotionMaster()->Clear(); + //me->GetMotionMaster()->MoveChase(pTarget, 20); + } + } + else + { + if (urand(0,1)) + pTarget = DoSelectLowestHpFriendly(50, 0); + else + pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (pTarget) + DoCast(pTarget, SPELL_DISPEL_MAGIC, false); + } + flashheal_timer = 2500; + } else flashheal_timer -= diff; + + /*if (dispelmagic_timer <= diff) + { + if (urand(0,1)) + { + Unit *pTarget = SelectTarget(); + + DoCast(pTarget, SPELL_DISPEL_MAGIC, false); + } + else + me->CastSpell(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_DISPEL_MAGIC, false); + + dispelmagic_timer = 12000; + } else dispelmagic_timer -= diff;*/ + + boss_hexlord_addAI::UpdateAI(diff); + } +}; + +#define SPELL_FIREBOLT 43584 + +struct boss_gazakrothAI : public boss_hexlord_addAI +{ + boss_gazakrothAI(Creature *c) : boss_hexlord_addAI(c) {} + + uint32 firebolt_timer; + + void Reset() + { + firebolt_timer = 2000; + boss_hexlord_addAI::Reset(); + } + + void AttackStart(Unit* who) + { + if (!who) + return; + + if (who->isTargetableForAttack()) + { + if (me->Attack(who, false)) + { + me->GetMotionMaster()->MoveChase(who, 20); + me->AddThreat(who, 0.0f); + } + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (firebolt_timer <= diff) + { + DoCast(me->getVictim(), SPELL_FIREBOLT, false); + firebolt_timer = 700; + } else firebolt_timer -= diff; + + boss_hexlord_addAI::UpdateAI(diff); + } +}; + +#define SPELL_FLAME_BREATH 43582 +#define SPELL_THUNDERCLAP 43583 + +struct boss_lord_raadanAI : public boss_hexlord_addAI +{ + boss_lord_raadanAI(Creature *c) : boss_hexlord_addAI(c) {} + + uint32 flamebreath_timer; + uint32 thunderclap_timer; + + void Reset() + { + flamebreath_timer = 8000; + thunderclap_timer = 13000; + + boss_hexlord_addAI::Reset(); + + } + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (thunderclap_timer <= diff) + { + DoCast(me->getVictim(), SPELL_THUNDERCLAP, false); + thunderclap_timer = 12000; + } else thunderclap_timer -= diff; + + if (flamebreath_timer <= diff) + { + DoCast(me->getVictim(), SPELL_FLAME_BREATH, false); + flamebreath_timer = 12000; + } else flamebreath_timer -= diff; + + boss_hexlord_addAI::UpdateAI(diff); + } +}; + +#define SPELL_PSYCHIC_WAIL 43590 + +struct boss_darkheartAI : public boss_hexlord_addAI +{ + boss_darkheartAI(Creature *c) : boss_hexlord_addAI(c) {} + + uint32 psychicwail_timer; + + void Reset() + { + psychicwail_timer = 8000; + boss_hexlord_addAI::Reset(); + } + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (psychicwail_timer <= diff) + { + DoCast(me->getVictim(), SPELL_PSYCHIC_WAIL, false); + psychicwail_timer = 12000; + } else psychicwail_timer -= diff; + + boss_hexlord_addAI::UpdateAI(diff); + } +}; + +#define SPELL_VENOM_SPIT 43579 + +struct boss_slitherAI : public boss_hexlord_addAI +{ + boss_slitherAI(Creature *c) : boss_hexlord_addAI(c) {} + + uint32 venomspit_timer; + + void Reset() + { + venomspit_timer = 5000; + boss_hexlord_addAI::Reset(); + } + + void AttackStart(Unit* who) + { + if (!who) + return; + + if (who->isTargetableForAttack()) + { + if (me->Attack(who, false)) + { + me->GetMotionMaster()->MoveChase(who, 20); + me->AddThreat(who, 0.0f); + } + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (venomspit_timer <= diff) + { + if (Unit* victim = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) + DoCast(victim, SPELL_VENOM_SPIT, false); + venomspit_timer = 2500; + } else venomspit_timer -= diff; + + boss_hexlord_addAI::UpdateAI(diff); + } +}; + +//Fenstalker +#define SPELL_VOLATILE_INFECTION 43586 + +struct boss_fenstalkerAI : public boss_hexlord_addAI +{ + boss_fenstalkerAI(Creature *c) : boss_hexlord_addAI(c) {} + + uint32 volatileinf_timer; + + void Reset() + { + volatileinf_timer = 15000; + boss_hexlord_addAI::Reset(); + + } + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (volatileinf_timer <= diff) + { + // core bug + me->getVictim()->CastSpell(me->getVictim(),SPELL_VOLATILE_INFECTION, false); + volatileinf_timer = 12000; + } else volatileinf_timer -= diff; + + boss_hexlord_addAI::UpdateAI(diff); + } +}; + +//Koragg +#define SPELL_COLD_STARE 43593 +#define SPELL_MIGHTY_BLOW 43592 + +struct boss_koraggAI : public boss_hexlord_addAI +{ + boss_koraggAI(Creature *c) : boss_hexlord_addAI(c) {} + + uint32 coldstare_timer; + uint32 mightyblow_timer; + + void Reset() + { + coldstare_timer = 15000; + mightyblow_timer = 10000; + boss_hexlord_addAI::Reset(); + + } + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (mightyblow_timer <= diff) + { + DoCast(me->getVictim(), SPELL_MIGHTY_BLOW, false); + mightyblow_timer = 12000; + } + if (coldstare_timer <= diff) + { + if (Unit* victim = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) + DoCast(victim, SPELL_COLD_STARE, false); + coldstare_timer = 12000; + } + + boss_hexlord_addAI::UpdateAI(diff); + } +}; + +CreatureAI* GetAI_boss_hex_lord_malacrass(Creature* pCreature) +{ + return new boss_hex_lord_malacrassAI (pCreature); +} + +CreatureAI* GetAI_boss_thurg(Creature* pCreature) +{ + return new boss_thurgAI (pCreature); +} + +CreatureAI* GetAI_boss_alyson_antille(Creature* pCreature) +{ + return new boss_alyson_antilleAI (pCreature); +} + +CreatureAI* GetAI_boss_gazakroth(Creature* pCreature) +{ + return new boss_gazakrothAI (pCreature); +} + +CreatureAI* GetAI_boss_lord_raadan(Creature* pCreature) +{ + return new boss_lord_raadanAI (pCreature); +} + +CreatureAI* GetAI_boss_darkheart(Creature* pCreature) +{ + return new boss_darkheartAI (pCreature); +} + +CreatureAI* GetAI_boss_slither(Creature* pCreature) +{ + return new boss_slitherAI (pCreature); +} + +CreatureAI* GetAI_boss_fenstalker(Creature* pCreature) +{ + return new boss_fenstalkerAI (pCreature); +} + +CreatureAI* GetAI_boss_koragg(Creature* pCreature) +{ + return new boss_koraggAI (pCreature); +} +void AddSC_boss_hex_lord_malacrass() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_hexlord_malacrass"; + newscript->GetAI = &GetAI_boss_hex_lord_malacrass; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_thurg"; + newscript->GetAI = &GetAI_boss_thurg; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_gazakroth"; + newscript->GetAI = &GetAI_boss_gazakroth; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_lord_raadan"; + newscript->GetAI = &GetAI_boss_lord_raadan; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_darkheart"; + newscript->GetAI = &GetAI_boss_darkheart; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_slither"; + newscript->GetAI = &GetAI_boss_slither; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_fenstalker"; + newscript->GetAI = &GetAI_boss_fenstalker; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_koragg"; + newscript->GetAI = &GetAI_boss_koragg; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_alyson_antille"; + newscript->GetAI = &GetAI_boss_alyson_antille; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp new file mode 100644 index 00000000000..9ac54976241 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp @@ -0,0 +1,687 @@ + /* 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_Janalai +SD%Complete: 100 +SDComment: +SDCategory: Zul'Aman +EndScriptData */ + +#include "ScriptedPch.h" +#include "zulaman.h" +#include "GridNotifiers.h" + +enum eEnums +{ + SAY_AGGRO = -1568000, + SAY_FIRE_BOMBS = -1568001, + SAY_SUMMON_HATCHER = -1568002, + SAY_ALL_EGGS = -1568003, + SAY_BERSERK = -1568004, + SAY_SLAY_1 = -1568005, + SAY_SLAY_2 = -1568006, + SAY_DEATH = -1568007, + SAY_EVENT_STRANGERS = -1568008, + SAY_EVENT_FRIENDS = -1568009, + +// Jan'alai + SPELL_FLAME_BREATH = 43140, + SPELL_FIRE_WALL = 43113, + SPELL_ENRAGE = 44779, + SPELL_SUMMON_PLAYERS = 43097, + SPELL_TELE_TO_CENTER = 43098, // coord + SPELL_HATCH_ALL = 43144, + SPELL_BERSERK = 45078, + +// -- Fire Bob Spells + SPELL_FIRE_BOMB_CHANNEL = 42621, // last forever + SPELL_FIRE_BOMB_THROW = 42628, // throw visual + SPELL_FIRE_BOMB_DUMMY = 42629, // bomb visual + SPELL_FIRE_BOMB_DAMAGE = 42630, + +// --Summons + MOB_AMANI_HATCHER = 23818, + MOB_HATCHLING = 23598, // 42493 + MOB_EGG = 23817, + MOB_FIRE_BOMB = 23920, + +// -- Hatcher Spells + SPELL_HATCH_EGG = 43734, // 42471 + +// -- Hatchling Spells + SPELL_FLAMEBUFFET = 43299 +}; + +const int area_dx = 44; +const int area_dy = 51; + +float JanalainPos[1][3] = +{ + {-33.93, 1149.27, 19} +}; + +float FireWallCoords[4][4] = +{ + {-10.13, 1149.27, 19, 3.1415}, + {-33.93, 1123.90, 19, 0.5*3.1415}, + {-54.80, 1150.08, 19, 0}, + {-33.93, 1175.68, 19, 1.5*3.1415} +}; + +float hatcherway[2][5][3] = +{ + { + {-87.46,1170.09,6}, + {-74.41,1154.75,6}, + {-52.74,1153.32,19}, + {-33.37,1172.46,19}, + {-33.09,1203.87,19} + }, + { + {-86.57,1132.85,6}, + {-73.94,1146.00,6}, + {-52.29,1146.51,19}, + {-33.57,1125.72,19}, + {-34.29,1095.22,19} + } +}; + +struct boss_janalaiAI : public ScriptedAI +{ + boss_janalaiAI(Creature *c) : ScriptedAI(c) + { + pInstance =c->GetInstanceData(); + + SpellEntry *TempSpell = GET_SPELL(SPELL_HATCH_EGG); + if (TempSpell && TempSpell->EffectImplicitTargetA[0] != 1) + { + TempSpell->EffectImplicitTargetA[0] = 1; + TempSpell->EffectImplicitTargetB[0] = 0; + } + } + + ScriptedInstance *pInstance; + + uint32 FireBreathTimer; + uint32 BombTimer; + uint32 BombSequenceTimer; + uint32 BombCount; + uint32 HatcherTimer; + uint32 EnrageTimer; + + bool noeggs; + bool enraged; + bool isBombing; + + bool isFlameBreathing; + + uint64 FireBombGUIDs[40]; + + void Reset() + { + if (pInstance) + pInstance->SetData(DATA_JANALAIEVENT, NOT_STARTED); + + FireBreathTimer = 8000; + BombTimer = 30000; + BombSequenceTimer = 1000; + BombCount = 0; + HatcherTimer = 10000; + EnrageTimer = MINUTE*5*IN_MILISECONDS; + + noeggs = false; + isBombing =false; + enraged = false; + + isFlameBreathing = false; + + for (uint8 i = 0; i < 40; ++i) + FireBombGUIDs[i] = 0; + + HatchAllEggs(1); + } + + void JustDied(Unit* /*Killer*/) + { + DoScriptText(SAY_DEATH, me); + + if (pInstance) + pInstance->SetData(DATA_JANALAIEVENT, DONE); + } + + void KilledUnit(Unit* /*victim*/) + { + DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me); + } + + void EnterCombat(Unit * /*who*/) + { + if (pInstance) + pInstance->SetData(DATA_JANALAIEVENT, IN_PROGRESS); + + DoScriptText(SAY_AGGRO, me); +// DoZoneInCombat(); + } + + void DamageDeal(Unit *pTarget, uint32 &damage) + { + if (isFlameBreathing) + { + if (!me->HasInArc(M_PI/6, pTarget)) + damage = 0; + } + } + + void FireWall() + { + uint8 WallNum; + Creature* wall = NULL; + for (uint8 i = 0; i < 4; ++i) + { + if (i == 0 || i == 2) + WallNum = 3; + else + WallNum = 2; + + for (uint8 j = 0; j < WallNum; j++) + { + if (WallNum == 3) + wall = me->SummonCreature(MOB_FIRE_BOMB, FireWallCoords[i][0],FireWallCoords[i][1]+5*(j-1),FireWallCoords[i][2],FireWallCoords[i][3],TEMPSUMMON_TIMED_DESPAWN,15000); + else + wall = me->SummonCreature(MOB_FIRE_BOMB, FireWallCoords[i][0]-2+4*j,FireWallCoords[i][1],FireWallCoords[i][2],FireWallCoords[i][3],TEMPSUMMON_TIMED_DESPAWN,15000); + if (wall) wall->CastSpell(wall, SPELL_FIRE_WALL, true); + } + } + } + + void SpawnBombs() + { + float dx, dy; + for (int i(0); i < 40; ++i) + { + dx = irand(-area_dx/2, area_dx/2); + dy = irand(-area_dy/2, area_dy/2); + + Creature* bomb = DoSpawnCreature(MOB_FIRE_BOMB, dx, dy, 0, 0, TEMPSUMMON_TIMED_DESPAWN, 15000); + if (bomb) FireBombGUIDs[i] = bomb->GetGUID(); + } + BombCount = 0; + } + + bool HatchAllEggs(uint32 uiAction) //1: reset, 2: isHatching all + { + std::list templist; + float x, y, z; + me->GetPosition(x, y, z); + + { + CellPair pair(Trinity::ComputeCellPair(x, y)); + Cell cell(pair); + cell.data.Part.reserved = ALL_DISTRICT; + cell.SetNoCreate(); + + Trinity::AllCreaturesOfEntryInRange check(me, MOB_EGG, 100); + Trinity::CreatureListSearcher searcher(me, templist, check); + + TypeContainerVisitor, GridTypeMapContainer> cSearcher(searcher); + + cell.Visit(pair, cSearcher, *(me->GetMap())); + } + + //error_log("Eggs %d at middle", templist.size()); + if (!templist.size()) + return false; + + for (std::list::const_iterator i = templist.begin(); i != templist.end(); ++i) + { + if (uiAction == 1) + (*i)->SetDisplayId(10056); + else if (uiAction == 2 &&(*i)->GetDisplayId() != 11686) + (*i)->CastSpell(*i, SPELL_HATCH_EGG, false); + } + return true; + } + + void Boom() + { + std::list templist; + float x, y, z; + me->GetPosition(x, y, z); + + { + CellPair pair(Trinity::ComputeCellPair(x, y)); + Cell cell(pair); + cell.data.Part.reserved = ALL_DISTRICT; + cell.SetNoCreate(); + + Trinity::AllCreaturesOfEntryInRange check(me, MOB_FIRE_BOMB, 100); + Trinity::CreatureListSearcher searcher(me, templist, check); + + TypeContainerVisitor, GridTypeMapContainer> cSearcher(searcher); + + cell.Visit(pair, cSearcher, *(me->GetMap())); + } + for (std::list::const_iterator i = templist.begin(); i != templist.end(); ++i) + { + (*i)->CastSpell(*i, SPELL_FIRE_BOMB_DAMAGE, true); + (*i)->RemoveAllAuras(); + } + } + + void HandleBombSequence() + { + if (BombCount < 40) + { + if (Unit *FireBomb = Unit::GetUnit((*me), FireBombGUIDs[BombCount])) + { + FireBomb->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + DoCast(FireBomb, SPELL_FIRE_BOMB_THROW, true); + FireBomb->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + } + ++BombCount; + if (BombCount == 40) + { + BombSequenceTimer = 5000; + } else BombSequenceTimer = 100; + } + else + { + Boom(); + isBombing = false; + BombTimer = urand(20000,40000); + me->RemoveAurasDueToSpell(SPELL_FIRE_BOMB_CHANNEL); + if (EnrageTimer <= 10000) + EnrageTimer = 0; + else + EnrageTimer -= 10000; + } + } + + void UpdateAI(const uint32 diff) + { + if (isFlameBreathing) + { + if (!me->IsNonMeleeSpellCasted(false)) + isFlameBreathing = false; + else + return; + } + + if (isBombing) + { + if (BombSequenceTimer <= diff) + HandleBombSequence(); + else + BombSequenceTimer -= diff; + return; + } + + if (!UpdateVictim()) + return; + + //enrage if under 25% hp before 5 min. + if (!enraged && me->GetHealth() * 4 < me->GetMaxHealth()) + EnrageTimer = 0; + + if (EnrageTimer <= diff) + { + if (!enraged) + { + DoCast(me, SPELL_ENRAGE, true); + enraged = true; + EnrageTimer = 300000; + } + else + { + DoScriptText(SAY_BERSERK, me); + DoCast(me, SPELL_BERSERK, true); + EnrageTimer = 300000; + } + } else EnrageTimer -= diff; + + if (BombTimer <= diff) + { + DoScriptText(SAY_FIRE_BOMBS, me); + + me->AttackStop(); + me->GetMotionMaster()->Clear(); + DoTeleportTo(JanalainPos[0][0],JanalainPos[0][1],JanalainPos[0][2]); + me->StopMoving(); + DoCast(me, SPELL_FIRE_BOMB_CHANNEL, false); + //DoTeleportPlayer(me, JanalainPos[0][0], JanalainPos[0][1],JanalainPos[0][2], 0); + //DoCast(me, SPELL_TELE_TO_CENTER, true); + + FireWall(); + SpawnBombs(); + isBombing = true; + BombSequenceTimer = 100; + + //Teleport every Player into the middle + Map* pMap = me->GetMap(); + if (!pMap->IsDungeon()) return; + 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()) + DoTeleportPlayer(i_pl, JanalainPos[0][0]-5+rand()%10, JanalainPos[0][1]-5+rand()%10, JanalainPos[0][2], 0); + //DoCast(Temp, SPELL_SUMMON_PLAYERS, true) // core bug, spell does not work if too far + return; + } else BombTimer -= diff; + + if (!noeggs) + { + if (100 * me->GetHealth() < 35 * me->GetMaxHealth()) + { + DoScriptText(SAY_ALL_EGGS, me); + + me->AttackStop(); + me->GetMotionMaster()->Clear(); + DoTeleportTo(JanalainPos[0][0],JanalainPos[0][1],JanalainPos[0][2]); + me->StopMoving(); + DoCast(me, SPELL_HATCH_ALL, false); + HatchAllEggs(2); + noeggs = true; + } + else if (HatcherTimer <= diff) + { + if (HatchAllEggs(0)) + { + DoScriptText(SAY_SUMMON_HATCHER, me); + me->SummonCreature(MOB_AMANI_HATCHER,hatcherway[0][0][0],hatcherway[0][0][1],hatcherway[0][0][2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,10000); + me->SummonCreature(MOB_AMANI_HATCHER,hatcherway[1][0][0],hatcherway[1][0][1],hatcherway[1][0][2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,10000); + HatcherTimer = 90000; + } + else + noeggs = true; + } else HatcherTimer -= diff; + } + + EnterEvadeIfOutOfCombatArea(diff); + + DoMeleeAttackIfReady(); + + if (FireBreathTimer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + { + me->AttackStop(); + me->GetMotionMaster()->Clear(); + DoCast(pTarget, SPELL_FLAME_BREATH, false); + me->StopMoving(); + isFlameBreathing = true; + } + FireBreathTimer = 8000; + } else FireBreathTimer -= diff; + } +}; + +CreatureAI* GetAI_boss_janalaiAI(Creature* pCreature) +{ + return new boss_janalaiAI(pCreature); +} + +struct mob_janalai_firebombAI : public ScriptedAI +{ + mob_janalai_firebombAI(Creature *c) : ScriptedAI(c){} + + void Reset() {} + + void SpellHit(Unit * /*caster*/, const SpellEntry *spell) + { + if (spell->Id == SPELL_FIRE_BOMB_THROW) + DoCast(me, SPELL_FIRE_BOMB_DUMMY, true); + } + + void EnterCombat(Unit* /*who*/) {} + + void AttackStart(Unit* /*who*/) {} + + void MoveInLineOfSight(Unit* /*who*/) {} + + void UpdateAI(const uint32 /*diff*/) {} +}; + +CreatureAI* GetAI_mob_janalai_firebombAI(Creature* pCreature) +{ + return new mob_janalai_firebombAI(pCreature); +} + +struct mob_amanishi_hatcherAI : public ScriptedAI +{ + mob_amanishi_hatcherAI(Creature *c) : ScriptedAI(c) + { + pInstance =c->GetInstanceData(); + } + + ScriptedInstance *pInstance; + + uint32 waypoint; + uint32 HatchNum; + uint32 WaitTimer; + + bool side; + bool hasChangedSide; + bool isHatching; + + void Reset() + { + me->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + side =(me->GetPositionY() < 1150); + waypoint = 0; + isHatching = false; + hasChangedSide = false; + WaitTimer = 1; + HatchNum = 0; + } + + bool HatchEggs(uint32 num) + { + std::list templist; + float x, y, z; + me->GetPosition(x, y, z); + + { + CellPair pair(Trinity::ComputeCellPair(x, y)); + Cell cell(pair); + cell.data.Part.reserved = ALL_DISTRICT; + cell.SetNoCreate(); + + Trinity::AllCreaturesOfEntryInRange check(me, 23817, 50); + Trinity::CreatureListSearcher searcher(me, templist, check); + + TypeContainerVisitor, GridTypeMapContainer> cSearcher(searcher); + + cell.Visit(pair, cSearcher, *(me->GetMap())); + } + + //error_log("Eggs %d at %d", templist.size(), side); + + for (std::list::const_iterator i = templist.begin(); i != templist.end() && num > 0; ++i) + if ((*i)->GetDisplayId() != 11686) + { + (*i)->CastSpell(*i, SPELL_HATCH_EGG, false); + num--; + } + + return num == 0; // if num == 0, no more templist + } + + void EnterCombat(Unit* /*who*/) {} + void AttackStart(Unit* /*who*/) {} + void MoveInLineOfSight(Unit* /*who*/) {} + void MovementInform(uint32, uint32) + { + if (waypoint == 5) + { + isHatching = true; + HatchNum = 1; + WaitTimer = 5000; + } + else + WaitTimer = 1; + } + + void UpdateAI(const uint32 diff) + { + if (!pInstance || !(pInstance->GetData(DATA_JANALAIEVENT) == IN_PROGRESS)) + { + me->DisappearAndDie(); + return; + } + + if (!isHatching) + { + if (WaitTimer) + { + me->GetMotionMaster()->Clear(); + me->GetMotionMaster()->MovePoint(0,hatcherway[side][waypoint][0],hatcherway[side][waypoint][1],hatcherway[side][waypoint][2]); + ++waypoint; + WaitTimer = 0; + } + } + else + { + if (WaitTimer <= diff) + { + if (HatchEggs(HatchNum)) + { + ++HatchNum; + WaitTimer = 10000; + } + else if (!hasChangedSide) + { + side = side ? 0 : 1; + isHatching = false; + waypoint = 3; + WaitTimer = 1; + hasChangedSide = true; + } + else + me->DisappearAndDie(); + + } else WaitTimer -= diff; + } + } +}; + +CreatureAI* GetAI_mob_amanishi_hatcherAI(Creature* pCreature) +{ + return new mob_amanishi_hatcherAI(pCreature); +} + +struct mob_hatchlingAI : public ScriptedAI +{ + mob_hatchlingAI(Creature *c) : ScriptedAI(c) + { + pInstance =c->GetInstanceData(); + } + + ScriptedInstance *pInstance; + uint32 BuffetTimer; + + void Reset() + { + BuffetTimer = 7000; + if (me->GetPositionY() > 1150) + me->GetMotionMaster()->MovePoint(0, hatcherway[0][3][0]+rand()%4-2,1150+rand()%4-2,hatcherway[0][3][2]); + else + me->GetMotionMaster()->MovePoint(0,hatcherway[1][3][0]+rand()%4-2,1150+rand()%4-2,hatcherway[1][3][2]); + + me->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); + } + + void EnterCombat(Unit * /*who*/) {/*DoZoneInCombat();*/} + + void UpdateAI(const uint32 diff) + { + if (!pInstance || !(pInstance->GetData(DATA_JANALAIEVENT) == IN_PROGRESS)) + { + me->DisappearAndDie(); + return; + } + + if (!UpdateVictim()) + return; + + if (BuffetTimer <= diff) + { + DoCast(me->getVictim(), SPELL_FLAMEBUFFET, false); + BuffetTimer = 10000; + } else BuffetTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_hatchlingAI(Creature* pCreature) +{ + return new mob_hatchlingAI(pCreature); +} + +struct mob_eggAI : public ScriptedAI +{ + mob_eggAI(Creature *c) : ScriptedAI(c){} + void Reset() {} + void EnterCombat(Unit* /*who*/) {} + void AttackStart(Unit* /*who*/) {} + void MoveInLineOfSight(Unit* /*who*/) {} + void UpdateAI(const uint32 /*diff*/) {} + + void SpellHit(Unit * /*caster*/, const SpellEntry *spell) + { + if (spell->Id == SPELL_HATCH_EGG) + { + DoSpawnCreature(MOB_HATCHLING, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000); + me->SetDisplayId(11686); + } + } +}; + +CreatureAI* GetAI_mob_eggAI(Creature* pCreature) +{ + return new mob_eggAI(pCreature); +} + +void AddSC_boss_janalai() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_janalai"; + newscript->GetAI = &GetAI_boss_janalaiAI; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_janalai_firebomb"; + newscript->GetAI = &GetAI_mob_janalai_firebombAI; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_janalai_hatcher"; + newscript->GetAI = &GetAI_mob_amanishi_hatcherAI; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_janalai_hatchling"; + newscript->GetAI = &GetAI_mob_hatchlingAI; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_janalai_egg"; + newscript->GetAI = &GetAI_mob_eggAI; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp new file mode 100644 index 00000000000..ae5c6596d2d --- /dev/null +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp @@ -0,0 +1,451 @@ + /* 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_Nalorakk +SD%Complete: 100 +SDComment: +SDCategory: Zul'Aman +EndScriptData */ + +#include "ScriptedPch.h" +#include "zulaman.h" +#include "GridNotifiers.h" + +//Trash Waves +float NalorakkWay[8][3] = +{ + { 18.569, 1414.512, 11.42},// waypoint 1 + {-17.264, 1419.551, 12.62}, + {-52.642, 1419.357, 27.31},// waypoint 2 + {-69.908, 1419.721, 27.31}, + {-79.929, 1395.958, 27.31}, + {-80.072, 1374.555, 40.87},// waypoint 3 + {-80.072, 1314.398, 40.87}, + {-80.072, 1295.775, 48.60} // waypoint 4 +}; + +#define YELL_NALORAKK_WAVE1 "Get da move on, guards! It be killin' time!" +#define SOUND_NALORAKK_WAVE1 12066 +#define YELL_NALORAKK_WAVE2 "Guards, go already! Who you more afraid of, dem... or me?" +#define SOUND_NALORAKK_WAVE2 12067 +#define YELL_NALORAKK_WAVE3 "Ride now! Ride out dere and bring me back some heads!" +#define SOUND_NALORAKK_WAVE3 12068 +#define YELL_NALORAKK_WAVE4 "I be losin' me patience! Go on: make dem wish dey was never born!" +#define SOUND_NALORAKK_WAVE4 12069 + +//Unimplemented SoundIDs +/* +#define SOUND_NALORAKK_EVENT1 12078 +#define SOUND_NALORAKK_EVENT2 12079 +*/ + +//General defines +#define YELL_AGGRO "You be dead soon enough!" +#define SOUND_YELL_AGGRO 12070 +#define YELL_KILL_ONE "Mua-ha-ha! Now whatchoo got to say?" +#define SOUND_YELL_KILL_ONE 12075 +#define YELL_KILL_TWO "Da Amani gonna rule again!" +#define SOUND_YELL_KILL_TWO 12076 +#define YELL_DEATH "I... be waitin' on da udda side...." +#define SOUND_YELL_DEATH 12077 +#define YELL_BERSERK "You had your chance, now it be too late!" //Never seen this being used, so just guessing from what I hear. +#define SOUND_YELL_BERSERK 12074 + +#define SPELL_BERSERK 45078 + +//Defines for Troll form +#define SPELL_BRUTALSWIPE 42384 +#define SPELL_MANGLE 42389 +#define SPELL_MANGLEEFFECT 44955 +#define SPELL_SURGE 42402 +#define SPELL_BEARFORM 42377 + +#define YELL_SURGE "I bring da pain!" +#define SOUND_YELL_SURGE 12071 + +#define YELL_SHIFTEDTOTROLL "Make way for Nalorakk!" +#define SOUND_YELL_TOTROLL 12073 + +//Defines for Bear form +#define SPELL_LACERATINGSLASH 42395 +#define SPELL_RENDFLESH 42397 +#define SPELL_DEAFENINGROAR 42398 + +#define YELL_SHIFTEDTOBEAR "You call on da beast, you gonna get more dan you bargain for!" +#define SOUND_YELL_TOBEAR 12072 + +struct boss_nalorakkAI : public ScriptedAI +{ + boss_nalorakkAI(Creature *c) : ScriptedAI(c) + { + MoveEvent = true; + MovePhase = 0; + pInstance = c->GetInstanceData(); + } + + ScriptedInstance *pInstance; + + uint32 BrutalSwipe_Timer; + uint32 Mangle_Timer; + uint32 Surge_Timer; + + uint32 LaceratingSlash_Timer; + uint32 RendFlesh_Timer; + uint32 DeafeningRoar_Timer; + + uint32 ShapeShift_Timer; + uint32 Berserk_Timer; + + bool inBearForm; + bool MoveEvent; + bool inMove; + uint32 MovePhase; + uint32 waitTimer; + + void Reset() + { + if (MoveEvent) + { + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + inMove = false; + waitTimer = 0; + me->SetSpeed(MOVE_RUN,2); + me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + }else + { + (*me).GetMotionMaster()->MovePoint(0,NalorakkWay[7][0],NalorakkWay[7][1],NalorakkWay[7][2]); + } + + if (pInstance) + pInstance->SetData(DATA_NALORAKKEVENT, NOT_STARTED); + + Surge_Timer = 15000 + rand()%5000; + BrutalSwipe_Timer = 7000 + rand()%5000; + Mangle_Timer = 10000 + rand()%5000; + ShapeShift_Timer = 45000 + rand()%5000; + Berserk_Timer = 600000; + + inBearForm = false; + // me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, 5122); // TODO: find the correct equipment id + } + + void SendAttacker(Unit *pTarget) + { + std::list templist; + float x, y, z; + me->GetPosition(x, y, z); + + { + CellPair pair(Trinity::ComputeCellPair(x, y)); + Cell cell(pair); + cell.data.Part.reserved = ALL_DISTRICT; + cell.SetNoCreate(); + + Trinity::AllFriendlyCreaturesInGrid check(me); + Trinity::CreatureListSearcher searcher(me, templist, check); + + TypeContainerVisitor, GridTypeMapContainer> cSearcher(searcher); + + cell.Visit(pair, cSearcher, *(me->GetMap())); + } + + if (!templist.size()) + return; + + for (std::list::const_iterator i = templist.begin(); i != templist.end(); ++i) + { + if ((*i) && me->IsWithinDistInMap((*i),25)) + { + (*i)->SetNoCallAssistance(true); + (*i)->AI()->AttackStart(pTarget); + } + } + } + + void AttackStart(Unit* who) + { + if (!MoveEvent) + ScriptedAI::AttackStart(who); + } + + void MoveInLineOfSight(Unit *who) + { + if (!MoveEvent) + { + ScriptedAI::MoveInLineOfSight(who); + } + else + { + if (me->IsHostileTo(who)) + { + if (!inMove) + { + switch(MovePhase) + { + case 0: + if (me->IsWithinDistInMap(who, 50)) + { + me->MonsterYell(YELL_NALORAKK_WAVE1, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_NALORAKK_WAVE1); + + (*me).GetMotionMaster()->MovePoint(1,NalorakkWay[1][0],NalorakkWay[1][1],NalorakkWay[1][2]); + MovePhase ++; + inMove = true; + + SendAttacker(who); + } + break; + case 2: + if (me->IsWithinDistInMap(who, 40)) + { + me->MonsterYell(YELL_NALORAKK_WAVE2, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_NALORAKK_WAVE2); + + (*me).GetMotionMaster()->MovePoint(3,NalorakkWay[3][0],NalorakkWay[3][1],NalorakkWay[3][2]); + MovePhase ++; + inMove = true; + + SendAttacker(who); + } + break; + case 5: + if (me->IsWithinDistInMap(who, 40)) + { + me->MonsterYell(YELL_NALORAKK_WAVE3, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_NALORAKK_WAVE3); + + (*me).GetMotionMaster()->MovePoint(6,NalorakkWay[6][0],NalorakkWay[6][1],NalorakkWay[6][2]); + MovePhase ++; + inMove = true; + + SendAttacker(who); + } + break; + case 7: + if (me->IsWithinDistInMap(who, 50)) + { + SendAttacker(who); + + me->MonsterYell(YELL_NALORAKK_WAVE4, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_NALORAKK_WAVE4); + + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + MoveEvent = false; + } + break; + } + } + } + } + } + + void EnterCombat(Unit * /*who*/) + { + if (pInstance) + pInstance->SetData(DATA_NALORAKKEVENT, IN_PROGRESS); + + me->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_YELL_AGGRO); + DoZoneInCombat(); + } + + void JustDied(Unit* /*Killer*/) + { + if (pInstance) + pInstance->SetData(DATA_NALORAKKEVENT, DONE); + + me->MonsterYell(YELL_DEATH,LANG_UNIVERSAL,NULL); + DoPlaySoundToSet(me, SOUND_YELL_DEATH); + } + + void KilledUnit(Unit* /*victim*/) + { + switch (urand(0,1)) + { + case 0: + me->MonsterYell(YELL_KILL_ONE, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_YELL_KILL_ONE); + break; + case 1: + me->MonsterYell(YELL_KILL_TWO, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_YELL_KILL_TWO); + break; + } + } + + void MovementInform(uint32 type, uint32 id) + { + if (MoveEvent) + { + if (type != POINT_MOTION_TYPE) + return; + + if (!inMove) + return; + + if (MovePhase != id) + return; + + switch(MovePhase) + { + case 2: + me->SetOrientation(3.1415*2); + inMove = false; + return; + case 1: + case 3: + case 4: + case 6: + MovePhase ++; + waitTimer = 1; + inMove = true; + return; + case 5: + me->SetOrientation(3.1415*0.5); + inMove = false; + return; + case 7: + me->SetOrientation(3.1415*0.5); + inMove = false; + return; + } + + } + } + + void UpdateAI(const uint32 diff) + { + if (waitTimer) + { + if (inMove) + if (waitTimer <= diff) + { + (*me).GetMotionMaster()->MovementExpired(); + (*me).GetMotionMaster()->MovePoint(MovePhase,NalorakkWay[MovePhase][0],NalorakkWay[MovePhase][1],NalorakkWay[MovePhase][2]); + waitTimer = 0; + } else waitTimer -= diff; + } + + if (!UpdateVictim()) + return; + + if (Berserk_Timer <= diff) + { + DoCast(me, SPELL_BERSERK, true); + me->MonsterYell(YELL_BERSERK, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_YELL_BERSERK); + Berserk_Timer = 600000; + } else Berserk_Timer -= diff; + + if (ShapeShift_Timer <= diff) + { + if (inBearForm) + { + // me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, 5122); + me->MonsterYell(YELL_SHIFTEDTOTROLL, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_YELL_TOTROLL); + me->RemoveAurasDueToSpell(SPELL_BEARFORM); + Surge_Timer = 15000 + rand()%5000; + BrutalSwipe_Timer = 7000 + rand()%5000; + Mangle_Timer = 10000 + rand()%5000; + ShapeShift_Timer = 45000 + rand()%5000; + inBearForm = false; + } + else + { + // me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, 0); + me->MonsterYell(YELL_SHIFTEDTOBEAR, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_YELL_TOBEAR); + DoCast(me, SPELL_BEARFORM, true); + LaceratingSlash_Timer = 2000; // dur 18s + RendFlesh_Timer = 3000; // dur 5s + DeafeningRoar_Timer = 5000 + rand()%5000; // dur 2s + ShapeShift_Timer = 20000 + rand()%5000; // dur 30s + inBearForm = true; + } + } else ShapeShift_Timer -= diff; + + if (!inBearForm) + { + if (BrutalSwipe_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_BRUTALSWIPE); + BrutalSwipe_Timer = 7000 + rand()%5000; + } else BrutalSwipe_Timer -= diff; + + if (Mangle_Timer <= diff) + { + if (me->getVictim() && !me->getVictim()->HasAura(SPELL_MANGLEEFFECT)) + { + DoCast(me->getVictim(), SPELL_MANGLE); + Mangle_Timer = 1000; + } + else Mangle_Timer = 10000 + rand()%5000; + } else Mangle_Timer -= diff; + + if (Surge_Timer <= diff) + { + me->MonsterYell(YELL_SURGE, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_YELL_SURGE); + Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 45, true); + if (pTarget) + DoCast(pTarget, SPELL_SURGE); + Surge_Timer = 15000 + rand()%5000; + } else Surge_Timer -= diff; + } + else + { + if (LaceratingSlash_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_LACERATINGSLASH); + LaceratingSlash_Timer = 18000 + rand()%5000; + } else LaceratingSlash_Timer -= diff; + + if (RendFlesh_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_RENDFLESH); + RendFlesh_Timer = 5000 + rand()%5000; + } else RendFlesh_Timer -= diff; + + if (DeafeningRoar_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_DEAFENINGROAR); + DeafeningRoar_Timer = 15000 + rand()%5000; + } else DeafeningRoar_Timer -= diff; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_nalorakk(Creature* pCreature) +{ + return new boss_nalorakkAI (pCreature); +} + +void AddSC_boss_nalorakk() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_nalorakk"; + newscript->GetAI = &GetAI_boss_nalorakk; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp new file mode 100644 index 00000000000..91cfa728f89 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp @@ -0,0 +1,623 @@ +/* Copyright (C) 2006,2007,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_ZulJin +SD%Complete: 85% +SDComment: +EndScriptData */ + +#include "ScriptedPch.h" +#include "zulaman.h" + +//Speech +#define YELL_TRANSFORM_TO_LYNX "Let me introduce to you my new bruddahs: fang and claw!" +#define SOUND_TRANSFORM_TO_LYNX 12094 + +#define YELL_TRANSFORM_TO_BEAR "Got me some new tricks...like me bruddah bear!" +#define SOUND_TRANSFORM_TO_BEAR 12092 + +#define YELL_TRANSFORM_TO_DRAGONHAWK "Ya don' have to look to da sky to see da dragonhawk!" +#define SOUND_TRANSFORM_TO_DRAGONHAWK 12095 + +#define YELL_TRANSFORM_TO_EAGLE "Dere be no hidin' from da eagle!" +#define SOUND_TRANSFORM_TO_EAGLE 12093 + +#define YELL_KILL_ONE "Da Amani de chuka!" +#define SOUND_KILL_ONE 12098 + +#define YELL_KILL_TWO "Lot more gonna fall like you!" +#define SOUND_KILL_TWO 12099 + +#define YELL_FIRE_BREATH "Fire kill you just as quick!" +#define SOUND_FIRE_BRETH 12096 + +#define YELL_AGGRO "Nobody badduh dan me!" +#define SOUND_AGGRO 12091 + +#define YELL_BERSERK "You too slow! Me too strong!" +#define SOUND_BERSERK 12097 + +#define YELL_DEATH "Mebbe me fall...but da Amani empire...never gonna die..." +#define SOUND_DEATH 12100 + +//Still not used, need more info +#define YELL_INTRO "Everybody always wanna take from us. Now we gonna start takin' back. Anybody who get in our way...gonna drown in their own blood! De Amani empire be back now...seekin' vengeance. And we gonna start...with you!" +#define SOUND_INTRO 12090 + +//Spells: +//====== Troll Form +#define SPELL_WHIRLWIND 17207 +#define SPELL_GRIEVOUS_THROW 43093 // remove debuff after full healed +//====== Bear Form +#define SPELL_CREEPING_PARALYSIS 43095 // should cast on the whole raid +#define SPELL_OVERPOWER 43456 // use after melee attack dodged +//====== Eagle Form +#define SPELL_ENERGY_STORM 43983 // enemy area aura, trigger 42577 +#define SPELL_ZAP_INFORM 42577 +#define SPELL_ZAP_DAMAGE 43137 // 1250 damage +#define SPELL_SUMMON_CYCLONE 43112 // summon four feather vortex +#define CREATURE_FEATHER_VORTEX 24136 +#define SPELL_CYCLONE_VISUAL 43119 // trigger 43147 visual +#define SPELL_CYCLONE_PASSIVE 43120 // trigger 43121 (4y aoe) every second +//Lynx Form +#define SPELL_CLAW_RAGE_HASTE 42583 +#define SPELL_CLAW_RAGE_TRIGGER 43149 +#define SPELL_CLAW_RAGE_DAMAGE 43150 +#define SPELL_LYNX_RUSH_HASTE 43152 +#define SPELL_LYNX_RUSH_DAMAGE 43153 +//Dragonhawk Form +#define SPELL_FLAME_WHIRL 43213 // trigger two spells +#define SPELL_FLAME_BREATH 43215 +#define SPELL_SUMMON_PILLAR 43216 // summon 24187 +#define CREATURE_COLUMN_OF_FIRE 24187 +#define SPELL_PILLAR_TRIGGER 43218 // trigger 43217 + +//cosmetic +#define SPELL_SPIRIT_AURA 42466 +#define SPELL_SIPHON_SOUL 43501 + +//Transforms: +#define SPELL_SHAPE_OF_THE_BEAR 42594 // 15% dmg +#define SPELL_SHAPE_OF_THE_EAGLE 42606 +#define SPELL_SHAPE_OF_THE_LYNX 42607 // haste melee 30% +#define SPELL_SHAPE_OF_THE_DRAGONHAWK 42608 + +#define SPELL_BERSERK 45078 + +#define PHASE_BEAR 0 +#define PHASE_EAGLE 1 +#define PHASE_LYNX 2 +#define PHASE_DRAGONHAWK 3 +#define PHASE_TROLL 4 + +//coords for going for changing form +#define CENTER_X 120.148811 +#define CENTER_Y 703.713684 +#define CENTER_Z 45.111477 + +struct SpiritInfoStruct +{ + uint32 entry; + float x, y, z, orient; +}; + +static SpiritInfoStruct SpiritInfo[] = +{ + {23878, 147.87, 706.51, 45.11, 3.04}, + {23880, 88.95, 705.49, 45.11, 6.11}, + {23877, 137.23, 725.98, 45.11, 3.71}, + {23879, 104.29, 726.43, 45.11, 5.43} +}; + +struct TransformStruct +{ + uint32 sound; + char* text; + uint32 spell, unaura; +}; + +static TransformStruct Transform[] = +{ + {SOUND_TRANSFORM_TO_BEAR, YELL_TRANSFORM_TO_BEAR, SPELL_SHAPE_OF_THE_BEAR, SPELL_WHIRLWIND}, + {SOUND_TRANSFORM_TO_EAGLE, YELL_TRANSFORM_TO_EAGLE, SPELL_SHAPE_OF_THE_EAGLE, SPELL_SHAPE_OF_THE_BEAR}, + {SOUND_TRANSFORM_TO_LYNX, YELL_TRANSFORM_TO_LYNX, SPELL_SHAPE_OF_THE_LYNX, SPELL_SHAPE_OF_THE_EAGLE}, + {SOUND_TRANSFORM_TO_DRAGONHAWK, YELL_TRANSFORM_TO_DRAGONHAWK, SPELL_SHAPE_OF_THE_DRAGONHAWK, SPELL_SHAPE_OF_THE_LYNX} +}; + +struct boss_zuljinAI : public ScriptedAI +{ + boss_zuljinAI(Creature *c) : ScriptedAI(c), Summons(me) + { + pInstance = c->GetInstanceData(); + } + ScriptedInstance *pInstance; + + uint64 SpiritGUID[4]; + uint64 ClawTargetGUID; + uint64 TankGUID; + + uint32 Phase; + uint32 health_20; + + uint32 Intro_Timer; + uint32 Berserk_Timer; + + uint32 Whirlwind_Timer; + uint32 Grievous_Throw_Timer; + + uint32 Creeping_Paralysis_Timer; + uint32 Overpower_Timer; + + uint32 Claw_Rage_Timer; + uint32 Lynx_Rush_Timer; + uint32 Claw_Counter; + uint32 Claw_Loop_Timer; + + uint32 Flame_Whirl_Timer; + uint32 Flame_Breath_Timer; + uint32 Pillar_Of_Fire_Timer; + + SummonList Summons; + + void Reset() + { + if (pInstance) + pInstance->SetData(DATA_ZULJINEVENT, NOT_STARTED); + + Phase = 0; + + health_20 = me->GetMaxHealth()*0.2; + + Intro_Timer = 37000; + Berserk_Timer = 600000; + + Whirlwind_Timer = 7000; + Grievous_Throw_Timer = 8000; + + Creeping_Paralysis_Timer = 7000; + Overpower_Timer = 0; + + Claw_Rage_Timer = 5000; + Lynx_Rush_Timer = 14000; + Claw_Loop_Timer = 0; + Claw_Counter = 0; + + Flame_Whirl_Timer = 5000; + Flame_Breath_Timer = 6000; + Pillar_Of_Fire_Timer = 7000; + + ClawTargetGUID = 0; + TankGUID = 0; + + Summons.DespawnAll(); + + me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 47174); + //me->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, 218172674); + //me->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE); + } + + void EnterCombat(Unit * /*who*/) + { + if (pInstance) + pInstance->SetData(DATA_ZULJINEVENT, IN_PROGRESS); + + DoZoneInCombat(); + + me->MonsterYell(YELL_INTRO,LANG_UNIVERSAL,NULL); + DoPlaySoundToSet(me, SOUND_INTRO); + SpawnAdds(); + EnterPhase(0); + } + + void KilledUnit(Unit* /*victim*/) + { + if (Intro_Timer) + return; + + switch (urand(0,1)) + { + case 0: + me->MonsterYell(YELL_KILL_ONE, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_KILL_ONE); + break; + case 1: + me->MonsterYell(YELL_KILL_TWO, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_KILL_TWO); + break; + } + } + + void JustDied(Unit* /*Killer*/) + { + if (pInstance) + pInstance->SetData(DATA_ZULJINEVENT, DONE); + + me->MonsterYell(YELL_DEATH, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_DEATH); + Summons.DespawnEntry(CREATURE_COLUMN_OF_FIRE); + + if (Unit *Temp = Unit::GetUnit(*me, SpiritGUID[3])) + Temp->SetUInt32Value(UNIT_FIELD_BYTES_1,UNIT_STAND_STATE_DEAD); + } + + void AttackStart(Unit *who) + { + if (Phase == 2) + AttackStartNoMove(who); + else + ScriptedAI::AttackStart(who); + } + + void DoMeleeAttackIfReady() + { + if (!me->IsNonMeleeSpellCasted(false)) + { + if (me->isAttackReady() && me->IsWithinMeleeRange(me->getVictim())) + { + if (Phase == 1 && !Overpower_Timer) + { + uint32 health = me->getVictim()->GetHealth(); + me->AttackerStateUpdate(me->getVictim()); + if (me->getVictim() && health == me->getVictim()->GetHealth()) + { + DoCast(me->getVictim(), SPELL_OVERPOWER, false); + Overpower_Timer = 5000; + } + } else me->AttackerStateUpdate(me->getVictim()); + me->resetAttackTimer(); + } + } + } + + void SpawnAdds() + { + Creature *pCreature = NULL; + for (uint8 i = 0; i < 4; ++i) + { + pCreature = me->SummonCreature(SpiritInfo[i].entry, SpiritInfo[i].x, SpiritInfo[i].y, SpiritInfo[i].z, SpiritInfo[i].orient, TEMPSUMMON_DEAD_DESPAWN, 0); + if (pCreature) + { + pCreature->CastSpell(pCreature, SPELL_SPIRIT_AURA, true); + pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + SpiritGUID[i] = pCreature->GetGUID(); + } + } + } + + void DespawnAdds() + { + for (uint8 i = 0; i < 4; ++i) + { + Unit* Temp = NULL; + if (SpiritGUID[i]) + { + if (Temp = Unit::GetUnit(*me, SpiritGUID[i])) + { + Temp->SetVisibility(VISIBILITY_OFF); + Temp->setDeathState(DEAD); + } + } + SpiritGUID[i] = 0; + } + } + + void JustSummoned(Creature *summon) + { + Summons.Summon(summon); + } + + void SummonedCreatureDespawn(Creature *summon) + { + Summons.Despawn(summon); + } + + void EnterPhase(uint32 NextPhase) + { + switch(NextPhase) + { + case 0: + break; + case 1: + case 2: + case 3: + case 4: + DoTeleportTo(CENTER_X, CENTER_Y, CENTER_Z, 100); + DoResetThreat(); + me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 0); + me->RemoveAurasDueToSpell(Transform[Phase].unaura); + DoCast(me, Transform[Phase].spell); + me->MonsterYell(Transform[Phase].text, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, Transform[Phase].sound); + if (Phase > 0) + { + if (Unit *Temp = Unit::GetUnit(*me, SpiritGUID[Phase - 1])) + Temp->SetUInt32Value(UNIT_FIELD_BYTES_1,UNIT_STAND_STATE_DEAD); + } + if (Unit *Temp = Unit::GetUnit(*me, SpiritGUID[NextPhase - 1])) + Temp->CastSpell(me, SPELL_SIPHON_SOUL, false); // should m cast on temp + if (NextPhase == 2) + { + me->GetMotionMaster()->Clear(); + DoCast(me, SPELL_ENERGY_STORM, true); // enemy aura + for (uint8 i = 0; i < 4; ++i) + { + Creature* Vortex = DoSpawnCreature(CREATURE_FEATHER_VORTEX, 0, 0, 0, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); + if (Vortex) + { + Vortex->CastSpell(Vortex, SPELL_CYCLONE_PASSIVE, true); + Vortex->CastSpell(Vortex, SPELL_CYCLONE_VISUAL, true); + Vortex->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + Vortex->SetSpeed(MOVE_RUN, 1.0f); + Vortex->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0)); + DoZoneInCombat(Vortex); + } + } + } + else + me->AI()->AttackStart(me->getVictim()); + if (NextPhase == 3) + { + me->RemoveAurasDueToSpell(SPELL_ENERGY_STORM); + Summons.DespawnEntry(CREATURE_FEATHER_VORTEX); + me->GetMotionMaster()->MoveChase(me->getVictim()); + } + break; + default: + break; + } + Phase = NextPhase; + } + + void UpdateAI(const uint32 diff) + { + if (!TankGUID) + { + if (!UpdateVictim()) + return; + + if (me->GetHealth() < health_20 * (4 - Phase)) + EnterPhase(Phase + 1); + } + + if (Berserk_Timer <= diff) + { + DoCast(me, SPELL_BERSERK, true); + me->MonsterYell(YELL_BERSERK, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_BERSERK); + Berserk_Timer = 60000; + } else Berserk_Timer -= diff; + + switch (Phase) + { + case 0: + if (Intro_Timer) + { + if (Intro_Timer <= diff) + { + me->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_AGGRO); + Intro_Timer = 0; + } else Intro_Timer -= diff; + } + + if (Whirlwind_Timer <= diff) + { + DoCast(me, SPELL_WHIRLWIND); + Whirlwind_Timer = 15000 + rand()%5000; + } else Whirlwind_Timer -= diff; + + if (Grievous_Throw_Timer <= diff) + { + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) + DoCast(pTarget, SPELL_GRIEVOUS_THROW, false); + Grievous_Throw_Timer = 10000; + } else Grievous_Throw_Timer -= diff; + break; + + case 1: + if (Creeping_Paralysis_Timer <= diff) + { + DoCast(me, SPELL_CREEPING_PARALYSIS); + Creeping_Paralysis_Timer = 20000; + } else Creeping_Paralysis_Timer -= diff; + + if (Overpower_Timer <= diff) + { + // implemented in DoMeleeAttackIfReady() + Overpower_Timer = 0; + } else Overpower_Timer -= diff; + break; + + case 2: + return; + + case 3: + if (Claw_Rage_Timer <= diff) + { + if (!TankGUID) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + TankGUID = me->getVictim()->GetGUID(); + me->SetSpeed(MOVE_RUN, 5.0f); + AttackStart(pTarget); // change victim + Claw_Rage_Timer = 0; + Claw_Loop_Timer = 500; + Claw_Counter = 0; + } + } + else if (!Claw_Rage_Timer) // do not do this when Lynx_Rush + { + if (Claw_Loop_Timer <= diff) + { + Unit *pTarget = me->getVictim(); + if (!pTarget || !pTarget->isTargetableForAttack()) pTarget = Unit::GetUnit(*me, TankGUID); + if (!pTarget || !pTarget->isTargetableForAttack()) pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (pTarget) + { + AttackStart(pTarget); + if (me->IsWithinMeleeRange(pTarget)) + { + DoCast(pTarget, SPELL_CLAW_RAGE_DAMAGE, true); + ++Claw_Counter; + if (Claw_Counter == 12) + { + Claw_Rage_Timer = 15000 + rand()%5000; + me->SetSpeed(MOVE_RUN, 1.2f); + AttackStart(Unit::GetUnit(*me, TankGUID)); + TankGUID = 0; + return; + } + else + Claw_Loop_Timer = 500; + } + } + else + { + EnterEvadeMode(); // if (pTarget) + return; + } + } else Claw_Loop_Timer -= diff; + } //if (TankGUID) + } else Claw_Rage_Timer -= diff; + + if (Lynx_Rush_Timer <= diff) + { + if (!TankGUID) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + TankGUID = me->getVictim()->GetGUID(); + me->SetSpeed(MOVE_RUN, 5.0f); + AttackStart(pTarget); // change victim + Lynx_Rush_Timer = 0; + Claw_Counter = 0; + } + } + else if (!Lynx_Rush_Timer) + { + Unit *pTarget = me->getVictim(); + if (!pTarget || !pTarget->isTargetableForAttack()) + { + pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + AttackStart(pTarget); + } + if (pTarget) + { + if (me->IsWithinMeleeRange(pTarget)) + { + DoCast(pTarget, SPELL_LYNX_RUSH_DAMAGE, true); + ++Claw_Counter; + if (Claw_Counter == 9) + { + Lynx_Rush_Timer = 15000 + rand()%5000; + me->SetSpeed(MOVE_RUN, 1.2f); + AttackStart(Unit::GetUnit(*me, TankGUID)); + TankGUID = 0; + } + else + AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0)); + } + } + else + { + EnterEvadeMode(); // if (pTarget) + return; + } + } //if (TankGUID) + } else Lynx_Rush_Timer -= diff; + + break; + case 4: + if (Flame_Whirl_Timer <= diff) + { + DoCast(me, SPELL_FLAME_WHIRL); + Flame_Whirl_Timer = 12000; + }Flame_Whirl_Timer -= diff; + + if (Pillar_Of_Fire_Timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(pTarget, SPELL_SUMMON_PILLAR); + Pillar_Of_Fire_Timer = 10000; + } else Pillar_Of_Fire_Timer -= diff; + + if (Flame_Breath_Timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + me->SetInFront(pTarget); + DoCast(me, SPELL_FLAME_BREATH); + Flame_Breath_Timer = 10000; + } else Flame_Breath_Timer -= diff; + break; + + default: + break; + } + + if (!TankGUID) + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_zuljin(Creature* pCreature) +{ + return new boss_zuljinAI (pCreature); +} + +struct feather_vortexAI : public ScriptedAI +{ + feather_vortexAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + + void EnterCombat(Unit * /*pTarget*/) {} + + void SpellHit(Unit *caster, const SpellEntry *spell) + { + if (spell->Id == SPELL_ZAP_INFORM) + DoCast(caster, SPELL_ZAP_DAMAGE, true); + } + + void UpdateAI(const uint32 /*diff*/) + { + //if the vortex reach the target, it change his target to another player + if (me->IsWithinMeleeRange(me->getVictim())) + AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0)); + } +}; + +CreatureAI* GetAI_feather_vortexAI(Creature* pCreature) +{ + return new feather_vortexAI (pCreature); +} + +void AddSC_boss_zuljin() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_zuljin"; + newscript->GetAI = &GetAI_boss_zuljin; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_zuljin_vortex"; + newscript->GetAI = &GetAI_feather_vortexAI; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp b/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp new file mode 100644 index 00000000000..897330691a6 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp @@ -0,0 +1,320 @@ + /* 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_zulaman +SD%Complete: 80 +SDComment: +SDCategory: Zul'Aman +EndScriptData */ + +#include "ScriptedPch.h" +#include "zulaman.h" + +#define MAX_ENCOUNTER 6 +#define RAND_VENDOR 2 + +//187021 //Harkor's Satchel +//186648 //Tanzar's Trunk +//186672 //Ashli's Bag +//186667 //Kraz's Package +// Chests spawn at bear/eagle/dragonhawk/lynx bosses +// The loots depend on how many bosses have been killed, but not the entries of the chests +// But we cannot add loots to gameobject, so we have to use the fixed loot_template +struct SHostageInfo +{ + uint32 npc, pGo; + float x, y, z, o; +}; + +static SHostageInfo HostageInfo[] = +{ + {23790, 186648, -57, 1343, 40.77, 3.2}, // bear + {23999, 187021, 400, 1414, 74.36, 3.3}, // eagle + {24001, 186672, -35, 1134, 18.71, 1.9}, // dragonhawk + {24024, 186667, 413, 1117, 6.32, 3.1} // lynx + +}; + +struct instance_zulaman : public ScriptedInstance +{ + instance_zulaman(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint64 HarkorsSatchelGUID; + uint64 TanzarsTrunkGUID; + uint64 AshlisBagGUID; + uint64 KrazsPackageGUID; + + uint64 HexLordGateGUID; + uint64 ZulJinGateGUID; + uint64 AkilzonDoorGUID; + uint64 ZulJinDoorGUID; + uint64 HalazziDoorGUID; + + uint32 QuestTimer; + uint16 BossKilled; + uint16 QuestMinute; + uint16 ChestLooted; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + uint32 RandVendor[RAND_VENDOR]; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + HarkorsSatchelGUID = 0; + TanzarsTrunkGUID = 0; + AshlisBagGUID = 0; + KrazsPackageGUID = 0; + + HexLordGateGUID = 0; + ZulJinGateGUID = 0; + AkilzonDoorGUID = 0; + HalazziDoorGUID = 0; + ZulJinDoorGUID = 0; + + QuestTimer = 0; + QuestMinute = 21; + BossKilled = 0; + ChestLooted = 0; + + for (uint8 i = 0; i < RAND_VENDOR; ++i) + RandVendor[i] = NOT_STARTED; + } + + 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 23578://janalai + case 23863://zuljin + case 24239://hexlord + case 23577://halazzi + case 23576://nalorakk + default: break; + } + } + + void OnGameObjectCreate(GameObject* pGo, bool /*add*/) + { + switch(pGo->GetEntry()) + { + case 186303: HalazziDoorGUID = pGo->GetGUID(); break; + case 186304: ZulJinGateGUID = pGo->GetGUID(); break; + case 186305: HexLordGateGUID = pGo->GetGUID(); break; + case 186858: AkilzonDoorGUID = pGo->GetGUID(); break; + case 186859: ZulJinDoorGUID = pGo->GetGUID(); break; + + case 187021: HarkorsSatchelGUID = pGo->GetGUID(); break; + case 186648: TanzarsTrunkGUID = pGo->GetGUID(); break; + case 186672: AshlisBagGUID = pGo->GetGUID(); break; + case 186667: KrazsPackageGUID = pGo->GetGUID(); break; + default: break; + + } + CheckInstanceStatus(); + } + + void SummonHostage(uint8 num) + { + if (!QuestMinute) + return; + + Map::PlayerList const &PlayerList = instance->GetPlayers(); + if (PlayerList.isEmpty()) + return; + + Map::PlayerList::const_iterator i = PlayerList.begin(); + if (Player* i_pl = i->getSource()) + { + if (Unit* Hostage = i_pl->SummonCreature(HostageInfo[num].npc, HostageInfo[num].x, HostageInfo[num].y, HostageInfo[num].z, HostageInfo[num].o, TEMPSUMMON_DEAD_DESPAWN, 0)) + { + Hostage->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + Hostage->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + } + } + } + + void CheckInstanceStatus() + { + if (BossKilled >= 4) + HandleGameObject(HexLordGateGUID, true); + + if (BossKilled >= 5) + HandleGameObject(ZulJinGateGUID, true); + } + + std::string GetSaveData() + { + std::ostringstream ss; + ss << "S " << BossKilled << " " << ChestLooted << " " << QuestMinute; + char* data = new char[ss.str().length()+1]; + strcpy(data, ss.str().c_str()); + //error_log("TSCR: Zul'aman saved, %s.", data); + return data; + } + + void Load(const char* load) + { + if (!load) return; + std::istringstream ss(load); + //error_log("TSCR: Zul'aman loaded, %s.", ss.str().c_str()); + char dataHead; // S + uint16 data1, data2, data3; + ss >> dataHead >> data1 >> data2 >> data3; + //error_log("TSCR: Zul'aman loaded, %d %d %d.", data1, data2, data3); + if (dataHead == 'S') + { + BossKilled = data1; + ChestLooted = data2; + QuestMinute = data3; + } else error_log("TSCR: Zul'aman: corrupted save data."); + } + + void SetData(uint32 type, uint32 data) + { + switch(type) + { + case DATA_NALORAKKEVENT: + m_auiEncounter[0] = data; + if (data == DONE) + { + if (QuestMinute) + { + QuestMinute += 15; + DoUpdateWorldState(3106, QuestMinute); + } + SummonHostage(0); + } + break; + case DATA_AKILZONEVENT: + m_auiEncounter[1] = data; + HandleGameObject(AkilzonDoorGUID, data != IN_PROGRESS); + if (data == DONE) + { + if (QuestMinute) + { + QuestMinute += 10; + DoUpdateWorldState(3106, QuestMinute); + } + SummonHostage(1); + } + break; + case DATA_JANALAIEVENT: + m_auiEncounter[2] = data; + if (data == DONE) SummonHostage(2); + break; + case DATA_HALAZZIEVENT: + m_auiEncounter[3] = data; + HandleGameObject(HalazziDoorGUID, data != IN_PROGRESS); + if (data == DONE) SummonHostage(3); + break; + case DATA_HEXLORDEVENT: + m_auiEncounter[4] = data; + if (data == IN_PROGRESS) + HandleGameObject(HexLordGateGUID, false); + else if (data == NOT_STARTED) + CheckInstanceStatus(); + break; + case DATA_ZULJINEVENT: + m_auiEncounter[5] = data; + HandleGameObject(ZulJinDoorGUID, data != IN_PROGRESS); + break; + case DATA_CHESTLOOTED: + ++ChestLooted; + SaveToDB(); + break; + case TYPE_RAND_VENDOR_1: + RandVendor[0] = data; + break; + case TYPE_RAND_VENDOR_2: + RandVendor[1] = data; + break; + } + + if (data == DONE) + { + ++BossKilled; + if (QuestMinute && BossKilled >= 4) + { + QuestMinute = 0; + DoUpdateWorldState(3104, 0); + } + CheckInstanceStatus(); + SaveToDB(); + } + } + + uint32 GetData(uint32 type) + { + switch(type) + { + case DATA_NALORAKKEVENT: return m_auiEncounter[0]; + case DATA_AKILZONEVENT: return m_auiEncounter[1]; + case DATA_JANALAIEVENT: return m_auiEncounter[2]; + case DATA_HALAZZIEVENT: return m_auiEncounter[3]; + case DATA_HEXLORDEVENT: return m_auiEncounter[4]; + case DATA_ZULJINEVENT: return m_auiEncounter[5]; + case DATA_CHESTLOOTED: return ChestLooted; + case TYPE_RAND_VENDOR_1: return RandVendor[0]; + case TYPE_RAND_VENDOR_2: return RandVendor[1]; + default: return 0; + } + } + + void Update(uint32 diff) + { + if (QuestMinute) + { + if (QuestTimer <= diff) + { + QuestMinute--; + SaveToDB(); + QuestTimer += 60000; + if (QuestMinute) + { + DoUpdateWorldState(3104, 1); + DoUpdateWorldState(3106, QuestMinute); + } else DoUpdateWorldState(3104, 0); + } + QuestTimer -= diff; + } + } +}; + +InstanceData* GetInstanceData_instance_zulaman(Map* pMap) +{ + return new instance_zulaman(pMap); +} + +void AddSC_instance_zulaman() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_zulaman"; + newscript->GetInstanceData = &GetInstanceData_instance_zulaman; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp new file mode 100644 index 00000000000..067ae687644 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp @@ -0,0 +1,192 @@ +/* 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: Zulaman +SD%Complete: 90 +SDComment: Forest Frog will turn into different NPC's. Workaround to prevent new entry from running this script +SDCategory: Zul'Aman +EndScriptData */ + +/* ContentData +npc_forest_frog +EndContentData */ + +#include "ScriptedPch.h" +#include "zulaman.h" + +/*###### +## npc_forest_frog +######*/ + +#define SPELL_REMOVE_AMANI_CURSE 43732 +#define SPELL_PUSH_MOJO 43923 +#define ENTRY_FOREST_FROG 24396 + +struct npc_forest_frogAI : public ScriptedAI +{ + npc_forest_frogAI(Creature* c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance *pInstance; + + void Reset() {} + + void EnterCombat(Unit * /*who*/) {} + + void DoSpawnRandom() + { + if (pInstance) + { + uint32 cEntry = 0; + switch(rand()%10) + { + case 0: cEntry = 24397; break; //Mannuth + case 1: cEntry = 24403; break; //Deez + case 2: cEntry = 24404; break; //Galathryn + case 3: cEntry = 24405; break; //Adarrah + case 4: cEntry = 24406; break; //Fudgerick + case 5: cEntry = 24407; break; //Darwen + case 6: cEntry = 24445; break; //Mitzi + case 7: cEntry = 24448; break; //Christian + case 8: cEntry = 24453; break; //Brennan + case 9: cEntry = 24455; break; //Hollee + } + + if (!pInstance->GetData(TYPE_RAND_VENDOR_1)) + if (rand()%10 == 1) cEntry = 24408; //Gunter + if (!pInstance->GetData(TYPE_RAND_VENDOR_2)) + if (rand()%10 == 1) cEntry = 24409; //Kyren + + if (cEntry) me->UpdateEntry(cEntry); + + if (cEntry == 24408) pInstance->SetData(TYPE_RAND_VENDOR_1,DONE); + if (cEntry == 24409) pInstance->SetData(TYPE_RAND_VENDOR_2,DONE); + } + } + + void SpellHit(Unit *caster, const SpellEntry *spell) + { + if (spell->Id == SPELL_REMOVE_AMANI_CURSE && caster->GetTypeId() == TYPEID_PLAYER && me->GetEntry() == ENTRY_FOREST_FROG) + { + //increase or decrease chance of mojo? + if (rand()%99 == 50) DoCast(caster, SPELL_PUSH_MOJO, true); + else DoSpawnRandom(); + } + } +}; +CreatureAI* GetAI_npc_forest_frog(Creature* pCreature) +{ + return new npc_forest_frogAI (pCreature); +} + +/*###### +## npc_zulaman_hostage +######*/ + +#define GOSSIP_HOSTAGE1 "I am glad to help you." + +static uint32 HostageEntry[] = {23790, 23999, 24024, 24001}; +static uint32 ChestEntry[] = {186648, 187021, 186672, 186667}; + +struct npc_zulaman_hostageAI : public ScriptedAI +{ + npc_zulaman_hostageAI(Creature *c) : ScriptedAI(c) {IsLoot = false;} + bool IsLoot; + uint64 PlayerGUID; + void Reset() {} + void EnterCombat(Unit * /*who*/) {} + void JustDied(Unit* /*who*/) + { + Player* pPlayer = Unit::GetPlayer(PlayerGUID); + if (pPlayer) pPlayer->SendLoot(me->GetGUID(), LOOT_CORPSE); + } + void UpdateAI(const uint32 /*diff*/) + { + if (IsLoot) + DoCast(me, 7, false); + } +}; + +bool GossipHello_npc_zulaman_hostage(Player* pPlayer, Creature* pCreature) +{ + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HOSTAGE1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_zulaman_hostage(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) + pPlayer->CLOSE_GOSSIP_MENU(); + + if (!pCreature->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP)) + return true; + pCreature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + + ScriptedInstance* pInstance = pCreature->GetInstanceData(); + if (pInstance) + { + //uint8 progress = pInstance->GetData(DATA_CHESTLOOTED); + pInstance->SetData(DATA_CHESTLOOTED, 0); + float x, y, z; + pCreature->GetPosition(x, y, z); + uint32 entry = pCreature->GetEntry(); + for (uint8 i = 0; i < 4; ++i) + { + if (HostageEntry[i] == entry) + { + pCreature->SummonGameObject(ChestEntry[i], x-2, y, z, 0, 0, 0, 0, 0, 0); + break; + } + } + /*Creature* summon = pCreature->SummonCreature(HostageInfo[progress], x-2, y, z, 0, TEMPSUMMON_DEAD_DESPAWN, 0); + if (summon) + { + CAST_AI(npc_zulaman_hostageAI, summon->AI())->PlayerGUID = pPlayer->GetGUID(); + CAST_AI(npc_zulaman_hostageAI, summon->AI())->IsLoot = true; + summon->SetDisplayId(10056); + summon->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + summon->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + }*/ + } + return true; +} + +CreatureAI* GetAI_npc_zulaman_hostage(Creature* pCreature) +{ + return new npc_zulaman_hostageAI(pCreature); +} + +void AddSC_zulaman() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_forest_frog"; + newscript->GetAI = &GetAI_npc_forest_frog; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_zulaman_hostage"; + newscript->GetAI = &GetAI_npc_zulaman_hostage; + newscript->pGossipHello = &GossipHello_npc_zulaman_hostage; + newscript->pGossipSelect = &GossipSelect_npc_zulaman_hostage; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.h b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.h new file mode 100644 index 00000000000..6fb0ef173bd --- /dev/null +++ b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.h @@ -0,0 +1,19 @@ +/* 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_ZULAMAN_H +#define DEF_ZULAMAN_H + +#define DATA_NALORAKKEVENT 1 +#define DATA_AKILZONEVENT 2 +#define DATA_JANALAIEVENT 3 +#define DATA_HALAZZIEVENT 4 +#define DATA_HEXLORDEVENT 5 +#define DATA_ZULJINEVENT 6 +#define DATA_CHESTLOOTED 7 +#define TYPE_RAND_VENDOR_1 8 +#define TYPE_RAND_VENDOR_2 9 + +#endif + diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp new file mode 100644 index 00000000000..cbbe6c4dc4c --- /dev/null +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp @@ -0,0 +1,278 @@ +/* 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_Arlokk +SD%Complete: 95 +SDComment: Wrong cleave and red aura is missing. +SDCategory: Zul'Gurub +EndScriptData */ + +#include "ScriptedPch.h" +#include "zulgurub.h" + +bool GOHello_go_gong_of_bethekk(Player* /*pPlayer*/, GameObject* pGo) +{ + if (ScriptedInstance* m_pInstance = pGo->GetInstanceData()) + { + if (m_pInstance->GetData(TYPE_ARLOKK) == DONE || m_pInstance->GetData(TYPE_ARLOKK) == IN_PROGRESS) + return true; + + m_pInstance->SetData(TYPE_ARLOKK, IN_PROGRESS); + return true; + } + + return true; +} + +enum eEnums +{ + SAY_AGGRO = -1309011, + SAY_FEAST_PANTHER = -1309012, + SAY_DEATH = -1309013, + + SPELL_SHADOWWORDPAIN = 23952, + SPELL_GOUGE = 24698, + SPELL_MARK = 24210, + SPELL_CLEAVE = 26350, //Perhaps not right. Not a red aura... + SPELL_PANTHER_TRANSFORM = 24190, + + MODEL_ID_NORMAL = 15218, + MODEL_ID_PANTHER = 15215, + MODEL_ID_BLANK = 11686, + + NPC_ZULIAN_PROWLER = 15101 +}; + +struct boss_arlokkAI : public ScriptedAI +{ + boss_arlokkAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = pCreature->GetInstanceData(); + } + + ScriptedInstance* m_pInstance; + + uint32 m_uiShadowWordPain_Timer; + uint32 m_uiGouge_Timer; + uint32 m_uiMark_Timer; + uint32 m_uiCleave_Timer; + uint32 m_uiVanish_Timer; + uint32 m_uiVisible_Timer; + + uint32 m_uiSummon_Timer; + uint32 m_uiSummonCount; + + Unit* m_pMarkedTarget; + uint64 MarkedTargetGUID; + + bool m_bIsPhaseTwo; + bool m_bIsVanished; + + void Reset() + { + m_uiShadowWordPain_Timer = 8000; + m_uiGouge_Timer = 14000; + m_uiMark_Timer = 35000; + m_uiCleave_Timer = 4000; + m_uiVanish_Timer = 60000; + m_uiVisible_Timer = 6000; + + m_uiSummon_Timer = 5000; + m_uiSummonCount = 0; + + m_bIsPhaseTwo = false; + m_bIsVanished = false; + + MarkedTargetGUID = 0; + + me->SetDisplayId(MODEL_ID_NORMAL); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + } + + void EnterCombat(Unit* /*pWho*/) + { + DoScriptText(SAY_AGGRO, me); + } + + void JustReachedHome() + { + if (m_pInstance) + m_pInstance->SetData(TYPE_ARLOKK, NOT_STARTED); + + //we should be summoned, so despawn + me->ForcedDespawn(); + } + + void JustDied(Unit* /*pKiller*/) + { + DoScriptText(SAY_DEATH, me); + + me->SetDisplayId(MODEL_ID_NORMAL); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + + if (m_pInstance) + m_pInstance->SetData(TYPE_ARLOKK, DONE); + } + + void DoSummonPhanters() + { + if (Unit *pMarkedTarget = Unit::GetUnit(*me, MarkedTargetGUID)) + DoScriptText(SAY_FEAST_PANTHER, me, pMarkedTarget); + + me->SummonCreature(NPC_ZULIAN_PROWLER, -11532.7998, -1649.6734, 41.4800, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + me->SummonCreature(NPC_ZULIAN_PROWLER, -11532.9970, -1606.4840, 41.2979, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + } + + void JustSummoned(Creature* pSummoned) + { + if (Unit *pMarkedTarget = Unit::GetUnit(*me, MarkedTargetGUID)) + pSummoned->AI()->AttackStart(pMarkedTarget); + + ++m_uiSummonCount; + } + + void UpdateAI(const uint32 uiDiff) + { + if (!UpdateVictim()) + return; + + if (!m_bIsPhaseTwo) + { + if (m_uiShadowWordPain_Timer <= uiDiff) + { + DoCast(me->getVictim(), SPELL_SHADOWWORDPAIN); + m_uiShadowWordPain_Timer = 15000; + } + else + m_uiShadowWordPain_Timer -= uiDiff; + + if (m_uiMark_Timer <= uiDiff) + { + Unit *pMarkedTarget = SelectUnit(SELECT_TARGET_RANDOM,0); + + if (pMarkedTarget) + { + DoCast(pMarkedTarget, SPELL_MARK); + MarkedTargetGUID = pMarkedTarget->GetGUID(); + } + else + error_log("TSCR: boss_arlokk could not accuire pMarkedTarget."); + + m_uiMark_Timer = 15000; + } + else + m_uiMark_Timer -= uiDiff; + } + else + { + //Cleave_Timer + if (m_uiCleave_Timer <= uiDiff) + { + DoCast(me->getVictim(), SPELL_CLEAVE); + m_uiCleave_Timer = 16000; + } + else + m_uiCleave_Timer -= uiDiff; + + //Gouge_Timer + if (m_uiGouge_Timer <= uiDiff) + { + DoCast(me->getVictim(), SPELL_GOUGE); + + DoModifyThreatPercent(me->getVictim(),-80); + + m_uiGouge_Timer = 17000+rand()%10000; + } + else + m_uiGouge_Timer -= uiDiff; + } + + if (m_uiSummonCount <= 30) + { + if (m_uiSummon_Timer <= uiDiff) + { + DoSummonPhanters(); + m_uiSummon_Timer = 5000; + } + else + m_uiSummon_Timer -= uiDiff; + } + + if (m_uiVanish_Timer <= uiDiff) + { + //Invisble Model + me->SetDisplayId(MODEL_ID_BLANK); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + + me->AttackStop(); + DoResetThreat(); + + m_bIsVanished = true; + + m_uiVanish_Timer = 45000; + m_uiVisible_Timer = 6000; + } + else + m_uiVanish_Timer -= uiDiff; + + if (m_bIsVanished) + { + if (m_uiVisible_Timer <= uiDiff) + { + //The Panther Model + me->SetDisplayId(MODEL_ID_PANTHER); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + + const CreatureInfo *cinfo = me->GetCreatureInfo(); + me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 35))); + me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 35))); + me->UpdateDamagePhysical(BASE_ATTACK); + + if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + AttackStart(pTarget); + + m_bIsPhaseTwo = true; + m_bIsVanished = false; + } + else + m_uiVisible_Timer -= uiDiff; + } + else + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_arlokk(Creature* pCreature) +{ + return new boss_arlokkAI (pCreature); +} + +void AddSC_boss_arlokk() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "go_gong_of_bethekk"; + newscript->pGOHello = &GOHello_go_gong_of_bethekk; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_arlokk"; + newscript->GetAI = &GetAI_boss_arlokk; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp new file mode 100644 index 00000000000..0201235be70 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp @@ -0,0 +1,93 @@ +/* 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_Gahz'ranka +SD%Complete: 85 +SDComment: Massive Geyser with knockback not working. Spell buggy. +SDCategory: Zul'Gurub +EndScriptData */ + +#include "ScriptedPch.h" + +#define SPELL_FROSTBREATH 16099 +#define SPELL_MASSIVEGEYSER 22421 //Not working. Cause its a summon... +#define SPELL_SLAM 24326 + +struct boss_gahzrankaAI : public ScriptedAI +{ + boss_gahzrankaAI(Creature *c) : ScriptedAI(c) {} + uint32 Frostbreath_Timer; + uint32 MassiveGeyser_Timer; + uint32 Slam_Timer; + + void Reset() + { + Frostbreath_Timer = 8000; + MassiveGeyser_Timer = 25000; + Slam_Timer = 17000; + } + + void EnterCombat(Unit * /*who*/) + { + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //Frostbreath_Timer + if (Frostbreath_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_FROSTBREATH); + Frostbreath_Timer = 7000 + rand()%4000; + } else Frostbreath_Timer -= diff; + + //MassiveGeyser_Timer + if (MassiveGeyser_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_MASSIVEGEYSER); + DoResetThreat(); + + MassiveGeyser_Timer = 22000 + rand()%10000; + } else MassiveGeyser_Timer -= diff; + + //Slam_Timer + if (Slam_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_SLAM); + Slam_Timer = 12000 + rand()%8000; + } else Slam_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_gahzranka(Creature* pCreature) +{ + return new boss_gahzrankaAI (pCreature); +} + +void AddSC_boss_gahzranka() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_gahzranka"; + newscript->GetAI = &GetAI_boss_gahzranka; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp new file mode 100644 index 00000000000..67de135674a --- /dev/null +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp @@ -0,0 +1,93 @@ +/* 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_Grilek +SD%Complete: 100 +SDComment: +SDCategory: Zul'Gurub +EndScriptData */ + +#include "ScriptedPch.h" +#include "zulgurub.h" + +#define SPELL_AVARTAR 24646 //The Enrage Spell +#define SPELL_GROUNDTREMOR 6524 + +struct boss_grilekAI : public ScriptedAI +{ + boss_grilekAI(Creature *c) : ScriptedAI(c) {} + + uint32 Avartar_Timer; + uint32 GroundTremor_Timer; + + void Reset() + { + Avartar_Timer = 15000 + rand()%10000; + GroundTremor_Timer = 8000 + rand()%8000; + } + + void EnterCombat(Unit * /*who*/) + { + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //Avartar_Timer + if (Avartar_Timer <= diff) + { + + DoCast(me, SPELL_AVARTAR); + Unit *pTarget = NULL; + + pTarget = SelectUnit(SELECT_TARGET_RANDOM,1); + + if (DoGetThreat(me->getVictim())) + DoModifyThreatPercent(me->getVictim(),-50); + if (pTarget) + AttackStart(pTarget); + + Avartar_Timer = 25000 + rand()%10000; + } else Avartar_Timer -= diff; + + //GroundTremor_Timer + if (GroundTremor_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_GROUNDTREMOR); + GroundTremor_Timer = 12000 + rand()%4000; + } else GroundTremor_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_grilek(Creature* pCreature) +{ + return new boss_grilekAI (pCreature); +} + +void AddSC_boss_grilek() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_grilek"; + newscript->GetAI = &GetAI_boss_grilek; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp new file mode 100644 index 00000000000..d7dd5020b74 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp @@ -0,0 +1,250 @@ +/* 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_Hakkar +SD%Complete: 95 +SDComment: Blood siphon spell buggy cause of Core Issue. +SDCategory: Zul'Gurub +EndScriptData */ + +#include "ScriptedPch.h" +#include "zulgurub.h" + +#define SAY_AGGRO -1309020 +#define SAY_FLEEING -1309021 +#define SAY_MINION_DESTROY -1309022 //where does it belong? +#define SAY_PROTECT_ALTAR -1309023 //where does it belong? + +#define SPELL_BLOODSIPHON 24322 +#define SPELL_CORRUPTEDBLOOD 24328 +#define SPELL_CAUSEINSANITY 24327 //Not working disabled. +#define SPELL_WILLOFHAKKAR 24178 +#define SPELL_ENRAGE 24318 + +// The Aspects of all High Priests +#define SPELL_ASPECT_OF_JEKLIK 24687 +#define SPELL_ASPECT_OF_VENOXIS 24688 +#define SPELL_ASPECT_OF_MARLI 24686 +#define SPELL_ASPECT_OF_THEKAL 24689 +#define SPELL_ASPECT_OF_ARLOKK 24690 + +struct boss_hakkarAI : public ScriptedAI +{ + boss_hakkarAI(Creature *c) : ScriptedAI(c) + { + m_pInstance = c->GetInstanceData(); + } + + ScriptedInstance *m_pInstance; + + uint32 BloodSiphon_Timer; + uint32 CorruptedBlood_Timer; + uint32 CauseInsanity_Timer; + uint32 WillOfHakkar_Timer; + uint32 Enrage_Timer; + + uint32 CheckJeklik_Timer; + uint32 CheckVenoxis_Timer; + uint32 CheckMarli_Timer; + uint32 CheckThekal_Timer; + uint32 CheckArlokk_Timer; + + uint32 AspectOfJeklik_Timer; + uint32 AspectOfVenoxis_Timer; + uint32 AspectOfMarli_Timer; + uint32 AspectOfThekal_Timer; + uint32 AspectOfArlokk_Timer; + + bool Enraged; + + void Reset() + { + BloodSiphon_Timer = 90000; + CorruptedBlood_Timer = 25000; + CauseInsanity_Timer = 17000; + WillOfHakkar_Timer = 17000; + Enrage_Timer = 600000; + + CheckJeklik_Timer = 1000; + CheckVenoxis_Timer = 2000; + CheckMarli_Timer = 3000; + CheckThekal_Timer = 4000; + CheckArlokk_Timer = 5000; + + AspectOfJeklik_Timer = 4000; + AspectOfVenoxis_Timer = 7000; + AspectOfMarli_Timer = 12000; + AspectOfThekal_Timer = 8000; + AspectOfArlokk_Timer = 18000; + + Enraged = false; + } + + void EnterCombat(Unit * /*who*/) + { + DoScriptText(SAY_AGGRO, me); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //BloodSiphon_Timer + if (BloodSiphon_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_BLOODSIPHON); + BloodSiphon_Timer = 90000; + } else BloodSiphon_Timer -= diff; + + //CorruptedBlood_Timer + if (CorruptedBlood_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_CORRUPTEDBLOOD); + CorruptedBlood_Timer = 30000 + rand()%15000; + } else CorruptedBlood_Timer -= diff; + + //CauseInsanity_Timer + /*if (CauseInsanity_Timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(pTarget, SPELL_CAUSEINSANITY); + + CauseInsanity_Timer = 35000 + rand()%8000; + } else CauseInsanity_Timer -= diff;*/ + + //WillOfHakkar_Timer + if (WillOfHakkar_Timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(pTarget, SPELL_WILLOFHAKKAR); + + WillOfHakkar_Timer = 25000 + rand()%10000; + } else WillOfHakkar_Timer -= diff; + + if (!Enraged && Enrage_Timer <= diff) + { + DoCast(me, SPELL_ENRAGE); + Enraged = true; + } else Enrage_Timer -= diff; + + //Checking if Jeklik is dead. If not we cast her Aspect + if (CheckJeklik_Timer <= diff) + { + if (m_pInstance) + { + if (m_pInstance->GetData(TYPE_JEKLIK) != DONE) + { + if (AspectOfJeklik_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_ASPECT_OF_JEKLIK); + AspectOfJeklik_Timer = 10000 + rand()%4000; + } else AspectOfJeklik_Timer -= diff; + } + } + CheckJeklik_Timer = 1000; + } else CheckJeklik_Timer -= diff; + + //Checking if Venoxis is dead. If not we cast his Aspect + if (CheckVenoxis_Timer <= diff) + { + if (m_pInstance) + { + if (m_pInstance->GetData(TYPE_VENOXIS) != DONE) + { + if (AspectOfVenoxis_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_ASPECT_OF_VENOXIS); + AspectOfVenoxis_Timer = 8000; + } else AspectOfVenoxis_Timer -= diff; + } + } + CheckVenoxis_Timer = 1000; + } else CheckVenoxis_Timer -= diff; + + //Checking if Marli is dead. If not we cast her Aspect + if (CheckMarli_Timer <= diff) + { + if (m_pInstance) + { + if (m_pInstance->GetData(TYPE_MARLI) != DONE) + { + if (AspectOfMarli_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_ASPECT_OF_MARLI); + AspectOfMarli_Timer = 10000; + } else AspectOfMarli_Timer -= diff; + + } + } + CheckMarli_Timer = 1000; + } else CheckMarli_Timer -= diff; + + //Checking if Thekal is dead. If not we cast his Aspect + if (CheckThekal_Timer <= diff) + { + if (m_pInstance) + { + if (m_pInstance->GetData(TYPE_THEKAL) != DONE) + { + if (AspectOfThekal_Timer <= diff) + { + DoCast(me, SPELL_ASPECT_OF_THEKAL); + AspectOfThekal_Timer = 15000; + } else AspectOfThekal_Timer -= diff; + } + } + CheckThekal_Timer = 1000; + } else CheckThekal_Timer -= diff; + + //Checking if Arlokk is dead. If yes we cast her Aspect + if (CheckArlokk_Timer <= diff) + { + if (m_pInstance) + { + if (m_pInstance->GetData(TYPE_ARLOKK) != DONE) + { + if (AspectOfArlokk_Timer <= diff) + { + DoCast(me, SPELL_ASPECT_OF_ARLOKK); + DoResetThreat(); + + AspectOfArlokk_Timer = 10000 + rand()%5000; + } else AspectOfArlokk_Timer -= diff; + } + } + CheckArlokk_Timer = 1000; + } else CheckArlokk_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_hakkar(Creature* pCreature) +{ + return new boss_hakkarAI (pCreature); +} + +void AddSC_boss_hakkar() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_hakkar"; + newscript->GetAI = &GetAI_boss_hakkar; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp new file mode 100644 index 00000000000..ca67d0842c3 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp @@ -0,0 +1,104 @@ +/* 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_Hazzarah +SD%Complete: 100 +SDComment: +SDCategory: Zul'Gurub +EndScriptData */ + +#include "ScriptedPch.h" +#include "zulgurub.h" + +#define SPELL_MANABURN 26046 +#define SPELL_SLEEP 24664 + +struct boss_hazzarahAI : public ScriptedAI +{ + boss_hazzarahAI(Creature *c) : ScriptedAI(c) {} + + uint32 ManaBurn_Timer; + uint32 Sleep_Timer; + uint32 Illusions_Timer; + + void Reset() + { + ManaBurn_Timer = 4000 + rand()%6000; + Sleep_Timer = 10000 + rand()%8000; + Illusions_Timer = 10000 + rand()%8000; + } + + void EnterCombat(Unit * /*who*/) + { + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //ManaBurn_Timer + if (ManaBurn_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_MANABURN); + ManaBurn_Timer = 8000 + rand()%8000; + } else ManaBurn_Timer -= diff; + + //Sleep_Timer + if (Sleep_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_SLEEP); + Sleep_Timer = 12000 + rand()%8000; + } else Sleep_Timer -= diff; + + //Illusions_Timer + if (Illusions_Timer <= diff) + { + //We will summon 3 illusions that will spawn on a random gamer and attack this gamer + //We will just use one model for the beginning + Unit *pTarget = NULL; + for (uint8 i = 0; i < 3; ++i) + { + pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); + if (!pTarget) + return; + + Creature *Illusion = me->SummonCreature(15163,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,30000); + if (Illusion) + Illusion->AI()->AttackStart(pTarget); + } + + Illusions_Timer = 15000 + rand()%10000; + } else Illusions_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_hazzarah(Creature* pCreature) +{ + return new boss_hazzarahAI (pCreature); +} + +void AddSC_boss_hazzarah() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_hazzarah"; + newscript->GetAI = &GetAI_boss_hazzarah; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp new file mode 100644 index 00000000000..fae05fcf384 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp @@ -0,0 +1,291 @@ +/* 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_Jeklik +SD%Complete: 85 +SDComment: Problem in finding the right flying batriders for spawning and making them fly. +SDCategory: Zul'Gurub +EndScriptData */ + +#include "ScriptedPch.h" +#include "zulgurub.h" + +#define SAY_AGGRO -1309002 +#define SAY_RAIN_FIRE -1309003 +#define SAY_DEATH -1309004 + +#define SPELL_CHARGE 22911 +#define SPELL_SONICBURST 23918 +#define SPELL_SCREECH 6605 +#define SPELL_SHADOW_WORD_PAIN 23952 +#define SPELL_MIND_FLAY 23953 +#define SPELL_CHAIN_MIND_FLAY 26044 //Right ID unknown. So disabled +#define SPELL_GREATERHEAL 23954 +#define SPELL_BAT_FORM 23966 + +// Batriders Spell + +#define SPELL_BOMB 40332 //Wrong ID but Magmadars bomb is not working... + +struct boss_jeklikAI : public ScriptedAI +{ + boss_jeklikAI(Creature *c) : ScriptedAI(c) + { + m_pInstance = c->GetInstanceData(); + } + + ScriptedInstance *m_pInstance; + + uint32 Charge_Timer; + uint32 SonicBurst_Timer; + uint32 Screech_Timer; + uint32 SpawnBats_Timer; + uint32 ShadowWordPain_Timer; + uint32 MindFlay_Timer; + uint32 ChainMindFlay_Timer; + uint32 GreaterHeal_Timer; + uint32 SpawnFlyingBats_Timer; + + bool PhaseTwo; + + void Reset() + { + Charge_Timer = 20000; + SonicBurst_Timer = 8000; + Screech_Timer = 13000; + SpawnBats_Timer = 60000; + ShadowWordPain_Timer = 6000; + MindFlay_Timer = 11000; + ChainMindFlay_Timer = 26000; + GreaterHeal_Timer = 50000; + SpawnFlyingBats_Timer = 10000; + + PhaseTwo = false; + } + + void EnterCombat(Unit * /*who*/) + { + DoScriptText(SAY_AGGRO, me); + DoCast(me, SPELL_BAT_FORM); + } + + void JustDied(Unit* /*Killer*/) + { + DoScriptText(SAY_DEATH, me); + + if (m_pInstance) + m_pInstance->SetData(TYPE_JEKLIK, DONE); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (me->getVictim() && me->isAlive()) + { + if ((me->GetHealth()*100 / me->GetMaxHealth() > 50)) + { + if (Charge_Timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + { + DoCast(pTarget, SPELL_CHARGE); + AttackStart(pTarget); + } + + Charge_Timer = 15000 + rand()%15000; + } else Charge_Timer -= diff; + + if (SonicBurst_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_SONICBURST); + SonicBurst_Timer = 8000 + rand()%5000; + } else SonicBurst_Timer -= diff; + + if (Screech_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_SCREECH); + Screech_Timer = 18000 + rand()%8000; + } else Screech_Timer -= diff; + + if (SpawnBats_Timer <= diff) + { + Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); + + Creature* Bat = NULL; + Bat = me->SummonCreature(11368,-12291.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (pTarget && Bat) Bat ->AI()->AttackStart(pTarget); + + Bat = me->SummonCreature(11368,-12289.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (pTarget && Bat) Bat ->AI()->AttackStart(pTarget); + + Bat = me->SummonCreature(11368,-12293.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (pTarget && Bat) Bat ->AI()->AttackStart(pTarget); + + Bat = me->SummonCreature(11368,-12291.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (pTarget && Bat) Bat ->AI()->AttackStart(pTarget); + + Bat = me->SummonCreature(11368,-12289.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (pTarget && Bat) Bat ->AI()->AttackStart(pTarget); + Bat = me->SummonCreature(11368,-12293.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (pTarget && Bat) Bat ->AI()->AttackStart(pTarget); + + SpawnBats_Timer = 60000; + } else SpawnBats_Timer -= diff; + } + else + { + if (PhaseTwo) + { + if (PhaseTwo && ShadowWordPain_Timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + { + DoCast(pTarget, SPELL_SHADOW_WORD_PAIN); + ShadowWordPain_Timer = 12000 + rand()%6000; + } + }ShadowWordPain_Timer -=diff; + + if (MindFlay_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_MIND_FLAY); + MindFlay_Timer = 16000; + }MindFlay_Timer -=diff; + + if (ChainMindFlay_Timer <= diff) + { + me->InterruptNonMeleeSpells(false); + DoCast(me->getVictim(), SPELL_CHAIN_MIND_FLAY); + ChainMindFlay_Timer = 15000 + rand()%15000; + }ChainMindFlay_Timer -=diff; + + if (GreaterHeal_Timer <= diff) + { + me->InterruptNonMeleeSpells(false); + DoCast(me, SPELL_GREATERHEAL); + GreaterHeal_Timer = 25000 + rand()%10000; + }GreaterHeal_Timer -=diff; + + if (SpawnFlyingBats_Timer <= diff) + { + Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (!pTarget) + return; + + Creature* FlyingBat = me->SummonCreature(14965, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ()+15, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (FlyingBat) + FlyingBat->AI()->AttackStart(pTarget); + + SpawnFlyingBats_Timer = 10000 + rand()%5000; + } else SpawnFlyingBats_Timer -=diff; + } + else + { + me->SetDisplayId(15219); + DoResetThreat(); + PhaseTwo = true; + } + } + + DoMeleeAttackIfReady(); + } + } +}; + +//Flying Bat +struct mob_batriderAI : public ScriptedAI +{ + mob_batriderAI(Creature *c) : ScriptedAI(c) + { + m_pInstance = c->GetInstanceData(); + } + + ScriptedInstance *m_pInstance; + + uint32 Bomb_Timer; + uint32 Check_Timer; + + void Reset() + { + Bomb_Timer = 2000; + Check_Timer = 1000; + + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + } + + void EnterCombat(Unit * /*who*/) {} + + void UpdateAI (const uint32 diff) + { + if (!UpdateVictim()) + return; + + //Bomb_Timer + if (Bomb_Timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + DoCast(pTarget, SPELL_BOMB); + Bomb_Timer = 5000; + } + } else Bomb_Timer -= diff; + + //Check_Timer + if (Check_Timer <= diff) + { + if (m_pInstance) + { + if (m_pInstance->GetData(TYPE_JEKLIK) == DONE) + { + me->setDeathState(JUST_DIED); + me->RemoveCorpse(); + return; + } + } + + Check_Timer = 1000; + } else Check_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_jeklik(Creature* pCreature) +{ + return new boss_jeklikAI (pCreature); +} + +CreatureAI* GetAI_mob_batrider(Creature* pCreature) +{ + return new mob_batriderAI (pCreature); +} + +void AddSC_boss_jeklik() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_jeklik"; + newscript->GetAI = &GetAI_boss_jeklik; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_batrider"; + newscript->GetAI = &GetAI_mob_batrider; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp new file mode 100644 index 00000000000..58f91f85a95 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp @@ -0,0 +1,263 @@ +/* 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_Jin'do the Hexxer +SD%Complete: 85 +SDComment: Mind Control not working because of core bug. Shades visible for all. +SDCategory: Zul'Gurub +EndScriptData */ + +#include "ScriptedPch.h" +#include "zulgurub.h" + +#define SAY_AGGRO -1309014 + +#define SPELL_BRAINWASHTOTEM 24262 +#define SPELL_POWERFULLHEALINGWARD 24309 //We will not use this spell. We will summon a totem by script cause the spell totems will not cast. +#define SPELL_HEX 24053 +#define SPELL_DELUSIONSOFJINDO 24306 +#define SPELL_SHADEOFJINDO 24308 //We will not use this spell. We will summon a shade by script. + +//Healing Ward Spell +#define SPELL_HEAL 38588 //Totems are not working right. Right heal spell ID is 24311 but this spell is not casting... + +//Shade of Jindo Spell +#define SPELL_SHADOWSHOCK 19460 +#define SPELL_INVISIBLE 24699 + +struct boss_jindoAI : public ScriptedAI +{ + boss_jindoAI(Creature *c) : ScriptedAI(c) {} + + uint32 BrainWashTotem_Timer; + uint32 HealingWard_Timer; + uint32 Hex_Timer; + uint32 Delusions_Timer; + uint32 Teleport_Timer; + + void Reset() + { + BrainWashTotem_Timer = 20000; + HealingWard_Timer = 16000; + Hex_Timer = 8000; + Delusions_Timer = 10000; + Teleport_Timer = 5000; + } + + void EnterCombat(Unit * /*who*/) + { + DoScriptText(SAY_AGGRO, me); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //BrainWashTotem_Timer + if (BrainWashTotem_Timer <= diff) + { + DoCast(me, SPELL_BRAINWASHTOTEM); + BrainWashTotem_Timer = 18000 + rand()%8000; + } else BrainWashTotem_Timer -= diff; + + //HealingWard_Timer + if (HealingWard_Timer <= diff) + { + //DoCast(me, SPELL_POWERFULLHEALINGWARD); + me->SummonCreature(14987, me->GetPositionX()+3, me->GetPositionY()-2, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,30000); + HealingWard_Timer = 14000 + rand()%6000; + } else HealingWard_Timer -= diff; + + //Hex_Timer + if (Hex_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_HEX); + + if (DoGetThreat(me->getVictim())) + DoModifyThreatPercent(me->getVictim(),-80); + + Hex_Timer = 12000 + rand()%8000; + } else Hex_Timer -= diff; + + //Casting the delusion curse with a shade. So shade will attack the same target with the curse. + if (Delusions_Timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + { + DoCast(pTarget, SPELL_DELUSIONSOFJINDO); + + Creature *Shade = me->SummonCreature(14986, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Shade) + Shade->AI()->AttackStart(pTarget); + } + + Delusions_Timer = 4000 + rand()%8000; + } else Delusions_Timer -= diff; + + //Teleporting a random gamer and spawning 9 skeletons that will attack this gamer + if (Teleport_Timer <= diff) + { + Unit *pTarget = NULL; + pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); + if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER) + { + DoTeleportPlayer(pTarget, -11583.7783,-1249.4278,77.5471,4.745); + + if (DoGetThreat(me->getVictim())) + DoModifyThreatPercent(pTarget,-100); + + Creature *Skeletons; + Skeletons = me->SummonCreature(14826, pTarget->GetPositionX()+2, pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Skeletons) + Skeletons->AI()->AttackStart(pTarget); + Skeletons = me->SummonCreature(14826, pTarget->GetPositionX()-2, pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Skeletons) + Skeletons->AI()->AttackStart(pTarget); + Skeletons = me->SummonCreature(14826, pTarget->GetPositionX()+4, pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Skeletons) + Skeletons->AI()->AttackStart(pTarget); + Skeletons = me->SummonCreature(14826, pTarget->GetPositionX()-4, pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Skeletons) + Skeletons->AI()->AttackStart(pTarget); + Skeletons = me->SummonCreature(14826, pTarget->GetPositionX(), pTarget->GetPositionY()+2, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Skeletons) + Skeletons->AI()->AttackStart(pTarget); + Skeletons = me->SummonCreature(14826, pTarget->GetPositionX(), pTarget->GetPositionY()-2, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Skeletons) + Skeletons->AI()->AttackStart(pTarget); + Skeletons = me->SummonCreature(14826, pTarget->GetPositionX(), pTarget->GetPositionY()+4, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Skeletons) + Skeletons->AI()->AttackStart(pTarget); + Skeletons = me->SummonCreature(14826, pTarget->GetPositionX(), pTarget->GetPositionY()-4, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Skeletons) + Skeletons->AI()->AttackStart(pTarget); + Skeletons = me->SummonCreature(14826, pTarget->GetPositionX()+3, pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Skeletons) + Skeletons->AI()->AttackStart(pTarget); + } + + Teleport_Timer = 15000 + rand()%8000; + } else Teleport_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +//Healing Ward +struct mob_healing_wardAI : public ScriptedAI +{ + mob_healing_wardAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + uint32 Heal_Timer; + + ScriptedInstance *pInstance; + + void Reset() + { + Heal_Timer = 2000; + } + + void EnterCombat(Unit * /*who*/) + { + } + + void UpdateAI (const uint32 diff) + { + //Heal_Timer + if (Heal_Timer <= diff) + { + if (pInstance) + { + Unit *pJindo = Unit::GetUnit((*me), pInstance->GetData64(DATA_JINDO)); + if (pJindo) + DoCast(pJindo, SPELL_HEAL); + } + Heal_Timer = 3000; + } else Heal_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +//Shade of Jindo +struct mob_shade_of_jindoAI : public ScriptedAI +{ + mob_shade_of_jindoAI(Creature *c) : ScriptedAI(c) {} + + uint32 ShadowShock_Timer; + + void Reset() + { + ShadowShock_Timer = 1000; + DoCast(me, SPELL_INVISIBLE, true); + } + + void EnterCombat(Unit * /*who*/){} + + void UpdateAI (const uint32 diff) + { + + //ShadowShock_Timer + if (ShadowShock_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_SHADOWSHOCK); + ShadowShock_Timer = 2000; + } else ShadowShock_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_jindo(Creature* pCreature) +{ + return new boss_jindoAI (pCreature); +} + +CreatureAI* GetAI_mob_healing_ward(Creature* pCreature) +{ + return new mob_healing_wardAI (pCreature); +} + +CreatureAI* GetAI_mob_shade_of_jindo(Creature* pCreature) +{ + return new mob_shade_of_jindoAI (pCreature); +} + +void AddSC_boss_jindo() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_jindo"; + newscript->GetAI = &GetAI_boss_jindo; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_healing_ward"; + newscript->GetAI = &GetAI_mob_healing_ward; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_shade_of_jindo"; + newscript->GetAI = &GetAI_mob_shade_of_jindo; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp new file mode 100644 index 00000000000..4609605f3c1 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp @@ -0,0 +1,333 @@ +/* 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_Mandokir +SD%Complete: 90 +SDComment: Ohgan function needs improvements. +SDCategory: Zul'Gurub +EndScriptData */ + +#include "ScriptedPch.h" +#include "zulgurub.h" + +#define SAY_AGGRO -1309015 +#define SAY_DING_KILL -1309016 +#define SAY_GRATS_JINDO -1309017 +#define SAY_WATCH -1309018 +#define SAY_WATCH_WHISPER -1309019 //is this text for real? easter egg? + +#define SPELL_CHARGE 24315 +#define SPELL_CLEAVE 20691 +#define SPELL_FEAR 29321 +#define SPELL_WHIRLWIND 24236 +#define SPELL_MORTAL_STRIKE 24573 +#define SPELL_ENRAGE 23537 +#define SPELL_WATCH 24314 +#define SPELL_LEVEL_UP 24312 + +//Ohgans Spells +#define SPELL_SUNDERARMOR 24317 + +struct boss_mandokirAI : public ScriptedAI +{ + boss_mandokirAI(Creature *c) : ScriptedAI(c) + { + m_pInstance = c->GetInstanceData(); + } + + uint32 KillCount; + uint32 Watch_Timer; + uint32 TargetInRange; + uint32 Cleave_Timer; + uint32 Whirlwind_Timer; + uint32 Fear_Timer; + uint32 MortalStrike_Timer; + uint32 Check_Timer; + float targetX; + float targetY; + float targetZ; + + ScriptedInstance *m_pInstance; + + bool endWatch; + bool someWatched; + bool RaptorDead; + bool CombatStart; + + uint64 WatchTarget; + + void Reset() + { + KillCount = 0; + Watch_Timer = 33000; + Cleave_Timer = 7000; + Whirlwind_Timer = 20000; + Fear_Timer = 1000; + MortalStrike_Timer = 1000; + Check_Timer = 1000; + + targetX = 0.0; + targetY = 0.0; + targetZ = 0.0; + TargetInRange = 0; + + WatchTarget = 0; + + someWatched = false; + endWatch = false; + RaptorDead = false; + CombatStart = false; + + DoCast(me, 23243); + } + + void KilledUnit(Unit* victim) + { + if (victim->GetTypeId() == TYPEID_PLAYER) + { + ++KillCount; + + if (KillCount == 3) + { + DoScriptText(SAY_DING_KILL, me); + + if (m_pInstance) + { + uint64 JindoGUID = m_pInstance->GetData64(DATA_JINDO); + if (JindoGUID) + { + if (Unit* jTemp = Unit::GetUnit(*me,JindoGUID)) + { + if (jTemp->isAlive()) + DoScriptText(SAY_GRATS_JINDO, jTemp); + } + } + } + DoCast(me, SPELL_LEVEL_UP, true); + KillCount = 0; + } + } + } + + void EnterCombat(Unit * /*who*/) + { + DoScriptText(SAY_AGGRO, me); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (me->getVictim() && me->isAlive()) + { + if (!CombatStart) + { + //At combat Start Mandokir is mounted so we must unmount it first + me->Unmount(); + + //And summon his raptor + me->SummonCreature(14988, me->getVictim()->GetPositionX(), me->getVictim()->GetPositionY(), me->getVictim()->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 35000); + CombatStart = true; + } + + if (Watch_Timer <= diff) //Every 20 Sec Mandokir will check this + { + if (WatchTarget) //If someone is watched and If the Position of the watched target is different from the one stored, or are attacking, mandokir will charge him + { + Unit* pUnit = Unit::GetUnit(*me, WatchTarget); + + if (pUnit && ( + targetX != pUnit->GetPositionX() || + targetY != pUnit->GetPositionY() || + targetZ != pUnit->GetPositionZ() || + pUnit->isInCombat())) + { + if (me->IsWithinMeleeRange(pUnit)) + { + DoCast(pUnit, 24316); + } + else + { + DoCast(pUnit, SPELL_CHARGE); + //me->SendMonsterMove(pUnit->GetPositionX(), pUnit->GetPositionY(), pUnit->GetPositionZ(), 0, true,1); + AttackStart(pUnit); + } + } + } + someWatched = false; + Watch_Timer = 20000; + } else Watch_Timer -= diff; + + if ((Watch_Timer < 8000) && !someWatched) //8 sec(cast time + expire time) before the check for the watch effect mandokir will cast watch debuff on a random target + { + if (Unit* p = SelectUnit(SELECT_TARGET_RANDOM,0)) + { + DoScriptText(SAY_WATCH, me, p); + DoCast(p, SPELL_WATCH); + WatchTarget = p->GetGUID(); + someWatched = true; + endWatch = true; + } + } + + if ((Watch_Timer < 1000) && endWatch) //1 sec before the debuf expire, store the target position + { + Unit* pUnit = Unit::GetUnit(*me, WatchTarget); + if (pUnit) + { + targetX = pUnit->GetPositionX(); + targetY = pUnit->GetPositionY(); + targetZ = pUnit->GetPositionZ(); + } + endWatch = false; + } + + if (!someWatched) + { + //Cleave + if (Cleave_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_CLEAVE); + Cleave_Timer = 7000; + } else Cleave_Timer -= diff; + + //Whirlwind + if (Whirlwind_Timer <= diff) + { + DoCast(me, SPELL_WHIRLWIND); + Whirlwind_Timer = 18000; + } else Whirlwind_Timer -= diff; + + //If more then 3 targets in melee range mandokir will cast fear + if (Fear_Timer <= diff) + { + TargetInRange = 0; + + std::list::const_iterator i = me->getThreatManager().getThreatList().begin(); + for (; i != me->getThreatManager().getThreatList().end(); ++i) + { + Unit* pUnit = Unit::GetUnit(*me, (*i)->getUnitGuid()); + if (pUnit && me->IsWithinMeleeRange(pUnit)) + ++TargetInRange; + } + + if (TargetInRange > 3) + DoCast(me->getVictim(), SPELL_FEAR); + + Fear_Timer = 4000; + } else Fear_Timer -=diff; + + //Mortal Strike if target below 50% hp + if (me->getVictim() && me->getVictim()->GetHealth() < me->getVictim()->GetMaxHealth()*0.5) + { + if (MortalStrike_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_MORTAL_STRIKE); + MortalStrike_Timer = 15000; + } else MortalStrike_Timer -= diff; + } + } + //Checking if Ohgan is dead. If yes Mandokir will enrage. + if (Check_Timer <= diff) + { + if (m_pInstance) + { + if (m_pInstance->GetData(TYPE_OHGAN) == DONE) + { + if (!RaptorDead) + { + DoCast(me, SPELL_ENRAGE); + RaptorDead = true; + } + } + } + + Check_Timer = 1000; + } else Check_Timer -= diff; + + DoMeleeAttackIfReady(); + } + } +}; + +//Ohgan +struct mob_ohganAI : public ScriptedAI +{ + mob_ohganAI(Creature *c) : ScriptedAI(c) + { + m_pInstance = c->GetInstanceData(); + } + + uint32 SunderArmor_Timer; + ScriptedInstance *m_pInstance; + + void Reset() + { + SunderArmor_Timer = 5000; + } + + void EnterCombat(Unit * /*who*/) {} + + void JustDied(Unit* /*Killer*/) + { + if (m_pInstance) + m_pInstance->SetData(TYPE_OHGAN, DONE); + } + + void UpdateAI (const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //SunderArmor_Timer + if (SunderArmor_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_SUNDERARMOR); + SunderArmor_Timer = 10000 + rand()%5000; + } else SunderArmor_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_mandokir(Creature* pCreature) +{ + return new boss_mandokirAI (pCreature); +} + +CreatureAI* GetAI_mob_ohgan(Creature* pCreature) +{ + return new mob_ohganAI (pCreature); +} + +void AddSC_boss_mandokir() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_mandokir"; + newscript->GetAI = &GetAI_boss_mandokir; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_ohgan"; + newscript->GetAI = &GetAI_mob_ohgan; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp new file mode 100644 index 00000000000..77e9f9b929f --- /dev/null +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp @@ -0,0 +1,261 @@ +/* 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_Marli +SD%Complete: 80 +SDComment: Charging healers and casters not working. Perhaps wrong Spell Timers. +SDCategory: Zul'Gurub +EndScriptData */ + +#include "ScriptedPch.h" +#include "zulgurub.h" + +#define SAY_AGGRO -1309005 +#define SAY_TRANSFORM -1309006 +#define SAY_SPIDER_SPAWN -1309007 +#define SAY_DEATH -1309008 + +#define SPELL_CHARGE 22911 +#define SPELL_ASPECT_OF_MARLI 24686 // A stun spell +#define SPELL_ENVOLWINGWEB 24110 +#define SPELL_POISONVOLLEY 24099 +#define SPELL_SPIDER_FORM 24084 + +//The Spider Spells +#define SPELL_LEVELUP 24312 //Not right Spell. + +struct boss_marliAI : public ScriptedAI +{ + boss_marliAI(Creature *c) : ScriptedAI(c) + { + m_pInstance = c->GetInstanceData(); + } + + ScriptedInstance *m_pInstance; + + uint32 SpawnStartSpiders_Timer; + uint32 PoisonVolley_Timer; + uint32 SpawnSpider_Timer; + uint32 Charge_Timer; + uint32 Aspect_Timer; + uint32 Transform_Timer; + uint32 TransformBack_Timer; + + bool Spawned; + bool PhaseTwo; + + void Reset() + { + SpawnStartSpiders_Timer = 1000; + PoisonVolley_Timer = 15000; + SpawnSpider_Timer = 30000; + Charge_Timer = 1500; + Aspect_Timer = 12000; + Transform_Timer = 45000; + TransformBack_Timer = 25000; + + Spawned = false; + PhaseTwo = false; + } + + void EnterCombat(Unit * /*who*/) + { + DoScriptText(SAY_AGGRO, me); + } + + void JustDied(Unit* /*Killer*/) + { + DoScriptText(SAY_DEATH, me); + if (m_pInstance) + m_pInstance->SetData(TYPE_MARLI, DONE); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (me->getVictim() && me->isAlive()) + { + if (PoisonVolley_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_POISONVOLLEY); + PoisonVolley_Timer = 10000 + rand()%10000; + } else PoisonVolley_Timer -= diff; + + if (!PhaseTwo && Aspect_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_ASPECT_OF_MARLI); + Aspect_Timer = 13000 + rand()%5000; + } else Aspect_Timer -= diff; + + if (!Spawned && SpawnStartSpiders_Timer <= diff) + { + DoScriptText(SAY_SPIDER_SPAWN, me); + + Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); + if (!pTarget) + return; + + Creature *Spider = NULL; + + Spider = me->SummonCreature(15041,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Spider) + Spider->AI()->AttackStart(pTarget); + Spider = me->SummonCreature(15041,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Spider) + Spider->AI()->AttackStart(pTarget); + Spider = me->SummonCreature(15041,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Spider) + Spider->AI()->AttackStart(pTarget); + Spider = me->SummonCreature(15041,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Spider) + Spider->AI()->AttackStart(pTarget); + + Spawned = true; + } else SpawnStartSpiders_Timer -= diff; + + if (SpawnSpider_Timer <= diff) + { + Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); + if (!pTarget) + return; + + Creature *Spider = me->SummonCreature(15041,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Spider) + Spider->AI()->AttackStart(pTarget); + SpawnSpider_Timer = 12000 + rand()%5000; + } else SpawnSpider_Timer -= diff; + + if (!PhaseTwo && Transform_Timer <= diff) + { + DoScriptText(SAY_TRANSFORM, me); + DoCast(me, SPELL_SPIDER_FORM); + const CreatureInfo *cinfo = me->GetCreatureInfo(); + me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 35))); + me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 35))); + me->UpdateDamagePhysical(BASE_ATTACK); + DoCast(me->getVictim(), SPELL_ENVOLWINGWEB); + + if (DoGetThreat(me->getVictim())) + DoModifyThreatPercent(me->getVictim(),-100); + + PhaseTwo = true; + Transform_Timer = urand(35000,60000); + } else Transform_Timer -= diff; + + if (PhaseTwo) + { + if (Charge_Timer <= diff) + { + Unit *pTarget = NULL; + int i = 0; + while (i < 3) // max 3 tries to get a random target with power_mana + { + ++i; + pTarget = SelectTarget(SELECT_TARGET_RANDOM,1, 100, true); // not aggro leader + if (pTarget && pTarget->getPowerType() == POWER_MANA) + i = 3; + } + if (pTarget) + { + DoCast(pTarget, SPELL_CHARGE); + //me->GetMap()->CreatureRelocation(me, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0); + //me->SendMonsterMove(pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, true,1); + AttackStart(pTarget); + } + + Charge_Timer = 8000; + } else Charge_Timer -= diff; + + if (TransformBack_Timer <= diff) + { + me->SetDisplayId(15220); + const CreatureInfo *cinfo = me->GetCreatureInfo(); + me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 1))); + me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 1))); + me->UpdateDamagePhysical(BASE_ATTACK); + + PhaseTwo = false; + TransformBack_Timer = urand(25000,40000); + } else TransformBack_Timer -= diff; + + } + + DoMeleeAttackIfReady(); + } + } +}; + +//Spawn of Marli +struct mob_spawn_of_marliAI : public ScriptedAI +{ + mob_spawn_of_marliAI(Creature *c) : ScriptedAI(c) {} + + uint32 LevelUp_Timer; + + void Reset() + { + LevelUp_Timer = 3000; + } + + void EnterCombat(Unit * /*who*/) + { + } + + void UpdateAI (const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //LevelUp_Timer + if (LevelUp_Timer <= diff) + { + DoCast(me, SPELL_LEVELUP); + LevelUp_Timer = 3000; + } else LevelUp_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_marli(Creature* pCreature) +{ + return new boss_marliAI (pCreature); +} + +CreatureAI* GetAI_mob_spawn_of_marli(Creature* pCreature) +{ + return new mob_spawn_of_marliAI (pCreature); +} + +void AddSC_boss_marli() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_marli"; + newscript->GetAI = &GetAI_boss_marli; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_spawn_of_marli"; + newscript->GetAI = &GetAI_mob_spawn_of_marli; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp new file mode 100644 index 00000000000..f7b01b26e19 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.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_Renataki +SD%Complete: 100 +SDComment: +SDCategory: Zul'Gurub +EndScriptData */ + +#include "ScriptedPch.h" +#include "zulgurub.h" + +#define SPELL_AMBUSH 24337 +#define SPELL_THOUSANDBLADES 24649 + +#define EQUIP_ID_MAIN_HAND 0 //was item display id 31818, but this id does not exist + +struct boss_renatakiAI : public ScriptedAI +{ + boss_renatakiAI(Creature *c) : ScriptedAI(c) {} + + uint32 Invisible_Timer; + uint32 Ambush_Timer; + uint32 Visible_Timer; + uint32 Aggro_Timer; + uint32 ThousandBlades_Timer; + + bool Invisible; + bool Ambushed; + + void Reset() + { + Invisible_Timer = 8000 + rand()%10000; + Ambush_Timer = 3000; + Visible_Timer = 4000; + Aggro_Timer = 15000 + rand()%10000; + ThousandBlades_Timer = 4000 + rand()%4000; + + Invisible = false; + Ambushed = false; + } + + void EnterCombat(Unit * /*who*/) + { + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //Invisible_Timer + if (Invisible_Timer <= diff) + { + me->InterruptSpell(CURRENT_GENERIC_SPELL); + + SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE); + me->SetDisplayId(11686); + + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + Invisible = true; + + Invisible_Timer = 15000 + rand()%15000; + } else Invisible_Timer -= diff; + + if (Invisible) + { + if (Ambush_Timer <= diff) + { + Unit *pTarget = NULL; + pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); + if (pTarget) + { + DoTeleportTo(pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ()); + DoCast(pTarget, SPELL_AMBUSH); + } + + Ambushed = true; + Ambush_Timer = 3000; + } else Ambush_Timer -= diff; + } + + if (Ambushed) + { + if (Visible_Timer <= diff) + { + me->InterruptSpell(CURRENT_GENERIC_SPELL); + + me->SetDisplayId(15268); + SetEquipmentSlots(false, EQUIP_ID_MAIN_HAND, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE); + + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + Invisible = false; + + Visible_Timer = 4000; + } else Visible_Timer -= diff; + } + + //Resetting some aggro so he attacks other gamers + if (!Invisible) + if (Aggro_Timer <= diff) + { + Unit *pTarget = NULL; + pTarget = SelectUnit(SELECT_TARGET_RANDOM,1); + + if (DoGetThreat(me->getVictim())) + DoModifyThreatPercent(me->getVictim(),-50); + + if (pTarget) + AttackStart(pTarget); + + Aggro_Timer = 7000 + rand()%13000; + } else Aggro_Timer -= diff; + + if (!Invisible) + if (ThousandBlades_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_THOUSANDBLADES); + ThousandBlades_Timer = 7000 + rand()%5000; + } else ThousandBlades_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_renataki(Creature* pCreature) +{ + return new boss_renatakiAI (pCreature); +} + +void AddSC_boss_renataki() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_renataki"; + newscript->GetAI = &GetAI_boss_renataki; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp new file mode 100644 index 00000000000..179700d36e7 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp @@ -0,0 +1,556 @@ +/* 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_Thekal +SD%Complete: 95 +SDComment: Almost finished. +SDCategory: Zul'Gurub +EndScriptData */ + +#include "ScriptedPch.h" +#include "zulgurub.h" + +#define SAY_AGGRO -1309009 +#define SAY_DEATH -1309010 + +#define SPELL_MORTALCLEAVE 22859 +#define SPELL_SILENCE 23207 +#define SPELL_FRENZY 23342 +#define SPELL_FORCEPUNCH 24189 +#define SPELL_CHARGE 24408 +#define SPELL_ENRAGE 23537 +#define SPELL_SUMMONTIGERS 24183 +#define SPELL_TIGER_FORM 24169 +#define SPELL_RESURRECT 24173 //We will not use this spell. + +//Zealot Lor'Khan Spells +#define SPELL_SHIELD 25020 +#define SPELL_BLOODLUST 24185 +#define SPELL_GREATERHEAL 24208 +#define SPELL_DISARM 22691 + +//Zealot Lor'Khan Spells +#define SPELL_SWEEPINGSTRIKES 18765 +#define SPELL_SINISTERSTRIKE 15667 +#define SPELL_GOUGE 24698 +#define SPELL_KICK 15614 +#define SPELL_BLIND 21060 + +struct boss_thekalAI : public ScriptedAI +{ + boss_thekalAI(Creature *c) : ScriptedAI(c) + { + m_pInstance = c->GetInstanceData(); + } + + uint32 MortalCleave_Timer; + uint32 Silence_Timer; + uint32 Frenzy_Timer; + uint32 ForcePunch_Timer; + uint32 Charge_Timer; + uint32 Enrage_Timer; + uint32 SummonTigers_Timer; + uint32 Check_Timer; + uint32 Resurrect_Timer; + + ScriptedInstance *m_pInstance; + bool Enraged; + bool PhaseTwo; + bool WasDead; + + void Reset() + { + MortalCleave_Timer = 4000; + Silence_Timer = 9000; + Frenzy_Timer = 30000; + ForcePunch_Timer = 4000; + Charge_Timer = 12000; + Enrage_Timer = 32000; + SummonTigers_Timer = 25000; + Check_Timer = 10000; + Resurrect_Timer = 10000; + + Enraged = false; + PhaseTwo = false; + WasDead = false; + } + + void EnterCombat(Unit * /*who*/) + { + DoScriptText(SAY_AGGRO, me); + } + + void JustDied(Unit* /*Killer*/) + { + DoScriptText(SAY_DEATH, me); + if (m_pInstance) + m_pInstance->SetData(TYPE_THEKAL, DONE); + } + + void JustReachedHome() + { + if (m_pInstance) + m_pInstance->SetData(TYPE_THEKAL, NOT_STARTED); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //Check_Timer for the death of LorKhan and Zath. + if (!WasDead && Check_Timer <= diff) + { + if (m_pInstance) + { + if (m_pInstance->GetData(TYPE_LORKHAN) == SPECIAL) + { + //Resurrect LorKhan + if (Unit *pLorKhan = Unit::GetUnit((*me), m_pInstance->GetData64(DATA_LORKHAN))) + { + pLorKhan->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); + pLorKhan->setFaction(14); + pLorKhan->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + pLorKhan->SetHealth(int(pLorKhan->GetMaxHealth()*1.0)); + + m_pInstance->SetData(TYPE_LORKHAN, DONE); + } + } + + if (m_pInstance->GetData(TYPE_ZATH) == SPECIAL) + { + //Resurrect Zath + Unit *pZath = Unit::GetUnit((*me), m_pInstance->GetData64(DATA_ZATH)); + if (pZath) + { + pZath->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); + pZath->setFaction(14); + pZath->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + pZath->SetHealth(int(pZath->GetMaxHealth()*1.0)); + + m_pInstance->SetData(TYPE_ZATH, DONE); + } + } + } + + Check_Timer = 5000; + } else Check_Timer -= diff; + + if (!PhaseTwo && MortalCleave_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_MORTALCLEAVE); + MortalCleave_Timer = 15000 + rand()%5000; + } else MortalCleave_Timer -= diff; + + if (!PhaseTwo && Silence_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_SILENCE); + Silence_Timer = 20000 + rand()%5000; + } else Silence_Timer -= diff; + + if (!PhaseTwo && !WasDead && me->GetHealth() <= me->GetMaxHealth() * 0.05) + { + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetStandState(UNIT_STAND_STATE_SLEEP); + me->AttackStop(); + + if (m_pInstance) + m_pInstance->SetData(TYPE_THEKAL, SPECIAL); + + WasDead=true; + } + + //Thekal will transform to Tiger if he died and was not resurrected after 10 seconds. + if (!PhaseTwo && WasDead) + { + if (Resurrect_Timer <= diff) + { + DoCast(me, SPELL_TIGER_FORM); + me->SetFloatValue(OBJECT_FIELD_SCALE_X, 2.00f); + me->SetStandState(UNIT_STAND_STATE_STAND); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetHealth(int(me->GetMaxHealth()*1.0)); + const CreatureInfo *cinfo = me->GetCreatureInfo(); + me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 40))); + me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 40))); + me->UpdateDamagePhysical(BASE_ATTACK); + DoResetThreat(); + PhaseTwo = true; + } else Resurrect_Timer -= diff; + } + + if ((me->GetHealth()*100 / me->GetMaxHealth() == 100) && WasDead) + { + WasDead = false; + } + + if (PhaseTwo) + { + if (Charge_Timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + { + DoCast(pTarget, SPELL_CHARGE); + DoResetThreat(); + AttackStart(pTarget); + } + + Charge_Timer = 15000 + rand()%7000; + } else Charge_Timer -= diff; + + if (Frenzy_Timer <= diff) + { + DoCast(me, SPELL_FRENZY); + Frenzy_Timer = 30000; + } else Frenzy_Timer -= diff; + + if (ForcePunch_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_SILENCE); + ForcePunch_Timer = 16000 + rand()%5000; + } else ForcePunch_Timer -= diff; + + if (SummonTigers_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_SUMMONTIGERS); + SummonTigers_Timer = 10000 + rand()%4000; + } else SummonTigers_Timer -= diff; + + if ((me->GetHealth()*100 / me->GetMaxHealth() < 11) && !Enraged) + { + DoCast(me, SPELL_ENRAGE); + Enraged = true; + } + } + + DoMeleeAttackIfReady(); + + } +}; + +//Zealot Lor'Khan +struct mob_zealot_lorkhanAI : public ScriptedAI +{ + mob_zealot_lorkhanAI(Creature *c) : ScriptedAI(c) + { + m_pInstance = c->GetInstanceData(); + } + + uint32 Shield_Timer; + uint32 BloodLust_Timer; + uint32 GreaterHeal_Timer; + uint32 Disarm_Timer; + uint32 Check_Timer; + + bool FakeDeath; + + ScriptedInstance *m_pInstance; + + void Reset() + { + Shield_Timer = 1000; + BloodLust_Timer = 16000; + GreaterHeal_Timer = 32000; + Disarm_Timer = 6000; + Check_Timer = 10000; + + FakeDeath = false; + + if (m_pInstance) + m_pInstance->SetData(TYPE_LORKHAN, NOT_STARTED); + + me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + } + + void EnterCombat(Unit * /*who*/) + { + } + + void UpdateAI (const uint32 diff) + { + if (!UpdateVictim()) + return; + + //Shield_Timer + if (Shield_Timer <= diff) + { + DoCast(me, SPELL_SHIELD); + Shield_Timer = 61000; + } else Shield_Timer -= diff; + + //BloodLust_Timer + if (BloodLust_Timer <= diff) + { + DoCast(me, SPELL_BLOODLUST); + BloodLust_Timer = 20000+rand()%8000; + } else BloodLust_Timer -= diff; + + //Casting Greaterheal to Thekal or Zath if they are in meele range. + if (GreaterHeal_Timer <= diff) + { + if (m_pInstance) + { + Unit *pThekal = Unit::GetUnit((*me), m_pInstance->GetData64(DATA_THEKAL)); + Unit *pZath = Unit::GetUnit((*me), m_pInstance->GetData64(DATA_ZATH)); + + if (!pThekal || !pZath) + return; + + switch (urand(0,1)) + { + case 0: + if (me->IsWithinMeleeRange(pThekal)) + DoCast(pThekal, SPELL_GREATERHEAL); + break; + case 1: + if (me->IsWithinMeleeRange(pZath)) + DoCast(pZath, SPELL_GREATERHEAL); + break; + } + } + + GreaterHeal_Timer = 15000+rand()%5000; + } else GreaterHeal_Timer -= diff; + + //Disarm_Timer + if (Disarm_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_DISARM); + Disarm_Timer = 15000+rand()%10000; + } else Disarm_Timer -= diff; + + //Check_Timer for the death of LorKhan and Zath. + if (!FakeDeath && Check_Timer <= diff) + { + if (m_pInstance) + { + if (m_pInstance->GetData(TYPE_THEKAL) == SPECIAL) + { + //Resurrect Thekal + if (Unit *pThekal = Unit::GetUnit((*me), m_pInstance->GetData64(DATA_THEKAL))) + { + pThekal->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); + pThekal->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + pThekal->setFaction(14); + pThekal->SetHealth(int(pThekal->GetMaxHealth()*1.0)); + } + } + + if (m_pInstance->GetData(TYPE_ZATH) == SPECIAL) + { + //Resurrect Zath + if (Unit *pZath = Unit::GetUnit((*me), m_pInstance->GetData64(DATA_ZATH))) + { + pZath->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); + pZath->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + pZath->setFaction(14); + pZath->SetHealth(int(pZath->GetMaxHealth()*1.0)); + } + } + } + + Check_Timer = 5000; + } else Check_Timer -= diff; + + if (me->GetHealth() <= me->GetMaxHealth() * 0.05) + { + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetStandState(UNIT_STAND_STATE_SLEEP); + me->setFaction(35); + me->AttackStop(); + + if (m_pInstance) + m_pInstance->SetData(TYPE_LORKHAN, SPECIAL); + + FakeDeath = true; + } + + DoMeleeAttackIfReady(); + } +}; + +//Zealot Zath +struct mob_zealot_zathAI : public ScriptedAI +{ + mob_zealot_zathAI(Creature *c) : ScriptedAI(c) + { + m_pInstance = c->GetInstanceData(); + } + + uint32 SweepingStrikes_Timer; + uint32 SinisterStrike_Timer; + uint32 Gouge_Timer; + uint32 Kick_Timer; + uint32 Blind_Timer; + uint32 Check_Timer; + + bool FakeDeath; + + ScriptedInstance *m_pInstance; + + void Reset() + { + SweepingStrikes_Timer = 13000; + SinisterStrike_Timer = 8000; + Gouge_Timer = 25000; + Kick_Timer = 18000; + Blind_Timer = 5000; + Check_Timer = 10000; + + FakeDeath = false; + + if (m_pInstance) + m_pInstance->SetData(TYPE_ZATH, NOT_STARTED); + + me->SetStandState(UNIT_STAND_STATE_STAND); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + } + + void EnterCombat(Unit * /*who*/) + { + } + + void UpdateAI (const uint32 diff) + { + if (!UpdateVictim()) + return; + + //SweepingStrikes_Timer + if (SweepingStrikes_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_SWEEPINGSTRIKES); + SweepingStrikes_Timer = 22000+rand()%4000; + } else SweepingStrikes_Timer -= diff; + + //SinisterStrike_Timer + if (SinisterStrike_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_SINISTERSTRIKE); + SinisterStrike_Timer = 8000+rand()%8000; + } else SinisterStrike_Timer -= diff; + + //Gouge_Timer + if (Gouge_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_GOUGE); + + if (DoGetThreat(me->getVictim())) + DoModifyThreatPercent(me->getVictim(),-100); + + Gouge_Timer = 17000+rand()%10000; + } else Gouge_Timer -= diff; + + //Kick_Timer + if (Kick_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_KICK); + Kick_Timer = 15000+rand()%10000; + } else Kick_Timer -= diff; + + //Blind_Timer + if (Blind_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_BLIND); + Blind_Timer = 10000+rand()%10000; + } else Blind_Timer -= diff; + + //Check_Timer for the death of LorKhan and Zath. + if (!FakeDeath && Check_Timer <= diff) + { + if (m_pInstance) + { + if (m_pInstance->GetData(TYPE_LORKHAN) == SPECIAL) + { + //Resurrect LorKhan + if (Unit *pLorKhan = Unit::GetUnit((*me), m_pInstance->GetData64(DATA_LORKHAN))) + { + pLorKhan->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); + pLorKhan->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + pLorKhan->setFaction(14); + pLorKhan->SetHealth(int(pLorKhan->GetMaxHealth()*1.0)); + } + } + + if (m_pInstance->GetData(TYPE_THEKAL) == SPECIAL) + { + //Resurrect Thekal + if (Unit *pThekal = Unit::GetUnit((*me), m_pInstance->GetData64(DATA_THEKAL))) + { + pThekal->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); + pThekal->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + pThekal->setFaction(14); + pThekal->SetHealth(int(pThekal->GetMaxHealth()*1.0)); + } + } + } + + Check_Timer = 5000; + } else Check_Timer -= diff; + + if (me->GetHealth() <= me->GetMaxHealth() * 0.05) + { + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetStandState(UNIT_STAND_STATE_SLEEP); + me->setFaction(35); + me->AttackStop(); + + if (m_pInstance) + m_pInstance->SetData(TYPE_ZATH, SPECIAL); + + FakeDeath = true; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_thekal(Creature* pCreature) +{ + return new boss_thekalAI (pCreature); +} + +CreatureAI* GetAI_mob_zealot_lorkhan(Creature* pCreature) +{ + return new mob_zealot_lorkhanAI (pCreature); +} + +CreatureAI* GetAI_mob_zealot_zath(Creature* pCreature) +{ + return new mob_zealot_zathAI (pCreature); +} + +void AddSC_boss_thekal() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_thekal"; + newscript->GetAI = &GetAI_boss_thekal; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_zealot_lorkhan"; + newscript->GetAI = &GetAI_mob_zealot_lorkhan; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_zealot_zath"; + newscript->GetAI = &GetAI_mob_zealot_zath; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp new file mode 100644 index 00000000000..ec1a7a142b5 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp @@ -0,0 +1,199 @@ +/* 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_Venoxis +SD%Complete: 100 +SDComment: +SDCategory: Zul'Gurub +EndScriptData */ + +#include "ScriptedPch.h" +#include "zulgurub.h" + +#define SAY_TRANSFORM -1309000 +#define SAY_DEATH -1309001 + +#define SPELL_HOLY_FIRE 23860 +#define SPELL_HOLY_WRATH 28883 //Not sure if this or 23979 +#define SPELL_VENOMSPIT 23862 +#define SPELL_HOLY_NOVA 23858 +#define SPELL_POISON_CLOUD 23861 +#define SPELL_SNAKE_FORM 23849 +#define SPELL_RENEW 23895 +#define SPELL_BERSERK 23537 +#define SPELL_DISPELL 23859 + +struct boss_venoxisAI : public ScriptedAI +{ + boss_venoxisAI(Creature *c) : ScriptedAI(c) + { + m_pInstance = c->GetInstanceData(); + } + + ScriptedInstance *m_pInstance; + + uint32 HolyFire_Timer; + uint32 HolyWrath_Timer; + uint32 VenomSpit_Timer; + uint32 Renew_Timer; + uint32 PoisonCloud_Timer; + uint32 HolyNova_Timer; + uint32 Dispell_Timer; + uint32 TargetInRange; + + bool PhaseTwo; + bool InBerserk; + + void Reset() + { + HolyFire_Timer = 10000; + HolyWrath_Timer = 60500; + VenomSpit_Timer = 5500; + Renew_Timer = 30500; + PoisonCloud_Timer = 2000; + HolyNova_Timer = 5000; + Dispell_Timer = 35000; + TargetInRange = 0; + + PhaseTwo = false; + InBerserk= false; + } + + void EnterCombat(Unit * /*who*/) + { + } + + void JustDied(Unit* /*Killer*/) + { + DoScriptText(SAY_DEATH, me); + if (m_pInstance) + m_pInstance->SetData(TYPE_VENOXIS, DONE); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if ((me->GetHealth()*100 / me->GetMaxHealth() > 50)) + { + if (Dispell_Timer <= diff) + { + DoCast(me, SPELL_DISPELL); + Dispell_Timer = 15000 + rand()%15000; + } else Dispell_Timer -= diff; + + if (Renew_Timer <= diff) + { + DoCast(me, SPELL_RENEW); + Renew_Timer = 20000 + rand()%10000; + } else Renew_Timer -= diff; + + if (HolyWrath_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_HOLY_WRATH); + HolyWrath_Timer = 15000 + rand()%10000; + } else HolyWrath_Timer -= diff; + + if (HolyNova_Timer <= diff) + { + TargetInRange = 0; + for (uint8 i = 0; i < 10; ++i) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO,i)) + if (me->IsWithinMeleeRange(pTarget)) + ++TargetInRange; + } + + if (TargetInRange > 1) + { + DoCast(me->getVictim(), SPELL_HOLY_NOVA); + HolyNova_Timer = 1000; + } + else + { + HolyNova_Timer = 2000; + } + + } else HolyNova_Timer -= diff; + + if (HolyFire_Timer < diff && TargetInRange < 3) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(pTarget, SPELL_HOLY_FIRE); + + HolyFire_Timer = 8000; + } else HolyFire_Timer -= diff; + } + else + { + if (!PhaseTwo) + { + DoScriptText(SAY_TRANSFORM, me); + me->InterruptNonMeleeSpells(false); + DoCast(me, SPELL_SNAKE_FORM); + me->SetFloatValue(OBJECT_FIELD_SCALE_X, 2.00f); + const CreatureInfo *cinfo = me->GetCreatureInfo(); + me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 25))); + me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 25))); + me->UpdateDamagePhysical(BASE_ATTACK); + DoResetThreat(); + PhaseTwo = true; + } + + if (PhaseTwo && PoisonCloud_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_POISON_CLOUD); + PoisonCloud_Timer = 15000; + }PoisonCloud_Timer -=diff; + + if (PhaseTwo && VenomSpit_Timer <= diff) + { + if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(pTarget, SPELL_VENOMSPIT); + + VenomSpit_Timer = 15000 + rand()%5000; + } else VenomSpit_Timer -= diff; + + if (PhaseTwo && (me->GetHealth()*100 / me->GetMaxHealth() < 11)) + { + if (!InBerserk) + { + me->InterruptNonMeleeSpells(false); + DoCast(me, SPELL_BERSERK); + InBerserk = true; + } + } + } + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_venoxis(Creature* pCreature) +{ + return new boss_venoxisAI (pCreature); +} + +void AddSC_boss_venoxis() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_venoxis"; + newscript->GetAI = &GetAI_boss_venoxis; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp new file mode 100644 index 00000000000..a71d7e0504a --- /dev/null +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp @@ -0,0 +1,85 @@ +/* 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_Wushoolay +SD%Complete: 100 +SDComment: +SDCategory: Zul'Gurub +EndScriptData */ + +#include "ScriptedPch.h" +#include "zulgurub.h" + +#define SPELL_LIGHTNINGCLOUD 25033 +#define SPELL_LIGHTNINGWAVE 24819 + +struct boss_wushoolayAI : public ScriptedAI +{ + boss_wushoolayAI(Creature *c) : ScriptedAI(c) {} + + uint32 LightningCloud_Timer; + uint32 LightningWave_Timer; + + void Reset() + { + LightningCloud_Timer = 5000 + rand()%5000; + LightningWave_Timer = 8000 + rand()%8000; + } + + void EnterCombat(Unit * /*who*/) + { + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //LightningCloud_Timer + if (LightningCloud_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_LIGHTNINGCLOUD); + LightningCloud_Timer = 15000 + rand()%5000; + } else LightningCloud_Timer -= diff; + + //LightningWave_Timer + if (LightningWave_Timer <= diff) + { + Unit *pTarget = NULL; + pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); + if (pTarget) DoCast(pTarget, SPELL_LIGHTNINGWAVE); + + LightningWave_Timer = 12000 + rand()%4000; + } else LightningWave_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_wushoolay(Creature* pCreature) +{ + return new boss_wushoolayAI (pCreature); +} + +void AddSC_boss_wushoolay() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_wushoolay"; + newscript->GetAI = &GetAI_boss_wushoolay; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp new file mode 100644 index 00000000000..aaed1c6df3a --- /dev/null +++ b/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp @@ -0,0 +1,159 @@ +/* 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_ZulGurub +SD%Complete: 80 +SDComment: Missing reset function after killing a boss for Ohgan, Thekal. +SDCategory: Zul'Gurub +EndScriptData */ + +#include "ScriptedPch.h" +#include "zulgurub.h" + +struct instance_zulgurub : public ScriptedInstance +{ + instance_zulgurub(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + //If all High Priest bosses were killed. Lorkhan, Zath and Ohgan are added too. + uint32 m_auiEncounter[MAX_ENCOUNTERS]; + + //Storing Lorkhan, Zath and Thekal because we need to cast on them later. Jindo is needed for healfunction too. + uint64 m_uiLorKhanGUID; + uint64 m_uiZathGUID; + uint64 m_uiThekalGUID; + uint64 m_uiJindoGUID; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + m_uiLorKhanGUID = 0; + m_uiZathGUID = 0; + m_uiThekalGUID = 0; + m_uiJindoGUID = 0; + } + + bool IsEncounterInProgress() const + { + //not active in Zul'Gurub + return false; + } + + void OnCreatureCreate(Creature* pCreature) + { + switch(pCreature->GetEntry()) + { + case 11347: m_uiLorKhanGUID = pCreature->GetGUID(); break; + case 11348: m_uiZathGUID = pCreature->GetGUID(); break; + case 14509: m_uiThekalGUID = pCreature->GetGUID(); break; + case 11380: m_uiJindoGUID = pCreature->GetGUID(); break; + } + } + + void SetData(uint32 uiType, uint32 uiData) + { + switch(uiType) + { + case TYPE_ARLOKK: + m_auiEncounter[0] = uiData; + break; + + case TYPE_JEKLIK: + m_auiEncounter[1] = uiData; + break; + + case TYPE_VENOXIS: + m_auiEncounter[2] = uiData; + break; + + case TYPE_MARLI: + m_auiEncounter[3] = uiData; + break; + + case TYPE_THEKAL: + m_auiEncounter[4] = uiData; + break; + + case TYPE_LORKHAN: + m_auiEncounter[5] = uiData; + break; + + case TYPE_ZATH: + m_auiEncounter[6] = uiData; + break; + + case TYPE_OHGAN: + m_auiEncounter[7] = uiData; + break; + } + } + + uint32 GetData(uint32 uiType) + { + switch(uiType) + { + case TYPE_ARLOKK: + return m_auiEncounter[0]; + case TYPE_JEKLIK: + return m_auiEncounter[1]; + case TYPE_VENOXIS: + return m_auiEncounter[2]; + case TYPE_MARLI: + return m_auiEncounter[3]; + case TYPE_THEKAL: + return m_auiEncounter[4]; + case TYPE_LORKHAN: + return m_auiEncounter[5]; + case TYPE_ZATH: + return m_auiEncounter[6]; + case TYPE_OHGAN: + return m_auiEncounter[7]; + } + return 0; + } + + uint64 GetData64(uint32 uiData) + { + switch(uiData) + { + case DATA_LORKHAN: + return m_uiLorKhanGUID; + case DATA_ZATH: + return m_uiZathGUID; + case DATA_THEKAL: + return m_uiThekalGUID; + case DATA_JINDO: + return m_uiJindoGUID; + } + return 0; + } +}; + +InstanceData* GetInstanceData_instance_zulgurub(Map* pMap) +{ + return new instance_zulgurub(pMap); +} + +void AddSC_instance_zulgurub() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_zulgurub"; + newscript->GetInstanceData = &GetInstanceData_instance_zulgurub; + newscript->RegisterSelf(); +} + diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h b/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h new file mode 100644 index 00000000000..bf55a54c1d5 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h @@ -0,0 +1,28 @@ +/* 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_ZULGURUB_H +#define DEF_ZULGURUB_H + +enum eTypes +{ + MAX_ENCOUNTERS = 8, + + TYPE_ARLOKK = 1, + TYPE_JEKLIK = 2, + TYPE_VENOXIS = 3, + TYPE_MARLI = 4, + TYPE_OHGAN = 5, + TYPE_THEKAL = 6, + TYPE_ZATH = 7, + TYPE_LORKHAN = 8, + + DATA_JINDO = 10, + DATA_LORKHAN = 11, + DATA_THEKAL = 12, + DATA_ZATH = 13 +}; + +#endif + diff --git a/src/server/scripts/EasternKingdoms/alterac_valley/alterac_valley.cpp b/src/server/scripts/EasternKingdoms/alterac_valley/alterac_valley.cpp deleted file mode 100644 index a61fc21d5ba..00000000000 --- a/src/server/scripts/EasternKingdoms/alterac_valley/alterac_valley.cpp +++ /dev/null @@ -1,180 +0,0 @@ -/* Copyright (C) 2008 - 2010 TrinityCore -* 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 -*/ - -#include "ScriptedPch.h" - -enum Spells -{ - SPELL_CHARGE = 22911, - SPELL_CLEAVE = 40504, - SPELL_DEMORALIZING_SHOUT = 23511, - SPELL_ENRAGE = 8599, - SPELL_WHIRLWIND1 = 15589, - SPELL_WHIRLWIND2 = 13736, - SPELL_NORTH_MARSHAL = 45828, - SPELL_SOUTH_MARSHAL = 45829, - SPELL_STONEHEARTH_MARSHAL = 45830, - SPELL_ICEWING_MARSHAL = 45831, - SPELL_ICEBLOOD_WARMASTER = 45822, - SPELL_TOWER_POINT_WARMASTER = 45823, - SPELL_WEST_FROSTWOLF_WARMASTER = 45824, - SPELL_EAST_FROSTWOLF_WARMASTER = 45826 -}; - -enum Creatures -{ - NPC_NORTH_MARSHAL = 14762, - NPC_SOUTH_MARSHAL = 14763, - NPC_ICEWING_MARSHAL = 14764, - NPC_STONEHEARTH_MARSHAL = 14765, - NPC_EAST_FROSTWOLF_WARMASTER = 14772, - NPC_ICEBLOOD_WARMASTER = 14773, - NPC_TOWER_POINT_WARMASTER = 14776, - NPC_WEST_FROSTWOLF_WARMASTER = 14777 -}; - -struct mob_av_marshal_or_warmasterAI : public ScriptedAI -{ - mob_av_marshal_or_warmasterAI(Creature *c) : ScriptedAI(c) {} - - uint32 uiChargeTimer; - uint32 uiCleaveTimer; - uint32 uiDemoralizingShoutTimer; - uint32 uiWhirlwind1Timer; - uint32 uiWhirlwind2Timer; - uint32 uiEnrageTimer; - uint32 uiResetTimer; - - bool bHasAura; - - void Reset() - { - uiChargeTimer = urand(2*IN_MILISECONDS,12*IN_MILISECONDS); - uiCleaveTimer = urand(1*IN_MILISECONDS,11*IN_MILISECONDS); - uiDemoralizingShoutTimer = urand(2*IN_MILISECONDS,2*IN_MILISECONDS); - uiWhirlwind1Timer = urand(1*IN_MILISECONDS,12*IN_MILISECONDS); - uiWhirlwind2Timer = urand(5*IN_MILISECONDS,20*IN_MILISECONDS); - uiEnrageTimer = urand(5*IN_MILISECONDS,20*IN_MILISECONDS); - uiResetTimer = 5*IN_MILISECONDS; - - bHasAura = false; - } - - void JustRespawned() - { - Reset(); - } - - void UpdateAI(const uint32 diff) - { - if (!bHasAura) - { - switch(me->GetEntry()) - { - case NPC_NORTH_MARSHAL: - DoCast(me,SPELL_NORTH_MARSHAL); - break; - case NPC_SOUTH_MARSHAL: - DoCast(me,SPELL_SOUTH_MARSHAL); - break; - case NPC_STONEHEARTH_MARSHAL: - DoCast(me,SPELL_STONEHEARTH_MARSHAL); - break; - case NPC_ICEWING_MARSHAL: - DoCast(me,SPELL_ICEWING_MARSHAL); - break; - case NPC_EAST_FROSTWOLF_WARMASTER: - DoCast(me,SPELL_EAST_FROSTWOLF_WARMASTER); - break; - case NPC_WEST_FROSTWOLF_WARMASTER: - DoCast(me,SPELL_WEST_FROSTWOLF_WARMASTER); - break; - case NPC_ICEBLOOD_WARMASTER: - DoCast(me,SPELL_ICEBLOOD_WARMASTER); - break; - case NPC_TOWER_POINT_WARMASTER: - DoCast(me,SPELL_TOWER_POINT_WARMASTER); - break; - } - - bHasAura = true; - } - - if (!UpdateVictim()) - return; - - if (uiChargeTimer <= diff) - { - DoCast(me->getVictim(), SPELL_CHARGE); - uiChargeTimer = urand(10*IN_MILISECONDS,25*IN_MILISECONDS); - } else uiChargeTimer -= diff; - - if (uiCleaveTimer <= diff) - { - DoCast(me->getVictim(), SPELL_CLEAVE); - uiCleaveTimer = urand(10*IN_MILISECONDS,16*IN_MILISECONDS); - } else uiCleaveTimer -= diff; - - if (uiDemoralizingShoutTimer <= diff) - { - DoCast(me->getVictim(), SPELL_DEMORALIZING_SHOUT); - uiDemoralizingShoutTimer = urand(10*IN_MILISECONDS,15*IN_MILISECONDS); - } else uiDemoralizingShoutTimer -= diff; - - if (uiWhirlwind1Timer <= diff) - { - DoCast(me->getVictim(), SPELL_WHIRLWIND1); - uiWhirlwind1Timer = urand(6*IN_MILISECONDS,20*IN_MILISECONDS); - } else uiWhirlwind1Timer -= diff; - - if (uiWhirlwind2Timer <= diff) - { - DoCast(me->getVictim(), SPELL_WHIRLWIND2); - uiWhirlwind2Timer = urand(10*IN_MILISECONDS,25*IN_MILISECONDS); - } else uiWhirlwind2Timer -= diff; - - if (uiEnrageTimer <= diff) - { - DoCast(me->getVictim(), SPELL_ENRAGE); - uiEnrageTimer = urand(10*IN_MILISECONDS,30*IN_MILISECONDS); - }else uiEnrageTimer -= diff; - - - // check if creature is not outside of building - if (uiResetTimer <= diff) - { - if (me->GetDistance2d(me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY()) > 50) - EnterEvadeMode(); - uiResetTimer = 5*IN_MILISECONDS; - } else uiResetTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_av_marshal_or_warmaster(Creature *_Creature) -{ - return new mob_av_marshal_or_warmasterAI (_Creature); -} - -void AddSC_alterac_valley() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "mob_av_marshal_or_warmaster"; - newscript->GetAI = &GetAI_mob_av_marshal_or_warmaster; - newscript->RegisterSelf(); -} diff --git a/src/server/scripts/EasternKingdoms/alterac_valley/boss_balinda.cpp b/src/server/scripts/EasternKingdoms/alterac_valley/boss_balinda.cpp deleted file mode 100644 index ce2a81c864a..00000000000 --- a/src/server/scripts/EasternKingdoms/alterac_valley/boss_balinda.cpp +++ /dev/null @@ -1,203 +0,0 @@ -/* Copyright (C) 2008 - 2010 TrinityCore - * 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 - */ - -#include "ScriptedPch.h" - -enum Spells -{ - SPELL_ARCANE_EXPLOSION = 46608, - SPELL_CONE_OF_COLD = 38384, - SPELL_FIREBALL = 46988, - SPELL_FROSTBOLT = 46987 -}; - -enum Yells -{ - YELL_AGGRO = -2100019, - YELL_EVADE = -2100020 -}; - -enum Creatures -{ - NPC_WATER_ELEMENTAL = 25040 -}; - -enum WaterElementalSpells -{ - SPELL_WATERBOLT = 46983 -}; - -struct mob_water_elementalAI : public ScriptedAI -{ - mob_water_elementalAI(Creature *c) : ScriptedAI(c) {} - - uint32 uiWaterBoltTimer; - uint64 uiBalindaGUID; - uint32 uiResetTimer; - - void Reset() - { - uiWaterBoltTimer = 3*IN_MILISECONDS; - uiResetTimer = 5*IN_MILISECONDS; - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (uiWaterBoltTimer < diff) - { - DoCast(me->getVictim(), SPELL_WATERBOLT); - uiWaterBoltTimer = 5*IN_MILISECONDS; - } else uiWaterBoltTimer -= diff; - - // check if creature is not outside of building - if (uiResetTimer < diff) - { - if (Creature *pBalinda = Unit::GetCreature(*me, uiBalindaGUID)) - if (me->GetDistance2d(pBalinda->GetHomePosition().GetPositionX(), pBalinda->GetHomePosition().GetPositionY()) > 50) - EnterEvadeMode(); - uiResetTimer = 5*IN_MILISECONDS; - } else uiResetTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -struct boss_balindaAI : public ScriptedAI -{ - boss_balindaAI(Creature *c) : ScriptedAI(c), Summons(me) {} - - uint32 uiArcaneExplosionTimer; - uint32 uiConeOfColdTimer; - uint32 uiFireBoltTimer; - uint32 uiFrostboltTimer; - uint32 uiResetTimer; - uint32 uiWaterElementalTimer; - - SummonList Summons; - - void Reset() - { - uiArcaneExplosionTimer = urand(5*IN_MILISECONDS,15*IN_MILISECONDS); - uiConeOfColdTimer = 8*IN_MILISECONDS; - uiFireBoltTimer = 1*IN_MILISECONDS; - uiFrostboltTimer = 4*IN_MILISECONDS; - uiResetTimer = 5*IN_MILISECONDS; - uiWaterElementalTimer = 0; - - Summons.DespawnAll(); - } - - void EnterCombat(Unit * /*who*/) - { - DoScriptText(YELL_AGGRO, me); - } - - void JustRespawned() - { - Reset(); - } - - void JustSummoned(Creature* summoned) - { - ((mob_water_elementalAI*)summoned->AI())->uiBalindaGUID = me->GetGUID(); - summoned->AI()->AttackStart(SelectTarget(SELECT_TARGET_RANDOM,0, 50, true)); - summoned->setFaction(me->getFaction()); - Summons.Summon(summoned); - } - - void JustDied(Unit* /*Killer*/) - { - Summons.DespawnAll(); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (uiWaterElementalTimer < diff) - { - if (Summons.empty()) - me->SummonCreature(NPC_WATER_ELEMENTAL, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45*IN_MILISECONDS); - uiWaterElementalTimer = 50*IN_MILISECONDS; - } else uiWaterElementalTimer -= diff; - - if (uiArcaneExplosionTimer < diff) - { - DoCast(me->getVictim(), SPELL_ARCANE_EXPLOSION); - uiArcaneExplosionTimer = urand(5*IN_MILISECONDS,15*IN_MILISECONDS); - } else uiArcaneExplosionTimer -= diff; - - if (uiConeOfColdTimer < diff) - { - DoCast(me->getVictim(), SPELL_CONE_OF_COLD); - uiConeOfColdTimer = urand(10*IN_MILISECONDS,20*IN_MILISECONDS); - } else uiConeOfColdTimer -= diff; - - if (uiFireBoltTimer < diff) - { - DoCast(me->getVictim(), SPELL_FIREBALL); - uiFireBoltTimer = urand(5*IN_MILISECONDS,9*IN_MILISECONDS); - } else uiFireBoltTimer -= diff; - - if (uiFrostboltTimer < diff) - { - DoCast(me->getVictim(), SPELL_FROSTBOLT); - uiFrostboltTimer = urand(4*IN_MILISECONDS,12*IN_MILISECONDS); - } else uiFrostboltTimer -= diff; - - - // check if creature is not outside of building - if (uiResetTimer < diff) - { - if (me->GetDistance2d(me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY()) > 50) - { - EnterEvadeMode(); - DoScriptText(YELL_EVADE, me); - } - uiResetTimer = 5*IN_MILISECONDS; - } else uiResetTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_balinda(Creature *_Creature) -{ - return new boss_balindaAI (_Creature); -} - -CreatureAI* GetAI_mob_water_elemental(Creature *_Creature) -{ - return new mob_water_elementalAI (_Creature); -} - -void AddSC_boss_balinda() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_balinda"; - newscript->GetAI = &GetAI_boss_balinda; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_water_elemental"; - newscript->GetAI = &GetAI_mob_water_elemental; - newscript->RegisterSelf(); -}; \ No newline at end of file diff --git a/src/server/scripts/EasternKingdoms/alterac_valley/boss_drekthar.cpp b/src/server/scripts/EasternKingdoms/alterac_valley/boss_drekthar.cpp deleted file mode 100644 index 6477ebe5eaf..00000000000 --- a/src/server/scripts/EasternKingdoms/alterac_valley/boss_drekthar.cpp +++ /dev/null @@ -1,138 +0,0 @@ -/* Copyright (C) 2008 - 2010 TrinityCore -* 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 -*/ - -#include "ScriptedPch.h" - -enum Spells -{ - SPELL_WHIRLWIND = 15589, - SPELL_WHIRLWIND2 = 13736, - SPELL_KNOCKDOWN = 19128, - SPELL_FRENZY = 8269, - SPELL_SWEEPING_STRIKES = 18765, // not sure - SPELL_CLEAVE = 20677, // not sure - SPELL_WINDFURY = 35886, // not sure - SPELL_STORMPIKE = 51876 // not sure -}; - -enum Yells -{ - YELL_AGGRO = -1810000, - YELL_EVADE = -1810001, - YELL_RESPAWN = -1810002, - YELL_RANDOM1 = -1810003, - YELL_RANDOM2 = -1810004, - YELL_RANDOM3 = -1810005, - YELL_RANDOM4 = -1810006, - YELL_RANDOM5 = -1810007 -}; - -struct boss_drektharAI : public ScriptedAI -{ - boss_drektharAI(Creature *c) : ScriptedAI(c) {} - - uint32 uiWhirlwindTimer; - uint32 uiWhirlwind2Timer; - uint32 uiKnockdownTimer; - uint32 uiFrenzyTimer; - uint32 uiYellTimer; - uint32 uiResetTimer; - - void Reset() - { - uiWhirlwindTimer = urand(1*IN_MILISECONDS,20*IN_MILISECONDS); - uiWhirlwind2Timer = urand(1*IN_MILISECONDS,20*IN_MILISECONDS); - uiKnockdownTimer = 12*IN_MILISECONDS; - uiFrenzyTimer = 6*IN_MILISECONDS; - uiResetTimer = 5*IN_MILISECONDS; - uiYellTimer = urand(20*IN_MILISECONDS,30*IN_MILISECONDS); //20 to 30 seconds - } - - void Aggro(Unit * /*who*/) - { - DoScriptText(YELL_AGGRO, me); - } - - void JustRespawned() - { - Reset(); - DoScriptText(YELL_RESPAWN, me); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (uiWhirlwindTimer <= diff) - { - DoCast(me->getVictim(), SPELL_WHIRLWIND); - uiWhirlwindTimer = urand(8*IN_MILISECONDS,18*IN_MILISECONDS); - } else uiWhirlwindTimer -= diff; - - if (uiWhirlwind2Timer <= diff) - { - DoCast(me->getVictim(), SPELL_WHIRLWIND2); - uiWhirlwind2Timer = urand(7*IN_MILISECONDS,25*IN_MILISECONDS); - } else uiWhirlwind2Timer -= diff; - - if (uiKnockdownTimer <= diff) - { - DoCast(me->getVictim(), SPELL_KNOCKDOWN); - uiKnockdownTimer = urand(10*IN_MILISECONDS,15*IN_MILISECONDS); - } else uiKnockdownTimer -= diff; - - if (uiFrenzyTimer <= diff) - { - DoCast(me->getVictim(), SPELL_FRENZY); - uiFrenzyTimer = urand(20*IN_MILISECONDS,30*IN_MILISECONDS); - } else uiFrenzyTimer -= diff; - - if (uiYellTimer <= diff) - { - DoScriptText(RAND(YELL_RANDOM1,YELL_RANDOM2,YELL_RANDOM3,YELL_RANDOM4,YELL_RANDOM5), me); - uiYellTimer = urand(20*IN_MILISECONDS,30*IN_MILISECONDS); //20 to 30 seconds - } else uiYellTimer -= diff; - - // check if creature is not outside of building - if (uiResetTimer <= diff) - { - if (me->GetDistance2d(me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY()) > 50) - { - EnterEvadeMode(); - DoScriptText(YELL_EVADE, me); - } - uiResetTimer = 5*IN_MILISECONDS; - } else uiResetTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - - -CreatureAI* GetAI_boss_drekthar(Creature *_Creature) -{ - return new boss_drektharAI (_Creature); -} - -void AddSC_boss_drekthar() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_drekthar"; - newscript->GetAI = &GetAI_boss_drekthar; - newscript->RegisterSelf(); -} \ No newline at end of file diff --git a/src/server/scripts/EasternKingdoms/alterac_valley/boss_galvangar.cpp b/src/server/scripts/EasternKingdoms/alterac_valley/boss_galvangar.cpp deleted file mode 100644 index a12b9f267f9..00000000000 --- a/src/server/scripts/EasternKingdoms/alterac_valley/boss_galvangar.cpp +++ /dev/null @@ -1,129 +0,0 @@ -/* Copyright (C) 2008 - 2010 TrinityCore -* 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 -*/ - -#include "ScriptedPch.h" - -enum Spells -{ - SPELL_CLEAVE = 15284, - SPELL_FRIGHTENING_SHOUT = 19134, - SPELL_WHIRLWIND1 = 15589, - SPELL_WHIRLWIND2 = 13736, - SPELL_MORTAL_STRIKE = 16856 -}; - -enum Yells -{ - YELL_AGGRO = -1810021, - YELL_EVADE = -1810022 -}; - -struct boss_galvangarAI : public ScriptedAI -{ - boss_galvangarAI(Creature *c) : ScriptedAI(c) {} - - - uint32 uiCleaveTimer; - uint32 uiFrighteningShoutTimer; - uint32 uiWhirlwind1Timer; - uint32 uiWhirlwind2Timer; - uint32 uiMortalStrikeTimer; - uint32 uiResetTimer; - - - void Reset() - { - uiCleaveTimer = urand(1*IN_MILISECONDS,9*IN_MILISECONDS); - uiFrighteningShoutTimer = urand(2*IN_MILISECONDS,19*IN_MILISECONDS); - uiWhirlwind1Timer = urand(1*IN_MILISECONDS,13*IN_MILISECONDS); - uiWhirlwind2Timer = urand(5*IN_MILISECONDS,20*IN_MILISECONDS); - uiMortalStrikeTimer = urand(5*IN_MILISECONDS,20*IN_MILISECONDS); - uiResetTimer = 5*IN_MILISECONDS; - } - - void Aggro(Unit * /*who*/) - { - DoScriptText(YELL_AGGRO, me); - } - - void JustRespawned() - { - Reset(); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (uiCleaveTimer <= diff) - { - DoCast(me->getVictim(), SPELL_CLEAVE); - uiCleaveTimer = urand(10*IN_MILISECONDS,16*IN_MILISECONDS); - } else uiCleaveTimer -= diff; - - if (uiFrighteningShoutTimer <= diff) - { - DoCast(me->getVictim(), SPELL_FRIGHTENING_SHOUT); - uiFrighteningShoutTimer = urand(10*IN_MILISECONDS,15*IN_MILISECONDS); - } else uiFrighteningShoutTimer -= diff; - - if (uiWhirlwind1Timer <= diff) - { - DoCast(me->getVictim(), SPELL_WHIRLWIND1); - uiWhirlwind1Timer = urand(6*IN_MILISECONDS,10*IN_MILISECONDS); - } else uiWhirlwind1Timer -= diff; - - if (uiWhirlwind2Timer <= diff) - { - DoCast(me->getVictim(), SPELL_WHIRLWIND2); - uiWhirlwind2Timer = urand(10*IN_MILISECONDS,25*IN_MILISECONDS); - } else uiWhirlwind2Timer -= diff; - - if (uiMortalStrikeTimer <= diff) - { - DoCast(me->getVictim(), SPELL_MORTAL_STRIKE); - uiMortalStrikeTimer = urand(10*IN_MILISECONDS,30*IN_MILISECONDS); - } else uiMortalStrikeTimer -= diff; - - // check if creature is not outside of building - if (uiResetTimer <= diff) - { - if (me->GetDistance2d(me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY()) > 50) - { - EnterEvadeMode(); - DoScriptText(YELL_EVADE, me); - } - uiResetTimer = 5*IN_MILISECONDS; - } else uiResetTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_galvangar(Creature *_Creature) -{ - return new boss_galvangarAI (_Creature); -} - -void AddSC_boss_galvangar() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_galvangar"; - newscript->GetAI = &GetAI_boss_galvangar; - newscript->RegisterSelf(); -} diff --git a/src/server/scripts/EasternKingdoms/alterac_valley/boss_vanndar.cpp b/src/server/scripts/EasternKingdoms/alterac_valley/boss_vanndar.cpp deleted file mode 100644 index 785827bc5d9..00000000000 --- a/src/server/scripts/EasternKingdoms/alterac_valley/boss_vanndar.cpp +++ /dev/null @@ -1,129 +0,0 @@ -/* Copyright (C) 2008 - 2010 TrinityCore -* 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 -*/ - -#include "ScriptedPch.h" - -enum Yells -{ - YELL_AGGRO = -1810008, - YELL_EVADE = -1810009, - YELL_RESPAWN1 = -1810010, - YELL_RESPAWN2 = -1810011, - YELL_RANDOM1 = -1810012, - YELL_RANDOM2 = -1810013, - YELL_RANDOM3 = -1810014, - YELL_RANDOM4 = -1810015, - YELL_RANDOM5 = -1810016, - YELL_RANDOM6 = -1810017, - YELL_RANDOM7 = -1810018 -}; - -enum Spells -{ - SPELL_AVATAR = 19135, - SPELL_THUNDERCLAP = 15588, - SPELL_STORMBOLT = 20685 // not sure -}; - -struct boss_vanndarAI : public ScriptedAI -{ - boss_vanndarAI(Creature *c) : ScriptedAI(c) {} - - - uint32 uiAvatarTimer; - uint32 uiThunderclapTimer; - uint32 uiStormboltTimer; - uint32 uiResetTimer; - uint32 uiYellTimer; - - - void Reset() - { - uiAvatarTimer = 3*IN_MILISECONDS; - uiThunderclapTimer = 4*IN_MILISECONDS; - uiStormboltTimer = 6*IN_MILISECONDS; - uiResetTimer = 5*IN_MILISECONDS; - uiYellTimer = urand(20*IN_MILISECONDS,30*IN_MILISECONDS); - } - - void Aggro(Unit * /*who*/) - { - DoScriptText(YELL_AGGRO, me); - } - - void JustRespawned() - { - Reset(); - DoScriptText(RAND(YELL_RESPAWN1,YELL_RESPAWN2), me); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (uiAvatarTimer <= diff) - { - DoCast(me->getVictim(), SPELL_AVATAR); - uiAvatarTimer = urand(15*IN_MILISECONDS,20*IN_MILISECONDS); - } else uiAvatarTimer -= diff; - - if (uiThunderclapTimer <= diff) - { - DoCast(me->getVictim(), SPELL_THUNDERCLAP); - uiThunderclapTimer = urand(5*IN_MILISECONDS,15*IN_MILISECONDS); - } else uiThunderclapTimer -= diff; - - if (uiStormboltTimer <= diff) - { - DoCast(me->getVictim(), SPELL_STORMBOLT); - uiStormboltTimer = urand(10*IN_MILISECONDS,25*IN_MILISECONDS); - } else uiStormboltTimer -= diff; - - if (uiYellTimer <= diff) - { - DoScriptText(RAND(YELL_RANDOM1,YELL_RANDOM2,YELL_RANDOM3,YELL_RANDOM4,YELL_RANDOM5,YELL_RANDOM6,YELL_RANDOM7), me); - uiYellTimer = urand(20*IN_MILISECONDS,30*IN_MILISECONDS); //20 to 30 seconds - } else uiYellTimer -= diff; - - // check if creature is not outside of building - if (uiResetTimer <= diff) - { - if (me->GetDistance2d(me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY()) > 50) - { - EnterEvadeMode(); - DoScriptText(YELL_EVADE, me); - } - uiResetTimer = 5*IN_MILISECONDS; - } else uiResetTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_vanndar(Creature *_Creature) -{ - return new boss_vanndarAI (_Creature); -} - -void AddSC_boss_vanndar() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_vanndar"; - newscript->GetAI = &GetAI_boss_vanndar; - newscript->RegisterSelf(); -} \ No newline at end of file diff --git a/src/server/scripts/EasternKingdoms/blackrock_depths/blackrock_depths.cpp b/src/server/scripts/EasternKingdoms/blackrock_depths/blackrock_depths.cpp deleted file mode 100644 index e04fa8444b2..00000000000 --- a/src/server/scripts/EasternKingdoms/blackrock_depths/blackrock_depths.cpp +++ /dev/null @@ -1,1338 +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: Blackrock_Depths -SD%Complete: 95 -SDComment: Quest support: 4001, 4342, 7604, 4322. Vendor Lokhtos Darkbargainer. Need to rewrite the Jail Break support -SDCategory: Blackrock Depths -EndScriptData */ - -/* ContentData -go_shadowforge_brazier -at_ring_of_law -npc_grimstone -mob_phalanx -npc_kharan_mighthammer -npc_lokhtos_darkbargainer -npc_dughal_stormwing -npc_marshal_windsor -npc_marshal_reginald_windsor -npc_tobias_seecher -npc_rocknot -EndContentData */ - -#include "ScriptedPch.h" -#include "ScriptedEscortAI.h" -#include "blackrock_depths.h" - -/*###### -+## go_shadowforge_brazier -+######*/ - -bool GOHello_go_shadowforge_brazier(Player* /*pPlayer*/, GameObject* pGo) -{ - if (ScriptedInstance* pInstance = pGo->GetInstanceData()) - { - if (pInstance->GetData(TYPE_LYCEUM) == IN_PROGRESS) - pInstance->SetData(TYPE_LYCEUM, DONE); - else - pInstance->SetData(TYPE_LYCEUM, IN_PROGRESS); - // If used brazier open linked doors (North or South) - if (pGo->GetGUID() == pInstance->GetData64(DATA_SF_BRAZIER_N)) - pInstance->HandleGameObject(pInstance->GetData64(DATA_GOLEM_DOOR_N), true); - else if (pGo->GetGUID() == pInstance->GetData64(DATA_SF_BRAZIER_S)) - pInstance->HandleGameObject(pInstance->GetData64(DATA_GOLEM_DOOR_S), true); - } - return false; -} - -/*###### -## npc_grimstone -######*/ - -enum eGrimstone -{ - NPC_GRIMSTONE = 10096, - NPC_THELDREN = 16059, - - //4 or 6 in total? 1+2+1 / 2+2+2 / 3+3. Depending on this, code should be changed. - MAX_MOB_AMOUNT = 4 -}; - -uint32 RingMob[]= -{ - 8925, // Dredge Worm - 8926, // Deep Stinger - 8927, // Dark Screecher - 8928, // Burrowing Thundersnout - 8933, // Cave Creeper - 8932, // Borer Beetle -}; - -uint32 RingBoss[]= -{ - 9027, // Gorosh - 9028, // Grizzle - 9029, // Eviscerator - 9030, // Ok'thor - 9031, // Anub'shiah - 9032, // Hedrum -}; - -bool AreaTrigger_at_ring_of_law(Player* pPlayer, const AreaTriggerEntry * /*at*/) -{ - if (ScriptedInstance* pInstance = pPlayer->GetInstanceData()) - { - if (pInstance->GetData(TYPE_RING_OF_LAW) == IN_PROGRESS || pInstance->GetData(TYPE_RING_OF_LAW) == DONE) - return false; - - pInstance->SetData(TYPE_RING_OF_LAW,IN_PROGRESS); - pPlayer->SummonCreature(NPC_GRIMSTONE,625.559,-205.618,-52.735,2.609,TEMPSUMMON_DEAD_DESPAWN,0); - - return false; - } - return false; -} - -/*###### -## npc_grimstone -######*/ - -enum GrimstoneTexts -{ - SCRIPT_TEXT1 = -1000000, - SCRIPT_TEXT2 = -1000001, - SCRIPT_TEXT3 = -1000002, - SCRIPT_TEXT4 = -1000003, - SCRIPT_TEXT5 = -1000004, - SCRIPT_TEXT6 = -1000005 -}; - -//TODO: implement quest part of event (different end boss) -struct npc_grimstoneAI : public npc_escortAI -{ - npc_grimstoneAI(Creature *c) : npc_escortAI(c) - { - pInstance = c->GetInstanceData(); - MobSpawnId = rand()%6; - } - - ScriptedInstance* pInstance; - - uint8 EventPhase; - uint32 Event_Timer; - - uint8 MobSpawnId; - uint8 MobCount; - uint32 MobDeath_Timer; - - uint64 RingMobGUID[4]; - uint64 RingBossGUID; - - bool CanWalk; - - void Reset() - { - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - - EventPhase = 0; - Event_Timer = 1000; - - MobCount = 0; - MobDeath_Timer = 0; - - for (uint8 i = 0; i < MAX_MOB_AMOUNT; ++i) - RingMobGUID[i] = 0; - - RingBossGUID = 0; - - CanWalk = false; - } - - //TODO: move them to center - void SummonRingMob() - { - if (Creature* tmp = me->SummonCreature(RingMob[MobSpawnId],608.960,-235.322,-53.907,1.857,TEMPSUMMON_DEAD_DESPAWN,0)) - RingMobGUID[MobCount] = tmp->GetGUID(); - - ++MobCount; - - if (MobCount == MAX_MOB_AMOUNT) - MobDeath_Timer = 2500; - } - - //TODO: move them to center - void SummonRingBoss() - { - if (Creature* tmp = me->SummonCreature(RingBoss[rand()%6],644.300,-175.989,-53.739,3.418,TEMPSUMMON_DEAD_DESPAWN,0)) - RingBossGUID = tmp->GetGUID(); - - MobDeath_Timer = 2500; - } - - void WaypointReached(uint32 i) - { - switch(i) - { - case 0: - DoScriptText(SCRIPT_TEXT1, me);//2 - CanWalk = false; - Event_Timer = 5000; - break; - case 1: - DoScriptText(SCRIPT_TEXT2, me);//4 - CanWalk = false; - Event_Timer = 5000; - break; - case 2: - CanWalk = false; - break; - case 3: - DoScriptText(SCRIPT_TEXT3, me);//5 - break; - case 4: - DoScriptText(SCRIPT_TEXT4, me);//6 - CanWalk = false; - Event_Timer = 5000; - break; - case 5: - if (pInstance) - { - pInstance->SetData(TYPE_RING_OF_LAW,DONE); - debug_log("TSCR: npc_grimstone: event reached end and set complete."); - } - break; - } - } - - void HandleGameObject(uint32 id, bool open) - { - pInstance->HandleGameObject(pInstance->GetData64(id), open); - } - - void UpdateAI(const uint32 diff) - { - if (!pInstance) - return; - - if (MobDeath_Timer) - { - if (MobDeath_Timer <= diff) - { - MobDeath_Timer = 2500; - - if (RingBossGUID) - { - Creature *boss = Unit::GetCreature(*me,RingBossGUID); - if (boss && !boss->isAlive() && boss->isDead()) - { - RingBossGUID = 0; - Event_Timer = 5000; - MobDeath_Timer = 0; - return; - } - return; - } - - for (uint8 i = 0; i < MAX_MOB_AMOUNT; ++i) - { - Creature *mob = Unit::GetCreature(*me,RingMobGUID[i]); - if (mob && !mob->isAlive() && mob->isDead()) - { - RingMobGUID[i] = 0; - --MobCount; - - //seems all are gone, so set timer to continue and discontinue this - if (!MobCount) - { - Event_Timer = 5000; - MobDeath_Timer = 0; - } - } - } - } else MobDeath_Timer -= diff; - } - - if (Event_Timer) - { - if (Event_Timer <= diff) - { - switch(EventPhase) - { - case 0: - DoScriptText(SCRIPT_TEXT5, me);//1 - HandleGameObject(DATA_ARENA4, false); - Start(false, false); - CanWalk = true; - Event_Timer = 0; - break; - case 1: - CanWalk = true; - Event_Timer = 0; - break; - case 2: - Event_Timer = 2000; - break; - case 3: - HandleGameObject(DATA_ARENA1, true); - Event_Timer = 3000; - break; - case 4: - CanWalk = true; - me->SetVisibility(VISIBILITY_OFF); - SummonRingMob(); - Event_Timer = 8000; - break; - case 5: - SummonRingMob(); - SummonRingMob(); - Event_Timer = 8000; - break; - case 6: - SummonRingMob(); - Event_Timer = 0; - break; - case 7: - me->SetVisibility(VISIBILITY_ON); - HandleGameObject(DATA_ARENA1, false); - DoScriptText(SCRIPT_TEXT6, me);//4 - CanWalk = true; - Event_Timer = 0; - break; - case 8: - HandleGameObject(DATA_ARENA2, true); - Event_Timer = 5000; - break; - case 9: - me->SetVisibility(VISIBILITY_OFF); - SummonRingBoss(); - Event_Timer = 0; - break; - case 10: - //if quest, complete - HandleGameObject(DATA_ARENA2, false); - HandleGameObject(DATA_ARENA3, true); - HandleGameObject(DATA_ARENA4, true); - CanWalk = true; - Event_Timer = 0; - break; - } - ++EventPhase; - } else Event_Timer -= diff; - } - - if (CanWalk) - npc_escortAI::UpdateAI(diff); - } -}; - -CreatureAI* GetAI_npc_grimstone(Creature* pCreature) -{ - return new npc_grimstoneAI(pCreature); -} - -/*###### -## mob_phalanx -######*/ - -enum PhalanxSpells -{ - SPELL_THUNDERCLAP = 8732, - SPELL_FIREBALLVOLLEY = 22425, - SPELL_MIGHTYBLOW = 14099 -}; - -struct mob_phalanxAI : public ScriptedAI -{ - mob_phalanxAI(Creature *c) : ScriptedAI(c) {} - - uint32 ThunderClap_Timer; - uint32 FireballVolley_Timer; - uint32 MightyBlow_Timer; - - void Reset() - { - ThunderClap_Timer = 12000; - FireballVolley_Timer =0; - MightyBlow_Timer = 15000; - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //ThunderClap_Timer - if (ThunderClap_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_THUNDERCLAP); - ThunderClap_Timer = 10000; - } else ThunderClap_Timer -= diff; - - //FireballVolley_Timer - if (me->GetHealth()*100 / me->GetMaxHealth() < 51) - { - if (FireballVolley_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_FIREBALLVOLLEY); - FireballVolley_Timer = 15000; - } else FireballVolley_Timer -= diff; - } - - //MightyBlow_Timer - if (MightyBlow_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_MIGHTYBLOW); - MightyBlow_Timer = 10000; - } else MightyBlow_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_mob_phalanx(Creature* pCreature) -{ - return new mob_phalanxAI (pCreature); -} - -/*###### -## npc_kharan_mighthammer -######*/ - -enum KharamQuests -{ - QUEST_4001 = 4001, - QUEST_4342 = 4342 -}; - -#define GOSSIP_ITEM_KHARAN_1 "I need to know where the princess are, Kharan!" -#define GOSSIP_ITEM_KHARAN_2 "All is not lost, Kharan!" - -#define GOSSIP_ITEM_KHARAN_3 "Gor'shak is my friend, you can trust me." -#define GOSSIP_ITEM_KHARAN_4 "Not enough, you need to tell me more." -#define GOSSIP_ITEM_KHARAN_5 "So what happened?" -#define GOSSIP_ITEM_KHARAN_6 "Continue..." -#define GOSSIP_ITEM_KHARAN_7 "So you suspect that someone on the inside was involved? That they were tipped off?" -#define GOSSIP_ITEM_KHARAN_8 "Continue with your story please." -#define GOSSIP_ITEM_KHARAN_9 "Indeed." -#define GOSSIP_ITEM_KHARAN_10 "The door is open, Kharan. You are a free man." - -bool GossipHello_npc_kharan_mighthammer(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - - if (pPlayer->GetQuestStatus(QUEST_4001) == QUEST_STATUS_INCOMPLETE) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - if (pPlayer->GetQuestStatus(4342) == QUEST_STATUS_INCOMPLETE) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); - - if (pPlayer->GetTeam() == HORDE) - pPlayer->SEND_GOSSIP_MENU(2473, pCreature->GetGUID()); - else - pPlayer->SEND_GOSSIP_MENU(2474, pCreature->GetGUID()); - - return true; -} - -bool GossipSelect_npc_kharan_mighthammer(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction) -{ - switch (uiAction) - { - case GOSSIP_ACTION_INFO_DEF+1: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - pPlayer->SEND_GOSSIP_MENU(2475, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); - pPlayer->SEND_GOSSIP_MENU(2476, pCreature->GetGUID()); - break; - - case GOSSIP_ACTION_INFO_DEF+3: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); - pPlayer->SEND_GOSSIP_MENU(2477, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+4: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); - pPlayer->SEND_GOSSIP_MENU(2478, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+5: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6); - pPlayer->SEND_GOSSIP_MENU(2479, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+6: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_8, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+7); - pPlayer->SEND_GOSSIP_MENU(2480, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+7: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_9, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+8); - pPlayer->SEND_GOSSIP_MENU(2481, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+8: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_10, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+9); - pPlayer->SEND_GOSSIP_MENU(2482, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+9: - pPlayer->CLOSE_GOSSIP_MENU(); - if (pPlayer->GetTeam() == HORDE) - pPlayer->AreaExploredOrEventHappens(QUEST_4001); - else - pPlayer->AreaExploredOrEventHappens(QUEST_4342); - break; - } - return true; -} - -/*###### -## npc_lokhtos_darkbargainer -######*/ - -enum LokhtosItems -{ - ITEM_THRORIUM_BROTHERHOOD_CONTRACT = 18628, - ITEM_SULFURON_INGOT = 17203 -}; - -enum LokhtosQuests -{ - QUEST_A_BINDING_CONTRACT = 7604 -}; - -enum LokhtosSpells -{ - SPELL_CREATE_THORIUM_BROTHERHOOD_CONTRACT_DND = 23059 -}; - -#define GOSSIP_ITEM_SHOW_ACCESS "Show me what I have access to, Lothos." -#define GOSSIP_ITEM_GET_CONTRACT "Get Thorium Brotherhood Contract" - -bool GossipHello_npc_lokhtos_darkbargainer(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - - if (pCreature->isVendor() && pPlayer->GetReputationRank(59) >= REP_FRIENDLY) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_ITEM_SHOW_ACCESS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); - - if (pPlayer->GetQuestRewardStatus(QUEST_A_BINDING_CONTRACT) != 1 && - !pPlayer->HasItemCount(ITEM_THRORIUM_BROTHERHOOD_CONTRACT, 1, true) && - pPlayer->HasItemCount(ITEM_SULFURON_INGOT, 1)) - { - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_GET_CONTRACT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - } - - if (pPlayer->GetReputationRank(59) < REP_FRIENDLY) - pPlayer->SEND_GOSSIP_MENU(3673, pCreature->GetGUID()); - else - pPlayer->SEND_GOSSIP_MENU(3677, pCreature->GetGUID()); - - return true; -} - -bool GossipSelect_npc_lokhtos_darkbargainer(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) - { - pPlayer->CLOSE_GOSSIP_MENU(); - pPlayer->CastSpell(pPlayer, SPELL_CREATE_THORIUM_BROTHERHOOD_CONTRACT_DND, false); - } - if (uiAction == GOSSIP_ACTION_TRADE) - pPlayer->SEND_VENDORLIST(pCreature->GetGUID()); - - return true; -} - -/*###### -## npc_dughal_stormwing -######*/ - -enum DughalQuests -{ - QUEST_JAIL_BREAK = 4322 -}; - -#define SAY_DUGHAL_FREE "Thank you, $N! I'm free!!!" -#define GOSSIP_DUGHAL "You're free, Dughal! Get out of here!" - -/* -struct npc_dughal_stormwingAI : public npc_escortAI -{ - npc_dughal_stormwingAI(Creature *c) : npc_escortAI(c) {} - - void WaypointReached(uint32 i) - { - switch(i) - { - case 0:me->Say(SAY_DUGHAL_FREE, LANG_UNIVERSAL, PlayerGUID); break; - case 1:pInstance->SetData(DATA_DUGHAL,ENCOUNTER_STATE_OBJECTIVE_COMPLETED);break; - case 2: - me->SetVisibility(VISIBILITY_OFF); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - pInstance->SetData(DATA_DUGHAL,ENCOUNTER_STATE_ENDED); - break; - } - } - - void EnterCombat(Unit* who) {} - void Reset() {} - - void JustDied(Unit* killer) - { - if (IsBeingEscorted && killer == me) - { - me->SetVisibility(VISIBILITY_OFF); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - pInstance->SetData(DATA_DUGHAL,ENCOUNTER_STATE_ENDED); - } - } - - void UpdateAI(const uint32 diff) - { - if (pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) return; - if ((pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_IN_PROGRESS || pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_FAILED || pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_ENDED)&& pInstance->GetData(DATA_DUGHAL) == ENCOUNTER_STATE_ENDED) - { - me->SetVisibility(VISIBILITY_OFF); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - } - else - { - me->SetVisibility(VISIBILITY_ON); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - } - npc_escortAI::UpdateAI(diff); - } -}; -CreatureAI* GetAI_npc_dughal_stormwing(Creature* pCreature) -{ - npc_dughal_stormwingAI* dughal_stormwingAI = new npc_dughal_stormwingAI(pCreature); - - dughal_stormwingAI->AddWaypoint(0, 280.42,-82.86, -77.12,0); - dughal_stormwingAI->AddWaypoint(1, 287.64,-87.01, -76.79,0); - dughal_stormwingAI->AddWaypoint(2, 354.63,-64.95, -67.53,0); - - return dughal_stormwingAI; -} -bool GossipHello_npc_dughal_stormwing(Player* pPlayer, Creature* pCreature) -{ - if (pPlayer->GetQuestStatus(QUEST_JAIL_BREAK) == QUEST_STATUS_INCOMPLETE && pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_IN_PROGRESS) - { - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DUGHAL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - pPlayer->SEND_GOSSIP_MENU(2846, pCreature->GetGUID()); - } - return true; -} - -bool GossipSelect_npc_dughal_stormwing(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) - { - pPlayer->CLOSE_GOSSIP_MENU(); - CAST_AI(npc_escortAI, (pCreature->AI()))->Start(false, true, pPlayer->GetGUID()); - pCreature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - pInstance->SetData(DATA_QUEST_JAIL_BREAK,ENCOUNTER_STATE_IN_PROGRESS); - } - return true; -} - */ -/*###### -## npc_marshal_windsor -######*/ - -#define SAY_WINDSOR_AGGRO1 "You locked up the wrong Marshal. Prepare to be destroyed!" -#define SAY_WINDSOR_AGGRO2 "I bet you're sorry now, aren't you !?!!" -#define SAY_WINDSOR_AGGRO3 "You better hold me back $N or they are going to feel some prison house beatings." -#define SAY_WINDSOR_1 "Let's get a move on. My gear should be in the storage area up this way..." -#define SAY_WINDSOR_4_1 "Check that cell, $N. If someone is alive in there, we need to get them out." -#define SAY_WINDSOR_4_2 "Get him out of there!" -#define SAY_WINDSOR_4_3 "Good work! We're almost there, $N. This way." -#define SAY_WINDSOR_6 "This is it, $N. My stuff should be in that room. Cover me, I'm going in!" -#define SAY_WINDSOR_9 "Ah, there it is!" -#define MOB_ENTRY_REGINALD_WINDSOR 9682 - -Player* pPlayerStart; -/* -struct npc_marshal_windsorAI : public npc_escortAI -{ - npc_marshal_windsorAI(Creature *c) : npc_escortAI(c) - { - pInstance = c->GetInstanceData(); - } - - void WaypointReached(uint32 i) - { - switch(i) - { - case 1: - me->Say(SAY_WINDSOR_1, LANG_UNIVERSAL, PlayerGUID); - break; - case 7: - me->HandleEmoteCommand(EMOTE_STATE_POINT); - me->Say(SAY_WINDSOR_4_1, LANG_UNIVERSAL, PlayerGUID); - IsOnHold=true; - break; - case 10: - me->setFaction(534); - break; - case 12: - me->Say(SAY_WINDSOR_6, LANG_UNIVERSAL, PlayerGUID); - pInstance->SetData(DATA_SUPPLY_ROOM, ENCOUNTER_STATE_IN_PROGRESS); - break; - case 13: - me->HandleEmoteCommand(EMOTE_STATE_USESTANDING);//EMOTE_STATE_WORK - break; - case 14: - pInstance->SetData(DATA_GATE_SR,0); - me->setFaction(11); - break; - case 16: - me->Say(SAY_WINDSOR_9, LANG_UNIVERSAL, PlayerGUID); - break; - case 17: - me->HandleEmoteCommand(EMOTE_STATE_USESTANDING);//EMOTE_STATE_WORK - break; - case 18: - pInstance->SetData(DATA_GATE_SC,0); - break; - case 19: - me->SetVisibility(VISIBILITY_OFF); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->SummonCreature(MOB_ENTRY_REGINALD_WINDSOR,403.61,-51.71,-63.92,3.600434,TEMPSUMMON_DEAD_DESPAWN ,0); - pInstance->SetData(DATA_SUPPLY_ROOM, ENCOUNTER_STATE_ENDED); - break; - } - } - - void EnterCombat(Unit* who) - { - switch (urand(0,2)) - { - case 0: me->Say(SAY_WINDSOR_AGGRO1, LANG_UNIVERSAL, PlayerGUID); break; - case 1: me->Say(SAY_WINDSOR_AGGRO2, LANG_UNIVERSAL, PlayerGUID); break; - case 2: me->Say(SAY_WINDSOR_AGGRO3, LANG_UNIVERSAL, PlayerGUID); break; - } - } - - void Reset() {} - - void JustDied(Unit *slayer) - { - pInstance->SetData(DATA_QUEST_JAIL_BREAK,ENCOUNTER_STATE_FAILED); - } - - void UpdateAI(const uint32 diff) - { - if (pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) return; - if (pInstance->GetData(DATA_DUGHAL) == ENCOUNTER_STATE_OBJECTIVE_COMPLETED) - SetEscortPaused(false); - if (!pInstance->GetData(DATA_GATE_D) && pInstance->GetData(DATA_DUGHAL) == ENCOUNTER_STATE_NOT_STARTED) - { - me->Say(SAY_WINDSOR_4_2, LANG_UNIVERSAL, PlayerGUID); - pInstance->SetData(DATA_DUGHAL, ENCOUNTER_STATE_BEFORE_START); - } - if (pInstance->GetData(DATA_DUGHAL) == ENCOUNTER_STATE_OBJECTIVE_COMPLETED) - { - me->Say(SAY_WINDSOR_4_3, LANG_UNIVERSAL, PlayerGUID); - pInstance->SetData(DATA_DUGHAL, ENCOUNTER_STATE_ENDED); - } - if ((pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_IN_PROGRESS || pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_FAILED || pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_ENDED)&& pInstance->GetData(DATA_SUPPLY_ROOM) == ENCOUNTER_STATE_ENDED) - { - me->SetVisibility(VISIBILITY_OFF); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - } - else - { - me->SetVisibility(VISIBILITY_ON); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - } - npc_escortAI::UpdateAI(diff); - } -}; -CreatureAI* GetAI_npc_marshal_windsor(Creature* pCreature) -{ - npc_marshal_windsorAI* marshal_windsorAI = new npc_marshal_windsorAI(pCreature); - - marshal_windsorAI->AddWaypoint(0, 316.336,-225.528, -77.7258,7000); - marshal_windsorAI->AddWaypoint(1, 316.336,-225.528, -77.7258,2000); - marshal_windsorAI->AddWaypoint(2, 322.96,-207.13, -77.87,0); - marshal_windsorAI->AddWaypoint(3, 281.05,-172.16, -75.12,0); - marshal_windsorAI->AddWaypoint(4, 272.19,-139.14, -70.61,0); - marshal_windsorAI->AddWaypoint(5, 283.62,-116.09, -70.21,0); - marshal_windsorAI->AddWaypoint(6, 296.18,-94.30, -74.08,0); - marshal_windsorAI->AddWaypoint(7, 294.57,-93.11, -74.08,0); - marshal_windsorAI->AddWaypoint(8, 314.31,-74.31, -76.09,0); - marshal_windsorAI->AddWaypoint(9, 360.22,-62.93, -66.77,0); - marshal_windsorAI->AddWaypoint(10, 383.38,-69.40, -63.25,0); - marshal_windsorAI->AddWaypoint(11, 389.99,-67.86, -62.57,0); - marshal_windsorAI->AddWaypoint(12, 400.98,-72.01, -62.31,0); - marshal_windsorAI->AddWaypoint(13, 404.22,-62.30, -63.50,2300); - marshal_windsorAI->AddWaypoint(14, 404.22,-62.30, -63.50,1500); - marshal_windsorAI->AddWaypoint(15, 407.65,-51.86, -63.96,0); - marshal_windsorAI->AddWaypoint(16, 403.61,-51.71, -63.92,1000); - marshal_windsorAI->AddWaypoint(17, 403.61,-51.71, -63.92,2000); - marshal_windsorAI->AddWaypoint(18, 403.61,-51.71, -63.92,1000); - marshal_windsorAI->AddWaypoint(19, 403.61,-51.71, -63.92,0); - - return marshal_windsorAI; -} - -bool QuestAccept_npc_marshal_windsor(Player* pPlayer, Creature* pCreature, Quest const *quest) -{ - if (quest->GetQuestId() == 4322) - {PlayerStart = player; - if (pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) - { - CAST_AI(npc_escortAI, (pCreature->AI()))->Start(true, false, pPlayer->GetGUID()); - pInstance->SetData(DATA_QUEST_JAIL_BREAK,ENCOUNTER_STATE_IN_PROGRESS); - pCreature->setFaction(11); - } - - } - return false; -} - */ -/*###### -## npc_marshal_reginald_windsor -######*/ - -#define SAY_REGINALD_WINDSOR_0_1 "Can you feel the power, $N??? It's time to ROCK!" -#define SAY_REGINALD_WINDSOR_0_2 "Now we just have to free Tobias and we can get out of here. This way!" -#define SAY_REGINALD_WINDSOR_5_1 "Open it." -#define SAY_REGINALD_WINDSOR_5_2 "I never did like those two. Let's get moving." -#define SAY_REGINALD_WINDSOR_7_1 "Open it and be careful this time!" -#define SAY_REGINALD_WINDSOR_7_2 "That intolerant dirtbag finally got what was coming to him. Good riddance!" -#define SAY_REGINALD_WINDSOR_7_3 "Alright, let's go." -#define SAY_REGINALD_WINDSOR_13_1 "Open it. We need to hurry up. I can smell those Dark Irons coming a mile away and I can tell you one thing, they're COMING!" -#define SAY_REGINALD_WINDSOR_13_2 "Administering fists of fury on Crest Killer!" -#define SAY_REGINALD_WINDSOR_13_3 "He has to be in the last cell. Unless... they killed him." -#define SAY_REGINALD_WINDSOR_14_1 "Get him out of there!" -#define SAY_REGINALD_WINDSOR_14_2 "Excellent work, $N. Let's find the exit. I think I know the way. Follow me!" -#define SAY_REGINALD_WINDSOR_20_1 "We made it!" -#define SAY_REGINALD_WINDSOR_20_2 "Meet me at Maxwell's encampment. We'll go over the next stages of the plan there and figure out a way to decode my tablets without the decryption ring." -#define MOB_ENTRY_SHILL_DINGER 9678 -#define MOB_ENTRY_CREST_KILLER 9680 - -int wp = 0; -/* -struct npc_marshal_reginald_windsorAI : public npc_escortAI -{ - npc_marshal_reginald_windsorAI(Creature *c) : npc_escortAI(c) - { - } - - void WaypointReached(uint32 i) - { - wp=i; - switch(i) - { - case 0: - me->setFaction(11); - me->Say(SAY_REGINALD_WINDSOR_0_1, LANG_UNIVERSAL, PlayerGUID); - break; - case 1: - me->Say(SAY_REGINALD_WINDSOR_0_2, LANG_UNIVERSAL, PlayerGUID); - break; - case 7: - me->HandleEmoteCommand(EMOTE_STATE_POINT); - me->Say(SAY_REGINALD_WINDSOR_5_1, LANG_UNIVERSAL, PlayerGUID); - IsOnHold=true; - break; - case 8: - me->Say(SAY_REGINALD_WINDSOR_5_2, LANG_UNIVERSAL, PlayerGUID); - break; - case 11: - me->HandleEmoteCommand(EMOTE_STATE_POINT); - me->Say(SAY_REGINALD_WINDSOR_7_1, LANG_UNIVERSAL, PlayerGUID); - IsOnHold=true; - break; - case 12: - me->Say(SAY_REGINALD_WINDSOR_7_2, LANG_UNIVERSAL, PlayerGUID); - break; - case 13: - me->Say(SAY_REGINALD_WINDSOR_7_3, LANG_UNIVERSAL, PlayerGUID); - break; - case 20: - me->HandleEmoteCommand(EMOTE_STATE_POINT); - me->Say(SAY_REGINALD_WINDSOR_13_1, LANG_UNIVERSAL, PlayerGUID); - IsOnHold=true; - break; - case 21: - me->Say(SAY_REGINALD_WINDSOR_13_3, LANG_UNIVERSAL, PlayerGUID); - break; - case 23: - me->HandleEmoteCommand(EMOTE_STATE_POINT); - me->Say(SAY_REGINALD_WINDSOR_14_1, LANG_UNIVERSAL, PlayerGUID); - IsOnHold=true; - break; - case 24: - me->Say(SAY_REGINALD_WINDSOR_14_2, LANG_UNIVERSAL, PlayerGUID); - break; - case 31: - me->Say(SAY_REGINALD_WINDSOR_20_1, LANG_UNIVERSAL, PlayerGUID); - break; - case 32: - me->Say(SAY_REGINALD_WINDSOR_20_2, LANG_UNIVERSAL, PlayerGUID); - PlayerStart->GroupEventHappens(QUEST_JAIL_BREAK, me); - pInstance->SetData(DATA_SHILL, ENCOUNTER_STATE_ENDED); - break; - } - } - - void MoveInLineOfSight(Unit *who) - { - if (HasEscortState(STATE_ESCORT_ESCORTING)) - return; - - if (who->GetTypeId() == TYPEID_PLAYER) - { - if (CAST_PLR(who)->GetQuestStatus(4322) == QUEST_STATUS_INCOMPLETE) - { - float Radius = 10.0; - if (me->IsWithinDistInMap(who, Radius)) - { - SetEscortPaused(false); - Start(true, false, who->GetGUID()); - } - } - } - } - - void EnterCombat(Unit* who) - { - switch (urand(0,2)) - { - case 0: me->Say(SAY_WINDSOR_AGGRO1, LANG_UNIVERSAL, PlayerGUID); break; - case 1: me->Say(SAY_WINDSOR_AGGRO2, LANG_UNIVERSAL, PlayerGUID); break; - case 2: me->Say(SAY_WINDSOR_AGGRO3, LANG_UNIVERSAL, PlayerGUID); break; - } - } - void Reset() {} - - void JustDied(Unit *slayer) - { - pInstance->SetData(DATA_QUEST_JAIL_BREAK,ENCOUNTER_STATE_FAILED); - } - - void UpdateAI(const uint32 diff) - { - if (pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) return; - if (wp == 7) - { - if (!pInstance->GetData(DATA_GATE_J) && pInstance->GetData(DATA_JAZ) == ENCOUNTER_STATE_NOT_STARTED) - { - pInstance->SetData(DATA_CREATURE_JAZ,1); - pInstance->SetData(DATA_JAZ,ENCOUNTER_STATE_IN_PROGRESS); - } - if (pInstance->GetData(DATA_CREATURE_JAZ) && pInstance->GetData(DATA_CREATURE_OGRABISI) && pInstance->GetData(DATA_JAZ) == ENCOUNTER_STATE_IN_PROGRESS) - { - SetEscortPaused(false); - pInstance->SetData(DATA_JAZ,ENCOUNTER_STATE_ENDED); - } - } - else if (wp == 11) - { - if (!pInstance->GetData(DATA_GATE_S) && pInstance->GetData(DATA_SHILL) == ENCOUNTER_STATE_NOT_STARTED) - { - pInstance->SetData(DATA_CREATURE_SHILL,1); - pInstance->SetData(DATA_SHILL,ENCOUNTER_STATE_IN_PROGRESS); - } - if (pInstance->GetData(DATA_CREATURE_SHILL) && pInstance->GetData(DATA_SHILL) == ENCOUNTER_STATE_IN_PROGRESS) - { - pInstance->SetData(DATA_SHILL,ENCOUNTER_STATE_ENDED); - SetEscortPaused(false); - } - } - else if (wp == 20) - { - if (!pInstance->GetData(DATA_GATE_C) && pInstance->GetData(DATA_CREST) == ENCOUNTER_STATE_NOT_STARTED) - { - pInstance->SetData(DATA_CREATURE_CREST,1); - me->Say(SAY_REGINALD_WINDSOR_13_2, LANG_UNIVERSAL, PlayerGUID); - pInstance->SetData(DATA_CREST,ENCOUNTER_STATE_IN_PROGRESS); - } - if (pInstance->GetData(DATA_CREATURE_CREST) && pInstance->GetData(DATA_CREST) == ENCOUNTER_STATE_IN_PROGRESS) - { - SetEscortPaused(false); - pInstance->SetData(DATA_CREST,ENCOUNTER_STATE_ENDED); - } - } - if (pInstance->GetData(DATA_TOBIAS) == ENCOUNTER_STATE_OBJECTIVE_COMPLETED) SetEscortPaused(false); - npc_escortAI::UpdateAI(diff); - } -}; -CreatureAI* GetAI_npc_marshal_reginald_windsor(Creature* pCreature) -{ - npc_marshal_reginald_windsorAI* marshal_reginald_windsorAI = new npc_marshal_reginald_windsorAI(pCreature); - - marshal_reginald_windsorAI->AddWaypoint(0, 403.61,-52.71, -63.92,4000); - marshal_reginald_windsorAI->AddWaypoint(1, 403.61,-52.71, -63.92,4000); - marshal_reginald_windsorAI->AddWaypoint(2, 406.33,-54.87, -63.95,0); - marshal_reginald_windsorAI->AddWaypoint(3, 407.99,-73.91, -62.26,0); - marshal_reginald_windsorAI->AddWaypoint(4, 557.03,-119.71, -61.83,0); - marshal_reginald_windsorAI->AddWaypoint(5, 573.40,-124.39, -65.07,0); - marshal_reginald_windsorAI->AddWaypoint(6, 593.91,-130.29, -69.25,0); - marshal_reginald_windsorAI->AddWaypoint(7, 593.21,-132.16, -69.25,0); - marshal_reginald_windsorAI->AddWaypoint(8, 593.21,-132.16, -69.25,3000); - marshal_reginald_windsorAI->AddWaypoint(9, 622.81,-135.55, -71.92,0); - marshal_reginald_windsorAI->AddWaypoint(10, 634.68,-151.29, -70.32,0); - marshal_reginald_windsorAI->AddWaypoint(11, 635.06,-153.25, -70.32,0); - marshal_reginald_windsorAI->AddWaypoint(12, 635.06,-153.25, -70.32,3000); - marshal_reginald_windsorAI->AddWaypoint(13, 635.06,-153.25, -70.32,1500); - marshal_reginald_windsorAI->AddWaypoint(14, 655.25,-172.39, -73.72,0); - marshal_reginald_windsorAI->AddWaypoint(15, 654.79,-226.30, -83.06,0); - marshal_reginald_windsorAI->AddWaypoint(16, 622.85,-268.85, -83.96,0); - marshal_reginald_windsorAI->AddWaypoint(17, 579.45,-275.56, -80.44,0); - marshal_reginald_windsorAI->AddWaypoint(18, 561.19,-266.85, -75.59,0); - marshal_reginald_windsorAI->AddWaypoint(19, 547.91,-253.92, -70.34,0); - marshal_reginald_windsorAI->AddWaypoint(20, 549.20,-252.40, -70.34,0); - marshal_reginald_windsorAI->AddWaypoint(21, 549.20,-252.40, -70.34,4000); - marshal_reginald_windsorAI->AddWaypoint(22, 555.33,-269.16, -74.40,0); - marshal_reginald_windsorAI->AddWaypoint(23, 554.31,-270.88, -74.40,0); - marshal_reginald_windsorAI->AddWaypoint(24, 554.31,-270.88, -74.40,4000); - marshal_reginald_windsorAI->AddWaypoint(25, 536.10,-249.60, -67.47,0); - marshal_reginald_windsorAI->AddWaypoint(26, 520.94,-216.65, -59.28,0); - marshal_reginald_windsorAI->AddWaypoint(27, 505.99,-148.74, -62.17,0); - marshal_reginald_windsorAI->AddWaypoint(28, 484.21,-56.24, -62.43,0); - marshal_reginald_windsorAI->AddWaypoint(29, 470.39,-6.01, -70.10,0); - marshal_reginald_windsorAI->AddWaypoint(30, 451.27,30.85, -70.07,0); - marshal_reginald_windsorAI->AddWaypoint(31, 452.45,29.85, -70.37,1500); - marshal_reginald_windsorAI->AddWaypoint(32, 452.45,29.85, -70.37,7000); - marshal_reginald_windsorAI->AddWaypoint(33, 452.45,29.85, -70.37,10000); - marshal_reginald_windsorAI->AddWaypoint(34, 451.27,31.85, -70.07,0); - - return marshal_reginald_windsorAI; -} -*/ -/*###### -## npc_tobias_seecher -######*/ - -#define SAY_TOBIAS_FREE "Thank you! I will run for safety immediately!" -/* -struct npc_tobias_seecherAI : public npc_escortAI -{ - npc_tobias_seecherAI(Creature *c) :npc_escortAI(c) {} - - void EnterCombat(Unit* who) {} - void Reset() {} - - void JustDied(Unit* killer) - { - if (IsBeingEscorted && killer == me) - { - me->SetVisibility(VISIBILITY_OFF); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - pInstance->SetData(DATA_TOBIAS,ENCOUNTER_STATE_ENDED); - } - } - - void WaypointReached(uint32 i) - { - switch(i) - { - case 0:me->Say(SAY_TOBIAS_FREE, LANG_UNIVERSAL, PlayerGUID); break; - case 2: - pInstance->SetData(DATA_TOBIAS,ENCOUNTER_STATE_OBJECTIVE_COMPLETED);break; - case 4: - me->SetVisibility(VISIBILITY_OFF); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - pInstance->SetData(DATA_TOBIAS,ENCOUNTER_STATE_ENDED); - break; - } - } - - void UpdateAI(const uint32 diff) - { - if (pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) return; - if ((pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_IN_PROGRESS || pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_FAILED || pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_ENDED)&& pInstance->GetData(DATA_TOBIAS) == ENCOUNTER_STATE_ENDED) - { - me->SetVisibility(VISIBILITY_OFF); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - } - else - { - me->SetVisibility(VISIBILITY_ON); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - } - npc_escortAI::UpdateAI(diff); - } -}; - -CreatureAI* GetAI_npc_tobias_seecher(Creature* pCreature) -{ - npc_tobias_seecherAI* tobias_seecherAI = new npc_tobias_seecherAI(pCreature); - - tobias_seecherAI->AddWaypoint(0, 549.21, -281.07, -75.27); - tobias_seecherAI->AddWaypoint(1, 554.39, -267.39, -73.68); - tobias_seecherAI->AddWaypoint(2, 533.59, -249.38, -67.04); - tobias_seecherAI->AddWaypoint(3, 519.44, -217.02, -59.34); - tobias_seecherAI->AddWaypoint(4, 506.55, -153.49, -62.34); - - return tobias_seecherAI; -} - -bool GossipHello_npc_tobias_seecher(Player* pPlayer, Creature* pCreature) -{ - if (pPlayer->GetQuestStatus(QUEST_JAIL_BREAK) == QUEST_STATUS_INCOMPLETE && pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_IN_PROGRESS) - { - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Get out of here, Tobias, you're free!", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - pPlayer->SEND_GOSSIP_MENU(2847, pCreature->GetGUID()); - } - return true; -} - -bool GossipSelect_npc_tobias_seecher(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) - { - pPlayer->CLOSE_GOSSIP_MENU(); - CAST_AI(npc_escortAI, (pCreature->AI()))->Start(false, true, pPlayer->GetGUID()); - pCreature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - pInstance->SetData(DATA_TOBIAS,ENCOUNTER_STATE_IN_PROGRESS); - } - return true; -} -*/ - -/*###### -## npc_rocknot -######*/ - -enum RocknotSays -{ - SAY_GOT_BEER = -1230000 -}; - -enum RocknotSpells -{ - SPELL_DRUNKEN_RAGE = 14872 -}; - -enum RocknotQuests -{ - QUEST_ALE = 4295 -}; - -struct npc_rocknotAI : public npc_escortAI -{ - npc_rocknotAI(Creature *c) : npc_escortAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint32 BreakKeg_Timer; - uint32 BreakDoor_Timer; - - void Reset() - { - if (HasEscortState(STATE_ESCORT_ESCORTING)) - return; - - BreakKeg_Timer = 0; - BreakDoor_Timer = 0; - } - - void DoGo(uint32 id, uint32 state) - { - if (GameObject* pGo = pInstance->instance->GetGameObject(pInstance->GetData64(id))) - pGo->SetGoState((GOState)state); - } - - void WaypointReached(uint32 i) - { - if (!pInstance) - return; - - switch(i) - { - case 1: - me->HandleEmoteCommand(EMOTE_ONESHOT_KICK); - break; - case 2: - me->HandleEmoteCommand(EMOTE_ONESHOT_ATTACKUNARMED); - break; - case 3: - me->HandleEmoteCommand(EMOTE_ONESHOT_ATTACKUNARMED); - break; - case 4: - me->HandleEmoteCommand(EMOTE_ONESHOT_KICK); - break; - case 5: - me->HandleEmoteCommand(EMOTE_ONESHOT_KICK); - BreakKeg_Timer = 2000; - break; - } - } - - void UpdateAI(const uint32 diff) - { - if (!pInstance) - return; - - if (BreakKeg_Timer) - { - if (BreakKeg_Timer <= diff) - { - DoGo(DATA_GO_BAR_KEG,0); - BreakKeg_Timer = 0; - BreakDoor_Timer = 1000; - } else BreakKeg_Timer -= diff; - } - - if (BreakDoor_Timer) - { - if (BreakDoor_Timer <= diff) - { - DoGo(DATA_GO_BAR_DOOR,2); - DoGo(DATA_GO_BAR_KEG_TRAP,0); //doesn't work very well, leaving code here for future - //spell by trap has effect61, this indicate the bar go hostile - - if (Unit *tmp = Unit::GetUnit(*me,pInstance->GetData64(DATA_PHALANX))) - tmp->setFaction(14); - - //for later, this event(s) has alot more to it. - //optionally, DONE can trigger bar to go hostile. - pInstance->SetData(TYPE_BAR,DONE); - - BreakDoor_Timer = 0; - } else BreakDoor_Timer -= diff; - } - - npc_escortAI::UpdateAI(diff); - } -}; - -CreatureAI* GetAI_npc_rocknot(Creature* pCreature) -{ - return new npc_rocknotAI(pCreature); -} - -bool ChooseReward_npc_rocknot(Player* /*pPlayer*/, Creature* pCreature, const Quest *_Quest, uint32 /*item*/) -{ - ScriptedInstance* pInstance = pCreature->GetInstanceData(); - - if (!pInstance) - return true; - - if (pInstance->GetData(TYPE_BAR) == DONE || pInstance->GetData(TYPE_BAR) == SPECIAL) - return true; - - if (_Quest->GetQuestId() == QUEST_ALE) - { - if (pInstance->GetData(TYPE_BAR) != IN_PROGRESS) - pInstance->SetData(TYPE_BAR,IN_PROGRESS); - - pInstance->SetData(TYPE_BAR,SPECIAL); - - //keep track of amount in instance script, returns SPECIAL if amount ok and event in progress - if (pInstance->GetData(TYPE_BAR) == SPECIAL) - { - DoScriptText(SAY_GOT_BEER, pCreature); - pCreature->CastSpell(pCreature,SPELL_DRUNKEN_RAGE,false); - if (npc_escortAI* pEscortAI = CAST_AI(npc_rocknotAI, pCreature->AI())) - pEscortAI->Start(false, false); - } - } - - return true; -} - -/*###### -## -######*/ - -void AddSC_blackrock_depths() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "go_shadowforge_brazier"; - newscript->pGOHello = &GOHello_go_shadowforge_brazier; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "at_ring_of_law"; - newscript->pAreaTrigger = &AreaTrigger_at_ring_of_law; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_grimstone"; - newscript->GetAI = &GetAI_npc_grimstone; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_phalanx"; - newscript->GetAI = &GetAI_mob_phalanx; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_kharan_mighthammer"; - newscript->pGossipHello = &GossipHello_npc_kharan_mighthammer; - newscript->pGossipSelect = &GossipSelect_npc_kharan_mighthammer; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_lokhtos_darkbargainer"; - newscript->pGossipHello = &GossipHello_npc_lokhtos_darkbargainer; - newscript->pGossipSelect = &GossipSelect_npc_lokhtos_darkbargainer; - newscript->RegisterSelf(); -/* - newscript = new Script; - newscript->Name = "npc_dughal_stormwing"; - newscript->pGossipHello = &GossipHello_npc_dughal_stormwing; - newscript->pGossipSelect = &GossipSelect_npc_dughal_stormwing; - newscript->GetAI = &GetAI_npc_dughal_stormwing; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_tobias_seecher"; - newscript->pGossipHello = &GossipHello_npc_tobias_seecher; - newscript->pGossipSelect = &GossipSelect_npc_tobias_seecher; - newscript->GetAI = &GetAI_npc_tobias_seecher; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_marshal_windsor"; - newscript->pQuestAccept = &QuestAccept_npc_marshal_windsor; - newscript->GetAI = &GetAI_npc_marshal_windsor; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_marshal_reginald_windsor"; - newscript->GetAI = &GetAI_npc_marshal_reginald_windsor; - newscript->RegisterSelf(); -*/ - newscript = new Script; - newscript->Name = "npc_rocknot"; - newscript->GetAI = &GetAI_npc_rocknot; - newscript->pChooseReward = &ChooseReward_npc_rocknot; - newscript->RegisterSelf(); -} diff --git a/src/server/scripts/EasternKingdoms/blackrock_depths/blackrock_depths.h b/src/server/scripts/EasternKingdoms/blackrock_depths/blackrock_depths.h deleted file mode 100644 index edb340252b2..00000000000 --- a/src/server/scripts/EasternKingdoms/blackrock_depths/blackrock_depths.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_BRD_H -#define DEF_BRD_H - -#define FACTION_NEUTRAL 734 -#define FACTION_HOSTILE 754 -#define FACTION_FRIEND 35 - -enum eTypes -{ - TYPE_RING_OF_LAW = 1, - TYPE_VAULT = 2, - TYPE_BAR = 3, - TYPE_TOMB_OF_SEVEN = 4, - TYPE_LYCEUM = 5, - TYPE_IRON_HALL = 6, - - DATA_EMPEROR = 10, - DATA_PHALANX = 11, - - DATA_ARENA1 = 12, - DATA_ARENA2 = 13, - DATA_ARENA3 = 14, - DATA_ARENA4 = 15, - - DATA_GO_BAR_KEG = 16, - DATA_GO_BAR_KEG_TRAP = 17, - DATA_GO_BAR_DOOR = 18, - DATA_GO_CHALICE = 19, - - DATA_GHOSTKILL = 20, - DATA_EVENSTARTER = 21, - - DATA_GOLEM_DOOR_N = 22, - DATA_GOLEM_DOOR_S = 23, - - DATA_THRONE_DOOR = 24, - - DATA_SF_BRAZIER_N = 25, - DATA_SF_BRAZIER_S = 26 -}; -#endif diff --git a/src/server/scripts/EasternKingdoms/blackrock_depths/boss_ambassador_flamelash.cpp b/src/server/scripts/EasternKingdoms/blackrock_depths/boss_ambassador_flamelash.cpp deleted file mode 100644 index a387e816951..00000000000 --- a/src/server/scripts/EasternKingdoms/blackrock_depths/boss_ambassador_flamelash.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: Boss_Ambassador_Flamelash -SD%Complete: 100 -SDComment: -SDCategory: Blackrock Depths -EndScriptData */ - -#include "ScriptedPch.h" - -enum Spells -{ - SPELL_FIREBLAST = 15573 -}; - -struct boss_ambassador_flamelashAI : public ScriptedAI -{ - boss_ambassador_flamelashAI(Creature *c) : ScriptedAI(c) {} - - uint32 FireBlast_Timer; - uint32 Spirit_Timer; - - void Reset() - { - FireBlast_Timer = 2000; - Spirit_Timer = 24000; - } - - void EnterCombat(Unit * /*who*/) {} - - void SummonSpirits(Unit* victim) - { - if (Creature *Spirit = DoSpawnCreature(9178, irand(-9,9), irand(-9,9), 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000)) - Spirit->AI()->AttackStart(victim); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //FireBlast_Timer - if (FireBlast_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_FIREBLAST); - FireBlast_Timer = 7000; - } else FireBlast_Timer -= diff; - - //Spirit_Timer - if (Spirit_Timer <= diff) - { - SummonSpirits(me->getVictim()); - SummonSpirits(me->getVictim()); - SummonSpirits(me->getVictim()); - SummonSpirits(me->getVictim()); - - Spirit_Timer = 30000; - } else Spirit_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_ambassador_flamelash(Creature* pCreature) -{ - return new boss_ambassador_flamelashAI (pCreature); -} - -void AddSC_boss_ambassador_flamelash() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_ambassador_flamelash"; - newscript->GetAI = &GetAI_boss_ambassador_flamelash; - newscript->RegisterSelf(); -} diff --git a/src/server/scripts/EasternKingdoms/blackrock_depths/boss_anubshiah.cpp b/src/server/scripts/EasternKingdoms/blackrock_depths/boss_anubshiah.cpp deleted file mode 100644 index 60e1dec236c..00000000000 --- a/src/server/scripts/EasternKingdoms/blackrock_depths/boss_anubshiah.cpp +++ /dev/null @@ -1,116 +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_Anubshiah -SD%Complete: 100 -SDComment: -SDCategory: Blackrock Depths -EndScriptData */ - -#include "ScriptedPch.h" - -enum Spells -{ - SPELL_SHADOWBOLT = 17228, - SPELL_CURSEOFTONGUES = 15470, - SPELL_CURSEOFWEAKNESS = 17227, - SPELL_DEMONARMOR = 11735, - SPELL_ENVELOPINGWEB = 15471 -}; - -struct boss_anubshiahAI : public ScriptedAI -{ - boss_anubshiahAI(Creature *c) : ScriptedAI(c) {} - - uint32 ShadowBolt_Timer; - uint32 CurseOfTongues_Timer; - uint32 CurseOfWeakness_Timer; - uint32 DemonArmor_Timer; - uint32 EnvelopingWeb_Timer; - - void Reset() - { - ShadowBolt_Timer = 7000; - CurseOfTongues_Timer = 24000; - CurseOfWeakness_Timer = 12000; - DemonArmor_Timer = 3000; - EnvelopingWeb_Timer = 16000; - } - - void EnterCombat(Unit * /*who*/) - { - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //ShadowBolt_Timer - if (ShadowBolt_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SHADOWBOLT); - ShadowBolt_Timer = 7000; - } else ShadowBolt_Timer -= diff; - - //CurseOfTongues_Timer - if (CurseOfTongues_Timer <= diff) - { - if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) - DoCast(pTarget, SPELL_CURSEOFTONGUES); - CurseOfTongues_Timer = 18000; - } else CurseOfTongues_Timer -= diff; - - //CurseOfWeakness_Timer - if (CurseOfWeakness_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_CURSEOFWEAKNESS); - CurseOfWeakness_Timer = 45000; - } else CurseOfWeakness_Timer -= diff; - - //DemonArmor_Timer - if (DemonArmor_Timer <= diff) - { - DoCast(me, SPELL_DEMONARMOR); - DemonArmor_Timer = 300000; - } else DemonArmor_Timer -= diff; - - //EnvelopingWeb_Timer - if (EnvelopingWeb_Timer <= diff) - { - if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) - DoCast(pTarget, SPELL_ENVELOPINGWEB); - EnvelopingWeb_Timer = 12000; - } else EnvelopingWeb_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_anubshiah(Creature* pCreature) -{ - return new boss_anubshiahAI (pCreature); -} - -void AddSC_boss_anubshiah() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_anubshiah"; - newscript->GetAI = &GetAI_boss_anubshiah; - newscript->RegisterSelf(); -} diff --git a/src/server/scripts/EasternKingdoms/blackrock_depths/boss_emperor_dagran_thaurissan.cpp b/src/server/scripts/EasternKingdoms/blackrock_depths/boss_emperor_dagran_thaurissan.cpp deleted file mode 100644 index 29fe219d6ec..00000000000 --- a/src/server/scripts/EasternKingdoms/blackrock_depths/boss_emperor_dagran_thaurissan.cpp +++ /dev/null @@ -1,111 +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_Emperor_Dagran_Thaurissan -SD%Complete: 99 -SDComment: -SDCategory: Blackrock Depths -EndScriptData */ - -#include "ScriptedPch.h" - -enum Yells -{ - SAY_AGGRO = -1230001, - SAY_SLAY = -1230002 -}; - -enum Spells -{ - SPELL_HANDOFTHAURISSAN = 17492, - SPELL_AVATAROFFLAME = 15636 -}; - -struct boss_draganthaurissanAI : public ScriptedAI -{ - boss_draganthaurissanAI(Creature *c) : ScriptedAI(c) {} - - uint32 HandOfThaurissan_Timer; - uint32 AvatarOfFlame_Timer; - //uint32 Counter; - - void Reset() - { - HandOfThaurissan_Timer = 4000; - AvatarOfFlame_Timer = 25000; - //Counter= 0; - } - - void EnterCombat(Unit * /*who*/) - { - DoScriptText(SAY_AGGRO, me); - me->CallForHelp(VISIBLE_RANGE); - } - - void KilledUnit(Unit* /*victim*/) - { - DoScriptText(SAY_SLAY, me); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - if (HandOfThaurissan_Timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(pTarget, SPELL_HANDOFTHAURISSAN); - - //3 Hands of Thaurissan will be casted - //if (Counter < 3) - //{ - // HandOfThaurissan_Timer = 1000; - // ++Counter; - //} - //else - //{ - HandOfThaurissan_Timer = 5000; - //Counter = 0; - //} - } else HandOfThaurissan_Timer -= diff; - - //AvatarOfFlame_Timer - if (AvatarOfFlame_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_AVATAROFFLAME); - AvatarOfFlame_Timer = 18000; - } else AvatarOfFlame_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_draganthaurissan(Creature* pCreature) -{ - return new boss_draganthaurissanAI (pCreature); -} - -void AddSC_boss_draganthaurissan() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_emperor_dagran_thaurissan"; - newscript->GetAI = &GetAI_boss_draganthaurissan; - newscript->RegisterSelf(); -} diff --git a/src/server/scripts/EasternKingdoms/blackrock_depths/boss_general_angerforge.cpp b/src/server/scripts/EasternKingdoms/blackrock_depths/boss_general_angerforge.cpp deleted file mode 100644 index 77d69263133..00000000000 --- a/src/server/scripts/EasternKingdoms/blackrock_depths/boss_general_angerforge.cpp +++ /dev/null @@ -1,132 +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_General_Angerforge -SD%Complete: 100 -SDComment: -SDCategory: Blackrock Depths -EndScriptData */ - -#include "ScriptedPch.h" - -enum Spells -{ - SPELL_MIGHTYBLOW = 14099, - SPELL_HAMSTRING = 9080, - SPELL_CLEAVE = 20691 -}; - -struct boss_general_angerforgeAI : public ScriptedAI -{ - boss_general_angerforgeAI(Creature *c) : ScriptedAI(c) {} - - uint32 MightyBlow_Timer; - uint32 HamString_Timer; - uint32 Cleave_Timer; - uint32 Adds_Timer; - bool Medics; - - void Reset() - { - MightyBlow_Timer = 8000; - HamString_Timer = 12000; - Cleave_Timer = 16000; - Adds_Timer = 0; - Medics = false; - } - - void EnterCombat(Unit * /*who*/) - { - } - - void SummonAdds(Unit* victim) - { - if (Creature *SummonedAdd = DoSpawnCreature(8901, irand(-14,14), irand(-14,14), 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 120000)) - SummonedAdd->AI()->AttackStart(victim); - } - - void SummonMedics(Unit* victim) - { - if (Creature *SummonedMedic = DoSpawnCreature(8894, irand(-9,9), irand(-9,9), 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 120000)) - SummonedMedic->AI()->AttackStart(victim); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //MightyBlow_Timer - if (MightyBlow_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_MIGHTYBLOW); - MightyBlow_Timer = 18000; - } else MightyBlow_Timer -= diff; - - //HamString_Timer - if (HamString_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_HAMSTRING); - HamString_Timer = 15000; - } else HamString_Timer -= diff; - - //Cleave_Timer - if (Cleave_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_CLEAVE); - Cleave_Timer = 9000; - } else Cleave_Timer -= diff; - - //Adds_Timer - if (me->GetHealth()*100 / me->GetMaxHealth() < 21) - { - if (Adds_Timer <= diff) - { - // summon 3 Adds every 25s - SummonAdds(me->getVictim()); - SummonAdds(me->getVictim()); - SummonAdds(me->getVictim()); - - Adds_Timer = 25000; - } else Adds_Timer -= diff; - } - - //Summon Medics - if (!Medics && me->GetHealth()*100 / me->GetMaxHealth() < 21) - { - SummonMedics(me->getVictim()); - SummonMedics(me->getVictim()); - Medics = true; - } - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_general_angerforge(Creature* pCreature) -{ - return new boss_general_angerforgeAI (pCreature); -} - -void AddSC_boss_general_angerforge() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_general_angerforge"; - newscript->GetAI = &GetAI_boss_general_angerforge; - newscript->RegisterSelf(); -} diff --git a/src/server/scripts/EasternKingdoms/blackrock_depths/boss_gorosh_the_dervish.cpp b/src/server/scripts/EasternKingdoms/blackrock_depths/boss_gorosh_the_dervish.cpp deleted file mode 100644 index 886bc3fc909..00000000000 --- a/src/server/scripts/EasternKingdoms/blackrock_depths/boss_gorosh_the_dervish.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: Boss_Gorosh_the_Dervish -SD%Complete: 100 -SDComment: -SDCategory: Blackrock Depths -EndScriptData */ - -#include "ScriptedPch.h" - -enum Spells -{ - SPELL_WHIRLWIND = 15589, - SPELL_MORTALSTRIKE = 24573 -}; - -struct boss_gorosh_the_dervishAI : public ScriptedAI -{ - boss_gorosh_the_dervishAI(Creature *c) : ScriptedAI(c) {} - - uint32 WhirlWind_Timer; - uint32 MortalStrike_Timer; - - void Reset() - { - WhirlWind_Timer = 12000; - MortalStrike_Timer = 22000; - } - - void EnterCombat(Unit * /*who*/) - { - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //WhirlWind_Timer - if (WhirlWind_Timer <= diff) - { - DoCast(me, SPELL_WHIRLWIND); - WhirlWind_Timer = 15000; - } else WhirlWind_Timer -= diff; - - //MortalStrike_Timer - if (MortalStrike_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_MORTALSTRIKE); - MortalStrike_Timer = 15000; - } else MortalStrike_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_gorosh_the_dervish(Creature* pCreature) -{ - return new boss_gorosh_the_dervishAI (pCreature); -} - -void AddSC_boss_gorosh_the_dervish() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_gorosh_the_dervish"; - newscript->GetAI = &GetAI_boss_gorosh_the_dervish; - newscript->RegisterSelf(); -} diff --git a/src/server/scripts/EasternKingdoms/blackrock_depths/boss_grizzle.cpp b/src/server/scripts/EasternKingdoms/blackrock_depths/boss_grizzle.cpp deleted file mode 100644 index d3551d38790..00000000000 --- a/src/server/scripts/EasternKingdoms/blackrock_depths/boss_grizzle.cpp +++ /dev/null @@ -1,94 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 .sourceforge.net/> - * 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_Grizzle -SD%Complete: 100 -SDComment: -SDCategory: Blackrock Depths -EndScriptData */ - -#include "ScriptedPch.h" - -enum Yells -{ - EMOTE_GENERIC_FRENZY_KILL = -1000001 -}; - -enum Spells -{ - SPELL_GROUNDTREMOR = 6524, - SPELL_FRENZY = 28371 -}; - -struct boss_grizzleAI : public ScriptedAI -{ - boss_grizzleAI(Creature *c) : ScriptedAI(c) {} - - uint32 GroundTremor_Timer; - uint32 Frenzy_Timer; - - void Reset() - { - GroundTremor_Timer = 12000; - Frenzy_Timer =0; - } - - void EnterCombat(Unit * /*who*/) - { - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //GroundTremor_Timer - if (GroundTremor_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_GROUNDTREMOR); - GroundTremor_Timer = 8000; - } else GroundTremor_Timer -= diff; - - //Frenzy_Timer - if (me->GetHealth()*100 / me->GetMaxHealth() < 51) - { - if (Frenzy_Timer <= diff) - { - DoCast(me, SPELL_FRENZY); - DoScriptText(EMOTE_GENERIC_FRENZY_KILL, me); - - Frenzy_Timer = 15000; - } else Frenzy_Timer -= diff; - } - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_grizzle(Creature* pCreature) -{ - return new boss_grizzleAI (pCreature); -} - -void AddSC_boss_grizzle() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_grizzle"; - newscript->GetAI = &GetAI_boss_grizzle; - newscript->RegisterSelf(); -} diff --git a/src/server/scripts/EasternKingdoms/blackrock_depths/boss_high_interrogator_gerstahn.cpp b/src/server/scripts/EasternKingdoms/blackrock_depths/boss_high_interrogator_gerstahn.cpp deleted file mode 100644 index 2af203826a1..00000000000 --- a/src/server/scripts/EasternKingdoms/blackrock_depths/boss_high_interrogator_gerstahn.cpp +++ /dev/null @@ -1,106 +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_Interrogator_Gerstahn -SD%Complete: 100 -SDComment: -SDCategory: Blackrock Depths -EndScriptData */ - -#include "ScriptedPch.h" - -enum Spells -{ - SPELL_SHADOWWORDPAIN = 10894, - SPELL_MANABURN = 10876, - SPELL_PSYCHICSCREAM = 8122, - SPELL_SHADOWSHIELD = 22417 -}; - -struct boss_high_interrogator_gerstahnAI : public ScriptedAI -{ - boss_high_interrogator_gerstahnAI(Creature *c) : ScriptedAI(c) {} - - uint32 ShadowWordPain_Timer; - uint32 ManaBurn_Timer; - uint32 PsychicScream_Timer; - uint32 ShadowShield_Timer; - - void Reset() - { - ShadowWordPain_Timer = 4000; - ManaBurn_Timer = 14000; - PsychicScream_Timer = 32000; - ShadowShield_Timer = 8000; - } - - void EnterCombat(Unit * /*who*/) - { - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //ShadowWordPain_Timer - if (ShadowWordPain_Timer <= diff) - { - if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) - DoCast(pTarget, SPELL_SHADOWWORDPAIN); - ShadowWordPain_Timer = 7000; - } else ShadowWordPain_Timer -= diff; - - //ManaBurn_Timer - if (ManaBurn_Timer <= diff) - { - if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) - DoCast(pTarget, SPELL_MANABURN); - ManaBurn_Timer = 10000; - } else ManaBurn_Timer -= diff; - - //PsychicScream_Timer - if (PsychicScream_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_PSYCHICSCREAM); - PsychicScream_Timer = 30000; - } else PsychicScream_Timer -= diff; - - //ShadowShield_Timer - if (ShadowShield_Timer <= diff) - { - DoCast(me, SPELL_SHADOWSHIELD); - ShadowShield_Timer = 25000; - } else ShadowShield_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_high_interrogator_gerstahn(Creature* pCreature) -{ - return new boss_high_interrogator_gerstahnAI (pCreature); -} - -void AddSC_boss_high_interrogator_gerstahn() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_high_interrogator_gerstahn"; - newscript->GetAI = &GetAI_boss_high_interrogator_gerstahn; - newscript->RegisterSelf(); -} diff --git a/src/server/scripts/EasternKingdoms/blackrock_depths/boss_magmus.cpp b/src/server/scripts/EasternKingdoms/blackrock_depths/boss_magmus.cpp deleted file mode 100644 index 2a0cf9be133..00000000000 --- a/src/server/scripts/EasternKingdoms/blackrock_depths/boss_magmus.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: Boss_Magmus -SD%Complete: 100 -SDComment: -SDCategory: Blackrock Depths -EndScriptData */ - -#include "ScriptedPch.h" - -enum Spells -{ - SPELL_FIERYBURST = 13900, - SPELL_WARSTOMP = 24375 -}; - -enum eEnums -{ - DATA_THRONE_DOOR = 24 // not id or guid of doors but number of enum in blackrock_depths.h -}; - -struct boss_magmusAI : public ScriptedAI -{ - boss_magmusAI(Creature *c) : ScriptedAI(c) {} - - uint32 FieryBurst_Timer; - uint32 WarStomp_Timer; - - void Reset() - { - FieryBurst_Timer = 5000; - WarStomp_Timer =0; - } - - void EnterCombat(Unit * /*who*/) - { - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //FieryBurst_Timer - if (FieryBurst_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_FIERYBURST); - FieryBurst_Timer = 6000; - } else FieryBurst_Timer -= diff; - - //WarStomp_Timer - if (me->GetHealth()*100 / me->GetMaxHealth() < 51) - { - if (WarStomp_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_WARSTOMP); - WarStomp_Timer = 8000; - } else WarStomp_Timer -= diff; - } - - DoMeleeAttackIfReady(); - } - // When he die open door to last chamber - void JustDied(Unit *who) - { - if (ScriptedInstance* pInstance = who->GetInstanceData()) - pInstance->HandleGameObject(pInstance->GetData64(DATA_THRONE_DOOR), true); - } -}; -CreatureAI* GetAI_boss_magmus(Creature* pCreature) -{ - return new boss_magmusAI (pCreature); -} - -void AddSC_boss_magmus() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_magmus"; - newscript->GetAI = &GetAI_boss_magmus; - newscript->RegisterSelf(); -} diff --git a/src/server/scripts/EasternKingdoms/blackrock_depths/boss_moira_bronzebeard.cpp b/src/server/scripts/EasternKingdoms/blackrock_depths/boss_moira_bronzebeard.cpp deleted file mode 100644 index 1c0ed389287..00000000000 --- a/src/server/scripts/EasternKingdoms/blackrock_depths/boss_moira_bronzebeard.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: Boss_Moira_Bronzbeard -SD%Complete: 90 -SDComment: Healing of Emperor NYI -SDCategory: Blackrock Depths -EndScriptData */ - -#include "ScriptedPch.h" - -enum Spells -{ - SPELL_HEAL = 10917, - SPELL_RENEW = 10929, - SPELL_SHIELD = 10901, - SPELL_MINDBLAST = 10947, - SPELL_SHADOWWORDPAIN = 10894, - SPELL_SMITE = 10934 -}; - -struct boss_moira_bronzebeardAI : public ScriptedAI -{ - boss_moira_bronzebeardAI(Creature *c) : ScriptedAI(c) {} - - uint32 Heal_Timer; - uint32 MindBlast_Timer; - uint32 ShadowWordPain_Timer; - uint32 Smite_Timer; - - void Reset() - { - Heal_Timer = 12000; //These times are probably wrong - MindBlast_Timer = 16000; - ShadowWordPain_Timer = 2000; - Smite_Timer = 8000; - } - - void EnterCombat(Unit * /*who*/) - { - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //MindBlast_Timer - if (MindBlast_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_MINDBLAST); - MindBlast_Timer = 14000; - } else MindBlast_Timer -= diff; - - //ShadowWordPain_Timer - if (ShadowWordPain_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SHADOWWORDPAIN); - ShadowWordPain_Timer = 18000; - } else ShadowWordPain_Timer -= diff; - - //Smite_Timer - if (Smite_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SMITE); - Smite_Timer = 10000; - } else Smite_Timer -= diff; - - } -}; -CreatureAI* GetAI_boss_moira_bronzebeard(Creature* pCreature) -{ - return new boss_moira_bronzebeardAI (pCreature); -} - -void AddSC_boss_moira_bronzebeard() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_moira_bronzebeard"; - newscript->GetAI = &GetAI_boss_moira_bronzebeard; - newscript->RegisterSelf(); -} diff --git a/src/server/scripts/EasternKingdoms/blackrock_depths/boss_tomb_of_seven.cpp b/src/server/scripts/EasternKingdoms/blackrock_depths/boss_tomb_of_seven.cpp deleted file mode 100644 index 94a37e8da7e..00000000000 --- a/src/server/scripts/EasternKingdoms/blackrock_depths/boss_tomb_of_seven.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: Boss_Tomb_Of_Seven -SD%Complete: 90 -SDComment: Learning Smelt Dark Iron if tribute quest rewarded. Missing event. -SDCategory: Blackrock Depths -EndScriptData */ - -#include "ScriptedPch.h" -#include "blackrock_depths.h" - -enum Spells -{ - SPELL_SMELT_DARK_IRON = 14891, - SPELL_LEARN_SMELT = 14894, -}; - -enum Quests -{ - QUEST_SPECTRAL_CHALICE = 4083 -}; - -enum Misc -{ - DATA_SKILLPOINT_MIN = 230 -}; - -#define GOSSIP_ITEM_TEACH_1 "Teach me the art of smelting dark iron" -#define GOSSIP_ITEM_TEACH_2 "Continue..." -#define GOSSIP_ITEM_TEACH_3 "[PH] Continue..." -#define GOSSIP_ITEM_TRIBUTE "I want to pay tribute" - -bool GossipHello_boss_gloomrel(Player* pPlayer, Creature* pCreature) -{ - if (pPlayer->GetQuestRewardStatus(QUEST_SPECTRAL_CHALICE) == 1 && pPlayer->GetSkillValue(SKILL_MINING) >= DATA_SKILLPOINT_MIN && !pPlayer->HasSpell(SPELL_SMELT_DARK_IRON)) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TEACH_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - - if (pPlayer->GetQuestRewardStatus(QUEST_SPECTRAL_CHALICE) == 0 && pPlayer->GetSkillValue(SKILL_MINING) >= DATA_SKILLPOINT_MIN) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TRIBUTE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - - pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); - return true; -} - -bool GossipSelect_boss_gloomrel(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction) -{ - switch (uiAction) - { - case GOSSIP_ACTION_INFO_DEF+1: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TEACH_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11); - pPlayer->SEND_GOSSIP_MENU(2606, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+11: - pPlayer->CLOSE_GOSSIP_MENU(); - pCreature->CastSpell(pPlayer, SPELL_LEARN_SMELT, false); - break; - case GOSSIP_ACTION_INFO_DEF+2: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TEACH_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 22); - pPlayer->SEND_GOSSIP_MENU(2604, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+22: - pPlayer->CLOSE_GOSSIP_MENU(); - if (ScriptedInstance* pInstance = pCreature->GetInstanceData()) - { - //are 5 minutes expected? go template may have data to despawn when used at quest - pInstance->DoRespawnGameObject(pInstance->GetData64(DATA_GO_CHALICE),MINUTE*5); - } - break; - } - return true; -} - -enum DoomrelSpells -{ - SPELL_SHADOWBOLTVOLLEY = 15245, - SPELL_IMMOLATE = 12742, - SPELL_CURSEOFWEAKNESS = 12493, - SPELL_DEMONARMOR = 13787, - SPELL_SUMMON_VOIDWALKERS = 15092 -}; - -struct boss_doomrelAI : public ScriptedAI -{ - boss_doomrelAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - uint32 ShadowVolley_Timer; - uint32 Immolate_Timer; - uint32 CurseOfWeakness_Timer; - uint32 DemonArmor_Timer; - bool Voidwalkers; - - void Reset() - { - ShadowVolley_Timer = 10000; - Immolate_Timer = 18000; - CurseOfWeakness_Timer = 5000; - DemonArmor_Timer = 16000; - Voidwalkers = false; - - me->setFaction(FACTION_FRIEND); - - // was set before event start, so set again - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); - - if (pInstance) - if (pInstance->GetData(DATA_GHOSTKILL) >= 7) - me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE); - else - me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - } - - void EnterCombat(Unit * /*who*/) - { - } - - void EnterEvadeMode() - { - me->RemoveAllAuras(); - me->DeleteThreatList(); - me->CombatStop(true); - me->LoadCreaturesAddon(); - if (me->isAlive()) - me->GetMotionMaster()->MoveTargetedHome(); - me->SetLootRecipient(NULL); - if (pInstance) - pInstance->SetData64(DATA_EVENSTARTER, 0); - } - - void JustDied(Unit * /*who*/) - { - if (pInstance) - pInstance->SetData(DATA_GHOSTKILL, 1); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //ShadowVolley_Timer - if (ShadowVolley_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SHADOWBOLTVOLLEY); - ShadowVolley_Timer = 12000; - } else ShadowVolley_Timer -= diff; - - //Immolate_Timer - if (Immolate_Timer <= diff) - { - if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) - DoCast(pTarget, SPELL_IMMOLATE); - - Immolate_Timer = 25000; - } else Immolate_Timer -= diff; - - //CurseOfWeakness_Timer - if (CurseOfWeakness_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_CURSEOFWEAKNESS); - CurseOfWeakness_Timer = 45000; - } else CurseOfWeakness_Timer -= diff; - - //DemonArmor_Timer - if (DemonArmor_Timer <= diff) - { - DoCast(me, SPELL_DEMONARMOR); - DemonArmor_Timer = 300000; - } else DemonArmor_Timer -= diff; - - //Summon Voidwalkers - if (!Voidwalkers && me->GetHealth()*100 / me->GetMaxHealth() < 51) - { - DoCast(me->getVictim(), SPELL_SUMMON_VOIDWALKERS, true); - Voidwalkers = true; - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_doomrel(Creature* pCreature) -{ - return new boss_doomrelAI (pCreature); -} - -#define GOSSIP_ITEM_CHALLENGE "Your bondage is at an end, Doom'rel. I challenge you!" -#define GOSSIP_SELECT_DOOMREL "[PH] Continue..." - -bool GossipHello_boss_doomrel(Player* pPlayer, Creature* pCreature) -{ - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_CHALLENGE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - pPlayer->SEND_GOSSIP_MENU(2601, pCreature->GetGUID()); - - return true; -} - -bool GossipSelect_boss_doomrel(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction) -{ - switch (uiAction) - { - case GOSSIP_ACTION_INFO_DEF+1: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_DOOMREL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - pPlayer->SEND_GOSSIP_MENU(2605, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - pPlayer->CLOSE_GOSSIP_MENU(); - //start event here - pCreature->setFaction(FACTION_HOSTILE); - pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); - pCreature->AI()->AttackStart(pPlayer); - ScriptedInstance* pInstance = pCreature->GetInstanceData(); - if (pInstance) - pInstance->SetData64(DATA_EVENSTARTER,pPlayer->GetGUID()); - break; - } - return true; -} - -void AddSC_boss_tomb_of_seven() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "boss_gloomrel"; - newscript->pGossipHello = &GossipHello_boss_gloomrel; - newscript->pGossipSelect = &GossipSelect_boss_gloomrel; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_doomrel"; - newscript->GetAI = &GetAI_boss_doomrel; - newscript->pGossipHello = &GossipHello_boss_doomrel; - newscript->pGossipSelect = &GossipSelect_boss_doomrel; - newscript->RegisterSelf(); -} diff --git a/src/server/scripts/EasternKingdoms/blackrock_depths/instance_blackrock_depths.cpp b/src/server/scripts/EasternKingdoms/blackrock_depths/instance_blackrock_depths.cpp deleted file mode 100644 index 7684aa6c6ac..00000000000 --- a/src/server/scripts/EasternKingdoms/blackrock_depths/instance_blackrock_depths.cpp +++ /dev/null @@ -1,460 +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_Blackrock_Depths -SD%Complete: 100 -SDComment: -SDCategory: Blackrock Depths -EndScriptData */ - -/* -update `creature_template` set `npcflag`='1',`ScriptName`='npc_dughal_stormwing' where `entry`='9022'; -update `creature_template` set `ScriptName`='npc_marshal_windsor' where `entry`='9023'; -update `creature_template` set `ScriptName`='npc_marshal_reginald_windsor' where `entry`='9682'; -update `creature_template` set `npcflag`='1',`ScriptName`='npc_tobias_seecher' where `entry`='9679'; -update `instance_template` set `script`='instance_blackrock_depths' where `map`='230'; -*/ - -#include "ScriptedPch.h" -#include "blackrock_depths.h" - -#define TIMER_TOMBOFTHESEVEN 15000 - -enum eEnums -{ - MAX_ENCOUNTER = 6, - - NPC_EMPEROR = 9019, - NPC_PHALANX = 9502, - NPC_ANGERREL = 9035, - NPC_DOPEREL = 9040, - NPC_HATEREL = 9034, - NPC_VILEREL = 9036, - NPC_SEETHREL = 9038, - NPC_GLOOMREL = 9037, - NPC_DOOMREL = 9039, - NPC_MAGMUS = 9938, - - GO_ARENA1 = 161525, - GO_ARENA2 = 161522, - GO_ARENA3 = 161524, - GO_ARENA4 = 161523, - GO_SHADOW_LOCK = 161460, - GO_SHADOW_MECHANISM = 161461, - GO_SHADOW_GIANT_DOOR = 157923, - GO_SHADOW_DUMMY = 161516, - GO_BAR_KEG_SHOT = 170607, - GO_BAR_KEG_TRAP = 171941, - GO_BAR_DOOR = 170571, - GO_TOMB_ENTER = 170576, - GO_TOMB_EXIT = 170577, - GO_LYCEUM = 170558, - GO_SF_N = 174745, // Shadowforge Brazier North - GO_SF_S = 174744, // Shadowforge Brazier South - GO_GOLEM_ROOM_N = 170573, // Magmus door North - GO_GOLEM_ROOM_S = 170574, // Magmus door Soutsh - GO_THRONE_ROOM = 170575, // Throne door - - GO_SPECTRAL_CHALICE = 164869, - GO_CHEST_SEVEN = 169243 -}; - -struct instance_blackrock_depths : public ScriptedInstance -{ - instance_blackrock_depths(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - std::string str_data; - - uint64 EmperorGUID; - uint64 PhalanxGUID; - uint64 MagmusGUID; - - uint64 GoArena1GUID; - uint64 GoArena2GUID; - uint64 GoArena3GUID; - uint64 GoArena4GUID; - uint64 GoShadowLockGUID; - uint64 GoShadowMechGUID; - uint64 GoShadowGiantGUID; - uint64 GoShadowDummyGUID; - uint64 GoBarKegGUID; - uint64 GoBarKegTrapGUID; - uint64 GoBarDoorGUID; - uint64 GoTombEnterGUID; - uint64 GoTombExitGUID; - uint64 GoLyceumGUID; - uint64 GoSFSGUID; - uint64 GoSFNGUID; - uint64 GoGolemNGUID; - uint64 GoGolemSGUID; - uint64 GoThroneGUID; - uint64 GoChestGUID; - - uint32 BarAleCount; - uint32 GhostKillCount; - uint64 TombBossGUIDs[7]; - uint64 TombEventStarterGUID; - uint32 TombTimer; - uint32 TombEventCounter; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - EmperorGUID = 0; - PhalanxGUID = 0; - MagmusGUID = 0; - - GoArena1GUID = 0; - GoArena2GUID = 0; - GoArena3GUID = 0; - GoArena4GUID = 0; - GoShadowLockGUID = 0; - GoShadowMechGUID = 0; - GoShadowGiantGUID = 0; - GoShadowDummyGUID = 0; - GoBarKegGUID = 0; - GoBarKegTrapGUID = 0; - GoBarDoorGUID = 0; - GoTombEnterGUID = 0; - GoTombExitGUID = 0; - GoLyceumGUID = 0; - GoSFSGUID = 0; - GoSFNGUID = 0; - GoGolemNGUID = 0; - GoGolemSGUID = 0; - GoThroneGUID = 0; - GoChestGUID = 0; - - BarAleCount = 0; - GhostKillCount = 0; - TombEventStarterGUID = 0; - TombTimer = TIMER_TOMBOFTHESEVEN; - TombEventCounter = 0; - - for (uint8 i = 0; i < 7; ++i) - TombBossGUIDs[i] = 0; - } - - void OnCreatureCreate(Creature* pCreature, bool /*add*/) - { - switch(pCreature->GetEntry()) - { - case NPC_EMPEROR: EmperorGUID = pCreature->GetGUID(); break; - case NPC_PHALANX: PhalanxGUID = pCreature->GetGUID(); break; - case NPC_DOOMREL: TombBossGUIDs[0] = pCreature->GetGUID(); break; - case NPC_DOPEREL: TombBossGUIDs[1] = pCreature->GetGUID(); break; - case NPC_HATEREL: TombBossGUIDs[2] = pCreature->GetGUID(); break; - case NPC_VILEREL: TombBossGUIDs[3] = pCreature->GetGUID(); break; - case NPC_SEETHREL: TombBossGUIDs[4] = pCreature->GetGUID(); break; - case NPC_GLOOMREL: TombBossGUIDs[5] = pCreature->GetGUID(); break; - case NPC_ANGERREL: TombBossGUIDs[6] = pCreature->GetGUID(); break; - case NPC_MAGMUS: - MagmusGUID = pCreature->GetGUID(); - if (!pCreature->isAlive()) - HandleGameObject(GetData64(DATA_THRONE_DOOR), true); // if Magmus is dead open door to last boss - break; - } - } - - void OnGameObjectCreate(GameObject* pGo, bool /*add*/) - { - switch(pGo->GetEntry()) - { - case GO_ARENA1: GoArena1GUID = pGo->GetGUID(); break; - case GO_ARENA2: GoArena2GUID = pGo->GetGUID(); break; - case GO_ARENA3: GoArena3GUID = pGo->GetGUID(); break; - case GO_ARENA4: GoArena4GUID = pGo->GetGUID(); break; - case GO_SHADOW_LOCK: GoShadowLockGUID = pGo->GetGUID(); break; - case GO_SHADOW_MECHANISM: GoShadowMechGUID = pGo->GetGUID(); break; - case GO_SHADOW_GIANT_DOOR: GoShadowGiantGUID = pGo->GetGUID(); break; - case GO_SHADOW_DUMMY: GoShadowDummyGUID = pGo->GetGUID(); break; - case GO_BAR_KEG_SHOT: GoBarKegGUID = pGo->GetGUID(); break; - case GO_BAR_KEG_TRAP: GoBarKegTrapGUID = pGo->GetGUID(); break; - case GO_BAR_DOOR: GoBarDoorGUID = pGo->GetGUID(); break; - case GO_TOMB_ENTER: GoTombEnterGUID = pGo->GetGUID(); break; - case GO_TOMB_EXIT: - GoTombExitGUID = pGo->GetGUID(); - if (GhostKillCount >= 7) - HandleGameObject(0, true, pGo); - else - HandleGameObject(0, false, pGo); - break; - case GO_LYCEUM: GoLyceumGUID = pGo->GetGUID(); break; - case GO_SF_S: GoSFSGUID = pGo->GetGUID(); break; - case GO_SF_N: GoSFNGUID = pGo->GetGUID(); break; - case GO_GOLEM_ROOM_N: GoGolemNGUID = pGo->GetGUID(); break; - case GO_GOLEM_ROOM_S: GoGolemSGUID = pGo->GetGUID(); break; - case GO_THRONE_ROOM: GoThroneGUID = pGo->GetGUID(); break; - case GO_CHEST_SEVEN: GoChestGUID = pGo->GetGUID(); break; - } - } - - void SetData64(uint32 type, uint64 data) - { - debug_log("TSCR: Instance Blackrock Depths: SetData64 update (Type: %u Data %u)", type, data); - - switch(type) - { - case DATA_EVENSTARTER: - TombEventStarterGUID = data; - if (!TombEventStarterGUID) - TombOfSevenReset();//reset - else - TombOfSevenStart();//start - break; - } - } - - void SetData(uint32 type, uint32 data) - { - debug_log("TSCR: Instance Blackrock Depths: SetData update (Type: %u Data %u)", type, data); - - switch(type) - { - case TYPE_RING_OF_LAW: - m_auiEncounter[0] = data; - break; - case TYPE_VAULT: - m_auiEncounter[1] = data; - break; - case TYPE_BAR: - if (data == SPECIAL) - ++BarAleCount; - else - m_auiEncounter[2] = data; - break; - case TYPE_TOMB_OF_SEVEN: - m_auiEncounter[3] = data; - break; - case TYPE_LYCEUM: - m_auiEncounter[4] = data; - break; - case TYPE_IRON_HALL: - m_auiEncounter[5] = data; - break; - case DATA_GHOSTKILL: - GhostKillCount += data; - break; - } - - if (data == DONE || GhostKillCount >= 7) - { - 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] << " " << GhostKillCount; - - str_data = saveStream.str(); - - SaveToDB(); - OUT_SAVE_INST_DATA_COMPLETE; - } - } - - uint32 GetData(uint32 type) - { - switch(type) - { - case TYPE_RING_OF_LAW: - return m_auiEncounter[0]; - case TYPE_VAULT: - return m_auiEncounter[1]; - case TYPE_BAR: - if (m_auiEncounter[2] == IN_PROGRESS && BarAleCount == 3) - return SPECIAL; - else - return m_auiEncounter[2]; - case TYPE_TOMB_OF_SEVEN: - return m_auiEncounter[3]; - case TYPE_LYCEUM: - return m_auiEncounter[4]; - case TYPE_IRON_HALL: - return m_auiEncounter[5]; - case DATA_GHOSTKILL: - return GhostKillCount; - } - return 0; - } - - uint64 GetData64(uint32 data) - { - switch(data) - { - case DATA_EMPEROR: - return EmperorGUID; - case DATA_PHALANX: - return PhalanxGUID; - case DATA_ARENA1: - return GoArena1GUID; - case DATA_ARENA2: - return GoArena2GUID; - case DATA_ARENA3: - return GoArena3GUID; - case DATA_ARENA4: - return GoArena4GUID; - case DATA_GO_BAR_KEG: - return GoBarKegGUID; - case DATA_GO_BAR_KEG_TRAP: - return GoBarKegTrapGUID; - case DATA_GO_BAR_DOOR: - return GoBarDoorGUID; - case DATA_EVENSTARTER: - return TombEventStarterGUID; - case DATA_SF_BRAZIER_N: - return GoSFNGUID; - case DATA_SF_BRAZIER_S: - return GoSFSGUID; - case DATA_THRONE_DOOR: - return GoThroneGUID; - case DATA_GOLEM_DOOR_N: - return GoGolemNGUID; - case DATA_GOLEM_DOOR_S: - return GoGolemSGUID; - } - 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] >> GhostKillCount; - - for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) - m_auiEncounter[i] = NOT_STARTED; - if (GhostKillCount > 0 && GhostKillCount < 7) - GhostKillCount = 0;//reset tomb of seven event - if (GhostKillCount >= 7) - GhostKillCount = 7; - - OUT_LOAD_INST_DATA_COMPLETE; - } - - void TombOfSevenEvent() - { - if (GhostKillCount < 7 && TombBossGUIDs[TombEventCounter]) - { - if (Creature* boss = instance->GetCreature(TombBossGUIDs[TombEventCounter])) - { - boss->setFaction(FACTION_HOSTILE); - boss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); - if (Unit *pTarget = boss->SelectNearestTarget(500)) - boss->AI()->AttackStart(pTarget); - } - } - } - - void TombOfSevenReset() - { - HandleGameObject(GoTombExitGUID,false);//event reseted, close exit door - HandleGameObject(GoTombEnterGUID,true);//event reseted, open entrance door - for (uint8 i = 0; i < 7; ++i) - { - if (Creature* boss = instance->GetCreature(TombBossGUIDs[i])) - { - if (!boss->isAlive()) - {//do not call EnterEvadeMode(), it will create infinit loops - boss->Respawn(); - boss->RemoveAllAuras(); - boss->DeleteThreatList(); - boss->CombatStop(true); - boss->LoadCreaturesAddon(); - boss->GetMotionMaster()->MoveTargetedHome(); - boss->SetLootRecipient(NULL); - } - boss->setFaction(FACTION_FRIEND); - } - } - GhostKillCount = 0; - TombEventStarterGUID = 0; - TombEventCounter = 0; - TombTimer = TIMER_TOMBOFTHESEVEN; - SetData(TYPE_TOMB_OF_SEVEN, NOT_STARTED); - } - - void TombOfSevenStart() - { - HandleGameObject(GoTombExitGUID,false);//event started, close exit door - HandleGameObject(GoTombEnterGUID,false);//event started, close entrance door - SetData(TYPE_TOMB_OF_SEVEN, IN_PROGRESS); - } - - void TombOfSevenEnd() - { - DoRespawnGameObject(GoChestGUID,DAY); - HandleGameObject(GoTombExitGUID,true);//event done, open exit door - HandleGameObject(GoTombEnterGUID,true);//event done, open entrance door - TombEventStarterGUID = 0; - SetData(TYPE_TOMB_OF_SEVEN, DONE); - } - void Update(uint32 diff) - { - if (TombEventStarterGUID && GhostKillCount < 7) - { - if (TombTimer <= diff) - { - TombTimer = TIMER_TOMBOFTHESEVEN; - ++TombEventCounter; - TombOfSevenEvent(); - // Check Killed bosses - for (uint8 i = 0; i < 7; ++i) - { - if (Creature* boss = instance->GetCreature(TombBossGUIDs[i])) - { - if (!boss->isAlive()) - { - GhostKillCount = i+1; - } - } - } - } else TombTimer -= diff; - } - if (GhostKillCount >= 7 && TombEventStarterGUID) - TombOfSevenEnd(); - } -}; - -InstanceData* GetInstanceData_instance_blackrock_depths(Map* pMap) -{ - return new instance_blackrock_depths(pMap); -} - - void AddSC_instance_blackrock_depths() - { - Script *newscript; - newscript = new Script; - newscript->Name = "instance_blackrock_depths"; - newscript->GetInstanceData = &GetInstanceData_instance_blackrock_depths; - newscript->RegisterSelf(); - } diff --git a/src/server/scripts/EasternKingdoms/blackrock_spire/blackrock_spire.cpp b/src/server/scripts/EasternKingdoms/blackrock_spire/blackrock_spire.cpp deleted file mode 100644 index 2ea115e6e0b..00000000000 --- a/src/server/scripts/EasternKingdoms/blackrock_spire/blackrock_spire.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/* Copyright (C) 2008 - 2010 TrinityCore - * 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 - */ - -#include "ScriptedPch.h" -#include "blackrock_spire.h" - -enum Creatures -{ - NPC_ROOKERY_WHELP = 10161 -}; - -struct npc_rookey_whelpAI : public ScriptedAI -{ - npc_rookey_whelpAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - void JustDied(Unit * /*who*/) - { - if (pInstance) - pInstance->SetData(WHELP_DEATH_COUNT, pInstance->GetData(WHELP_DEATH_COUNT)+1); - } - - void UpdateAI(const uint32 /*diff*/) - { - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_rookey_whelp(Creature* pCreature) -{ - return new npc_rookey_whelpAI(pCreature); -} - -bool GOHello_rookey_egg(Player *pPlayer, GameObject * /*pGO*/) -{ - Position pos; - pPlayer->GetPosition(&pos); - pPlayer->SummonCreature(NPC_ROOKERY_WHELP, pos, TEMPSUMMON_TIMED_DESPAWN, 15*IN_MILISECONDS); - //destroy gobject need to be implemented - - return true; -}; - -void AddSC_blackrock_spire() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "npc_rookey_whelp"; - newscript->GetAI = &GetAI_rookey_whelp; - newscript->RegisterSelf(); - newscript = new Script; - - newscript->Name = "go_rookey_egg"; - newscript->pGOHello = &GOHello_rookey_egg; - newscript->RegisterSelf(); -} diff --git a/src/server/scripts/EasternKingdoms/blackrock_spire/blackrock_spire.h b/src/server/scripts/EasternKingdoms/blackrock_spire/blackrock_spire.h deleted file mode 100644 index 56b6e0cbe23..00000000000 --- a/src/server/scripts/EasternKingdoms/blackrock_spire/blackrock_spire.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Copyright (C) 2008 - 2010 TrinityCore - * 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 - */ - -#ifndef DEF_BRS_H -#define DEF_BRS_H - -enum Data -{ - EVENT_LEEEROY, - WHELP_DEATH_COUNT -}; - -#endif diff --git a/src/server/scripts/EasternKingdoms/blackrock_spire/boss_drakkisath.cpp b/src/server/scripts/EasternKingdoms/blackrock_spire/boss_drakkisath.cpp deleted file mode 100644 index b53ddaf23ef..00000000000 --- a/src/server/scripts/EasternKingdoms/blackrock_spire/boss_drakkisath.cpp +++ /dev/null @@ -1,102 +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_Drakkisath -SD%Complete: 100 -SDComment: -SDCategory: Blackrock Spire -EndScriptData */ - -#include "ScriptedPch.h" - -#define SPELL_FIRENOVA 23462 -#define SPELL_CLEAVE 20691 -#define SPELL_CONFLIGURATION 16805 -#define SPELL_THUNDERCLAP 15548 //Not sure if right ID. 23931 would be a harder possibility. - -struct boss_drakkisathAI : public ScriptedAI -{ - boss_drakkisathAI(Creature *c) : ScriptedAI(c) {} - - uint32 FireNova_Timer; - uint32 Cleave_Timer; - uint32 Confliguration_Timer; - uint32 Thunderclap_Timer; - - void Reset() - { - FireNova_Timer = 6000; - Cleave_Timer = 8000; - Confliguration_Timer = 15000; - Thunderclap_Timer = 17000; - } - - void EnterCombat(Unit * /*who*/) - { - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //FireNova_Timer - if (FireNova_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_FIRENOVA); - FireNova_Timer = 10000; - } else FireNova_Timer -= diff; - - //Cleave_Timer - if (Cleave_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_CLEAVE); - Cleave_Timer = 8000; - } else Cleave_Timer -= diff; - - //Confliguration_Timer - if (Confliguration_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_CONFLIGURATION); - Confliguration_Timer = 18000; - } else Confliguration_Timer -= diff; - - //Thunderclap_Timer - if (Thunderclap_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_THUNDERCLAP); - Thunderclap_Timer = 20000; - } else Thunderclap_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_drakkisath(Creature* pCreature) -{ - return new boss_drakkisathAI (pCreature); -} - -void AddSC_boss_drakkisath() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_drakkisath"; - newscript->GetAI = &GetAI_boss_drakkisath; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/blackrock_spire/boss_gyth.cpp b/src/server/scripts/EasternKingdoms/blackrock_spire/boss_gyth.cpp deleted file mode 100644 index fcd2ea1a6d0..00000000000 --- a/src/server/scripts/EasternKingdoms/blackrock_spire/boss_gyth.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_Gyth -SD%Complete: 100 -SDComment: -SDCategory: Blackrock Spire -EndScriptData */ - -#include "ScriptedPch.h" - -#define SPELL_CORROSIVEACID 20667 -#define SPELL_FREEZE 18763 -#define SPELL_FLAMEBREATH 20712 - -struct boss_gythAI : public ScriptedAI -{ - boss_gythAI(Creature *c) : ScriptedAI(c) {} - - uint32 Aggro_Timer; - uint32 Dragons_Timer; - uint32 Orc_Timer; - uint32 CorrosiveAcid_Timer; - uint32 Freeze_Timer; - uint32 Flamebreath_Timer; - uint32 Line1Count; - uint32 Line2Count; - - bool Event; - bool SummonedDragons; - bool SummonedOrcs; - bool SummonedRend; - bool bAggro; - bool RootSelf; - - void Reset() - { - Dragons_Timer = 3000; - Orc_Timer = 60000; - Aggro_Timer = 60000; - CorrosiveAcid_Timer = 8000; - Freeze_Timer = 11000; - Flamebreath_Timer = 4000; - Event = false; - SummonedDragons = false; - SummonedOrcs= false; - SummonedRend = false; - bAggro = false; - RootSelf = false; - - // how many times should the two lines of summoned creatures be spawned - // min 2 x 2, max 7 lines of attack in total - Line1Count = rand() % 4 + 2; - if (Line1Count < 5) - Line2Count = rand() % (5 - Line1Count) + 2; - else - Line2Count = 2; - - //Invisible for event start - me->SetDisplayId(11686); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - } - - void EnterCombat(Unit * /*who*/) - { - } - - void SummonCreatureWithRandomTarget(uint32 creatureId) - { - Unit* Summoned = me->SummonCreature(creatureId, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 240000); - if (Summoned) - { - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (pTarget) - Summoned->AddThreat(pTarget, 1.0f); - } - } - - void UpdateAI(const uint32 diff) - { - //char buf[200]; - - //Return since we have no target - if (!UpdateVictim()) - return; - - if (!RootSelf) - { - //me->m_canMove = true; - DoCast(me, 33356); - RootSelf = true; - } - - if (!bAggro && Line1Count == 0 && Line2Count == 0) - { - if (Aggro_Timer <= diff) - { - bAggro = true; - // Visible now! - me->SetDisplayId(9723); - me->setFaction(14); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - } else Aggro_Timer -= diff; - } - - // Summon Dragon pack. 2 Dragons and 3 Whelps - if (!bAggro && !SummonedRend && Line1Count > 0) - { - if (Dragons_Timer <= diff) - { - SummonCreatureWithRandomTarget(10372); - SummonCreatureWithRandomTarget(10372); - SummonCreatureWithRandomTarget(10442); - SummonCreatureWithRandomTarget(10442); - SummonCreatureWithRandomTarget(10442); - Line1Count = Line1Count - 1; - Dragons_Timer = 60000; - } else Dragons_Timer -= diff; - } - - //Summon Orc pack. 1 Orc Handler 1 Elite Dragonkin and 3 Whelps - if (!bAggro && !SummonedRend && Line1Count == 0 && Line2Count > 0) - { - if (Orc_Timer <= diff) - { - SummonCreatureWithRandomTarget(10447); - SummonCreatureWithRandomTarget(10317); - SummonCreatureWithRandomTarget(10442); - SummonCreatureWithRandomTarget(10442); - SummonCreatureWithRandomTarget(10442); - Line2Count = Line2Count - 1; - Orc_Timer = 60000; - } else Orc_Timer -= diff; - } - - // we take part in the fight - if (bAggro) - { - // CorrosiveAcid_Timer - if (CorrosiveAcid_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_CORROSIVEACID); - CorrosiveAcid_Timer = 7000; - } else CorrosiveAcid_Timer -= diff; - - // Freeze_Timer - if (Freeze_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_FREEZE); - Freeze_Timer = 16000; - } else Freeze_Timer -= diff; - - // Flamebreath_Timer - if (Flamebreath_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_FLAMEBREATH); - Flamebreath_Timer = 10500; - } else Flamebreath_Timer -= diff; - - //Summon Rend - if (!SummonedRend && me->GetHealth()*100 / me->GetMaxHealth() < 11 - && me->GetHealth() > 0) - { - //summon Rend and Change model to normal Gyth - //Inturrupt any spell casting - me->InterruptNonMeleeSpells(false); - //Gyth model - me->SetDisplayId(9806); - me->SummonCreature(10429, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 900000); - SummonedRend = true; - } - - DoMeleeAttackIfReady(); - } // end if Aggro - } -}; - -CreatureAI* GetAI_boss_gyth(Creature* pCreature) -{ - return new boss_gythAI (pCreature); -} - -void AddSC_boss_gyth() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_gyth"; - newscript->GetAI = &GetAI_boss_gyth; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/blackrock_spire/boss_halycon.cpp b/src/server/scripts/EasternKingdoms/blackrock_spire/boss_halycon.cpp deleted file mode 100644 index 9e78667717a..00000000000 --- a/src/server/scripts/EasternKingdoms/blackrock_spire/boss_halycon.cpp +++ /dev/null @@ -1,96 +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_Halycon -SD%Complete: 100 -SDComment: -SDCategory: Blackrock Spire -EndScriptData */ - -#include "ScriptedPch.h" - -#define SPELL_CROWDPUMMEL 10887 -#define SPELL_MIGHTYBLOW 14099 - -#define ADD_1X -169.839203 -#define ADD_1Y -324.961395 -#define ADD_1Z 64.401443 -#define ADD_1O 3.124724 - -struct boss_halyconAI : public ScriptedAI -{ - boss_halyconAI(Creature *c) : ScriptedAI(c) {} - - uint32 CrowdPummel_Timer; - uint32 MightyBlow_Timer; - bool Summoned; - - void Reset() - { - CrowdPummel_Timer = 8000; - MightyBlow_Timer = 14000; - Summoned = false; - } - - void EnterCombat(Unit * /*who*/) - { - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //CrowdPummel_Timer - if (CrowdPummel_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_CROWDPUMMEL); - CrowdPummel_Timer = 14000; - } else CrowdPummel_Timer -= diff; - - //MightyBlow_Timer - if (MightyBlow_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_MIGHTYBLOW); - MightyBlow_Timer = 10000; - } else MightyBlow_Timer -= diff; - - //Summon Gizrul - if (!Summoned && me->GetHealth()*100 / me->GetMaxHealth() < 25) - { - me->SummonCreature(10268,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,300000); - Summoned = true; - } - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_halycon(Creature* pCreature) -{ - return new boss_halyconAI (pCreature); -} - -void AddSC_boss_halycon() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_halycon"; - newscript->GetAI = &GetAI_boss_halycon; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/blackrock_spire/boss_highlord_omokk.cpp b/src/server/scripts/EasternKingdoms/blackrock_spire/boss_highlord_omokk.cpp deleted file mode 100644 index 65f1e8081a0..00000000000 --- a/src/server/scripts/EasternKingdoms/blackrock_spire/boss_highlord_omokk.cpp +++ /dev/null @@ -1,132 +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_Highlord_Omokk -SD%Complete: 100 -SDComment: -SDCategory: Blackrock Spire -EndScriptData */ - -#include "ScriptedPch.h" - -#define SPELL_WARSTOMP 24375 -#define SPELL_CLEAVE 15579 -#define SPELL_STRIKE 18368 -#define SPELL_REND 18106 -#define SPELL_SUNDERARMOR 24317 -#define SPELL_KNOCKAWAY 20686 -#define SPELL_SLOW 22356 - -struct boss_highlordomokkAI : public ScriptedAI -{ - boss_highlordomokkAI(Creature *c) : ScriptedAI(c) {} - - uint32 WarStomp_Timer; - uint32 Cleave_Timer; - uint32 Strike_Timer; - uint32 Rend_Timer; - uint32 SunderArmor_Timer; - uint32 KnockAway_Timer; - uint32 Slow_Timer; - - void Reset() - { - WarStomp_Timer = 15000; - Cleave_Timer = 6000; - Strike_Timer = 10000; - Rend_Timer = 14000; - SunderArmor_Timer = 2000; - KnockAway_Timer = 18000; - Slow_Timer = 24000; - } - - void EnterCombat(Unit * /*who*/) - { - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //WarStomp_Timer - if (WarStomp_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_WARSTOMP); - WarStomp_Timer = 14000; - } else WarStomp_Timer -= diff; - - //Cleave_Timer - if (Cleave_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_CLEAVE); - Cleave_Timer = 8000; - } else Cleave_Timer -= diff; - - //Strike_Timer - if (Strike_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_STRIKE); - Strike_Timer = 10000; - } else Strike_Timer -= diff; - - //Rend_Timer - if (Rend_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_REND); - Rend_Timer = 18000; - } else Rend_Timer -= diff; - - //SunderArmor_Timer - if (SunderArmor_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SUNDERARMOR); - SunderArmor_Timer = 25000; - } else SunderArmor_Timer -= diff; - - //KnockAway_Timer - if (KnockAway_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_KNOCKAWAY); - KnockAway_Timer = 12000; - } else KnockAway_Timer -= diff; - - //Slow_Timer - if (Slow_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SLOW); - Slow_Timer = 18000; - } else Slow_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_highlordomokk(Creature* pCreature) -{ - return new boss_highlordomokkAI (pCreature); -} - -void AddSC_boss_highlordomokk() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_highlord_omokk"; - newscript->GetAI = &GetAI_boss_highlordomokk; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/blackrock_spire/boss_mother_smolderweb.cpp b/src/server/scripts/EasternKingdoms/blackrock_spire/boss_mother_smolderweb.cpp deleted file mode 100644 index 60dda5a5fab..00000000000 --- a/src/server/scripts/EasternKingdoms/blackrock_spire/boss_mother_smolderweb.cpp +++ /dev/null @@ -1,87 +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_Smolderweb -SD%Complete: 100 -SDComment: Uncertain how often mother's milk is casted -SDCategory: Blackrock Spire -EndScriptData */ - -#include "ScriptedPch.h" - -#define SPELL_CRYSTALIZE 16104 -#define SPELL_MOTHERSMILK 16468 -#define SPELL_SUMMON_SPIRE_SPIDERLING 16103 - -struct boss_mothersmolderwebAI : public ScriptedAI -{ - boss_mothersmolderwebAI(Creature *c) : ScriptedAI(c) {} - - uint32 Crystalize_Timer; - uint32 MothersMilk_Timer; - - void Reset() - { - Crystalize_Timer = 20000; - MothersMilk_Timer = 10000; - } - - void EnterCombat(Unit * /*who*/) {} - - void DamageTaken(Unit * /*done_by*/, uint32 &damage) - { - if (me->GetHealth() <= damage) - DoCast(me, SPELL_SUMMON_SPIRE_SPIDERLING, true); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //Crystalize_Timer - if (Crystalize_Timer <= diff) - { - DoCast(me, SPELL_CRYSTALIZE); - Crystalize_Timer = 15000; - } else Crystalize_Timer -= diff; - - //MothersMilk_Timer - if (MothersMilk_Timer <= diff) - { - DoCast(me, SPELL_MOTHERSMILK); - MothersMilk_Timer = urand(5000,12500); - } else MothersMilk_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_mothersmolderweb(Creature* pCreature) -{ - return new boss_mothersmolderwebAI (pCreature); -} - -void AddSC_boss_mothersmolderweb() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_mother_smolderweb"; - newscript->GetAI = &GetAI_boss_mothersmolderweb; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/blackrock_spire/boss_overlord_wyrmthalak.cpp b/src/server/scripts/EasternKingdoms/blackrock_spire/boss_overlord_wyrmthalak.cpp deleted file mode 100644 index 8846442705b..00000000000 --- a/src/server/scripts/EasternKingdoms/blackrock_spire/boss_overlord_wyrmthalak.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_Overlord_Wyrmthalak -SD%Complete: 100 -SDComment: -SDCategory: Blackrock Spire -EndScriptData */ - -#include "ScriptedPch.h" - -#define SPELL_BLASTWAVE 11130 -#define SPELL_SHOUT 23511 -#define SPELL_CLEAVE 20691 -#define SPELL_KNOCKAWAY 20686 - -#define ADD_1X -39.355381 -#define ADD_1Y -513.456482 -#define ADD_1Z 88.472046 -#define ADD_1O 4.679872 - -#define ADD_2X -49.875881 -#define ADD_2Y -511.896942 -#define ADD_2Z 88.195160 -#define ADD_2O 4.613114 - -struct boss_overlordwyrmthalakAI : public ScriptedAI -{ - boss_overlordwyrmthalakAI(Creature *c) : ScriptedAI(c) {} - - uint32 BlastWave_Timer; - uint32 Shout_Timer; - uint32 Cleave_Timer; - uint32 Knockaway_Timer; - bool Summoned; - - void Reset() - { - BlastWave_Timer = 20000; - Shout_Timer = 2000; - Cleave_Timer = 6000; - Knockaway_Timer = 12000; - Summoned = false; - } - - void EnterCombat(Unit * /*who*/) - { - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //BlastWave_Timer - if (BlastWave_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_BLASTWAVE); - BlastWave_Timer = 20000; - } else BlastWave_Timer -= diff; - - //Shout_Timer - if (Shout_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SHOUT); - Shout_Timer = 10000; - } else Shout_Timer -= diff; - - //Cleave_Timer - if (Cleave_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_CLEAVE); - Cleave_Timer = 7000; - } else Cleave_Timer -= diff; - - //Knockaway_Timer - if (Knockaway_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_KNOCKAWAY); - Knockaway_Timer = 14000; - } else Knockaway_Timer -= diff; - - //Summon two Beserks - if (!Summoned && me->GetHealth()*100 / me->GetMaxHealth() < 51) - { - Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0, 100, true); - - if (Creature *SummonedCreature = me->SummonCreature(9216,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,300000)) - SummonedCreature->AI()->AttackStart(pTarget); - if (Creature *SummonedCreature = me->SummonCreature(9268,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,300000)) - SummonedCreature->AI()->AttackStart(pTarget); - Summoned = true; - } - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_overlordwyrmthalak(Creature* pCreature) -{ - return new boss_overlordwyrmthalakAI (pCreature); -} - -void AddSC_boss_overlordwyrmthalak() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_overlord_wyrmthalak"; - newscript->GetAI = &GetAI_boss_overlordwyrmthalak; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/blackrock_spire/boss_pyroguard_emberseer.cpp b/src/server/scripts/EasternKingdoms/blackrock_spire/boss_pyroguard_emberseer.cpp deleted file mode 100644 index 6cbd6955665..00000000000 --- a/src/server/scripts/EasternKingdoms/blackrock_spire/boss_pyroguard_emberseer.cpp +++ /dev/null @@ -1,93 +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_Pyroguard_Emberseer -SD%Complete: 100 -SDComment: Event to activate Emberseer NYI -SDCategory: Blackrock Spire -EndScriptData */ - -#include "ScriptedPch.h" - -#define SPELL_FIRENOVA 23462 -#define SPELL_FLAMEBUFFET 23341 -#define SPELL_PYROBLAST 17274 - -struct boss_pyroguard_emberseerAI : public ScriptedAI -{ - boss_pyroguard_emberseerAI(Creature *c) : ScriptedAI(c) {} - - uint32 FireNova_Timer; - uint32 FlameBuffet_Timer; - uint32 PyroBlast_Timer; - - void Reset() - { - FireNova_Timer = 6000; - FlameBuffet_Timer = 3000; - PyroBlast_Timer = 14000; - } - - void EnterCombat(Unit * /*who*/) - { - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //FireNova_Timer - if (FireNova_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_FIRENOVA); - FireNova_Timer = 6000; - } else FireNova_Timer -= diff; - - //FlameBuffet_Timer - if (FlameBuffet_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_FLAMEBUFFET); - FlameBuffet_Timer = 14000; - } else FlameBuffet_Timer -= diff; - - //PyroBlast_Timer - if (PyroBlast_Timer <= diff) - { - if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) - DoCast(pTarget, SPELL_PYROBLAST); - PyroBlast_Timer = 15000; - } else PyroBlast_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_pyroguard_emberseer(Creature* pCreature) -{ - return new boss_pyroguard_emberseerAI (pCreature); -} - -void AddSC_boss_pyroguard_emberseer() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_pyroguard_emberseer"; - newscript->GetAI = &GetAI_boss_pyroguard_emberseer; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/blackrock_spire/boss_quartermaster_zigris.cpp b/src/server/scripts/EasternKingdoms/blackrock_spire/boss_quartermaster_zigris.cpp deleted file mode 100644 index 9058b35cd5c..00000000000 --- a/src/server/scripts/EasternKingdoms/blackrock_spire/boss_quartermaster_zigris.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: Boss_Quartmaster_Zigris -SD%Complete: 100 -SDComment: Needs revision -SDCategory: Blackrock Spire -EndScriptData */ - -#include "ScriptedPch.h" - -#define SPELL_SHOOT 16496 -#define SPELL_STUNBOMB 16497 -#define SPELL_HEALING_POTION 15504 -#define SPELL_HOOKEDNET 15609 - -struct boss_quatermasterzigrisAI : public ScriptedAI -{ - boss_quatermasterzigrisAI(Creature *c) : ScriptedAI(c) {} - - uint32 Shoot_Timer; - uint32 StunBomb_Timer; - //uint32 HelingPotion_Timer; - - void Reset() - { - Shoot_Timer = 1000; - StunBomb_Timer = 16000; - //HelingPotion_Timer = 25000; - } - - void EnterCombat(Unit * /*who*/) - { - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //Shoot_Timer - if (Shoot_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SHOOT); - Shoot_Timer = 500; - } else Shoot_Timer -= diff; - - //StunBomb_Timer - if (StunBomb_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_STUNBOMB); - StunBomb_Timer = 14000; - } else StunBomb_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_quatermasterzigris(Creature* pCreature) -{ - return new boss_quatermasterzigrisAI (pCreature); -} - -void AddSC_boss_quatermasterzigris() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "quartermaster_zigris"; - newscript->GetAI = &GetAI_boss_quatermasterzigris; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/blackrock_spire/boss_rend_blackhand.cpp b/src/server/scripts/EasternKingdoms/blackrock_spire/boss_rend_blackhand.cpp deleted file mode 100644 index 56de5dbb385..00000000000 --- a/src/server/scripts/EasternKingdoms/blackrock_spire/boss_rend_blackhand.cpp +++ /dev/null @@ -1,92 +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_Rend_Blackhand -SD%Complete: 100 -SDComment: Intro event NYI -SDCategory: Blackrock Spire -EndScriptData */ - -#include "ScriptedPch.h" - -#define SPELL_WHIRLWIND 26038 -#define SPELL_CLEAVE 20691 -#define SPELL_THUNDERCLAP 23931 //Not sure if he cast this spell - -struct boss_rend_blackhandAI : public ScriptedAI -{ - boss_rend_blackhandAI(Creature *c) : ScriptedAI(c) {} - - uint32 WhirlWind_Timer; - uint32 Cleave_Timer; - uint32 Thunderclap_Timer; - - void Reset() - { - WhirlWind_Timer = 20000; - Cleave_Timer = 5000; - Thunderclap_Timer = 9000; - } - - void EnterCombat(Unit * /*who*/) - { - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //WhirlWind_Timer - if (WhirlWind_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_WHIRLWIND); - WhirlWind_Timer = 18000; - } else WhirlWind_Timer -= diff; - - //Cleave_Timer - if (Cleave_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_CLEAVE); - Cleave_Timer = 10000; - } else Cleave_Timer -= diff; - - //Thunderclap_Timer - if (Thunderclap_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_THUNDERCLAP); - Thunderclap_Timer = 16000; - } else Thunderclap_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_rend_blackhand(Creature* pCreature) -{ - return new boss_rend_blackhandAI (pCreature); -} - -void AddSC_boss_rend_blackhand() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_rend_blackhand"; - newscript->GetAI = &GetAI_boss_rend_blackhand; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/blackrock_spire/boss_shadow_hunter_voshgajin.cpp b/src/server/scripts/EasternKingdoms/blackrock_spire/boss_shadow_hunter_voshgajin.cpp deleted file mode 100644 index 73afc3b5afe..00000000000 --- a/src/server/scripts/EasternKingdoms/blackrock_spire/boss_shadow_hunter_voshgajin.cpp +++ /dev/null @@ -1,93 +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_Shadow_Hunter_Voshgajin -SD%Complete: 100 -SDComment: -SDCategory: Blackrock Spire -EndScriptData */ - -#include "ScriptedPch.h" - -#define SPELL_CURSEOFBLOOD 24673 -#define SPELL_HEX 16708 -#define SPELL_CLEAVE 20691 - -struct boss_shadowvoshAI : public ScriptedAI -{ - boss_shadowvoshAI(Creature *c) : ScriptedAI(c) {} - - uint32 CurseOfBlood_Timer; - uint32 Hex_Timer; - uint32 Cleave_Timer; - - void Reset() - { - CurseOfBlood_Timer = 2000; - Hex_Timer = 8000; - Cleave_Timer = 14000; - - //DoCast(me, SPELL_ICEARMOR, true); - } - - void EnterCombat(Unit * /*who*/){} - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //CurseOfBlood_Timer - if (CurseOfBlood_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_CURSEOFBLOOD); - CurseOfBlood_Timer = 45000; - } else CurseOfBlood_Timer -= diff; - - //Hex_Timer - if (Hex_Timer <= diff) - { - if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) - DoCast(pTarget, SPELL_HEX); - Hex_Timer = 15000; - } else Hex_Timer -= diff; - - //Cleave_Timer - if (Cleave_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_CLEAVE); - Cleave_Timer = 7000; - } else Cleave_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_shadowvosh(Creature* pCreature) -{ - return new boss_shadowvoshAI (pCreature); -} - -void AddSC_boss_shadowvosh() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_shadow_hunter_voshgajin"; - newscript->GetAI = &GetAI_boss_shadowvosh; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/blackrock_spire/boss_the_beast.cpp b/src/server/scripts/EasternKingdoms/blackrock_spire/boss_the_beast.cpp deleted file mode 100644 index 499f9cf4ce5..00000000000 --- a/src/server/scripts/EasternKingdoms/blackrock_spire/boss_the_beast.cpp +++ /dev/null @@ -1,93 +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_Best -SD%Complete: 100 -SDComment: -SDCategory: Blackrock Spire -EndScriptData */ - -#include "ScriptedPch.h" - -#define SPELL_FLAMEBREAK 16785 -#define SPELL_IMMOLATE 20294 -#define SPELL_TERRIFYINGROAR 14100 - -struct boss_thebeastAI : public ScriptedAI -{ - boss_thebeastAI(Creature *c) : ScriptedAI(c) {} - - uint32 Flamebreak_Timer; - uint32 Immolate_Timer; - uint32 TerrifyingRoar_Timer; - - void Reset() - { - Flamebreak_Timer = 12000; - Immolate_Timer = 3000; - TerrifyingRoar_Timer = 23000; - } - - void EnterCombat(Unit * /*who*/) - { - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //Flamebreak_Timer - if (Flamebreak_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_FLAMEBREAK); - Flamebreak_Timer = 10000; - } else Flamebreak_Timer -= diff; - - //Immolate_Timer - if (Immolate_Timer <= diff) - { - if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) - DoCast(pTarget, SPELL_IMMOLATE); - Immolate_Timer = 8000; - } else Immolate_Timer -= diff; - - //TerrifyingRoar_Timer - if (TerrifyingRoar_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_TERRIFYINGROAR); - TerrifyingRoar_Timer = 20000; - } else TerrifyingRoar_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_thebeast(Creature* pCreature) -{ - return new boss_thebeastAI (pCreature); -} - -void AddSC_boss_thebeast() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_the_beast"; - newscript->GetAI = &GetAI_boss_thebeast; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/blackrock_spire/boss_warmaster_voone.cpp b/src/server/scripts/EasternKingdoms/blackrock_spire/boss_warmaster_voone.cpp deleted file mode 100644 index 50b47c94fc5..00000000000 --- a/src/server/scripts/EasternKingdoms/blackrock_spire/boss_warmaster_voone.cpp +++ /dev/null @@ -1,122 +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_Warmaster_Voone -SD%Complete: 100 -SDComment: -SDCategory: Blackrock Spire -EndScriptData */ - -#include "ScriptedPch.h" - -#define SPELL_SNAPKICK 15618 -#define SPELL_CLEAVE 15579 -#define SPELL_UPPERCUT 10966 -#define SPELL_MORTALSTRIKE 16856 -#define SPELL_PUMMEL 15615 -#define SPELL_THROWAXE 16075 - -struct boss_warmastervooneAI : public ScriptedAI -{ - boss_warmastervooneAI(Creature *c) : ScriptedAI(c) {} - - uint32 Snapkick_Timer; - uint32 Cleave_Timer; - uint32 Uppercut_Timer; - uint32 MortalStrike_Timer; - uint32 Pummel_Timer; - uint32 ThrowAxe_Timer; - - void Reset() - { - Snapkick_Timer = 8000; - Cleave_Timer = 14000; - Uppercut_Timer = 20000; - MortalStrike_Timer = 12000; - Pummel_Timer = 32000; - ThrowAxe_Timer = 1000; - } - - void EnterCombat(Unit * /*who*/) - { - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //Snapkick_Timer - if (Snapkick_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SNAPKICK); - Snapkick_Timer = 6000; - } else Snapkick_Timer -= diff; - - //Cleave_Timer - if (Cleave_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_CLEAVE); - Cleave_Timer = 12000; - } else Cleave_Timer -= diff; - - //Uppercut_Timer - if (Uppercut_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_UPPERCUT); - Uppercut_Timer = 14000; - } else Uppercut_Timer -= diff; - - //MortalStrike_Timer - if (MortalStrike_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_MORTALSTRIKE); - MortalStrike_Timer = 10000; - } else MortalStrike_Timer -= diff; - - //Pummel_Timer - if (Pummel_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_PUMMEL); - Pummel_Timer = 16000; - } else Pummel_Timer -= diff; - - //ThrowAxe_Timer - if (ThrowAxe_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_THROWAXE); - ThrowAxe_Timer = 8000; - } else ThrowAxe_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_warmastervoone(Creature* pCreature) -{ - return new boss_warmastervooneAI (pCreature); -} - -void AddSC_boss_warmastervoone() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_warmaster_voone"; - newscript->GetAI = &GetAI_boss_warmastervoone; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/blackrock_spire/instance_blackrock_spire.cpp b/src/server/scripts/EasternKingdoms/blackrock_spire/instance_blackrock_spire.cpp deleted file mode 100644 index f2e2b39fe87..00000000000 --- a/src/server/scripts/EasternKingdoms/blackrock_spire/instance_blackrock_spire.cpp +++ /dev/null @@ -1,104 +0,0 @@ -/* Copyright (C) 2008 - 2010 TrinityCore - * 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 - */ - -#include "ScriptedPch.h" -#include "blackrock_spire.h" - -enum Achievements -{ - ACHIEV_LEROY_JENKINS = 2188 -}; - -struct instance_blackrock_spire : public ScriptedInstance -{ - instance_blackrock_spire(Map* pMap) : ScriptedInstance(pMap) {} - - uint32 uiLeeroyTimer; - uint32 uiWhelpCount; - uint32 uiLeroyData; - - bool bLeeeeeeeeroy; - - void Initialize() - { - uiLeeroyTimer = 15*IN_MILISECONDS; - uiWhelpCount = 0; - bLeeeeeeeeroy = true; - uiLeroyData = 0; - } - - void SetData(uint32 type, uint32 data) - { - switch(type) - { - case EVENT_LEEEROY: - if (data == DONE) - DoCompleteAchievement(ACHIEV_LEROY_JENKINS); - uiLeroyData = data; - break; - case WHELP_DEATH_COUNT: - if (data == 1) - { - SetData(EVENT_LEEEROY, IN_PROGRESS); - //DoSendNotifyToInstance("Leeeeeeeeeeeeeroy! Started"); - } - uiWhelpCount = data; - break; - } - } - - uint32 GetData(uint32 type) - { - switch(type) - { - case EVENT_LEEEROY: return uiLeroyData; - case WHELP_DEATH_COUNT: return uiWhelpCount; - } - return 0; - } - - void Update(uint32 diff) - { - if (GetData(EVENT_LEEEROY) != FAIL && GetData(EVENT_LEEEROY) == IN_PROGRESS) - { - if (uiLeeroyTimer <= diff) - { - SetData(EVENT_LEEEROY, FAIL); - bLeeeeeeeeroy = false; - //DoSendNotifyToInstance("Leeeeeeeeeeeeeroy! Failed"); - } else uiLeeroyTimer -= diff; - if (uiWhelpCount >= 50 && bLeeeeeeeeroy) - { - SetData(EVENT_LEEEROY, DONE); - //DoSendNotifyToInstance("Leeeeeeeeeeeeeroy! Success"); - } - } - } -}; - -InstanceData* GetInstanceData_instance_blackrock_spire(Map* pMap) -{ - return new instance_blackrock_spire(pMap); -} - -void AddSC_instance_blackrock_spire() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_blackrock_spire"; - newscript->GetInstanceData = &GetInstanceData_instance_blackrock_spire; - newscript->RegisterSelf(); -} diff --git a/src/server/scripts/EasternKingdoms/blackwing_lair/boss_broodlord_lashlayer.cpp b/src/server/scripts/EasternKingdoms/blackwing_lair/boss_broodlord_lashlayer.cpp deleted file mode 100644 index 856e1236176..00000000000 --- a/src/server/scripts/EasternKingdoms/blackwing_lair/boss_broodlord_lashlayer.cpp +++ /dev/null @@ -1,112 +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_Broodlord_Lashlayer -SD%Complete: 100 -SDComment: -SDCategory: Blackwing Lair -EndScriptData */ - -#include "ScriptedPch.h" - -#define SAY_AGGRO -1469000 -#define SAY_LEASH -1469001 - -#define SPELL_CLEAVE 26350 -#define SPELL_BLASTWAVE 23331 -#define SPELL_MORTALSTRIKE 24573 -#define SPELL_KNOCKBACK 25778 - -struct boss_broodlordAI : public ScriptedAI -{ - boss_broodlordAI(Creature *c) : ScriptedAI(c) {} - - uint32 Cleave_Timer; - uint32 BlastWave_Timer; - uint32 MortalStrike_Timer; - uint32 KnockBack_Timer; - - void Reset() - { - Cleave_Timer = 8000; //These times are probably wrong - BlastWave_Timer = 12000; - MortalStrike_Timer = 20000; - KnockBack_Timer = 30000; - } - - void EnterCombat(Unit * /*who*/) - { - DoScriptText(SAY_AGGRO, me); - DoZoneInCombat(); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //Cleave_Timer - if (Cleave_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_CLEAVE); - Cleave_Timer = 7000; - } else Cleave_Timer -= diff; - - // BlastWave - if (BlastWave_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_BLASTWAVE); - BlastWave_Timer = urand(8000,16000); - } else BlastWave_Timer -= diff; - - //MortalStrike_Timer - if (MortalStrike_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_MORTALSTRIKE); - MortalStrike_Timer = urand(25000,35000); - } else MortalStrike_Timer -= diff; - - if (KnockBack_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_KNOCKBACK); - //Drop 50% aggro - if (DoGetThreat(me->getVictim())) - DoModifyThreatPercent(me->getVictim(),-50); - - KnockBack_Timer = urand(15000,30000); - } else KnockBack_Timer -= diff; - - if (EnterEvadeIfOutOfCombatArea(diff)) - DoScriptText(SAY_LEASH, me); - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_broodlord(Creature* pCreature) -{ - return new boss_broodlordAI (pCreature); -} - -void AddSC_boss_broodlord() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_broodlord"; - newscript->GetAI = &GetAI_boss_broodlord; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/blackwing_lair/boss_chromaggus.cpp b/src/server/scripts/EasternKingdoms/blackwing_lair/boss_chromaggus.cpp deleted file mode 100644 index 08bebe95384..00000000000 --- a/src/server/scripts/EasternKingdoms/blackwing_lair/boss_chromaggus.cpp +++ /dev/null @@ -1,301 +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_Chromaggus -SD%Complete: 95 -SDComment: Chromatic Mutation disabled due to lack of core support -SDCategory: Blackwing Lair -EndScriptData */ - -#include "ScriptedPch.h" - -enum Emotes -{ - EMOTE_FRENZY = -1469002, - EMOTE_SHIMMER = -1469003 -}; - -enum Spells -{ - //These spells are actually called elemental shield - //What they do is decrease all damage by 75% then they increase - //One school of damage by 1100% - SPELL_FIRE_VULNERABILITY = 22277, - SPELL_FROST_VULNERABILITY = 22278, - SPELL_SHADOW_VULNERABILITY = 22279, - SPELL_NATURE_VULNERABILITY = 22280, - SPELL_ARCANE_VULNERABILITY = 22281, - //Other spells - SPELL_INCINERATE = 23308, //Incinerate 23308,23309 - SPELL_TIMELAPSE = 23310, //Time lapse 23310, 23311(old threat mod that was removed in 2.01) - SPELL_CORROSIVEACID = 23313, //Corrosive Acid 23313, 23314 - SPELL_IGNITEFLESH = 23315, //Ignite Flesh 23315,23316 - SPELL_FROSTBURN = 23187, //Frost burn 23187, 23189 - //Brood Affliction 23173 - Scripted Spell that cycles through all targets within 100 yards and has a chance to cast one of the afflictions on them - //Since Scripted spells arn't coded I'll just write a function that does the same thing - SPELL_BROODAF_BLUE = 23153, //Blue affliction 23153 - SPELL_BROODAF_BLACK = 23154, //Black affliction 23154 - SPELL_BROODAF_RED = 23155, //Red affliction 23155 (23168 on death) - SPELL_BROODAF_BRONZE = 23170, //Bronze Affliction 23170 - SPELL_BROODAF_GREEN = 23169, //Brood Affliction Green 23169 - SPELL_CHROMATIC_MUT_1 = 23174, //Spell cast on player if they get all 5 debuffs - SPELL_FRENZY = 28371, //The frenzy spell may be wrong - SPELL_ENRAGE = 28747 -}; - -struct boss_chromaggusAI : public ScriptedAI -{ - boss_chromaggusAI(Creature *c) : ScriptedAI(c) - { - //Select the 2 breaths that we are going to use until despawned - //5 possiblities for the first breath, 4 for the second, 20 total possiblites - //This way we don't end up casting 2 of the same breath - //TL TL would be stupid - switch (urand(0,19)) - { - //B1 - Incin - case 0: - Breath1_Spell = SPELL_INCINERATE; - Breath2_Spell = SPELL_TIMELAPSE; - break; - case 1: - Breath1_Spell = SPELL_INCINERATE; - Breath2_Spell = SPELL_CORROSIVEACID; - break; - case 2: - Breath1_Spell = SPELL_INCINERATE; - Breath2_Spell = SPELL_IGNITEFLESH; - break; - case 3: - Breath1_Spell = SPELL_INCINERATE; - Breath2_Spell = SPELL_FROSTBURN; - break; - - //B1 - TL - case 4: - Breath1_Spell = SPELL_TIMELAPSE; - Breath2_Spell = SPELL_INCINERATE; - break; - case 5: - Breath1_Spell = SPELL_TIMELAPSE; - Breath2_Spell = SPELL_CORROSIVEACID; - break; - case 6: - Breath1_Spell = SPELL_TIMELAPSE; - Breath2_Spell = SPELL_IGNITEFLESH; - break; - case 7: - Breath1_Spell = SPELL_TIMELAPSE; - Breath2_Spell = SPELL_FROSTBURN; - break; - - //B1 - Acid - case 8: - Breath1_Spell = SPELL_CORROSIVEACID; - Breath2_Spell = SPELL_INCINERATE; - break; - case 9: - Breath1_Spell = SPELL_CORROSIVEACID; - Breath2_Spell = SPELL_TIMELAPSE; - break; - case 10: - Breath1_Spell = SPELL_CORROSIVEACID; - Breath2_Spell = SPELL_IGNITEFLESH; - break; - case 11: - Breath1_Spell = SPELL_CORROSIVEACID; - Breath2_Spell = SPELL_FROSTBURN; - break; - - //B1 - Ignite - case 12: - Breath1_Spell = SPELL_IGNITEFLESH; - Breath2_Spell = SPELL_INCINERATE; - break; - case 13: - Breath1_Spell = SPELL_IGNITEFLESH; - Breath2_Spell = SPELL_CORROSIVEACID; - break; - case 14: - Breath1_Spell = SPELL_IGNITEFLESH; - Breath2_Spell = SPELL_TIMELAPSE; - break; - case 15: - Breath1_Spell = SPELL_IGNITEFLESH; - Breath2_Spell = SPELL_FROSTBURN; - break; - - //B1 - Frost - case 16: - Breath1_Spell = SPELL_FROSTBURN; - Breath2_Spell = SPELL_INCINERATE; - break; - case 17: - Breath1_Spell = SPELL_FROSTBURN; - Breath2_Spell = SPELL_TIMELAPSE; - break; - case 18: - Breath1_Spell = SPELL_FROSTBURN; - Breath2_Spell = SPELL_CORROSIVEACID; - break; - case 19: - Breath1_Spell = SPELL_FROSTBURN; - Breath2_Spell = SPELL_IGNITEFLESH; - break; - }; - - EnterEvadeMode(); - } - - uint32 Breath1_Spell; - uint32 Breath2_Spell; - uint32 CurrentVurln_Spell; - - uint32 Shimmer_Timer; - uint32 Breath1_Timer; - uint32 Breath2_Timer; - uint32 Affliction_Timer; - uint32 Frenzy_Timer; - bool Enraged; - - void Reset() - { - CurrentVurln_Spell = 0; //We use this to store our last vulnerabilty spell so we can remove it later - - Shimmer_Timer = 0; //Time till we change vurlnerabilites - Breath1_Timer = 30000; //First breath is 30 seconds - Breath2_Timer = 60000; //Second is 1 minute so that we can alternate - Affliction_Timer = 10000; //This is special - 5 seconds means that we cast this on 1 player every 5 sconds - Frenzy_Timer = 15000; - - Enraged = false; - } - - void EnterCombat(Unit * /*who*/) - { - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //Shimmer_Timer Timer - if (Shimmer_Timer <= diff) - { - //Remove old vulnerabilty spell - if (CurrentVurln_Spell) - me->RemoveAurasDueToSpell(CurrentVurln_Spell); - - //Cast new random vulnerabilty on self - uint32 spell = RAND(SPELL_FIRE_VULNERABILITY, SPELL_FROST_VULNERABILITY, - SPELL_SHADOW_VULNERABILITY, SPELL_NATURE_VULNERABILITY, SPELL_ARCANE_VULNERABILITY); - - DoCast(me, spell); - CurrentVurln_Spell = spell; - - DoScriptText(EMOTE_SHIMMER, me); - Shimmer_Timer = 45000; - } else Shimmer_Timer -= diff; - - //Breath1_Timer - if (Breath1_Timer <= diff) - { - DoCast(me->getVictim(), Breath1_Spell); - Breath1_Timer = 60000; - } else Breath1_Timer -= diff; - - //Breath2_Timer - if (Breath2_Timer <= diff) - { - DoCast(me->getVictim(), Breath2_Spell); - Breath2_Timer = 60000; - } else Breath2_Timer -= diff; - - //Affliction_Timer - if (Affliction_Timer <= diff) - { - std::list threatlist = me->getThreatManager().getThreatList(); - for (std::list::const_iterator i = threatlist.begin(); i != threatlist.end(); ++i) - { - Unit* pUnit; - if ((*i) && (*i)->getSource()) - { - pUnit = Unit::GetUnit((*me), (*i)->getUnitGuid()); - if (pUnit) - { - //Cast affliction - DoCast(pUnit, RAND(SPELL_BROODAF_BLUE, SPELL_BROODAF_BLACK, - SPELL_BROODAF_RED, SPELL_BROODAF_BRONZE, SPELL_BROODAF_GREEN), true); - - //Chromatic mutation if target is effected by all afflictions - if (pUnit->HasAura(SPELL_BROODAF_BLUE) - && pUnit->HasAura(SPELL_BROODAF_BLACK) - && pUnit->HasAura(SPELL_BROODAF_RED) - && pUnit->HasAura(SPELL_BROODAF_BRONZE) - && pUnit->HasAura(SPELL_BROODAF_GREEN)) - { - //pTarget->RemoveAllAuras(); - //DoCast(pTarget, SPELL_CHROMATIC_MUT_1); - - //Chromatic mutation is causing issues - //Assuming it is caused by a lack of core support for Charm - //So instead we instant kill our target - - //WORKAROUND - if (pUnit->GetTypeId() == TYPEID_PLAYER) - pUnit->CastSpell(pUnit, 5, false); - } - } - } - } - - Affliction_Timer = 10000; - } else Affliction_Timer -= diff; - - //Frenzy_Timer - if (Frenzy_Timer <= diff) - { - DoCast(me, SPELL_FRENZY); - DoScriptText(EMOTE_FRENZY, me); - Frenzy_Timer = urand(10000,15000); - } else Frenzy_Timer -= diff; - - //Enrage if not already enraged and below 20% - if (!Enraged && (me->GetHealth()*100 / me->GetMaxHealth()) < 20) - { - DoCast(me, SPELL_ENRAGE); - Enraged = true; - } - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_chromaggus(Creature* pCreature) -{ - return new boss_chromaggusAI (pCreature); -} - -void AddSC_boss_chromaggus() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_chromaggus"; - newscript->GetAI = &GetAI_boss_chromaggus; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/blackwing_lair/boss_ebonroc.cpp b/src/server/scripts/EasternKingdoms/blackwing_lair/boss_ebonroc.cpp deleted file mode 100644 index 49a999fc458..00000000000 --- a/src/server/scripts/EasternKingdoms/blackwing_lair/boss_ebonroc.cpp +++ /dev/null @@ -1,104 +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_Ebonroc -SD%Complete: 50 -SDComment: Shadow of Ebonroc needs core support -SDCategory: Blackwing Lair -EndScriptData */ - -#include "ScriptedPch.h" - -#define SPELL_SHADOWFLAME 22539 -#define SPELL_WINGBUFFET 18500 -#define SPELL_SHADOWOFEBONROC 23340 -#define SPELL_HEAL 41386 //Thea Heal spell of his Shadow - -struct boss_ebonrocAI : public ScriptedAI -{ - boss_ebonrocAI(Creature *c) : ScriptedAI(c) {} - - uint32 ShadowFlame_Timer; - uint32 WingBuffet_Timer; - uint32 ShadowOfEbonroc_Timer; - uint32 Heal_Timer; - - void Reset() - { - ShadowFlame_Timer = 15000; //These times are probably wrong - WingBuffet_Timer = 30000; - ShadowOfEbonroc_Timer = 45000; - Heal_Timer = 1000; - } - - void EnterCombat(Unit * /*who*/) - { - DoZoneInCombat(); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //Shadowflame Timer - if (ShadowFlame_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SHADOWFLAME); - ShadowFlame_Timer = urand(12000,15000); - } else ShadowFlame_Timer -= diff; - - //Wing Buffet Timer - if (WingBuffet_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_WINGBUFFET); - WingBuffet_Timer = 25000; - } else WingBuffet_Timer -= diff; - - //Shadow of Ebonroc Timer - if (ShadowOfEbonroc_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SHADOWOFEBONROC); - ShadowOfEbonroc_Timer = urand(25000,350000); - } else ShadowOfEbonroc_Timer -= diff; - - if (me->getVictim()->HasAura(SPELL_SHADOWOFEBONROC)) - { - if (Heal_Timer <= diff) - { - DoCast(me, SPELL_HEAL); - Heal_Timer = urand(1000,3000); - } else Heal_Timer -= diff; - } - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_ebonroc(Creature* pCreature) -{ - return new boss_ebonrocAI (pCreature); -} - -void AddSC_boss_ebonroc() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_ebonroc"; - newscript->GetAI = &GetAI_boss_ebonroc; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/blackwing_lair/boss_firemaw.cpp b/src/server/scripts/EasternKingdoms/blackwing_lair/boss_firemaw.cpp deleted file mode 100644 index af62b1103bc..00000000000 --- a/src/server/scripts/EasternKingdoms/blackwing_lair/boss_firemaw.cpp +++ /dev/null @@ -1,95 +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_Firemaw -SD%Complete: 100 -SDComment: -SDCategory: Blackwing Lair -EndScriptData */ - -#include "ScriptedPch.h" - -#define SPELL_SHADOWFLAME 22539 -#define SPELL_WINGBUFFET 23339 -#define SPELL_FLAMEBUFFET 23341 - -struct boss_firemawAI : public ScriptedAI -{ - boss_firemawAI(Creature *c) : ScriptedAI(c) {} - - uint32 ShadowFlame_Timer; - uint32 WingBuffet_Timer; - uint32 FlameBuffet_Timer; - - void Reset() - { - ShadowFlame_Timer = 30000; //These times are probably wrong - WingBuffet_Timer = 24000; - FlameBuffet_Timer = 5000; - } - - void EnterCombat(Unit * /*who*/) - { - DoZoneInCombat(); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //ShadowFlame_Timer - if (ShadowFlame_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SHADOWFLAME); - ShadowFlame_Timer = urand(15000,18000); - } else ShadowFlame_Timer -= diff; - - //WingBuffet_Timer - if (WingBuffet_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_WINGBUFFET); - if (DoGetThreat(me->getVictim())) - DoModifyThreatPercent(me->getVictim(),-75); - - WingBuffet_Timer = 25000; - } else WingBuffet_Timer -= diff; - - //FlameBuffet_Timer - if (FlameBuffet_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_FLAMEBUFFET); - FlameBuffet_Timer = 5000; - } else FlameBuffet_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_firemaw(Creature* pCreature) -{ - return new boss_firemawAI (pCreature); -} - -void AddSC_boss_firemaw() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_firemaw"; - newscript->GetAI = &GetAI_boss_firemaw; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/blackwing_lair/boss_flamegor.cpp b/src/server/scripts/EasternKingdoms/blackwing_lair/boss_flamegor.cpp deleted file mode 100644 index b29fe41f2b1..00000000000 --- a/src/server/scripts/EasternKingdoms/blackwing_lair/boss_flamegor.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: Boss_Flamegor -SD%Complete: 100 -SDComment: -SDCategory: Blackwing Lair -EndScriptData */ - -#include "ScriptedPch.h" - -#define EMOTE_FRENZY -1469031 - -#define SPELL_SHADOWFLAME 22539 -#define SPELL_WINGBUFFET 23339 -#define SPELL_FRENZY 23342 //This spell periodically triggers fire nova - -struct boss_flamegorAI : public ScriptedAI -{ - boss_flamegorAI(Creature *c) : ScriptedAI(c) {} - - uint32 ShadowFlame_Timer; - uint32 WingBuffet_Timer; - uint32 Frenzy_Timer; - - void Reset() - { - ShadowFlame_Timer = 21000; //These times are probably wrong - WingBuffet_Timer = 35000; - Frenzy_Timer = 10000; - } - - void EnterCombat(Unit * /*who*/) - { - DoZoneInCombat(); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //ShadowFlame_Timer - if (ShadowFlame_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SHADOWFLAME); - ShadowFlame_Timer = 15000 + rand()%7000; - } else ShadowFlame_Timer -= diff; - - //WingBuffet_Timer - if (WingBuffet_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_WINGBUFFET); - if (DoGetThreat(me->getVictim())) - DoModifyThreatPercent(me->getVictim(),-75); - - WingBuffet_Timer = 25000; - } else WingBuffet_Timer -= diff; - - //Frenzy_Timer - if (Frenzy_Timer <= diff) - { - DoScriptText(EMOTE_FRENZY, me); - DoCast(me, SPELL_FRENZY); - Frenzy_Timer = urand(8000, 10000); - } else Frenzy_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_flamegor(Creature* pCreature) -{ - return new boss_flamegorAI (pCreature); -} - -void AddSC_boss_flamegor() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_flamegor"; - newscript->GetAI = &GetAI_boss_flamegor; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/blackwing_lair/boss_nefarian.cpp b/src/server/scripts/EasternKingdoms/blackwing_lair/boss_nefarian.cpp deleted file mode 100644 index 5ef05be519c..00000000000 --- a/src/server/scripts/EasternKingdoms/blackwing_lair/boss_nefarian.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: Boss_Nefarian -SD%Complete: 80 -SDComment: Some issues with class calls effecting more than one class -SDCategory: Blackwing Lair -EndScriptData */ - -#include "ScriptedPch.h" - -#define SAY_AGGRO -1469007 -#define SAY_XHEALTH -1469008 -#define SAY_SHADOWFLAME -1469009 -#define SAY_RAISE_SKELETONS -1469010 -#define SAY_SLAY -1469011 -#define SAY_DEATH -1469012 - -#define SAY_MAGE -1469013 -#define SAY_WARRIOR -1469014 -#define SAY_DRUID -1469015 -#define SAY_PRIEST -1469016 -#define SAY_PALADIN -1469017 -#define SAY_SHAMAN -1469018 -#define SAY_WARLOCK -1469019 -#define SAY_HUNTER -1469020 -#define SAY_ROGUE -1469021 - -#define SPELL_SHADOWFLAME_INITIAL 22972 -#define SPELL_SHADOWFLAME 22539 -#define SPELL_BELLOWINGROAR 22686 -#define SPELL_VEILOFSHADOW 7068 -#define SPELL_CLEAVE 20691 -#define SPELL_TAILLASH 23364 -#define SPELL_BONECONTRUST 23363 //23362, 23361 - -#define SPELL_MAGE 23410 //wild magic -#define SPELL_WARRIOR 23397 //beserk -#define SPELL_DRUID 23398 // cat form -#define SPELL_PRIEST 23401 // corrupted healing -#define SPELL_PALADIN 23418 //syphon blessing -#define SPELL_SHAMAN 23425 //totems -#define SPELL_WARLOCK 23427 //infernals -#define SPELL_HUNTER 23436 //bow broke -#define SPELL_ROGUE 23414 //Paralise - -struct boss_nefarianAI : public ScriptedAI -{ - boss_nefarianAI(Creature *c) : ScriptedAI(c) {} - - uint32 ShadowFlame_Timer; - uint32 BellowingRoar_Timer; - uint32 VeilOfShadow_Timer; - uint32 Cleave_Timer; - uint32 TailLash_Timer; - uint32 ClassCall_Timer; - bool Phase3; - - uint32 DespawnTimer; - - void Reset() - { - ShadowFlame_Timer = 12000; //These times are probably wrong - BellowingRoar_Timer = 30000; - VeilOfShadow_Timer = 15000; - Cleave_Timer = 7000; - TailLash_Timer = 10000; - ClassCall_Timer = 35000; //35-40 seconds - Phase3 = false; - - DespawnTimer = 5000; - } - - void KilledUnit(Unit* Victim) - { - if (rand()%5) - return; - - DoScriptText(SAY_SLAY, me, Victim); - } - - void JustDied(Unit* /*Killer*/) - { - DoScriptText(SAY_DEATH, me); - } - - void EnterCombat(Unit * who) - { - DoScriptText(RAND(SAY_XHEALTH,SAY_AGGRO,SAY_SHADOWFLAME), me); - - DoCast(who, SPELL_SHADOWFLAME_INITIAL); - DoZoneInCombat(); - } - - void UpdateAI(const uint32 diff) - { - if (DespawnTimer <= diff) - { - if (!UpdateVictim()) - me->ForcedDespawn(); - DespawnTimer = 5000; - } else DespawnTimer -= diff; - - if (!UpdateVictim()) - return; - - //ShadowFlame_Timer - if (ShadowFlame_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SHADOWFLAME); - ShadowFlame_Timer = 12000; - } else ShadowFlame_Timer -= diff; - - //BellowingRoar_Timer - if (BellowingRoar_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_BELLOWINGROAR); - BellowingRoar_Timer = 30000; - } else BellowingRoar_Timer -= diff; - - //VeilOfShadow_Timer - if (VeilOfShadow_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_VEILOFSHADOW); - VeilOfShadow_Timer = 15000; - } else VeilOfShadow_Timer -= diff; - - //Cleave_Timer - if (Cleave_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_CLEAVE); - Cleave_Timer = 7000; - } else Cleave_Timer -= diff; - - //TailLash_Timer - if (TailLash_Timer <= diff) - { - //Cast NYI since we need a better check for behind target - //DoCast(me->getVictim(), SPELL_TAILLASH); - - TailLash_Timer = 10000; - } else TailLash_Timer -= diff; - - //ClassCall_Timer - if (ClassCall_Timer <= diff) - { - //Cast a random class call - //On official it is based on what classes are currently on the hostil list - //but we can't do that yet so just randomly call one - - switch (urand(0,8)) - { - case 0: - DoScriptText(SAY_MAGE, me); - DoCast(me, SPELL_MAGE); - break; - case 1: - DoScriptText(SAY_WARRIOR, me); - DoCast(me, SPELL_WARRIOR); - break; - case 2: - DoScriptText(SAY_DRUID, me); - DoCast(me, SPELL_DRUID); - break; - case 3: - DoScriptText(SAY_PRIEST, me); - DoCast(me, SPELL_PRIEST); - break; - case 4: - DoScriptText(SAY_PALADIN, me); - DoCast(me, SPELL_PALADIN); - break; - case 5: - DoScriptText(SAY_SHAMAN, me); - DoCast(me, SPELL_SHAMAN); - break; - case 6: - DoScriptText(SAY_WARLOCK, me); - DoCast(me, SPELL_WARLOCK); - break; - case 7: - DoScriptText(SAY_HUNTER, me); - DoCast(me, SPELL_HUNTER); - break; - case 8: - DoScriptText(SAY_ROGUE, me); - DoCast(me, SPELL_ROGUE); - break; - } - - ClassCall_Timer = 35000 + (rand() % 5000); - } else ClassCall_Timer -= diff; - - //Phase3 begins when we are below X health - if (!Phase3 && (me->GetHealth()*100 / me->GetMaxHealth()) < 20) - { - Phase3 = true; - DoScriptText(SAY_RAISE_SKELETONS, me); - } - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_nefarian(Creature* pCreature) -{ - return new boss_nefarianAI (pCreature); -} - -void AddSC_boss_nefarian() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_nefarian"; - newscript->GetAI = &GetAI_boss_nefarian; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/blackwing_lair/boss_razorgore.cpp b/src/server/scripts/EasternKingdoms/blackwing_lair/boss_razorgore.cpp deleted file mode 100644 index a095756b18b..00000000000 --- a/src/server/scripts/EasternKingdoms/blackwing_lair/boss_razorgore.cpp +++ /dev/null @@ -1,125 +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_Razorgore -SD%Complete: 50 -SDComment: Needs additional review. Phase 1 NYI (Grethok the Controller) -SDCategory: Blackwing Lair -EndScriptData */ - -#include "ScriptedPch.h" - -//Razorgore Phase 2 Script - -#define SAY_EGGS_BROKEN1 -1469022 -#define SAY_EGGS_BROKEN2 -1469023 -#define SAY_EGGS_BROKEN3 -1469024 -#define SAY_DEATH -1469025 - -#define SPELL_CLEAVE 22540 -#define SPELL_WARSTOMP 24375 -#define SPELL_FIREBALLVOLLEY 22425 -#define SPELL_CONFLAGRATION 23023 - -struct boss_razorgoreAI : public ScriptedAI -{ - boss_razorgoreAI(Creature *c) : ScriptedAI(c) {} - - uint32 Cleave_Timer; - uint32 WarStomp_Timer; - uint32 FireballVolley_Timer; - uint32 Conflagration_Timer; - - void Reset() - { - Cleave_Timer = 15000; //These times are probably wrong - WarStomp_Timer = 35000; - FireballVolley_Timer = 7000; - Conflagration_Timer = 12000; - } - - void EnterCombat(Unit * /*who*/) - { - DoZoneInCombat(); - } - - void JustDied(Unit* /*Killer*/) - { - DoScriptText(SAY_DEATH, me); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //Cleave_Timer - if (Cleave_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_CLEAVE); - Cleave_Timer = urand(7000,10000); - } else Cleave_Timer -= diff; - - //WarStomp_Timer - if (WarStomp_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_WARSTOMP); - WarStomp_Timer = urand(15000,25000); - } else WarStomp_Timer -= diff; - - //FireballVolley_Timer - if (FireballVolley_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_FIREBALLVOLLEY); - FireballVolley_Timer = urand(12000,15000); - } else FireballVolley_Timer -= diff; - - //Conflagration_Timer - if (Conflagration_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_CONFLAGRATION); - //We will remove this threat reduction and add an aura check. - - //if (DoGetThreat(me->getVictim())) - //DoModifyThreatPercent(me->getVictim(),-50); - - Conflagration_Timer = 12000; - } else Conflagration_Timer -= diff; - - // Aura Check. If the gamer is affected by confliguration we attack a random gamer. - if (me->getVictim() && me->getVictim()->HasAura(SPELL_CONFLAGRATION)) - if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true)) - me->TauntApply(pTarget); - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_razorgore(Creature* pCreature) -{ - return new boss_razorgoreAI (pCreature); -} - -void AddSC_boss_razorgore() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_razorgore"; - newscript->GetAI = &GetAI_boss_razorgore; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/blackwing_lair/boss_vaelastrasz.cpp b/src/server/scripts/EasternKingdoms/blackwing_lair/boss_vaelastrasz.cpp deleted file mode 100644 index f6e94307f2f..00000000000 --- a/src/server/scripts/EasternKingdoms/blackwing_lair/boss_vaelastrasz.cpp +++ /dev/null @@ -1,262 +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_Vaelastrasz -SD%Complete: 75 -SDComment: Burning Adrenaline not correctly implemented in core -SDCategory: Blackwing Lair -EndScriptData */ - -#include "ScriptedPch.h" - -#define SAY_LINE1 -1469026 -#define SAY_LINE2 -1469027 -#define SAY_LINE3 -1469028 -#define SAY_HALFLIFE -1469029 -#define SAY_KILLTARGET -1469030 - -#define GOSSIP_ITEM "Start Event " - -#define SPELL_ESSENCEOFTHERED 23513 -#define SPELL_FLAMEBREATH 23461 -#define SPELL_FIRENOVA 23462 -#define SPELL_TAILSWIPE 15847 -#define SPELL_BURNINGADRENALINE 23620 -#define SPELL_CLEAVE 20684 //Chain cleave is most likely named something different and contains a dummy effect - -struct boss_vaelAI : public ScriptedAI -{ - boss_vaelAI(Creature *c) : ScriptedAI(c) - { - c->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - c->setFaction(35); - c->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - } - - uint64 PlayerGUID; - uint32 SpeechTimer; - uint32 SpeechNum; - uint32 Cleave_Timer; - uint32 FlameBreath_Timer; - uint32 FireNova_Timer; - uint32 BurningAdrenalineCaster_Timer; - uint32 BurningAdrenalineTank_Timer; - uint32 TailSwipe_Timer; - bool HasYelled; - bool DoingSpeech; - - void Reset() - { - PlayerGUID = 0; - SpeechTimer = 0; - SpeechNum = 0; - Cleave_Timer = 8000; //These times are probably wrong - FlameBreath_Timer = 11000; - BurningAdrenalineCaster_Timer = 15000; - BurningAdrenalineTank_Timer = 45000; - FireNova_Timer = 5000; - TailSwipe_Timer = 20000; - HasYelled = false; - DoingSpeech = false; - } - - void BeginSpeech(Unit *pTarget) - { - //Stand up and begin speach - PlayerGUID = pTarget->GetGUID(); - - //10 seconds - DoScriptText(SAY_LINE1, me); - - SpeechTimer = 10000; - SpeechNum = 0; - DoingSpeech = true; - - me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - } - - void KilledUnit(Unit * victim) - { - if (rand()%5) - return; - - DoScriptText(SAY_KILLTARGET, me, victim); - } - - void EnterCombat(Unit * /*who*/) - { - DoCast(me, SPELL_ESSENCEOFTHERED); - DoZoneInCombat(); - me->SetHealth(int(me->GetMaxHealth()*.3)); - } - - void UpdateAI(const uint32 diff) - { - //Speech - if (DoingSpeech) - { - if (SpeechTimer <= diff) - { - switch (SpeechNum) - { - case 0: - //16 seconds till next line - DoScriptText(SAY_LINE2, me); - SpeechTimer = 16000; - ++SpeechNum; - break; - case 1: - //This one is actually 16 seconds but we only go to 10 seconds because he starts attacking after he says "I must fight this!" - DoScriptText(SAY_LINE3, me); - SpeechTimer = 10000; - ++SpeechNum; - break; - case 2: - me->setFaction(103); - if (PlayerGUID && Unit::GetUnit((*me),PlayerGUID)) - { - AttackStart(Unit::GetUnit((*me),PlayerGUID)); - DoCast(me, SPELL_ESSENCEOFTHERED); - } - SpeechTimer = 0; - DoingSpeech = false; - break; - } - } else SpeechTimer -= diff; - } - - //Return since we have no target - if (!UpdateVictim()) - return; - - // Yell if hp lower than 15% - if (me->GetHealth()*100 / me->GetMaxHealth() < 15 && !HasYelled) - { - DoScriptText(SAY_HALFLIFE, me); - HasYelled = true; - } - - //Cleave_Timer - if (Cleave_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_CLEAVE); - Cleave_Timer = 15000; - } else Cleave_Timer -= diff; - - //FlameBreath_Timer - if (FlameBreath_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_FLAMEBREATH); - FlameBreath_Timer = urand(4000,8000); - } else FlameBreath_Timer -= diff; - - //BurningAdrenalineCaster_Timer - if (BurningAdrenalineCaster_Timer <= diff) - { - Unit *pTarget = NULL; - - uint8 i = 0; - while (i < 3) // max 3 tries to get a random target with power_mana - { - ++i; - pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true); //not aggro leader - if (pTarget && pTarget->getPowerType() == POWER_MANA) - i = 3; - } - if (pTarget) // cast on self (see below) - pTarget->CastSpell(pTarget,SPELL_BURNINGADRENALINE,1); - - BurningAdrenalineCaster_Timer = 15000; - } else BurningAdrenalineCaster_Timer -= diff; - - //BurningAdrenalineTank_Timer - if (BurningAdrenalineTank_Timer <= diff) - { - // have the victim cast the spell on himself otherwise the third effect aura will be applied - // to Vael instead of the player - me->getVictim()->CastSpell(me->getVictim(),SPELL_BURNINGADRENALINE,1); - - BurningAdrenalineTank_Timer = 45000; - } else BurningAdrenalineTank_Timer -= diff; - - //FireNova_Timer - if (FireNova_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_FIRENOVA); - FireNova_Timer = 5000; - } else FireNova_Timer -= diff; - - //TailSwipe_Timer - if (TailSwipe_Timer <= diff) - { - //Only cast if we are behind - /*if (!me->HasInArc(M_PI, me->getVictim())) - { - DoCast(me->getVictim(), SPELL_TAILSWIPE); - }*/ - - TailSwipe_Timer = 20000; - } else TailSwipe_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -void SendDefaultMenu_boss_vael(Player* pPlayer, Creature* pCreature, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) //Fight time - { - pPlayer->CLOSE_GOSSIP_MENU(); - CAST_AI(boss_vaelAI, pCreature->AI())->BeginSpeech(pPlayer); - } -} - -bool GossipSelect_boss_vael(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - if (uiSender == GOSSIP_SENDER_MAIN) - SendDefaultMenu_boss_vael(pPlayer, pCreature, uiAction); - - return true; -} - -bool GossipHello_boss_vael(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - - 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; -} - -CreatureAI* GetAI_boss_vael(Creature* pCreature) -{ - return new boss_vaelAI (pCreature); -} - -void AddSC_boss_vael() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_vaelastrasz"; - newscript->GetAI = &GetAI_boss_vael; - newscript->pGossipHello = &GossipHello_boss_vael; - newscript->pGossipSelect = &GossipSelect_boss_vael; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/blackwing_lair/boss_victor_nefarius.cpp b/src/server/scripts/EasternKingdoms/blackwing_lair/boss_victor_nefarius.cpp deleted file mode 100644 index dfeb2519bae..00000000000 --- a/src/server/scripts/EasternKingdoms/blackwing_lair/boss_victor_nefarius.cpp +++ /dev/null @@ -1,385 +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_Victor_Nefarius -SD%Complete: 75 -SDComment: Missing some text, Vael beginning event, and spawns Nef in wrong place -SDCategory: Blackwing Lair -EndScriptData */ - -#include "ScriptedPch.h" - -#define SAY_GAMESBEGIN_1 -1469004 -#define SAY_GAMESBEGIN_2 -1469005 -#define SAY_VAEL_INTRO -1469006 //when he corrupts Vaelastrasz - -#define GOSSIP_ITEM_1 "I've made no mistakes." -#define GOSSIP_ITEM_2 "You have lost your mind, Nefarius. You speak in riddles." -#define GOSSIP_ITEM_3 "Please do." - -#define CREATURE_BRONZE_DRAKANOID 14263 -#define CREATURE_BLUE_DRAKANOID 14261 -#define CREATURE_RED_DRAKANOID 14264 -#define CREATURE_GREEN_DRAKANOID 14262 -#define CREATURE_BLACK_DRAKANOID 14265 - -#define CREATURE_CHROMATIC_DRAKANOID 14302 -#define CREATURE_NEFARIAN 11583 - -#define ADD_X1 -7591.151855 -#define ADD_X2 -7514.598633 -#define ADD_Y1 -1204.051880 -#define ADD_Y2 -1150.448853 -#define ADD_Z1 476.800476 -#define ADD_Z2 476.796570 - -#define NEF_X -7445 -#define NEF_Y -1332 -#define NEF_Z 536 - -#define HIDE_X -7592 -#define HIDE_Y -1264 -#define HIDE_Z 481 - -#define SPELL_SHADOWBOLT 21077 -#define SPELL_FEAR 26070 - -//This script is complicated -//Instead of morphing Victor Nefarius we will have him control phase 1 -//And then have him spawn "Nefarian" for phase 2 -//When phase 2 starts Victor Nefarius will go into hiding and stop attacking -//If Nefarian despawns because he killed the players then this guy will EnterEvadeMode -//and allow players to start the event over -//If nefarian dies then he will kill himself then he will kill himself in his hiding place -//To prevent players from doing the event twice - -struct boss_victor_nefariusAI : public ScriptedAI -{ - boss_victor_nefariusAI(Creature *c) : ScriptedAI(c) - { - NefarianGUID = 0; - switch (urand(0,19)) - { - case 0: - DrakType1 = CREATURE_BRONZE_DRAKANOID; - DrakType2 = CREATURE_BLUE_DRAKANOID; - break; - case 1: - DrakType1 = CREATURE_BRONZE_DRAKANOID; - DrakType2 = CREATURE_RED_DRAKANOID; - break; - case 2: - DrakType1 = CREATURE_BRONZE_DRAKANOID; - DrakType2 = CREATURE_GREEN_DRAKANOID; - break; - case 3: - DrakType1 = CREATURE_BRONZE_DRAKANOID; - DrakType2 = CREATURE_BLACK_DRAKANOID; - break; - case 4: - DrakType1 = CREATURE_BLUE_DRAKANOID; - DrakType2 = CREATURE_BRONZE_DRAKANOID; - break; - case 5: - DrakType1 = CREATURE_BLUE_DRAKANOID; - DrakType2 = CREATURE_RED_DRAKANOID; - break; - case 6: - DrakType1 = CREATURE_BLUE_DRAKANOID; - DrakType2 = CREATURE_GREEN_DRAKANOID; - break; - case 7: - DrakType1 = CREATURE_BLUE_DRAKANOID; - DrakType2 = CREATURE_BLACK_DRAKANOID; - break; - case 8: - DrakType1 = CREATURE_RED_DRAKANOID; - DrakType2 = CREATURE_BRONZE_DRAKANOID; - break; - case 9: - DrakType1 = CREATURE_RED_DRAKANOID; - DrakType2 = CREATURE_BLUE_DRAKANOID; - break; - case 10: - DrakType1 = CREATURE_RED_DRAKANOID; - DrakType2 = CREATURE_GREEN_DRAKANOID; - break; - case 11: - DrakType1 = CREATURE_RED_DRAKANOID; - DrakType2 = CREATURE_BLACK_DRAKANOID; - break; - case 12: - DrakType1 = CREATURE_GREEN_DRAKANOID; - DrakType2 = CREATURE_BRONZE_DRAKANOID; - break; - case 13: - DrakType1 = CREATURE_GREEN_DRAKANOID; - DrakType2 = CREATURE_BLUE_DRAKANOID; - break; - case 14: - DrakType1 = CREATURE_GREEN_DRAKANOID; - DrakType2 = CREATURE_RED_DRAKANOID; - break; - case 15: - DrakType1 = CREATURE_GREEN_DRAKANOID; - DrakType2 = CREATURE_BLACK_DRAKANOID; - break; - case 16: - DrakType1 = CREATURE_BLACK_DRAKANOID; - DrakType2 = CREATURE_BRONZE_DRAKANOID; - break; - case 17: - DrakType1 = CREATURE_BLACK_DRAKANOID; - DrakType2 = CREATURE_BLUE_DRAKANOID; - break; - case 18: - DrakType1 = CREATURE_BLACK_DRAKANOID; - DrakType2 = CREATURE_GREEN_DRAKANOID; - break; - case 19: - DrakType1 = CREATURE_BLACK_DRAKANOID; - DrakType2 = CREATURE_RED_DRAKANOID; - break; - } - } - - uint32 SpawnedAdds; - uint32 AddSpawnTimer; - uint32 ShadowBoltTimer; - uint32 FearTimer; - uint32 MindControlTimer; - uint32 ResetTimer; - uint32 DrakType1; - uint32 DrakType2; - uint64 NefarianGUID; - uint32 NefCheckTime; - - void Reset() - { - SpawnedAdds = 0; - AddSpawnTimer = 10000; - ShadowBoltTimer = 5000; - FearTimer = 8000; - ResetTimer = 900000; //On official it takes him 15 minutes(900 seconds) to reset. We are only doing 1 minute to make testing easier - NefarianGUID = 0; - NefCheckTime = 2000; - - me->SetUInt32Value(UNIT_NPC_FLAGS,1); - me->setFaction(35); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - } - - void BeginEvent(Player *pTarget) - { - DoScriptText(SAY_GAMESBEGIN_2, me); - - //Trinity::Singleton::Instance().GetMap(me->GetMapId(), me)->GetPlayers().begin(); - /* - list ::const_iterator i = MapManager::Instance().GetMap(me->GetMapId(), me)->GetPlayers().begin(); - - for (i = MapManager::Instance().GetMap(me->GetMapId(), me)->GetPlayers().begin(); i != MapManager::Instance().GetMap(me->GetMapId(), me)->GetPlayers().end(); ++i) - { - AttackStart((*i)); - } - */ - me->SetUInt32Value(UNIT_NPC_FLAGS,0); - me->setFaction(103); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - AttackStart(pTarget); - } - - void EnterCombat(Unit * /*who*/) - { - } - - void MoveInLineOfSight(Unit *who) - { - //We simply use this function to find players until we can use pMap->GetPlayers() - - if (who && who->GetTypeId() == TYPEID_PLAYER && me->IsHostileTo(who)) - { - //Add them to our threat list - me->AddThreat(who, 0.0f); - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //Only do this if we haven't spawned nef yet - if (SpawnedAdds < 42) - { - //ShadowBoltTimer - if (ShadowBoltTimer <= diff) - { - if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) - DoCast(pTarget, SPELL_SHADOWBOLT); - - ShadowBoltTimer = urand(3000,10000); - } else ShadowBoltTimer -= diff; - - //FearTimer - if (FearTimer <= diff) - { - if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) - DoCast(pTarget, SPELL_FEAR); - - FearTimer = 10000 + (rand()%10000); - } else FearTimer -= diff; - - //Add spawning mechanism - if (AddSpawnTimer <= diff) - { - //Spawn 2 random types of creatures at the 2 locations - uint32 CreatureID; - Creature* Spawned = NULL; - Unit *pTarget = NULL; - - //1 in 3 chance it will be a chromatic - if (urand(0,2) == 0) - CreatureID = CREATURE_CHROMATIC_DRAKANOID; - else - CreatureID = DrakType1; - - ++SpawnedAdds; - - //Spawn Creature and force it to start attacking a random target - Spawned = me->SummonCreature(CreatureID,ADD_X1,ADD_Y1,ADD_Z1,5.000,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); - pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); - if (pTarget && Spawned) - { - Spawned->AI()->AttackStart(pTarget); - Spawned->setFaction(103); - } - - //1 in 3 chance it will be a chromatic - if (urand(0,2) == 0) - CreatureID = CREATURE_CHROMATIC_DRAKANOID; - else - CreatureID = DrakType2; - - ++SpawnedAdds; - - Spawned = me->SummonCreature(CreatureID,ADD_X2,ADD_Y2,ADD_Z2,5.000,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); - pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); - if (pTarget && Spawned) - { - Spawned->AI()->AttackStart(pTarget); - Spawned->setFaction(103); - } - - //Begin phase 2 by spawning Nefarian and what not - if (SpawnedAdds >= 42) - { - //Teleport Victor Nefarius way out of the map - //MapManager::Instance().GetMap(me->GetMapId(), me)->CreatureRelocation(me,0,0,-5000,0); - - //Inturrupt any spell casting - me->InterruptNonMeleeSpells(false); - - //Root self - DoCast(me, 33356); - - //Make super invis - DoCast(me, 8149); - - //Teleport self to a hiding spot (this causes errors in the Trinity log but no real issues) - DoTeleportTo(HIDE_X,HIDE_Y,HIDE_Z); - me->addUnitState(UNIT_STAT_FLEEING); - - //Spawn nef and have him attack a random target - Creature* Nefarian = me->SummonCreature(CREATURE_NEFARIAN,NEF_X,NEF_Y,NEF_Z,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,120000); - pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); - if (pTarget && Nefarian) - { - Nefarian->AI()->AttackStart(pTarget); - Nefarian->setFaction(103); - NefarianGUID = Nefarian->GetGUID(); - } - else error_log("TSCR: Blackwing Lair: Unable to spawn nefarian properly."); - } - - AddSpawnTimer = 4000; - } else AddSpawnTimer -= diff; - } - else if (NefarianGUID) - { - if (NefCheckTime <= diff) - { - Unit* Nefarian = Unit::GetCreature((*me),NefarianGUID); - - //If nef is dead then we die to so the players get out of combat - //and cannot repeat the event - if (!Nefarian || !Nefarian->isAlive()) - { - NefarianGUID = 0; - me->ForcedDespawn(); - } - - NefCheckTime = 2000; - } else NefCheckTime -= diff; - } - } -}; - -CreatureAI* GetAI_boss_victor_nefarius(Creature* pCreature) -{ - return new boss_victor_nefariusAI (pCreature); -} - -bool GossipHello_boss_victor_nefarius(Player* pPlayer, Creature* pCreature) -{ - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_1 , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - pPlayer->SEND_GOSSIP_MENU(7134, pCreature->GetGUID()); - return true; -} - -bool GossipSelect_boss_victor_nefarius(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction) -{ - switch (uiAction) - { - case GOSSIP_ACTION_INFO_DEF+1: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - pPlayer->SEND_GOSSIP_MENU(7198, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); - pPlayer->SEND_GOSSIP_MENU(7199, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+3: - pPlayer->CLOSE_GOSSIP_MENU(); - DoScriptText(SAY_GAMESBEGIN_1, pCreature); - CAST_AI(boss_victor_nefariusAI, pCreature->AI())->BeginEvent(pPlayer); - break; - } - return true; -} - -void AddSC_boss_victor_nefarius() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "boss_victor_nefarius"; - newscript->GetAI = &GetAI_boss_victor_nefarius; - newscript->pGossipHello = &GossipHello_boss_victor_nefarius; - newscript->pGossipSelect = &GossipSelect_boss_victor_nefarius; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/blackwing_lair/instance_blackwing_lair.cpp b/src/server/scripts/EasternKingdoms/blackwing_lair/instance_blackwing_lair.cpp deleted file mode 100644 index d6403fa1206..00000000000 --- a/src/server/scripts/EasternKingdoms/blackwing_lair/instance_blackwing_lair.cpp +++ /dev/null @@ -1,25 +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_Blackwing_Lair -SD%Complete: 0 -SDComment: -SDCategory: Blackwing Lair -EndScriptData */ - -#include "ScriptedPch.h" - diff --git a/src/server/scripts/EasternKingdoms/deadmines/boss_mr_smite.cpp b/src/server/scripts/EasternKingdoms/deadmines/boss_mr_smite.cpp deleted file mode 100644 index 5c6bab46e5a..00000000000 --- a/src/server/scripts/EasternKingdoms/deadmines/boss_mr_smite.cpp +++ /dev/null @@ -1,182 +0,0 @@ -/* -* Copyright (C) 2008-2010 Trinity -* -* 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 Mr.Smite -SD%Complete: -SDComment: Timers and say taken from acid script -EndScriptData */ - -#include "ScriptedPch.h" -#include "deadmines.h" - -enum eSpels -{ - SPELL_TRASH = 3391, - SPELL_SMITE_STOMP = 6432, - SPELL_SMITE_SLAM = 6435, - SPELL_NIMBLE_REFLEXES = 6264, - - EQUIP_SWORD = 5191, - EQUIP_MACE = 7230, - - SAY_AGGRO = -1036001 -}; - -struct boss_mr_smiteAI : public ScriptedAI -{ - boss_mr_smiteAI(Creature* pCreature) : ScriptedAI(pCreature) - { - pInstance = pCreature->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint32 uiTrashTimer; - uint32 uiSlamTimer; - uint32 uiNimbleReflexesTimer; - - uint8 uiHealth; - - uint32 uiPhase; - uint32 uiTimer; - - void Reset() - { - uiTrashTimer = urand(5000,9000); - uiSlamTimer = 9000; - uiNimbleReflexesTimer = urand(15500,31600); - - uiHealth = 0; - - uiPhase = 0; - uiTimer = 0; - - SetEquipmentSlots(false, EQUIP_SWORD, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); - } - - void EnterCombat(Unit* /*pWho*/) - { - DoScriptText(SAY_AGGRO, me); - } - - bool bCheckChances() - { - uint32 uiChances = urand(0,99); - if (uiChances <= 15) - return false; - else - return true; - } - - void UpdateAI(const uint32 uiDiff) - { - if (!UpdateVictim()) - return; - - /*START ACID-AI*/ - if (uiTrashTimer <= uiDiff) - { - if (bCheckChances()) - DoCast(me, SPELL_TRASH); - uiTrashTimer = urand(6000,15500); - } else uiTrashTimer -= uiDiff; - - if (uiSlamTimer <= uiDiff) - { - if (bCheckChances()) - DoCast(me->getVictim(), SPELL_SMITE_SLAM); - uiSlamTimer = 11000; - } else uiSlamTimer -= uiDiff; - - if (uiNimbleReflexesTimer <= uiDiff) - { - if (bCheckChances()) - DoCast(me, SPELL_NIMBLE_REFLEXES); - uiNimbleReflexesTimer = urand(27300,60100); - } else uiNimbleReflexesTimer -= uiDiff; - /*END ACID-AI*/ - - if (uiHealth == 0 && me->GetHealth()*100 / me->GetMaxHealth() <= 66 || uiHealth == 1 && me->GetHealth()*100 / me->GetMaxHealth() <= 33) - { - ++uiHealth; - DoCastAOE(SPELL_SMITE_STOMP,false); - SetCombatMovement(false); - if (pInstance) - if (GameObject* pGo = GameObject::GetGameObject((*me),pInstance->GetData64(DATA_SMITE_CHEST))) - { - me->GetMotionMaster()->Clear(); - me->GetMotionMaster()->MovePoint(1,-3.00+pGo->GetPositionX(),pGo->GetPositionY(),pGo->GetPositionZ()); - } - } - - if (uiPhase) - { - if (uiTimer <= uiDiff) - { - switch(uiPhase) - { - case 1: - me->HandleEmoteCommand(EMOTE_STATE_KNEEL); //dosen't work? - uiTimer = 1000; - uiPhase = 2; - break; - case 2: - if (uiHealth == 1) - SetEquipmentSlots(false, EQUIP_SWORD, EQUIP_SWORD, EQUIP_NO_CHANGE); - else - SetEquipmentSlots(false, EQUIP_MACE, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); - uiTimer = 500; - uiPhase = 3; - break; - case 3: - SetCombatMovement(true); - me->GetMotionMaster()->MoveChase(me->getVictim(), me->m_CombatDistance); - uiPhase = 0; - break; - - } - } else uiTimer -= uiDiff; - } - - DoMeleeAttackIfReady(); - } - - void MovementInform(uint32 uiType, uint32 /*uiId*/) - { - if (uiType != POINT_MOTION_TYPE) - return; - - uiTimer = 1500; - uiPhase = 1; - } - -}; -CreatureAI* GetAI_boss_mr_smite(Creature* pCreature) -{ - return new boss_mr_smiteAI (pCreature); -} - -void AddSC_boss_mr_smite() -{ - Script* newscript; - newscript = new Script; - newscript->Name = "boss_mr_smite"; - newscript->GetAI = &GetAI_boss_mr_smite; - newscript->RegisterSelf(); -} diff --git a/src/server/scripts/EasternKingdoms/deadmines/deadmines.cpp b/src/server/scripts/EasternKingdoms/deadmines/deadmines.cpp deleted file mode 100644 index 5bc1121bead..00000000000 --- a/src/server/scripts/EasternKingdoms/deadmines/deadmines.cpp +++ /dev/null @@ -1,60 +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: Deadmines -SD%Complete: 0 -SDComment: Placeholder -SDCategory: Deadmines -EndScriptData */ - -#include "ScriptedPch.h" -#include "deadmines.h" -#include "Spell.h" - -/*##### -# item_Defias_Gunpowder -#####*/ - -bool ItemUse_item_defias_gunpowder(Player* pPlayer, Item* pItem, SpellCastTargets const& targets) -{ - ScriptedInstance *pInstance = pPlayer->GetInstanceData(); - - if (!pInstance) - { - pPlayer->GetSession()->SendNotification("Instance script not initialized"); - return true; - } - if (pInstance->GetData(EVENT_STATE)!= CANNON_NOT_USED) - return false; - if (targets.getGOTarget() && targets.getGOTarget()->GetTypeId() == TYPEID_GAMEOBJECT && - targets.getGOTarget()->GetEntry() == GO_DEFIAS_CANNON) - { - pInstance->SetData(EVENT_STATE, CANNON_GUNPOWDER_USED); - } - - pPlayer->DestroyItemCount(pItem->GetEntry(), 1, true); - return true; -} - -void AddSC_deadmines() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "item_defias_gunpowder"; - newscript->pItemUse = &ItemUse_item_defias_gunpowder; - newscript->RegisterSelf(); -} diff --git a/src/server/scripts/EasternKingdoms/deadmines/deadmines.h b/src/server/scripts/EasternKingdoms/deadmines/deadmines.h deleted file mode 100644 index 203494ad5b7..00000000000 --- a/src/server/scripts/EasternKingdoms/deadmines/deadmines.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef DEF_DEADMINES_H -#define DEF_DEADMINES_H - -#include "ScriptedPch.h" - -enum CannonState -{ - CANNON_NOT_USED, - CANNON_GUNPOWDER_USED, - CANNON_BLAST_INITIATED, - PIRATES_ATTACK, - EVENT_DONE -}; - -enum Data -{ - EVENT_STATE, - EVENT_RHAHKZOR -}; - -enum Data64 -{ - DATA_SMITE_CHEST -}; - -enum GameObjects -{ - GO_FACTORY_DOOR = 13965, - GO_IRONCLAD_DOOR = 16397, - GO_DEFIAS_CANNON = 16398, - GO_DOOR_LEVER = 101833, - GO_MR_SMITE_CHEST = 144111 -}; -#endif - diff --git a/src/server/scripts/EasternKingdoms/deadmines/instance_deadmines.cpp b/src/server/scripts/EasternKingdoms/deadmines/instance_deadmines.cpp deleted file mode 100644 index f1aa0c62b8a..00000000000 --- a/src/server/scripts/EasternKingdoms/deadmines/instance_deadmines.cpp +++ /dev/null @@ -1,256 +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: Instance_Deadmines -SD%Complete: 100 -SDComment: -SDCategory: Deadmines -EndScriptData */ - -#include "ScriptedPch.h" -#include "deadmines.h" - -enum Sounds -{ - SOUND_CANNONFIRE = 1400, - SOUND_DESTROYDOOR = 3079, - SOUND_MR_SMITE_ALARM1 = 5775, - SOUND_MR_SMITE_ALARM2 = 5777 -}; - -#define SAY_MR_SMITE_ALARM1 "You there, check out that noise!" -#define SAY_MR_SMITE_ALARM2 "We're under attack! A vast, ye swabs! Repel the invaders!" - -enum Misc -{ - DATA_CANNON_BLAST_TIMER = 3000, - DATA_PIRATES_DELAY_TIMER = 1000 -}; - -struct instance_deadmines : public ScriptedInstance -{ - instance_deadmines(Map* pMap) : ScriptedInstance(pMap) { Initialize(); }; - - uint64 FactoryDoorGUID; - uint64 IronCladDoorGUID; - uint64 DefiasCannonGUID; - uint64 DoorLeverGUID; - uint64 DefiasPirate1GUID; - uint64 DefiasPirate2GUID; - uint64 DefiasCompanionGUID; - - uint32 State; - uint32 CannonBlast_Timer; - uint32 PiratesDelay_Timer; - uint64 uiSmiteChestGUID; - - void Initialize() - { - FactoryDoorGUID = 0; - IronCladDoorGUID = 0; - DefiasCannonGUID = 0; - DoorLeverGUID = 0; - DefiasPirate1GUID = 0; - DefiasPirate2GUID = 0; - DefiasCompanionGUID = 0; - - State = CANNON_NOT_USED; - uiSmiteChestGUID = 0; - } - - virtual void Update(uint32 diff) - { - if (!IronCladDoorGUID || !DefiasCannonGUID || !DoorLeverGUID) - return; - - GameObject *pIronCladDoor = instance->GetGameObject(IronCladDoorGUID); - if (!pIronCladDoor) - return; - - switch (State) - { - case CANNON_GUNPOWDER_USED: - CannonBlast_Timer = DATA_CANNON_BLAST_TIMER; - // it's a hack - Mr. Smite should do that but his too far away - pIronCladDoor->SetName("Mr. Smite"); - pIronCladDoor->MonsterYell(SAY_MR_SMITE_ALARM1, LANG_UNIVERSAL, 0); - DoPlaySound(pIronCladDoor, SOUND_MR_SMITE_ALARM1); - State = CANNON_BLAST_INITIATED; - break; - case CANNON_BLAST_INITIATED: - PiratesDelay_Timer = DATA_PIRATES_DELAY_TIMER; - if (CannonBlast_Timer <= diff) - { - SummonCreatures(); - ShootCannon(); - BlastOutDoor(); - LeverStucked(); - pIronCladDoor->MonsterYell(SAY_MR_SMITE_ALARM2, LANG_UNIVERSAL, 0); - DoPlaySound(pIronCladDoor, SOUND_MR_SMITE_ALARM2); - State = PIRATES_ATTACK; - } else CannonBlast_Timer -= diff; - break; - case PIRATES_ATTACK: - if (PiratesDelay_Timer <= diff) - { - MoveCreaturesInside(); - State = EVENT_DONE; - } else PiratesDelay_Timer -= diff; - break; - } - } - - void SummonCreatures() - { - if (GameObject *pIronCladDoor = instance->GetGameObject(IronCladDoorGUID)) - { - Creature *DefiasPirate1 = pIronCladDoor->SummonCreature(657,pIronCladDoor->GetPositionX() - 2,pIronCladDoor->GetPositionY()-7,pIronCladDoor->GetPositionZ(), 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000); - Creature *DefiasPirate2 = pIronCladDoor->SummonCreature(657,pIronCladDoor->GetPositionX() + 3,pIronCladDoor->GetPositionY()-6,pIronCladDoor->GetPositionZ(), 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000); - Creature *DefiasCompanion = pIronCladDoor->SummonCreature(3450,pIronCladDoor->GetPositionX() + 2,pIronCladDoor->GetPositionY()-6,pIronCladDoor->GetPositionZ(), 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000); - - DefiasPirate1GUID = DefiasPirate1->GetGUID(); - DefiasPirate2GUID = DefiasPirate2->GetGUID(); - DefiasCompanionGUID = DefiasCompanion->GetGUID(); - } - } - - void MoveCreaturesInside() - { - if (!DefiasPirate1GUID || !DefiasPirate2GUID || !DefiasCompanionGUID) - return; - - Creature *pDefiasPirate1 = instance->GetCreature(DefiasPirate1GUID); - Creature *pDefiasPirate2 = instance->GetCreature(DefiasPirate2GUID); - Creature *pDefiasCompanion = instance->GetCreature(DefiasCompanionGUID); - if (!pDefiasPirate1 || !pDefiasPirate2 || !pDefiasCompanion) - return; - - MoveCreatureInside(pDefiasPirate1); - MoveCreatureInside(pDefiasPirate2); - MoveCreatureInside(pDefiasCompanion); - } - - void MoveCreatureInside(Creature* pCreature) - { - pCreature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - pCreature->GetMotionMaster()->MovePoint(0, -102.7,-655.9, pCreature->GetPositionZ()); - } - - void ShootCannon() - { - if (GameObject *pDefiasCannon = instance->GetGameObject(DefiasCannonGUID)) - { - pDefiasCannon->SetGoState(GO_STATE_ACTIVE); - DoPlaySound(pDefiasCannon, SOUND_CANNONFIRE); - } - } - - void BlastOutDoor() - { - if (GameObject *pIronCladDoor = instance->GetGameObject(IronCladDoorGUID)) - { - pIronCladDoor->SetGoState(GO_STATE_ACTIVE_ALTERNATIVE); - DoPlaySound(pIronCladDoor, SOUND_DESTROYDOOR); - } - } - - void LeverStucked() - { - if (GameObject *pDoorLever = instance->GetGameObject(DoorLeverGUID)) - pDoorLever->SetUInt32Value(GAMEOBJECT_FLAGS, 4); - } - - void OnGameObjectCreate(GameObject* pGo, bool /*add*/) - { - switch(pGo->GetEntry()) - { - case GO_FACTORY_DOOR: FactoryDoorGUID = pGo->GetGUID(); break; - case GO_IRONCLAD_DOOR: IronCladDoorGUID = pGo->GetGUID(); break; - case GO_DEFIAS_CANNON: DefiasCannonGUID = pGo->GetGUID(); break; - case GO_DOOR_LEVER: DoorLeverGUID = pGo->GetGUID(); break; - case GO_MR_SMITE_CHEST: uiSmiteChestGUID = pGo->GetGUID(); break; - } - } - - void SetData(uint32 type, uint32 data) - { - switch (type) - { - case EVENT_STATE: - if (DefiasCannonGUID && IronCladDoorGUID) - State=data; - break; - case EVENT_RHAHKZOR: - if (data == DONE) - if (GameObject* pGo = instance->GetGameObject(FactoryDoorGUID)) - pGo->SetGoState(GO_STATE_ACTIVE); - break; - } - } - - uint32 GetData(uint32 type) - { - switch (type) - { - case EVENT_STATE: - return State; - } - - return 0; - } - - uint64 GetData64(uint32 data) - { - switch (data) - { - case DATA_SMITE_CHEST: - return uiSmiteChestGUID; - } - - return 0; - } - - void DoPlaySound(GameObject* unit, uint32 sound) - { - WorldPacket data(4); - data.SetOpcode(SMSG_PLAY_SOUND); - data << uint32(sound); - unit->SendMessageToSet(&data,false); - } - - void DoPlaySoundCreature(Unit* unit, uint32 sound) - { - WorldPacket data(4); - data.SetOpcode(SMSG_PLAY_SOUND); - data << uint32(sound); - unit->SendMessageToSet(&data,false); - } -}; - -InstanceData* GetInstanceData_instance_deadmines(Map* pMap) -{ - return new instance_deadmines(pMap); -} - -void AddSC_instance_deadmines() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_deadmines"; - newscript->GetInstanceData = &GetInstanceData_instance_deadmines; - newscript->RegisterSelf(); -} diff --git a/src/server/scripts/EasternKingdoms/gnomeregan/gnomeregan.cpp b/src/server/scripts/EasternKingdoms/gnomeregan/gnomeregan.cpp deleted file mode 100644 index c39bfb69910..00000000000 --- a/src/server/scripts/EasternKingdoms/gnomeregan/gnomeregan.cpp +++ /dev/null @@ -1,593 +0,0 @@ -/* - * Copyright (C) 2010 Trinity - * - * 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 - */ - -/* Script Data Start -SDName: Gnomeregan -SDAuthor: Manuel -SD%Complete: 90% -SDComment: Some visual effects are not implemented. -Script Data End */ - -#include "ScriptedPch.h" -#include "gnomeregan.h" -#include "ScriptedEscortAI.h" - -#define GOSSIP_START_EVENT "I am ready to being" - -enum eBlastmasterEmiShortfuse -{ - GOSSIP_TEXT_EMI = 1693, - - SAY_BLASTMASTER_0 = -1090000, - SAY_BLASTMASTER_1 = -1090001, - SAY_BLASTMASTER_2 = -1090002, - SAY_BLASTMASTER_3 = -1090003, - SAY_BLASTMASTER_4 = -1090004, - SAY_BLASTMASTER_5 = -1090005, - SAY_BLASTMASTER_6 = -1090006, - SAY_BLASTMASTER_7 = -1090007, - SAY_BLASTMASTER_8 = -1090008, - SAY_BLASTMASTER_9 = -1090009, - SAY_BLASTMASTER_10 = -1090010, - SAY_BLASTMASTER_11 = -1090011, - SAY_BLASTMASTER_12 = -1090012, - SAY_BLASTMASTER_13 = -1090013, - SAY_BLASTMASTER_14 = -1090014, - SAY_BLASTMASTER_15 = -1090015, - SAY_BLASTMASTER_16 = -1090016, - SAY_BLASTMASTER_17 = -1090017, - SAY_BLASTMASTER_18 = -1090018, - SAY_BLASTMASTER_19 = -1090019, - SAY_BLASTMASTER_20 = -1090020, - SAY_BLASTMASTER_21 = -1090021, - SAY_BLASTMASTER_22 = -1090022, - SAY_BLASTMASTER_23 = -1090023, - SAY_BLASTMASTER_24 = -1090024, - SAY_BLASTMASTER_25 = -1090025, - SAY_BLASTMASTER_26 = -1090026, - SAY_BLASTMASTER_27 = -1090027, - - SAY_GRUBBIS = -1090028 -}; - -const Position SpawnPosition[] = -{ - {-557.630,-114.514,-152.209,0.641}, - {-555.263,-113.802,-152.737,0.311}, - {-552.154,-112.476,-153.349,0.621}, - {-548.692,-111.089,-154.090,0.621}, - {-546.905,-108.340,-154.877,0.729}, - {-547.736,-105.154,-155.176,0.372}, - {-547.274,-114.109,-153.952,0.735}, - {-552.534,-110.012,-153.577,0.747}, - {-550.708,-116.436,-153.103,0.679}, - {-554.030,-115.983,-152.635,0.695}, - {-494.595,-87.516,149.116,3.344}, - {-493.349,-90.845,-148.882,3.717}, - {-491.995,-87.619,-148.197,3.230}, - {-490.732,-90.739,-148.091,3.230}, - {-490.554,-89.114,-148.055,3.230}, - {-495.240,-90.808,-149.493,3.238}, - {-494.195,-89.553,-149.131,3.254} -}; - -struct npc_blastmaster_emi_shortfuseAI : public npc_escortAI -{ - npc_blastmaster_emi_shortfuseAI(Creature* pCreature) : npc_escortAI(pCreature) - { - pInstance = pCreature->GetInstanceData(); - pCreature->RestoreFaction(); - Reset(); - } - - ScriptedInstance* pInstance; - - uint8 uiPhase; - uint32 uiTimer; - - std::list SummonList; - std::list GoSummonList; - - void Reset() - { - if (!HasEscortState(STATE_ESCORT_ESCORTING)) - { - uiTimer = 0; - uiPhase = 0; - - RestoreAll(); - - SummonList.clear(); - GoSummonList.clear(); - } - } - - void NextStep(uint32 uiTimerStep,bool bNextStep = true,uint8 uiPhaseStep = 0) - { - uiTimer = uiTimerStep; - if (bNextStep) - ++uiPhase; - else - uiPhase = uiPhaseStep; - } - - void CaveDestruction(bool bBool) - { - if (GoSummonList.empty()) - return; - - for (std::list::const_iterator itr = GoSummonList.begin(); itr != GoSummonList.end(); ++itr) - { - if (GameObject* pGo = GameObject::GetGameObject(*me, *itr)) - { - if (pGo) - { - if (Creature *trigger = pGo->SummonTrigger(pGo->GetPositionX(), pGo->GetPositionY(),pGo->GetPositionZ(), 0, 1)) - { - //visual effects are not working! ¬¬ - trigger->CastSpell(trigger,11542,true); - trigger->CastSpell(trigger,35470,true); - } - pGo->RemoveFromWorld(); - //pGo->CastSpell(me,12158); makes all die?! - } - } - } - - if (bBool) - { - if (pInstance) - if (GameObject* pGo = GameObject::GetGameObject((*me),pInstance->GetData64(DATA_GO_CAVE_IN_RIGHT))) - pInstance->HandleGameObject(NULL,false,pGo); - }else - if (pInstance) - if (GameObject* pGo = GameObject::GetGameObject((*me),pInstance->GetData64(DATA_GO_CAVE_IN_LEFT))) - pInstance->HandleGameObject(NULL,false,pGo); - } - - void SetInFace(bool bBool) - { - if (!pInstance) - return; - - if (bBool) - { - if (GameObject* pGo = GameObject::GetGameObject((*me),pInstance->GetData64(DATA_GO_CAVE_IN_RIGHT))) - me->SetFacingToObject(pGo); - }else - if (GameObject* pGo = GameObject::GetGameObject((*me),pInstance->GetData64(DATA_GO_CAVE_IN_LEFT))) - me->SetFacingToObject(pGo); - } - - void RestoreAll() - { - if (!pInstance) - return; - - if (GameObject* pGo = GameObject::GetGameObject((*me),pInstance->GetData64(DATA_GO_CAVE_IN_RIGHT))) - pInstance->HandleGameObject(NULL,false,pGo); - - if (GameObject* pGo = GameObject::GetGameObject((*me),pInstance->GetData64(DATA_GO_CAVE_IN_LEFT))) - pInstance->HandleGameObject(NULL,false,pGo); - - if (!GoSummonList.empty()) - for (std::list::const_iterator itr = GoSummonList.begin(); itr != GoSummonList.end(); ++itr) - { - if (GameObject* pGo = GameObject::GetGameObject(*me, *itr)) - pGo->RemoveFromWorld(); - } - - if (!SummonList.empty()) - for (std::list::const_iterator itr = SummonList.begin(); itr != SummonList.end(); ++itr) - { - if (Creature* pSummon = Unit::GetCreature(*me, *itr)) - { - if (pSummon->isAlive()) - pSummon->DisappearAndDie(); - else - pSummon->RemoveCorpse(); - } - } - } - - void AggroAllPlayers(Creature* pTemp) - { - Map::PlayerList const &PlList = me->GetMap()->GetPlayers(); - - if (PlList.isEmpty()) - return; - - for (Map::PlayerList::const_iterator i = PlList.begin(); i != PlList.end(); ++i) - { - if (Player* pPlayer = i->getSource()) - { - if (pPlayer->isGameMaster()) - continue; - - if (pPlayer->isAlive()) - { - pTemp->SetInCombatWith(pPlayer); - pPlayer->SetInCombatWith(pTemp); - pTemp->AddThreat(pPlayer, 0.0f); - } - } - } - } - - void WaypointReached(uint32 uiPoint) - { - //just in case - if (GetPlayerForEscort()) - if (me->getFaction() != GetPlayerForEscort()->getFaction()) - me->setFaction(GetPlayerForEscort()->getFaction()); - - switch(uiPoint) - { - case 3: - SetEscortPaused(true); - NextStep(2000,false,3); - break; - case 7: - SetEscortPaused(true); - NextStep(2000,false,4); - break; - case 9: - NextStep(1000,false,8); - break; - case 10: - NextStep(25000,false,10); - break; - case 11: - SetEscortPaused(true); - SetInFace(true); - NextStep(1000,false,11); - break; - case 12: - NextStep(25000,false,18); - break; - case 13: - Summon(7); - NextStep(25000,false,19); - break; - case 14: - SetInFace(false); - DoScriptText(SAY_BLASTMASTER_26,me); - SetEscortPaused(true); - NextStep(5000,false,20); - break; - } - } - - void SetData(uint32 uiI,uint32 uiValue) - { - switch(uiI) - { - case 1: - SetEscortPaused(true); - DoScriptText(SAY_BLASTMASTER_0,me); - NextStep(1500,true); - break; - case 2: - if (!pInstance) - return; - - switch(uiValue) - { - case 1: - pInstance->SetData(TYPE_EVENT, IN_PROGRESS); - break; - case 2: - pInstance->SetData(TYPE_EVENT, DONE); - NextStep(5000,false,22); - break; - } - break; - } - } - - void Summon(uint8 uiCase) - { - switch(uiCase) - { - case 1: - me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000); - me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000); - me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000); - me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000); - me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[4], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000); - me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[5], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000); - me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[6], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000); - me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[7], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000); - me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[8], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000); - me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[9], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000); - break; - case 2: - if (GameObject* pGo = me->SummonGameObject(183410, -533.140,-105.322,-156.016, 0, 0, 0, 0, 0, 1000)) - { - GoSummonList.push_back(pGo->GetGUID()); - pGo->SetFlag(GAMEOBJECT_FLAGS,GO_FLAG_UNK1); //We can't use it! - } - Summon(3); - break; - case 3: - me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000); - me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000); - me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000); - me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000); - DoScriptText(SAY_BLASTMASTER_19,me); - break; - case 4: - if (GameObject* pGo = me->SummonGameObject(183410, -542.199,-96.854,-155.790, 0, 0, 0, 0, 0, 1000)) - { - GoSummonList.push_back(pGo->GetGUID()); - pGo->SetFlag(GAMEOBJECT_FLAGS,GO_FLAG_UNK1); - } - break; - case 5: - me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000); - me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000); - me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000); - DoScriptText(SAY_BLASTMASTER_15,me); - break; - case 6: - me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[10], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000); - me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[11], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000); - me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[12], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000); - me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[13], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000); - me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[14], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000); - break; - case 7: - if (GameObject* pGo = me->SummonGameObject(183410, -507.820,-103.333,-151.353, 0, 0, 0, 0, 0, 1000)) - { - GoSummonList.push_back(pGo->GetGUID()); - pGo->SetFlag(GAMEOBJECT_FLAGS,GO_FLAG_UNK1); //We can't use it! - Summon(6); - } - break; - case 8: - if (GameObject* pGo = me->SummonGameObject(183410, -511.829,-86.249,-151.431, 0, 0, 0, 0, 0, 1000)) - { - GoSummonList.push_back(pGo->GetGUID()); - pGo->SetFlag(GAMEOBJECT_FLAGS,GO_FLAG_UNK1); //We can't use it! - } - break; - case 9: - if (Creature* pGrubbis = me->SummonCreature(NPC_GRUBBIS, SpawnPosition[15], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000)) - DoScriptText(SAY_GRUBBIS,pGrubbis); - me->SummonCreature(NPC_CHOMPER, SpawnPosition[16], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000); - break; - } - } - - void UpdateEscortAI(const uint32 uiDiff) - { - if (uiPhase) - { - if (uiTimer <= uiDiff) - { - switch(uiPhase) - { - case 1: - DoScriptText(SAY_BLASTMASTER_1,me); - NextStep(1500,true); - break; - case 2: - SetEscortPaused(false); - NextStep(0,false,0); - break; - case 3: - DoScriptText(SAY_BLASTMASTER_2,me); - SetEscortPaused(false); - NextStep(0,false,0); - break; - case 4: - DoScriptText(SAY_BLASTMASTER_3,me); - NextStep(3000,true); - break; - case 5: - DoScriptText(SAY_BLASTMASTER_4,me); - NextStep(3000,true); - break; - case 6: - SetInFace(true); - DoScriptText(SAY_BLASTMASTER_5,me); - Summon(1); - if (pInstance) - if (GameObject* pGo = GameObject::GetGameObject((*me),pInstance->GetData64(DATA_GO_CAVE_IN_RIGHT))) - pInstance->HandleGameObject(NULL,true,pGo); - NextStep(3000,true); - break; - case 7: - DoScriptText(SAY_BLASTMASTER_6,me); - SetEscortPaused(false); - NextStep(0,false,0); - break; - case 8: - me->HandleEmoteCommand(EMOTE_STATE_WORK); - NextStep(25000,true); - break; - case 9: - Summon(2); - NextStep(0,false); - break; - case 10: - Summon(4); - NextStep(0,false); - break; - case 11: - DoScriptText(SAY_BLASTMASTER_17,me); - NextStep(5000,true); - break; - case 12: - DoScriptText(SAY_BLASTMASTER_18,me); - NextStep(5000,true); - break; - case 13: - DoScriptText(SAY_BLASTMASTER_20,me); - CaveDestruction(true); - NextStep(8000,true); - break; - case 14: - DoScriptText(SAY_BLASTMASTER_21,me); - NextStep(8500,true); - break; - case 15: - DoScriptText(SAY_BLASTMASTER_22,me); - NextStep(2000,true); - break; - case 16: - DoScriptText(SAY_BLASTMASTER_23,me); - SetInFace(false); - if (pInstance) - if (GameObject* pGo = GameObject::GetGameObject((*me),pInstance->GetData64(DATA_GO_CAVE_IN_LEFT))) - pInstance->HandleGameObject(NULL,true,pGo); - NextStep(2000,true); - break; - case 17: - SetEscortPaused(false); - DoScriptText(SAY_BLASTMASTER_24,me); - Summon(6); - NextStep(0,false); - break; - case 18: - Summon(7); - NextStep(0,false); - break; - case 19: - SetInFace(false); - Summon(8); - DoScriptText(SAY_BLASTMASTER_25,me); - NextStep(0,false); - break; - case 20: - DoScriptText(SAY_BLASTMASTER_27,me); - NextStep(2000,true); - break; - case 21: - Summon(9); - NextStep(0,false); - break; - case 22: - CaveDestruction(false); - DoScriptText(SAY_BLASTMASTER_20,me); - NextStep(0,false); - break; - } - } else uiTimer -= uiDiff; - } - - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - - void JustSummoned(Creature* pSummon) - { - SummonList.push_back(pSummon->GetGUID()); - AggroAllPlayers(pSummon); - } -}; - -CreatureAI* GetAI_npc_blastmaster_emi_shortfuse(Creature* pCreature) -{ - return new npc_blastmaster_emi_shortfuseAI(pCreature); -} - -bool GossipHello_npc_blastmaster_emi_shortfuse(Player* pPlayer, Creature* pCreature) -{ - ScriptedInstance* pInstance = pCreature->GetInstanceData(); - - if (pInstance && pInstance->GetData(TYPE_EVENT) == NOT_STARTED) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_START_EVENT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXT_EMI, pCreature->GetGUID()); - - return true; -} - -bool GossipSelect_npc_blastmaster_emi_shortfuse(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) - { - if (npc_escortAI* pEscortAI = CAST_AI(npc_blastmaster_emi_shortfuseAI, pCreature->AI())) - pEscortAI->Start(true, false,pPlayer->GetGUID()); - - pCreature->setFaction(pPlayer->getFaction()); - pCreature->AI()->SetData(1,0); - - pPlayer->CLOSE_GOSSIP_MENU(); - } - return true; -} - -struct boss_grubbisAI : public ScriptedAI -{ - boss_grubbisAI(Creature* pCreature) : ScriptedAI(pCreature) - { - SetDataSummoner(); - } - - void SetDataSummoner() - { - if (!me->isSummon()) - return; - - if (Unit* pSummon = CAST_SUM(me)->GetSummoner()) - CAST_CRE(pSummon)->AI()->SetData(2,1); - } - - void UpdateAI(const uint32 /*diff*/) - { - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - - void JustDied(Unit* /*pKiller*/) - { - if (!me->isSummon()) - return; - - if (Unit* pSummon = CAST_SUM(me)->GetSummoner()) - CAST_CRE(pSummon)->AI()->SetData(2,2); - } -}; - -CreatureAI* GetAI_boss_grubbis(Creature* pCreature) -{ - return new boss_grubbisAI(pCreature); -} - -void AddSC_gnomeregan() -{ - Script* newscript; - - newscript = new Script; - newscript->Name = "npc_blastmaster_emi_shortfuse"; - newscript->pGossipHello = &GossipHello_npc_blastmaster_emi_shortfuse; - newscript->pGossipSelect = &GossipSelect_npc_blastmaster_emi_shortfuse; - newscript->GetAI = &GetAI_npc_blastmaster_emi_shortfuse; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_grubbis"; - newscript->GetAI = &GetAI_boss_grubbis; - newscript->RegisterSelf(); -} diff --git a/src/server/scripts/EasternKingdoms/gnomeregan/gnomeregan.h b/src/server/scripts/EasternKingdoms/gnomeregan/gnomeregan.h deleted file mode 100644 index e46c811e9b1..00000000000 --- a/src/server/scripts/EasternKingdoms/gnomeregan/gnomeregan.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2010 Trinity - * - * 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 - */ - -#ifndef DEF_GNOMEREGAN_H -#define DEF_GNOMEREGAN_H - -enum eGameObjects -{ - GO_CAVE_IN_LEFT = 146085, - GO_CAVE_IN_RIGHT = 146086 -}; - -enum eCreatures -{ - NPC_BLASTMASTER_EMI_SHORTFUSE = 7998, - NPC_CAVERNDEEP_AMBUSHER = 6207, - NPC_GRUBBIS = 7361, - NPC_CHOMPER = 6215 -}; - -enum eData -{ - TYPE_EVENT = 1 -}; - -enum eData64 -{ - DATA_GO_CAVE_IN_LEFT, - DATA_GO_CAVE_IN_RIGHT, - DATA_NPC_BASTMASTER_EMI_SHORTFUSE -}; - -#endif diff --git a/src/server/scripts/EasternKingdoms/gnomeregan/instance_gnomeregan.cpp b/src/server/scripts/EasternKingdoms/gnomeregan/instance_gnomeregan.cpp deleted file mode 100644 index 980a6d3552b..00000000000 --- a/src/server/scripts/EasternKingdoms/gnomeregan/instance_gnomeregan.cpp +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Copyright (C) 2010 Trinity - * - * 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 - */ - -#include "ScriptedPch.h" -#include "gnomeregan.h" - -#define MAX_ENCOUNTER 1 - -struct instance_gnomeregan : public ScriptedInstance -{ - instance_gnomeregan(Map* pMap) : ScriptedInstance(pMap) - { - Initialize(); - }; - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - - uint64 uiCaveInLeftGUID; - uint64 uiCaveInRightGUID; - - uint64 uiBastmasterEmiShortfuseGUID; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - uiCaveInLeftGUID = 0; - uiCaveInRightGUID = 0; - - uiBastmasterEmiShortfuseGUID = 0; - } - - 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]; - - for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) - { - if (m_auiEncounter[i] == IN_PROGRESS) - m_auiEncounter[i] = NOT_STARTED; - } - - OUT_LOAD_INST_DATA_COMPLETE; - } - - void OnCreatureCreate(Creature* pCreature, bool /*bAdd*/) - { - switch(pCreature->GetEntry()) - { - case NPC_BLASTMASTER_EMI_SHORTFUSE: uiBastmasterEmiShortfuseGUID = pCreature->GetGUID(); break; - } - } - - void OnGameObjectCreate(GameObject* pGo, bool /*bAdd*/) - { - switch(pGo->GetEntry()) - { - case GO_CAVE_IN_LEFT: - uiCaveInLeftGUID = pGo->GetGUID(); - if (m_auiEncounter[0] == DONE || m_auiEncounter[0] == NOT_STARTED) - HandleGameObject(NULL,false,pGo); - break; - case GO_CAVE_IN_RIGHT: - uiCaveInRightGUID = pGo->GetGUID(); - if (m_auiEncounter[0] == DONE || m_auiEncounter[0] == NOT_STARTED) - HandleGameObject(NULL,false,pGo); - break; - } - } - - void SetData(uint32 uiType, uint32 uiData) - { - switch(uiType) - { - case TYPE_EVENT: - m_auiEncounter[0] = uiData; - if (uiData == DONE) - SaveToDB(); - break; - } - } - - uint32 GetData(uint32 uiType, uint32 /*uiData*/) - { - switch(uiType) - { - case TYPE_EVENT: return m_auiEncounter[0]; - } - } - - uint64 GetData64(uint32 uiType) - { - switch(uiType) - { - case DATA_GO_CAVE_IN_LEFT: return uiCaveInLeftGUID; - case DATA_GO_CAVE_IN_RIGHT: return uiCaveInRightGUID; - case DATA_NPC_BASTMASTER_EMI_SHORTFUSE: return uiBastmasterEmiShortfuseGUID; - } - - return 0; - } -}; - -InstanceData* GetInstanceData_instance_gnomeregan(Map* pMap) -{ - return new instance_gnomeregan(pMap); -} - -void AddSC_instance_gnomeregan() -{ - Script* newscript; - - newscript = new Script; - newscript->Name = "instance_gnomeregan"; - newscript->GetInstanceData = &GetInstanceData_instance_gnomeregan; - newscript->RegisterSelf(); -} diff --git a/src/server/scripts/EasternKingdoms/karazhan/boss_curator.cpp b/src/server/scripts/EasternKingdoms/karazhan/boss_curator.cpp deleted file mode 100644 index 7105d27ca6a..00000000000 --- a/src/server/scripts/EasternKingdoms/karazhan/boss_curator.cpp +++ /dev/null @@ -1,196 +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_Curator -SD%Complete: 100 -SDComment: -SDCategory: Karazhan -EndScriptData */ - -#include "ScriptedPch.h" - -#define SAY_AGGRO -1532057 -#define SAY_SUMMON1 -1532058 -#define SAY_SUMMON2 -1532059 -#define SAY_EVOCATE -1532060 -#define SAY_ENRAGE -1532061 -#define SAY_KILL1 -1532062 -#define SAY_KILL2 -1532063 -#define SAY_DEATH -1532064 - -//Flare spell info -#define SPELL_ASTRAL_FLARE_PASSIVE 30234 //Visual effect + Flare damage - -//Curator spell info -#define SPELL_HATEFUL_BOLT 30383 -#define SPELL_EVOCATION 30254 -#define SPELL_ENRAGE 30403 //Arcane Infusion: Transforms Curator and adds damage. -#define SPELL_BERSERK 26662 - -struct boss_curatorAI : public ScriptedAI -{ - boss_curatorAI(Creature *c) : ScriptedAI(c) {} - - uint32 AddTimer; - uint32 HatefulBoltTimer; - uint32 BerserkTimer; - - bool Enraged; - bool Evocating; - - void Reset() - { - AddTimer = 10000; - HatefulBoltTimer = 15000; //This time may be wrong - BerserkTimer = 720000; //12 minutes - Enraged = false; - Evocating = false; - - me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_ARCANE, true); - } - - void KilledUnit(Unit * /*victim*/) - { - DoScriptText(RAND(SAY_KILL1,SAY_KILL2), me); - } - - void JustDied(Unit * /*victim*/) - { - DoScriptText(SAY_DEATH, me); - } - - void EnterCombat(Unit * /*who*/) - { - DoScriptText(SAY_AGGRO, me); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //always decrease BerserkTimer - if (BerserkTimer <= diff) - { - //if evocate, then break evocate - if (Evocating) - { - if (me->HasAura(SPELL_EVOCATION)) - me->RemoveAurasDueToSpell(SPELL_EVOCATION); - - Evocating = false; - } - - //may not be correct SAY (generic hard enrage) - DoScriptText(SAY_ENRAGE, me); - - me->InterruptNonMeleeSpells(true); - DoCast(me, SPELL_BERSERK); - - //don't know if he's supposed to do summon/evocate after hard enrage (probably not) - Enraged = true; - } else BerserkTimer -= diff; - - if (Evocating) - { - //not supposed to do anything while evocate - if (me->HasAura(SPELL_EVOCATION)) - return; - else - Evocating = false; - } - - if (!Enraged) - { - if (AddTimer <= diff) - { - //Summon Astral Flare - Creature* AstralFlare = DoSpawnCreature(17096, rand()%37, rand()%37, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); - Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); - - if (AstralFlare && pTarget) - { - AstralFlare->CastSpell(AstralFlare, SPELL_ASTRAL_FLARE_PASSIVE, false); - AstralFlare->AI()->AttackStart(pTarget); - } - - //Reduce Mana by 10% of max health - if (int32 mana = me->GetMaxPower(POWER_MANA)) - { - mana /= 10; - me->ModifyPower(POWER_MANA, -mana); - - //if this get's us below 10%, then we evocate (the 10th should be summoned now) - if (me->GetPower(POWER_MANA)*100 / me->GetMaxPower(POWER_MANA) < 10) - { - DoScriptText(SAY_EVOCATE, me); - me->InterruptNonMeleeSpells(false); - DoCast(me, SPELL_EVOCATION); - Evocating = true; - //no AddTimer cooldown, this will make first flare appear instantly after evocate end, like expected - return; - } - else - { - if (urand(0,1) == 0) - { - DoScriptText(RAND(SAY_SUMMON1,SAY_SUMMON2), me); - } - } - } - - AddTimer = 10000; - } else AddTimer -= diff; - - if (me->GetHealth()*100 / me->GetMaxHealth() <= 15) - { - Enraged = true; - DoCast(me, SPELL_ENRAGE); - DoScriptText(SAY_ENRAGE, me); - } - } - - if (HatefulBoltTimer <= diff) - { - if (Enraged) - HatefulBoltTimer = 7000; - else - HatefulBoltTimer = 15000; - - if (Unit *pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO, 1)) - DoCast(pTarget, SPELL_HATEFUL_BOLT); - - } else HatefulBoltTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_curator(Creature* pCreature) -{ - return new boss_curatorAI (pCreature); -} - -void AddSC_boss_curator() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_curator"; - newscript->GetAI = &GetAI_boss_curator; - newscript->RegisterSelf(); -} diff --git a/src/server/scripts/EasternKingdoms/karazhan/boss_maiden_of_virtue.cpp b/src/server/scripts/EasternKingdoms/karazhan/boss_maiden_of_virtue.cpp deleted file mode 100644 index 21db1be1be3..00000000000 --- a/src/server/scripts/EasternKingdoms/karazhan/boss_maiden_of_virtue.cpp +++ /dev/null @@ -1,138 +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_Maiden_of_Virtue -SD%Complete: 100 -SDComment: -SDCategory: Karazhan -EndScriptData */ - -#include "ScriptedPch.h" - -#define SAY_AGGRO -1532018 -#define SAY_SLAY1 -1532019 -#define SAY_SLAY2 -1532020 -#define SAY_SLAY3 -1532021 -#define SAY_REPENTANCE1 -1532022 -#define SAY_REPENTANCE2 -1532023 -#define SAY_DEATH -1532024 - -#define SPELL_REPENTANCE 29511 -#define SPELL_HOLYFIRE 29522 -#define SPELL_HOLYWRATH 32445 -#define SPELL_HOLYGROUND 29512 -#define SPELL_BERSERK 26662 - -struct boss_maiden_of_virtueAI : public ScriptedAI -{ - boss_maiden_of_virtueAI(Creature *c) : ScriptedAI(c) {} - - uint32 Repentance_Timer; - uint32 Holyfire_Timer; - uint32 Holywrath_Timer; - uint32 Holyground_Timer; - uint32 Enrage_Timer; - - bool Enraged; - - void Reset() - { - Repentance_Timer = 25000+(rand()%15000); - Holyfire_Timer = 8000+(rand()%17000); - Holywrath_Timer = 15000+(rand()%10000); - Holyground_Timer = 3000; - Enrage_Timer = 600000; - - Enraged = false; - } - - void KilledUnit(Unit* /*Victim*/) - { - if (urand(0,1) == 0) - DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), me); - } - - void JustDied(Unit* /*Killer*/) - { - DoScriptText(SAY_DEATH, me); - } - - void EnterCombat(Unit * /*who*/) - { - DoScriptText(SAY_AGGRO, me); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (Enrage_Timer < diff && !Enraged) - { - DoCast(me, SPELL_BERSERK, true); - Enraged = true; - } else Enrage_Timer -= diff; - - if (Holyground_Timer <= diff) - { - DoCast(me, SPELL_HOLYGROUND, true); //Triggered so it doesn't interrupt her at all - Holyground_Timer = 3000; - } else Holyground_Timer -= diff; - - if (Repentance_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_REPENTANCE); - DoScriptText(RAND(SAY_REPENTANCE1,SAY_REPENTANCE2), me); - - Repentance_Timer = urand(25000,35000); //A little randomness on that spell - } else Repentance_Timer -= diff; - - if (Holyfire_Timer <= diff) - { - if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) - DoCast(pTarget, SPELL_HOLYFIRE); - - Holyfire_Timer = urand(8000,23000); //Anywhere from 8 to 23 seconds, good luck having several of those in a row! - } else Holyfire_Timer -= diff; - - if (Holywrath_Timer <= diff) - { - if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) - DoCast(pTarget, SPELL_HOLYWRATH); - - Holywrath_Timer = urand(20000,25000); //20-30 secs sounds nice - } else Holywrath_Timer -= diff; - - DoMeleeAttackIfReady(); - } - -}; - -CreatureAI* GetAI_boss_maiden_of_virtue(Creature* pCreature) -{ - return new boss_maiden_of_virtueAI (pCreature); -} - -void AddSC_boss_maiden_of_virtue() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_maiden_of_virtue"; - newscript->GetAI = &GetAI_boss_maiden_of_virtue; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/karazhan/boss_midnight.cpp b/src/server/scripts/EasternKingdoms/karazhan/boss_midnight.cpp deleted file mode 100644 index a2f2a8b605e..00000000000 --- a/src/server/scripts/EasternKingdoms/karazhan/boss_midnight.cpp +++ /dev/null @@ -1,310 +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_Midnight -SD%Complete: 100 -SDComment: -SDCategory: Karazhan -EndScriptData */ - -#include "ScriptedPch.h" - -#define SAY_MIDNIGHT_KILL -1532000 -#define SAY_APPEAR1 -1532001 -#define SAY_APPEAR2 -1532002 -#define SAY_APPEAR3 -1532003 -#define SAY_MOUNT -1532004 -#define SAY_KILL1 -1532005 -#define SAY_KILL2 -1532006 -#define SAY_DISARMED -1532007 -#define SAY_DEATH -1532008 -#define SAY_RANDOM1 -1532009 -#define SAY_RANDOM2 -1532010 - -#define SPELL_SHADOWCLEAVE 29832 -#define SPELL_INTANGIBLE_PRESENCE 29833 -#define SPELL_BERSERKER_CHARGE 26561 //Only when mounted - -#define MOUNTED_DISPLAYID 16040 - -//Attumen (TODO: Use the summoning spell instead of Creature id. It works , but is not convenient for us) -#define SUMMON_ATTUMEN 15550 - -struct boss_midnightAI : public ScriptedAI -{ - boss_midnightAI(Creature *c) : ScriptedAI(c) {} - - uint64 Attumen; - uint8 Phase; - uint32 Mount_Timer; - - void Reset() - { - Phase = 1; - Attumen = 0; - Mount_Timer = 0; - - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->SetVisibility(VISIBILITY_ON); - } - - void EnterCombat(Unit* /*who*/) {} - - void KilledUnit(Unit * /*victim*/) - { - if (Phase == 2) - { - if (Unit *pUnit = Unit::GetUnit(*me, Attumen)) - DoScriptText(SAY_MIDNIGHT_KILL, pUnit); - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (Phase == 1 && (me->GetHealth()*100)/me->GetMaxHealth() < 95) - { - Phase = 2; - if (Creature* pAttumen = me->SummonCreature(SUMMON_ATTUMEN, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30000)) - { - Attumen = pAttumen->GetGUID(); - pAttumen->AI()->AttackStart(me->getVictim()); - SetMidnight(pAttumen, me->GetGUID()); - DoScriptText(RAND(SAY_APPEAR1,SAY_APPEAR2,SAY_APPEAR3), pAttumen); - } - } - else if (Phase == 2 && (me->GetHealth()*100)/me->GetMaxHealth() < 25) - { - if (Unit *pAttumen = Unit::GetUnit(*me, Attumen)) - Mount(pAttumen); - } - else if (Phase == 3) - { - if (Mount_Timer) - { - if (Mount_Timer <= diff) - { - Mount_Timer = 0; - me->SetVisibility(VISIBILITY_OFF); - me->GetMotionMaster()->MoveIdle(); - if (Unit *pAttumen = Unit::GetUnit(*me, Attumen)) - { - pAttumen->SetDisplayId(MOUNTED_DISPLAYID); - pAttumen->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - if (pAttumen->getVictim()) - { - pAttumen->GetMotionMaster()->MoveChase(pAttumen->getVictim()); - pAttumen->SetUInt64Value(UNIT_FIELD_TARGET, pAttumen->getVictim()->GetGUID()); - } - pAttumen->SetFloatValue(OBJECT_FIELD_SCALE_X,1); - } - } else Mount_Timer -= diff; - } - } - - if (Phase != 3) - DoMeleeAttackIfReady(); - } - - void Mount(Unit *pAttumen) - { - DoScriptText(SAY_MOUNT, pAttumen); - Phase = 3; - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - pAttumen->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - float angle = me->GetAngle(pAttumen); - float distance = me->GetDistance2d(pAttumen); - float newX = me->GetPositionX() + cos(angle)*(distance/2) ; - float newY = me->GetPositionY() + sin(angle)*(distance/2) ; - float newZ = 50; - //me->Relocate(newX,newY,newZ,angle); - //me->SendMonsterMove(newX, newY, newZ, 0, true, 1000); - me->GetMotionMaster()->Clear(); - me->GetMotionMaster()->MovePoint(0, newX, newY, newZ); - distance += 10; - newX = me->GetPositionX() + cos(angle)*(distance/2) ; - newY = me->GetPositionY() + sin(angle)*(distance/2) ; - pAttumen->GetMotionMaster()->Clear(); - pAttumen->GetMotionMaster()->MovePoint(0, newX, newY, newZ); - //pAttumen->Relocate(newX,newY,newZ,-angle); - //pAttumen->SendMonsterMove(newX, newY, newZ, 0, true, 1000); - Mount_Timer = 1000; - } - - void SetMidnight(Creature *, uint64); //Below .. -}; - -CreatureAI* GetAI_boss_midnight(Creature* pCreature) -{ - return new boss_midnightAI(pCreature); -} - -struct boss_attumenAI : public ScriptedAI -{ - boss_attumenAI(Creature *c) : ScriptedAI(c) - { - Phase = 1; - - CleaveTimer = urand(10000,15000); - CurseTimer = 30000; - RandomYellTimer = urand(30000,60000); //Occasionally yell - ChargeTimer = 20000; - ResetTimer = 0; - } - - uint64 Midnight; - uint8 Phase; - uint32 CleaveTimer; - uint32 CurseTimer; - uint32 RandomYellTimer; - uint32 ChargeTimer; //only when mounted - uint32 ResetTimer; - - void Reset() - { - ResetTimer = 2000; - } - - void EnterCombat(Unit* /*who*/) {} - - void KilledUnit(Unit * /*victim*/) - { - DoScriptText(RAND(SAY_KILL1,SAY_KILL2), me); - } - - void JustDied(Unit * /*victim*/) - { - DoScriptText(SAY_DEATH, me); - if (Unit *pMidnight = Unit::GetUnit(*me, Midnight)) - pMidnight->Kill(pMidnight); - } - - void UpdateAI(const uint32 diff) - { - if (ResetTimer) - { - if (ResetTimer <= diff) - { - ResetTimer = 0; - Unit *pMidnight = Unit::GetUnit(*me, Midnight); - if (pMidnight) - { - pMidnight->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - pMidnight->SetVisibility(VISIBILITY_ON); - } - Midnight = 0; - me->SetVisibility(VISIBILITY_OFF); - me->Kill(me); - } - } else ResetTimer -= diff; - - //Return since we have no target - if (!UpdateVictim()) - return; - - if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE)) - return; - - if (CleaveTimer <= diff) - { - DoCast(me->getVictim(), SPELL_SHADOWCLEAVE); - CleaveTimer = urand(10000,15000); - } else CleaveTimer -= diff; - - if (CurseTimer <= diff) - { - DoCast(me->getVictim(), SPELL_INTANGIBLE_PRESENCE); - CurseTimer = 30000; - } else CurseTimer -= diff; - - if (RandomYellTimer <= diff) - { - DoScriptText(RAND(SAY_RANDOM1,SAY_RANDOM2), me); - RandomYellTimer = urand(30000,60000); - } else RandomYellTimer -= diff; - - if (me->GetUInt32Value(UNIT_FIELD_DISPLAYID) == MOUNTED_DISPLAYID) - { - if (ChargeTimer <= 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 && !pTarget->IsWithinDist(me, ATTACK_DISTANCE, false)) - target_list.push_back(pTarget); - pTarget = NULL; - } - if (target_list.size()) - pTarget = *(target_list.begin()+rand()%target_list.size()); - - DoCast(pTarget, SPELL_BERSERKER_CHARGE); - ChargeTimer = 20000; - } else ChargeTimer -= diff; - } - else - { - if ((me->GetHealth()*100)/me->GetMaxHealth() < 25) - { - Creature *pMidnight = Unit::GetCreature(*me, Midnight); - if (pMidnight && pMidnight->GetTypeId() == TYPEID_UNIT) - { - CAST_AI(boss_midnightAI, (pMidnight->AI()))->Mount(me); - me->SetHealth(pMidnight->GetHealth()); - DoResetThreat(); - } - } - } - - DoMeleeAttackIfReady(); - } - - void SpellHit(Unit * /*source*/, const SpellEntry *spell) - { - if (spell->Mechanic == MECHANIC_DISARM) - DoScriptText(SAY_DISARMED, me); - } -}; - -void boss_midnightAI::SetMidnight(Creature *pAttumen, uint64 value) -{ - CAST_AI(boss_attumenAI, pAttumen->AI())->Midnight = value; -} - -CreatureAI* GetAI_boss_attumen(Creature* pCreature) -{ - return new boss_attumenAI (pCreature); -} - -void AddSC_boss_attumen() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_attumen"; - newscript->GetAI = &GetAI_boss_attumen; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_midnight"; - newscript->GetAI = &GetAI_boss_midnight; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/karazhan/boss_moroes.cpp b/src/server/scripts/EasternKingdoms/karazhan/boss_moroes.cpp deleted file mode 100644 index 6c8fabcca35..00000000000 --- a/src/server/scripts/EasternKingdoms/karazhan/boss_moroes.cpp +++ /dev/null @@ -1,785 +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_Moroes -SD%Complete: 95 -SDComment: -SDCategory: Karazhan -EndScriptData */ - -#include "ScriptedPch.h" -#include "karazhan.h" - -#define SAY_AGGRO -1532011 -#define SAY_SPECIAL_1 -1532012 -#define SAY_SPECIAL_2 -1532013 -#define SAY_KILL_1 -1532014 -#define SAY_KILL_2 -1532015 -#define SAY_KILL_3 -1532016 -#define SAY_DEATH -1532017 - -#define SPELL_VANISH 29448 -#define SPELL_GARROTE 37066 -#define SPELL_BLIND 34694 -#define SPELL_GOUGE 29425 -#define SPELL_FRENZY 37023 - -#define POS_Z 81.73 - -float Locations[4][3]= -{ - {-10991.0, -1884.33, 0.614315}, - {-10989.4, -1885.88, 0.904913}, - {-10978.1, -1887.07, 2.035550}, - {-10975.9, -1885.81, 2.253890}, -}; - -const uint32 Adds[6]= -{ - 17007, - 19872, - 19873, - 19874, - 19875, - 19876, -}; - -struct boss_moroesAI : public ScriptedAI -{ - boss_moroesAI(Creature *c) : ScriptedAI(c) - { - for (uint8 i = 0; i < 4; ++i) - { - AddId[i] = 0; - } - pInstance = c->GetInstanceData(); - } - - ScriptedInstance *pInstance; - - uint64 AddGUID[4]; - - uint32 Vanish_Timer; - uint32 Blind_Timer; - uint32 Gouge_Timer; - uint32 Wait_Timer; - uint32 CheckAdds_Timer; - uint32 AddId[4]; - - bool InVanish; - bool Enrage; - - void Reset() - { - Vanish_Timer = 30000; - Blind_Timer = 35000; - Gouge_Timer = 23000; - Wait_Timer = 0; - CheckAdds_Timer = 5000; - - Enrage = false; - InVanish = false; - if (me->GetHealth() > 0) - { - SpawnAdds(); - } - - if (pInstance) - pInstance->SetData(TYPE_MOROES, NOT_STARTED); - } - - void StartEvent() - { - if (pInstance) - pInstance->SetData(TYPE_MOROES, IN_PROGRESS); - - DoZoneInCombat(); - } - - void EnterCombat(Unit* /*who*/) - { - StartEvent(); - - DoScriptText(SAY_AGGRO, me); - AddsAttack(); - DoZoneInCombat(); - } - - void KilledUnit(Unit* /*victim*/) - { - DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2,SAY_KILL_3), me); - } - - void JustDied(Unit* /*victim*/) - { - DoScriptText(SAY_DEATH, me); - - if (pInstance) - pInstance->SetData(TYPE_MOROES, DONE); - - DeSpawnAdds(); - - //remove aura from spell Garrote when Moroes dies - if (pInstance) - pInstance->DoRemoveAurasDueToSpellOnPlayers(SPELL_GARROTE); - } - - void SpawnAdds() - { - DeSpawnAdds(); - if (isAddlistEmpty()) - { - Creature *pCreature = NULL; - std::vector AddList; - - for (uint8 i = 0; i < 6; ++i) - AddList.push_back(Adds[i]); - - while (AddList.size() > 4) - AddList.erase((AddList.begin())+(rand()%AddList.size())); - - uint8 i = 0; - for (std::vector::const_iterator itr = AddList.begin(); itr != AddList.end(); ++itr) - { - uint32 entry = *itr; - - pCreature = me->SummonCreature(entry, Locations[i][0], Locations[i][1], POS_Z, Locations[i][2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); - if (pCreature) - { - AddGUID[i] = pCreature->GetGUID(); - AddId[i] = entry; - } - ++i; - } - }else - { - for (uint8 i = 0; i < 4; ++i) - { - Creature *pCreature = me->SummonCreature(AddId[i], Locations[i][0], Locations[i][1], POS_Z, Locations[i][2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); - if (pCreature) - { - AddGUID[i] = pCreature->GetGUID(); - } - } - } - } - - bool isAddlistEmpty() - { - for (uint8 i = 0; i < 4; ++i) - { - if (AddId[i] == 0) - return true; - } - return false; - } - - void DeSpawnAdds() - { - for (uint8 i = 0; i < 4 ; ++i) - { - Creature* Temp = NULL; - if (AddGUID[i]) - { - Temp = Creature::GetCreature((*me),AddGUID[i]); - if (Temp && Temp->isAlive()) - Temp->DisappearAndDie(); - } - } - } - - void AddsAttack() - { - for (uint8 i = 0; i < 4; ++i) - { - Creature* Temp = NULL; - if (AddGUID[i]) - { - Temp = Creature::GetCreature((*me),AddGUID[i]); - if (Temp && Temp->isAlive()) - { - Temp->AI()->AttackStart(me->getVictim()); - DoZoneInCombat(Temp); - } else - EnterEvadeMode(); - } - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (pInstance && !pInstance->GetData(TYPE_MOROES)) - { - EnterEvadeMode(); - return; - } - - if (!Enrage && me->GetHealth()*100 / me->GetMaxHealth() < 30) - { - DoCast(me, SPELL_FRENZY); - Enrage = true; - } - - if (CheckAdds_Timer <= diff) - { - for (uint8 i = 0; i < 4; ++i) - { - Creature* Temp = NULL; - if (AddGUID[i]) - { - Temp = Unit::GetCreature((*me),AddGUID[i]); - if (Temp && Temp->isAlive()) - if (!Temp->getVictim()) - Temp->AI()->AttackStart(me->getVictim()); - } - } - CheckAdds_Timer = 5000; - } else CheckAdds_Timer -= diff; - - if (!Enrage) - { - //Cast Vanish, then Garrote random victim - if (Vanish_Timer <= diff) - { - DoCast(me, SPELL_VANISH); - InVanish = true; - Vanish_Timer = 30000; - Wait_Timer = 5000; - } else Vanish_Timer -= diff; - - if (Gouge_Timer <= diff) - { - DoCastVictim(SPELL_GOUGE); - Gouge_Timer = 40000; - } else Gouge_Timer -= diff; - - if (Blind_Timer <= diff) - { - std::list pTargets; - SelectTargetList(pTargets, 5, SELECT_TARGET_RANDOM, me->GetMeleeReach()*5, true); - for (std::list::const_iterator i = pTargets.begin(); i != pTargets.end(); ++i) - if (!me->IsWithinMeleeRange(*i)) - { - DoCast(*i, SPELL_BLIND); - break; - } - Blind_Timer = 40000; - } else Blind_Timer -= diff; - } - - if (InVanish) - { - if (Wait_Timer <= diff) - { - DoScriptText(RAND(SAY_SPECIAL_1,SAY_SPECIAL_2), me); - - if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) - pTarget->CastSpell(pTarget, SPELL_GARROTE,true); - - InVanish = false; - } else Wait_Timer -= diff; - } - - if (!InVanish) - DoMeleeAttackIfReady(); - } -}; - -struct boss_moroes_guestAI : public ScriptedAI -{ - ScriptedInstance* pInstance; - - uint64 GuestGUID[4]; - - boss_moroes_guestAI(Creature* c) : ScriptedAI(c) - { - for (uint8 i = 0; i < 4; ++i) - GuestGUID[i] = 0; - - pInstance = c->GetInstanceData(); - } - - void Reset() - { - if (pInstance) - pInstance->SetData(TYPE_MOROES, NOT_STARTED); - } - - void AcquireGUID() - { - if (!pInstance) - return; - - uint64 MoroesGUID = pInstance->GetData64(DATA_MOROES); - Creature* Moroes = (Unit::GetCreature((*me), MoroesGUID)); - if (Moroes) - { - for (uint8 i = 0; i < 4; ++i) - { - uint64 GUID = CAST_AI(boss_moroesAI, Moroes->AI())->AddGUID[i]; - if (GUID) - GuestGUID[i] = GUID; - } - } - } - - Unit* SelectGuestTarget() - { - uint64 TempGUID = GuestGUID[rand()%4]; - if (TempGUID) - { - Unit* pUnit = Unit::GetUnit((*me), TempGUID); - if (pUnit && pUnit->isAlive()) - return pUnit; - } - - return me; - } - - void UpdateAI(const uint32 /*diff*/) - { - if (pInstance && !pInstance->GetData(TYPE_MOROES)) - EnterEvadeMode(); - - DoMeleeAttackIfReady(); - } -}; - -#define SPELL_MANABURN 29405 -#define SPELL_MINDFLY 29570 -#define SPELL_SWPAIN 34441 -#define SPELL_SHADOWFORM 29406 - -struct boss_baroness_dorothea_millstipeAI : public boss_moroes_guestAI -{ - //Shadow Priest - boss_baroness_dorothea_millstipeAI(Creature *c) : boss_moroes_guestAI(c) {} - - uint32 ManaBurn_Timer; - uint32 MindFlay_Timer; - uint32 ShadowWordPain_Timer; - - void Reset() - { - ManaBurn_Timer = 7000; - MindFlay_Timer = 1000; - ShadowWordPain_Timer = 6000; - - DoCast(me, SPELL_SHADOWFORM, true); - - boss_moroes_guestAI::Reset(); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - boss_moroes_guestAI::UpdateAI(diff); - - if (MindFlay_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_MINDFLY); - MindFlay_Timer = 12000; // 3 sec channeled - } else MindFlay_Timer -= diff; - - if (ManaBurn_Timer <= diff) - { - if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) - if (pTarget->getPowerType() == POWER_MANA) - DoCast(pTarget, SPELL_MANABURN); - ManaBurn_Timer = 5000; // 3 sec cast - } else ManaBurn_Timer -= diff; - - if (ShadowWordPain_Timer <= diff) - { - if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) - { - DoCast(pTarget, SPELL_SWPAIN); - ShadowWordPain_Timer = 7000; - } - } else ShadowWordPain_Timer -= diff; - } -}; - -#define SPELL_HAMMEROFJUSTICE 13005 -#define SPELL_JUDGEMENTOFCOMMAND 29386 -#define SPELL_SEALOFCOMMAND 29385 - -struct boss_baron_rafe_dreugerAI : public boss_moroes_guestAI -{ - //Retr Pally - boss_baron_rafe_dreugerAI(Creature *c) : boss_moroes_guestAI(c){} - - uint32 HammerOfJustice_Timer; - uint32 SealOfCommand_Timer; - uint32 JudgementOfCommand_Timer; - - void Reset() - { - HammerOfJustice_Timer = 1000; - SealOfCommand_Timer = 7000; - JudgementOfCommand_Timer = SealOfCommand_Timer + 29000; - - boss_moroes_guestAI::Reset(); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - boss_moroes_guestAI::UpdateAI(diff); - - if (SealOfCommand_Timer <= diff) - { - DoCast(me, SPELL_SEALOFCOMMAND); - SealOfCommand_Timer = 32000; - JudgementOfCommand_Timer = 29000; - } else SealOfCommand_Timer -= diff; - - if (JudgementOfCommand_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_JUDGEMENTOFCOMMAND); - JudgementOfCommand_Timer = SealOfCommand_Timer + 29000; - } else JudgementOfCommand_Timer -= diff; - - if (HammerOfJustice_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_HAMMEROFJUSTICE); - HammerOfJustice_Timer = 12000; - } else HammerOfJustice_Timer -= diff; - } -}; - -#define SPELL_DISPELMAGIC 15090 //Self or other guest+Moroes -#define SPELL_GREATERHEAL 29564 //Self or other guest+Moroes -#define SPELL_HOLYFIRE 29563 -#define SPELL_PWSHIELD 29408 - -struct boss_lady_catriona_von_indiAI : public boss_moroes_guestAI -{ - //Holy Priest - boss_lady_catriona_von_indiAI(Creature *c) : boss_moroes_guestAI(c) {} - - uint32 DispelMagic_Timer; - uint32 GreaterHeal_Timer; - uint32 HolyFire_Timer; - uint32 PowerWordShield_Timer; - - void Reset() - { - DispelMagic_Timer = 11000; - GreaterHeal_Timer = 1500; - HolyFire_Timer = 5000; - PowerWordShield_Timer = 1000; - - AcquireGUID(); - - boss_moroes_guestAI::Reset(); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - boss_moroes_guestAI::UpdateAI(diff); - - if (PowerWordShield_Timer <= diff) - { - DoCast(me, SPELL_PWSHIELD); - PowerWordShield_Timer = 15000; - } else PowerWordShield_Timer -= diff; - - if (GreaterHeal_Timer <= diff) - { - Unit *pTarget = SelectGuestTarget(); - - DoCast(pTarget, SPELL_GREATERHEAL); - GreaterHeal_Timer = 17000; - } else GreaterHeal_Timer -= diff; - - if (HolyFire_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_HOLYFIRE); - HolyFire_Timer = 22000; - } else HolyFire_Timer -= diff; - - if (DispelMagic_Timer <= diff) - { - if (Unit *pTarget = RAND(SelectGuestTarget(), SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))) - DoCast(pTarget, SPELL_DISPELMAGIC); - - DispelMagic_Timer = 25000; - } else DispelMagic_Timer -= diff; - } -}; - -#define SPELL_CLEANSE 29380 //Self or other guest+Moroes -#define SPELL_GREATERBLESSOFMIGHT 29381 //Self or other guest+Moroes -#define SPELL_HOLYLIGHT 29562 //Self or other guest+Moroes -#define SPELL_DIVINESHIELD 41367 - -struct boss_lady_keira_berrybuckAI : public boss_moroes_guestAI -{ - //Holy Pally - boss_lady_keira_berrybuckAI(Creature *c) : boss_moroes_guestAI(c) {} - - uint32 Cleanse_Timer; - uint32 GreaterBless_Timer; - uint32 HolyLight_Timer; - uint32 DivineShield_Timer; - - void Reset() - { - Cleanse_Timer = 13000; - GreaterBless_Timer = 1000; - HolyLight_Timer = 7000; - DivineShield_Timer = 31000; - - AcquireGUID(); - - boss_moroes_guestAI::Reset(); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - boss_moroes_guestAI::UpdateAI(diff); - - if (DivineShield_Timer <= diff) - { - DoCast(me, SPELL_DIVINESHIELD); - DivineShield_Timer = 31000; - } else DivineShield_Timer -= diff; - - if (HolyLight_Timer <= diff) - { - Unit *pTarget = SelectGuestTarget(); - - DoCast(pTarget, SPELL_HOLYLIGHT); - HolyLight_Timer = 10000; - } else HolyLight_Timer -= diff; - - if (GreaterBless_Timer <= diff) - { - Unit *pTarget = SelectGuestTarget(); - - DoCast(pTarget, SPELL_GREATERBLESSOFMIGHT); - - GreaterBless_Timer = 50000; - } else GreaterBless_Timer -= diff; - - if (Cleanse_Timer <= diff) - { - Unit *pTarget = SelectGuestTarget(); - - DoCast(pTarget, SPELL_CLEANSE); - - Cleanse_Timer = 10000; - } else Cleanse_Timer -= diff; - } -}; - -#define SPELL_HAMSTRING 9080 -#define SPELL_MORTALSTRIKE 29572 -#define SPELL_WHIRLWIND 29573 - -struct boss_lord_robin_darisAI : public boss_moroes_guestAI -{ - //Arms Warr - boss_lord_robin_darisAI(Creature *c) : boss_moroes_guestAI(c) {} - - uint32 Hamstring_Timer; - uint32 MortalStrike_Timer; - uint32 WhirlWind_Timer; - - void Reset() - { - Hamstring_Timer = 7000; - MortalStrike_Timer = 10000; - WhirlWind_Timer = 21000; - - boss_moroes_guestAI::Reset(); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - boss_moroes_guestAI::UpdateAI(diff); - - if (Hamstring_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_HAMSTRING); - Hamstring_Timer = 12000; - } else Hamstring_Timer -= diff; - - if (MortalStrike_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_MORTALSTRIKE); - MortalStrike_Timer = 18000; - } else MortalStrike_Timer -= diff; - - if (WhirlWind_Timer <= diff) - { - DoCast(me, SPELL_WHIRLWIND); - WhirlWind_Timer = 21000; - } else WhirlWind_Timer -= diff; - } -}; - -#define SPELL_DISARM 8379 -#define SPELL_HEROICSTRIKE 29567 -#define SPELL_SHIELDBASH 11972 -#define SPELL_SHIELDWALL 29390 - -struct boss_lord_crispin_ferenceAI : public boss_moroes_guestAI -{ - //Arms Warr - boss_lord_crispin_ferenceAI(Creature *c) : boss_moroes_guestAI(c) {} - - uint32 Disarm_Timer; - uint32 HeroicStrike_Timer; - uint32 ShieldBash_Timer; - uint32 ShieldWall_Timer; - - void Reset() - { - Disarm_Timer = 6000; - HeroicStrike_Timer = 10000; - ShieldBash_Timer = 8000; - ShieldWall_Timer = 4000; - - boss_moroes_guestAI::Reset(); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - boss_moroes_guestAI::UpdateAI(diff); - - if (Disarm_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_DISARM); - Disarm_Timer = 12000; - } else Disarm_Timer -= diff; - - if (HeroicStrike_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_HEROICSTRIKE); - HeroicStrike_Timer = 10000; - } else HeroicStrike_Timer -= diff; - - if (ShieldBash_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SHIELDBASH); - ShieldBash_Timer = 13000; - } else ShieldBash_Timer -= diff; - - if (ShieldWall_Timer <= diff) - { - DoCast(me, SPELL_SHIELDWALL); - ShieldWall_Timer = 21000; - } else ShieldWall_Timer -= diff; - } -}; - -CreatureAI* GetAI_boss_moroes(Creature* pCreature) -{ - return new boss_moroesAI (pCreature); -} - -CreatureAI* GetAI_baroness_dorothea_millstipe(Creature* pCreature) -{ - return new boss_baroness_dorothea_millstipeAI (pCreature); -} - -CreatureAI* GetAI_baron_rafe_dreuger(Creature* pCreature) -{ - return new boss_baron_rafe_dreugerAI (pCreature); -} - -CreatureAI* GetAI_lady_catriona_von_indi(Creature* pCreature) -{ - return new boss_lady_catriona_von_indiAI (pCreature); -} - -CreatureAI* GetAI_lady_keira_berrybuck(Creature* pCreature) -{ - return new boss_lady_keira_berrybuckAI (pCreature); -} - -CreatureAI* GetAI_lord_robin_daris(Creature* pCreature) -{ - return new boss_lord_robin_darisAI (pCreature); -} - -CreatureAI* GetAI_lord_crispin_ference(Creature* pCreature) -{ - return new boss_lord_crispin_ferenceAI (pCreature); -} - -void AddSC_boss_moroes() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "boss_moroes"; - newscript->GetAI = &GetAI_boss_moroes; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_baroness_dorothea_millstipe"; - newscript->GetAI = &GetAI_baroness_dorothea_millstipe; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_baron_rafe_dreuger"; - newscript->GetAI = &GetAI_baron_rafe_dreuger; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_lady_catriona_von_indi"; - newscript->GetAI = &GetAI_lady_catriona_von_indi; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_lady_keira_berrybuck"; - newscript->GetAI = &GetAI_lady_keira_berrybuck; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_lord_robin_daris"; - newscript->GetAI = &GetAI_lord_robin_daris; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_lord_crispin_ference"; - newscript->GetAI = &GetAI_lord_crispin_ference; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/karazhan/boss_netherspite.cpp b/src/server/scripts/EasternKingdoms/karazhan/boss_netherspite.cpp deleted file mode 100644 index 004f1902bfc..00000000000 --- a/src/server/scripts/EasternKingdoms/karazhan/boss_netherspite.cpp +++ /dev/null @@ -1,343 +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_Netherspite -SD%Complete: 90 -SDComment: Not sure about timing and portals placing -SDCategory: Karazhan -EndScriptData */ - -#include "ScriptedPch.h" -#include "karazhan.h" - -#define EMOTE_PHASE_PORTAL -1532089 -#define EMOTE_PHASE_BANISH -1532090 - -#define SPELL_NETHERBURN_AURA 30522 -#define SPELL_VOIDZONE 37063 -#define SPELL_NETHER_INFUSION 38688 -#define SPELL_NETHERBREATH 38523 -#define SPELL_BANISH_VISUAL 39833 -#define SPELL_BANISH_ROOT 42716 -#define SPELL_EMPOWERMENT 38549 -#define SPELL_NETHERSPITE_ROAR 38684 - -const float PortalCoord[3][3] = -{ - {-11195.353516, -1613.237183, 278.237258}, // Left side - {-11137.846680, -1685.607422, 278.239258}, // Right side - {-11094.493164, -1591.969238, 279.949188} // Back side -}; - -enum Netherspite_Portal{ - RED_PORTAL = 0, // Perseverence - GREEN_PORTAL = 1, // Serenity - BLUE_PORTAL = 2 // Dominance -}; - -const uint32 PortalID[3] = {17369, 17367, 17368}; -const uint32 PortalVisual[3] = {30487,30490,30491}; -const uint32 PortalBeam[3] = {30465,30464,30463}; -const uint32 PlayerBuff[3] = {30421,30422,30423}; -const uint32 NetherBuff[3] = {30466,30467,30468}; -const uint32 PlayerDebuff[3] = {38637,38638,38639}; - -struct boss_netherspiteAI : public ScriptedAI -{ - boss_netherspiteAI(Creature* c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - - for (int i=0; i<3; ++i) - { - PortalGUID[i] = 0; - BeamTarget[i] = 0; - BeamerGUID[i] = 0; - } - // need core fix - for (int i=0; i<3; ++i) - { - if (SpellEntry *spell = (SpellEntry*)GetSpellStore()->LookupEntry(PlayerBuff[i])) - spell->AttributesEx |= SPELL_ATTR_EX_NEGATIVE; - } - } - - ScriptedInstance* pInstance; - - bool PortalPhase; - bool Berserk; - uint32 PhaseTimer; // timer for phase switching - uint32 VoidZoneTimer; - uint32 NetherInfusionTimer; // berserking timer - uint32 NetherbreathTimer; - uint32 EmpowermentTimer; - uint32 PortalTimer; // timer for beam checking - uint64 PortalGUID[3]; // guid's of portals - uint64 BeamerGUID[3]; // guid's of auxiliary beaming portals - uint64 BeamTarget[3]; // guid's of portals' current targets - - bool IsBetween(WorldObject* u1, WorldObject *pTarget, WorldObject* u2) // the in-line checker - { - if (!u1 || !u2 || !pTarget) - return false; - - float xn, yn, xp, yp, xh, yh; - xn = u1->GetPositionX(); - yn = u1->GetPositionY(); - xp = u2->GetPositionX(); - yp = u2->GetPositionY(); - xh = pTarget->GetPositionX(); - yh = pTarget->GetPositionY(); - - // check if target is between (not checking distance from the beam yet) - if (dist(xn,yn,xh,yh) >= dist(xn,yn,xp,yp) || dist(xp,yp,xh,yh) >= dist(xn,yn,xp,yp)) - return false; - // check distance from the beam - return (abs((xn-xp)*yh+(yp-yn)*xh-xn*yp+xp*yn)/dist(xn,yn,xp,yp) < 1.5f); - } - - float dist(float xa, float ya, float xb, float yb) // auxiliary method for distance - { - return sqrt((xa-xb)*(xa-xb) + (ya-yb)*(ya-yb)); - } - - void Reset() - { - Berserk = false; - NetherInfusionTimer = 540000; - VoidZoneTimer = 15000; - NetherbreathTimer = 3000; - - HandleDoors(true); - DestroyPortals(); - } - - void SummonPortals() - { - uint8 r = rand()%4; - uint8 pos[3]; - pos[RED_PORTAL] = (r%2 ? (r>1 ? 2: 1): 0); - pos[GREEN_PORTAL] = (r%2 ? 0: (r>1 ? 2: 1)); - pos[BLUE_PORTAL] = (r>1 ? 1: 2); // Blue Portal not on the left side (0) - - for (int i=0; i<3; ++i) - if (Creature *portal = me->SummonCreature(PortalID[i],PortalCoord[pos[i]][0],PortalCoord[pos[i]][1],PortalCoord[pos[i]][2],0,TEMPSUMMON_TIMED_DESPAWN,60000)) - { - PortalGUID[i] = portal->GetGUID(); - portal->AddAura(PortalVisual[i], portal); - } - } - - void DestroyPortals() - { - for (int i=0; i<3; ++i) - { - if (Creature *portal = Unit::GetCreature(*me, PortalGUID[i])) - portal->DisappearAndDie(); - if (Creature *portal = Unit::GetCreature(*me, BeamerGUID[i])) - portal->DisappearAndDie(); - PortalGUID[i] = 0; - BeamTarget[i] = 0; - } - } - - void UpdatePortals() // Here we handle the beams' behavior - { - for (int j=0; j<3; ++j) // j = color - if (Creature *portal = Unit::GetCreature(*me, PortalGUID[j])) - { - // the one who's been casted upon before - Unit *current = Unit::GetUnit(*portal, BeamTarget[j]); - // temporary store for the best suitable beam reciever - Unit *pTarget = me; - - if (Map* map = me->GetMap()) - { - Map::PlayerList const& players = map->GetPlayers(); - - // get the best suitable target - for (Map::PlayerList::const_iterator i = players.begin(); i != players.end(); ++i) - { - Player* p = i->getSource(); - if (p && p->isAlive() // alive - && (!pTarget || pTarget->GetDistance2d(portal)>p->GetDistance2d(portal)) // closer than current best - && !p->HasAura(PlayerDebuff[j],0) // not exhausted - && !p->HasAura(PlayerBuff[(j+1)%3],0) // not on another beam - && !p->HasAura(PlayerBuff[(j+2)%3],0) - && IsBetween(me, p, portal)) // on the beam - pTarget = p; - } - } - // buff the target - if (pTarget->GetTypeId() == TYPEID_PLAYER) - pTarget->AddAura(PlayerBuff[j], pTarget); - else - pTarget->AddAura(NetherBuff[j], pTarget); - // cast visual beam on the chosen target if switched - // simple target switching isn't working -> using BeamerGUID to cast (workaround) - if (!current || pTarget != current) - { - BeamTarget[j] = pTarget->GetGUID(); - // remove currently beaming portal - if (Creature *beamer = Unit::GetCreature(*portal, BeamerGUID[j])) - { - beamer->CastSpell(pTarget, PortalBeam[j], false); - beamer->DisappearAndDie(); - BeamerGUID[j] = 0; - } - // create new one and start beaming on the target - if (Creature *beamer = portal->SummonCreature(PortalID[j],portal->GetPositionX(),portal->GetPositionY(),portal->GetPositionZ(),portal->GetOrientation(),TEMPSUMMON_TIMED_DESPAWN,60000)) - { - beamer->CastSpell(pTarget, PortalBeam[j], false); - BeamerGUID[j] = beamer->GetGUID(); - } - } - // aggro target if Red Beam - if (j == RED_PORTAL && me->getVictim() != pTarget && pTarget->GetTypeId() == TYPEID_PLAYER) - me->getThreatManager().addThreat(pTarget, 100000.0f+DoGetThreat(me->getVictim())); - } - } - - void SwitchToPortalPhase() - { - me->RemoveAurasDueToSpell(SPELL_BANISH_ROOT); - me->RemoveAurasDueToSpell(SPELL_BANISH_VISUAL); - SummonPortals(); - PhaseTimer = 60000; - PortalPhase = true; - PortalTimer = 10000; - EmpowermentTimer = 10000; - DoScriptText(EMOTE_PHASE_PORTAL,me); - } - - void SwitchToBanishPhase() - { - me->RemoveAurasDueToSpell(SPELL_EMPOWERMENT); - me->RemoveAurasDueToSpell(SPELL_NETHERBURN_AURA); - DoCast(me, SPELL_BANISH_VISUAL, true); - DoCast(me, SPELL_BANISH_ROOT, true); - DestroyPortals(); - PhaseTimer = 30000; - PortalPhase = false; - DoScriptText(EMOTE_PHASE_BANISH,me); - - for (int i=0; i<3; ++i) - me->RemoveAurasDueToSpell(NetherBuff[i]); - } - - void HandleDoors(bool open) // Massive Door switcher - { - if (GameObject *Door = GameObject::GetGameObject(*me, pInstance ? pInstance->GetData64(DATA_GO_MASSIVE_DOOR) : 0)) - Door->SetGoState(open ? GO_STATE_ACTIVE : GO_STATE_READY); - } - - void Aggro(Unit * /*who*/) - { - HandleDoors(false); - SwitchToPortalPhase(); - } - - void JustDied(Unit* /*killer*/) - { - HandleDoors(true); - DestroyPortals(); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - // Void Zone - if (VoidZoneTimer <= diff) - { - DoCast(SelectTarget(SELECT_TARGET_RANDOM,1,45,true),SPELL_VOIDZONE,true); - VoidZoneTimer = 15000; - } else VoidZoneTimer -= diff; - - // NetherInfusion Berserk - if (!Berserk && NetherInfusionTimer <= diff) - { - me->AddAura(SPELL_NETHER_INFUSION, me); - DoCast(me, SPELL_NETHERSPITE_ROAR); - Berserk = true; - } else NetherInfusionTimer -= diff; - - if (PortalPhase) // PORTAL PHASE - { - // Distribute beams and buffs - if (PortalTimer <= diff) - { - UpdatePortals(); - PortalTimer = 1000; - } else PortalTimer -= diff; - - // Empowerment & Nether Burn - if (EmpowermentTimer <= diff) - { - DoCast(me, SPELL_EMPOWERMENT); - me->AddAura(SPELL_NETHERBURN_AURA, me); - EmpowermentTimer = 90000; - } else EmpowermentTimer -= diff; - - if (PhaseTimer <= diff) - { - if (!me->IsNonMeleeSpellCasted(false)) - { - SwitchToBanishPhase(); - return; - } - } else PhaseTimer -= diff; - } - else // BANISH PHASE - { - // Netherbreath - if (NetherbreathTimer <= diff) - { - if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0,40,true)) - DoCast(pTarget, SPELL_NETHERBREATH); - NetherbreathTimer = urand(5000,7000); - } else NetherbreathTimer -= diff; - - if (PhaseTimer <= diff) - { - if (!me->IsNonMeleeSpellCasted(false)) - { - SwitchToPortalPhase(); - return; - } - } else PhaseTimer -= diff; - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_netherspite(Creature *pCreature) -{ - return new boss_netherspiteAI(pCreature); -} - -void AddSC_boss_netherspite() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "boss_netherspite"; - newscript->GetAI = GetAI_boss_netherspite; - newscript->RegisterSelf(); -} diff --git a/src/server/scripts/EasternKingdoms/karazhan/boss_nightbane.cpp b/src/server/scripts/EasternKingdoms/karazhan/boss_nightbane.cpp deleted file mode 100644 index 2e8b6f51317..00000000000 --- a/src/server/scripts/EasternKingdoms/karazhan/boss_nightbane.cpp +++ /dev/null @@ -1,418 +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_Nightbane -SD%Complete: 80 -SDComment: SDComment: Timers may incorrect -SDCategory: Karazhan -EndScriptData */ - -#include "ScriptedPch.h" -#include "karazhan.h" - -//phase 1 -#define SPELL_BELLOWING_ROAR 39427 -#define SPELL_CHARRED_EARTH 30129 -#define SPELL_DISTRACTING_ASH 30130 -#define SPELL_SMOLDERING_BREATH 30210 -#define SPELL_TAIL_SWEEP 25653 -//phase 2 -#define SPELL_RAIN_OF_BONES 37098 -#define SPELL_SMOKING_BLAST 37057 -#define SPELL_FIREBALL_BARRAGE 30282 -#define SPELL_SEARING_CINDERS 30127 -#define SPELL_SUMMON_SKELETON 30170 - -#define EMOTE_SUMMON "An ancient being awakens in the distance..." -#define YELL_AGGRO "What fools! I shall bring a quick end to your suffering!" -#define YELL_FLY_PHASE "Miserable vermin. I shall exterminate you from the air!" -#define YELL_LAND_PHASE_1 "Enough! I shall land and crush you myself!" -#define YELL_LAND_PHASE_2 "Insects! Let me show you my strength up close!" -#define EMOTE_BREATH "takes a deep breath." - -float IntroWay[8][3] = -{ - {-11053.37,-1794.48,149}, - {-11141.07,-1841.40,125}, - {-11187.28,-1890.23,125}, - {-11189.20,-1931.25,125}, - {-11153.76,-1948.93,125}, - {-11128.73,-1929.75,125}, - {-11140 , -1915 ,122}, - {-11163 , -1903 ,91.473} -}; - -struct boss_nightbaneAI : public ScriptedAI -{ - boss_nightbaneAI(Creature* c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - Intro = true; - } - - ScriptedInstance* pInstance; - - uint32 Phase; - - bool RainBones; - bool Skeletons; - - uint32 BellowingRoarTimer; - uint32 CharredEarthTimer; - uint32 DistractingAshTimer; - uint32 SmolderingBreathTimer; - uint32 TailSweepTimer; - uint32 RainofBonesTimer; - uint32 SmokingBlastTimer; - uint32 FireballBarrageTimer; - uint32 SearingCindersTimer; - - uint32 FlyCount; - uint32 FlyTimer; - - bool Intro; - bool Flying; - bool Movement; - - uint32 WaitTimer; - uint32 MovePhase; - - void Reset() - { - BellowingRoarTimer = 30000; - CharredEarthTimer = 15000; - DistractingAshTimer = 20000; - SmolderingBreathTimer = 10000; - TailSweepTimer = 12000; - RainofBonesTimer = 10000; - SmokingBlastTimer = 20000; - FireballBarrageTimer = 13000; - SearingCindersTimer = 14000; - WaitTimer = 1000; - - Phase =1; - FlyCount = 0; - MovePhase = 0; - - me->SetSpeed(MOVE_RUN, 2.0f); - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - me->setActive(true); - - if (pInstance) - { - if (pInstance->GetData(TYPE_NIGHTBANE) == DONE || pInstance->GetData(TYPE_NIGHTBANE) == IN_PROGRESS) - me->DisappearAndDie(); - else - pInstance->SetData(TYPE_NIGHTBANE, NOT_STARTED); - } - - HandleTerraceDoors(true); - - Flying = false; - Movement = false; - - if (!Intro) - { - me->SetHomePosition(IntroWay[7][0],IntroWay[7][1],IntroWay[7][2],0); - me->GetMotionMaster()->MoveTargetedHome(); - } - } - - void HandleTerraceDoors(bool open) - { - if (pInstance) - { - pInstance->HandleGameObject(pInstance->GetData64(DATA_MASTERS_TERRACE_DOOR_1), open); - pInstance->HandleGameObject(pInstance->GetData64(DATA_MASTERS_TERRACE_DOOR_2), open); - } - } - - void EnterCombat(Unit * /*who*/) - { - if (pInstance) - pInstance->SetData(TYPE_NIGHTBANE, IN_PROGRESS); - - HandleTerraceDoors(false); - me->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, NULL); - } - - void AttackStart(Unit* who) - { - if (!Intro && !Flying) - ScriptedAI::AttackStart(who); - } - - void JustDied(Unit* /*killer*/) - { - if (pInstance) - pInstance->SetData(TYPE_NIGHTBANE, DONE); - - HandleTerraceDoors(true); - } - - void MoveInLineOfSight(Unit *who) - { - if (!Intro && !Flying) - ScriptedAI::MoveInLineOfSight(who); - } - - void MovementInform(uint32 type, uint32 id) - { - if (type != POINT_MOTION_TYPE) - return; - - if (Intro) - { - if (id >= 8) - { - Intro = false; - me->SetHomePosition(IntroWay[7][0],IntroWay[7][1],IntroWay[7][2],0); - return; - } - - WaitTimer = 1; - } - - if (Flying) - { - if (id == 0) - { - me->MonsterTextEmote(EMOTE_BREATH, 0, true); - Flying = false; - Phase = 2; - return; - } - - if (id == 3) - { - MovePhase = 4; - WaitTimer = 1; - return; - } - - if (id == 8) - { - Flying = false; - Phase = 1; - Movement = true; - return; - } - - WaitTimer = 1; - } - } - - void JustSummoned(Creature *summoned) - { - summoned->AI()->AttackStart(me->getVictim()); - } - - void TakeOff() - { - me->MonsterYell(YELL_FLY_PHASE, LANG_UNIVERSAL, NULL); - - me->InterruptSpell(CURRENT_GENERIC_SPELL); - me->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - (*me).GetMotionMaster()->Clear(false); - (*me).GetMotionMaster()->MovePoint(0,IntroWay[2][0],IntroWay[2][1],IntroWay[2][2]); - - Flying = true; - - FlyTimer = urand(45000,60000); //timer wrong between 45 and 60 seconds - ++FlyCount; - - RainofBonesTimer = 5000; //timer wrong (maybe) - RainBones = false; - Skeletons = false; - } - - void UpdateAI(const uint32 diff) - { - /* The timer for this was never setup apparently, not sure if the code works properly: - if (WaitTimer <= diff) - { - if (Intro) - { - if (MovePhase >= 7) - { - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - me->HandleEmoteCommand(EMOTE_ONESHOT_LAND); - me->GetMotionMaster()->MovePoint(8,IntroWay[7][0],IntroWay[7][1],IntroWay[7][2]); - } - else - { - me->GetMotionMaster()->MovePoint(MovePhase,IntroWay[MovePhase][0],IntroWay[MovePhase][1],IntroWay[MovePhase][2]); - ++MovePhase; - } - } - if (Flying) - { - if (MovePhase >= 7) - { - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - me->HandleEmoteCommand(EMOTE_ONESHOT_LAND); - me->GetMotionMaster()->MovePoint(8,IntroWay[7][0],IntroWay[7][1],IntroWay[7][2]); - } - else - { - me->GetMotionMaster()->MovePoint(MovePhase,IntroWay[MovePhase][0],IntroWay[MovePhase][1],IntroWay[MovePhase][2]); - ++MovePhase; - } - } - - WaitTimer = 0; - } else WaitTimer -= diff; - */ - - if (!UpdateVictim()) - return; - - if (Flying) - return; - - // Phase 1 "GROUND FIGHT" - if (Phase == 1) - { - if (Movement) - { - DoStartMovement(me->getVictim()); - Movement = false; - } - - if (BellowingRoarTimer <= diff) - { - DoCast(me->getVictim(), SPELL_BELLOWING_ROAR); - BellowingRoarTimer = urand(30000,40000); - } else BellowingRoarTimer -= diff; - - if (SmolderingBreathTimer <= diff) - { - DoCast(me->getVictim(), SPELL_SMOLDERING_BREATH); - SmolderingBreathTimer = 20000; - } else SmolderingBreathTimer -= diff; - - if (CharredEarthTimer <= diff) - { - if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) - DoCast(pTarget, SPELL_CHARRED_EARTH); - CharredEarthTimer = 20000; - } else CharredEarthTimer -= diff; - - if (TailSweepTimer <= diff) - { - if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) - if (!me->HasInArc(M_PI, pTarget)) - DoCast(pTarget, SPELL_TAIL_SWEEP); - TailSweepTimer = 15000; - } else TailSweepTimer -= diff; - - if (SearingCindersTimer <= diff) - { - if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) - DoCast(pTarget, SPELL_SEARING_CINDERS); - SearingCindersTimer = 10000; - } else SearingCindersTimer -= diff; - - uint32 Prozent; - Prozent = (me->GetHealth()*100) / me->GetMaxHealth(); - - if (Prozent < 75 && FlyCount == 0) // first take off 75% - TakeOff(); - - if (Prozent < 50 && FlyCount == 1) // secound take off 50% - TakeOff(); - - if (Prozent < 25 && FlyCount == 2) // third take off 25% - TakeOff(); - - DoMeleeAttackIfReady(); - } - - //Phase 2 "FLYING FIGHT" - if (Phase == 2) - { - if (!RainBones) - { - if (!Skeletons) - { - for (uint8 i = 0; i <= 3; ++i) - { - DoCast(me->getVictim(), SPELL_SUMMON_SKELETON); - Skeletons = true; - } - } - - if (RainofBonesTimer < diff && !RainBones) // only once at the beginning of phase 2 - { - DoCast(me->getVictim(), SPELL_RAIN_OF_BONES); - RainBones = true; - SmokingBlastTimer = 20000; - } else RainofBonesTimer -= diff; - - if (DistractingAshTimer <= diff) - { - if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) - DoCast(pTarget, SPELL_DISTRACTING_ASH); - DistractingAshTimer = 2000; //timer wrong - } else DistractingAshTimer -= diff; - } - - if (RainBones) - { - if (SmokingBlastTimer <= diff) - { - DoCast(me->getVictim(), SPELL_SMOKING_BLAST); - SmokingBlastTimer = 1500; //timer wrong - } else SmokingBlastTimer -= diff; - } - - if (FireballBarrageTimer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_FARTHEST, 0)) - DoCast(pTarget, SPELL_FIREBALL_BARRAGE); - FireballBarrageTimer = 20000; - } else FireballBarrageTimer -= diff; - - if (FlyTimer <= diff) //landing - { - me->MonsterYell(RAND(*YELL_LAND_PHASE_1,*YELL_LAND_PHASE_2), LANG_UNIVERSAL, NULL); - - me->GetMotionMaster()->Clear(false); - me->GetMotionMaster()->MovePoint(3,IntroWay[3][0],IntroWay[3][1],IntroWay[3][2]); - - Flying = true; - } else FlyTimer -= diff; - } - } -}; - -CreatureAI* GetAI_boss_nightbane(Creature* pCreature) -{ - return new boss_nightbaneAI (pCreature); -} - -void AddSC_boss_nightbane() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_nightbane"; - newscript->GetAI = &GetAI_boss_nightbane; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/karazhan/boss_prince_malchezaar.cpp b/src/server/scripts/EasternKingdoms/karazhan/boss_prince_malchezaar.cpp deleted file mode 100644 index 1071eae78a0..00000000000 --- a/src/server/scripts/EasternKingdoms/karazhan/boss_prince_malchezaar.cpp +++ /dev/null @@ -1,604 +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_Prince_Malchezzar -SD%Complete: 100 -SDComment: -SDCategory: Karazhan -EndScriptData */ - -#include "ScriptedPch.h" -#include "karazhan.h" - -#define SAY_AGGRO -1532091 -#define SAY_AXE_TOSS1 -1532092 -#define SAY_AXE_TOSS2 -1532093 -#define SAY_SPECIAL1 -1532094 -#define SAY_SPECIAL2 -1532095 -#define SAY_SPECIAL3 -1532096 -#define SAY_SLAY1 -1532097 -#define SAY_SLAY2 -1532098 -#define SAY_SLAY3 -1532099 -#define SAY_SUMMON1 -1532100 -#define SAY_SUMMON2 -1532101 -#define SAY_DEATH -1532102 - -// 18 Coordinates for Infernal spawns -struct InfernalPoint -{ - float x,y; -}; - -#define INFERNAL_Z 275.5 - -static InfernalPoint InfernalPoints[] = -{ - {-10922.8, -1985.2}, - {-10916.2, -1996.2}, - {-10932.2, -2008.1}, - {-10948.8, -2022.1}, - {-10958.7, -1997.7}, - {-10971.5, -1997.5}, - {-10990.8, -1995.1}, - {-10989.8, -1976.5}, - {-10971.6, -1973.0}, - {-10955.5, -1974.0}, - {-10939.6, -1969.8}, - {-10958.0, -1952.2}, - {-10941.7, -1954.8}, - {-10943.1, -1988.5}, - {-10948.8, -2005.1}, - {-10984.0, -2019.3}, - {-10932.8, -1979.6}, - {-10935.7, -1996.0} -}; - -#define TOTAL_INFERNAL_POINTS 18 - -//Enfeeble is supposed to reduce hp to 1 and then heal player back to full when it ends -//Along with reducing healing and regen while enfeebled to 0% -//This spell effect will only reduce healing - -#define SPELL_ENFEEBLE 30843 //Enfeeble during phase 1 and 2 -#define SPELL_ENFEEBLE_EFFECT 41624 - -#define SPELL_SHADOWNOVA 30852 //Shadownova used during all phases -#define SPELL_SW_PAIN 30854 //Shadow word pain during phase 1 and 3 (different targeting rules though) -#define SPELL_THRASH_PASSIVE 12787 //Extra attack chance during phase 2 -#define SPELL_SUNDER_ARMOR 30901 //Sunder armor during phase 2 -#define SPELL_THRASH_AURA 12787 //Passive proc chance for thrash -#define SPELL_EQUIP_AXES 30857 //Visual for axe equiping -#define SPELL_AMPLIFY_DAMAGE 39095 //Amplifiy during phase 3 -#define SPELL_CLEAVE 30131 //Same as Nightbane. -#define SPELL_HELLFIRE 30859 //Infenals' hellfire aura -#define NETHERSPITE_INFERNAL 17646 //The netherspite infernal creature -#define MALCHEZARS_AXE 17650 //Malchezar's axes (creatures), summoned during phase 3 - -#define INFERNAL_MODEL_INVISIBLE 11686 //Infernal Effects -#define SPELL_INFERNAL_RELAY 30834 - -#define EQUIP_ID_AXE 33542 //Axes info - -//---------Infernal code first -struct netherspite_infernalAI : public ScriptedAI -{ - netherspite_infernalAI(Creature *c) : ScriptedAI(c) , - malchezaar(0), HellfireTimer(0), CleanupTimer(0), point(NULL) {} - - uint32 HellfireTimer; - uint32 CleanupTimer; - uint32 malchezaar; - InfernalPoint *point; - - void Reset() {} - void EnterCombat(Unit * /*who*/) {} - void MoveInLineOfSight(Unit * /*who*/) {} - - void UpdateAI(const uint32 diff) - { - if (HellfireTimer) - if (HellfireTimer <= diff) - { - DoCast(me, SPELL_HELLFIRE); - HellfireTimer = 0; - } - else HellfireTimer -= diff; - - if (CleanupTimer) - if (CleanupTimer <= diff) - { - Cleanup(); - CleanupTimer = 0; - } else CleanupTimer -= diff; - } - - void KilledUnit(Unit *who) - { - Unit *pMalchezaar = Unit::GetUnit(*me, malchezaar); - if (pMalchezaar) - CAST_CRE(pMalchezaar)->AI()->KilledUnit(who); - } - - void SpellHit(Unit * /*who*/, const SpellEntry *spell) - { - if (spell->Id == SPELL_INFERNAL_RELAY) - { - me->SetDisplayId(me->GetUInt32Value(UNIT_FIELD_NATIVEDISPLAYID)); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - HellfireTimer = 4000; - CleanupTimer = 170000; - } - } - - void DamageTaken(Unit *done_by, uint32 &damage) - { - if (done_by->GetGUID() != malchezaar) - damage = 0; - } - - void Cleanup(); //below ... -}; - -struct boss_malchezaarAI : public ScriptedAI -{ - boss_malchezaarAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance *pInstance; - uint32 EnfeebleTimer; - uint32 EnfeebleResetTimer; - uint32 ShadowNovaTimer; - uint32 SWPainTimer; - uint32 SunderArmorTimer; - uint32 AmplifyDamageTimer; - uint32 Cleave_Timer; - uint32 InfernalTimer; - uint32 AxesTargetSwitchTimer; - uint32 InfernalCleanupTimer; - - std::vector infernals; - std::vector positions; - - uint64 axes[2]; - uint64 enfeeble_targets[5]; - uint64 enfeeble_health[5]; - - uint32 phase; - - void Reset() - { - AxesCleanup(); - ClearWeapons(); - InfernalCleanup(); - positions.clear(); - - for (uint8 i = 0; i < 5; ++i) - enfeeble_targets[i] = 0; - - for (uint8 i = 0; i < TOTAL_INFERNAL_POINTS; ++i) - positions.push_back(&InfernalPoints[i]); - - EnfeebleTimer = 30000; - EnfeebleResetTimer = 38000; - ShadowNovaTimer = 35500; - SWPainTimer = 20000; - AmplifyDamageTimer = 5000; - Cleave_Timer = 8000; - InfernalTimer = 45000; - InfernalCleanupTimer = 47000; - AxesTargetSwitchTimer = urand(7500,20000); - SunderArmorTimer = urand(5000,10000); - phase = 1; - - if (pInstance) - pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_NETHER_DOOR), true); - } - - void KilledUnit(Unit * /*victim*/) - { - DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), me); - } - - void JustDied(Unit * /*victim*/) - { - DoScriptText(SAY_DEATH, me); - - AxesCleanup(); - ClearWeapons(); - InfernalCleanup(); - positions.clear(); - - for (uint8 i = 0; i < TOTAL_INFERNAL_POINTS; ++i) - positions.push_back(&InfernalPoints[i]); - - if (pInstance) - pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_NETHER_DOOR), true); - } - - void EnterCombat(Unit * /*who*/) - { - DoScriptText(SAY_AGGRO, me); - - if (pInstance) - pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_NETHER_DOOR), false); // Open the door leading further in - } - - void InfernalCleanup() - { - //Infernal Cleanup - for (std::vector::const_iterator itr = infernals.begin(); itr != infernals.end(); ++itr) - if (Unit *pInfernal = Unit::GetUnit(*me, *itr)) - if (pInfernal->isAlive()) - { - pInfernal->SetVisibility(VISIBILITY_OFF); - pInfernal->setDeathState(JUST_DIED); - } - - infernals.clear(); - } - - void AxesCleanup() - { - for (uint8 i = 0; i < 2; ++i) - { - Unit *axe = Unit::GetUnit(*me, axes[i]); - if (axe && axe->isAlive()) - axe->Kill(axe); - axes[i] = 0; - } - } - - void ClearWeapons() - { - SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); - - //damage - const CreatureInfo *cinfo = me->GetCreatureInfo(); - me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, cinfo->mindmg); - me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, cinfo->maxdmg); - me->UpdateDamagePhysical(BASE_ATTACK); - } - - void EnfeebleHealthEffect() - { - const SpellEntry *info = GetSpellStore()->LookupEntry(SPELL_ENFEEBLE_EFFECT); - if (!info) - return; - - std::list t_list = me->getThreatManager().getThreatList(); - std::vector targets; - - if (!t_list.size()) - return; - - //begin + 1, so we don't target the one with the highest threat - std::list::const_iterator itr = t_list.begin(); - std::advance(itr, 1); - for (; itr != t_list.end(); ++itr) //store the threat list in a different container - if (Unit *pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid())) - if (pTarget->isAlive() && pTarget->GetTypeId() == TYPEID_PLAYER) - targets.push_back(pTarget); - - //cut down to size if we have more than 5 targets - while (targets.size() > 5) - targets.erase(targets.begin()+rand()%targets.size()); - - uint32 i = 0; - for (std::vector::const_iterator iter = targets.begin(); iter != targets.end(); ++iter, ++i) - if (Unit *pTarget = *iter) - { - enfeeble_targets[i] = pTarget->GetGUID(); - enfeeble_health[i] = pTarget->GetHealth(); - - pTarget->CastSpell(pTarget, SPELL_ENFEEBLE, true, 0, 0, me->GetGUID()); - pTarget->SetHealth(1); - } - } - - void EnfeebleResetHealth() - { - for (uint8 i = 0; i < 5; ++i) - { - Unit *pTarget = Unit::GetUnit(*me, enfeeble_targets[i]); - if (pTarget && pTarget->isAlive()) - pTarget->SetHealth(enfeeble_health[i]); - enfeeble_targets[i] = 0; - enfeeble_health[i] = 0; - } - } - - void SummonInfernal(const uint32 /*diff*/) - { - InfernalPoint *point = NULL; - Position pos; - if ((me->GetMapId() != 532) || positions.empty()) - me->GetRandomNearPosition(pos, 60); - else - { - std::vector::iterator itr = positions.begin()+rand()%positions.size(); - point = *itr; - positions.erase(itr); - pos.Relocate(point->x, point->y, INFERNAL_Z); - } - - Creature *Infernal = me->SummonCreature(NETHERSPITE_INFERNAL, pos, TEMPSUMMON_TIMED_DESPAWN, 180000); - - if (Infernal) - { - Infernal->SetDisplayId(INFERNAL_MODEL_INVISIBLE); - Infernal->setFaction(me->getFaction()); - if (point) - CAST_AI(netherspite_infernalAI, Infernal->AI())->point=point; - CAST_AI(netherspite_infernalAI, Infernal->AI())->malchezaar=me->GetGUID(); - - infernals.push_back(Infernal->GetGUID()); - DoCast(Infernal, SPELL_INFERNAL_RELAY); - } - - DoScriptText(RAND(SAY_SUMMON1,SAY_SUMMON2), me); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (EnfeebleResetTimer && EnfeebleResetTimer <= diff) // Let's not forget to reset that - { - EnfeebleResetHealth(); - EnfeebleResetTimer = 0; - } else EnfeebleResetTimer -= diff; - - if (me->hasUnitState(UNIT_STAT_STUNNED)) // While shifting to phase 2 malchezaar stuns himself - return; - - if (me->GetUInt64Value(UNIT_FIELD_TARGET) != me->getVictim()->GetGUID()) - me->SetUInt64Value(UNIT_FIELD_TARGET, me->getVictim()->GetGUID()); - - if (phase == 1) - { - if ((me->GetHealth()*100) / me->GetMaxHealth() < 60) - { - me->InterruptNonMeleeSpells(false); - - phase = 2; - - //animation - DoCast(me, SPELL_EQUIP_AXES); - - //text - DoScriptText(SAY_AXE_TOSS1, me); - - //passive thrash aura - DoCast(me, SPELL_THRASH_AURA, true); - - //models - SetEquipmentSlots(false, EQUIP_ID_AXE, EQUIP_ID_AXE, EQUIP_NO_CHANGE); - - //damage - const CreatureInfo *cinfo = me->GetCreatureInfo(); - me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, 2*cinfo->mindmg); - me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, 2*cinfo->maxdmg); - me->UpdateDamagePhysical(BASE_ATTACK); - - me->SetBaseWeaponDamage(OFF_ATTACK, MINDAMAGE, cinfo->mindmg); - me->SetBaseWeaponDamage(OFF_ATTACK, MAXDAMAGE, cinfo->maxdmg); - //Sigh, updating only works on main attack, do it manually .... - me->SetFloatValue(UNIT_FIELD_MINOFFHANDDAMAGE, cinfo->mindmg); - me->SetFloatValue(UNIT_FIELD_MAXOFFHANDDAMAGE, cinfo->maxdmg); - - me->SetAttackTime(OFF_ATTACK, (me->GetAttackTime(BASE_ATTACK)*150)/100); - } - } - else if (phase == 2) - { - if ((me->GetHealth()*100) / me->GetMaxHealth() < 30) - { - InfernalTimer = 15000; - - phase = 3; - - ClearWeapons(); - - //remove thrash - me->RemoveAurasDueToSpell(SPELL_THRASH_AURA); - - DoScriptText(SAY_AXE_TOSS2, me); - - Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); - for (uint8 i = 0; i < 2; ++i) - { - Creature *axe = me->SummonCreature(MALCHEZARS_AXE, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000); - if (axe) - { - axe->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - axe->setFaction(me->getFaction()); - axes[i] = axe->GetGUID(); - if (pTarget) - { - axe->AI()->AttackStart(pTarget); - //axe->getThreatManager().tauntApply(pTarget); //Taunt Apply and fade out does not work properly - // So we'll use a hack to add a lot of threat to our target - axe->AddThreat(pTarget, 10000000.0f); - } - } - } - - if (ShadowNovaTimer > 35000) - ShadowNovaTimer = EnfeebleTimer + 5000; - - return; - } - - if (SunderArmorTimer <= diff) - { - DoCast(me->getVictim(), SPELL_SUNDER_ARMOR); - SunderArmorTimer = urand(10000,18000); - - } else SunderArmorTimer -= diff; - - if (Cleave_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_CLEAVE); - Cleave_Timer = urand(6000,12000); - - } else Cleave_Timer -= diff; - } - else - { - if (AxesTargetSwitchTimer <= diff) - { - AxesTargetSwitchTimer = urand(7500,20000); - - if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) - { - for (uint8 i = 0; i < 2; ++i) - { - if (Unit *axe = Unit::GetUnit(*me, axes[i])) - { - if (axe->getVictim()) - DoModifyThreatPercent(axe->getVictim(), -100); - if (pTarget) - axe->AddThreat(pTarget, 1000000.0f); - //axe->getThreatManager().tauntFadeOut(axe->getVictim()); - //axe->getThreatManager().tauntApply(pTarget); - } - } - } - } else AxesTargetSwitchTimer -= diff; - - if (AmplifyDamageTimer <= diff) - { - if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) - DoCast(pTarget, SPELL_AMPLIFY_DAMAGE); - AmplifyDamageTimer = urand(20000,30000); - } else AmplifyDamageTimer -= diff; - } - - //Time for global and double timers - if (InfernalTimer <= diff) - { - SummonInfernal(diff); - InfernalTimer = phase == 3 ? 14500 : 44500; // 15 secs in phase 3, 45 otherwise - } else InfernalTimer -= diff; - - if (ShadowNovaTimer <= diff) - { - DoCast(me->getVictim(), SPELL_SHADOWNOVA); - ShadowNovaTimer = phase == 3 ? 31000 : uint32(-1); - } else ShadowNovaTimer -= diff; - - if (phase != 2) - { - if (SWPainTimer <= diff) - { - Unit *pTarget = NULL; - if (phase == 1) - pTarget = me->getVictim(); // the tank - else // anyone but the tank - pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true); - - if (pTarget) - DoCast(pTarget, SPELL_SW_PAIN); - - SWPainTimer = 20000; - } else SWPainTimer -= diff; - } - - if (phase != 3) - { - if (EnfeebleTimer <= diff) - { - EnfeebleHealthEffect(); - EnfeebleTimer = 30000; - ShadowNovaTimer = 5000; - EnfeebleResetTimer = 9000; - } else EnfeebleTimer -= diff; - } - - if (phase == 2) - DoMeleeAttacksIfReady(); - else - DoMeleeAttackIfReady(); - } - - void DoMeleeAttacksIfReady() - { - if (me->IsWithinMeleeRange(me->getVictim()) && !me->IsNonMeleeSpellCasted(false)) - { - //Check for base attack - if (me->isAttackReady() && me->getVictim()) - { - me->AttackerStateUpdate(me->getVictim()); - me->resetAttackTimer(); - } - //Check for offhand attack - if (me->isAttackReady(OFF_ATTACK) && me->getVictim()) - { - me->AttackerStateUpdate(me->getVictim(), OFF_ATTACK); - me->resetAttackTimer(OFF_ATTACK); - } - } - } - - void Cleanup(Creature *infernal, InfernalPoint *point) - { - for (std::vector::iterator itr = infernals.begin(); itr!= infernals.end(); ++itr) - if (*itr == infernal->GetGUID()) - { - infernals.erase(itr); - break; - } - - positions.push_back(point); - } -}; - -void netherspite_infernalAI::Cleanup() -{ - Unit *pMalchezaar = Unit::GetUnit(*me, malchezaar); - - if (pMalchezaar && pMalchezaar->isAlive()) - CAST_AI(boss_malchezaarAI, CAST_CRE(pMalchezaar)->AI())->Cleanup(me, point); -} - -CreatureAI* GetAI_netherspite_infernal(Creature* pCreature) -{ - return new netherspite_infernalAI (pCreature); -} - -CreatureAI* GetAI_boss_malchezaar(Creature* pCreature) -{ - return new boss_malchezaarAI (pCreature); -} - -void AddSC_boss_malchezaar() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_malchezaar"; - newscript->GetAI = &GetAI_boss_malchezaar; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "netherspite_infernal"; - newscript->GetAI = &GetAI_netherspite_infernal; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/karazhan/boss_shade_of_aran.cpp b/src/server/scripts/EasternKingdoms/karazhan/boss_shade_of_aran.cpp deleted file mode 100644 index 394cff3ccc5..00000000000 --- a/src/server/scripts/EasternKingdoms/karazhan/boss_shade_of_aran.cpp +++ /dev/null @@ -1,569 +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_Aran -SD%Complete: 95 -SDComment: Flame wreath missing cast animation, mods won't triggere. -SDCategory: Karazhan -EndScriptData */ - -#include "ScriptedPch.h" -#include "ScriptedSimpleAI.h" -#include "karazhan.h" -#include "GameObject.h" - -#define SAY_AGGRO1 -1532073 -#define SAY_AGGRO2 -1532074 -#define SAY_AGGRO3 -1532075 -#define SAY_FLAMEWREATH1 -1532076 -#define SAY_FLAMEWREATH2 -1532077 -#define SAY_BLIZZARD1 -1532078 -#define SAY_BLIZZARD2 -1532079 -#define SAY_EXPLOSION1 -1532080 -#define SAY_EXPLOSION2 -1532081 -#define SAY_DRINK -1532082 //Low Mana / AoE Pyroblast -#define SAY_ELEMENTALS -1532083 -#define SAY_KILL1 -1532084 -#define SAY_KILL2 -1532085 -#define SAY_TIMEOVER -1532086 -#define SAY_DEATH -1532087 -#define SAY_ATIESH -1532088 //Atiesh is equipped by a raid member - -//Spells -#define SPELL_FROSTBOLT 29954 -#define SPELL_FIREBALL 29953 -#define SPELL_ARCMISSLE 29955 -#define SPELL_CHAINSOFICE 29991 -#define SPELL_DRAGONSBREATH 29964 -#define SPELL_MASSSLOW 30035 -#define SPELL_FLAME_WREATH 29946 -#define SPELL_AOE_CS 29961 -#define SPELL_PLAYERPULL 32265 -#define SPELL_AEXPLOSION 29973 -#define SPELL_MASS_POLY 29963 -#define SPELL_BLINK_CENTER 29967 -#define SPELL_ELEMENTALS 29962 -#define SPELL_CONJURE 29975 -#define SPELL_DRINK 30024 -#define SPELL_POTION 32453 -#define SPELL_AOE_PYROBLAST 29978 - -//Creature Spells -#define SPELL_CIRCULAR_BLIZZARD 29951 //29952 is the REAL circular blizzard that leaves persistant blizzards that last for 10 seconds -#define SPELL_WATERBOLT 31012 -#define SPELL_SHADOW_PYRO 29978 - -//Creatures -#define CREATURE_WATER_ELEMENTAL 17167 -#define CREATURE_SHADOW_OF_ARAN 18254 -#define CREATURE_ARAN_BLIZZARD 17161 - -enum SuperSpell -{ - SUPER_FLAME = 0, - SUPER_BLIZZARD, - SUPER_AE, -}; - -struct boss_aranAI : public ScriptedAI -{ - boss_aranAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint32 SecondarySpellTimer; - uint32 NormalCastTimer; - uint32 SuperCastTimer; - uint32 BerserkTimer; - uint32 CloseDoorTimer; // Don't close the door right on aggro in case some people are still entering. - - uint8 LastSuperSpell; - - uint32 FlameWreathTimer; - uint32 FlameWreathCheckTime; - uint64 FlameWreathTarget[3]; - float FWTargPosX[3]; - float FWTargPosY[3]; - - uint32 CurrentNormalSpell; - uint32 ArcaneCooldown; - uint32 FireCooldown; - uint32 FrostCooldown; - - uint32 DrinkInturruptTimer; - - bool ElementalsSpawned; - bool Drinking; - bool DrinkInturrupted; - - void Reset() - { - SecondarySpellTimer = 5000; - NormalCastTimer = 0; - SuperCastTimer = 35000; - BerserkTimer = 720000; - CloseDoorTimer = 15000; - - LastSuperSpell = rand()%3; - - FlameWreathTimer = 0; - FlameWreathCheckTime = 0; - - CurrentNormalSpell = 0; - ArcaneCooldown = 0; - FireCooldown = 0; - FrostCooldown = 0; - - DrinkInturruptTimer = 10000; - - ElementalsSpawned = false; - Drinking = false; - DrinkInturrupted = false; - - if (pInstance) - { - // Not in progress - pInstance->SetData(TYPE_ARAN, NOT_STARTED); - pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_LIBRARY_DOOR), true); - } - } - - void KilledUnit(Unit * /*victim*/) - { - DoScriptText(RAND(SAY_KILL1,SAY_KILL2), me); - } - - void JustDied(Unit * /*victim*/) - { - DoScriptText(SAY_DEATH, me); - - if (pInstance) - { - pInstance->SetData(TYPE_ARAN, DONE); - pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_LIBRARY_DOOR), true); - } - } - - void EnterCombat(Unit * /*who*/) - { - DoScriptText(RAND(SAY_AGGRO1,SAY_AGGRO2,SAY_AGGRO3), me); - - if (pInstance) - { - pInstance->SetData(TYPE_ARAN, IN_PROGRESS); - pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_LIBRARY_DOOR), false); - } - } - - void FlameWreathEffect() - { - std::vector targets; - std::list t_list = me->getThreatManager().getThreatList(); - - if (!t_list.size()) - return; - - //store the threat list in a different container - for (std::list::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) - { - Unit *pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid()); - //only on alive players - if (pTarget && pTarget->isAlive() && pTarget->GetTypeId() == TYPEID_PLAYER) - targets.push_back(pTarget); - } - - //cut down to size if we have more than 3 targets - while (targets.size() > 3) - targets.erase(targets.begin()+rand()%targets.size()); - - uint32 i = 0; - for (std::vector::const_iterator itr = targets.begin(); itr!= targets.end(); ++itr) - { - if (*itr) - { - FlameWreathTarget[i] = (*itr)->GetGUID(); - FWTargPosX[i] = (*itr)->GetPositionX(); - FWTargPosY[i] = (*itr)->GetPositionY(); - DoCast((*itr), SPELL_FLAME_WREATH, true); - ++i; - } - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (CloseDoorTimer) - { - if (CloseDoorTimer <= diff) - { - if (pInstance) - { - pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_LIBRARY_DOOR), false); - CloseDoorTimer = 0; - } - } else CloseDoorTimer -= diff; - } - - //Cooldowns for casts - if (ArcaneCooldown) - { - if (ArcaneCooldown >= diff) - ArcaneCooldown -= diff; - else ArcaneCooldown = 0; - } - - if (FireCooldown) - { - if (FireCooldown >= diff) - FireCooldown -= diff; - else FireCooldown = 0; - } - - if (FrostCooldown) - { - if (FrostCooldown >= diff) - FrostCooldown -= diff; - else FrostCooldown = 0; - } - - if (!Drinking && me->GetMaxPower(POWER_MANA) && (me->GetPower(POWER_MANA)*100 / me->GetMaxPower(POWER_MANA)) < 20) - { - Drinking = true; - me->InterruptNonMeleeSpells(false); - - DoScriptText(SAY_DRINK, me); - - if (!DrinkInturrupted) - { - DoCast(me, SPELL_MASS_POLY, true); - DoCast(me, SPELL_CONJURE, false); - DoCast(me, SPELL_DRINK, false); - me->SetStandState(UNIT_STAND_STATE_SIT); - DrinkInturruptTimer = 10000; - } - } - - //Drink Inturrupt - if (Drinking && DrinkInturrupted) - { - Drinking = false; - me->RemoveAurasDueToSpell(SPELL_DRINK); - me->SetStandState(UNIT_STAND_STATE_STAND); - me->SetPower(POWER_MANA, me->GetMaxPower(POWER_MANA)-32000); - DoCast(me, SPELL_POTION, false); - } - - //Drink Inturrupt Timer - if (Drinking && !DrinkInturrupted) - if (DrinkInturruptTimer >= diff) - DrinkInturruptTimer -= diff; - else - { - me->SetStandState(UNIT_STAND_STATE_STAND); - DoCast(me, SPELL_POTION, true); - DoCast(me, SPELL_AOE_PYROBLAST, false); - DrinkInturrupted = true; - Drinking = false; - } - - //Don't execute any more code if we are drinking - if (Drinking) - return; - - //Normal casts - if (NormalCastTimer <= diff) - { - if (!me->IsNonMeleeSpellCasted(false)) - { - Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); - if (!pTarget) - return; - - uint32 Spells[3]; - uint8 AvailableSpells = 0; - - //Check for what spells are not on cooldown - if (!ArcaneCooldown) - { - Spells[AvailableSpells] = SPELL_ARCMISSLE; - ++AvailableSpells; - } - if (!FireCooldown) - { - Spells[AvailableSpells] = SPELL_FIREBALL; - ++AvailableSpells; - } - if (!FrostCooldown) - { - Spells[AvailableSpells] = SPELL_FROSTBOLT; - ++AvailableSpells; - } - - //If no available spells wait 1 second and try again - if (AvailableSpells) - { - CurrentNormalSpell = Spells[rand() % AvailableSpells]; - DoCast(pTarget, CurrentNormalSpell); - } - } - NormalCastTimer = 1000; - } else NormalCastTimer -= diff; - - if (SecondarySpellTimer <= diff) - { - switch (urand(0,1)) - { - case 0: - DoCast(me, SPELL_AOE_CS); - break; - case 1: - if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) - DoCast(pTarget, SPELL_CHAINSOFICE); - break; - } - SecondarySpellTimer = urand(5000,20000); - } else SecondarySpellTimer -= diff; - - if (SuperCastTimer <= diff) - { - uint8 Available[2]; - - switch (LastSuperSpell) - { - case SUPER_AE: - Available[0] = SUPER_FLAME; - Available[1] = SUPER_BLIZZARD; - break; - case SUPER_FLAME: - Available[0] = SUPER_AE; - Available[1] = SUPER_BLIZZARD; - break; - case SUPER_BLIZZARD: - Available[0] = SUPER_FLAME; - Available[1] = SUPER_AE; - break; - } - - LastSuperSpell = Available[urand(0,1)]; - - switch (LastSuperSpell) - { - case SUPER_AE: - DoScriptText(RAND(SAY_EXPLOSION1,SAY_EXPLOSION2), me); - - DoCast(me, SPELL_BLINK_CENTER, true); - DoCast(me, SPELL_PLAYERPULL, true); - DoCast(me, SPELL_MASSSLOW, true); - DoCast(me, SPELL_AEXPLOSION, false); - break; - - case SUPER_FLAME: - DoScriptText(RAND(SAY_FLAMEWREATH1,SAY_FLAMEWREATH2), me); - - FlameWreathTimer = 20000; - FlameWreathCheckTime = 500; - - FlameWreathTarget[0] = 0; - FlameWreathTarget[1] = 0; - FlameWreathTarget[2] = 0; - - FlameWreathEffect(); - break; - - case SUPER_BLIZZARD: - DoScriptText(RAND(SAY_BLIZZARD1,SAY_BLIZZARD2), me); - - if (Creature* pSpawn = me->SummonCreature(CREATURE_ARAN_BLIZZARD, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 25000)) - { - pSpawn->setFaction(me->getFaction()); - pSpawn->CastSpell(pSpawn, SPELL_CIRCULAR_BLIZZARD, false); - } - break; - } - - SuperCastTimer = urand(35000,40000); - } else SuperCastTimer -= diff; - - if (!ElementalsSpawned && me->GetHealth()*100 / me->GetMaxHealth() < 40) - { - ElementalsSpawned = true; - - for (uint32 i = 0; i < 4; ++i) - { - if (Creature* pUnit = me->SummonCreature(CREATURE_WATER_ELEMENTAL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 90000)) - { - pUnit->Attack(me->getVictim(), true); - pUnit->setFaction(me->getFaction()); - } - } - - DoScriptText(SAY_ELEMENTALS, me); - } - - if (BerserkTimer <= diff) - { - for (uint32 i = 0; i < 5; ++i) - { - if (Creature* pUnit = me->SummonCreature(CREATURE_SHADOW_OF_ARAN, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000)) - { - pUnit->Attack(me->getVictim(), true); - pUnit->setFaction(me->getFaction()); - } - } - - DoScriptText(SAY_TIMEOVER, me); - - BerserkTimer = 60000; - } else BerserkTimer -= diff; - - //Flame Wreath check - if (FlameWreathTimer) - { - if (FlameWreathTimer >= diff) - FlameWreathTimer -= diff; - else FlameWreathTimer = 0; - - if (FlameWreathCheckTime <= diff) - { - for (uint8 i = 0; i < 3; ++i) - { - if (!FlameWreathTarget[i]) - continue; - - Unit* pUnit = Unit::GetUnit(*me, FlameWreathTarget[i]); - if (pUnit && !pUnit->IsWithinDist2d(FWTargPosX[i], FWTargPosY[i], 3)) - { - pUnit->CastSpell(pUnit, 20476, true, 0, 0, me->GetGUID()); - pUnit->CastSpell(pUnit, 11027, true); - FlameWreathTarget[i] = 0; - } - } - FlameWreathCheckTime = 500; - } else FlameWreathCheckTime -= diff; - } - - if (ArcaneCooldown && FireCooldown && FrostCooldown) - DoMeleeAttackIfReady(); - } - - void DamageTaken(Unit* /*pAttacker*/, uint32 &damage) - { - if (!DrinkInturrupted && Drinking && damage) - DrinkInturrupted = true; - } - - void SpellHit(Unit* /*pAttacker*/, const SpellEntry* Spell) - { - //We only care about inturrupt effects and only if they are durring a spell currently being casted - if ((Spell->Effect[0] != SPELL_EFFECT_INTERRUPT_CAST && - Spell->Effect[1] != SPELL_EFFECT_INTERRUPT_CAST && - Spell->Effect[2] != SPELL_EFFECT_INTERRUPT_CAST) || !me->IsNonMeleeSpellCasted(false)) - return; - - //Inturrupt effect - me->InterruptNonMeleeSpells(false); - - //Normally we would set the cooldown equal to the spell duration - //but we do not have access to the DurationStore - - switch (CurrentNormalSpell) - { - case SPELL_ARCMISSLE: ArcaneCooldown = 5000; break; - case SPELL_FIREBALL: FireCooldown = 5000; break; - case SPELL_FROSTBOLT: FrostCooldown = 5000; break; - } - } -}; - -struct water_elementalAI : public ScriptedAI -{ - water_elementalAI(Creature *c) : ScriptedAI(c) {} - - uint32 CastTimer; - - void Reset() - { - CastTimer = 2000 + (rand()%3000); - } - - void EnterCombat(Unit* /*who*/) {} - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (CastTimer <= diff) - { - DoCast(me->getVictim(), SPELL_WATERBOLT); - CastTimer = urand(2000,5000); - } else CastTimer -= diff; - } -}; - -CreatureAI* GetAI_boss_aran(Creature* pCreature) -{ - return new boss_aranAI (pCreature); -} - -CreatureAI* GetAI_water_elemental(Creature* pCreature) -{ - return new water_elementalAI (pCreature); -} - -// CONVERT TO ACID -CreatureAI* GetAI_shadow_of_aran(Creature* pCreature) -{ - outstring_log("TSCR: Convert simpleAI script for Creature Entry %u to ACID", pCreature->GetEntry()); - SimpleAI* ai = new SimpleAI (pCreature); - - ai->Spell[0].Enabled = true; - ai->Spell[0].Spell_Id = SPELL_SHADOW_PYRO; - ai->Spell[0].Cooldown = 5000; - ai->Spell[0].First_Cast = 1000; - ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_TARGET; - - ai->EnterEvadeMode(); - - return ai; -} - -void AddSC_boss_shade_of_aran() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_shade_of_aran"; - newscript->GetAI = &GetAI_boss_aran; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_shadow_of_aran"; - newscript->GetAI = &GetAI_shadow_of_aran; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_aran_elemental"; - newscript->GetAI = &GetAI_water_elemental; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/karazhan/boss_terestian_illhoof.cpp b/src/server/scripts/EasternKingdoms/karazhan/boss_terestian_illhoof.cpp deleted file mode 100644 index 5305cc8d354..00000000000 --- a/src/server/scripts/EasternKingdoms/karazhan/boss_terestian_illhoof.cpp +++ /dev/null @@ -1,417 +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_Terestian_Illhoof -SD%Complete: 95 -SDComment: Complete! Needs adjustments to use spell though. -SDCategory: Karazhan -EndScriptData */ - -#include "ScriptedPch.h" -#include "karazhan.h" - -#define SAY_SLAY1 -1532065 -#define SAY_SLAY2 -1532066 -#define SAY_DEATH -1532067 -#define SAY_AGGRO -1532068 -#define SAY_SACRIFICE1 -1532069 -#define SAY_SACRIFICE2 -1532070 -#define SAY_SUMMON1 -1532071 -#define SAY_SUMMON2 -1532072 - -#define SPELL_SUMMON_DEMONCHAINS 30120 // Summons demonic chains that maintain the ritual of sacrifice. -#define SPELL_DEMON_CHAINS 30206 // Instant - Visual Effect -#define SPELL_ENRAGE 23537 // Increases the caster's attack speed by 50% and the Physical damage it deals by 219 to 281 for 10 min. -#define SPELL_SHADOW_BOLT 30055 // Hurls a bolt of dark magic at an enemy, inflicting Shadow damage. -#define SPELL_SACRIFICE 30115 // Teleports and adds the debuff -#define SPELL_BERSERK 32965 // Increases attack speed by 75%. Periodically casts Shadow Bolt Volley. -#define SPELL_SUMMON_FIENDISIMP 30184 // Summons a Fiendish Imp. -#define SPELL_SUMMON_IMP 30066 // Summons Kil'rek - -#define SPELL_FIENDISH_PORTAL 30171 // Opens portal and summons Fiendish Portal, 2 sec cast -#define SPELL_FIENDISH_PORTAL_1 30179 // Opens portal and summons Fiendish Portal, instant cast - -#define SPELL_FIREBOLT 30050 // Blasts a target for 150 Fire damage. -#define SPELL_BROKEN_PACT 30065 // All damage taken increased by 25%. -#define SPELL_AMPLIFY_FLAMES 30053 // Increases the Fire damage taken by an enemy by 500 for 25 sec. - -#define CREATURE_DEMONCHAINS 17248 -#define CREATURE_FIENDISHIMP 17267 -#define CREATURE_PORTAL 17265 -#define CREATURE_KILREK 17229 - -struct mob_kilrekAI : public ScriptedAI -{ - mob_kilrekAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint64 TerestianGUID; - - uint32 AmplifyTimer; - - void Reset() - { - TerestianGUID = 0; - AmplifyTimer = 2000; - } - - void EnterCombat(Unit * /*who*/) - { - if (!pInstance) - { - ERROR_INST_DATA(me); - return; - } - } - - void JustDied(Unit* /*Killer*/) - { - if (pInstance) - { - uint64 TerestianGUID = pInstance->GetData64(DATA_TERESTIAN); - if (TerestianGUID) - { - Unit* Terestian = Unit::GetUnit((*me), TerestianGUID); - if (Terestian && Terestian->isAlive()) - DoCast(Terestian, SPELL_BROKEN_PACT, true); - } - } else ERROR_INST_DATA(me); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - if (AmplifyTimer <= diff) - { - me->InterruptNonMeleeSpells(false); - DoCast(me->getVictim(), SPELL_AMPLIFY_FLAMES); - - AmplifyTimer = urand(10000,20000); - } else AmplifyTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -struct mob_demon_chainAI : public ScriptedAI -{ - mob_demon_chainAI(Creature *c) : ScriptedAI(c) {} - - uint64 SacrificeGUID; - - void Reset() - { - SacrificeGUID = 0; - } - - void EnterCombat(Unit* /*who*/) {} - void AttackStart(Unit* /*who*/) {} - void MoveInLineOfSight(Unit* /*who*/) {} - - void JustDied(Unit * /*killer*/) - { - if (SacrificeGUID) - { - Unit* Sacrifice = Unit::GetUnit((*me),SacrificeGUID); - if (Sacrifice) - Sacrifice->RemoveAurasDueToSpell(SPELL_SACRIFICE); - } - } -}; - -struct mob_fiendish_portalAI : public PassiveAI -{ - mob_fiendish_portalAI(Creature *c) : PassiveAI(c),summons(me){} - - SummonList summons; - - void Reset() - { - summons.DespawnAll(); - } - - void JustSummoned(Creature* summon) - { - summons.Summon(summon); - DoZoneInCombat(summon); - } - - void DespawnAllImp() - { - summons.DespawnAll(); - } -}; - -struct boss_terestianAI : public ScriptedAI -{ - boss_terestianAI(Creature *c) : ScriptedAI(c) - { - for (uint8 i = 0; i < 2; ++i) - PortalGUID[i] = 0; - pInstance = c->GetInstanceData(); - } - - ScriptedInstance *pInstance; - - uint64 PortalGUID[2]; - uint8 PortalsCount; - - uint32 SacrificeTimer; - uint32 ShadowboltTimer; - uint32 SummonTimer; - uint32 BerserkTimer; - - bool SummonedPortals; - bool Berserk; - - void Reset() - { - for (uint8 i = 0; i < 2; ++i) - { - if (PortalGUID[i]) - { - if (Creature* pPortal = Unit::GetCreature(*me, PortalGUID[i])) - { - CAST_AI(mob_fiendish_portalAI, pPortal->AI())->DespawnAllImp(); - pPortal->ForcedDespawn(); - } - - PortalGUID[i] = 0; - } - } - - PortalsCount = 0; - SacrificeTimer = 30000; - ShadowboltTimer = 5000; - SummonTimer = 10000; - BerserkTimer = 600000; - - SummonedPortals = false; - Berserk = false; - - if (pInstance) - pInstance->SetData(TYPE_TERESTIAN, NOT_STARTED); - - me->RemoveAurasDueToSpell(SPELL_BROKEN_PACT); - - if (Minion* Kilrek = me->GetFirstMinion()) - { - if (!Kilrek->isAlive()) - { - Kilrek->UnSummon(); - DoCast(me, SPELL_SUMMON_IMP, true); - } - } - else DoCast(me, SPELL_SUMMON_IMP, true); - } - - void EnterCombat(Unit* /*who*/) - { - DoScriptText(SAY_AGGRO, me); - } - - void JustSummoned(Creature* pSummoned) - { - if (pSummoned->GetEntry() == CREATURE_PORTAL) - { - PortalGUID[PortalsCount] = pSummoned->GetGUID(); - ++PortalsCount; - - if (pSummoned->GetUInt32Value(UNIT_CREATED_BY_SPELL) == SPELL_FIENDISH_PORTAL_1) - { - DoScriptText(RAND(SAY_SUMMON1,SAY_SUMMON2), me); - SummonedPortals = true; - } - } - } - - void KilledUnit(Unit * /*victim*/) - { - DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me); - } - - void JustDied(Unit * /*killer*/) - { - for (uint8 i = 0; i < 2; ++i) - { - if (PortalGUID[i]) - { - if (Creature* pPortal = Unit::GetCreature((*me), PortalGUID[i])) - pPortal->ForcedDespawn(); - - PortalGUID[i] = 0; - } - } - - DoScriptText(SAY_DEATH, me); - - if (pInstance) - pInstance->SetData(TYPE_TERESTIAN, DONE); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (SacrificeTimer <= diff) - { - Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true); - if (pTarget && pTarget->isAlive()) - { - DoCast(pTarget, SPELL_SACRIFICE, true); - DoCast(pTarget, SPELL_SUMMON_DEMONCHAINS, true); - - if (Creature* Chains = me->FindNearestCreature(CREATURE_DEMONCHAINS, 5000)) - { - CAST_AI(mob_demon_chainAI, Chains->AI())->SacrificeGUID = pTarget->GetGUID(); - Chains->CastSpell(Chains, SPELL_DEMON_CHAINS, true); - DoScriptText(RAND(SAY_SACRIFICE1,SAY_SACRIFICE2), me); - SacrificeTimer = 30000; - } - } - } else SacrificeTimer -= diff; - - if (ShadowboltTimer <= diff) - { - DoCast(SelectUnit(SELECT_TARGET_TOPAGGRO, 0), SPELL_SHADOW_BOLT); - ShadowboltTimer = 10000; - } else ShadowboltTimer -= diff; - - if (SummonTimer <= diff) - { - if (!PortalGUID[0]) - DoCast(me->getVictim(), SPELL_FIENDISH_PORTAL, false); - - if (!PortalGUID[1]) - DoCast(me->getVictim(), SPELL_FIENDISH_PORTAL_1, false); - - if (PortalGUID[0] && PortalGUID[1]) - { - if (Creature* pPortal = Unit::GetCreature(*me, PortalGUID[urand(0,1)])) - pPortal->CastSpell(me->getVictim(), SPELL_SUMMON_FIENDISIMP, false); - SummonTimer = 5000; - } - } else SummonTimer -= diff; - - if (!Berserk) - { - if (BerserkTimer <= diff) - { - DoCast(me, SPELL_BERSERK); - Berserk = true; - } else BerserkTimer -= diff; - } - - DoMeleeAttackIfReady(); - } -}; - -#define SPELL_FIREBOLT 30050 // Blasts a target for 181-209 Fire damage. - -struct mob_fiendish_impAI : public ScriptedAI -{ - mob_fiendish_impAI(Creature *c) : ScriptedAI(c) {} - - uint32 FireboltTimer; - - void Reset() - { - FireboltTimer = 2000; - - me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true); - } - - void EnterCombat(Unit * /*who*/) {} - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - if (FireboltTimer <= diff) - { - DoCast(me->getVictim(), SPELL_FIREBOLT); - FireboltTimer = 2200; - } else FireboltTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_kilrek(Creature* pCreature) -{ - return new mob_kilrekAI (pCreature); -} - -CreatureAI* GetAI_mob_fiendish_imp(Creature* pCreature) -{ - return new mob_fiendish_impAI (pCreature); -} - -CreatureAI* GetAI_mob_fiendish_portal(Creature* pCreature) -{ - return new mob_fiendish_portalAI (pCreature); -} - -CreatureAI* GetAI_boss_terestian_illhoof(Creature* pCreature) -{ - return new boss_terestianAI (pCreature); -} - -CreatureAI* GetAI_mob_demon_chain(Creature* pCreature) -{ - return new mob_demon_chainAI(pCreature); -} - -void AddSC_boss_terestian_illhoof() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_terestian_illhoof"; - newscript->GetAI = &GetAI_boss_terestian_illhoof; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_fiendish_imp"; - newscript->GetAI = &GetAI_mob_fiendish_imp; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name= "mob_fiendish_portal"; - newscript->GetAI = &GetAI_mob_fiendish_portal; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_kilrek"; - newscript->GetAI = &GetAI_mob_kilrek; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_demon_chain"; - newscript->GetAI = &GetAI_mob_demon_chain; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/karazhan/bosses_opera.cpp b/src/server/scripts/EasternKingdoms/karazhan/bosses_opera.cpp deleted file mode 100644 index ae6de9c1add..00000000000 --- a/src/server/scripts/EasternKingdoms/karazhan/bosses_opera.cpp +++ /dev/null @@ -1,1494 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 .sourceforge.net/> - * 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: Bosses_Opera -SD%Complete: 90 -SDComment: Oz, Hood, and RAJ event implemented. RAJ event requires more testing. -SDCategory: Karazhan -EndScriptData */ - -#include "ScriptedPch.h" -#include "karazhan.h" - -/***********************************/ -/*** OPERA WIZARD OF OZ EVENT *****/ -/*********************************/ - -#define SAY_DOROTHEE_DEATH -1532025 -#define SAY_DOROTHEE_SUMMON -1532026 -#define SAY_DOROTHEE_TITO_DEATH -1532027 -#define SAY_DOROTHEE_AGGRO -1532028 - -#define SAY_ROAR_AGGRO -1532029 -#define SAY_ROAR_DEATH -1532030 -#define SAY_ROAR_SLAY -1532031 - -#define SAY_STRAWMAN_AGGRO -1532032 -#define SAY_STRAWMAN_DEATH -1532033 -#define SAY_STRAWMAN_SLAY -1532034 - -#define SAY_TINHEAD_AGGRO -1532035 -#define SAY_TINHEAD_DEATH -1532036 -#define SAY_TINHEAD_SLAY -1532037 -#define EMOTE_RUST -1532038 - -#define SAY_CRONE_AGGRO -1532039 -#define SAY_CRONE_AGGRO2 -1532040 -#define SAY_CRONE_DEATH -1532041 -#define SAY_CRONE_SLAY -1532042 - -/**** Spells ****/ -// Dorothee -#define SPELL_WATERBOLT 31012 -#define SPELL_SCREAM 31013 -#define SPELL_SUMMONTITO 31014 - -// Tito -#define SPELL_YIPPING 31015 - -// Strawman -#define SPELL_BRAIN_BASH 31046 -#define SPELL_BRAIN_WIPE 31069 -#define SPELL_BURNING_STRAW 31075 - -// Tinhead -#define SPELL_CLEAVE 31043 -#define SPELL_RUST 31086 - -// Roar -#define SPELL_MANGLE 31041 -#define SPELL_SHRED 31042 -#define SPELL_FRIGHTENED_SCREAM 31013 - -// Crone -#define SPELL_CHAIN_LIGHTNING 32337 - -// Cyclone -#define SPELL_KNOCKBACK 32334 -#define SPELL_CYCLONE_VISUAL 32332 - -/** Creature Entries **/ -#define CREATURE_TITO 17548 -#define CREATURE_CYCLONE 18412 -#define CREATURE_CRONE 18168 - -void SummonCroneIfReady(ScriptedInstance* pInstance, Creature* pCreature) -{ - pInstance->SetData(DATA_OPERA_OZ_DEATHCOUNT, SPECIAL); // Increment DeathCount - - if (pInstance->GetData(DATA_OPERA_OZ_DEATHCOUNT) == 4) - { - if (Creature* pCrone = pCreature->SummonCreature(CREATURE_CRONE, -10891.96, -1755.95, pCreature->GetPositionZ(), 4.64, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, HOUR*2*IN_MILISECONDS)) - { - if (pCreature->getVictim()) - pCrone->AI()->AttackStart(pCreature->getVictim()); - } - } -}; - -struct boss_dorotheeAI : public ScriptedAI -{ - boss_dorotheeAI(Creature* c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint32 AggroTimer; - - uint32 WaterBoltTimer; - uint32 FearTimer; - uint32 SummonTitoTimer; - - bool SummonedTito; - bool TitoDied; - - void Reset() - { - AggroTimer = 500; - - WaterBoltTimer = 5000; - FearTimer = 15000; - SummonTitoTimer = 47500; - - SummonedTito = false; - TitoDied = false; - } - - void EnterCombat(Unit* /*who*/) - { - DoScriptText(SAY_DOROTHEE_AGGRO, me); - } - - void JustReachedHome() - { - me->ForcedDespawn(); - } - - void SummonTito(); // See below - - void JustDied(Unit* /*killer*/) - { - DoScriptText(SAY_DOROTHEE_DEATH, me); - - if (pInstance) - SummonCroneIfReady(pInstance, me); - } - - void AttackStart(Unit* who) - { - if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - return; - - ScriptedAI::AttackStart(who); - } - - void MoveInLineOfSight(Unit* who) - { - if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - return; - - ScriptedAI::MoveInLineOfSight(who); - } - - void UpdateAI(const uint32 diff) - { - if (AggroTimer) - { - if (AggroTimer <= diff) - { - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - AggroTimer = 0; - } else AggroTimer -= diff; - } - - if (!UpdateVictim()) - return; - - if (WaterBoltTimer <= diff) - { - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_WATERBOLT); - WaterBoltTimer = TitoDied ? 1500 : 5000; - } else WaterBoltTimer -= diff; - - if (FearTimer <= diff) - { - DoCast(me->getVictim(), SPELL_SCREAM); - FearTimer = 30000; - } else FearTimer -= diff; - - if (!SummonedTito) - { - if (SummonTitoTimer <= diff) - SummonTito(); - else SummonTitoTimer -= diff; - } - - DoMeleeAttackIfReady(); - } -}; - -struct mob_titoAI : public ScriptedAI -{ - mob_titoAI(Creature* c) : ScriptedAI(c) {} - - uint64 DorotheeGUID; - uint32 YipTimer; - - void Reset() - { - DorotheeGUID = 0; - YipTimer = 10000; - } - - void EnterCombat(Unit* /*who*/) {} - - void JustDied(Unit* /*killer*/) - { - if (DorotheeGUID) - { - Creature* Dorothee = (Unit::GetCreature((*me), DorotheeGUID)); - if (Dorothee && Dorothee->isAlive()) - { - CAST_AI(boss_dorotheeAI, Dorothee->AI())->TitoDied = true; - DoScriptText(SAY_DOROTHEE_TITO_DEATH, Dorothee); - } - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (YipTimer <= diff) - { - DoCast(me->getVictim(), SPELL_YIPPING); - YipTimer = 10000; - } else YipTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -void boss_dorotheeAI::SummonTito() -{ - if (Creature* pTito = me->SummonCreature(CREATURE_TITO, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000)) - { - DoScriptText(SAY_DOROTHEE_SUMMON, me); - CAST_AI(mob_titoAI, pTito->AI())->DorotheeGUID = me->GetGUID(); - pTito->AI()->AttackStart(me->getVictim()); - SummonedTito = true; - TitoDied = false; - } -} - -struct boss_strawmanAI : public ScriptedAI -{ - boss_strawmanAI(Creature* c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint32 AggroTimer; - uint32 BrainBashTimer; - uint32 BrainWipeTimer; - - void Reset() - { - AggroTimer = 13000; - BrainBashTimer = 5000; - BrainWipeTimer = 7000; - } - - void AttackStart(Unit* who) - { - if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - return; - - ScriptedAI::AttackStart(who); - } - - void MoveInLineOfSight(Unit* who) - { - if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - return; - - ScriptedAI::MoveInLineOfSight(who); - } - - void EnterCombat(Unit* /*who*/) - { - DoScriptText(SAY_STRAWMAN_AGGRO, me); - } - - void JustReachedHome() - { - me->ForcedDespawn(); - } - - void SpellHit(Unit* /*caster*/, const SpellEntry *Spell) - { - if ((Spell->SchoolMask == SPELL_SCHOOL_MASK_FIRE) && (!(rand()%10))) - { - /* - if (not direct damage(aoe,dot)) - return; - */ - - DoCast(me, SPELL_BURNING_STRAW, true); - } - } - - void JustDied(Unit* /*killer*/) - { - DoScriptText(SAY_STRAWMAN_DEATH, me); - - if (pInstance) - SummonCroneIfReady(pInstance, me); - } - - void KilledUnit(Unit* /*victim*/) - { - DoScriptText(SAY_STRAWMAN_SLAY, me); - } - - void UpdateAI(const uint32 diff) - { - if (AggroTimer) - { - if (AggroTimer <= diff) - { - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - AggroTimer = 0; - } else AggroTimer -= diff; - } - - if (!UpdateVictim()) - return; - - if (BrainBashTimer <= diff) - { - DoCast(me->getVictim(), SPELL_BRAIN_BASH); - BrainBashTimer = 15000; - } else BrainBashTimer -= diff; - - if (BrainWipeTimer <= diff) - { - if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) - DoCast(pTarget, SPELL_BRAIN_WIPE); - BrainWipeTimer = 20000; - } else BrainWipeTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -struct boss_tinheadAI : public ScriptedAI -{ - boss_tinheadAI(Creature* c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint32 AggroTimer; - uint32 CleaveTimer; - uint32 RustTimer; - - uint8 RustCount; - - void Reset() - { - AggroTimer = 15000; - CleaveTimer = 5000; - RustTimer = 30000; - - RustCount = 0; - } - - void EnterCombat(Unit* /*who*/) - { - DoScriptText(SAY_TINHEAD_AGGRO, me); - } - - void JustReachedHome() - { - me->ForcedDespawn(); - } - - void AttackStart(Unit* who) - { - if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - return; - - ScriptedAI::AttackStart(who); - } - - void MoveInLineOfSight(Unit* who) - { - if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - return; - - ScriptedAI::MoveInLineOfSight(who); - } - - void JustDied(Unit* /*killer*/) - { - DoScriptText(SAY_TINHEAD_DEATH, me); - - if (pInstance) - SummonCroneIfReady(pInstance, me); - } - - void KilledUnit(Unit* /*victim*/) - { - DoScriptText(SAY_TINHEAD_SLAY, me); - } - - void UpdateAI(const uint32 diff) - { - if (AggroTimer) - { - if (AggroTimer <= diff) - { - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - AggroTimer = 0; - } else AggroTimer -= diff; - } - - if (!UpdateVictim()) - return; - - if (CleaveTimer <= diff) - { - DoCast(me->getVictim(), SPELL_CLEAVE); - CleaveTimer = 5000; - } else CleaveTimer -= diff; - - if (RustCount < 8) - { - if (RustTimer <= diff) - { - ++RustCount; - DoScriptText(EMOTE_RUST, me); - DoCast(me, SPELL_RUST); - RustTimer = 6000; - } else RustTimer -= diff; - } - - DoMeleeAttackIfReady(); - } -}; - -struct boss_roarAI : public ScriptedAI -{ - boss_roarAI(Creature* c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint32 AggroTimer; - uint32 MangleTimer; - uint32 ShredTimer; - uint32 ScreamTimer; - - void Reset() - { - AggroTimer = 20000; - MangleTimer = 5000; - ShredTimer = 10000; - ScreamTimer = 15000; - } - - void MoveInLineOfSight(Unit* who) - { - if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - return; - - ScriptedAI::MoveInLineOfSight(who); - } - - void AttackStart(Unit* who) - { - if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - return; - - ScriptedAI::AttackStart(who); - } - - void EnterCombat(Unit* /*who*/) - { - DoScriptText(SAY_ROAR_AGGRO, me); - } - - void JustReachedHome() - { - me->ForcedDespawn(); - } - - void JustDied(Unit* /*killer*/) - { - DoScriptText(SAY_ROAR_DEATH, me); - - if (pInstance) - SummonCroneIfReady(pInstance, me); - } - - void KilledUnit(Unit* /*victim*/) - { - DoScriptText(SAY_ROAR_SLAY, me); - } - - void UpdateAI(const uint32 diff) - { - if (AggroTimer) - { - if (AggroTimer <= diff) - { - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - AggroTimer = 0; - } else AggroTimer -= diff; - } - - if (!UpdateVictim()) - return; - - if (MangleTimer <= diff) - { - DoCast(me->getVictim(), SPELL_MANGLE); - MangleTimer = urand(5000,8000); - } else MangleTimer -= diff; - - if (ShredTimer <= diff) - { - DoCast(me->getVictim(), SPELL_SHRED); - ShredTimer = urand(10000,15000); - } else ShredTimer -= diff; - - if (ScreamTimer <= diff) - { - DoCast(me->getVictim(), SPELL_FRIGHTENED_SCREAM); - ScreamTimer = urand(20000,30000); - } else ScreamTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -struct boss_croneAI : public ScriptedAI -{ - boss_croneAI(Creature* c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint32 CycloneTimer; - uint32 ChainLightningTimer; - - void Reset() - { - CycloneTimer = 30000; - ChainLightningTimer = 10000; - } - - void JustReachedHome() - { - me->ForcedDespawn(); - } - - void EnterCombat(Unit* /*who*/) - { - DoScriptText(RAND(SAY_CRONE_AGGRO,SAY_CRONE_AGGRO2), me); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); - } - - void JustDied(Unit* /*killer*/) - { - DoScriptText(SAY_CRONE_DEATH, me); - - if (pInstance) - { - pInstance->SetData(TYPE_OPERA, DONE); - pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_STAGEDOORLEFT), true); - pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_STAGEDOORRIGHT), true); - - if (GameObject* pSideEntrance = pInstance->instance->GetGameObject(pInstance->GetData64(DATA_GO_SIDE_ENTRANCE_DOOR))) - pSideEntrance->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED); - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - - if (CycloneTimer <= diff) - { - if (Creature* Cyclone = DoSpawnCreature(CREATURE_CYCLONE, urand(0,9), urand(0,9), 0, 0, TEMPSUMMON_TIMED_DESPAWN, 15000)) - Cyclone->CastSpell(Cyclone, SPELL_CYCLONE_VISUAL, true); - CycloneTimer = 30000; - } else CycloneTimer -= diff; - - if (ChainLightningTimer <= diff) - { - DoCast(me->getVictim(), SPELL_CHAIN_LIGHTNING); - ChainLightningTimer = 15000; - } else ChainLightningTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -struct mob_cycloneAI : public ScriptedAI -{ - mob_cycloneAI(Creature* c) : ScriptedAI(c) {} - - uint32 MoveTimer; - - void Reset() - { - MoveTimer = 1000; - } - - void EnterCombat(Unit* /*who*/) {} - - void MoveInLineOfSight(Unit* /*who*/) - { - } - - void UpdateAI(const uint32 diff) - { - if (!me->HasAura(SPELL_KNOCKBACK)) - DoCast(me, SPELL_KNOCKBACK, true); - - if (MoveTimer <= diff) - { - Position pos; - me->GetRandomNearPosition(pos, 10); - me->GetMotionMaster()->MovePoint(0, pos); - MoveTimer = urand(5000,8000); - } else MoveTimer -= diff; - } -}; - -CreatureAI* GetAI_boss_dorothee(Creature* pCreature) -{ - return new boss_dorotheeAI(pCreature); -} - -CreatureAI* GetAI_boss_strawman(Creature* pCreature) -{ - return new boss_strawmanAI(pCreature); -} - -CreatureAI* GetAI_boss_tinhead(Creature* pCreature) -{ - return new boss_tinheadAI(pCreature); -} - -CreatureAI* GetAI_boss_roar(Creature* pCreature) -{ - return new boss_roarAI(pCreature); -} - -CreatureAI* GetAI_boss_crone(Creature* pCreature) -{ - return new boss_croneAI(pCreature); -} - -CreatureAI* GetAI_mob_tito(Creature* pCreature) -{ - return new mob_titoAI(pCreature); -} - -CreatureAI* GetAI_mob_cyclone(Creature* pCreature) -{ - return new mob_cycloneAI(pCreature); -} - -/**************************************/ -/**** Opera Red Riding Hood Event ****/ -/************************************/ - -/**** Yells for the Wolf ****/ -#define SAY_WOLF_AGGRO -1532043 -#define SAY_WOLF_SLAY -1532044 -#define SAY_WOLF_HOOD -1532045 -#define SOUND_WOLF_DEATH 9275 //Only sound on death, no text. - -/**** Spells For The Wolf ****/ -#define SPELL_LITTLE_RED_RIDING_HOOD 30768 -#define SPELL_TERRIFYING_HOWL 30752 -#define SPELL_WIDE_SWIPE 30761 - -#define GOSSIP_GRANDMA "What phat lewtz you have grandmother?" - -/**** The Wolf's Entry ****/ -#define CREATURE_BIG_BAD_WOLF 17521 - -bool GossipHello_npc_grandmother(Player* pPlayer, Creature* pCreature) -{ - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_GRANDMA, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - pPlayer->SEND_GOSSIP_MENU(8990, pCreature->GetGUID()); - - return true; -} - -bool GossipSelect_npc_grandmother(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_INFO_DEF) - { - if (Creature* pBigBadWolf = pCreature->SummonCreature(CREATURE_BIG_BAD_WOLF, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, HOUR*2*IN_MILISECONDS)) - pBigBadWolf->AI()->AttackStart(pPlayer); - - pCreature->ForcedDespawn(); - } - - return true; -} - -struct boss_bigbadwolfAI : public ScriptedAI -{ - boss_bigbadwolfAI(Creature* c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint32 ChaseTimer; - uint32 FearTimer; - uint32 SwipeTimer; - - uint64 HoodGUID; - float TempThreat; - - bool IsChasing; - - void Reset() - { - ChaseTimer = 30000; - FearTimer = 25000 + rand()%10000; - SwipeTimer = 5000; - - HoodGUID = 0; - TempThreat = 0; - - IsChasing = false; - } - - void EnterCombat(Unit* /*who*/) - { - DoScriptText(SAY_WOLF_AGGRO, me); - } - - void JustReachedHome() - { - me->ForcedDespawn(); - } - - void JustDied(Unit* /*killer*/) - { - DoPlaySoundToSet(me, SOUND_WOLF_DEATH); - - if (pInstance) - { - pInstance->SetData(TYPE_OPERA, DONE); - pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_STAGEDOORLEFT), true); - pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_STAGEDOORRIGHT), true); - - if (GameObject* pSideEntrance = pInstance->instance->GetGameObject(pInstance->GetData64(DATA_GO_SIDE_ENTRANCE_DOOR))) - pSideEntrance->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED); - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - - if (ChaseTimer <= diff) - { - if (!IsChasing) - { - if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) - { - DoScriptText(SAY_WOLF_HOOD, me); - DoCast(pTarget, SPELL_LITTLE_RED_RIDING_HOOD, true); - TempThreat = DoGetThreat(pTarget); - if (TempThreat) - DoModifyThreatPercent(pTarget, -100); - HoodGUID = pTarget->GetGUID(); - me->AddThreat(pTarget, 1000000.0f); - ChaseTimer = 20000; - IsChasing = true; - } - } - else - { - IsChasing = false; - - if (Unit *pTarget = Unit::GetUnit((*me), HoodGUID)) - { - HoodGUID = 0; - if (DoGetThreat(pTarget)) - DoModifyThreatPercent(pTarget, -100); - me->AddThreat(pTarget, TempThreat); - TempThreat = 0; - } - - ChaseTimer = 40000; - } - } else ChaseTimer -= diff; - - if (IsChasing) - return; - - if (FearTimer <= diff) - { - DoCast(me->getVictim(), SPELL_TERRIFYING_HOWL); - FearTimer = urand(25000,35000); - } else FearTimer -= diff; - - if (SwipeTimer <= diff) - { - DoCast(me->getVictim(), SPELL_WIDE_SWIPE); - SwipeTimer = urand(25000,30000); - } else SwipeTimer -= diff; - - } -}; - -CreatureAI* GetAI_boss_bigbadwolf(Creature* pCreature) -{ - return new boss_bigbadwolfAI(pCreature); -} - -/**********************************************/ -/******** Opera Romeo and Juliet Event *******/ -/********************************************/ - -/**** Speech *****/ -#define SAY_JULIANNE_AGGRO -1532046 -#define SAY_JULIANNE_ENTER -1532047 -#define SAY_JULIANNE_DEATH01 -1532048 -#define SAY_JULIANNE_DEATH02 -1532049 -#define SAY_JULIANNE_RESURRECT -1532050 -#define SAY_JULIANNE_SLAY -1532051 - -#define SAY_ROMULO_AGGRO -1532052 -#define SAY_ROMULO_DEATH -1532053 -#define SAY_ROMULO_ENTER -1532054 -#define SAY_ROMULO_RESURRECT -1532055 -#define SAY_ROMULO_SLAY -1532056 - -/***** Spells For Julianne *****/ -#define SPELL_BLINDING_PASSION 30890 -#define SPELL_DEVOTION 30887 -#define SPELL_ETERNAL_AFFECTION 30878 -#define SPELL_POWERFUL_ATTRACTION 30889 -#define SPELL_DRINK_POISON 30907 - -/***** Spells For Romulo ****/ -#define SPELL_BACKWARD_LUNGE 30815 -#define SPELL_DARING 30841 -#define SPELL_DEADLY_SWATHE 30817 -#define SPELL_POISON_THRUST 30822 - -/**** Other Misc. Spells ****/ -#define SPELL_UNDYING_LOVE 30951 -#define SPELL_RES_VISUAL 24171 - -/*** Misc. Information ****/ -#define CREATURE_ROMULO 17533 -#define ROMULO_X -10900 -#define ROMULO_Y -1758 - -enum RAJPhase -{ - PHASE_JULIANNE = 0, - PHASE_ROMULO = 1, - PHASE_BOTH = 2, -}; - -void PretendToDie(Creature* pCreature) -{ - pCreature->InterruptNonMeleeSpells(true); - pCreature->RemoveAllAuras(); - pCreature->SetHealth(0); - pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - pCreature->GetMotionMaster()->MovementExpired(false); - pCreature->GetMotionMaster()->MoveIdle(); - pCreature->SetStandState(UNIT_STAND_STATE_DEAD); -}; - -void Resurrect(Creature *pTarget) -{ - pTarget->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - pTarget->SetHealth(pTarget->GetMaxHealth()); - pTarget->SetStandState(UNIT_STAND_STATE_STAND); - pTarget->CastSpell(pTarget, SPELL_RES_VISUAL, true); - if (pTarget->getVictim()) - { - pTarget->GetMotionMaster()->MoveChase(pTarget->getVictim()); - pTarget->AI()->AttackStart(pTarget->getVictim()); - } - else - pTarget->GetMotionMaster()->Initialize(); -}; - -struct boss_julianneAI : public ScriptedAI -{ - boss_julianneAI(Creature* c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - EntryYellTimer = 1000; - AggroYellTimer = 10000; - IsFakingDeath = false; - } - - ScriptedInstance* pInstance; - - uint32 EntryYellTimer; - uint32 AggroYellTimer; - - uint64 RomuloGUID; - - uint32 Phase; - - uint32 BlindingPassionTimer; - uint32 DevotionTimer; - uint32 EternalAffectionTimer; - uint32 PowerfulAttractionTimer; - uint32 SummonRomuloTimer; - uint32 ResurrectTimer; - uint32 DrinkPoisonTimer; - uint32 ResurrectSelfTimer; - - bool IsFakingDeath; - bool SummonedRomulo; - bool RomuloDead; - - void Reset() - { - RomuloGUID = 0; - Phase = PHASE_JULIANNE; - - BlindingPassionTimer = 30000; - DevotionTimer = 15000; - EternalAffectionTimer = 25000; - PowerfulAttractionTimer = 5000; - SummonRomuloTimer = 10000; - DrinkPoisonTimer = 0; - ResurrectSelfTimer = 0; - - if (IsFakingDeath) - { - Resurrect(me); - IsFakingDeath = false; - } - - SummonedRomulo = false; - RomuloDead = false; - } - - void EnterCombat(Unit* /*who*/) {} - - void AttackStart(Unit* who) - { - if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - return; - - ScriptedAI::AttackStart(who); - } - - void MoveInLineOfSight(Unit* who) - { - if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - return; - - ScriptedAI::MoveInLineOfSight(who); - } - - void JustReachedHome() - { - me->ForcedDespawn(); - } - - void SpellHit(Unit* /*caster*/, const SpellEntry *Spell) - { - if (Spell->Id == SPELL_DRINK_POISON) - { - DoScriptText(SAY_JULIANNE_DEATH01, me); - DrinkPoisonTimer = 2500; - } - } - - void DamageTaken(Unit* done_by, uint32 &damage); - - void JustDied(Unit* /*killer*/) - { - DoScriptText(SAY_JULIANNE_DEATH02, me); - - if (pInstance) - { - pInstance->SetData(TYPE_OPERA, DONE); - pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_STAGEDOORLEFT), true); - pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_STAGEDOORRIGHT), true); - if (GameObject* pSideEntrance = pInstance->instance->GetGameObject(pInstance->GetData64(DATA_GO_SIDE_ENTRANCE_DOOR))) - pSideEntrance->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED); - } - } - - void KilledUnit(Unit* /*victim*/) - { - DoScriptText(SAY_JULIANNE_SLAY, me); - } - - void UpdateAI(const uint32 diff); -}; - -struct boss_romuloAI : public ScriptedAI -{ - boss_romuloAI(Creature* c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - EntryYellTimer = 8000; - AggroYellTimer = 15000; - } - - ScriptedInstance* pInstance; - - uint64 JulianneGUID; - uint32 Phase; - - uint32 EntryYellTimer; - uint32 AggroYellTimer; - uint32 BackwardLungeTimer; - uint32 DaringTimer; - uint32 DeadlySwatheTimer; - uint32 PoisonThrustTimer; - uint32 ResurrectTimer; - - bool IsFakingDeath; - bool JulianneDead; - - void Reset() - { - JulianneGUID = 0; - Phase = PHASE_ROMULO; - - BackwardLungeTimer = 15000; - DaringTimer = 20000; - DeadlySwatheTimer = 25000; - PoisonThrustTimer = 10000; - ResurrectTimer = 10000; - - IsFakingDeath = false; - JulianneDead = false; - } - - void JustReachedHome() - { - me->ForcedDespawn(); - } - - void DamageTaken(Unit* done_by, uint32 &damage); - - void EnterCombat(Unit* /*who*/) - { - DoScriptText(SAY_ROMULO_AGGRO, me); - if (JulianneGUID) - { - Creature* Julianne = (Unit::GetCreature((*me), JulianneGUID)); - if (Julianne && Julianne->getVictim()) - { - me->AddThreat(Julianne->getVictim(), 1.0f); - AttackStart(Julianne->getVictim()); - } - } - } - - void MoveInLineOfSight(Unit* who) - { - if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - return; - - ScriptedAI::MoveInLineOfSight(who); - } - - void JustDied(Unit* /*killer*/) - { - DoScriptText(SAY_ROMULO_DEATH, me); - - if (pInstance) - { - pInstance->SetData(TYPE_OPERA, DONE); - pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_STAGEDOORLEFT), true); - pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_STAGEDOORRIGHT), true); - - if (GameObject* pSideEntrance = pInstance->instance->GetGameObject(pInstance->GetData64(DATA_GO_SIDE_ENTRANCE_DOOR))) - pSideEntrance->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED); - } - } - - void KilledUnit(Unit* /*victim*/) - { - DoScriptText(SAY_ROMULO_SLAY, me); - } - - void UpdateAI(const uint32 diff); -}; - -void boss_julianneAI::DamageTaken(Unit* /*done_by*/, uint32 &damage) -{ - if (damage < me->GetHealth()) - return; - - //anything below only used if incoming damage will kill - - if (Phase == PHASE_JULIANNE) - { - damage = 0; - - //this means already drinking, so return - if (IsFakingDeath) - return; - - me->InterruptNonMeleeSpells(true); - DoCast(me, SPELL_DRINK_POISON); - - IsFakingDeath = true; - //IS THIS USEFULL? Creature* Julianne = (Unit::GetCreature((*me), JulianneGUID)); - return; - } - - if (Phase == PHASE_ROMULO) - { - error_log("TSCR: boss_julianneAI: cannot take damage in PHASE_ROMULO, why was i here?"); - damage = 0; - return; - } - - if (Phase == PHASE_BOTH) - { - //if this is true then we have to kill romulo too - if (RomuloDead) - { - if (Creature* Romulo = (Unit::GetCreature((*me), RomuloGUID))) - { - Romulo->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - Romulo->GetMotionMaster()->Clear(); - Romulo->setDeathState(JUST_DIED); - Romulo->CombatStop(true); - Romulo->DeleteThreatList(); - Romulo->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); - } - - return; - } - - //if not already returned, then romulo is alive and we can pretend die - if (Creature* Romulo = (Unit::GetCreature((*me), RomuloGUID))) - { - PretendToDie(me); - IsFakingDeath = true; - CAST_AI(boss_romuloAI, Romulo->AI())->ResurrectTimer = 10000; - CAST_AI(boss_romuloAI, Romulo->AI())->JulianneDead = true; - damage = 0; - return; - } - } - error_log("TSCR: boss_julianneAI: DamageTaken reach end of code, that should not happen."); -} - -void boss_romuloAI::DamageTaken(Unit* /*done_by*/, uint32 &damage) -{ - if (damage < me->GetHealth()) - return; - - //anything below only used if incoming damage will kill - - if (Phase == PHASE_ROMULO) - { - DoScriptText(SAY_ROMULO_DEATH, me); - PretendToDie(me); - IsFakingDeath = true; - Phase = PHASE_BOTH; - - if (Creature* Julianne = (Unit::GetCreature((*me), JulianneGUID))) - { - CAST_AI(boss_julianneAI, Julianne->AI())->RomuloDead = true; - CAST_AI(boss_julianneAI, Julianne->AI())->ResurrectSelfTimer = 10000; - } - - damage = 0; - return; - } - - if (Phase == PHASE_BOTH) - { - if (JulianneDead) - { - if (Creature* Julianne = (Unit::GetCreature((*me), JulianneGUID))) - { - Julianne->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - Julianne->GetMotionMaster()->Clear(); - Julianne->setDeathState(JUST_DIED); - Julianne->CombatStop(true); - Julianne->DeleteThreatList(); - Julianne->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); - } - return; - } - - if (Creature* Julianne = (Unit::GetCreature((*me), JulianneGUID))) - { - PretendToDie(me); - IsFakingDeath = true; - CAST_AI(boss_julianneAI, Julianne->AI())->ResurrectTimer = 10000; - CAST_AI(boss_julianneAI, Julianne->AI())->RomuloDead = true; - damage = 0; - return; - } - } - - error_log("TSCR: boss_romuloAI: DamageTaken reach end of code, that should not happen."); -} - -void boss_julianneAI::UpdateAI(const uint32 diff) -{ - if (EntryYellTimer) - { - if (EntryYellTimer <= diff) - { - DoScriptText(SAY_JULIANNE_ENTER, me); - EntryYellTimer = 0; - } else EntryYellTimer -= diff; - } - - if (AggroYellTimer) - { - if (AggroYellTimer <= diff) - { - DoScriptText(SAY_JULIANNE_AGGRO, me); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->setFaction(16); - AggroYellTimer = 0; - } else AggroYellTimer -= diff; - } - - if (DrinkPoisonTimer) - { - //will do this 2secs after spell hit. this is time to display visual as expected - if (DrinkPoisonTimer <= diff) - { - PretendToDie(me); - Phase = PHASE_ROMULO; - SummonRomuloTimer = 10000; - DrinkPoisonTimer = 0; - } else DrinkPoisonTimer -= diff; - } - - if (Phase == PHASE_ROMULO && !SummonedRomulo) - { - if (SummonRomuloTimer <= diff) - { - if (Creature* pRomulo = me->SummonCreature(CREATURE_ROMULO, ROMULO_X, ROMULO_Y, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, HOUR*2*IN_MILISECONDS)) - { - RomuloGUID = pRomulo->GetGUID(); - CAST_AI(boss_romuloAI, pRomulo->AI())->JulianneGUID = me->GetGUID(); - CAST_AI(boss_romuloAI, pRomulo->AI())->Phase = PHASE_ROMULO; - DoZoneInCombat(pRomulo); - - pRomulo->setFaction(16); - } - SummonedRomulo = true; - } else SummonRomuloTimer -= diff; - } - - if (ResurrectSelfTimer) - { - if (ResurrectSelfTimer <= diff) - { - Resurrect(me); - Phase = PHASE_BOTH; - IsFakingDeath = false; - - if (me->getVictim()) - AttackStart(me->getVictim()); - - ResurrectSelfTimer = 0; - ResurrectTimer = 1000; - } else ResurrectSelfTimer -= diff; - } - - if (!UpdateVictim() || IsFakingDeath) - return; - - if (RomuloDead) - { - if (ResurrectTimer <= diff) - { - Creature* Romulo = (Unit::GetCreature((*me), RomuloGUID)); - if (Romulo && CAST_AI(boss_romuloAI, Romulo->AI())->IsFakingDeath) - { - DoScriptText(SAY_JULIANNE_RESURRECT, me); - Resurrect(Romulo); - CAST_AI(boss_romuloAI, Romulo->AI())->IsFakingDeath = false; - RomuloDead = false; - ResurrectTimer = 10000; - } - } else ResurrectTimer -= diff; - } - - if (BlindingPassionTimer <= diff) - { - if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) - DoCast(pTarget, SPELL_BLINDING_PASSION); - BlindingPassionTimer = urand(30000,45000); - } else BlindingPassionTimer -= diff; - - if (DevotionTimer <= diff) - { - DoCast(me, SPELL_DEVOTION); - DevotionTimer = urand(15000,45000); - } else DevotionTimer -= diff; - - if (PowerfulAttractionTimer <= diff) - { - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_POWERFUL_ATTRACTION); - PowerfulAttractionTimer = urand(5000,30000); - } else PowerfulAttractionTimer -= diff; - - if (EternalAffectionTimer <= diff) - { - if (urand(0,1) && SummonedRomulo) - { - Creature* Romulo = (Unit::GetCreature((*me), RomuloGUID)); - if (Romulo && Romulo->isAlive() && !RomuloDead) - DoCast(Romulo, SPELL_ETERNAL_AFFECTION); - } else DoCast(me, SPELL_ETERNAL_AFFECTION); - - EternalAffectionTimer = urand(45000,60000); - } else EternalAffectionTimer -= diff; - - DoMeleeAttackIfReady(); -} - -void boss_romuloAI::UpdateAI(const uint32 diff) -{ - if (!UpdateVictim() || IsFakingDeath) - return; - - if (JulianneDead) - { - if (ResurrectTimer <= diff) - { - Creature* Julianne = (Unit::GetCreature((*me), JulianneGUID)); - if (Julianne && CAST_AI(boss_julianneAI, Julianne->AI())->IsFakingDeath) - { - DoScriptText(SAY_ROMULO_RESURRECT, me); - Resurrect(Julianne); - CAST_AI(boss_julianneAI, Julianne->AI())->IsFakingDeath = false; - JulianneDead = false; - ResurrectTimer = 10000; - } - } else ResurrectTimer -= diff; - } - - if (BackwardLungeTimer <= diff) - { - Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true); - if (pTarget && !me->HasInArc(M_PI, pTarget)) - { - DoCast(pTarget, SPELL_BACKWARD_LUNGE); - BackwardLungeTimer = urand(15000,30000); - } - } else BackwardLungeTimer -= diff; - - if (DaringTimer <= diff) - { - DoCast(me, SPELL_DARING); - DaringTimer = urand(20000,40000); - } else DaringTimer -= diff; - - if (DeadlySwatheTimer <= diff) - { - if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) - DoCast(pTarget, SPELL_DEADLY_SWATHE); - DeadlySwatheTimer = urand(15000,25000); - } else DeadlySwatheTimer -= diff; - - if (PoisonThrustTimer <= diff) - { - DoCast(me->getVictim(), SPELL_POISON_THRUST); - PoisonThrustTimer = urand(10000,20000); - } else PoisonThrustTimer -= diff; - - DoMeleeAttackIfReady(); -} - -CreatureAI* GetAI_boss_julianne(Creature* pCreature) -{ - return new boss_julianneAI(pCreature); -} - -CreatureAI* GetAI_boss_romulo(Creature* pCreature) -{ - return new boss_romuloAI(pCreature); -} - -void AddSC_bosses_opera() -{ - Script* newscript; - - // Oz - newscript = new Script; - newscript->GetAI = &GetAI_boss_dorothee; - newscript->Name = "boss_dorothee"; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->GetAI = &GetAI_boss_strawman; - newscript->Name = "boss_strawman"; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->GetAI = &GetAI_boss_tinhead; - newscript->Name = "boss_tinhead"; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->GetAI = &GetAI_boss_roar; - newscript->Name = "boss_roar"; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->GetAI = &GetAI_boss_crone; - newscript->Name = "boss_crone"; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->GetAI = &GetAI_mob_tito; - newscript->Name = "mob_tito"; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->GetAI = &GetAI_mob_cyclone; - newscript->Name = "mob_cyclone"; - newscript->RegisterSelf(); - - // Hood - newscript = new Script; - newscript->pGossipHello = &GossipHello_npc_grandmother; - newscript->pGossipSelect = &GossipSelect_npc_grandmother; - newscript->Name = "npc_grandmother"; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->GetAI = &GetAI_boss_bigbadwolf; - newscript->Name = "boss_bigbadwolf"; - newscript->RegisterSelf(); - - // Romeo And Juliet - newscript = new Script; - newscript->GetAI = &GetAI_boss_julianne; - newscript->Name = "boss_julianne"; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->GetAI = &GetAI_boss_romulo; - newscript->Name = "boss_romulo"; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/karazhan/instance_karazhan.cpp b/src/server/scripts/EasternKingdoms/karazhan/instance_karazhan.cpp deleted file mode 100644 index 59c1236bcdc..00000000000 --- a/src/server/scripts/EasternKingdoms/karazhan/instance_karazhan.cpp +++ /dev/null @@ -1,308 +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_Karazhan -SD%Complete: 70 -SDComment: Instance Script for Karazhan to help in various encounters. TODO: GameObject visibility for Opera event. -SDCategory: Karazhan -EndScriptData */ - -#include "ScriptedPch.h" -#include "karazhan.h" - -#define MAX_ENCOUNTER 12 - -/* -0 - Attumen + Midnight (optional) -1 - Moroes -2 - Maiden of Virtue (optional) -3 - Hyakiss the Lurker / Rokad the Ravager / Shadikith the Glider -4 - Opera Event -5 - Curator -6 - Shade of Aran (optional) -7 - Terestian Illhoof (optional) -8 - Netherspite (optional) -9 - Chess Event -10 - Prince Malchezzar -11 - Nightbane -*/ - -struct instance_karazhan : public ScriptedInstance -{ - instance_karazhan(Map* pMap) : ScriptedInstance(pMap) {Initialize();} - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - std::string strSaveData; - - uint32 m_uiOperaEvent; - uint32 m_uiOzDeathCount; - - uint64 m_uiCurtainGUID; - uint64 m_uiStageDoorLeftGUID; - uint64 m_uiStageDoorRightGUID; - uint64 m_uiKilrekGUID; - uint64 m_uiTerestianGUID; - uint64 m_uiMoroesGUID; - uint64 m_uiLibraryDoor; // Door at Shade of Aran - uint64 m_uiMassiveDoor; // Door at Netherspite - uint64 m_uiSideEntranceDoor; // Side Entrance - uint64 m_uiGamesmansDoor; // Door before Chess - uint64 m_uiGamesmansExitDoor; // Door after Chess - uint64 m_uiNetherspaceDoor; // Door at Malchezaar - uint64 MastersTerraceDoor[2]; - uint64 ImageGUID; - uint64 DustCoveredChest; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - // 1 - OZ, 2 - HOOD, 3 - RAJ, this never gets altered. - m_uiOperaEvent = urand(1,3); - m_uiOzDeathCount = 0; - - m_uiCurtainGUID = 0; - m_uiStageDoorLeftGUID = 0; - m_uiStageDoorRightGUID = 0; - - m_uiKilrekGUID = 0; - m_uiTerestianGUID = 0; - m_uiMoroesGUID = 0; - - m_uiLibraryDoor = 0; - m_uiMassiveDoor = 0; - m_uiSideEntranceDoor = 0; - m_uiGamesmansDoor = 0; - m_uiGamesmansExitDoor = 0; - m_uiNetherspaceDoor = 0; - MastersTerraceDoor[0]= 0; - MastersTerraceDoor[1]= 0; - ImageGUID = 0; - DustCoveredChest = 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 17229: m_uiKilrekGUID = pCreature->GetGUID(); break; - case 15688: m_uiTerestianGUID = pCreature->GetGUID(); break; - case 15687: m_uiMoroesGUID = pCreature->GetGUID(); break; - } - } - - void SetData(uint32 type, uint32 uiData) - { - switch (type) - { - case TYPE_ATTUMEN: m_auiEncounter[0] = uiData; break; - case TYPE_MOROES: - if (m_auiEncounter[1] == DONE) - break; - m_auiEncounter[1] = uiData; - break; - case TYPE_MAIDEN: m_auiEncounter[2] = uiData; break; - case TYPE_OPTIONAL_BOSS: m_auiEncounter[3] = uiData; break; - case TYPE_OPERA: m_auiEncounter[4] = uiData; break; - case TYPE_CURATOR: m_auiEncounter[5] = uiData; break; - case TYPE_ARAN: m_auiEncounter[6] = uiData; break; - case TYPE_TERESTIAN: m_auiEncounter[7] = uiData; break; - case TYPE_NETHERSPITE: m_auiEncounter[8] = uiData; break; - case TYPE_CHESS: - if (uiData == DONE) - DoRespawnGameObject(DustCoveredChest,DAY); - m_auiEncounter[9] = uiData; - break; - case TYPE_MALCHEZZAR: m_auiEncounter[10] = uiData; break; - case TYPE_NIGHTBANE: - if (m_auiEncounter[11] != DONE) - m_auiEncounter[11] = uiData; - break; - case DATA_OPERA_OZ_DEATHCOUNT: - if (uiData == SPECIAL) - ++m_uiOzDeathCount; - else if (uiData == IN_PROGRESS) - m_uiOzDeathCount = 0; - break; - } - - if (uiData == 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] << " " << m_auiEncounter[9] << " " << m_auiEncounter[10] << " " << m_auiEncounter[11]; - - strSaveData = saveStream.str(); - - SaveToDB(); - OUT_SAVE_INST_DATA_COMPLETE; - } - } - - void SetData64(uint32 identifier, uint64 data) - { - switch(identifier) - { - case DATA_IMAGE_OF_MEDIVH: ImageGUID = data; - } - } - - void OnGameObjectCreate(GameObject* pGo, bool /*add*/) - { - switch(pGo->GetEntry()) - { - case 183932: m_uiCurtainGUID = pGo->GetGUID(); break; - case 184278: - m_uiStageDoorLeftGUID = pGo->GetGUID(); - if (m_auiEncounter[4] == DONE) - pGo->SetGoState(GO_STATE_ACTIVE); - break; - case 184279: - m_uiStageDoorRightGUID = pGo->GetGUID(); - if (m_auiEncounter[4] == DONE) - pGo->SetGoState(GO_STATE_ACTIVE); - break; - case 184517: m_uiLibraryDoor = pGo->GetGUID(); break; - case 185521: m_uiMassiveDoor = pGo->GetGUID(); break; - case 184276: m_uiGamesmansDoor = pGo->GetGUID(); break; - case 184277: m_uiGamesmansExitDoor = pGo->GetGUID(); break; - case 185134: m_uiNetherspaceDoor = pGo->GetGUID(); break; - case 184274: MastersTerraceDoor[0] = pGo->GetGUID(); break; - case 184280: MastersTerraceDoor[1] = pGo->GetGUID(); break; - case 184275: - m_uiSideEntranceDoor = pGo->GetGUID(); - if (m_auiEncounter[4] == DONE) - pGo->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED); - else - pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED); - break; - case 185119: DustCoveredChest = pGo->GetGUID(); break; - } - - switch(m_uiOperaEvent) - { - //TODO: Set Object visibilities for Opera based on performance - case EVENT_OZ: - break; - - case EVENT_HOOD: - break; - - case EVENT_RAJ: - break; - } - } - - std::string GetSaveData() - { - return strSaveData; - } - - uint32 GetData(uint32 uiData) - { - switch (uiData) - { - case TYPE_ATTUMEN: return m_auiEncounter[0]; - case TYPE_MOROES: return m_auiEncounter[1]; - case TYPE_MAIDEN: return m_auiEncounter[2]; - case TYPE_OPTIONAL_BOSS: return m_auiEncounter[3]; - case TYPE_OPERA: return m_auiEncounter[4]; - case TYPE_CURATOR: return m_auiEncounter[5]; - case TYPE_ARAN: return m_auiEncounter[6]; - case TYPE_TERESTIAN: return m_auiEncounter[7]; - case TYPE_NETHERSPITE: return m_auiEncounter[8]; - case TYPE_CHESS: return m_auiEncounter[9]; - case TYPE_MALCHEZZAR: return m_auiEncounter[10]; - case TYPE_NIGHTBANE: return m_auiEncounter[11]; - case DATA_OPERA_PERFORMANCE: return m_uiOperaEvent; - case DATA_OPERA_OZ_DEATHCOUNT: return m_uiOzDeathCount; - case DATA_IMAGE_OF_MEDIVH: return ImageGUID; - } - - return 0; - } - - uint64 GetData64(uint32 uiData) - { - switch (uiData) - { - case DATA_KILREK: return m_uiKilrekGUID; - case DATA_TERESTIAN: return m_uiTerestianGUID; - case DATA_MOROES: return m_uiMoroesGUID; - case DATA_GO_STAGEDOORLEFT: return m_uiStageDoorLeftGUID; - case DATA_GO_STAGEDOORRIGHT: return m_uiStageDoorRightGUID; - case DATA_GO_CURTAINS: return m_uiCurtainGUID; - case DATA_GO_LIBRARY_DOOR: return m_uiLibraryDoor; - case DATA_GO_MASSIVE_DOOR: return m_uiMassiveDoor; - case DATA_GO_SIDE_ENTRANCE_DOOR: return m_uiSideEntranceDoor; - case DATA_GO_GAME_DOOR: return m_uiGamesmansDoor; - case DATA_GO_GAME_EXIT_DOOR: return m_uiGamesmansExitDoor; - case DATA_GO_NETHER_DOOR: return m_uiNetherspaceDoor; - case DATA_MASTERS_TERRACE_DOOR_1: return MastersTerraceDoor[0]; - case DATA_MASTERS_TERRACE_DOOR_2: return MastersTerraceDoor[1]; - } - - return 0; - } - - void Load(const char* chrIn) - { - if (!chrIn) - { - OUT_LOAD_INST_DATA_FAIL; - return; - } - - OUT_LOAD_INST_DATA(chrIn); - std::istringstream loadStream(chrIn); - - 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] >> m_auiEncounter[9] >> m_auiEncounter[10] >> m_auiEncounter[11]; - 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_karazhan(Map* pMap) -{ - return new instance_karazhan(pMap); -} - -void AddSC_instance_karazhan() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_karazhan"; - newscript->GetInstanceData = &GetInstanceData_instance_karazhan; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/karazhan/karazhan.cpp b/src/server/scripts/EasternKingdoms/karazhan/karazhan.cpp deleted file mode 100644 index 5186a794b0d..00000000000 --- a/src/server/scripts/EasternKingdoms/karazhan/karazhan.cpp +++ /dev/null @@ -1,646 +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: Karazhan -SD%Complete: 100 -SDComment: Support for Barnes (Opera controller) and Berthold (Doorman), Support for Quest 9645. -SDCategory: Karazhan -EndScriptData */ - -/* ContentData -npc_barnes -npc_berthold -npc_image_of_medivh -EndContentData */ - -#include "ScriptedPch.h" -#include "karazhan.h" -#include "ScriptedEscortAI.h" - -/*###### -# npc_barnesAI -######*/ - -#define GOSSIP_READY "I'm not an actor." - -#define SAY_READY "Splendid, I'm going to get the audience ready. Break a leg!" -#define SAY_OZ_INTRO1 "Finally, everything is in place. Are you ready for your big stage debut?" -#define OZ_GOSSIP1 "I'm not an actor." -#define SAY_OZ_INTRO2 "Don't worry, you'll be fine. You look like a natural!" -#define OZ_GOSSIP2 "Ok, I'll give it a try, then." - -#define SAY_RAJ_INTRO1 "The romantic plays are really tough, but you'll do better this time. You have TALENT. Ready?" -#define RAJ_GOSSIP1 "I've never been more ready." - -#define OZ_GM_GOSSIP1 "[GM] Change event to EVENT_OZ" -#define OZ_GM_GOSSIP2 "[GM] Change event to EVENT_HOOD" -#define OZ_GM_GOSSIP3 "[GM] Change event to EVENT_RAJ" - -struct Dialogue -{ - int32 textid; - uint32 timer; -}; - -static Dialogue OzDialogue[]= -{ - {-1532103, 6000}, - {-1532104, 18000}, - {-1532105, 9000}, - {-1532106, 15000} -}; - -static Dialogue HoodDialogue[]= -{ - {-1532107, 6000}, - {-1532108, 10000}, - {-1532109, 14000}, - {-1532110, 15000} -}; - -static Dialogue RAJDialogue[]= -{ - {-1532111, 5000}, - {-1532112, 7000}, - {-1532113, 14000}, - {-1532114, 14000} -}; - -// Entries and spawn locations for creatures in Oz event -float Spawns[6][2]= -{ - {17535, -10896}, // Dorothee - {17546, -10891}, // Roar - {17547, -10884}, // Tinhead - {17543, -10902}, // Strawman - {17603, -10892}, // Grandmother - {17534, -10900}, // Julianne -}; - -#define CREATURE_SPOTLIGHT 19525 - -#define SPELL_SPOTLIGHT 25824 -#define SPELL_TUXEDO 32616 - -#define SPAWN_Z 90.5 -#define SPAWN_Y -1758 -#define SPAWN_O 4.738 - -struct npc_barnesAI : public npc_escortAI -{ - npc_barnesAI(Creature* c) : npc_escortAI(c) - { - RaidWiped = false; - m_uiEventId = 0; - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint64 m_uiSpotlightGUID; - - uint32 TalkCount; - uint32 TalkTimer; - uint32 WipeTimer; - uint32 m_uiEventId; - - bool PerformanceReady; - bool RaidWiped; - - void Reset() - { - m_uiSpotlightGUID = 0; - - TalkCount = 0; - TalkTimer = 2000; - WipeTimer = 5000; - - PerformanceReady = false; - - if (pInstance) - m_uiEventId = pInstance->GetData(DATA_OPERA_PERFORMANCE); - } - - void StartEvent() - { - if (!pInstance) - return; - - pInstance->SetData(TYPE_OPERA, IN_PROGRESS); - - //resets count for this event, in case earlier failed - if (m_uiEventId == EVENT_OZ) - pInstance->SetData(DATA_OPERA_OZ_DEATHCOUNT, IN_PROGRESS); - - Start(false, false); - } - - void EnterCombat(Unit* /*who*/) {} - - void WaypointReached(uint32 i) - { - if (!pInstance) - return; - - switch(i) - { - case 0: - DoCast(me, SPELL_TUXEDO, false); - pInstance->DoUseDoorOrButton(pInstance->GetData64(DATA_GO_STAGEDOORLEFT)); - break; - case 4: - TalkCount = 0; - SetEscortPaused(true); - - if (Creature* pSpotlight = me->SummonCreature(CREATURE_SPOTLIGHT, - me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0.0f, - TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000)) - { - pSpotlight->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - pSpotlight->CastSpell(pSpotlight, SPELL_SPOTLIGHT, false); - m_uiSpotlightGUID = pSpotlight->GetGUID(); - } - break; - case 8: - pInstance->DoUseDoorOrButton(pInstance->GetData64(DATA_GO_STAGEDOORLEFT)); - PerformanceReady = true; - break; - case 9: - PrepareEncounter(); - pInstance->DoUseDoorOrButton(pInstance->GetData64(DATA_GO_CURTAINS)); - break; - } - } - - void Talk(uint32 count) - { - int32 text = 0; - - switch(m_uiEventId) - { - case EVENT_OZ: - if (OzDialogue[count].textid) - text = OzDialogue[count].textid; - if (OzDialogue[count].timer) - TalkTimer = OzDialogue[count].timer; - break; - - case EVENT_HOOD: - if (HoodDialogue[count].textid) - text = HoodDialogue[count].textid; - if (HoodDialogue[count].timer) - TalkTimer = HoodDialogue[count].timer; - break; - - case EVENT_RAJ: - if (RAJDialogue[count].textid) - text = RAJDialogue[count].textid; - if (RAJDialogue[count].timer) - TalkTimer = RAJDialogue[count].timer; - break; - } - - if (text) - DoScriptText(text, me); - } - - void PrepareEncounter() - { - debug_log("TSCR: Barnes Opera Event - Introduction complete - preparing encounter %d", m_uiEventId); - uint8 index = 0; - uint8 count = 0; - - switch(m_uiEventId) - { - case EVENT_OZ: - index = 0; - count = 4; - break; - case EVENT_HOOD: - index = 4; - count = index+1; - break; - case EVENT_RAJ: - index = 5; - count = index+1; - break; - } - - for (; index < count; ++index) - { - uint32 entry = ((uint32)Spawns[index][0]); - float PosX = Spawns[index][1]; - - if (Creature* pCreature = me->SummonCreature(entry, PosX, SPAWN_Y, SPAWN_Z, SPAWN_O, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, HOUR*2*IN_MILISECONDS)) - { - // In case database has bad flags - pCreature->SetUInt32Value(UNIT_FIELD_FLAGS, 0); - pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - } - } - - RaidWiped = false; - } - - void UpdateAI(const uint32 diff) - { - npc_escortAI::UpdateAI(diff); - - if (HasEscortState(STATE_ESCORT_PAUSED)) - { - if (TalkTimer <= diff) - { - if (TalkCount > 3) - { - if (Creature* pSpotlight = Unit::GetCreature(*me, m_uiSpotlightGUID)) - pSpotlight->ForcedDespawn(); - - SetEscortPaused(false); - return; - } - - Talk(TalkCount); - ++TalkCount; - } else TalkTimer -= diff; - } - - if (PerformanceReady) - { - if (!RaidWiped) - { - if (WipeTimer <= diff) - { - Map* pMap = me->GetMap(); - if (!pMap->IsDungeon()) - return; - - Map::PlayerList const &PlayerList = pMap->GetPlayers(); - if (PlayerList.isEmpty()) - return; - - RaidWiped = true; - for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) - { - if (i->getSource()->isAlive() && !i->getSource()->isGameMaster()) - { - RaidWiped = false; - break; - } - } - - if (RaidWiped) - { - RaidWiped = true; - EnterEvadeMode(); - return; - } - - WipeTimer = 15000; - } else WipeTimer -= diff; - } - - } - } -}; - -CreatureAI* GetAI_npc_barnesAI(Creature* pCreature) -{ - return new npc_barnesAI(pCreature); -} - -bool GossipHello_npc_barnes(Player* pPlayer, Creature* pCreature) -{ - if (ScriptedInstance* pInstance = pCreature->GetInstanceData()) - { - // Check for death of Moroes and if opera event is not done already - if (pInstance->GetData(TYPE_MOROES) == DONE && pInstance->GetData(TYPE_OPERA) != DONE) - { - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, OZ_GOSSIP1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - - if (pPlayer->isGameMaster()) - { - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_DOT, OZ_GM_GOSSIP1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_DOT, OZ_GM_GOSSIP2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_DOT, OZ_GM_GOSSIP3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5); - } - - if (npc_barnesAI* pBarnesAI = CAST_AI(npc_barnesAI,pCreature->AI())) - { - if (!pBarnesAI->RaidWiped) - pPlayer->SEND_GOSSIP_MENU(8970, pCreature->GetGUID()); - else - pPlayer->SEND_GOSSIP_MENU(8975, pCreature->GetGUID()); - - return true; - } - } - } - - pPlayer->SEND_GOSSIP_MENU(8978, pCreature->GetGUID()); - return true; -} - -bool GossipSelect_npc_barnes(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction) -{ - npc_barnesAI* pBarnesAI = CAST_AI(npc_barnesAI, pCreature->AI()); - - switch(uiAction) - { - case GOSSIP_ACTION_INFO_DEF+1: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, OZ_GOSSIP2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - pPlayer->SEND_GOSSIP_MENU(8971, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - pPlayer->CLOSE_GOSSIP_MENU(); - pBarnesAI->StartEvent(); - break; - case GOSSIP_ACTION_INFO_DEF+3: - pPlayer->CLOSE_GOSSIP_MENU(); - pBarnesAI->m_uiEventId = EVENT_OZ; - outstring_log("TSCR: player (GUID %i) manually set Opera event to EVENT_OZ",pPlayer->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+4: - pPlayer->CLOSE_GOSSIP_MENU(); - pBarnesAI->m_uiEventId = EVENT_HOOD; - outstring_log("TSCR: player (GUID %i) manually set Opera event to EVENT_HOOD",pPlayer->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+5: - pPlayer->CLOSE_GOSSIP_MENU(); - pBarnesAI->m_uiEventId = EVENT_RAJ; - outstring_log("TSCR: player (GUID %i) manually set Opera event to EVENT_RAJ",pPlayer->GetGUID()); - break; - } - - return true; -} - -/*### -# npc_berthold -####*/ - -enum eBerthold -{ - SPELL_TELEPORT = 39567 -}; - -#define GOSSIP_ITEM_TELEPORT "Teleport me to the Guardian's Library" - -bool GossipHello_npc_berthold(Player* pPlayer, Creature* pCreature) -{ - if (ScriptedInstance* pInstance = pCreature->GetInstanceData()) - { - // Check if Shade of Aran event is done - if (pInstance->GetData(TYPE_ARAN) == DONE) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TELEPORT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - } - - pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); - return true; -} - -bool GossipSelect_npc_berthold(Player* pPlayer, Creature* /*pCreature*/, uint32 /*uiSender*/, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) - pPlayer->CastSpell(pPlayer, SPELL_TELEPORT, true); - - pPlayer->CLOSE_GOSSIP_MENU(); - return true; -} - -/*### -# npc_image_of_medivh -####*/ - -#define SAY_DIALOG_MEDIVH_1 "You've got my attention, dragon. You'll find I'm not as easily scared as the villagers below." -#define SAY_DIALOG_ARCANAGOS_2 "Your dabbling in the arcane has gone too far, Medivh. You've attracted the attention of powers beyond your understanding. You must leave Karazhan at once!" -#define SAY_DIALOG_MEDIVH_3 "You dare challenge me at my own dwelling? Your arrogance is astounding, even for a dragon!" -#define SAY_DIALOG_ARCANAGOS_4 "A dark power seeks to use you, Medivh! If you stay, dire days will follow. You must hurry, we don't have much time!" -#define SAY_DIALOG_MEDIVH_5 "I do not know what you speak of, dragon... but I will not be bullied by this display of insolence. I'll leave Karazhan when it suits me!" -#define SAY_DIALOG_ARCANAGOS_6 "You leave me no alternative. I will stop you by force if you won't listen to reason!" -#define EMOTE_DIALOG_MEDIVH_7 "begins to cast a spell of great power, weaving his own essence into the magic." -#define SAY_DIALOG_ARCANAGOS_8 "What have you done, wizard? This cannot be! I'm burning from... within!" -#define SAY_DIALOG_MEDIVH_9 "He should not have angered me. I must go... recover my strength now..." - -#define MOB_ARCANAGOS 17652 -#define SPELL_FIRE_BALL 30967 -#define SPELL_UBER_FIREBALL 30971 -#define SPELL_CONFLAGRATION_BLAST 30977 -#define SPELL_MANA_SHIELD 31635 - -static float MedivPos[4] = {-11161.49,-1902.24,91.48,1.94}; -static float ArcanagosPos[4] = {-11169.75,-1881.48,95.39,4.83}; - -struct npc_image_of_medivhAI : public ScriptedAI -{ - npc_image_of_medivhAI(Creature* c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance *pInstance; - - uint64 ArcanagosGUID; - - uint32 YellTimer; - uint32 Step; - uint32 FireMedivhTimer; - uint32 FireArcanagosTimer; - - bool EventStarted; - - void Reset() - { - ArcanagosGUID = 0; - - if (pInstance && pInstance->GetData64(DATA_IMAGE_OF_MEDIVH) == 0) - { - pInstance->SetData64(DATA_IMAGE_OF_MEDIVH, me->GetGUID()); - (*me).GetMotionMaster()->MovePoint(1,MedivPos[0],MedivPos[1],MedivPos[2]); - Step = 0; - }else - { - me->DealDamage(me,me->GetHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - me->RemoveCorpse(); - } - } - void EnterCombat(Unit* /*who*/) {} - - void MovementInform(uint32 type, uint32 id) - { - if (type != POINT_MOTION_TYPE) - return; - if (id == 1) - { - StartEvent(); - me->SetOrientation(MedivPos[3]); - me->SetOrientation(MedivPos[3]); - } - } - - void StartEvent() - { - Step = 1; - EventStarted = true; - Creature* Arcanagos = me->SummonCreature(MOB_ARCANAGOS,ArcanagosPos[0],ArcanagosPos[1],ArcanagosPos[2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,20000); - if (!Arcanagos) - return; - ArcanagosGUID = Arcanagos->GetGUID(); - Arcanagos->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - (*Arcanagos).GetMotionMaster()->MovePoint(0,ArcanagosPos[0],ArcanagosPos[1],ArcanagosPos[2]); - Arcanagos->SetOrientation(ArcanagosPos[3]); - me->SetOrientation(MedivPos[3]); - YellTimer = 10000; - } - - uint32 NextStep(uint32 Step) - { - Unit* arca = Unit::GetUnit((*me),ArcanagosGUID); - Map* pMap = me->GetMap(); - switch(Step) - { - case 0: return 9999999; - case 1: - me->MonsterYell(SAY_DIALOG_MEDIVH_1,LANG_UNIVERSAL,NULL); - return 10000; - case 2: - if (arca) - CAST_CRE(arca)->MonsterYell(SAY_DIALOG_ARCANAGOS_2,LANG_UNIVERSAL,NULL); - return 20000; - case 3: - me->MonsterYell(SAY_DIALOG_MEDIVH_3,LANG_UNIVERSAL,NULL); - return 10000; - case 4: - if (arca) - CAST_CRE(arca)->MonsterYell(SAY_DIALOG_ARCANAGOS_4, LANG_UNIVERSAL, NULL); - return 20000; - case 5: - me->MonsterYell(SAY_DIALOG_MEDIVH_5, LANG_UNIVERSAL, NULL); - return 20000; - case 6: - if (arca) - CAST_CRE(arca)->MonsterYell(SAY_DIALOG_ARCANAGOS_6, LANG_UNIVERSAL, NULL); - return 10000; - case 7: - FireArcanagosTimer = 500; - return 5000; - case 8: - FireMedivhTimer = 500; - DoCast(me, SPELL_MANA_SHIELD); - return 10000; - case 9: - me->MonsterTextEmote(EMOTE_DIALOG_MEDIVH_7, 0, false); - return 10000; - case 10: - if (arca) - DoCast(arca, SPELL_CONFLAGRATION_BLAST, false); - return 1000; - case 11: - if (arca) - CAST_CRE(arca)->MonsterYell(SAY_DIALOG_ARCANAGOS_8, LANG_UNIVERSAL, NULL); - return 5000; - case 12: - arca->GetMotionMaster()->MovePoint(0, -11010.82,-1761.18, 156.47); - arca->setActive(true); - arca->InterruptNonMeleeSpells(true); - arca->SetSpeed(MOVE_FLIGHT, 2.0f); - return 10000; - case 13: - me->MonsterYell(SAY_DIALOG_MEDIVH_9, LANG_UNIVERSAL, NULL); - return 10000; - case 14: - me->SetVisibility(VISIBILITY_OFF); - me->ClearInCombat(); - - if (pMap->IsDungeon()) - { - InstanceMap::PlayerList const &PlayerList = pMap->GetPlayers(); - for (InstanceMap::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) - { - if (i->getSource()->isAlive()) - { - if (i->getSource()->GetQuestStatus(9645) == QUEST_STATUS_INCOMPLETE) - i->getSource()->CompleteQuest(9645); - } - } - } - return 50000; - case 15: - arca->DealDamage(arca,arca->GetHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - return 5000; - default : return 9999999; - } - - } - - void UpdateAI(const uint32 diff) - { - - if (YellTimer <= diff) - { - if (EventStarted) - YellTimer = NextStep(Step++); - } else YellTimer -= diff; - - if (Step >= 7 && Step <= 12) - { - Unit* arca = Unit::GetUnit((*me),ArcanagosGUID); - - if (FireArcanagosTimer <= diff) - { - if (arca) - arca->CastSpell(me, SPELL_FIRE_BALL, false); - FireArcanagosTimer = 6000; - } else FireArcanagosTimer -= diff; - - if (FireMedivhTimer <= diff) - { - if (arca) - DoCast(arca, SPELL_FIRE_BALL); - FireMedivhTimer = 5000; - } else FireMedivhTimer -= diff; - } - } -}; - -CreatureAI* GetAI_npc_image_of_medivh(Creature* pCreature) -{ - return new npc_image_of_medivhAI(pCreature); -} - -void AddSC_karazhan() -{ - Script* newscript; - - newscript = new Script; - newscript->GetAI = &GetAI_npc_barnesAI; - newscript->Name = "npc_barnes"; - newscript->pGossipHello = &GossipHello_npc_barnes; - newscript->pGossipSelect = &GossipSelect_npc_barnes; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_berthold"; - newscript->pGossipHello = &GossipHello_npc_berthold; - newscript->pGossipSelect = &GossipSelect_npc_berthold; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_image_of_medivh"; - newscript->GetAI = &GetAI_npc_image_of_medivh; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/karazhan/karazhan.h b/src/server/scripts/EasternKingdoms/karazhan/karazhan.h deleted file mode 100644 index 56a6b106332..00000000000 --- a/src/server/scripts/EasternKingdoms/karazhan/karazhan.h +++ /dev/null @@ -1,53 +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_KARAZHAN_H -#define DEF_KARAZHAN_H - -enum eEnums -{ - TYPE_ATTUMEN = 1, - TYPE_MOROES = 2, - TYPE_MAIDEN = 3, - TYPE_OPTIONAL_BOSS = 4, - TYPE_OPERA = 5, - TYPE_CURATOR = 6, - TYPE_ARAN = 7, - TYPE_TERESTIAN = 8, - TYPE_NETHERSPITE = 9, - TYPE_CHESS = 10, - TYPE_MALCHEZZAR = 11, - TYPE_NIGHTBANE = 12, - - DATA_OPERA_PERFORMANCE = 13, - DATA_OPERA_OZ_DEATHCOUNT = 14, - - DATA_KILREK = 15, - DATA_TERESTIAN = 16, - DATA_MOROES = 17, - DATA_GO_CURTAINS = 18, - DATA_GO_STAGEDOORLEFT = 19, - DATA_GO_STAGEDOORRIGHT = 20, - DATA_GO_LIBRARY_DOOR = 21, - DATA_GO_MASSIVE_DOOR = 22, - DATA_GO_NETHER_DOOR = 23, - DATA_GO_GAME_DOOR = 24, - DATA_GO_GAME_EXIT_DOOR = 25, - - DATA_IMAGE_OF_MEDIVH = 26, - DATA_MASTERS_TERRACE_DOOR_1 = 27, - DATA_MASTERS_TERRACE_DOOR_2 = 28, - DATA_GO_SIDE_ENTRANCE_DOOR = 29 -}; - -enum OperaEvents -{ - EVENT_OZ = 1, - EVENT_HOOD = 2, - EVENT_RAJ = 3 -}; - -#define ERROR_INST_DATA(a) error_log("TSCR: Instance Data for Karazhan not set properly. Encounter for Creature Entry %u may not work properly.", a->GetEntry()); -#endif - diff --git a/src/server/scripts/EasternKingdoms/magisters_terrace/boss_felblood_kaelthas.cpp b/src/server/scripts/EasternKingdoms/magisters_terrace/boss_felblood_kaelthas.cpp deleted file mode 100644 index b5835dfe0a1..00000000000 --- a/src/server/scripts/EasternKingdoms/magisters_terrace/boss_felblood_kaelthas.cpp +++ /dev/null @@ -1,680 +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_Felblood_Kaelthas -SD%Complete: 80 -SDComment: Normal and Heroic Support. Issues: Arcane Spheres do not initially follow targets. -SDCategory: Magisters' Terrace -EndScriptData */ - -#include "ScriptedPch.h" -#include "magisters_terrace.h" -#include "WorldPacket.h" - -#define SAY_AGGRO -1585023 //This yell should be done when the room is cleared. For now, set it as a movelineofsight yell. -#define SAY_PHOENIX -1585024 -#define SAY_FLAMESTRIKE -1585025 -#define SAY_GRAVITY_LAPSE -1585026 -#define SAY_TIRED -1585027 -#define SAY_RECAST_GRAVITY -1585028 -#define SAY_DEATH -1585029 - -/*** Spells ***/ - -// Phase 1 spells -#define SPELL_FIREBALL_NORMAL 44189 // Deals 2700-3300 damage at current target -#define SPELL_FIREBALL_HEROIC 46164 // 4950-6050 - -#define SPELL_PHOENIX 44194 // Summons a phoenix (Doesn't work?) -#define SPELL_PHOENIX_BURN 44197 // A spell Phoenix uses to damage everything around -#define SPELL_REBIRTH_DMG 44196 // DMG if a Phoenix rebirth happen - -#define SPELL_FLAMESTRIKE1_NORMAL 44190 // Damage part -#define SPELL_FLAMESTRIKE1_HEROIC 46163 // Heroic damage part -#define SPELL_FLAMESTRIKE2 44191 // Flamestrike indicator before the damage -#define SPELL_FLAMESTRIKE3 44192 // Summons the trigger + animation (projectile) - -#define SPELL_SHOCK_BARRIER 46165 // Heroic only; 10k damage shield, followed by Pyroblast -#define SPELL_PYROBLAST 36819 // Heroic only; 45-55k fire damage - -// Phase 2 spells -#define SPELL_GRAVITY_LAPSE_INITIAL 44224 // Cast at the beginning of every Gravity Lapse -#define SPELL_GRAVITY_LAPSE_CHANNEL 44251 // Channeled; blue beam animation to every enemy in range -#define SPELL_TELEPORT_CENTER 44218 // Should teleport people to the center. Requires DB entry in spell_target_position. -#define SPELL_GRAVITY_LAPSE_FLY 44227 // Hastens flyspeed and allows flying for 1 minute. For some reason removes 44226. -#define SPELL_GRAVITY_LAPSE_DOT 44226 // Knocks up in the air and applies a 300 DPS DoT. -#define SPELL_ARCANE_SPHERE_PASSIVE 44263 // Passive auras on Arcane Spheres -#define SPELL_POWER_FEEDBACK 44233 // Stuns him, making him take 50% more damage for 10 seconds. Cast after Gravity Lapse - -/*** Creatures ***/ -#define CREATURE_PHOENIX 24674 -#define CREATURE_PHOENIX_EGG 24675 -#define CREATURE_ARCANE_SPHERE 24708 - -/** Locations **/ -float KaelLocations[3][2]= -{ - {148.744659, 181.377426}, - {140.823883, 195.403046}, - {156.574188, 195.650482}, -}; - -#define LOCATION_Z -16.727455 - -struct boss_felblood_kaelthasAI : public ScriptedAI -{ - boss_felblood_kaelthasAI(Creature* c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint32 FireballTimer; - uint32 PhoenixTimer; - uint32 FlameStrikeTimer; - uint32 CombatPulseTimer; - - //Heroic only - uint32 PyroblastTimer; - - uint32 GravityLapseTimer; - uint32 GravityLapsePhase; - // 0 = No Gravity Lapse - // 1 = Casting Gravity Lapse visual - // 2 = Teleported people to self - // 3 = Knocked people up in the air - // 4 = Applied an aura that allows them to fly, channeling visual, relased Arcane Orbs. - - bool FirstGravityLapse; - bool HasTaunted; - - uint8 Phase; - // 0 = Not started - // 1 = Fireball; Summon Phoenix; Flamestrike - // 2 = Gravity Lapses - - void Reset() - { - // TODO: Timers - FireballTimer = 0; - PhoenixTimer = 10000; - FlameStrikeTimer = 25000; - CombatPulseTimer = 0; - - PyroblastTimer = 60000; - - GravityLapseTimer = 0; - GravityLapsePhase = 0; - - FirstGravityLapse = true; - HasTaunted = false; - - Phase = 0; - - if (pInstance) - { - pInstance->SetData(DATA_KAELTHAS_EVENT, NOT_STARTED); - pInstance->HandleGameObject(pInstance->GetData64(DATA_KAEL_DOOR), true); - // Open the big encounter door. Close it in Aggro and open it only in JustDied(and here) - // Small door opened after event are expected to be closed by default - } - } - - void JustDied(Unit * /*killer*/) - { - DoScriptText(SAY_DEATH, me); - - if (!pInstance) - return; - - pInstance->HandleGameObject(pInstance->GetData64(DATA_KAEL_DOOR), true); - // Open the encounter door - } - - void DamageTaken(Unit* /*done_by*/, uint32 &damage) - { - if (damage > me->GetHealth()) - RemoveGravityLapse(); // Remove Gravity Lapse so that players fall to ground if they kill him when in air. - } - - void EnterCombat(Unit * /*who*/) - { - if (!pInstance) - return; - - pInstance->HandleGameObject(pInstance->GetData64(DATA_KAEL_DOOR), false); - //Close the encounter door, open it in JustDied/Reset - } - - void MoveInLineOfSight(Unit *who) - { - if (!HasTaunted && me->IsWithinDistInMap(who, 40.0)) - { - DoScriptText(SAY_AGGRO, me); - HasTaunted = true; - } - - ScriptedAI::MoveInLineOfSight(who); - } - - void SetThreatList(Creature* SummonedUnit) - { - if (!SummonedUnit) - 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 = me->getThreatManager().getThreat(pUnit); - SummonedUnit->AddThreat(pUnit, threat); - } - } - } - - void TeleportPlayersToSelf() - { - float x = KaelLocations[0][0]; - float y = KaelLocations[0][1]; - me->GetMap()->CreatureRelocation(me, x, y, LOCATION_Z, 0.0f); - //me->SendMonsterMove(x, y, LOCATION_Z, 0, 0, 0); // causes some issues... - std::list::const_iterator i = me->getThreatManager().getThreatList().begin(); - 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)) - pUnit->CastSpell(pUnit, SPELL_TELEPORT_CENTER, true); - } - DoCast(me, SPELL_TELEPORT_CENTER, true); - } - - void CastGravityLapseKnockUp() - { - std::list::const_iterator i = me->getThreatManager().getThreatList().begin(); - 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)) - // Knockback into the air - pUnit->CastSpell(pUnit, SPELL_GRAVITY_LAPSE_DOT, true, 0, 0, me->GetGUID()); - } - } - - void CastGravityLapseFly() // Use Fly Packet hack for now as players can't cast "fly" spells unless in map 530. Has to be done a while after they get knocked into the air... - { - std::list::const_iterator i = me->getThreatManager().getThreatList().begin(); - 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)) - { - // Also needs an exception in spell system. - pUnit->CastSpell(pUnit, SPELL_GRAVITY_LAPSE_FLY, true, 0, 0, me->GetGUID()); - // Use packet hack - WorldPacket data(12); - data.SetOpcode(SMSG_MOVE_SET_CAN_FLY); - data.append(pUnit->GetPackGUID()); - data << uint32(0); - pUnit->SendMessageToSet(&data, true); - } - } - } - - void RemoveGravityLapse() - { - std::list::const_iterator i = me->getThreatManager().getThreatList().begin(); - 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)) - { - pUnit->RemoveAurasDueToSpell(SPELL_GRAVITY_LAPSE_FLY); - pUnit->RemoveAurasDueToSpell(SPELL_GRAVITY_LAPSE_DOT); - - WorldPacket data(12); - data.SetOpcode(SMSG_MOVE_UNSET_CAN_FLY); - data.append(pUnit->GetPackGUID()); - data << uint32(0); - pUnit->SendMessageToSet(&data, true); - } - } - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - switch(Phase) - { - case 0: - { - // *Heroic mode only: - if (IsHeroic()) - { - if (PyroblastTimer <= diff) - { - me->InterruptSpell(CURRENT_CHANNELED_SPELL); - me->InterruptSpell(CURRENT_GENERIC_SPELL); - DoCast(me, SPELL_SHOCK_BARRIER, true); - DoCast(me->getVictim(), SPELL_PYROBLAST); - PyroblastTimer = 60000; - } else PyroblastTimer -= diff; - } - - if (FireballTimer <= diff) - { - DoCast(me->getVictim(), SPELL_FIREBALL_NORMAL); - FireballTimer = urand(2000,6000); - } else FireballTimer -= diff; - - if (PhoenixTimer <= diff) - { - - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1); - - uint8 random = urand(1,2); - float x = KaelLocations[random][0]; - float y = KaelLocations[random][1]; - - Creature* Phoenix = me->SummonCreature(CREATURE_PHOENIX, x, y, LOCATION_Z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000); - if (Phoenix) - { - Phoenix->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE); - SetThreatList(Phoenix); - Phoenix->AI()->AttackStart(pTarget); - } - - DoScriptText(SAY_PHOENIX, me); - - PhoenixTimer = 60000; - } else PhoenixTimer -= diff; - - if (FlameStrikeTimer <= diff) - { - if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) - { - me->InterruptSpell(CURRENT_CHANNELED_SPELL); - me->InterruptSpell(CURRENT_GENERIC_SPELL); - DoCast(pTarget, SPELL_FLAMESTRIKE3, true); - DoScriptText(SAY_FLAMESTRIKE, me); - } - FlameStrikeTimer = urand(15000,25000); - } else FlameStrikeTimer -= diff; - - // Below 50% - if (me->GetMaxHealth() * 0.5 > me->GetHealth()) - { - me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, true); - me->StopMoving(); - me->GetMotionMaster()->Clear(); - me->GetMotionMaster()->MoveIdle(); - GravityLapseTimer = 0; - GravityLapsePhase = 0; - Phase = 1; - } - - DoMeleeAttackIfReady(); - } - break; - - case 1: - { - if (GravityLapseTimer <= diff) - { - switch(GravityLapsePhase) - { - case 0: - if (FirstGravityLapse) // Different yells at 50%, and at every following Gravity Lapse - { - DoScriptText(SAY_GRAVITY_LAPSE, me); - FirstGravityLapse = false; - - if (pInstance) - { - pInstance->HandleGameObject(pInstance->GetData64(DATA_KAEL_STATUE_LEFT), true); - pInstance->HandleGameObject(pInstance->GetData64(DATA_KAEL_STATUE_RIGHT), true); - } - }else - { - DoScriptText(SAY_RECAST_GRAVITY, me); - } - - DoCast(me, SPELL_GRAVITY_LAPSE_INITIAL); - GravityLapseTimer = 2000 + diff;// Don't interrupt the visual spell - GravityLapsePhase = 1; - break; - - case 1: - TeleportPlayersToSelf(); - GravityLapseTimer = 1000; - GravityLapsePhase = 2; - break; - - case 2: - CastGravityLapseKnockUp(); - GravityLapseTimer = 1000; - GravityLapsePhase = 3; - break; - - case 3: - CastGravityLapseFly(); - GravityLapseTimer = 30000; - GravityLapsePhase = 4; - - for (uint8 i = 0; i < 3; ++i) - { - Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); - - Creature* Orb = DoSpawnCreature(CREATURE_ARCANE_SPHERE, 5, 5, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000); - if (Orb && pTarget) - { - Orb->SetSpeed(MOVE_RUN, 0.5f); - Orb->AddThreat(pTarget, 1000000.0f); - Orb->AI()->AttackStart(pTarget); - } - - } - - DoCast(me, SPELL_GRAVITY_LAPSE_CHANNEL); - break; - - case 4: - me->InterruptNonMeleeSpells(false); - DoScriptText(SAY_TIRED, me); - DoCast(me, SPELL_POWER_FEEDBACK); - RemoveGravityLapse(); - GravityLapseTimer = 10000; - GravityLapsePhase = 0; - break; - } - } else GravityLapseTimer -= diff; - } - break; - } - } -}; - -struct mob_felkael_flamestrikeAI : public ScriptedAI -{ - mob_felkael_flamestrikeAI(Creature *c) : ScriptedAI(c) - { - } - - uint32 FlameStrikeTimer; - - void Reset() - { - FlameStrikeTimer = 5000; - - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->setFaction(14); - - DoCast(me, SPELL_FLAMESTRIKE2, true); - } - - void EnterCombat(Unit * /*who*/) {} - void MoveInLineOfSight(Unit * /*who*/) {} - void UpdateAI(const uint32 diff) - { - if (FlameStrikeTimer <= diff) - { - DoCast(me, SPELL_FLAMESTRIKE1_NORMAL, true); - me->Kill(me); - } else FlameStrikeTimer -= diff; - } -}; - -struct mob_felkael_phoenixAI : public ScriptedAI -{ - mob_felkael_phoenixAI(Creature* c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - uint32 BurnTimer; - uint32 Death_Timer; - bool Rebirth; - bool FakeDeath; - - void Reset() - { - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE); - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - DoCast(me, SPELL_PHOENIX_BURN, true); - BurnTimer = 2000; - Death_Timer = 3000; - Rebirth = false; - FakeDeath = false; - } - - void EnterCombat(Unit* /*who*/) {} - - void DamageTaken(Unit* /*pKiller*/, uint32 &damage) - { - if (damage < me->GetHealth()) - return; - - //Prevent glitch if in fake death - if (FakeDeath) - { - damage = 0; - return; - - } - //Don't really die in all phases of Kael'Thas - if (pInstance && pInstance->GetData(DATA_KAELTHAS_EVENT) == 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); - - } - - } - - void JustDied(Unit* /*slayer*/) - { - me->SummonCreature(CREATURE_PHOENIX_EGG, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000); - } - - void UpdateAI(const uint32 diff) - { - - //If we are fake death, we cast revbirth and after that we kill the phoenix to spawn the egg. - if (FakeDeath) - { - if (!Rebirth) - { - DoCast(me, SPELL_REBIRTH_DMG); - Rebirth = true; - } - - if (Rebirth) - { - - if (Death_Timer <= diff) - { - me->SummonCreature(CREATURE_PHOENIX_EGG, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000); - me->DisappearAndDie(); - Rebirth = false; - } else Death_Timer -= diff; - } - - } - - if (!UpdateVictim()) - return; - - if (BurnTimer <= diff) - { - //spell Burn should possible do this, but it doesn't, so do this for now. - uint16 dmg = urand(1650,2050); - me->DealDamage(me, dmg, 0, DOT, SPELL_SCHOOL_MASK_FIRE, NULL, false); - BurnTimer += 2000; - } BurnTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -struct mob_felkael_phoenix_eggAI : public ScriptedAI -{ - mob_felkael_phoenix_eggAI(Creature *c) : ScriptedAI(c) {} - - uint32 HatchTimer; - - void Reset() - { - HatchTimer = 10000; - } - - void EnterCombat(Unit* /*who*/) {} - void MoveInLineOfSight(Unit* /*who*/) {} - - void UpdateAI(const uint32 diff) - { - if (HatchTimer <= diff) - { - me->SummonCreature(CREATURE_PHOENIX, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000); - me->Kill(me); - } else HatchTimer -= diff; - - } -}; - -struct mob_arcane_sphereAI : public ScriptedAI -{ - mob_arcane_sphereAI(Creature *c) : ScriptedAI(c) { Reset(); } - - uint32 DespawnTimer; - uint32 ChangeTargetTimer; - - void Reset() - { - DespawnTimer = 30000; - ChangeTargetTimer = urand(6000,12000); - - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - me->setFaction(14); - DoCast(me, SPELL_ARCANE_SPHERE_PASSIVE, true); - } - - void EnterCombat(Unit* /*who*/) {} - - void UpdateAI(const uint32 diff) - { - if (DespawnTimer <= diff) - me->Kill(me); - else - DespawnTimer -= diff; - - //Return since we have no target - if (!UpdateVictim()) - return; - - if (ChangeTargetTimer <= diff) - { - if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) - { - me->AddThreat(pTarget, 1.0f); - me->TauntApply(pTarget); - AttackStart(pTarget); - } - - ChangeTargetTimer = urand(5000,15000); - } else ChangeTargetTimer -= diff; - } -}; - -CreatureAI* GetAI_boss_felblood_kaelthas(Creature* c) -{ - return new boss_felblood_kaelthasAI(c); -} - -CreatureAI* GetAI_mob_arcane_sphere(Creature* c) -{ - return new mob_arcane_sphereAI(c); -} - -CreatureAI* GetAI_mob_felkael_phoenix(Creature* c) -{ - return new mob_felkael_phoenixAI(c); -} - -CreatureAI* GetAI_mob_felkael_phoenix_egg(Creature* c) -{ - return new mob_felkael_phoenix_eggAI(c); -} - -CreatureAI* GetAI_mob_felkael_flamestrike(Creature* c) -{ - return new mob_felkael_flamestrikeAI(c); -} - -void AddSC_boss_felblood_kaelthas() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "boss_felblood_kaelthas"; - newscript->GetAI = &GetAI_boss_felblood_kaelthas; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_arcane_sphere"; - newscript->GetAI = &GetAI_mob_arcane_sphere; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_felkael_phoenix"; - newscript->GetAI = &GetAI_mob_felkael_phoenix; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_felkael_phoenix_egg"; - newscript->GetAI = &GetAI_mob_felkael_phoenix_egg; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_felkael_flamestrike"; - newscript->GetAI = &GetAI_mob_felkael_flamestrike; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/magisters_terrace/boss_priestess_delrissa.cpp b/src/server/scripts/EasternKingdoms/magisters_terrace/boss_priestess_delrissa.cpp deleted file mode 100644 index 2112eaabc87..00000000000 --- a/src/server/scripts/EasternKingdoms/magisters_terrace/boss_priestess_delrissa.cpp +++ /dev/null @@ -1,1321 +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_Priestess_Delrissa -SD%Complete: 65 -SDComment: No Heroic support yet. Needs further testing. Several scripts for pets disabled, not seem to require any special script. -SDCategory: Magister's Terrace -EndScriptData */ - -#include "ScriptedPch.h" -#include "magisters_terrace.h" - -struct Speech -{ - int32 id; -}; - -static Speech LackeyDeath[]= -{ - {-1585013}, - {-1585014}, - {-1585015}, - {-1585016}, -}; - -static Speech PlayerDeath[]= -{ - {-1585017}, - {-1585018}, - {-1585019}, - {-1585020}, - {-1585021}, -}; - -enum eEnums -{ - SAY_AGGRO = -1585012, - SAY_DEATH = -1585022, - - SPELL_DISPEL_MAGIC = 27609, - SPELL_FLASH_HEAL = 17843, - SPELL_SW_PAIN_NORMAL = 14032, - SPELL_SW_PAIN_HEROIC = 15654, - SPELL_SHIELD = 44291, - SPELL_RENEW_NORMAL = 44174, - SPELL_RENEW_HEROIC = 46192, - - MAX_ACTIVE_LACKEY = 4 -}; - -const float fOrientation = 4.98; -const float fZLocation = -19.921; - -float LackeyLocations[4][2]= -{ - {123.77, 17.6007}, - {131.731, 15.0827}, - {121.563, 15.6213}, - {129.988, 17.2355}, -}; - -const uint32 m_auiAddEntries[] = -{ - 24557, //Kagani Nightstrike - 24558, //Elris Duskhallow - 24554, //Eramas Brightblaze - 24561, //Yazzaj - 24559, //Warlord Salaris - 24555, //Garaxxas - 24553, //Apoko - 24556, //Zelfan -}; - -struct boss_priestess_delrissaAI : public ScriptedAI -{ - boss_priestess_delrissaAI(Creature* c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - memset(&m_auiLackeyGUID, 0, sizeof(m_auiLackeyGUID)); - LackeyEntryList.clear(); - } - - ScriptedInstance* pInstance; - - std::vector LackeyEntryList; - uint64 m_auiLackeyGUID[MAX_ACTIVE_LACKEY]; - - uint8 PlayersKilled; - - uint32 HealTimer; - uint32 RenewTimer; - uint32 ShieldTimer; - uint32 SWPainTimer; - uint32 DispelTimer; - uint32 ResetTimer; - - void Reset() - { - PlayersKilled = 0; - - HealTimer = 15000; - RenewTimer = 10000; - ShieldTimer = 2000; - SWPainTimer = 5000; - DispelTimer = 7500; - ResetTimer = 5000; - - InitializeLackeys(); - } - - //this mean she at some point evaded - void JustReachedHome() - { - if (pInstance) - pInstance->SetData(DATA_DELRISSA_EVENT, FAIL); - } - - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, me); - - for (uint8 i = 0; i < MAX_ACTIVE_LACKEY; ++i) - { - if (Unit* pAdd = Unit::GetUnit(*me, m_auiLackeyGUID[i])) - { - if (!pAdd->getVictim()) - { - who->SetInCombatWith(pAdd); - pAdd->AddThreat(who, 0.0f); - } - } - } - - if (pInstance) - pInstance->SetData(DATA_DELRISSA_EVENT, IN_PROGRESS); - } - - void InitializeLackeys() - { - //can be called if Creature are dead, so avoid - if (!me->isAlive()) - return; - - uint8 j = 0; - - //it's empty, so first time - if (LackeyEntryList.empty()) - { - //pre-allocate size for speed - LackeyEntryList.resize((sizeof(m_auiAddEntries) / sizeof(uint32))); - - //fill vector array with entries from Creature array - for (uint8 i = 0; i < LackeyEntryList.size(); ++i) - LackeyEntryList[i] = m_auiAddEntries[i]; - - //remove random entries - while (LackeyEntryList.size() > MAX_ACTIVE_LACKEY) - LackeyEntryList.erase(LackeyEntryList.begin() + rand()%LackeyEntryList.size()); - - //summon all the remaining in vector - for (std::vector::const_iterator itr = LackeyEntryList.begin(); itr != LackeyEntryList.end(); ++itr) - { - if (Creature* pAdd = me->SummonCreature((*itr), LackeyLocations[j][0], LackeyLocations[j][1], fZLocation, fOrientation, TEMPSUMMON_CORPSE_DESPAWN, 0)) - m_auiLackeyGUID[j] = pAdd->GetGUID(); - - ++j; - } - } - else - { - for (std::vector::const_iterator itr = LackeyEntryList.begin(); itr != LackeyEntryList.end(); ++itr) - { - Unit* pAdd = Unit::GetUnit(*me, m_auiLackeyGUID[j]); - - //object already removed, not exist - if (!pAdd) - { - if (Creature* pAdd = me->SummonCreature((*itr), LackeyLocations[j][0], LackeyLocations[j][1], fZLocation, fOrientation, TEMPSUMMON_CORPSE_DESPAWN, 0)) - m_auiLackeyGUID[j] = pAdd->GetGUID(); - } - ++j; - } - } - } - - void KilledUnit(Unit* victim) - { - if (victim->GetTypeId() != TYPEID_PLAYER) - return; - - DoScriptText(PlayerDeath[PlayersKilled].id, me); - - if (PlayersKilled < 4) - ++PlayersKilled; - } - - void JustDied(Unit* /*killer*/) - { - DoScriptText(SAY_DEATH, me); - - if (!pInstance) - return; - - if (pInstance->GetData(DATA_DELRISSA_DEATH_COUNT) == MAX_ACTIVE_LACKEY) - pInstance->SetData(DATA_DELRISSA_EVENT, DONE); - else - { - if (me->HasFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE)) - me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (ResetTimer <= diff) - { - float x, y, z, o; - me->GetHomePosition(x, y, z, o); - if (me->GetPositionZ() >= z+10) - { - EnterEvadeMode(); - return; - } - ResetTimer = 5000; - } else ResetTimer -= diff; - - if (HealTimer <= diff) - { - uint32 health = me->GetHealth(); - Unit *pTarget = me; - for (uint8 i = 0; i < MAX_ACTIVE_LACKEY; ++i) - { - if (Unit* pAdd = Unit::GetUnit(*me, m_auiLackeyGUID[i])) - { - if (pAdd->isAlive() && pAdd->GetHealth() < health) - pTarget = pAdd; - } - } - - DoCast(pTarget, SPELL_FLASH_HEAL); - HealTimer = 15000; - } else HealTimer -= diff; - - if (RenewTimer <= diff) - { - Unit *pTarget = me; - - if (urand(0,1)) - if (Unit* pAdd = Unit::GetUnit(*me, m_auiLackeyGUID[rand()%MAX_ACTIVE_LACKEY])) - if (pAdd->isAlive()) - pTarget = pAdd; - - DoCast(pTarget, SPELL_RENEW_NORMAL); - RenewTimer = 5000; - } else RenewTimer -= diff; - - if (ShieldTimer <= diff) - { - Unit *pTarget = me; - - if (urand(0,1)) - if (Unit* pAdd = Unit::GetUnit(*me, m_auiLackeyGUID[rand()%MAX_ACTIVE_LACKEY])) - if (pAdd->isAlive() && !pAdd->HasAura(SPELL_SHIELD)) - pTarget = pAdd; - - DoCast(pTarget, SPELL_SHIELD); - ShieldTimer = 7500; - } else ShieldTimer -= diff; - - if (DispelTimer <= diff) - { - Unit *pTarget = NULL; - bool friendly = false; - - if (urand(0,1)) - pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); - else - { - friendly = true; - - if (urand(0,1)) - pTarget = me; - else - if (Unit* pAdd = Unit::GetUnit(*me, m_auiLackeyGUID[rand()%MAX_ACTIVE_LACKEY])) - if (pAdd->isAlive()) - pTarget = pAdd; - } - - if (pTarget) - DoCast(pTarget, SPELL_DISPEL_MAGIC); - - DispelTimer = 12000; - } else DispelTimer -= diff; - - if (SWPainTimer <= diff) - { - if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) - DoCast(pTarget, SPELL_SW_PAIN_NORMAL); - - SWPainTimer = 10000; - } else SWPainTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_priestess_delrissa(Creature* pCreature) -{ - return new boss_priestess_delrissaAI(pCreature); -} - -enum eHealingPotion -{ - SPELL_HEALING_POTION = 15503 -}; - -//all 8 possible lackey use this common -struct boss_priestess_lackey_commonAI : public ScriptedAI -{ - boss_priestess_lackey_commonAI(Creature* c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - memset(&m_auiLackeyGUIDs, 0, sizeof(m_auiLackeyGUIDs)); - AcquireGUIDs(); - } - - ScriptedInstance* pInstance; - - uint64 m_auiLackeyGUIDs[MAX_ACTIVE_LACKEY]; - uint32 ResetThreatTimer; - - bool UsedPotion; - - void Reset() - { - UsedPotion = false; - - // These guys does not follow normal threat system rules - // For later development, some alternative threat system should be made - // We do not know what this system is based upon, but one theory is class (healers=high threat, dps=medium, etc) - // We reset their threat frequently as an alternative until such a system exist - ResetThreatTimer = urand(5000,20000); - - // in case she is not alive and Reset was for some reason called, respawn her (most likely party wipe after killing her) - if (Creature* pDelrissa = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_DELRISSA) : 0)) - { - if (!pDelrissa->isAlive()) - pDelrissa->Respawn(); - } - } - - void EnterCombat(Unit* pWho) - { - if (!pWho) - return; - - if (pInstance) - { - for (uint8 i = 0; i < MAX_ACTIVE_LACKEY; ++i) - { - if (Unit* pAdd = Unit::GetUnit(*me, m_auiLackeyGUIDs[i])) - { - if (!pAdd->getVictim() && pAdd != me) - { - pWho->SetInCombatWith(pAdd); - pAdd->AddThreat(pWho, 0.0f); - } - } - } - - if (Creature* pDelrissa = Unit::GetCreature(*me, pInstance->GetData64(DATA_DELRISSA))) - { - if (pDelrissa->isAlive() && !pDelrissa->getVictim()) - { - pWho->SetInCombatWith(pDelrissa); - pDelrissa->AddThreat(pWho, 0.0f); - } - } - } - } - - void JustDied(Unit* /*killer*/) - { - if (!pInstance) - return; - - Creature* pDelrissa = Unit::GetCreature(*me, pInstance->GetData64(DATA_DELRISSA)); - uint32 uiLackeyDeathCount = pInstance->GetData(DATA_DELRISSA_DEATH_COUNT); - - if (!pDelrissa) - return; - - //should delrissa really yell if dead? - DoScriptText(LackeyDeath[uiLackeyDeathCount].id, pDelrissa); - - pInstance->SetData(DATA_DELRISSA_DEATH_COUNT, SPECIAL); - - //increase local var, since we now may have four dead - ++uiLackeyDeathCount; - - if (uiLackeyDeathCount == MAX_ACTIVE_LACKEY) - { - //time to make her lootable and complete event if she died before lackeys - if (!pDelrissa->isAlive()) - { - if (!pDelrissa->HasFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE)) - pDelrissa->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); - - pInstance->SetData(DATA_DELRISSA_EVENT, DONE); - } - } - } - - void KilledUnit(Unit* victim) - { - if (!pInstance) - return; - - if (Creature* Delrissa = Unit::GetCreature(*me, pInstance->GetData64(DATA_DELRISSA))) - Delrissa->AI()->KilledUnit(victim); - } - - void AcquireGUIDs() - { - if (!pInstance) - return; - - if (Creature* Delrissa = (Unit::GetCreature(*me, pInstance->GetData64(DATA_DELRISSA)))) - { - for (uint8 i = 0; i < MAX_ACTIVE_LACKEY; ++i) - m_auiLackeyGUIDs[i] = CAST_AI(boss_priestess_delrissaAI, Delrissa->AI())->m_auiLackeyGUID[i]; - } - } - - void UpdateAI(const uint32 diff) - { - if (!UsedPotion && (me->GetHealth()*100 / me->GetMaxHealth()) < 25) - { - DoCast(me, SPELL_HEALING_POTION); - UsedPotion = true; - } - - if (ResetThreatTimer <= diff) - { - DoResetThreat(); - ResetThreatTimer = 5000 + rand()%15000; - } else ResetThreatTimer -= diff; - } -}; - -enum eRogueSpells -{ - SPELL_KIDNEY_SHOT = 27615, - SPELL_GOUGE = 12540, - SPELL_KICK = 27613, - SPELL_VANISH = 44290, - SPELL_BACKSTAB = 15657, - SPELL_EVISCERATE = 27611 -}; - -struct boss_kagani_nightstrikeAI : public boss_priestess_lackey_commonAI -{ - //Rogue - boss_kagani_nightstrikeAI(Creature *c) : boss_priestess_lackey_commonAI(c) {} - - uint32 Gouge_Timer; - uint32 Kick_Timer; - uint32 Vanish_Timer; - uint32 Eviscerate_Timer; - uint32 Wait_Timer; - bool InVanish; - - void Reset() - { - Gouge_Timer = 5500; - Kick_Timer = 7000; - Vanish_Timer = 2000; - Eviscerate_Timer = 6000; - Wait_Timer = 5000; - InVanish = false; - me->SetVisibility(VISIBILITY_ON); - - boss_priestess_lackey_commonAI::Reset(); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - boss_priestess_lackey_commonAI::UpdateAI(diff); - - if (Vanish_Timer <= diff) - { - DoCast(me, SPELL_VANISH); - - Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 0); - - DoResetThreat(); - - if (pUnit) - me->AddThreat(pUnit, 1000.0f); - - InVanish = true; - Vanish_Timer = 30000; - Wait_Timer = 10000; - } else Vanish_Timer -= diff; - - if (InVanish) - { - if (Wait_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_BACKSTAB, true); - DoCast(me->getVictim(), SPELL_KIDNEY_SHOT, true); - me->SetVisibility(VISIBILITY_ON); // ...? Hacklike - InVanish = false; - } else Wait_Timer -= diff; - } - - if (Gouge_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_GOUGE); - Gouge_Timer = 5500; - } else Gouge_Timer -= diff; - - if (Kick_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_KICK); - Kick_Timer = 7000; - } else Kick_Timer -= diff; - - if (Eviscerate_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_EVISCERATE); - Eviscerate_Timer = 4000; - } else Eviscerate_Timer -= diff; - - if (!InVanish) - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_kagani_nightstrike(Creature* pCreature) -{ - return new boss_kagani_nightstrikeAI(pCreature); -} - -enum eWarlockSpells -{ - SPELL_IMMOLATE = 44267, - SPELL_SHADOW_BOLT = 12471, - SPELL_SEED_OF_CORRUPTION = 44141, - SPELL_CURSE_OF_AGONY = 14875, - SPELL_FEAR = 38595, - SPELL_IMP_FIREBALL = 44164, - SPELL_SUMMON_IMP = 44163 -}; - -struct boss_ellris_duskhallowAI : public boss_priestess_lackey_commonAI -{ - //Warlock - boss_ellris_duskhallowAI(Creature *c) : boss_priestess_lackey_commonAI(c) {} - - uint32 Immolate_Timer; - uint32 Shadow_Bolt_Timer; - uint32 Seed_of_Corruption_Timer; - uint32 Curse_of_Agony_Timer; - uint32 Fear_Timer; - - void Reset() - { - Immolate_Timer = 6000; - Shadow_Bolt_Timer = 3000; - Seed_of_Corruption_Timer = 2000; - Curse_of_Agony_Timer = 1000; - Fear_Timer = 10000; - - boss_priestess_lackey_commonAI::Reset(); - } - - void Aggro(Unit* /*pWho*/) - { - DoCast(me, SPELL_SUMMON_IMP); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - boss_priestess_lackey_commonAI::UpdateAI(diff); - - if (Immolate_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_IMMOLATE); - Immolate_Timer = 6000; - } else Immolate_Timer -= diff; - - if (Shadow_Bolt_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SHADOW_BOLT); - Shadow_Bolt_Timer = 5000; - } else Shadow_Bolt_Timer -= diff; - - if (Seed_of_Corruption_Timer <= diff) - { - if (Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(pUnit, SPELL_SEED_OF_CORRUPTION); - - Seed_of_Corruption_Timer = 10000; - } else Seed_of_Corruption_Timer -= diff; - - if (Curse_of_Agony_Timer <= diff) - { - if (Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(pUnit, SPELL_CURSE_OF_AGONY); - - Curse_of_Agony_Timer = 13000; - } else Curse_of_Agony_Timer -= diff; - - if (Fear_Timer <= diff) - { - if (Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(pUnit, SPELL_FEAR); - - Fear_Timer = 10000; - } else Fear_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_ellris_duskhallow(Creature* pCreature) -{ - return new boss_ellris_duskhallowAI(pCreature); -} - -enum eKickDown -{ - SPELL_KNOCKDOWN = 11428, - SPELL_SNAP_KICK = 46182 -}; - -struct boss_eramas_brightblazeAI : public boss_priestess_lackey_commonAI -{ - //Monk - boss_eramas_brightblazeAI(Creature *c) : boss_priestess_lackey_commonAI(c) {} - - uint32 Knockdown_Timer; - uint32 Snap_Kick_Timer; - - void Reset() - { - Knockdown_Timer = 6000; - Snap_Kick_Timer = 4500; - - boss_priestess_lackey_commonAI::Reset(); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - boss_priestess_lackey_commonAI::UpdateAI(diff); - - if (Knockdown_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_KNOCKDOWN); - Knockdown_Timer = 6000; - } else Knockdown_Timer -= diff; - - if (Snap_Kick_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SNAP_KICK); - Snap_Kick_Timer = 4500; - } else Snap_Kick_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_eramas_brightblaze(Creature* pCreature) -{ - return new boss_eramas_brightblazeAI(pCreature); -} - -enum eMageSpells -{ - SPELL_POLYMORPH = 13323, - SPELL_ICE_BLOCK = 27619, - SPELL_BLIZZARD = 44178, - SPELL_ICE_LANCE = 46194, - SPELL_CONE_OF_COLD = 38384, - SPELL_FROSTBOLT = 15043, - SPELL_BLINK = 14514 -}; - -struct boss_yazzaiAI : public boss_priestess_lackey_commonAI -{ - //Mage - boss_yazzaiAI(Creature *c) : boss_priestess_lackey_commonAI(c) {} - - bool HasIceBlocked; - - uint32 Polymorph_Timer; - uint32 Ice_Block_Timer; - uint32 Wait_Timer; - uint32 Blizzard_Timer; - uint32 Ice_Lance_Timer; - uint32 Cone_of_Cold_Timer; - uint32 Frostbolt_Timer; - uint32 Blink_Timer; - - void Reset() - { - HasIceBlocked = false; - - Polymorph_Timer = 1000; - Ice_Block_Timer = 20000; - Wait_Timer = 10000; - Blizzard_Timer = 8000; - Ice_Lance_Timer = 12000; - Cone_of_Cold_Timer = 10000; - Frostbolt_Timer = 3000; - Blink_Timer = 8000; - - boss_priestess_lackey_commonAI::Reset(); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - boss_priestess_lackey_commonAI::UpdateAI(diff); - - if (Polymorph_Timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - DoCast(pTarget, SPELL_POLYMORPH); - Polymorph_Timer = 20000; - } - } else Polymorph_Timer -= diff; - - if (((me->GetHealth()*100 / me->GetMaxHealth()) < 35) && !HasIceBlocked) - { - DoCast(me, SPELL_ICE_BLOCK); - HasIceBlocked = true; - } - - if (Blizzard_Timer <= diff) - { - if (Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(pUnit, SPELL_BLIZZARD); - - Blizzard_Timer = 8000; - } else Blizzard_Timer -= diff; - - if (Ice_Lance_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_ICE_LANCE); - Ice_Lance_Timer = 12000; - } else Ice_Lance_Timer -= diff; - - if (Cone_of_Cold_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_CONE_OF_COLD); - Cone_of_Cold_Timer = 10000; - } else Cone_of_Cold_Timer -= diff; - - if (Frostbolt_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_FROSTBOLT); - Frostbolt_Timer = 8000; - } else Frostbolt_Timer -= diff; - - if (Blink_Timer <= diff) - { - bool InMeleeRange = false; - std::list& t_list = me->getThreatManager().getThreatList(); - for (std::list::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) - { - if (Unit *pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid())) - { - //if in melee range - if (pTarget->IsWithinDistInMap(me, 5)) - { - InMeleeRange = true; - break; - } - } - } - - //if anybody is in melee range than escape by blink - if (InMeleeRange) - DoCast(me, SPELL_BLINK); - - Blink_Timer = 8000; - } else Blink_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_yazzai(Creature* pCreature) -{ - return new boss_yazzaiAI(pCreature); -} - -enum eWarriorSpells -{ - SPELL_INTERCEPT_STUN = 27577, - SPELL_DISARM = 27581, - SPELL_PIERCING_HOWL = 23600, - SPELL_FRIGHTENING_SHOUT = 19134, - SPELL_HAMSTRING = 27584, - SPELL_BATTLE_SHOUT = 27578, - SPELL_MORTAL_STRIKE = 44268 -}; - -struct boss_warlord_salarisAI : public boss_priestess_lackey_commonAI -{ - //Warrior - boss_warlord_salarisAI(Creature *c) : boss_priestess_lackey_commonAI(c) {} - - uint32 Intercept_Stun_Timer; - uint32 Disarm_Timer; - uint32 Piercing_Howl_Timer; - uint32 Frightening_Shout_Timer; - uint32 Hamstring_Timer; - uint32 Mortal_Strike_Timer; - - void Reset() - { - Intercept_Stun_Timer = 500; - Disarm_Timer = 6000; - Piercing_Howl_Timer = 10000; - Frightening_Shout_Timer = 18000; - Hamstring_Timer = 4500; - Mortal_Strike_Timer = 8000; - - boss_priestess_lackey_commonAI::Reset(); - } - - void EnterCombat(Unit* /*who*/) - { - DoCast(me, SPELL_BATTLE_SHOUT); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - boss_priestess_lackey_commonAI::UpdateAI(diff); - - if (Intercept_Stun_Timer <= diff) - { - bool InMeleeRange = false; - std::list& t_list = me->getThreatManager().getThreatList(); - for (std::list::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) - { - if (Unit *pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid())) - { - //if in melee range - if (pTarget->IsWithinDistInMap(me, ATTACK_DISTANCE)) - { - InMeleeRange = true; - break; - } - } - } - - //if nobody is in melee range than try to use Intercept - if (!InMeleeRange) - { - if (Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(pUnit, SPELL_INTERCEPT_STUN); - } - - Intercept_Stun_Timer = 10000; - } else Intercept_Stun_Timer -= diff; - - if (Disarm_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_DISARM); - Disarm_Timer = 6000; - } else Disarm_Timer -= diff; - - if (Hamstring_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_HAMSTRING); - Hamstring_Timer = 4500; - } else Hamstring_Timer -= diff; - - if (Mortal_Strike_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_MORTAL_STRIKE); - Mortal_Strike_Timer = 4500; - } else Mortal_Strike_Timer -= diff; - - if (Piercing_Howl_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_PIERCING_HOWL); - Piercing_Howl_Timer = 10000; - } else Piercing_Howl_Timer -= diff; - - if (Frightening_Shout_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_FRIGHTENING_SHOUT); - Frightening_Shout_Timer = 18000; - } else Frightening_Shout_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_warlord_salaris(Creature* pCreature) -{ - return new boss_warlord_salarisAI(pCreature); -} - -enum eHunterSpells -{ - SPELL_AIMED_SHOT = 44271, - SPELL_SHOOT = 15620, - SPELL_CONCUSSIVE_SHOT = 27634, - SPELL_MULTI_SHOT = 31942, - SPELL_WING_CLIP = 44286, - SPELL_FREEZING_TRAP = 44136, - - NPC_SLIVER = 24552 -}; - -struct boss_garaxxasAI : public boss_priestess_lackey_commonAI -{ - //Hunter - boss_garaxxasAI(Creature *c) : boss_priestess_lackey_commonAI(c) { m_uiPetGUID = 0; } - - uint64 m_uiPetGUID; - - uint32 Aimed_Shot_Timer; - uint32 Shoot_Timer; - uint32 Concussive_Shot_Timer; - uint32 Multi_Shot_Timer; - uint32 Wing_Clip_Timer; - uint32 Freezing_Trap_Timer; - - void Reset() - { - Aimed_Shot_Timer = 6000; - Shoot_Timer = 2500; - Concussive_Shot_Timer = 8000; - Multi_Shot_Timer = 10000; - Wing_Clip_Timer = 4000; - Freezing_Trap_Timer = 15000; - - Unit* pPet = Unit::GetUnit(*me,m_uiPetGUID); - if (!pPet) - me->SummonCreature(NPC_SLIVER, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0); - - boss_priestess_lackey_commonAI::Reset(); - } - - void JustSummoned(Creature* pSummoned) - { - m_uiPetGUID = pSummoned->GetGUID(); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - boss_priestess_lackey_commonAI::UpdateAI(diff); - - if (me->IsWithinDistInMap(me->getVictim(), ATTACK_DISTANCE)) - { - if (Wing_Clip_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_WING_CLIP); - Wing_Clip_Timer = 4000; - } else Wing_Clip_Timer -= diff; - - if (Freezing_Trap_Timer <= diff) - { - //attempt find go summoned from spell (casted by me) - GameObject* pGo = me->GetGameObject(SPELL_FREEZING_TRAP); - - //if we have a pGo, we need to wait (only one trap at a time) - if (pGo) - Freezing_Trap_Timer = 2500; - else - { - //if pGo does not exist, then we can cast - DoCast(me->getVictim(), SPELL_FREEZING_TRAP); - Freezing_Trap_Timer = 15000; - } - } else Freezing_Trap_Timer -= diff; - - DoMeleeAttackIfReady(); - } - else - { - if (Concussive_Shot_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_CONCUSSIVE_SHOT); - Concussive_Shot_Timer = 8000; - } else Concussive_Shot_Timer -= diff; - - if (Multi_Shot_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_MULTI_SHOT); - Multi_Shot_Timer = 10000; - } else Multi_Shot_Timer -= diff; - - if (Aimed_Shot_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_AIMED_SHOT); - Aimed_Shot_Timer = 6000; - } else Aimed_Shot_Timer -= diff; - - if (Shoot_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SHOOT); - Shoot_Timer = 2500; - } else Shoot_Timer -= diff; - } - } -}; - -CreatureAI* GetAI_garaxxas(Creature* pCreature) -{ - return new boss_garaxxasAI(pCreature); -} - -enum Spells -{ - SPELL_WINDFURY_TOTEM = 27621, - SPELL_WAR_STOMP = 46026, - SPELL_PURGE = 27626, - SPELL_LESSER_HEALING_WAVE = 44256, - SPELL_FROST_SHOCK = 21401, - SPELL_FIRE_NOVA_TOTEM = 44257, - SPELL_EARTHBIND_TOTEM = 15786 -}; - -struct boss_apokoAI : public boss_priestess_lackey_commonAI -{ - //Shaman - boss_apokoAI(Creature *c) : boss_priestess_lackey_commonAI(c) {} - - uint32 Totem_Timer; - uint8 Totem_Amount; - uint32 War_Stomp_Timer; - uint32 Purge_Timer; - uint32 Healing_Wave_Timer; - uint32 Frost_Shock_Timer; - - void Reset() - { - Totem_Timer = 2000; - Totem_Amount = 1; - War_Stomp_Timer = 10000; - Purge_Timer = 8000; - Healing_Wave_Timer = 5000; - Frost_Shock_Timer = 7000; - - boss_priestess_lackey_commonAI::Reset(); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - boss_priestess_lackey_commonAI::UpdateAI(diff); - - if (Totem_Timer <= diff) - { - DoCast(me, RAND(SPELL_WINDFURY_TOTEM,SPELL_FIRE_NOVA_TOTEM,SPELL_EARTHBIND_TOTEM)); - ++Totem_Amount; - Totem_Timer = Totem_Amount*2000; - } else Totem_Timer -= diff; - - if (War_Stomp_Timer <= diff) - { - DoCast(me, SPELL_WAR_STOMP); - War_Stomp_Timer = 10000; - } else War_Stomp_Timer -= diff; - - if (Purge_Timer <= diff) - { - if (Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(pUnit, SPELL_PURGE); - - Purge_Timer = 15000; - } else Purge_Timer -= diff; - - if (Frost_Shock_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_FROST_SHOCK); - Frost_Shock_Timer = 7000; - } else Frost_Shock_Timer -= diff; - - if (Healing_Wave_Timer <= diff) - { - // std::vector::const_iterator itr = Group.begin() + rand()%Group.size(); - // uint64 guid = (*itr)->guid; - // if (guid) - // { - // Unit* pAdd = Unit::GetUnit(*me, (*itr)->guid); - // if (pAdd && pAdd->isAlive()) - // { - DoCast(me, SPELL_LESSER_HEALING_WAVE); - Healing_Wave_Timer = 5000; - // } - // } - } else Healing_Wave_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_apoko(Creature* pCreature) -{ - return new boss_apokoAI(pCreature); -} - -enum eEngineerSpells -{ - SPELL_GOBLIN_DRAGON_GUN = 44272, - SPELL_ROCKET_LAUNCH = 44137, - SPELL_RECOMBOBULATE = 44274, - SPELL_HIGH_EXPLOSIVE_SHEEP = 44276, - SPELL_FEL_IRON_BOMB = 46024, - SPELL_SHEEP_EXPLOSION = 44279 -}; - -struct boss_zelfanAI : public boss_priestess_lackey_commonAI -{ - //Engineer - boss_zelfanAI(Creature *c) : boss_priestess_lackey_commonAI(c) {} - - uint32 Goblin_Dragon_Gun_Timer; - uint32 Rocket_Launch_Timer; - uint32 Recombobulate_Timer; - uint32 High_Explosive_Sheep_Timer; - uint32 Fel_Iron_Bomb_Timer; - - void Reset() - { - Goblin_Dragon_Gun_Timer = 20000; - Rocket_Launch_Timer = 7000; - Recombobulate_Timer = 4000; - High_Explosive_Sheep_Timer = 10000; - Fel_Iron_Bomb_Timer = 15000; - - boss_priestess_lackey_commonAI::Reset(); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - boss_priestess_lackey_commonAI::UpdateAI(diff); - - if (Goblin_Dragon_Gun_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_GOBLIN_DRAGON_GUN); - Goblin_Dragon_Gun_Timer = 10000; - } else Goblin_Dragon_Gun_Timer -= diff; - - if (Rocket_Launch_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_ROCKET_LAUNCH); - Rocket_Launch_Timer = 9000; - } else Rocket_Launch_Timer -= diff; - - if (Fel_Iron_Bomb_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_FEL_IRON_BOMB); - Fel_Iron_Bomb_Timer = 15000; - } else Fel_Iron_Bomb_Timer -= diff; - - if (Recombobulate_Timer <= diff) - { - for (uint8 i = 0; i < MAX_ACTIVE_LACKEY; ++i) - { - if (Unit* pAdd = Unit::GetUnit(*me, m_auiLackeyGUIDs[i])) - { - if (pAdd->IsPolymorphed()) - { - DoCast(pAdd, SPELL_RECOMBOBULATE); - break; - } - } - } - Recombobulate_Timer = 2000; - } else Recombobulate_Timer -= diff; - - if (High_Explosive_Sheep_Timer <= diff) - { - DoCast(me, SPELL_HIGH_EXPLOSIVE_SHEEP); - High_Explosive_Sheep_Timer = 65000; - } else High_Explosive_Sheep_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_zelfan(Creature* pCreature) -{ - return new boss_zelfanAI(pCreature); -} - -//struct mob_high_explosive_sheepAI : public ScriptedAI -//{ -// mob_high_explosive_sheepAI(Creature *c) : ScriptedAI(c) {} -// -// uint32 Explosion_Timer; -// -// void Reset() -// { -// Explosion_Timer = 60000; -// } -// -// void JustDied(Unit *Killer){} -// -// void EnterCombat(Unit * /*who*/){} -// -// void UpdateAI(const uint32 diff) -// { -// if (Explosion_Timer <= diff) -// { -// DoCast(me->getVictim(), SPELL_SHEEP_EXPLOSION); -// }else -// Explosion_Timer -= diff; -// } -//}; - -//CreatureAI* GetAI_mob_high_explosive_sheep(Creature* pCreature) -//{ -// return new mob_high_explosive_sheepAI (pCreature); -//}; - -void AddSC_boss_priestess_delrissa() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "boss_priestess_delrissa"; - newscript->GetAI = &GetAI_boss_priestess_delrissa; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_kagani_nightstrike"; - newscript->GetAI = &GetAI_boss_kagani_nightstrike; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_ellris_duskhallow"; - newscript->GetAI = &GetAI_ellris_duskhallow; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_eramas_brightblaze"; - newscript->GetAI = &GetAI_eramas_brightblaze; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_yazzai"; - newscript->GetAI = &GetAI_yazzai; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_warlord_salaris"; - newscript->GetAI = &GetAI_warlord_salaris; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_garaxxas"; - newscript->GetAI = &GetAI_garaxxas; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_apoko"; - newscript->GetAI = &GetAI_apoko; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_zelfan"; - newscript->GetAI = &GetAI_zelfan; - newscript->RegisterSelf(); - - /*newscript = new Script; - newscript->Name = "mob_high_explosive_sheep"; - newscript->GetAI = &GetAI_mob_high_explosive_sheep; - newscript->RegisterSelf();*/ -} - diff --git a/src/server/scripts/EasternKingdoms/magisters_terrace/boss_selin_fireheart.cpp b/src/server/scripts/EasternKingdoms/magisters_terrace/boss_selin_fireheart.cpp deleted file mode 100644 index adb0700eabf..00000000000 --- a/src/server/scripts/EasternKingdoms/magisters_terrace/boss_selin_fireheart.cpp +++ /dev/null @@ -1,366 +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_Selin_Fireheart -SD%Complete: 90 -SDComment: Heroic and Normal Support. Needs further testing. -SDCategory: Magister's Terrace -EndScriptData */ - -#include "ScriptedPch.h" -#include "magisters_terrace.h" - -#define SAY_AGGRO -1585000 -#define SAY_ENERGY -1585001 -#define SAY_EMPOWERED -1585002 -#define SAY_KILL_1 -1585003 -#define SAY_KILL_2 -1585004 -#define SAY_DEATH -1585005 -#define EMOTE_CRYSTAL -1585006 - -//Crystal effect spells -#define SPELL_FEL_CRYSTAL_COSMETIC 44374 -#define SPELL_FEL_CRYSTAL_DUMMY 44329 -#define SPELL_FEL_CRYSTAL_VISUAL 44355 -#define SPELL_MANA_RAGE 44320 // This spell triggers 44321, which changes scale and regens mana Requires an entry in spell_script_target - -//Selin's spells -#define SPELL_DRAIN_LIFE 44294 -#define SPELL_FEL_EXPLOSION 44314 - -#define SPELL_DRAIN_MANA 46153 // Heroic only - -#define CRYSTALS_NUMBER 5 -#define DATA_CRYSTALS 6 - -#define CREATURE_FEL_CRYSTAL 24722 - -struct boss_selin_fireheartAI : public ScriptedAI -{ - boss_selin_fireheartAI(Creature* c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - - Crystals.clear(); - //GUIDs per instance is static, so we only need to load them once. - if (pInstance) - { - uint32 size = pInstance->GetData(DATA_FEL_CRYSTAL_SIZE); - for (uint8 i = 0; i < size; ++i) - { - uint64 guid = pInstance->GetData64(DATA_FEL_CRYSTAL); - debug_log("TSCR: Selin: Adding Fel Crystal %u to list", guid); - Crystals.push_back(guid); - } - } - } - - ScriptedInstance* pInstance; - - std::list Crystals; - - uint32 DrainLifeTimer; - uint32 DrainManaTimer; - uint32 FelExplosionTimer; - uint32 DrainCrystalTimer; - uint32 EmpowerTimer; - - bool IsDraining; - bool DrainingCrystal; - - uint64 CrystalGUID; // This will help us create a pointer to the crystal we are draining. We store GUIDs, never units in case unit is deleted/offline (offline if player of course). - - void Reset() - { - if (pInstance) - { - //for (uint8 i = 0; i < CRYSTALS_NUMBER; ++i) - for (std::list::const_iterator itr = Crystals.begin(); itr != Crystals.end(); ++itr) - { - //Unit* pUnit = Unit::GetUnit(*me, FelCrystals[i]); - Unit* pUnit = Unit::GetUnit(*me, *itr); - if (pUnit) - { - if (!pUnit->isAlive()) - CAST_CRE(pUnit)->Respawn(); // Let the core handle setting death state, etc. - - // Only need to set unselectable flag. You can't attack unselectable units so non_attackable flag is not necessary here. - pUnit->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - } - } - - pInstance->HandleGameObject(pInstance->GetData64(DATA_SELIN_ENCOUNTER_DOOR), true); - // Open the big encounter door. Close it in Aggro and open it only in JustDied(and here) - // Small door opened after event are expected to be closed by default - // Set Inst data for encounter - pInstance->SetData(DATA_SELIN_EVENT, NOT_STARTED); - } else error_log(ERROR_INST_DATA); - - DrainLifeTimer = 3000 + rand()%4000; - DrainManaTimer = DrainLifeTimer + 5000; - FelExplosionTimer = 2100; - DrainCrystalTimer = 10000 + rand()%5000; - DrainCrystalTimer = 20000 + rand()%5000; - EmpowerTimer = 10000; - - IsDraining = false; - DrainingCrystal = false; - CrystalGUID = 0; - } - - void SelectNearestCrystal() - { - if (Crystals.empty()) - return; - - //float ShortestDistance = 0; - CrystalGUID = 0; - Unit* pCrystal = NULL; - Unit* CrystalChosen = NULL; - //for (uint8 i = 0; i < CRYSTALS_NUMBER; ++i) - for (std::list::const_iterator itr = Crystals.begin(); itr != Crystals.end(); ++itr) - { - pCrystal = NULL; - //pCrystal = Unit::GetUnit(*me, FelCrystals[i]); - pCrystal = Unit::GetUnit(*me, *itr); - if (pCrystal && pCrystal->isAlive()) - { - // select nearest - if (!CrystalChosen || me->GetDistanceOrder(pCrystal, CrystalChosen, false)) - { - CrystalGUID = pCrystal->GetGUID(); - CrystalChosen = pCrystal; // Store a copy of pCrystal so we don't need to recreate a pointer to closest crystal for the movement and yell. - } - } - } - if (CrystalChosen) - { - DoScriptText(SAY_ENERGY, me); - DoScriptText(EMOTE_CRYSTAL, me); - - CrystalChosen->CastSpell(CrystalChosen, SPELL_FEL_CRYSTAL_COSMETIC, true); - - float x, y, z; // coords that we move to, close to the crystal. - CrystalChosen->GetClosePoint(x, y, z, me->GetObjectSize(), CONTACT_DISTANCE); - - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - me->GetMotionMaster()->MovePoint(1, x, y, z); - DrainingCrystal = true; - } - } - - void ShatterRemainingCrystals() - { - if (Crystals.empty()) - return; - - //for (uint8 i = 0; i < CRYSTALS_NUMBER; ++i) - for (std::list::const_iterator itr = Crystals.begin(); itr != Crystals.end(); ++itr) - { - //Creature* pCrystal = (Unit::GetCreature(*me, FelCrystals[i])); - Creature* pCrystal = Unit::GetCreature(*me, *itr); - if (pCrystal && pCrystal->isAlive()) - pCrystal->Kill(pCrystal); - } - } - - void EnterCombat(Unit* /*who*/) - { - DoScriptText(SAY_AGGRO, me); - - if (pInstance) - pInstance->HandleGameObject(pInstance->GetData64(DATA_SELIN_ENCOUNTER_DOOR), false); - //Close the encounter door, open it in JustDied/Reset - } - - void KilledUnit(Unit* /*victim*/) - { - DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2), me); - } - - void MovementInform(uint32 type, uint32 id) - { - if (type == POINT_MOTION_TYPE && id == 1) - { - Unit* CrystalChosen = Unit::GetUnit(*me, CrystalGUID); - if (CrystalChosen && CrystalChosen->isAlive()) - { - // Make the crystal attackable - // We also remove NON_ATTACKABLE in case the database has it set. - CrystalChosen->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE); - CrystalChosen->CastSpell(me, SPELL_MANA_RAGE, true); - IsDraining = true; - } - else - { - // Make an error message in case something weird happened here - error_log("TSCR: Selin Fireheart unable to drain crystal as the crystal is either dead or despawned"); - DrainingCrystal = false; - } - } - } - - void JustDied(Unit* /*killer*/) - { - DoScriptText(SAY_DEATH, me); - - if (!pInstance) - return; - - pInstance->SetData(DATA_SELIN_EVENT, DONE); // Encounter complete! - pInstance->HandleGameObject(pInstance->GetData64(DATA_SELIN_ENCOUNTER_DOOR), true); // Open the encounter door - pInstance->HandleGameObject(pInstance->GetData64(DATA_SELIN_DOOR), true); // Open the door leading further in - ShatterRemainingCrystals(); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (!DrainingCrystal) - { - uint32 maxPowerMana = me->GetMaxPower(POWER_MANA); - if (maxPowerMana && ((me->GetPower(POWER_MANA)*100 / maxPowerMana) < 10)) - { - if (DrainLifeTimer <= diff) - { - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_DRAIN_LIFE); - DrainLifeTimer = 10000; - } else DrainLifeTimer -= diff; - - // Heroic only - if (IsHeroic()) - { - if (DrainManaTimer <= diff) - { - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 1), SPELL_DRAIN_MANA); - DrainManaTimer = 10000; - } else DrainManaTimer -= diff; - } - } - - if (FelExplosionTimer <= diff) - { - if (!me->IsNonMeleeSpellCasted(false)) - { - DoCast(me, SPELL_FEL_EXPLOSION); - FelExplosionTimer = 2000; - } - } else FelExplosionTimer -= diff; - - // If below 10% mana, start recharging - maxPowerMana = me->GetMaxPower(POWER_MANA); - if (maxPowerMana && ((me->GetPower(POWER_MANA)*100 / maxPowerMana) < 10)) - { - if (DrainCrystalTimer <= diff) - { - SelectNearestCrystal(); - if (IsHeroic()) - DrainCrystalTimer = 10000 + rand()%5000; - else - DrainCrystalTimer = 20000 + rand()%5000; - } else DrainCrystalTimer -= diff; - } - - }else - { - if (IsDraining) - { - if (EmpowerTimer <= diff) - { - IsDraining = false; - DrainingCrystal = false; - - DoScriptText(SAY_EMPOWERED, me); - - Unit* CrystalChosen = Unit::GetUnit(*me, CrystalGUID); - if (CrystalChosen && CrystalChosen->isAlive()) - // Use Deal Damage to kill it, not setDeathState. - CrystalChosen->Kill(CrystalChosen); - - CrystalGUID = 0; - - me->GetMotionMaster()->Clear(); - me->GetMotionMaster()->MoveChase(me->getVictim()); - } else EmpowerTimer -= diff; - } - } - - DoMeleeAttackIfReady(); // No need to check if we are draining crystal here, as the spell has a stun. - } -}; - -CreatureAI* GetAI_boss_selin_fireheart(Creature* pCreature) -{ - return new boss_selin_fireheartAI (pCreature); -}; - -struct mob_fel_crystalAI : public ScriptedAI -{ - mob_fel_crystalAI(Creature *c) : ScriptedAI(c) {} - - void Reset() {} - void EnterCombat(Unit* /*who*/) {} - void AttackStart(Unit* /*who*/) {} - void MoveInLineOfSight(Unit* /*who*/) {} - void UpdateAI(const uint32 /*diff*/) {} - - void JustDied(Unit* /*killer*/) - { - if (ScriptedInstance* pInstance = me->GetInstanceData()) - { - Creature* Selin = (Unit::GetCreature(*me, pInstance->GetData64(DATA_SELIN))); - if (Selin && Selin->isAlive()) - { - if (CAST_AI(boss_selin_fireheartAI, Selin->AI())->CrystalGUID == me->GetGUID()) - { - // Set this to false if we are the Creature that Selin is draining so his AI flows properly - CAST_AI(boss_selin_fireheartAI, Selin->AI())->DrainingCrystal = false; - CAST_AI(boss_selin_fireheartAI, Selin->AI())->IsDraining = false; - CAST_AI(boss_selin_fireheartAI, Selin->AI())->EmpowerTimer = 10000; - if (Selin->getVictim()) - { - Selin->AI()->AttackStart(Selin->getVictim()); - Selin->GetMotionMaster()->MoveChase(Selin->getVictim()); - } - } - } - } else error_log(ERROR_INST_DATA); - } -}; - -CreatureAI* GetAI_mob_fel_crystal(Creature* pCreature) -{ - return new mob_fel_crystalAI (pCreature); -}; - -void AddSC_boss_selin_fireheart() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "boss_selin_fireheart"; - newscript->GetAI = &GetAI_boss_selin_fireheart; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_fel_crystal"; - newscript->GetAI = &GetAI_mob_fel_crystal; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/magisters_terrace/boss_vexallus.cpp b/src/server/scripts/EasternKingdoms/magisters_terrace/boss_vexallus.cpp deleted file mode 100644 index bc8bd5cec30..00000000000 --- a/src/server/scripts/EasternKingdoms/magisters_terrace/boss_vexallus.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_Vexallus -SD%Complete: 90 -SDComment: Heroic and Normal support. Needs further testing. -SDCategory: Magister's Terrace -EndScriptData */ - -#include "ScriptedPch.h" -#include "magisters_terrace.h" - -enum eEnums -{ - SAY_AGGRO = -1585007, - SAY_ENERGY = -1585008, - SAY_OVERLOAD = -1585009, - SAY_KILL = -1585010, - EMOTE_DISCHARGE_ENERGY = -1585011, - - //is this text for real? - //#define SAY_DEATH "What...happen...ed." - - //Pure energy spell info - SPELL_ENERGY_BOLT = 46156, - SPELL_ENERGY_FEEDBACK = 44335, - - //Vexallus spell info - SPELL_CHAIN_LIGHTNING = 44318, - SPELL_H_CHAIN_LIGHTNING = 46380, //heroic spell - SPELL_OVERLOAD = 44353, - SPELL_ARCANE_SHOCK = 44319, - SPELL_H_ARCANE_SHOCK = 46381, //heroic spell - - SPELL_SUMMON_PURE_ENERGY = 44322, //mod scale -10 - H_SPELL_SUMMON_PURE_ENERGY1 = 46154, //mod scale -5 - H_SPELL_SUMMON_PURE_ENERGY2 = 46159, //mod scale -5 - - //Creatures - NPC_PURE_ENERGY = 24745, - - INTERVAL_MODIFIER = 15, - INTERVAL_SWITCH = 6 -}; - -struct boss_vexallusAI : public ScriptedAI -{ - boss_vexallusAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint32 ChainLightningTimer; - uint32 ArcaneShockTimer; - uint32 OverloadTimer; - uint32 IntervalHealthAmount; - bool Enraged; - - void Reset() - { - ChainLightningTimer = 8000; - ArcaneShockTimer = 5000; - OverloadTimer = 1200; - IntervalHealthAmount = 1; - Enraged = false; - - if (pInstance) - pInstance->SetData(DATA_VEXALLUS_EVENT, NOT_STARTED); - } - - void KilledUnit(Unit * /*victim*/) - { - DoScriptText(SAY_KILL, me); - } - - void JustDied(Unit * /*victim*/) - { - if (pInstance) - pInstance->SetData(DATA_VEXALLUS_EVENT, DONE); - } - - void EnterCombat(Unit * /*who*/) - { - DoScriptText(SAY_AGGRO, me); - - if (pInstance) - pInstance->SetData(DATA_VEXALLUS_EVENT, IN_PROGRESS); - } - - void JustSummoned(Creature *summoned) - { - if (Unit *temp = SelectUnit(SELECT_TARGET_RANDOM, 0)) - summoned->GetMotionMaster()->MoveFollow(temp,0,0); - - //spells are SUMMON_TYPE_GUARDIAN, so using setOwner should be ok - summoned->CastSpell(summoned,SPELL_ENERGY_BOLT,false,0,0,me->GetGUID()); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (!Enraged) - { - //used for check, when Vexallus cast adds 85%, 70%, 55%, 40%, 25% - if ((me->GetHealth()*100 / me->GetMaxHealth()) <= (100-(INTERVAL_MODIFIER*IntervalHealthAmount))) - { - //increase amount, unless we're at 10%, then we switch and return - if (IntervalHealthAmount == INTERVAL_SWITCH) - { - Enraged = true; - return; - } - else - ++IntervalHealthAmount; - - DoScriptText(SAY_ENERGY, me); - DoScriptText(EMOTE_DISCHARGE_ENERGY, me); - - if (IsHeroic()) - { - DoCast(me, H_SPELL_SUMMON_PURE_ENERGY1, false); - DoCast(me, H_SPELL_SUMMON_PURE_ENERGY2, false); - } - else - DoCast(me, SPELL_SUMMON_PURE_ENERGY, false); - - //below are workaround summons, remove when summoning spells w/implicitTarget 73 implemented in the core - me->SummonCreature(NPC_PURE_ENERGY, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0); - - if (IsHeroic()) - me->SummonCreature(NPC_PURE_ENERGY, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0); - } - - if (ChainLightningTimer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(pTarget, SPELL_CHAIN_LIGHTNING); - - ChainLightningTimer = 8000; - } else ChainLightningTimer -= diff; - - if (ArcaneShockTimer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) - if (pTarget) - DoCast(pTarget, SPELL_ARCANE_SHOCK); - - ArcaneShockTimer = 8000; - } else ArcaneShockTimer -= diff; - } - else - { - if (OverloadTimer <= diff) - { - DoCast(me->getVictim(), SPELL_OVERLOAD); - - OverloadTimer = 2000; - } else OverloadTimer -= diff; - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_vexallus(Creature* pCreature) -{ - return new boss_vexallusAI (pCreature); -}; - -struct mob_pure_energyAI : public ScriptedAI -{ - mob_pure_energyAI(Creature *c) : ScriptedAI(c) {} - - void Reset() {} - - void JustDied(Unit* slayer) - { - if (Unit *temp = me->GetOwner()) - { - if (temp && temp->isAlive()) - slayer->CastSpell(slayer, SPELL_ENERGY_FEEDBACK, true, 0, 0, temp->GetGUID()); - } - } - - void EnterCombat(Unit * /*who*/) {} - void MoveInLineOfSight(Unit * /*who*/) {} - void AttackStart(Unit * /*who*/) {} -}; - -CreatureAI* GetAI_mob_pure_energy(Creature* pCreature) -{ - return new mob_pure_energyAI (pCreature); -}; - -void AddSC_boss_vexallus() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "boss_vexallus"; - newscript->GetAI = &GetAI_boss_vexallus; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_pure_energy"; - newscript->GetAI = &GetAI_mob_pure_energy; - newscript->RegisterSelf(); -} diff --git a/src/server/scripts/EasternKingdoms/magisters_terrace/instance_magisters_terrace.cpp b/src/server/scripts/EasternKingdoms/magisters_terrace/instance_magisters_terrace.cpp deleted file mode 100644 index 455c03739bc..00000000000 --- a/src/server/scripts/EasternKingdoms/magisters_terrace/instance_magisters_terrace.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: Instance_Magisters_Terrace -SD%Complete: 60 -SDComment: Designed only for Selin Fireheart -SDCategory: Magister's Terrace -EndScriptData */ - -#include "ScriptedPch.h" -#include "magisters_terrace.h" - -#define MAX_ENCOUNTER 4 - -/* -0 - Selin Fireheart -1 - Vexallus -2 - Priestess Delrissa -3 - Kael'thas Sunstrider -*/ - -struct instance_magisters_terrace : public ScriptedInstance -{ - instance_magisters_terrace(Map* pMap) : ScriptedInstance(pMap) {Initialize();} - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - uint32 DelrissaDeathCount; - - std::list FelCrystals; - std::list::const_iterator CrystalItr; - - uint64 SelinGUID; - uint64 DelrissaGUID; - uint64 VexallusDoorGUID; - uint64 SelinDoorGUID; - uint64 SelinEncounterDoorGUID; - uint64 DelrissaDoorGUID; - uint64 KaelDoorGUID; - uint64 KaelStatue[2]; - - bool InitializedItr; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - FelCrystals.clear(); - - DelrissaDeathCount = 0; - - SelinGUID = 0; - DelrissaGUID = 0; - VexallusDoorGUID = 0; - SelinDoorGUID = 0; - SelinEncounterDoorGUID = 0; - DelrissaDoorGUID = 0; - KaelDoorGUID = 0; - KaelStatue[0] = 0; - KaelStatue[1] = 0; - - InitializedItr = false; - } - - bool IsEncounterInProgress() const - { - for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) - return true; - return false; - } - - uint32 GetData(uint32 identifier) - { - switch(identifier) - { - case DATA_SELIN_EVENT: return m_auiEncounter[0]; - case DATA_VEXALLUS_EVENT: return m_auiEncounter[1]; - case DATA_DELRISSA_EVENT: return m_auiEncounter[2]; - case DATA_KAELTHAS_EVENT: return m_auiEncounter[3]; - case DATA_DELRISSA_DEATH_COUNT: return DelrissaDeathCount; - case DATA_FEL_CRYSTAL_SIZE: return FelCrystals.size(); - } - return 0; - } - - void SetData(uint32 identifier, uint32 data) - { - switch(identifier) - { - case DATA_SELIN_EVENT: m_auiEncounter[0] = data; break; - case DATA_VEXALLUS_EVENT: - if (data == DONE) - DoUseDoorOrButton(VexallusDoorGUID); - m_auiEncounter[1] = data; - break; - case DATA_DELRISSA_EVENT: - if (data == DONE) - DoUseDoorOrButton(DelrissaDoorGUID); - if (data == IN_PROGRESS) - DelrissaDeathCount = 0; - m_auiEncounter[2] = data; - break; - case DATA_KAELTHAS_EVENT: m_auiEncounter[3] = data; break; - - case DATA_DELRISSA_DEATH_COUNT: - if (data == SPECIAL) - ++DelrissaDeathCount; - else - DelrissaDeathCount = 0; - break; - } - } - - void OnCreatureCreate(Creature* pCreature, bool /*add*/) - { - switch(pCreature->GetEntry()) - { - case 24723: SelinGUID = pCreature->GetGUID(); break; - case 24560: DelrissaGUID = pCreature->GetGUID(); break; - case 24722: FelCrystals.push_back(pCreature->GetGUID()); break; - } - } - - void OnGameObjectCreate(GameObject* pGo, bool /*add*/) - { - switch(pGo->GetEntry()) - { - case 187896: VexallusDoorGUID = pGo->GetGUID(); break; - //SunwellRaid Gate 02 - case 187979: SelinDoorGUID = pGo->GetGUID(); break; - //Assembly Chamber Door - case 188065: SelinEncounterDoorGUID = pGo->GetGUID(); break; - case 187770: DelrissaDoorGUID = pGo->GetGUID(); break; - case 188064: KaelDoorGUID = pGo->GetGUID(); break; - case 188165: KaelStatue[0] = pGo->GetGUID(); break; - case 188166: KaelStatue[1] = pGo->GetGUID(); break; - } - } - - uint64 GetData64(uint32 identifier) - { - switch(identifier) - { - case DATA_SELIN: return SelinGUID; - case DATA_DELRISSA: return DelrissaGUID; - case DATA_VEXALLUS_DOOR: return VexallusDoorGUID; - case DATA_SELIN_DOOR: return SelinDoorGUID; - case DATA_SELIN_ENCOUNTER_DOOR: return SelinEncounterDoorGUID; - case DATA_DELRISSA_DOOR: return DelrissaDoorGUID; - case DATA_KAEL_DOOR: return KaelDoorGUID; - case DATA_KAEL_STATUE_LEFT: return KaelStatue[0]; - case DATA_KAEL_STATUE_RIGHT: return KaelStatue[1]; - - case DATA_FEL_CRYSTAL: - { - if (FelCrystals.empty()) - { - error_log("TSCR: Magisters Terrace: No Fel Crystals loaded in Inst Data"); - return 0; - } - - if (!InitializedItr) - { - CrystalItr = FelCrystals.begin(); - InitializedItr = true; - } - - uint64 guid = *CrystalItr; - ++CrystalItr; - return guid; - } - } - return 0; - } -}; - -InstanceData* GetInstanceData_instance_magisters_terrace(Map* pMap) -{ - return new instance_magisters_terrace(pMap); -} - -void AddSC_instance_magisters_terrace() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "instance_magisters_terrace"; - newscript->GetInstanceData = &GetInstanceData_instance_magisters_terrace; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/magisters_terrace/magisters_terrace.cpp b/src/server/scripts/EasternKingdoms/magisters_terrace/magisters_terrace.cpp deleted file mode 100644 index e46da9cb1bf..00000000000 --- a/src/server/scripts/EasternKingdoms/magisters_terrace/magisters_terrace.cpp +++ /dev/null @@ -1,174 +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: Magisters_Terrace -SD%Complete: 100 -SDComment: Quest support: 11490(post-event) -SDCategory: Magisters Terrace -EndScriptData */ - -/* ContentData -npc_kalecgos -EndContentData */ - -#include "ScriptedPch.h" - -/*###### -## npc_kalecgos -######*/ - -enum eEnums -{ - SPELL_TRANSFORM_TO_KAEL = 44670, - SPELL_ORB_KILL_CREDIT = 46307, - NPC_KAEL = 24848, //human form entry - POINT_ID_LAND = 1 -}; - -const float afKaelLandPoint[] = {225.045, -276.236, -5.434}; - -#define GOSSIP_ITEM_KAEL_1 "Who are you?" -#define GOSSIP_ITEM_KAEL_2 "What can we do to assist you?" -#define GOSSIP_ITEM_KAEL_3 "What brings you to the Sunwell?" -#define GOSSIP_ITEM_KAEL_4 "You're not alone here?" -#define GOSSIP_ITEM_KAEL_5 "What would Kil'jaeden want with a mortal woman?" - -// This is friendly keal that appear after used Orb. -// If we assume DB handle summon, summon appear somewhere outside the platform where Orb is -struct npc_kalecgosAI : public ScriptedAI -{ - npc_kalecgosAI(Creature* pCreature) : ScriptedAI(pCreature) {} - - uint32 m_uiTransformTimer; - - void Reset() - { - m_uiTransformTimer = 0; - - // we must assume he appear as dragon somewhere outside the platform of orb, and then move directly to here - if (me->GetEntry() != NPC_KAEL) - me->GetMotionMaster()->MovePoint(POINT_ID_LAND, afKaelLandPoint[0], afKaelLandPoint[1], afKaelLandPoint[2]); - } - - void MovementInform(uint32 uiType, uint32 uiPointId) - { - if (uiType != POINT_MOTION_TYPE) - return; - - if (uiPointId == POINT_ID_LAND) - m_uiTransformTimer = MINUTE*IN_MILISECONDS; - } - - // some targeting issues with the spell, so use this workaround as temporary solution - void DoWorkaroundForQuestCredit() - { - Map* pMap = me->GetMap(); - - if (!pMap || pMap->IsHeroic()) - return; - - Map::PlayerList const &lList = pMap->GetPlayers(); - - if (lList.isEmpty()) - return; - - SpellEntry const* pSpell = GetSpellStore()->LookupEntry(SPELL_ORB_KILL_CREDIT); - - for (Map::PlayerList::const_iterator i = lList.begin(); i != lList.end(); ++i) - { - if (Player* pPlayer = i->getSource()) - { - if (pSpell && pSpell->EffectMiscValue[0]) - pPlayer->KilledMonsterCredit(pSpell->EffectMiscValue[0], 0); - } - } - } - - void UpdateAI(const uint32 uiDiff) - { - if (m_uiTransformTimer) - { - if (m_uiTransformTimer <= uiDiff) - { - DoCast(me, SPELL_ORB_KILL_CREDIT, false); - DoWorkaroundForQuestCredit(); - - // Transform and update entry, now ready for quest/read gossip - DoCast(me, SPELL_TRANSFORM_TO_KAEL, false); - me->UpdateEntry(NPC_KAEL); - - m_uiTransformTimer = 0; - } else m_uiTransformTimer -= uiDiff; - } - } -}; - -CreatureAI* GetAI_npc_kalecgos(Creature* pCreature) -{ - return new npc_kalecgosAI(pCreature); -} - -bool GossipHello_npc_kalecgos(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAEL_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - pPlayer->SEND_GOSSIP_MENU(12498, pCreature->GetGUID()); - - return true; -} - -bool GossipSelect_npc_kalecgos(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction) -{ - switch(uiAction) - { - case GOSSIP_ACTION_INFO_DEF: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAEL_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - pPlayer->SEND_GOSSIP_MENU(12500, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+1: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAEL_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - pPlayer->SEND_GOSSIP_MENU(12502, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAEL_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - pPlayer->SEND_GOSSIP_MENU(12606, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+3: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAEL_5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); - pPlayer->SEND_GOSSIP_MENU(12607, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+4: - pPlayer->SEND_GOSSIP_MENU(12608, pCreature->GetGUID()); - break; - } - - return true; -} - -void AddSC_magisters_terrace() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "npc_kalecgos"; - newscript->GetAI = &GetAI_npc_kalecgos; - newscript->pGossipHello = &GossipHello_npc_kalecgos; - newscript->pGossipSelect = &GossipSelect_npc_kalecgos; - newscript->RegisterSelf(); -} diff --git a/src/server/scripts/EasternKingdoms/magisters_terrace/magisters_terrace.h b/src/server/scripts/EasternKingdoms/magisters_terrace/magisters_terrace.h deleted file mode 100644 index d6419ea409c..00000000000 --- a/src/server/scripts/EasternKingdoms/magisters_terrace/magisters_terrace.h +++ /dev/null @@ -1,31 +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_MAGISTERS_TERRACE_H -#define DEF_MAGISTERS_TERRACE_H - -#define DATA_SELIN_EVENT 1 -#define DATA_VEXALLUS_EVENT 2 -#define DATA_DELRISSA_EVENT 3 -#define DATA_KAELTHAS_EVENT 4 - -#define DATA_SELIN 5 -#define DATA_FEL_CRYSTAL 6 -#define DATA_FEL_CRYSTAL_SIZE 7 - -#define DATA_VEXALLUS_DOOR 8 -#define DATA_SELIN_DOOR 9 -#define DATA_DELRISSA 10 -#define DATA_DELRISSA_DOOR 11 -#define DATA_SELIN_ENCOUNTER_DOOR 12 - -#define DATA_KAEL_DOOR 13 -#define DATA_KAEL_STATUE_LEFT 14 -#define DATA_KAEL_STATUE_RIGHT 15 - -#define DATA_DELRISSA_DEATH_COUNT 16 - -#define ERROR_INST_DATA "TSCR Error: Instance Data not set properly for Magister's Terrace instance (map 585). Encounters will be buggy." -#endif - diff --git a/src/server/scripts/EasternKingdoms/molten_core/boss_baron_geddon.cpp b/src/server/scripts/EasternKingdoms/molten_core/boss_baron_geddon.cpp deleted file mode 100644 index 77c6fafa10a..00000000000 --- a/src/server/scripts/EasternKingdoms/molten_core/boss_baron_geddon.cpp +++ /dev/null @@ -1,107 +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_Baron_Geddon -SD%Complete: 100 -SDComment: -SDCategory: Molten Core -EndScriptData */ - -#include "ScriptedPch.h" - -#define EMOTE_SERVICE -1409000 - -#define SPELL_INFERNO 19695 -#define SPELL_IGNITEMANA 19659 -#define SPELL_LIVINGBOMB 20475 -#define SPELL_ARMAGEDDOM 20479 - -struct boss_baron_geddonAI : public ScriptedAI -{ - boss_baron_geddonAI(Creature *c) : ScriptedAI(c) {} - - uint32 Inferno_Timer; - uint32 IgniteMana_Timer; - uint32 LivingBomb_Timer; - - void Reset() - { - Inferno_Timer = 45000; //These times are probably wrong - IgniteMana_Timer = 30000; - LivingBomb_Timer = 35000; - } - - void EnterCombat(Unit * /*who*/) - { - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //If we are <2% hp cast Armageddom - if (me->GetHealth()*100 / me->GetMaxHealth() <= 2) - { - me->InterruptNonMeleeSpells(true); - DoCast(me, SPELL_ARMAGEDDOM); - DoScriptText(EMOTE_SERVICE, me); - return; - } - - //Inferno_Timer - if (Inferno_Timer <= diff) - { - DoCast(me, SPELL_INFERNO); - Inferno_Timer = 45000; - } else Inferno_Timer -= diff; - - //IgniteMana_Timer - if (IgniteMana_Timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(pTarget, SPELL_IGNITEMANA); - - IgniteMana_Timer = 30000; - } else IgniteMana_Timer -= diff; - - //LivingBomb_Timer - if (LivingBomb_Timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(pTarget, SPELL_LIVINGBOMB); - - LivingBomb_Timer = 35000; - } else LivingBomb_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_baron_geddon(Creature* pCreature) -{ - return new boss_baron_geddonAI (pCreature); -} - -void AddSC_boss_baron_geddon() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_baron_geddon"; - newscript->GetAI = &GetAI_boss_baron_geddon; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/molten_core/boss_garr.cpp b/src/server/scripts/EasternKingdoms/molten_core/boss_garr.cpp deleted file mode 100644 index 75891cf8c43..00000000000 --- a/src/server/scripts/EasternKingdoms/molten_core/boss_garr.cpp +++ /dev/null @@ -1,143 +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_Garr -SD%Complete: 50 -SDComment: Adds NYI -SDCategory: Molten Core -EndScriptData */ - -#include "ScriptedPch.h" - -// Garr spells -#define SPELL_ANTIMAGICPULSE 19492 -#define SPELL_MAGMASHACKLES 19496 -#define SPELL_ENRAGE 19516 //Stacking enrage (stacks to 10 times) - -//Add spells -#define SPELL_ERUPTION 19497 -#define SPELL_IMMOLATE 20294 - -struct boss_garrAI : public ScriptedAI -{ - boss_garrAI(Creature *c) : ScriptedAI(c) {} - - uint32 AntiMagicPulse_Timer; - uint32 MagmaShackles_Timer; - uint32 CheckAdds_Timer; - uint64 Add[8]; - bool Enraged[8]; - - void Reset() - { - AntiMagicPulse_Timer = 25000; //These times are probably wrong - MagmaShackles_Timer = 15000; - CheckAdds_Timer = 2000; - } - - void EnterCombat(Unit * /*who*/) - { - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //AntiMagicPulse_Timer - if (AntiMagicPulse_Timer <= diff) - { - DoCast(me, SPELL_ANTIMAGICPULSE); - AntiMagicPulse_Timer = 10000 + rand()%5000; - } else AntiMagicPulse_Timer -= diff; - - //MagmaShackles_Timer - if (MagmaShackles_Timer <= diff) - { - DoCast(me, SPELL_MAGMASHACKLES); - MagmaShackles_Timer = 8000 + rand()%4000; - } else MagmaShackles_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -struct mob_fireswornAI : public ScriptedAI -{ - mob_fireswornAI(Creature *c) : ScriptedAI(c) {} - - uint32 Immolate_Timer; - - void Reset() - { - Immolate_Timer = 4000; //These times are probably wrong - } - - void EnterCombat(Unit * /*who*/) - { - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //Immolate_Timer - if (Immolate_Timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(pTarget, SPELL_IMMOLATE); - - Immolate_Timer = urand(5000,10000); - } else Immolate_Timer -= diff; - - //Cast Erruption and let them die - if (me->GetHealth() <= me->GetMaxHealth() * 0.10) - { - DoCast(me->getVictim(), SPELL_ERUPTION); - me->setDeathState(JUST_DIED); - me->RemoveCorpse(); - } - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_garr(Creature* pCreature) -{ - return new boss_garrAI (pCreature); -} - -CreatureAI* GetAI_mob_firesworn(Creature* pCreature) -{ - return new mob_fireswornAI (pCreature); -} - -void AddSC_boss_garr() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "boss_garr"; - newscript->GetAI = &GetAI_boss_garr; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_firesworn"; - newscript->GetAI = &GetAI_mob_firesworn; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/molten_core/boss_gehennas.cpp b/src/server/scripts/EasternKingdoms/molten_core/boss_gehennas.cpp deleted file mode 100644 index 9ebe69c0c4e..00000000000 --- a/src/server/scripts/EasternKingdoms/molten_core/boss_gehennas.cpp +++ /dev/null @@ -1,93 +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_Gehennas -SD%Complete: 90 -SDComment: Adds MC NYI -SDCategory: Molten Core -EndScriptData */ - -#include "ScriptedPch.h" - -#define SPELL_SHADOWBOLT 19728 -#define SPELL_RAINOFFIRE 19717 -#define SPELL_GEHENNASCURSE 19716 - -struct boss_gehennasAI : public ScriptedAI -{ - boss_gehennasAI(Creature *c) : ScriptedAI(c) {} - - uint32 ShadowBolt_Timer; - uint32 RainOfFire_Timer; - uint32 GehennasCurse_Timer; - - void Reset() - { - ShadowBolt_Timer = 6000; - RainOfFire_Timer = 10000; - GehennasCurse_Timer = 12000; - } - - void EnterCombat(Unit * /*who*/) {} - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //ShadowBolt_Timer - if (ShadowBolt_Timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1)) - DoCast(pTarget, SPELL_SHADOWBOLT); - - ShadowBolt_Timer = 7000; - } else ShadowBolt_Timer -= diff; - - //RainOfFire_Timer - if (RainOfFire_Timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(pTarget, SPELL_RAINOFFIRE); - - RainOfFire_Timer = urand(4000,12000); - } else RainOfFire_Timer -= diff; - - //GehennasCurse_Timer - if (GehennasCurse_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_GEHENNASCURSE); - GehennasCurse_Timer = urand(22000,30000); - } else GehennasCurse_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_gehennas(Creature* pCreature) -{ - return new boss_gehennasAI (pCreature); -} - -void AddSC_boss_gehennas() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_gehennas"; - newscript->GetAI = &GetAI_boss_gehennas; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/molten_core/boss_golemagg.cpp b/src/server/scripts/EasternKingdoms/molten_core/boss_golemagg.cpp deleted file mode 100644 index 2aba378d399..00000000000 --- a/src/server/scripts/EasternKingdoms/molten_core/boss_golemagg.cpp +++ /dev/null @@ -1,198 +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_Golemagg -SD%Complete: 90 -SDComment: Timers need to be confirmed, Golemagg's Trust need to be checked -SDCategory: Molten Core -EndScriptData */ - -#include "ScriptedPch.h" -#include "molten_core.h" - -enum eEnums -{ - SPELL_MAGMASPLASH = 13879, - SPELL_PYROBLAST = 20228, - SPELL_EARTHQUAKE = 19798, - SPELL_ENRAGE = 19953, - SPELL_GOLEMAGG_TRUST = 20553, - - // Core Rager - EMOTE_LOWHP = -1409002, - SPELL_MANGLE = 19820 -}; - -struct boss_golemaggAI : public ScriptedAI -{ - boss_golemaggAI(Creature* pCreature) : ScriptedAI(pCreature) - { - m_pInstance = pCreature->GetInstanceData(); - } - - ScriptedInstance* m_pInstance; - - uint32 m_uiPyroblastTimer; - uint32 m_uiEarthquakeTimer; - uint32 m_uiBuffTimer; - bool m_bEnraged; - - void Reset() - { - m_uiPyroblastTimer = 7*IN_MILISECONDS; // These timers are probably wrong - m_uiEarthquakeTimer = 3*IN_MILISECONDS; - m_uiBuffTimer = 2.5*IN_MILISECONDS; - m_bEnraged = false; - - DoCast(me, SPELL_MAGMASPLASH, true); - } - - void JustDied(Unit* /*pKiller*/) - { - if (m_pInstance) - m_pInstance->SetData(DATA_GOLEMAGG_DEATH, 0); - } - - void UpdateAI(const uint32 uiDiff) - { - if (!UpdateVictim()) - return; - - //Pyroblast - if (m_uiPyroblastTimer <= uiDiff) - { - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(pTarget, SPELL_PYROBLAST); - - m_uiPyroblastTimer = 7*IN_MILISECONDS; - } - else - m_uiPyroblastTimer -= uiDiff; - - // Enrage - if (!m_bEnraged && me->GetHealth()*100 < me->GetMaxHealth()*10) - { - DoCast(me, SPELL_ENRAGE); - m_bEnraged = true; - } - - // Earthquake - if (m_bEnraged) - { - if (m_uiEarthquakeTimer <= uiDiff) - { - DoCast(me->getVictim(), SPELL_EARTHQUAKE); - m_uiEarthquakeTimer = 3*IN_MILISECONDS; - } - else - m_uiEarthquakeTimer -= uiDiff; - } - - /* - // Golemagg's Trust - if (m_uiBuffTimer <= uidiff) - { - DoCast(me, SPELL_GOLEMAGG_TRUST); - m_uiBuffTimer = 2.5*IN_MILISECONDS; - } - else - m_uiBuffTimer -= uiDiff; - */ - - DoMeleeAttackIfReady(); - } -}; - -struct mob_core_ragerAI : public ScriptedAI -{ - mob_core_ragerAI(Creature *c) : ScriptedAI(c) - { - m_pInstance = c->GetInstanceData(); - } - - ScriptedInstance* m_pInstance; - - uint32 m_uiMangleTimer; - - void Reset() - { - m_uiMangleTimer = 7*IN_MILISECONDS; // These times are probably wrong - } - - void DamageTaken(Unit* /*pDoneBy*/, uint32& uiDamage) - { - if (me->GetHealth()*100 < me->GetMaxHealth()*50) - { - if (m_pInstance) - { - if (Creature* pGolemagg = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_GOLEMAGG))) - { - if (pGolemagg->isAlive()) - { - DoScriptText(EMOTE_LOWHP, me); - me->SetHealth(me->GetMaxHealth()); - } - else - uiDamage = me->GetHealth(); - } - } - } - } - - void UpdateAI(const uint32 uiDiff) - { - if (!UpdateVictim()) - return; - - // Mangle - if (m_uiMangleTimer <= uiDiff) - { - DoCast(me->getVictim(), SPELL_MANGLE); - m_uiMangleTimer = 10*IN_MILISECONDS; - } - else - m_uiMangleTimer -= uiDiff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_golemagg(Creature* pCreature) -{ - return new boss_golemaggAI (pCreature); -} - -CreatureAI* GetAI_mob_core_rager(Creature* pCreature) -{ - return new mob_core_ragerAI (pCreature); -} - -void AddSC_boss_golemagg() -{ - Script* newscript; - - newscript = new Script; - newscript->Name = "boss_golemagg"; - newscript->GetAI = &GetAI_boss_golemagg; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_core_rager"; - newscript->GetAI = &GetAI_mob_core_rager; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/molten_core/boss_lucifron.cpp b/src/server/scripts/EasternKingdoms/molten_core/boss_lucifron.cpp deleted file mode 100644 index 50601f04147..00000000000 --- a/src/server/scripts/EasternKingdoms/molten_core/boss_lucifron.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: Boss_Lucifron -SD%Complete: 100 -SDComment: -SDCategory: Molten Core -EndScriptData */ - -#include "ScriptedPch.h" - -#define SPELL_IMPENDINGDOOM 19702 -#define SPELL_LUCIFRONCURSE 19703 -#define SPELL_SHADOWSHOCK 20603 - -struct boss_lucifronAI : public ScriptedAI -{ - boss_lucifronAI(Creature *c) : ScriptedAI(c) {} - - uint32 ImpendingDoom_Timer; - uint32 LucifronCurse_Timer; - uint32 ShadowShock_Timer; - - void Reset() - { - ImpendingDoom_Timer = 10000; //Initial cast after 10 seconds so the debuffs alternate - LucifronCurse_Timer = 20000; //Initial cast after 20 seconds - ShadowShock_Timer = 6000; //6 seconds - } - - void EnterCombat(Unit * /*who*/) - { - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //Impending doom timer - if (ImpendingDoom_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_IMPENDINGDOOM); - ImpendingDoom_Timer = 20000; - } else ImpendingDoom_Timer -= diff; - - //Lucifron's curse timer - if (LucifronCurse_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_LUCIFRONCURSE); - LucifronCurse_Timer = 15000; - } else LucifronCurse_Timer -= diff; - - //Shadowshock - if (ShadowShock_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SHADOWSHOCK); - ShadowShock_Timer = 6000; - } else ShadowShock_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_lucifron(Creature* pCreature) -{ - return new boss_lucifronAI (pCreature); -} - -void AddSC_boss_lucifron() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_lucifron"; - newscript->GetAI = &GetAI_boss_lucifron; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/molten_core/boss_magmadar.cpp b/src/server/scripts/EasternKingdoms/molten_core/boss_magmadar.cpp deleted file mode 100644 index f612003b076..00000000000 --- a/src/server/scripts/EasternKingdoms/molten_core/boss_magmadar.cpp +++ /dev/null @@ -1,100 +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_Magmadar -SD%Complete: 75 -SDComment: Conflag on ground nyi, fear causes issues without VMAPs -SDCategory: Molten Core -EndScriptData */ - -#include "ScriptedPch.h" - -#define EMOTE_FRENZY -1409001 - -#define SPELL_FRENZY 19451 -#define SPELL_MAGMASPIT 19449 //This is actually a buff he gives himself -#define SPELL_PANIC 19408 -#define SPELL_LAVABOMB 19411 //This calls a dummy server side effect that isn't implemented yet -#define SPELL_LAVABOMB_ALT 19428 //This is the spell that the lava bomb casts - -struct boss_magmadarAI : public ScriptedAI -{ - boss_magmadarAI(Creature *c) : ScriptedAI(c) {} - - uint32 Frenzy_Timer; - uint32 Panic_Timer; - uint32 Lavabomb_Timer; - - void Reset() - { - Frenzy_Timer = 30000; - Panic_Timer = 20000; - Lavabomb_Timer = 12000; - - DoCast(me, SPELL_MAGMASPIT, true); - } - - void EnterCombat(Unit * /*who*/) - { - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //Frenzy_Timer - if (Frenzy_Timer <= diff) - { - DoScriptText(EMOTE_FRENZY, me); - DoCast(me, SPELL_FRENZY); - Frenzy_Timer = 15000; - } else Frenzy_Timer -= diff; - - //Panic_Timer - if (Panic_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_PANIC); - Panic_Timer = 35000; - } else Panic_Timer -= diff; - - //Lavabomb_Timer - if (Lavabomb_Timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(pTarget, SPELL_LAVABOMB_ALT); - - Lavabomb_Timer = 12000; - } else Lavabomb_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_magmadar(Creature* pCreature) -{ - return new boss_magmadarAI (pCreature); -} - -void AddSC_boss_magmadar() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_magmadar"; - newscript->GetAI = &GetAI_boss_magmadar; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/molten_core/boss_majordomo_executus.cpp b/src/server/scripts/EasternKingdoms/molten_core/boss_majordomo_executus.cpp deleted file mode 100644 index 11ae70befcf..00000000000 --- a/src/server/scripts/EasternKingdoms/molten_core/boss_majordomo_executus.cpp +++ /dev/null @@ -1,134 +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_Majordomo_Executus -SD%Complete: 30 -SDComment: Correct spawning and Event NYI -SDCategory: Molten Core -EndScriptData */ - -#include "ScriptedPch.h" - -#define SAY_AGGRO -1409003 -#define SAY_SPAWN -1409004 -#define SAY_SLAY -1409005 -#define SAY_SPECIAL -1409006 -#define SAY_DEFEAT -1409007 - -#define SAY_SUMMON_MAJ -1409008 -#define SAY_ARRIVAL1_RAG -1409009 -#define SAY_ARRIVAL2_MAJ -1409010 -#define SAY_ARRIVAL3_RAG -1409011 -#define SAY_ARRIVAL5_RAG -1409012 - -#define SPAWN_RAG_X 838.51 -#define SPAWN_RAG_Y -829.84 -#define SPAWN_RAG_Z -232.00 -#define SPAWN_RAG_O 1.70 - -#define SPELL_MAGIC_REFLECTION 20619 -#define SPELL_DAMAGE_REFLECTION 21075 - -#define SPELL_BLASTWAVE 20229 -#define SPELL_AEGIS 20620 //This is self casted whenever we are below 50% -#define SPELL_TELEPORT 20618 -#define SPELL_SUMMON_RAGNAROS 19774 - -#define ENTRY_FLAMEWALKER_HEALER 11663 -#define ENTRY_FLAMEWALKER_ELITE 11664 - -struct boss_majordomoAI : public ScriptedAI -{ - boss_majordomoAI(Creature *c) : ScriptedAI(c) {} - - uint32 MagicReflection_Timer; - uint32 DamageReflection_Timer; - uint32 Blastwave_Timer; - - void Reset() - { - MagicReflection_Timer = 30000; //Damage reflection first so we alternate - DamageReflection_Timer = 15000; - Blastwave_Timer = 10000; - } - - void KilledUnit(Unit* /*victim*/) - { - if (rand()%5) - return; - - DoScriptText(SAY_SLAY, me); - } - - void EnterCombat(Unit * /*who*/) - { - DoScriptText(SAY_AGGRO, me); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //Cast Ageis if less than 50% hp - if (me->GetHealth()*100 / me->GetMaxHealth() < 50) - { - DoCast(me, SPELL_AEGIS); - } - - //MagicReflection_Timer - // if (MagicReflection_Timer <= diff) - // { - // DoCast(me, SPELL_MAGICREFLECTION); - - //60 seconds until we should cast this agian - // MagicReflection_Timer = 30000; - // } else MagicReflection_Timer -= diff; - - //DamageReflection_Timer - // if (DamageReflection_Timer <= diff) - // { - // DoCast(me, SPELL_DAMAGEREFLECTION); - - //60 seconds until we should cast this agian - // DamageReflection_Timer = 30000; - // } else DamageReflection_Timer -= diff; - - //Blastwave_Timer - if (Blastwave_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_BLASTWAVE); - Blastwave_Timer = 10000; - } else Blastwave_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_majordomo(Creature* pCreature) -{ - return new boss_majordomoAI (pCreature); -} - -void AddSC_boss_majordomo() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_majordomo"; - newscript->GetAI = &GetAI_boss_majordomo; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/molten_core/boss_ragnaros.cpp b/src/server/scripts/EasternKingdoms/molten_core/boss_ragnaros.cpp deleted file mode 100644 index 71c0b40de3f..00000000000 --- a/src/server/scripts/EasternKingdoms/molten_core/boss_ragnaros.cpp +++ /dev/null @@ -1,297 +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_Ragnaros -SD%Complete: 75 -SDComment: Intro Dialog and event NYI -SDCategory: Molten Core -EndScriptData */ - -#include "ScriptedPch.h" - -#define SAY_REINFORCEMENTS1 -1409013 -#define SAY_REINFORCEMENTS2 -1409014 -#define SAY_HAND -1409015 -#define SAY_WRATH -1409016 -#define SAY_KILL -1409017 -#define SAY_MAGMABURST -1409018 - -#define SPELL_HANDOFRAGNAROS 19780 -#define SPELL_WRATHOFRAGNAROS 20566 -#define SPELL_LAVABURST 21158 - -#define SPELL_MAGMABURST 20565 //Ranged attack - -#define SPELL_SONSOFFLAME_DUMMY 21108 //Server side effect -#define SPELL_RAGSUBMERGE 21107 //Stealth aura -#define SPELL_RAGEMERGE 20568 -#define SPELL_MELTWEAPON 21388 -#define SPELL_ELEMENTALFIRE 20564 -#define SPELL_ERRUPTION 17731 - -#define ADD_1X 848.740356 -#define ADD_1Y -816.103455 -#define ADD_1Z -229.74327 -#define ADD_1O 2.615287 - -#define ADD_2X 852.560791 -#define ADD_2Y -849.861511 -#define ADD_2Z -228.560974 -#define ADD_2O 2.836073 - -#define ADD_3X 808.710632 -#define ADD_3Y -852.845764 -#define ADD_3Z -227.914963 -#define ADD_3O 0.964207 - -#define ADD_4X 786.597107 -#define ADD_4Y -821.132874 -#define ADD_4Z -226.350128 -#define ADD_4O 0.949377 - -#define ADD_5X 796.219116 -#define ADD_5Y -800.948059 -#define ADD_5Z -226.010361 -#define ADD_5O 0.560603 - -#define ADD_6X 821.602539 -#define ADD_6Y -782.744109 -#define ADD_6Z -226.023575 -#define ADD_6O 6.157440 - -#define ADD_7X 844.924744 -#define ADD_7Y -769.453735 -#define ADD_7Z -225.521698 -#define ADD_7O 4.4539958 - -#define ADD_8X 839.823364 -#define ADD_8Y -810.869385 -#define ADD_8Z -229.683182 -#define ADD_8O 4.693108 - -struct boss_ragnarosAI : public ScriptedAI -{ - boss_ragnarosAI(Creature *c) : ScriptedAI(c) - { - SetCombatMovement(false); - } - - uint32 WrathOfRagnaros_Timer; - uint32 HandOfRagnaros_Timer; - uint32 LavaBurst_Timer; - uint32 MagmaBurst_Timer; - uint32 ElementalFire_Timer; - uint32 Erruption_Timer; - uint32 Submerge_Timer; - uint32 Attack_Timer; - - bool HasYelledMagmaBurst; - bool HasSubmergedOnce; - bool WasBanished; - bool HasAura; - - void Reset() - { - WrathOfRagnaros_Timer = 30000; - HandOfRagnaros_Timer = 25000; - LavaBurst_Timer = 10000; - MagmaBurst_Timer = 2000; - Erruption_Timer = 15000; - ElementalFire_Timer = 3000; - Submerge_Timer = 180000; - Attack_Timer = 90000; - HasYelledMagmaBurst = false; - HasSubmergedOnce = false; - WasBanished = false; - - DoCast(me, SPELL_MELTWEAPON, true); - HasAura = true; - } - - void KilledUnit(Unit* /*victim*/) - { - if (rand()%5) - return; - - DoScriptText(SAY_KILL, me); - } - - void EnterCombat(Unit * /*who*/) - { - } - - void UpdateAI(const uint32 diff) - { - if (WasBanished && Attack_Timer <= diff) - { - //Become unbanished again - me->setFaction(14); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - DoCast(me, SPELL_RAGEMERGE); - WasBanished = false; - } else if (WasBanished) - { - Attack_Timer -= diff; - //Do nothing while banished - return; - } - - //Return since we have no target - if (!UpdateVictim()) - return; - - //WrathOfRagnaros_Timer - if (WrathOfRagnaros_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_WRATHOFRAGNAROS); - - if (urand(0,1)) - DoScriptText(SAY_WRATH, me); - - WrathOfRagnaros_Timer = 30000; - } else WrathOfRagnaros_Timer -= diff; - - //HandOfRagnaros_Timer - if (HandOfRagnaros_Timer <= diff) - { - DoCast(me, SPELL_HANDOFRAGNAROS); - - if (urand(0,1)) - DoScriptText(SAY_HAND, me); - - HandOfRagnaros_Timer = 25000; - } else HandOfRagnaros_Timer -= diff; - - //LavaBurst_Timer - if (LavaBurst_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_LAVABURST); - LavaBurst_Timer = 10000; - } else LavaBurst_Timer -= diff; - - //Erruption_Timer - if (LavaBurst_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_ERRUPTION); - Erruption_Timer = urand(20000,45000); - } else Erruption_Timer -= diff; - - //ElementalFire_Timer - if (ElementalFire_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_ELEMENTALFIRE); - ElementalFire_Timer = urand(10000,14000); - } else ElementalFire_Timer -= diff; - - //Submerge_Timer - if (!WasBanished && Submerge_Timer <= diff) - { - //Creature spawning and ragnaros becomming unattackable - //is not very well supported in the core - //so added normaly spawning and banish workaround and attack again after 90 secs. - - me->InterruptNonMeleeSpells(false); - //Root self - DoCast(me, 23973); - me->setFaction(35); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->HandleEmoteCommand(EMOTE_ONESHOT_SUBMERGE); - - if (!HasSubmergedOnce) - { - DoScriptText(SAY_REINFORCEMENTS1, me); - - // summon 10 elementals - for (uint8 i = 0; i < 9; ++i) - { - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) - { - if (Creature* pSummoned = me->SummonCreature(12143,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0.0f,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,900000)) - pSummoned->AI()->AttackStart(pTarget); - } - } - - HasSubmergedOnce = true; - WasBanished = true; - DoCast(me, SPELL_RAGSUBMERGE); - Attack_Timer = 90000; - - } - else - { - DoScriptText(SAY_REINFORCEMENTS2, me); - - for (uint8 i = 0; i < 9; ++i) - { - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) - { - if (Creature* pSummoned = me->SummonCreature(12143,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0.0f,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,900000)) - pSummoned->AI()->AttackStart(pTarget); - } - } - - WasBanished = true; - DoCast(me, SPELL_RAGSUBMERGE); - Attack_Timer = 90000; - } - - Submerge_Timer = 180000; - } else Submerge_Timer -= diff; - - //If we are within range melee the target - if (me->IsWithinMeleeRange(me->getVictim())) - { - //Make sure our attack is ready and we arn't currently casting - if (me->isAttackReady() && !me->IsNonMeleeSpellCasted(false)) - { - me->AttackerStateUpdate(me->getVictim()); - me->resetAttackTimer(); - } - } - else - { - //MagmaBurst_Timer - if (MagmaBurst_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_MAGMABURST); - - if (!HasYelledMagmaBurst) - { - //Say our dialog - DoScriptText(SAY_MAGMABURST, me); - HasYelledMagmaBurst = true; - } - - MagmaBurst_Timer = 2500; - } else MagmaBurst_Timer -= diff; - } - } -}; -CreatureAI* GetAI_boss_ragnaros(Creature* pCreature) -{ - return new boss_ragnarosAI (pCreature); -} - -void AddSC_boss_ragnaros() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_ragnaros"; - newscript->GetAI = &GetAI_boss_ragnaros; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/molten_core/boss_shazzrah.cpp b/src/server/scripts/EasternKingdoms/molten_core/boss_shazzrah.cpp deleted file mode 100644 index 4b0774cdc54..00000000000 --- a/src/server/scripts/EasternKingdoms/molten_core/boss_shazzrah.cpp +++ /dev/null @@ -1,121 +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_Shazzrah -SD%Complete: 75 -SDComment: Teleport NYI -SDCategory: Molten Core -EndScriptData */ - -#include "ScriptedPch.h" - -#define SPELL_ARCANEEXPLOSION 19712 -#define SPELL_SHAZZRAHCURSE 19713 -#define SPELL_DEADENMAGIC 19714 -#define SPELL_COUNTERSPELL 19715 - -struct boss_shazzrahAI : public ScriptedAI -{ - boss_shazzrahAI(Creature *c) : ScriptedAI(c) {} - - uint32 ArcaneExplosion_Timer; - uint32 ShazzrahCurse_Timer; - uint32 DeadenMagic_Timer; - uint32 Countspell_Timer; - uint32 Blink_Timer; - - void Reset() - { - ArcaneExplosion_Timer = 6000; //These times are probably wrong - ShazzrahCurse_Timer = 10000; - DeadenMagic_Timer = 24000; - Countspell_Timer = 15000; - Blink_Timer = 30000; - } - - void EnterCombat(Unit * /*who*/) - { - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //ArcaneExplosion_Timer - if (ArcaneExplosion_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_ARCANEEXPLOSION); - ArcaneExplosion_Timer = 5000 + rand()%4000; - } else ArcaneExplosion_Timer -= diff; - - //ShazzrahCurse_Timer - if (ShazzrahCurse_Timer <= diff) - { - Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); - if (pTarget) DoCast(pTarget, SPELL_SHAZZRAHCURSE); - - ShazzrahCurse_Timer = 25000 + rand()%5000; - } else ShazzrahCurse_Timer -= diff; - - //DeadenMagic_Timer - if (DeadenMagic_Timer <= diff) - { - DoCast(me, SPELL_DEADENMAGIC); - DeadenMagic_Timer = 35000; - } else DeadenMagic_Timer -= diff; - - //Countspell_Timer - if (Countspell_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_COUNTERSPELL); - Countspell_Timer = 16000 + rand()%4000; - } else Countspell_Timer -= diff; - - //Blink_Timer - if (Blink_Timer <= diff) - { - // Teleporting him to a random gamer and casting Arcane Explosion after that. - // Blink is not working cause of LoS System we need to do this hardcoded. - if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0, 100, true)) - { - DoTeleportTo(pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ()); - DoCast(pTarget, SPELL_ARCANEEXPLOSION); - DoResetThreat(); - } - - Blink_Timer = 45000; - } else Blink_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_shazzrah(Creature* pCreature) -{ - return new boss_shazzrahAI (pCreature); -} - -void AddSC_boss_shazzrah() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_shazzrah"; - newscript->GetAI = &GetAI_boss_shazzrah; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/molten_core/boss_sulfuron_harbinger.cpp b/src/server/scripts/EasternKingdoms/molten_core/boss_sulfuron_harbinger.cpp deleted file mode 100644 index 83288fe003b..00000000000 --- a/src/server/scripts/EasternKingdoms/molten_core/boss_sulfuron_harbinger.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_Sulfuron_Harbringer -SD%Complete: 80 -SDComment: Adds NYI -SDCategory: Molten Core -EndScriptData */ - -#include "ScriptedPch.h" -#include "molten_core.h" - -#define SPELL_DARKSTRIKE 19777 -#define SPELL_DEMORALIZINGSHOUT 19778 -#define SPELL_INSPIRE 19779 -#define SPELL_KNOCKDOWN 19780 -#define SPELL_FLAMESPEAR 19781 - -//Adds Spells -#define SPELL_HEAL 19775 -#define SPELL_SHADOWWORDPAIN 19776 -#define SPELL_IMMOLATE 20294 - -struct boss_sulfuronAI : public ScriptedAI -{ - boss_sulfuronAI(Creature *c) : ScriptedAI(c) {} - - uint32 Darkstrike_Timer; - uint32 DemoralizingShout_Timer; - uint32 Inspire_Timer; - uint32 Knockdown_Timer; - uint32 Flamespear_Timer; - - void Reset() - { - Darkstrike_Timer=10000; //These times are probably wrong - DemoralizingShout_Timer = 15000; - Inspire_Timer = 13000; - Knockdown_Timer = 6000; - Flamespear_Timer = 2000; - } - - void EnterCombat(Unit * /*who*/) - { - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //DemoralizingShout_Timer - if (DemoralizingShout_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_DEMORALIZINGSHOUT); - DemoralizingShout_Timer = 15000 + rand()%5000; - } else DemoralizingShout_Timer -= diff; - - //Inspire_Timer - if (Inspire_Timer <= diff) - { - Creature *pTarget = NULL; - std::list pList = DoFindFriendlyMissingBuff(45.0f,SPELL_INSPIRE); - if (!pList.empty()) - { - std::list::const_iterator i = pList.begin(); - advance(i, (rand()%pList.size())); - pTarget = (*i); - } - - if (pTarget) - DoCast(pTarget, SPELL_INSPIRE); - - DoCast(me, SPELL_INSPIRE); - - Inspire_Timer = 20000 + rand()%6000; - } else Inspire_Timer -= diff; - - //Knockdown_Timer - if (Knockdown_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_KNOCKDOWN); - Knockdown_Timer = 12000 + rand()%3000; - } else Knockdown_Timer -= diff; - - //Flamespear_Timer - if (Flamespear_Timer <= diff) - { - Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); - if (pTarget) DoCast(pTarget, SPELL_FLAMESPEAR); - - Flamespear_Timer = 12000 + rand()%4000; - } else Flamespear_Timer -= diff; - - //DarkStrike_Timer - if (Darkstrike_Timer <= diff) - { - DoCast(me, SPELL_DARKSTRIKE); - Darkstrike_Timer = 15000 + rand()%3000; - } else Darkstrike_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -struct mob_flamewaker_priestAI : public ScriptedAI -{ - mob_flamewaker_priestAI(Creature *c) : ScriptedAI(c) {} - - uint32 Heal_Timer; - uint32 ShadowWordPain_Timer; - uint32 Immolate_Timer; - - void Reset() - { - Heal_Timer = 15000+rand()%15000; - ShadowWordPain_Timer = 2000; - Immolate_Timer = 8000; - } - - void EnterCombat(Unit * /*who*/) - { - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //Casting Heal to Sulfuron or other Guards. - if (Heal_Timer <= diff) - { - Unit* pUnit = DoSelectLowestHpFriendly(60.0f, 1); - if (!pUnit) - return; - - DoCast(pUnit, SPELL_HEAL); - - Heal_Timer = 15000+rand()%5000; - } else Heal_Timer -= diff; - - //ShadowWordPain_Timer - if (ShadowWordPain_Timer <= diff) - { - Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); - if (pTarget) DoCast(pTarget, SPELL_SHADOWWORDPAIN); - - ShadowWordPain_Timer = 18000+rand()%8000; - } else ShadowWordPain_Timer -= diff; - - //Immolate_Timer - if (Immolate_Timer <= diff) - { - Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); - if (pTarget) DoCast(pTarget, SPELL_IMMOLATE); - - Immolate_Timer = 15000+rand()%10000; - } else Immolate_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_sulfuron(Creature* pCreature) -{ - return new boss_sulfuronAI (pCreature); -} - -CreatureAI* GetAI_mob_flamewaker_priest(Creature* pCreature) -{ - return new mob_flamewaker_priestAI (pCreature); -} - -void AddSC_boss_sulfuron() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "boss_sulfuron"; - newscript->GetAI = &GetAI_boss_sulfuron; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_flamewaker_priest"; - newscript->GetAI = &GetAI_mob_flamewaker_priest; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/molten_core/instance_molten_core.cpp b/src/server/scripts/EasternKingdoms/molten_core/instance_molten_core.cpp deleted file mode 100644 index eb79c234134..00000000000 --- a/src/server/scripts/EasternKingdoms/molten_core/instance_molten_core.cpp +++ /dev/null @@ -1,266 +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_Molten_Core -SD%Complete: 0 -SDComment: Place Holder -SDCategory: Molten Core -EndScriptData */ - -#include "ScriptedPch.h" -#include "molten_core.h" - -#define MAX_ENCOUNTER 9 - -#define ID_LUCIFRON 12118 -#define ID_MAGMADAR 11982 -#define ID_GEHENNAS 12259 -#define ID_GARR 12057 -#define ID_GEDDON 12056 -#define ID_SHAZZRAH 12264 -#define ID_GOLEMAGG 11988 -#define ID_SULFURON 12098 -#define ID_DOMO 12018 -#define ID_RAGNAROS 11502 -#define ID_FLAMEWAKERPRIEST 11662 - -struct instance_molten_core : public ScriptedInstance -{ - instance_molten_core(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint64 Lucifron, Magmadar, Gehennas, Garr, Geddon, Shazzrah, Sulfuron, Golemagg, Domo, Ragnaros, FlamewakerPriest; - uint64 RuneKoro, RuneZeth, RuneMazj, RuneTheri, RuneBlaz, RuneKress, RuneMohn, m_uiFirelordCacheGUID; - - //If all Bosses are dead. - bool IsBossDied[9]; - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - Lucifron = 0; - Magmadar = 0; - Gehennas = 0; - Garr = 0; - Geddon = 0; - Shazzrah = 0; - Sulfuron = 0; - Golemagg = 0; - Domo = 0; - Ragnaros = 0; - FlamewakerPriest = 0; - - RuneKoro = 0; - RuneZeth = 0; - RuneMazj = 0; - RuneTheri = 0; - RuneBlaz = 0; - RuneKress = 0; - RuneMohn = 0; - - m_uiFirelordCacheGUID = 0; - - IsBossDied[0] = false; - IsBossDied[1] = false; - IsBossDied[2] = false; - IsBossDied[3] = false; - IsBossDied[4] = false; - IsBossDied[5] = false; - IsBossDied[6] = false; - - IsBossDied[7] = false; - IsBossDied[8] = false; - } - - bool IsEncounterInProgress() const - { - return false; - }; - - void OnGameObjectCreate(GameObject* pGo, bool /*add*/) - { - switch(pGo->GetEntry()) - { - case 176951: //Sulfuron - RuneKoro = pGo->GetGUID(); - break; - case 176952: //Geddon - RuneZeth = pGo->GetGUID(); - break; - case 176953: //Shazzrah - RuneMazj = pGo->GetGUID(); - break; - case 176954: //Golemagg - RuneTheri = pGo->GetGUID(); - break; - case 176955: //Garr - RuneBlaz = pGo->GetGUID(); - break; - case 176956: //Magmadar - RuneKress = pGo->GetGUID(); - break; - case 176957: //Gehennas - RuneMohn = pGo->GetGUID(); - break; - case 179703: - m_uiFirelordCacheGUID = pGo->GetGUID(); //when majordomo event == DONE DoRespawnGameObject(m_uiFirelordCacheGUID,); - break; - } - } - - void OnCreatureCreate(Creature* pCreature, bool /*add*/) - { - switch (pCreature->GetEntry()) - { - case ID_LUCIFRON: - Lucifron = pCreature->GetGUID(); - break; - - case ID_MAGMADAR: - Magmadar = pCreature->GetGUID(); - break; - - case ID_GEHENNAS: - Gehennas = pCreature->GetGUID(); - break; - - case ID_GARR: - Garr = pCreature->GetGUID(); - break; - - case ID_GEDDON: - Geddon = pCreature->GetGUID(); - break; - - case ID_SHAZZRAH: - Shazzrah = pCreature->GetGUID(); - break; - - case ID_SULFURON: - Sulfuron = pCreature->GetGUID(); - break; - - case ID_GOLEMAGG: - Golemagg = pCreature->GetGUID(); - break; - - case ID_DOMO: - Domo = pCreature->GetGUID(); - break; - - case ID_RAGNAROS: - Ragnaros = pCreature->GetGUID(); - break; - - case ID_FLAMEWAKERPRIEST: - FlamewakerPriest = pCreature->GetGUID(); - break; - } - } - - uint64 GetData64 (uint32 identifier) - { - switch(identifier) - { - case DATA_SULFURON: - return Sulfuron; - case DATA_GOLEMAGG: - return Golemagg; - - case DATA_FLAMEWAKERPRIEST: - return FlamewakerPriest; - } - - return 0; - } - - uint32 GetData(uint32 type) - { - switch(type) - { - case DATA_LUCIFRONISDEAD: - if (IsBossDied[0]) - return 1; - break; - - case DATA_MAGMADARISDEAD: - if (IsBossDied[1]) - return 1; - break; - - case DATA_GEHENNASISDEAD: - if (IsBossDied[2]) - return 1; - break; - - case DATA_GARRISDEAD: - if (IsBossDied[3]) - return 1; - break; - - case DATA_GEDDONISDEAD: - if (IsBossDied[4]) - return 1; - break; - - case DATA_SHAZZRAHISDEAD: - if (IsBossDied[5]) - return 1; - break; - - case DATA_SULFURONISDEAD: - if (IsBossDied[6]) - return 1; - break; - - case DATA_GOLEMAGGISDEAD: - if (IsBossDied[7]) - return 1; - break; - - case DATA_MAJORDOMOISDEAD: - if (IsBossDied[8]) - return 1; - break; - } - - return 0; - } - - void SetData(uint32 type, uint32 /*data*/) - { - if (type == DATA_GOLEMAGG_DEATH) - IsBossDied[7] = true; - } -}; - -InstanceData* GetInstance_instance_molten_core(Map* pMap) -{ - return new instance_molten_core (pMap); -} - -void AddSC_instance_molten_core() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_molten_core"; - newscript->GetInstanceData = &GetInstance_instance_molten_core; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/molten_core/molten_core.cpp b/src/server/scripts/EasternKingdoms/molten_core/molten_core.cpp deleted file mode 100644 index f8fe5bf1477..00000000000 --- a/src/server/scripts/EasternKingdoms/molten_core/molten_core.cpp +++ /dev/null @@ -1,81 +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: Molten_Core -SD%Complete: 100 -SDComment: -SDCategory: Molten Core -EndScriptData */ - -/* ContentData -mob_ancient_core_hound -EndContentData */ - -#include "ScriptedPch.h" -#include "ScriptedSimpleAI.h" - -#define SPELL_CONE_OF_FIRE 19630 -#define SPELL_BITE 19771 - -//Random Debuff (each hound has only one of these) -#define SPELL_GROUND_STOMP 19364 -#define SPELL_ANCIENT_DREAD 19365 -#define SPELL_CAUTERIZING_FLAMES 19366 -#define SPELL_WITHERING_HEAT 19367 -#define SPELL_ANCIENT_DESPAIR 19369 -#define SPELL_ANCIENT_HYSTERIA 19372 - -CreatureAI* GetAI_mob_ancient_core_hound(Creature* pCreature) -{ - SimpleAI *ai = new SimpleAI(pCreature); - - ai->Spell[0].Enabled = true; - ai->Spell[0].Spell_Id = SPELL_CONE_OF_FIRE; - ai->Spell[0].Cooldown = 7000; - ai->Spell[0].First_Cast = 10000; - ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_TARGET; - - uint32 RandDebuff = RAND(SPELL_GROUND_STOMP,SPELL_ANCIENT_DREAD,SPELL_CAUTERIZING_FLAMES, - SPELL_WITHERING_HEAT,SPELL_ANCIENT_DESPAIR,SPELL_ANCIENT_HYSTERIA); - - ai->Spell[1].Enabled = true; - ai->Spell[1].Spell_Id = RandDebuff; - ai->Spell[1].Cooldown = 24000; - ai->Spell[1].First_Cast = 15000; - ai->Spell[1].Cast_Target_Type = CAST_HOSTILE_TARGET; - - ai->Spell[2].Enabled = true; - ai->Spell[2].Spell_Id = SPELL_BITE; - ai->Spell[2].Cooldown = 6000; - ai->Spell[2].First_Cast = 4000; - ai->Spell[2].Cast_Target_Type = CAST_HOSTILE_TARGET; - - ai->EnterEvadeMode(); - - return ai; -} - -void AddSC_molten_core() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "mob_ancient_core_hound"; - newscript->GetAI = &GetAI_mob_ancient_core_hound; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/molten_core/molten_core.h b/src/server/scripts/EasternKingdoms/molten_core/molten_core.h deleted file mode 100644 index 5874d8b9408..00000000000 --- a/src/server/scripts/EasternKingdoms/molten_core/molten_core.h +++ /dev/null @@ -1,22 +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_MOLTEN_CORE_H -#define DEF_MOLTEN_CORE_H - -#define DATA_FLAMEWAKERPRIEST 1 -#define DATA_GARRISDEAD 2 -#define DATA_GEDDONISDEAD 3 -#define DATA_GEHENNASISDEAD 4 -#define DATA_GOLEMAGGISDEAD 5 -#define DATA_GOLEMAGG_DEATH 6 -#define DATA_LUCIFRONISDEAD 7 -#define DATA_MAGMADARISDEAD 8 -#define DATA_MAJORDOMOISDEAD 9 -#define DATA_SHAZZRAHISDEAD 10 -#define DATA_SULFURON 11 -#define DATA_SULFURONISDEAD 12 -#define DATA_GOLEMAGG 13 -#endif - diff --git a/src/server/scripts/EasternKingdoms/scarlet_enclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/scarlet_enclave/chapter1.cpp deleted file mode 100644 index bdbf6b7c081..00000000000 --- a/src/server/scripts/EasternKingdoms/scarlet_enclave/chapter1.cpp +++ /dev/null @@ -1,1079 +0,0 @@ -/* - * Copyright (C) 2009 Trinity - * - * 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 - */ - -#include "ScriptedPch.h" -#include "Vehicle.h" -#include "ObjectMgr.h" -#include "ScriptedEscortAI.h" - -/*###### -##Quest 12848 -######*/ - -#define GCD_CAST 1 - -enum eDeathKnightSpells -{ - SPELL_SOUL_PRISON_CHAIN_SELF = 54612, - SPELL_SOUL_PRISON_CHAIN = 54613, - SPELL_DK_INITIATE_VISUAL = 51519, - - SPELL_ICY_TOUCH = 52372, - SPELL_PLAGUE_STRIKE = 52373, - SPELL_BLOOD_STRIKE = 52374, - SPELL_DEATH_COIL = 52375 -}; - -#define EVENT_ICY_TOUCH 1 -#define EVENT_PLAGUE_STRIKE 2 -#define EVENT_BLOOD_STRIKE 3 -#define EVENT_DEATH_COIL 4 - -//used by 29519,29520,29565,29566,29567 but signed for 29519 -int32 say_event_start[8] = -{ - -1609000,-1609001,-1609002,-1609003, - -1609004,-1609005,-1609006,-1609007 -}; - -int32 say_event_attack[9] = -{ - -1609008,-1609009,-1609010,-1609011,-1609012, - -1609013,-1609014,-1609015,-1609016 -}; - -uint32 acherus_soul_prison[12] = -{ - 191577, - 191580, - 191581, - 191582, - 191583, - 191584, - 191585, - 191586, - 191587, - 191588, - 191589, - 191590 -}; - -uint32 acherus_unworthy_initiate[5] = -{ - 29519, - 29520, - 29565, - 29566, - 29567 -}; - -enum UnworthyInitiatePhase -{ - PHASE_CHAINED, - PHASE_TO_EQUIP, - PHASE_EQUIPING, - PHASE_TO_ATTACK, - PHASE_ATTACKING, -}; - -struct npc_unworthy_initiateAI : public ScriptedAI -{ - npc_unworthy_initiateAI(Creature *c) : ScriptedAI(c) - { - me->SetReactState(REACT_PASSIVE); - if (!me->GetEquipmentId()) - if (const CreatureInfo *info = GetCreatureInfo(28406)) - if (info->equipmentId) - const_cast(me->GetCreatureInfo())->equipmentId = info->equipmentId; - } - - uint64 playerGUID; - UnworthyInitiatePhase phase; - uint32 wait_timer; - float anchorX, anchorY; - uint64 anchorGUID; - - EventMap events; - - void Reset() - { - anchorGUID = 0; - phase = PHASE_CHAINED; - events.Reset(); - me->setFaction(7); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); - me->SetUInt32Value(UNIT_FIELD_BYTES_1, 8); - me->LoadEquipment(0, true); - } - - void EnterCombat(Unit * /*who*/) - { - events.ScheduleEvent(EVENT_ICY_TOUCH, 1000, GCD_CAST); - events.ScheduleEvent(EVENT_PLAGUE_STRIKE, 3000, GCD_CAST); - events.ScheduleEvent(EVENT_BLOOD_STRIKE, 2000, GCD_CAST); - events.ScheduleEvent(EVENT_DEATH_COIL, 5000, GCD_CAST); - } - - void MovementInform(uint32 type, uint32 id) - { - if (type != POINT_MOTION_TYPE) - return; - - if (id == 1) - { - wait_timer = 5000; - me->CastSpell(me, SPELL_DK_INITIATE_VISUAL, true); - - if (Player* starter = Unit::GetPlayer(playerGUID)) - DoScriptText(say_event_attack[rand()%9], me, starter); - - phase = PHASE_TO_ATTACK; - } - } - - void EventStart(Creature* anchor, Player *pTarget) - { - wait_timer = 5000; - phase = PHASE_TO_EQUIP; - - me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - me->RemoveAurasDueToSpell(SPELL_SOUL_PRISON_CHAIN_SELF); - me->RemoveAurasDueToSpell(SPELL_SOUL_PRISON_CHAIN); - - float z; - anchor->GetContactPoint(me, anchorX, anchorY, z, 1.0f); - - playerGUID = pTarget->GetGUID(); - DoScriptText(say_event_start[rand()%8], me, pTarget); - } - - void UpdateAI(const uint32 diff); -}; - -CreatureAI* GetAI_npc_unworthy_initiate(Creature* pCreature) -{ - return new npc_unworthy_initiateAI(pCreature); -} - -struct npc_unworthy_initiate_anchorAI : public PassiveAI -{ - npc_unworthy_initiate_anchorAI(Creature *c) : PassiveAI(c), prisonerGUID(0) {} - - uint64 prisonerGUID; - - void SetGUID(const uint64 &guid, int32 /*id*/) - { - if (!prisonerGUID) - prisonerGUID = guid; - } - - uint64 GetGUID(int32 /*id*/) { return prisonerGUID; } -}; - -void npc_unworthy_initiateAI::UpdateAI(const uint32 diff) -{ - switch(phase) - { - case PHASE_CHAINED: - if (!anchorGUID) - { - if (Creature *anchor = me->FindNearestCreature(29521, 30)) - { - anchor->AI()->SetGUID(me->GetGUID()); - anchor->CastSpell(me, SPELL_SOUL_PRISON_CHAIN, true); - anchorGUID = anchor->GetGUID(); - } - else - error_log("npc_unworthy_initiateAI: unable to find anchor!"); - - float dist = 99.0f; - GameObject *prison = NULL; - - for (uint8 i = 0; i < 12; ++i) - { - if (GameObject* temp_prison = me->FindNearestGameObject(acherus_soul_prison[i],30)) - { - if (me->IsWithinDist(temp_prison, dist, false)) - { - dist = me->GetDistance2d(temp_prison); - prison = temp_prison; - } - } - } - - if (prison) - prison->ResetDoorOrButton(); - else - error_log("npc_unworthy_initiateAI: unable to find prison!"); - } - return; - case PHASE_TO_EQUIP: - if (wait_timer) - { - if (wait_timer > diff) - wait_timer -= diff; - else - { - me->GetMotionMaster()->MovePoint(1, anchorX, anchorY, me->GetPositionZ()); - //debug_log("npc_unworthy_initiateAI: move to %f %f %f", anchorX, anchorY, me->GetPositionZ()); - phase = PHASE_EQUIPING; - wait_timer = 0; - } - } - return; - case PHASE_TO_ATTACK: - if (wait_timer) - { - if (wait_timer > diff) - wait_timer -= diff; - else - { - me->setFaction(14); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); - phase = PHASE_ATTACKING; - - if (Player *pTarget = Unit::GetPlayer(playerGUID)) - me->AI()->AttackStart(pTarget); - wait_timer = 0; - } - } - return; - case PHASE_ATTACKING: - if (!UpdateVictim()) - return; - - events.Update(diff); - - while (uint32 eventId = events.ExecuteEvent()) - { - switch(eventId) - { - case EVENT_ICY_TOUCH: - DoCast(me->getVictim(), SPELL_ICY_TOUCH); - events.DelayEvents(1000, GCD_CAST); - events.ScheduleEvent(EVENT_ICY_TOUCH, 5000, GCD_CAST); - break; - case EVENT_PLAGUE_STRIKE: - DoCast(me->getVictim(), SPELL_PLAGUE_STRIKE); - events.DelayEvents(1000, GCD_CAST); - events.ScheduleEvent(SPELL_PLAGUE_STRIKE, 5000, GCD_CAST); - break; - case EVENT_BLOOD_STRIKE: - DoCast(me->getVictim(), SPELL_BLOOD_STRIKE); - events.DelayEvents(1000, GCD_CAST); - events.ScheduleEvent(EVENT_BLOOD_STRIKE, 5000, GCD_CAST); - break; - case EVENT_DEATH_COIL: - DoCast(me->getVictim(), SPELL_DEATH_COIL); - events.DelayEvents(1000, GCD_CAST); - events.ScheduleEvent(EVENT_DEATH_COIL, 5000, GCD_CAST); - break; - } - } - - DoMeleeAttackIfReady(); - } -} - -CreatureAI* GetAI_npc_unworthy_initiate_anchor(Creature* pCreature) -{ - return new npc_unworthy_initiate_anchorAI(pCreature); -} - -bool GOHello_go_acherus_soul_prison(Player* pPlayer, GameObject* pGo) -{ - if (Creature *anchor = pGo->FindNearestCreature(29521, 15)) - if (uint64 prisonerGUID = anchor->AI()->GetGUID()) - if (Creature* prisoner = Creature::GetCreature(*pPlayer, prisonerGUID)) - CAST_AI(npc_unworthy_initiateAI, prisoner->AI())->EventStart(anchor, pPlayer); - - return false; -} - -/*###### -## npc_death_knight_initiate -######*/ - -#define GOSSIP_ACCEPT_DUEL "I challenge you, death knight!" - -enum eDuelEnums -{ - SAY_DUEL_A = -1609080, - SAY_DUEL_B = -1609081, - SAY_DUEL_C = -1609082, - SAY_DUEL_D = -1609083, - SAY_DUEL_E = -1609084, - SAY_DUEL_F = -1609085, - SAY_DUEL_G = -1609086, - SAY_DUEL_H = -1609087, - SAY_DUEL_I = -1609088, - - SPELL_DUEL = 52996, - //SPELL_DUEL_TRIGGERED = 52990, - SPELL_DUEL_VICTORY = 52994, - SPELL_DUEL_FLAG = 52991, - - QUEST_DEATH_CHALLENGE = 12733, - FACTION_HOSTILE = 2068 -}; - -int32 m_auiRandomSay[] = -{ - SAY_DUEL_A, SAY_DUEL_B, SAY_DUEL_C, SAY_DUEL_D, SAY_DUEL_E, SAY_DUEL_F, SAY_DUEL_G, SAY_DUEL_H, SAY_DUEL_I -}; - -struct npc_death_knight_initiateAI : public CombatAI -{ - npc_death_knight_initiateAI(Creature* pCreature) : CombatAI(pCreature) - { - m_bIsDuelInProgress = false; - } - - bool lose; - uint64 m_uiDuelerGUID; - uint32 m_uiDuelTimer; - bool m_bIsDuelInProgress; - - void Reset() - { - lose = false; - me->RestoreFaction(); - CombatAI::Reset(); - - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_15); - - m_uiDuelerGUID = 0; - m_uiDuelTimer = 5000; - m_bIsDuelInProgress = false; - } - - void SpellHit(Unit* pCaster, const SpellEntry* pSpell) - { - if (!m_bIsDuelInProgress && pSpell->Id == SPELL_DUEL) - { - m_uiDuelerGUID = pCaster->GetGUID(); - m_bIsDuelInProgress = true; - } - } - - void DamageTaken(Unit* pDoneBy, uint32 &uiDamage) - { - if (m_bIsDuelInProgress && pDoneBy->IsControlledByPlayer()) - { - if (pDoneBy->GetGUID() != m_uiDuelerGUID && pDoneBy->GetOwnerGUID() != m_uiDuelerGUID) // other players cannot help - uiDamage = 0; - else if (uiDamage >= me->GetHealth()) - { - uiDamage = 0; - - if (!lose) - { - pDoneBy->RemoveGameObject(SPELL_DUEL_FLAG, true); - pDoneBy->AttackStop(); - me->CastSpell(pDoneBy, SPELL_DUEL_VICTORY, true); - lose = true; - me->CastSpell(me, 7267, true); - me->RestoreFaction(); - } - } - } - } - - void UpdateAI(const uint32 uiDiff) - { - if (!UpdateVictim()) - { - if (m_bIsDuelInProgress) - { - if (m_uiDuelTimer <= uiDiff) - { - me->setFaction(FACTION_HOSTILE); - - if (Unit* pUnit = Unit::GetUnit(*me, m_uiDuelerGUID)) - AttackStart(pUnit); - } - else - m_uiDuelTimer -= uiDiff; - } - return; - } - - if (m_bIsDuelInProgress) - { - if (lose) - { - if (!me->HasAura(7267)) - EnterEvadeMode(); - return; - } - else if (me->getVictim()->GetTypeId() == TYPEID_PLAYER - && me->getVictim()->GetHealth() * 10 < me->getVictim()->GetMaxHealth()) - { - me->getVictim()->CastSpell(me->getVictim(), 7267, true); // beg - me->getVictim()->RemoveGameObject(SPELL_DUEL_FLAG, true); - EnterEvadeMode(); - return; - } - } - - // TODO: spells - - CombatAI::UpdateAI(uiDiff); - } -}; - -CreatureAI* GetAI_npc_death_knight_initiate(Creature* pCreature) -{ - return new npc_death_knight_initiateAI(pCreature); -} - -bool GossipHello_npc_death_knight_initiate(Player* pPlayer, Creature* pCreature) -{ - if (pPlayer->GetQuestStatus(QUEST_DEATH_CHALLENGE) == QUEST_STATUS_INCOMPLETE && pCreature->GetHealth() == pCreature->GetMaxHealth()) - { - if (pPlayer->GetHealth() * 10 < pPlayer->GetMaxHealth()) - return true; - - if (pPlayer->isInCombat() || pCreature->isInCombat()) - return true; - - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ACCEPT_DUEL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature),pCreature->GetGUID()); - } - return true; -} - -bool GossipSelect_npc_death_knight_initiate(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_INFO_DEF) - { - pPlayer->CLOSE_GOSSIP_MENU(); - - if (pPlayer->isInCombat() || pCreature->isInCombat()) - return true; - - if (npc_death_knight_initiateAI* pInitiateAI = CAST_AI(npc_death_knight_initiateAI, pCreature->AI())) - { - if (pInitiateAI->m_bIsDuelInProgress) - return true; - } - - pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); - pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_15); - - int32 uiSayId = rand()% (sizeof(m_auiRandomSay)/sizeof(int32)); - DoScriptText(m_auiRandomSay[uiSayId], pCreature, pPlayer); - - pPlayer->CastSpell(pCreature, SPELL_DUEL, false); - pPlayer->CastSpell(pPlayer, SPELL_DUEL_FLAG, true); - } - return true; -} - -/*###### -## npc_dark_rider_of_acherus -######*/ - -#define DESPAWN_HORSE 52267 -#define SAY_DARK_RIDER "The realm of shadows awaits..." - -struct npc_dark_rider_of_acherusAI : public ScriptedAI -{ - npc_dark_rider_of_acherusAI(Creature *c) : ScriptedAI(c) {} - - uint32 PhaseTimer; - uint32 Phase; - bool Intro; - uint64 TargetGUID; - - void Reset() - { - PhaseTimer = 4000; - Phase = 0; - Intro = false; - TargetGUID = 0; - } - - void UpdateAI(const uint32 diff) - { - if (!Intro || !TargetGUID) - return; - - if (PhaseTimer <= diff) - { - switch(Phase) - { - case 0: - me->MonsterSay(SAY_DARK_RIDER, LANG_UNIVERSAL, 0); - PhaseTimer = 5000; - Phase = 1; - break; - case 1: - if (Unit *pTarget = Unit::GetUnit(*me, TargetGUID)) - DoCast(pTarget, DESPAWN_HORSE, true); - PhaseTimer = 3000; - Phase = 2; - break; - case 2: - me->SetVisibility(VISIBILITY_OFF); - PhaseTimer = 2000; - Phase = 3; - break; - case 3: - me->ForcedDespawn(); - break; - default: - break; - } - } else PhaseTimer -= diff; - - } - - void InitDespawnHorse(Unit *who) - { - if (!who) - return; - - TargetGUID = who->GetGUID(); - me->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - me->SetSpeed(MOVE_RUN, 0.4f); - me->GetMotionMaster()->MoveChase(who); - me->SetUInt64Value(UNIT_FIELD_TARGET, TargetGUID); - Intro = true; - } - -}; - -CreatureAI* GetAI_npc_dark_rider_of_acherus(Creature* pCreature) -{ - return new npc_dark_rider_of_acherusAI(pCreature); -} - -/*###### -## npc_salanar_the_horseman -######*/ - -enum eSalanar -{ - REALM_OF_SHADOWS = 52693, - EFFECT_STOLEN_HORSE = 52263, - DELIVER_STOLEN_HORSE = 52264, - CALL_DARK_RIDER = 52266, - SPELL_EFFECT_OVERTAKE = 52349 -}; - -struct npc_salanar_the_horsemanAI : public ScriptedAI -{ - npc_salanar_the_horsemanAI(Creature *c) : ScriptedAI(c) {} - - void SpellHit(Unit *caster, const SpellEntry *spell) - { - if (spell->Id == DELIVER_STOLEN_HORSE) - { - if (caster->GetTypeId() == TYPEID_UNIT && caster->IsVehicle()) - { - if (Unit *charmer = caster->GetCharmer()) - { - charmer->RemoveAurasDueToSpell(EFFECT_STOLEN_HORSE); - caster->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK); - caster->setFaction(35); - DoCast(caster, CALL_DARK_RIDER, true); - if (Creature* Dark_Rider = me->FindNearestCreature(28654, 15)) - CAST_AI(npc_dark_rider_of_acherusAI, Dark_Rider->AI())->InitDespawnHorse(caster); - } - } - } - } - - void MoveInLineOfSight(Unit *who) - { - ScriptedAI::MoveInLineOfSight(who); - - if (who->GetTypeId() == TYPEID_UNIT && who->IsVehicle() && me->IsWithinDistInMap(who, 5.0f)) - { - if (Unit *charmer = who->GetCharmer()) - { - if (charmer->GetTypeId() == TYPEID_PLAYER) - { - // for quest Into the Realm of Shadows(12687) - if (me->GetEntry() == 28788 && CAST_PLR(charmer)->GetQuestStatus(12687) == QUEST_STATUS_INCOMPLETE) - { - CAST_PLR(charmer)->GroupEventHappens(12687, me); - charmer->RemoveAurasDueToSpell(SPELL_EFFECT_OVERTAKE); - CAST_CRE(who)->ForcedDespawn(); - //CAST_CRE(who)->Respawn(true); - } - - if (CAST_PLR(charmer)->HasAura(REALM_OF_SHADOWS)) - charmer->RemoveAurasDueToSpell(REALM_OF_SHADOWS); - } - } - } - } -}; - -CreatureAI* GetAI_npc_salanar_the_horseman(Creature* pCreature) -{ - return new npc_salanar_the_horsemanAI(pCreature); -} - -/*###### -## npc_ros_dark_rider -######*/ - -struct npc_ros_dark_riderAI : public ScriptedAI -{ - npc_ros_dark_riderAI(Creature *c) : ScriptedAI(c) {} - - void EnterCombat(Unit * /*who*/) - { - me->ExitVehicle(); - } - - void Reset() - { - Creature* deathcharger = me->FindNearestCreature(28782, 30); - if (!deathcharger) return; - deathcharger->RestoreFaction(); - deathcharger->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK); - deathcharger->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - if (!me->GetVehicle() && deathcharger->IsVehicle() && deathcharger->GetVehicleKit()->HasEmptySeat(0)) - me->EnterVehicle(deathcharger); - } - - void JustDied(Unit *killer) - { - Creature* deathcharger = me->FindNearestCreature(28782, 30); - if (!deathcharger) return; - if (killer->GetTypeId() == TYPEID_PLAYER && deathcharger->GetTypeId() == TYPEID_UNIT && deathcharger->IsVehicle()) - { - deathcharger->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK); - deathcharger->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - deathcharger->setFaction(2096); - } - } -}; - -CreatureAI* GetAI_npc_ros_dark_rider(Creature* pCreature) -{ - return new npc_ros_dark_riderAI(pCreature); -} - -// correct way: 52312 52314 52555 ... -enum SG -{ - GHOULS = 28845, - GHOSTS = 28846, -}; -struct npc_dkc1_gothikAI : public ScriptedAI -{ - npc_dkc1_gothikAI(Creature *c) : ScriptedAI(c) {} - - void MoveInLineOfSight(Unit *who) - { - ScriptedAI::MoveInLineOfSight(who); - - if (who->GetEntry() == GHOULS && me->IsWithinDistInMap(who, 10.0f)) - { - if (Unit *owner = who->GetOwner()) - { - if (owner->GetTypeId() == TYPEID_PLAYER) - { - if (CAST_PLR(owner)->GetQuestStatus(12698) == QUEST_STATUS_INCOMPLETE) - { - //CAST_CRE(who)->CastSpell(owner, 52517, true); - CAST_PLR(owner)->KilledMonsterCredit(GHOULS, me->GetGUID()); - } - //Todo: Creatures must not be removed, but, must instead - // stand next to Gothik and be commanded into the pit - // and dig into the ground. - CAST_CRE(who)->ForcedDespawn(); - - if (CAST_PLR(owner)->GetQuestStatus(12698) == QUEST_STATUS_COMPLETE) - owner->RemoveAllMinionsByEntry(GHOULS); - } - } - } - } -}; - -CreatureAI* GetAI_npc_dkc1_gothik(Creature* pCreature) -{ - return new npc_dkc1_gothikAI(pCreature); -} - -struct npc_scarlet_ghoulAI : public ScriptedAI -{ - npc_scarlet_ghoulAI(Creature *c) : ScriptedAI(c) - { - // Ghouls should display their Birth Animation - // Crawling out of the ground - //DoCast(me, 35177, true); - //me->MonsterSay("Mommy?",LANG_UNIVERSAL,0); - me->SetReactState(REACT_DEFENSIVE); - } - - void FindMinions(Unit *owner) - { - std::list MinionList; - owner->GetAllMinionsByEntry(MinionList,GHOULS); - - if (!MinionList.empty()) - { - for (std::list::const_iterator itr = MinionList.begin(); itr != MinionList.end(); ++itr) - { - if (CAST_CRE(*itr)->GetOwner()->GetGUID() == me->GetOwner()->GetGUID()) - { - if (CAST_CRE(*itr)->isInCombat() && CAST_CRE(*itr)->getAttackerForHelper()) - { - AttackStart(CAST_CRE(*itr)->getAttackerForHelper()); - } - } - } - } - } - - void UpdateAI(const uint32 /*diff*/) - { - if (!me->isInCombat()) - { - if (Unit *owner = me->GetOwner()) - { - if (owner->GetTypeId() == TYPEID_PLAYER && CAST_PLR(owner)->isInCombat()) - { - if (CAST_PLR(owner)->getAttackerForHelper() && CAST_PLR(owner)->getAttackerForHelper()->GetEntry() == GHOSTS) - { - AttackStart(CAST_PLR(owner)->getAttackerForHelper()); - } - else - { - FindMinions(owner); - } - } - } - } - - if (!UpdateVictim()) - return; - - //ScriptedAI::UpdateAI(diff); - //Check if we have a current target - if (me->getVictim()->GetEntry() == GHOSTS) - { - if (me->isAttackReady()) - { - //If we are within range melee the target - if (me->IsWithinMeleeRange(me->getVictim())) - { - me->AttackerStateUpdate(me->getVictim()); - me->resetAttackTimer(); - } - } - } - } -}; - -CreatureAI* GetAI_npc_scarlet_ghoul(Creature* pCreature) -{ - return new npc_scarlet_ghoulAI(pCreature); -} - -/*#### -## npc_scarlet_miner_cart -####*/ - -#define SPELL_CART_CHECK 54173 -#define SPELL_CART_DRAG 52465 - -struct npc_scarlet_miner_cartAI : public PassiveAI -{ - npc_scarlet_miner_cartAI(Creature *c) : PassiveAI(c), minerGUID(0) - { - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); - me->SetDisplayId(me->GetCreatureInfo()->Modelid1); // H0 is horse - } - - uint64 minerGUID; - - void SetGUID(const uint64 &guid, int32 /*id*/) - { - minerGUID = guid; - } - - void DoAction(const int32 /*param*/) - { - if (Creature *miner = Unit::GetCreature(*me, minerGUID)) - { - // very bad visual effect - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - //me->SetSpeed(MOVE_WALK, miner->GetSpeed(MOVE_WALK)); - me->SetSpeed(MOVE_RUN, miner->GetSpeed(MOVE_RUN)); - me->GetMotionMaster()->MoveFollow(miner, 1.0f, 0); - } - } - - void PassengerBoarded(Unit * /*who*/, int8 /*seatId*/, bool apply) - { - if (!apply) - if (Creature *miner = Unit::GetCreature(*me, minerGUID)) - miner->DisappearAndDie(); - } -}; - -CreatureAI* GetAI_npc_scarlet_miner_cart(Creature *_Creature) -{ - return new npc_scarlet_miner_cartAI(_Creature); -} - -/*#### -## npc_scarlet_miner -####*/ - -#define SAY_SCARLET_MINER1 "Where'd this come from? I better get this down to the ships before the foreman sees it!" -#define SAY_SCARLET_MINER2 "Now I can have a rest!" - -struct npc_scarlet_minerAI : public npc_escortAI -{ - npc_scarlet_minerAI(Creature *c) : npc_escortAI(c) - { - me->SetReactState(REACT_PASSIVE); - } - - uint32 IntroTimer; - uint32 IntroPhase; - uint64 carGUID; - - void Reset() - { - carGUID = 0; - IntroTimer = 0; - IntroPhase = 0; - } - - void InitWaypoint() - { - AddWaypoint(1, 2389.03, -5902.74, 109.014, 5000); - AddWaypoint(2, 2341.812012, -5900.484863, 102.619743); - AddWaypoint(3, 2306.561279, -5901.738281, 91.792419); - AddWaypoint(4, 2300.098389, -5912.618652, 86.014885); - AddWaypoint(5, 2294.142090, -5927.274414, 75.316849); - AddWaypoint(6, 2286.984375, -5944.955566, 63.714966); - AddWaypoint(7, 2280.001709, -5961.186035, 54.228283); - AddWaypoint(8, 2259.389648, -5974.197754, 42.359348); - AddWaypoint(9, 2242.882812, -5984.642578, 32.827850); - AddWaypoint(10, 2217.265625, -6028.959473, 7.675705); - AddWaypoint(11, 2202.595947, -6061.325684, 5.882018); - AddWaypoint(12, 2188.974609, -6080.866699, 3.370027); - - if (urand(0,1)) - { - AddWaypoint(13, 2176.483887, -6110.407227, 1.855181); - AddWaypoint(14, 2172.516602, -6146.752441, 1.074235); - AddWaypoint(15, 2138.918457, -6158.920898, 1.342926); - AddWaypoint(16, 2129.866699, -6174.107910, 4.380779); - AddWaypoint(17, 2117.709473, -6193.830078, 13.3542, 10000); - } - else - { - AddWaypoint(13, 2184.190186, -6166.447266, 0.968877); - AddWaypoint(14, 2234.265625, -6163.741211, 0.916021); - AddWaypoint(15, 2268.071777, -6158.750977, 1.822252); - AddWaypoint(16, 2270.028320, -6176.505859, 6.340538); - AddWaypoint(17, 2271.739014, -6195.401855, 13.3542, 10000); - } - } - - void InitCartQuest(Player *who) - { - carGUID = who->GetVehicleBase()->GetGUID(); - InitWaypoint(); - Start(false, false, who->GetGUID()); - SetDespawnAtFar(false); - } - - void WaypointReached(uint32 i) - { - switch (i) - { - case 1: - if (Unit *car = Unit::GetCreature(*me, carGUID)) - { - me->SetInFront(car); - me->SendMovementFlagUpdate(); - } - me->MonsterSay(SAY_SCARLET_MINER1,LANG_UNIVERSAL,NULL); - SetRun(true); - IntroTimer = 4000; - IntroPhase = 1; - break; - case 17: - if (Unit *car = Unit::GetCreature(*me, carGUID)) - { - me->SetInFront(car); - me->SendMovementFlagUpdate(); - car->Relocate(car->GetPositionX(), car->GetPositionY(), me->GetPositionZ()); - car->SendMonsterStop(); - //this make player fall under ground, dunno why - //car->GetMotionMaster()->MovePoint(0, car->GetPositionX(), car->GetPositionY(), me->GetPositionZ()); - car->RemoveAura(SPELL_CART_DRAG); - } - me->MonsterSay(SAY_SCARLET_MINER2,LANG_UNIVERSAL,NULL); - break; - default: - break; - } - } - - void UpdateAI(const uint32 diff) - { - if (IntroPhase) - { - if (IntroTimer <= diff) - { - if (IntroPhase == 1) - { - if (Creature *car = Unit::GetCreature(*me, carGUID)) - DoCast(car, SPELL_CART_DRAG); - IntroTimer = 800; - IntroPhase = 2; - } - else - { - if (Creature *car = Unit::GetCreature(*me, carGUID)) - car->AI()->DoAction(); - IntroPhase = 0; - } - } else IntroTimer-=diff; - } - npc_escortAI::UpdateAI(diff); - } -}; - -CreatureAI* GetAI_npc_scarlet_miner(Creature *_Creature) -{ - return new npc_scarlet_minerAI(_Creature); -} - -/*###### -## go_inconspicuous_mine_car -######*/ - -#define SPELL_CART_SUMM 52463 - -bool GOHello_go_inconspicuous_mine_car(Player* pPlayer, GameObject* /*pGO*/) -{ - if (pPlayer->GetQuestStatus(12701) == QUEST_STATUS_INCOMPLETE) - { - // Hack Why Trinity Dont Support Custom Summon Location - if (Creature *miner = pPlayer->SummonCreature(28841, 2383.869629, -5900.312500, 107.996086, pPlayer->GetOrientation(),TEMPSUMMON_DEAD_DESPAWN, 1)) - { - pPlayer->CastSpell(pPlayer, SPELL_CART_SUMM, true); - if (Creature *car = pPlayer->GetVehicleCreatureBase()) - { - if (car->GetEntry() == 28817) - { - car->AI()->SetGUID(miner->GetGUID()); - CAST_AI(npc_scarlet_minerAI, miner->AI())->InitCartQuest(pPlayer); - } else error_log("TSCR: GOHello_go_inconspicuous_mine_car vehicle entry is not correct."); - } else error_log("TSCR: GOHello_go_inconspicuous_mine_car player is not on the vehicle."); - } else error_log("TSCR: GOHello_go_inconspicuous_mine_car Scarlet Miner cant be found by script."); - } - return true; -} - -// npc 28912 quest 17217 boss 29001 mob 29007 go 191092 - -void AddSC_the_scarlet_enclave_c1() -{ - Script *newscript; - - // 12848 The Endless Hunger - newscript = new Script; - newscript->Name = "npc_unworthy_initiate"; - newscript->GetAI = &GetAI_npc_unworthy_initiate; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_unworthy_initiate_anchor"; - newscript->GetAI = &GetAI_npc_unworthy_initiate_anchor; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "go_acherus_soul_prison"; - newscript->pGOHello = &GOHello_go_acherus_soul_prison; - newscript->RegisterSelf(); - - // Death's Challenge - newscript = new Script; - newscript->Name = "npc_death_knight_initiate"; - newscript->GetAI = &GetAI_npc_death_knight_initiate; - newscript->pGossipHello = &GossipHello_npc_death_knight_initiate; - newscript->pGossipSelect = &GossipSelect_npc_death_knight_initiate; - newscript->RegisterSelf(); - - // 12680 Grand Theft Palomino - newscript = new Script; - newscript->Name = "npc_salanar_the_horseman"; - newscript->GetAI = &GetAI_npc_salanar_the_horseman; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_dark_rider_of_acherus"; - newscript->GetAI = &GetAI_npc_dark_rider_of_acherus; - newscript->RegisterSelf(); - - // 12687 Into the Realm of Shadows - newscript = new Script; - newscript->Name = "npc_ros_dark_rider"; - newscript->GetAI = &GetAI_npc_ros_dark_rider; - newscript->RegisterSelf(); - - // 12698 The Gift That Keeps On Giving - newscript = new Script; - newscript->Name = "npc_dkc1_gothik"; - newscript->GetAI = &GetAI_npc_dkc1_gothik; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_scarlet_ghoul"; - newscript->GetAI = &GetAI_npc_scarlet_ghoul; - newscript->RegisterSelf(); - - // Massacre At Light's Point - newscript = new Script; - newscript->Name = "npc_scarlet_miner"; - newscript->GetAI = &GetAI_npc_scarlet_miner; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_scarlet_miner_cart"; - newscript->GetAI = &GetAI_npc_scarlet_miner_cart; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "go_inconspicuous_mine_car"; - newscript->pGOHello = &GOHello_go_inconspicuous_mine_car; - newscript->RegisterSelf(); -} - -/* -DELETE FROM `script_texts` WHERE `entry` IN(-1609301, -1609302); -INSERT INTO `script_texts` (`entry`,`content_default`,`type`,`language`,`emote`,`comment`) VALUES -(-1609301, 'Come, weakling! Strike me down!', 0, 0, 0, 'SAY_DEATH_RIDER_FINAL'), -(-1609302, '%s rears up, beckoning you to ride it.', 2, 0, 0, 'SAY_DEATH_CHARGER'); -*/ diff --git a/src/server/scripts/EasternKingdoms/scarlet_enclave/chapter2.cpp b/src/server/scripts/EasternKingdoms/scarlet_enclave/chapter2.cpp deleted file mode 100644 index 91f7e0e6cbe..00000000000 --- a/src/server/scripts/EasternKingdoms/scarlet_enclave/chapter2.cpp +++ /dev/null @@ -1,995 +0,0 @@ -/* - * Copyright (C) 2009 Trinity - * - * 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 - */ - -#include "ScriptedPch.h" -#include "ScriptedEscortAI.h" - -//How to win friends and influence enemies -// texts signed for creature 28939 but used for 28939,28940,28610 -enum win_friends -{ - SAY_PERSUADE1 = -1609501, - SAY_PERSUADE2 = -1609502, - SAY_PERSUADE3 = -1609503, - SAY_PERSUADE4 = -1609504, - SAY_PERSUADE5 = -1609505, - SAY_PERSUADE6 = -1609506, - SAY_PERSUADE7 = -1609507, - SAY_CRUSADER1 = -1609508, - SAY_CRUSADER2 = -1609509, - SAY_CRUSADER3 = -1609510, - SAY_CRUSADER4 = -1609511, - SAY_CRUSADER5 = -1609512, - SAY_CRUSADER6 = -1609513, - SAY_PERSUADED1 = -1609514, - SAY_PERSUADED2 = -1609515, - SAY_PERSUADED3 = -1609516, - SAY_PERSUADED4 = -1609517, - SAY_PERSUADED5 = -1609518, - SAY_PERSUADED6 = -1609519, - SPELL_PERSUASIVE_STRIKE = 52781 -}; - -struct npc_crusade_persuadedAI : public ScriptedAI -{ - npc_crusade_persuadedAI(Creature *pCreature) : ScriptedAI(pCreature) {} - - uint32 uiSpeech_timer; - uint32 uiSpeech_counter; - uint64 uiPlayerGUID; - - void Reset() - { - uiSpeech_timer = 0; - uiSpeech_counter = 0; - uiPlayerGUID = 0; - me->SetReactState(REACT_AGGRESSIVE); - me->RestoreFaction(); - } - - void SpellHit(Unit *caster, const SpellEntry *spell) - { - if (spell->Id == SPELL_PERSUASIVE_STRIKE && caster->GetTypeId() == TYPEID_PLAYER && me->isAlive() && !uiSpeech_counter) - { - if (CAST_PLR(caster)->GetQuestStatus(12720) == QUEST_STATUS_INCOMPLETE) - { - uiPlayerGUID = caster->GetGUID(); - uiSpeech_timer = 1000; - uiSpeech_counter = 1; - me->setFaction(caster->getFaction()); - me->CombatStop(true); - me->GetMotionMaster()->MoveIdle(); - me->SetReactState(REACT_PASSIVE); - DoCastAOE(58111, true); - - DoScriptText(RAND(SAY_PERSUADE1,SAY_PERSUADE2,SAY_PERSUADE3, - SAY_PERSUADE4,SAY_PERSUADE5,SAY_PERSUADE6, - SAY_PERSUADE7), caster); - - DoScriptText(RAND(SAY_CRUSADER1,SAY_CRUSADER2,SAY_CRUSADER3, - SAY_CRUSADER4,SAY_CRUSADER5,SAY_CRUSADER6), me); - } - } - } - - void UpdateAI(const uint32 diff) - { - if (uiSpeech_counter) - { - if (uiSpeech_timer <= diff) - { - Player* pPlayer = Unit::GetPlayer(uiPlayerGUID); - if (!pPlayer) - { - EnterEvadeMode(); - return; - } - - switch(uiSpeech_counter) - { - case 1: DoScriptText(SAY_PERSUADED1, me); uiSpeech_timer = 8000; break; - case 2: DoScriptText(SAY_PERSUADED2, me); uiSpeech_timer = 8000; break; - case 3: DoScriptText(SAY_PERSUADED3, me); uiSpeech_timer = 8000; break; - case 4: DoScriptText(SAY_PERSUADED4, me); uiSpeech_timer = 8000; break; - case 5: DoScriptText(SAY_PERSUADED5, pPlayer); uiSpeech_timer = 8000; break; - case 6: DoScriptText(SAY_PERSUADED6, me); - pPlayer->Kill(me); - //me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - //me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - uiSpeech_counter = 0; - pPlayer->GroupEventHappens(12720, me); - return; - } - - ++uiSpeech_counter; - DoCastAOE(58111, true); - } else uiSpeech_timer -= diff; - - return; - } - - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_npc_crusade_persuaded(Creature* pCreature) -{ - return new npc_crusade_persuadedAI (pCreature); -} - -/*###### -## npc_koltira_deathweaver -######*/ - -enum eKoltira -{ - SAY_BREAKOUT1 = -1609561, - SAY_BREAKOUT2 = -1609562, - SAY_BREAKOUT3 = -1609563, - SAY_BREAKOUT4 = -1609564, - SAY_BREAKOUT5 = -1609565, - SAY_BREAKOUT6 = -1609566, - SAY_BREAKOUT7 = -1609567, - SAY_BREAKOUT8 = -1609568, - SAY_BREAKOUT9 = -1609569, - SAY_BREAKOUT10 = -1609570, - - SPELL_KOLTIRA_TRANSFORM = 52899, - SPELL_ANTI_MAGIC_ZONE = 52894, - - QUEST_BREAKOUT = 12727, - - NPC_CRIMSON_ACOLYTE = 29007, - NPC_HIGH_INQUISITOR_VALROTH = 29001, - NPC_KOLTIRA_ALT = 28447, - - //not sure about this id - //NPC_DEATH_KNIGHT_MOUNT = 29201, - MODEL_DEATH_KNIGHT_MOUNT = 25278 -}; - -struct npc_koltira_deathweaverAI : public npc_escortAI -{ - npc_koltira_deathweaverAI(Creature *pCreature) : npc_escortAI(pCreature) - { - me->SetReactState(REACT_DEFENSIVE); - } - - uint32 m_uiWave; - uint32 m_uiWave_Timer; - uint64 m_uiValrothGUID; - - void Reset() - { - if (!HasEscortState(STATE_ESCORT_ESCORTING)) - { - m_uiWave = 0; - m_uiWave_Timer = 3000; - m_uiValrothGUID = 0; - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->LoadEquipment(0, true); - me->RemoveAura(SPELL_ANTI_MAGIC_ZONE); - } - } - - void WaypointReached(uint32 uiPointId) - { - switch(uiPointId) - { - case 0: - DoScriptText(SAY_BREAKOUT1, me); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - break; - case 1: - me->SetStandState(UNIT_STAND_STATE_KNEEL); - break; - case 2: - me->SetStandState(UNIT_STAND_STATE_STAND); - //me->UpdateEntry(NPC_KOLTIRA_ALT); //unclear if we must update or not - DoCast(me, SPELL_KOLTIRA_TRANSFORM); - me->LoadEquipment(me->GetEquipmentId()); - break; - case 3: - SetEscortPaused(true); - me->SetStandState(UNIT_STAND_STATE_KNEEL); - DoScriptText(SAY_BREAKOUT2, me); - DoCast(me, SPELL_ANTI_MAGIC_ZONE); // cast again that makes bubble up - break; - case 4: - SetRun(true); - break; - case 9: - me->Mount(MODEL_DEATH_KNIGHT_MOUNT); - break; - case 10: - me->Unmount(); - break; - } - } - - void JustSummoned(Creature* pSummoned) - { - if (Player* pPlayer = GetPlayerForEscort()) - { - pSummoned->AI()->AttackStart(pPlayer); - } - - if (pSummoned->GetEntry() == NPC_HIGH_INQUISITOR_VALROTH) - m_uiValrothGUID = pSummoned->GetGUID(); - - pSummoned->AddThreat(me, 0.0f); - pSummoned->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); - } - - void SummonAcolyte(uint32 uiAmount) - { - for (uint32 i = 0; i < uiAmount; ++i) - me->SummonCreature(NPC_CRIMSON_ACOLYTE, 1642.329, -6045.818, 127.583, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); - } - - void UpdateAI(const uint32 uiDiff) - { - npc_escortAI::UpdateAI(uiDiff); - - if (HasEscortState(STATE_ESCORT_PAUSED)) - { - if (m_uiWave_Timer <= uiDiff) - { - switch(m_uiWave) - { - case 0: - DoScriptText(SAY_BREAKOUT3, me); - SummonAcolyte(3); - m_uiWave_Timer = 20000; - break; - case 1: - DoScriptText(SAY_BREAKOUT4, me); - SummonAcolyte(3); - m_uiWave_Timer = 20000; - break; - case 2: - DoScriptText(SAY_BREAKOUT5, me); - SummonAcolyte(4); - m_uiWave_Timer = 20000; - break; - case 3: - DoScriptText(SAY_BREAKOUT6, me); - me->SummonCreature(NPC_HIGH_INQUISITOR_VALROTH, 1642.329, -6045.818, 127.583, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000); - m_uiWave_Timer = 1000; - break; - case 4: - { - Creature* pTemp = Unit::GetCreature(*me, m_uiValrothGUID); - - if (!pTemp || !pTemp->isAlive()) - { - DoScriptText(SAY_BREAKOUT8, me); - m_uiWave_Timer = 5000; - } - else - { - m_uiWave_Timer = 2500; - return; //return, we don't want m_uiWave to increment now - } - break; - } - case 5: - DoScriptText(SAY_BREAKOUT9, me); - me->RemoveAurasDueToSpell(SPELL_ANTI_MAGIC_ZONE); - // i do not know why the armor will also be removed - m_uiWave_Timer = 2500; - break; - case 6: - DoScriptText(SAY_BREAKOUT10, me); - SetEscortPaused(false); - break; - } - - ++m_uiWave; - } - else - m_uiWave_Timer -= uiDiff; - } - } -}; - -CreatureAI* GetAI_npc_koltira_deathweaver(Creature* pCreature) -{ - return new npc_koltira_deathweaverAI(pCreature); -} - -bool QuestAccept_npc_koltira_deathweaver(Player* pPlayer, Creature* pCreature, const Quest* pQuest) -{ - if (pQuest->GetQuestId() == QUEST_BREAKOUT) - { - pCreature->SetStandState(UNIT_STAND_STATE_STAND); - - if (npc_escortAI* pEscortAI = CAST_AI(npc_koltira_deathweaverAI,pCreature->AI())) - pEscortAI->Start(false, false, pPlayer->GetGUID()); - } - return true; -} - -//Scarlet courier -enum ScarletCourierEnum -{ - SAY_TREE1 = -1609531, - SAY_TREE2 = -1609532, - SPELL_SHOOT = 52818, - GO_INCONSPICUOUS_TREE = 191144, - NPC_SCARLET_COURIER = 29076 -}; - -struct mob_scarlet_courierAI : public ScriptedAI -{ - mob_scarlet_courierAI(Creature *pCreature) : ScriptedAI(pCreature) {} - - uint32 uiStage; - uint32 uiStage_timer; - - void Reset() - { - me->Mount(14338); // not sure about this id - uiStage = 1; - uiStage_timer = 3000; - } - - void EnterCombat(Unit * /*who*/) - { - DoScriptText(SAY_TREE2, me); - me->Unmount(); - uiStage = 0; - } - - void MovementInform(uint32 type, uint32 id) - { - if (type != POINT_MOTION_TYPE) - return; - - if (id == 1) - uiStage = 2; - } - - void UpdateAI(const uint32 diff) - { - if (uiStage && !me->isInCombat()) - { - if (uiStage_timer <= diff) - { - switch(uiStage) - { - case 1: - me->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - if (GameObject* tree = me->FindNearestGameObject(GO_INCONSPICUOUS_TREE, 40.0f)) - { - DoScriptText(SAY_TREE1, me); - float x, y, z; - tree->GetContactPoint(me, x, y, z); - me->GetMotionMaster()->MovePoint(1, x, y, z); - } - break; - case 2: - if (GameObject* tree = me->FindNearestGameObject(GO_INCONSPICUOUS_TREE, 40.0f)) - if (Unit *unit = tree->GetOwner()) - AttackStart(unit); - break; - } - uiStage_timer = 3000; - uiStage = 0; - } else uiStage_timer -= diff; - } - - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_scarlet_courier(Creature* pCreature) -{ - return new mob_scarlet_courierAI (pCreature); -} - -//Koltira & Valroth- Breakout - -enum valroth -{ - SAY_VALROTH1 = -1609581, - SAY_VALROTH2 = -1609582, - SAY_VALROTH3 = -1609583, - SAY_VALROTH4 = -1609584, - SAY_VALROTH5 = -1609585, - SAY_VALROTH6 = -1609586, - SPELL_RENEW = 38210, - SPELL_INQUISITOR_PENANCE = 52922, - SPELL_VALROTH_SMITE = 52926, - SPELL_SUMMON_VALROTH_REMAINS = 52929 -}; - -struct mob_high_inquisitor_valrothAI : public ScriptedAI -{ - mob_high_inquisitor_valrothAI(Creature *pCreature) : ScriptedAI(pCreature) {} - - uint32 uiRenew_timer; - uint32 uiInquisitor_Penance_timer; - uint32 uiValroth_Smite_timer; - - void Reset() - { - uiRenew_timer = 1000; - uiInquisitor_Penance_timer = 2000; - uiValroth_Smite_timer = 1000; - } - - void EnterCombat(Unit* who) - { - DoScriptText(SAY_VALROTH2, me); - DoCast(who, SPELL_VALROTH_SMITE); - } - - void UpdateAI(const uint32 diff) - { - if (uiRenew_timer <= diff) - { - Shout(); - DoCast(me, SPELL_RENEW); - uiRenew_timer = 1000 + rand()%5000; - } else uiRenew_timer -= diff; - - if (uiInquisitor_Penance_timer <= diff) - { - Shout(); - DoCast(me->getVictim(), SPELL_INQUISITOR_PENANCE); - uiInquisitor_Penance_timer = 2000 + rand()%5000; - } else uiInquisitor_Penance_timer -= diff; - - if (uiValroth_Smite_timer <= diff) - { - Shout(); - DoCast(me->getVictim(), SPELL_VALROTH_SMITE); - uiValroth_Smite_timer = 1000 + rand()%5000; - } else uiValroth_Smite_timer -= diff; - - DoMeleeAttackIfReady(); - } - - void Shout() - { - if (rand()%100 < 15) - DoScriptText(RAND(SAY_VALROTH3,SAY_VALROTH4,SAY_VALROTH5), me); - } - - void JustDied(Unit* killer) - { - DoScriptText(SAY_VALROTH6, me); - killer->CastSpell(me, SPELL_SUMMON_VALROTH_REMAINS, true); - } -}; - -CreatureAI* GetAI_mob_high_inquisitor_valroth(Creature* pCreature) -{ - return new mob_high_inquisitor_valrothAI (pCreature); -} - -/*###### -## npc_a_special_surprise -######*/ -//used by 29032,29061,29065,29067,29068,29070,29074,29072,29073,29071 but signed for 29032 -enum SpecialSurprise -{ - SAY_EXEC_START_1 = -1609025, // speech for all - SAY_EXEC_START_2 = -1609026, - SAY_EXEC_START_3 = -1609027, - SAY_EXEC_PROG_1 = -1609028, - SAY_EXEC_PROG_2 = -1609029, - SAY_EXEC_PROG_3 = -1609030, - SAY_EXEC_PROG_4 = -1609031, - SAY_EXEC_PROG_5 = -1609032, - SAY_EXEC_PROG_6 = -1609033, - SAY_EXEC_PROG_7 = -1609034, - SAY_EXEC_NAME_1 = -1609035, - SAY_EXEC_NAME_2 = -1609036, - SAY_EXEC_RECOG_1 = -1609037, - SAY_EXEC_RECOG_2 = -1609038, - SAY_EXEC_RECOG_3 = -1609039, - SAY_EXEC_RECOG_4 = -1609040, - SAY_EXEC_RECOG_5 = -1609041, - SAY_EXEC_RECOG_6 = -1609042, - SAY_EXEC_NOREM_1 = -1609043, - SAY_EXEC_NOREM_2 = -1609044, - SAY_EXEC_NOREM_3 = -1609045, - SAY_EXEC_NOREM_4 = -1609046, - SAY_EXEC_NOREM_5 = -1609047, - SAY_EXEC_NOREM_6 = -1609048, - SAY_EXEC_NOREM_7 = -1609049, - SAY_EXEC_NOREM_8 = -1609050, - SAY_EXEC_NOREM_9 = -1609051, - SAY_EXEC_THINK_1 = -1609052, - SAY_EXEC_THINK_2 = -1609053, - SAY_EXEC_THINK_3 = -1609054, - SAY_EXEC_THINK_4 = -1609055, - SAY_EXEC_THINK_5 = -1609056, - SAY_EXEC_THINK_6 = -1609057, - SAY_EXEC_THINK_7 = -1609058, - SAY_EXEC_THINK_8 = -1609059, - SAY_EXEC_THINK_9 = -1609060, - SAY_EXEC_THINK_10 = -1609061, - SAY_EXEC_LISTEN_1 = -1609062, - SAY_EXEC_LISTEN_2 = -1609063, - SAY_EXEC_LISTEN_3 = -1609064, - SAY_EXEC_LISTEN_4 = -1609065, - SAY_PLAGUEFIST = -1609066, - SAY_EXEC_TIME_1 = -1609067, - SAY_EXEC_TIME_2 = -1609068, - SAY_EXEC_TIME_3 = -1609069, - SAY_EXEC_TIME_4 = -1609070, - SAY_EXEC_TIME_5 = -1609071, - SAY_EXEC_TIME_6 = -1609072, - SAY_EXEC_TIME_7 = -1609073, - SAY_EXEC_TIME_8 = -1609074, - SAY_EXEC_TIME_9 = -1609075, - SAY_EXEC_TIME_10 = -1609076, - SAY_EXEC_WAITING = -1609077, - EMOTE_DIES = -1609078, - - NPC_PLAGUEFIST = 29053 -}; - -struct npc_a_special_surpriseAI : public ScriptedAI -{ - npc_a_special_surpriseAI(Creature *pCreature) : ScriptedAI(pCreature) {} - - uint32 ExecuteSpeech_Timer; - uint32 ExecuteSpeech_Counter; - uint64 PlayerGUID; - - void Reset() - { - ExecuteSpeech_Timer = 0; - ExecuteSpeech_Counter = 0; - PlayerGUID = 0; - - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); - } - - bool MeetQuestCondition(Unit* pPlayer) - { - switch(me->GetEntry()) - { - case 29061: // Ellen Stanbridge - if (CAST_PLR(pPlayer)->GetQuestStatus(12742) == QUEST_STATUS_INCOMPLETE) - return true; - break; - case 29072: // Kug Ironjaw - if (CAST_PLR(pPlayer)->GetQuestStatus(12748) == QUEST_STATUS_INCOMPLETE) - return true; - break; - case 29067: // Donovan Pulfrost - if (CAST_PLR(pPlayer)->GetQuestStatus(12744) == QUEST_STATUS_INCOMPLETE) - return true; - break; - case 29065: // Yazmina Oakenthorn - if (CAST_PLR(pPlayer)->GetQuestStatus(12743) == QUEST_STATUS_INCOMPLETE) - return true; - break; - case 29071: // Antoine Brack - if (CAST_PLR(pPlayer)->GetQuestStatus(12750) == QUEST_STATUS_INCOMPLETE) - return true; - break; - case 29032: // Malar Bravehorn - if (CAST_PLR(pPlayer)->GetQuestStatus(12739) == QUEST_STATUS_INCOMPLETE) - return true; - break; - case 29068: // Goby Blastenheimer - if (CAST_PLR(pPlayer)->GetQuestStatus(12745) == QUEST_STATUS_INCOMPLETE) - return true; - break; - case 29073: // Iggy Darktusk - if (CAST_PLR(pPlayer)->GetQuestStatus(12749) == QUEST_STATUS_INCOMPLETE) - return true; - break; - case 29074: // Lady Eonys - if (CAST_PLR(pPlayer)->GetQuestStatus(12747) == QUEST_STATUS_INCOMPLETE) - return true; - break; - case 29070: // Valok the Righteous - if (CAST_PLR(pPlayer)->GetQuestStatus(12746) == QUEST_STATUS_INCOMPLETE) - return true; - break; - } - - return false; - } - - void MoveInLineOfSight(Unit* pWho) - { - if (PlayerGUID || pWho->GetTypeId() != TYPEID_PLAYER || !pWho->IsWithinDist(me, INTERACTION_DISTANCE)) - return; - - if (MeetQuestCondition(pWho)) - PlayerGUID = pWho->GetGUID(); - } - - void UpdateAI(const uint32 diff) - { - if (PlayerGUID && !me->getVictim() && me->isAlive()) - { - if (ExecuteSpeech_Timer <= diff) - { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); - - if (!pPlayer) - { - Reset(); - return; - } - - //TODO: simplify text's selection - - switch(pPlayer->getRace()) - { - case RACE_HUMAN: - switch(ExecuteSpeech_Counter) - { - case 0: DoScriptText(SAY_EXEC_START_1, me, pPlayer); break; - case 1: me->SetStandState(UNIT_STAND_STATE_STAND); break; - case 2: DoScriptText(SAY_EXEC_PROG_5, me, pPlayer); break; - case 3: DoScriptText(SAY_EXEC_NAME_1, me, pPlayer); break; - case 4: DoScriptText(SAY_EXEC_RECOG_1, me, pPlayer); break; - case 5: DoScriptText(SAY_EXEC_NOREM_5, me, pPlayer); break; - case 6: DoScriptText(SAY_EXEC_THINK_7, me, pPlayer); break; - case 7: DoScriptText(SAY_EXEC_LISTEN_1, me, pPlayer); break; - case 8: - if (Creature* Plaguefist = GetClosestCreatureWithEntry(me, NPC_PLAGUEFIST, 85.0f)) - DoScriptText(SAY_PLAGUEFIST, Plaguefist, pPlayer); - break; - case 9: - DoScriptText(SAY_EXEC_TIME_6, me, pPlayer); - me->SetStandState(UNIT_STAND_STATE_KNEEL); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); - break; - case 10: DoScriptText(SAY_EXEC_WAITING, me, pPlayer); break; - case 11: - DoScriptText(EMOTE_DIES, me); - me->setDeathState(JUST_DIED); - me->SetHealth(0); - return; - } - break; - case RACE_ORC: - switch(ExecuteSpeech_Counter) - { - case 0: DoScriptText(SAY_EXEC_START_1, me, pPlayer); break; - case 1: me->SetStandState(UNIT_STAND_STATE_STAND); break; - case 2: DoScriptText(SAY_EXEC_PROG_6, me, pPlayer); break; - case 3: DoScriptText(SAY_EXEC_NAME_1, me, pPlayer); break; - case 4: DoScriptText(SAY_EXEC_RECOG_1, me, pPlayer); break; - case 5: DoScriptText(SAY_EXEC_NOREM_7, me, pPlayer); break; - case 6: DoScriptText(SAY_EXEC_THINK_8, me, pPlayer); break; - case 7: DoScriptText(SAY_EXEC_LISTEN_1, me, pPlayer); break; - case 8: - if (Creature* Plaguefist = GetClosestCreatureWithEntry(me, NPC_PLAGUEFIST, 85.0f)) - DoScriptText(SAY_PLAGUEFIST, Plaguefist, pPlayer); - break; - case 9: - DoScriptText(SAY_EXEC_TIME_8, me, pPlayer); - me->SetStandState(UNIT_STAND_STATE_KNEEL); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); - break; - case 10: DoScriptText(SAY_EXEC_WAITING, me, pPlayer); break; - case 11: - DoScriptText(EMOTE_DIES, me); - me->setDeathState(JUST_DIED); - me->SetHealth(0); - return; - } - break; - case RACE_DWARF: - switch(ExecuteSpeech_Counter) - { - case 0: DoScriptText(SAY_EXEC_START_2, me, pPlayer); break; - case 1: me->SetStandState(UNIT_STAND_STATE_STAND); break; - case 2: DoScriptText(SAY_EXEC_PROG_2, me, pPlayer); break; - case 3: DoScriptText(SAY_EXEC_NAME_1, me, pPlayer); break; - case 4: DoScriptText(SAY_EXEC_RECOG_3, me, pPlayer); break; - case 5: DoScriptText(SAY_EXEC_NOREM_2, me, pPlayer); break; - case 6: DoScriptText(SAY_EXEC_THINK_5, me, pPlayer); break; - case 7: DoScriptText(SAY_EXEC_LISTEN_2, me, pPlayer); break; - case 8: - if (Creature* Plaguefist = GetClosestCreatureWithEntry(me, NPC_PLAGUEFIST, 85.0f)) - DoScriptText(SAY_PLAGUEFIST, Plaguefist, pPlayer); - break; - case 9: - DoScriptText(SAY_EXEC_TIME_3, me, pPlayer); - me->SetStandState(UNIT_STAND_STATE_KNEEL); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); - break; - case 10: DoScriptText(SAY_EXEC_WAITING, me, pPlayer); break; - case 11: - DoScriptText(EMOTE_DIES, me); - me->setDeathState(JUST_DIED); - me->SetHealth(0); - return; - } - break; - case RACE_NIGHTELF: - switch(ExecuteSpeech_Counter) - { - case 0: DoScriptText(SAY_EXEC_START_1, me, pPlayer); break; - case 1: me->SetStandState(UNIT_STAND_STATE_STAND); break; - case 2: DoScriptText(SAY_EXEC_PROG_5, me, pPlayer); break; - case 3: DoScriptText(SAY_EXEC_NAME_1, me, pPlayer); break; - case 4: DoScriptText(SAY_EXEC_RECOG_1, me, pPlayer); break; - case 5: DoScriptText(SAY_EXEC_NOREM_6, me, pPlayer); break; - case 6: DoScriptText(SAY_EXEC_THINK_2, me, pPlayer); break; - case 7: DoScriptText(SAY_EXEC_LISTEN_1, me, pPlayer); break; - case 8: - if (Creature* Plaguefist = GetClosestCreatureWithEntry(me, NPC_PLAGUEFIST, 85.0f)) - DoScriptText(SAY_PLAGUEFIST, Plaguefist, pPlayer); - break; - case 9: - DoScriptText(SAY_EXEC_TIME_7, me, pPlayer); - me->SetStandState(UNIT_STAND_STATE_KNEEL); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); - break; - case 10: DoScriptText(SAY_EXEC_WAITING, me, pPlayer); break; - case 11: - DoScriptText(EMOTE_DIES, me); - me->setDeathState(JUST_DIED); - me->SetHealth(0); - return; - } - break; - case RACE_UNDEAD_PLAYER: - switch(ExecuteSpeech_Counter) - { - case 0: DoScriptText(SAY_EXEC_START_1, me, pPlayer); break; - case 1: me->SetStandState(UNIT_STAND_STATE_STAND); break; - case 2: DoScriptText(SAY_EXEC_PROG_3, me, pPlayer); break; - case 3: DoScriptText(SAY_EXEC_NAME_1, me, pPlayer); break; - case 4: DoScriptText(SAY_EXEC_RECOG_4, me, pPlayer); break; - case 5: DoScriptText(SAY_EXEC_NOREM_3, me, pPlayer); break; - case 6: DoScriptText(SAY_EXEC_THINK_1, me, pPlayer); break; - case 7: DoScriptText(SAY_EXEC_LISTEN_3, me, pPlayer); break; - case 8: - if (Creature* Plaguefist = GetClosestCreatureWithEntry(me, NPC_PLAGUEFIST, 85.0f)) - DoScriptText(SAY_PLAGUEFIST, Plaguefist, pPlayer); - break; - case 9: - DoScriptText(SAY_EXEC_TIME_4, me, pPlayer); - me->SetStandState(UNIT_STAND_STATE_KNEEL); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); - break; - case 10: DoScriptText(SAY_EXEC_WAITING, me, pPlayer); break; - case 11: - DoScriptText(EMOTE_DIES, me); - me->setDeathState(JUST_DIED); - me->SetHealth(0); - return; - } - break; - case RACE_TAUREN: - switch(ExecuteSpeech_Counter) - { - case 0: DoScriptText(SAY_EXEC_START_1, me, pPlayer); break; - case 1: me->SetStandState(UNIT_STAND_STATE_STAND); break; - case 2: DoScriptText(SAY_EXEC_PROG_1, me, pPlayer); break; - case 3: DoScriptText(SAY_EXEC_NAME_1, me, pPlayer); break; - case 4: DoScriptText(SAY_EXEC_RECOG_5, me, pPlayer); break; - case 5: DoScriptText(SAY_EXEC_NOREM_8, me, pPlayer); break; - case 6: DoScriptText(SAY_EXEC_THINK_9, me, pPlayer); break; - case 7: DoScriptText(SAY_EXEC_LISTEN_1, me, pPlayer); break; - case 8: - if (Creature* Plaguefist = GetClosestCreatureWithEntry(me, NPC_PLAGUEFIST, 85.0f)) - DoScriptText(SAY_PLAGUEFIST, Plaguefist, pPlayer); - break; - case 9: - DoScriptText(SAY_EXEC_TIME_9, me, pPlayer); - me->SetStandState(UNIT_STAND_STATE_KNEEL); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); - break; - case 10: DoScriptText(SAY_EXEC_WAITING, me, pPlayer); break; - case 11: - DoScriptText(EMOTE_DIES, me); - me->setDeathState(JUST_DIED); - me->SetHealth(0); - return; - } - break; - case RACE_GNOME: - switch(ExecuteSpeech_Counter) - { - case 0: DoScriptText(SAY_EXEC_START_1, me, pPlayer); break; - case 1: me->SetStandState(UNIT_STAND_STATE_STAND); break; - case 2: DoScriptText(SAY_EXEC_PROG_4, me, pPlayer); break; - case 3: DoScriptText(SAY_EXEC_NAME_1, me, pPlayer); break; - case 4: DoScriptText(SAY_EXEC_RECOG_1, me, pPlayer); break; - case 5: DoScriptText(SAY_EXEC_NOREM_4, me, pPlayer); break; - case 6: DoScriptText(SAY_EXEC_THINK_6, me, pPlayer); break; - case 7: DoScriptText(SAY_EXEC_LISTEN_1, me, pPlayer); break; - case 8: - if (Creature* Plaguefist = GetClosestCreatureWithEntry(me, NPC_PLAGUEFIST, 85.0f)) - DoScriptText(SAY_PLAGUEFIST, Plaguefist, pPlayer); - break; - case 9: - DoScriptText(SAY_EXEC_TIME_5, me, pPlayer); - me->SetStandState(UNIT_STAND_STATE_KNEEL); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); - break; - case 10: DoScriptText(SAY_EXEC_WAITING, me, pPlayer); break; - case 11: - DoScriptText(EMOTE_DIES, me); - me->setDeathState(JUST_DIED); - me->SetHealth(0); - return; - } - break; - case RACE_TROLL: - switch(ExecuteSpeech_Counter) - { - case 0: DoScriptText(SAY_EXEC_START_3, me, pPlayer); break; - case 1: me->SetStandState(UNIT_STAND_STATE_STAND); break; - case 2: DoScriptText(SAY_EXEC_PROG_7, me, pPlayer); break; - case 3: DoScriptText(SAY_EXEC_NAME_2, me, pPlayer); break; - case 4: DoScriptText(SAY_EXEC_RECOG_6, me, pPlayer); break; - case 5: DoScriptText(SAY_EXEC_NOREM_9, me, pPlayer); break; - case 6: DoScriptText(SAY_EXEC_THINK_10, me, pPlayer); break; - case 7: DoScriptText(SAY_EXEC_LISTEN_4, me, pPlayer); break; - case 8: - if (Creature* Plaguefist = GetClosestCreatureWithEntry(me, NPC_PLAGUEFIST, 85.0f)) - DoScriptText(SAY_PLAGUEFIST, Plaguefist, pPlayer); - break; - case 9: - DoScriptText(SAY_EXEC_TIME_10, me, pPlayer); - me->SetStandState(UNIT_STAND_STATE_KNEEL); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); - break; - case 10: DoScriptText(SAY_EXEC_WAITING, me, pPlayer); break; - case 11: - DoScriptText(EMOTE_DIES, me); - me->setDeathState(JUST_DIED); - me->SetHealth(0); - return; - } - break; - case RACE_BLOODELF: - switch(ExecuteSpeech_Counter) - { - case 0: DoScriptText(SAY_EXEC_START_1, me, pPlayer); break; - case 1: me->SetStandState(UNIT_STAND_STATE_STAND); break; - case 2: DoScriptText(SAY_EXEC_PROG_1, me, pPlayer); break; - case 3: DoScriptText(SAY_EXEC_NAME_1, me, pPlayer); break; - case 4: DoScriptText(SAY_EXEC_RECOG_1, me, pPlayer); break; - //case 5: //unknown - case 6: DoScriptText(SAY_EXEC_THINK_3, me, pPlayer); break; - case 7: DoScriptText(SAY_EXEC_LISTEN_1, me, pPlayer); break; - case 8: - if (Creature* Plaguefist = GetClosestCreatureWithEntry(me, NPC_PLAGUEFIST, 85.0f)) - DoScriptText(SAY_PLAGUEFIST, Plaguefist, pPlayer); - break; - case 9: - DoScriptText(SAY_EXEC_TIME_1, me, pPlayer); - me->SetStandState(UNIT_STAND_STATE_KNEEL); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); - break; - case 10: DoScriptText(SAY_EXEC_WAITING, me, pPlayer); break; - case 11: - DoScriptText(EMOTE_DIES, me); - me->setDeathState(JUST_DIED); - me->SetHealth(0); - return; - } - break; - case RACE_DRAENEI: - switch(ExecuteSpeech_Counter) - { - case 0: DoScriptText(SAY_EXEC_START_1, me, pPlayer); break; - case 1: me->SetStandState(UNIT_STAND_STATE_STAND); break; - case 2: DoScriptText(SAY_EXEC_PROG_1, me, pPlayer); break; - case 3: DoScriptText(SAY_EXEC_NAME_1, me, pPlayer); break; - case 4: DoScriptText(SAY_EXEC_RECOG_2, me, pPlayer); break; - case 5: DoScriptText(SAY_EXEC_NOREM_1, me, pPlayer); break; - case 6: DoScriptText(SAY_EXEC_THINK_4, me, pPlayer); break; - case 7: DoScriptText(SAY_EXEC_LISTEN_1, me, pPlayer); break; - case 8: - if (Creature* Plaguefist = GetClosestCreatureWithEntry(me, NPC_PLAGUEFIST, 85.0f)) - DoScriptText(SAY_PLAGUEFIST, Plaguefist, pPlayer); - break; - case 9: - DoScriptText(SAY_EXEC_TIME_2, me, pPlayer); - me->SetStandState(UNIT_STAND_STATE_KNEEL); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); - break; - case 10: DoScriptText(SAY_EXEC_WAITING, me, pPlayer); break; - case 11: - DoScriptText(EMOTE_DIES, me); - me->setDeathState(JUST_DIED); - me->SetHealth(0); - return; - } - break; - } - - if (ExecuteSpeech_Counter >= 9) - ExecuteSpeech_Timer = 15000; - else - ExecuteSpeech_Timer = 7000; - - ++ExecuteSpeech_Counter; - } - else - ExecuteSpeech_Timer -= diff; - } - } -}; - -CreatureAI* GetAI_npc_a_special_surprise(Creature* pCreature) -{ - return new npc_a_special_surpriseAI(pCreature); -} - -void AddSC_the_scarlet_enclave_c2() -{ - Script *newscript; - - // How to win friends and influence enemies - newscript = new Script; - newscript->Name = "npc_crusade_persuaded"; - newscript->GetAI = &GetAI_npc_crusade_persuaded; - newscript->RegisterSelf(); - - // Ambush At The Overlook - newscript = new Script; - newscript->Name = "mob_scarlet_courier"; - newscript->GetAI = &GetAI_mob_scarlet_courier; - newscript->RegisterSelf(); - - // 12727 Bloody Breakout - newscript = new Script; - newscript->Name = "npc_koltira_deathweaver"; - newscript->GetAI = &GetAI_npc_koltira_deathweaver; - newscript->pQuestAccept = &QuestAccept_npc_koltira_deathweaver; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_high_inquisitor_valroth"; - newscript->GetAI = &GetAI_mob_high_inquisitor_valroth; - newscript->RegisterSelf(); - - // A Special Suprise - newscript = new Script; - newscript->Name = "npc_a_special_surprise"; - newscript->GetAI = &GetAI_npc_a_special_surprise; - newscript->RegisterSelf(); -} - -/* --- Bloody Breakout -UPDATE `creature_template` SET `ScriptName`='npc_koltira_deathweaver' WHERE `entry`='28912'; -UPDATE `creature_template` SET `ScriptName`='mob_high_inquisitor_valroth',minmana=6489,maxmana=6489,unit_flags=32768 WHERE `entry`='29001'; -UPDATE `creature_template` SET `ScriptName`='mob_eventai', `AIName`='EventAI',minmana=1020,maxmana=1058,unit_flags=32768 WHERE (`entry`='29007'); -DELETE FROM creature_ai_scripts WHERE id BETWEEN 90030 AND 90033; -INSERT INTO `creature_ai_scripts` VALUES ('90030', '29007', '0', '0', '100', '1', '1000', '4000', '1000', '4000', '11', '15498', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', 'Crimson Acolyte - Holy Smite'); -INSERT INTO `creature_ai_scripts` VALUES ('90031', '29007', '0', '0', '100', '1', '1000', '10000', '20000', '21000', '11', '34809', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 'Crimson Acolyte - Holy Fury'); -INSERT INTO `creature_ai_scripts` VALUES ('90032', '29007', '0', '0', '100', '1', '1000', '5000', '1000', '5000', '11', '19725', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', 'Crimson Acolyte - Turn Undead'); -INSERT INTO `creature_ai_scripts` VALUES ('90033', '29007', '4', '0', '100', '0', '0', '0', '0', '0', '11', '15498', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', 'Crimson Acolyte aggro'); -*/ diff --git a/src/server/scripts/EasternKingdoms/scarlet_enclave/chapter5.cpp b/src/server/scripts/EasternKingdoms/scarlet_enclave/chapter5.cpp deleted file mode 100644 index 3b0ce186592..00000000000 --- a/src/server/scripts/EasternKingdoms/scarlet_enclave/chapter5.cpp +++ /dev/null @@ -1,1684 +0,0 @@ -/* - * Copyright (C) 2009 Trinity - * - * 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 - */ - -#include "ScriptedPch.h" -#include "ScriptedEscortAI.h" - -#define LESS_MOB // if you do not have a good server and do not want it to be laggy as hell -//Light of Dawn -enum mograine -{ -#ifdef LESS_MOB - ENCOUNTER_DK_NUMBER = 5, // how many player queue to start the quest , or - - ENCOUNTER_DK_TIMER = 10, // *every 5 minutes. These have to be done in instance data - ENCOUNTER_DEFENDER_NUMBER = 10, // how many of defender - ENCOUNTER_EARTHSHATTER_NUMBER = 1, // how many of earthshatter - ENCOUNTER_ABOMINATION_NUMBER = 2, // how many of abomination - ENCOUNTER_BEHEMOTH_NUMBER = 1, // how many of behemoth - ENCOUNTER_GHOUL_NUMBER = 5, // how many of ghoul - ENCOUNTER_WARRIOR_NUMBER = 1, // how many of warrior -#else - ENCOUNTER_DK_NUMBER = 5, // how many player queue to start the quest , or - - ENCOUNTER_DK_TIMER = 10, // *every 5 minutes. These have to be done in instance data - ENCOUNTER_DEFENDER_NUMBER = 20, // how many of defender - ENCOUNTER_EARTHSHATTER_NUMBER = 20, // how many of earthshatter - ENCOUNTER_ABOMINATION_NUMBER = 3, // how many of abomination - ENCOUNTER_BEHEMOTH_NUMBER = 2, // how many of behemoth - ENCOUNTER_GHOUL_NUMBER = 10, // how many of ghoul - ENCOUNTER_WARRIOR_NUMBER = 2, // how many of warrior -#endif - ENCOUNTER_TOTAL_DAWN = 300, // Total number - ENCOUNTER_TOTAL_SCOURGE = 10000, - - WORLD_STATE_REMAINS = 3592, - WORLD_STATE_COUNTDOWN = 3603, - WORLD_STATE_EVENT_BEGIN = 3605, - - SAY_LIGHT_OF_DAWN01 = -1609201, // pre text - SAY_LIGHT_OF_DAWN02 = -1609202, - SAY_LIGHT_OF_DAWN03 = -1609203, - SAY_LIGHT_OF_DAWN04 = -1609204, // intro - SAY_LIGHT_OF_DAWN05 = -1609205, - SAY_LIGHT_OF_DAWN06 = -1609206, - SAY_LIGHT_OF_DAWN07 = -1609207, // During the fight - Korfax, Champion of the Light - SAY_LIGHT_OF_DAWN08 = -1609208, // Lord Maxwell Tyrosus - SAY_LIGHT_OF_DAWN09 = -1609209, // Highlord Darion Mograine - SAY_LIGHT_OF_DAWN10 = -1609210, - SAY_LIGHT_OF_DAWN11 = -1609211, - SAY_LIGHT_OF_DAWN12 = -1609212, - SAY_LIGHT_OF_DAWN13 = -1609213, - SAY_LIGHT_OF_DAWN14 = -1609214, - SAY_LIGHT_OF_DAWN15 = -1609215, - SAY_LIGHT_OF_DAWN16 = -1609216, - SAY_LIGHT_OF_DAWN17 = -1609217, - SAY_LIGHT_OF_DAWN18 = -1609218, - SAY_LIGHT_OF_DAWN19 = -1609219, - SAY_LIGHT_OF_DAWN20 = -1609220, - SAY_LIGHT_OF_DAWN21 = -1609221, - SAY_LIGHT_OF_DAWN22 = -1609222, - SAY_LIGHT_OF_DAWN23 = -1609223, - SAY_LIGHT_OF_DAWN24 = -1609224, - SAY_LIGHT_OF_DAWN25 = -1609225, // After the fight - SAY_LIGHT_OF_DAWN26 = -1609226, // Highlord Tirion Fordring - SAY_LIGHT_OF_DAWN27 = -1609227, // Highlord Darion Mograine - SAY_LIGHT_OF_DAWN28 = -1609228, // Highlord Tirion Fordring - SAY_LIGHT_OF_DAWN29 = -1609229, // Highlord Tirion Fordring - SAY_LIGHT_OF_DAWN30 = -1609230, // Highlord Tirion Fordring - SAY_LIGHT_OF_DAWN31 = -1609231, // Highlord Tirion Fordring - SAY_LIGHT_OF_DAWN32 = -1609232, // Highlord Alexandros Mograine - SAY_LIGHT_OF_DAWN33 = -1609233, // Highlord Darion Mograine - SAY_LIGHT_OF_DAWN34 = -1609234, // Highlord Darion Mograine - SAY_LIGHT_OF_DAWN35 = -1609235, // Darion Mograine - SAY_LIGHT_OF_DAWN36 = -1609236, // Darion Mograine - SAY_LIGHT_OF_DAWN37 = -1609237, // Highlord Alexandros Mograine - SAY_LIGHT_OF_DAWN38 = -1609238, // Darion Mograine - SAY_LIGHT_OF_DAWN39 = -1609239, // Highlord Alexandros Mograine - SAY_LIGHT_OF_DAWN40 = -1609240, // Darion Mograine - SAY_LIGHT_OF_DAWN41 = -1609241, // Highlord Alexandros Mograine - SAY_LIGHT_OF_DAWN42 = -1609242, // Highlord Alexandros Mograine - SAY_LIGHT_OF_DAWN43 = -1609243, // The Lich King - SAY_LIGHT_OF_DAWN44 = -1609244, // Highlord Darion Mograine - SAY_LIGHT_OF_DAWN45 = -1609245, // The Lich King - SAY_LIGHT_OF_DAWN46 = -1609246, // The Lich King - SAY_LIGHT_OF_DAWN47 = -1609247, // Highlord Tirion Fordring - SAY_LIGHT_OF_DAWN48 = -1609248, // The Lich King - SAY_LIGHT_OF_DAWN49 = -1609249, // The Lich King - SAY_LIGHT_OF_DAWN50 = -1609250, // Lord Maxwell Tyrosus - SAY_LIGHT_OF_DAWN51 = -1609251, // The Lich King - SAY_LIGHT_OF_DAWN52 = -1609252, // Highlord Darion Mograine - SAY_LIGHT_OF_DAWN53 = -1609253, // Highlord Darion Mograine - SAY_LIGHT_OF_DAWN54 = -1609254, // Highlord Tirion Fordring - SAY_LIGHT_OF_DAWN55 = -1609255, // The Lich King - SAY_LIGHT_OF_DAWN56 = -1609256, // Highlord Tirion Fordring - SAY_LIGHT_OF_DAWN57 = -1609257, // The Lich King - SAY_LIGHT_OF_DAWN58 = -1609258, // The Lich King - SAY_LIGHT_OF_DAWN59 = -1609259, // The Lich King - SAY_LIGHT_OF_DAWN60 = -1609260, // Highlord Tirion Fordring - SAY_LIGHT_OF_DAWN61 = -1609261, // Highlord Tirion Fordring - SAY_LIGHT_OF_DAWN62 = -1609262, // Highlord Tirion Fordring - SAY_LIGHT_OF_DAWN63 = -1609263, // Highlord Tirion Fordring - SAY_LIGHT_OF_DAWN64 = -1609264, // Highlord Tirion Fordring - SAY_LIGHT_OF_DAWN65 = -1609265, // Highlord Tirion Fordring - SAY_LIGHT_OF_DAWN66 = -1609266, // Highlord Tirion Fordring - SAY_LIGHT_OF_DAWN67 = -1609267, // Highlord Tirion Fordring - SAY_LIGHT_OF_DAWN68 = -1609268, // Highlord Darion Mograine - - EMOTE_LIGHT_OF_DAWN01 = -1609269, // Emotes - EMOTE_LIGHT_OF_DAWN02 = -1609270, - EMOTE_LIGHT_OF_DAWN03 = -1609271, - EMOTE_LIGHT_OF_DAWN04 = -1609272, - EMOTE_LIGHT_OF_DAWN05 = -1609273, - EMOTE_LIGHT_OF_DAWN06 = -1609274, - EMOTE_LIGHT_OF_DAWN07 = -1609275, - EMOTE_LIGHT_OF_DAWN08 = -1609276, - EMOTE_LIGHT_OF_DAWN09 = -1609277, - EMOTE_LIGHT_OF_DAWN10 = -1609278, - EMOTE_LIGHT_OF_DAWN11 = -1609279, - EMOTE_LIGHT_OF_DAWN12 = -1609280, - EMOTE_LIGHT_OF_DAWN13 = -1609281, - EMOTE_LIGHT_OF_DAWN14 = -1609282, - EMOTE_LIGHT_OF_DAWN15 = -1609283, - EMOTE_LIGHT_OF_DAWN16 = -1609284, - EMOTE_LIGHT_OF_DAWN17 = -1609285, - EMOTE_LIGHT_OF_DAWN18 = -1609286, - - GO_LIGHT_OF_DAWN = 191330, - SPELL_THE_LIGHT_OF_DAWN_Q = 53606, // quest credit - - // ---- Dark Knight npc -------------------- - // Highlord Darion Mograine - NPC_HIGHLORD_DARION_MOGRAINE = 29173, - SPELL_ANTI_MAGIC_ZONE1 = 52893, - SPELL_DEATH_STRIKE = 53639, - SPELL_DEATH_EMBRACE = 53635, - SPELL_ICY_TOUCH1 = 49723, - SPELL_THE_LIGHT_OF_DAWN = 53658, - SPELL_THE_MIGHT_OF_MOGRAINE = 53642, // on players when begins - SPELL_UNHOLY_BLIGHT = 53640, - SPELL_ALEXANDROS_MOGRAINE_SPAWN = 53667, - SPELL_MOGRAINE_CHARGE = 53679, - SPELL_ASHBRINGER = 53701, - - // Koltira Deathweaver & Orbaz Bloodbane are using the same abilities - NPC_KOLTIRA_DEATHWEAVER = 29199, - NPC_ORBAZ_BLOODBANE = 29204, // this guy fleed - NPC_THASSARIAN = 29200, // he also does SPELL_THE_LIGHT_OF_DAWN 53658 - SPELL_BLOOD_STRIKE1 = 52374, - SPELL_DEATH_GRIP = 49576, - SPELL_ICY_TOUCH2 = 52372, - SPELL_PLAGUE_STRIKE1 = 50668, - // all do SPELL_HERO_AGGRO_AURA 53627 - - // Lich King - NPC_THE_LICH_KING = 29183, // show up at end - SPELL_APOCALYPSE = 53210, - SPELL_TELEPORT_VISUAL = 52233, - SPELL_SOUL_FEAST_ALEX = 53677, // on Alexandros - SPELL_SOUL_FEAST_TIRION = 53685, // on Tirion - SPELL_ICEBOUND_VISAGE = 53274, // not sure what is it for - SPELL_REBUKE = 53680, - - // others - NPC_RAMPAGING_ABOMINATION = 29186, - SPELL_CLEAVE1 = 53633, - SPELL_SCOURGE_HOOK = 50335, - SPELL_SCOURGE_AGGRO_AURA = 53624, - - NPC_FLESH_BEHEMOTH = 29190, // giant guy - SPELL_STOMP = 53634, - SPELL_THUNDERCLAP = 36706, - SPELL_HERO_AGGRO_AURA = 53627, - - NPC_ACHERUS_GHOUL = 29219, // just ghoul.... - SPELL_GHOULPLOSION = 53632, - - NPC_WARRIOR_OF_THE_FROZEN_WASTES = 29206, // use SPELL_CLEAVE 53631 - - NPC_HIGHLORD_ALEXANDROS_MOGRAINE = 29227, // ghost - NPC_DARION_MOGRAINE = 29228, // ghost - - // ---- Dawn npc -------------------- - // Highlord Tirion Fordring - NPC_HIGHLORD_TIRION_FORDRING = 29175, - EQUIP_HIGHLORD_TIRION_FORDRING = 13262, - SPELL_LAY_ON_HANDS = 53778, - SPELL_REBIRTH_OF_THE_ASHBRINGER = 53702, - SPELL_TIRION_CHARGE = 53705, - SPELL_TIRION_CHARGE_VISUAL = 53706, - - // others - NPC_KORFAX_CHAMPION_OF_THE_LIGHT = 29176, - SPELL_CLEAVE = 53631, - SPELL_HEROIC_LEAP = 53625, - - NPC_LORD_MAXWELL_TYROSUS = 29178, - NPC_LEONID_BARTHALOMEW_THE_REVERED = 29179, - NPC_DUKE_NICHOLAS_ZVERENHOFF = 29180, - - NPC_COMMANDER_ELIGOR_DAWNBRINGER = 29177, - SPELL_HOLY_LIGHT2 = 37979, - - NPC_RAYNE = 29181, - SPELL_REJUVENATION = 20664, - SPELL_STARFALL = 20678, - SPELL_TRANQUILITY = 25817, - SPELL_WRATH = 21807, - - NPC_DEFENDER_OF_THE_LIGHT = 29174, // also does SPELL_HEROIC_LEAP 53625 - SPELL_HOLY_LIGHT1 = 29427, - SPELL_HOLY_STRIKE = 53643, - SPELL_HOLY_WRATH = 53638, - SPELL_UPPERCUT = 53629, - - NPC_RIMBLAT_EARTHSHATTER = 29182, - SPELL_CHAIN_HEAL = 33642, - SPELL_THUNDER = 53630 -}; - -struct Locations -{ - float x, y, z, o; - uint32 id; -}; - -void UpdateWorldState(Map *map, uint32 id, uint32 state) -{ - Map::PlayerList const& players = map->GetPlayers(); - - if (!players.isEmpty()) - { - for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) - { - if (Player* pPlayer = itr->getSource()) - pPlayer->SendUpdateWorldState(id,state); - } - } -} - -static Locations LightofDawnLoc[]= -{ - {2281.335, -5300.409, 85.170, 0}, // 0 Tirion Fordring loc - {2283.896, -5287.914, 83.066, 1.55}, // 1 Tirion Fordring loc2 - {2281.461, -5263.014, 81.164, 0}, // 2 Tirion charges - {2262.277, -5293.477, 82.167, 0}, // 3 Tirion run - {2270.286, -5287.73, 82.262, 0}, // 4 Tirion relocate - {2269.511, -5288.289, 82.225, 0}, // 5 Tirion forward - {2262.277, -5293.477, 82.167, 0}, // 6 Tirion runs to Darion - {2270.286, -5287.73, 82.262, 0}, - {2269.511, -5288.289, 82.225, 0}, - {2273.205, -5288.848, 82.617, 0}, // 9 Korfax loc1 - {2274.739, -5287.926, 82.684, 0}, // 10 Korfax loc2 - {2253.673, -5318.004, 81.724, 0}, // 11 Korfax kicked - {2287.028, -5309.644, 87.253, 0}, // 12 Maxwell loc1 - {2286.978, -5308.025, 86.83, 0}, // 13 Maxwell loc2 - {2248.877, -5307.586, 82.166, 0}, // 14 maxwell kicked - {2278.58, -5316.933, 88.319, 0}, // 15 Eligor loc1 - {2278.535, -5315.479, 88.08, 0}, // 16 Eligor loc2 - {2259.416, -5304.505, 82.149, 0}, // 17 eligor kicked - {2289.259, -5280.355, 82.112, 0}, // 18 Koltira loc1 - {2289.02, -5281.985, 82.207, 0}, // 19 Koltira loc2 - {2273.289, -5273.675, 81.701, 0}, // 20 Thassarian loc1 - {2273.332, -5275.544, 81.849, 0}, // 21 Thassarian loc2 - {2281.198, -5257.397, 80.224, 4.66}, // 22 Alexandros loc1 - {2281.156, -5259.934, 80.647, 0}, // 23 Alexandros loc2 - {2281.294, -5281.895, 82.445, 1.35}, // 24 Darion loc1 - {2281.093, -5263.013, 81.125, 0}, // 25 Darion loc1 - {2281.313, -5250.282, 79.322, 4.69}, // 26 Lich King spawns - {2281.523, -5261.058, 80.877, 0}, // 27 Lich king move forwards - {2272.709, -5255.552, 78.226, 0}, // 28 Lich king kicked - {2273.972, -5257.676, 78.862, 0} // 29 Lich king moves forward -}; - -struct npc_highlord_darion_mograineAI : public npc_escortAI -{ - npc_highlord_darion_mograineAI(Creature *pCreature) : npc_escortAI(pCreature) - { - Reset(); - } - - bool bIsBattle; - uint32 uiStep; - uint32 uiPhase_timer; - uint32 uiFight_duration; - uint32 uiTotal_dawn; - uint32 uiTotal_scourge; - uint32 uiSummon_counter; - - // Darion Mograine - uint32 uiAnti_magic_zone; - uint32 uiDeath_strike; - uint32 uiDeath_embrace; - uint32 uiIcy_touch; - uint32 uiUnholy_blight; - uint32 uiFight_speech; - uint32 uiSpawncheck; - uint32 uiTargetcheck; - - // Dawn - uint64 uiTirionGUID; - uint64 uiAlexandrosGUID; - uint64 uiDarionGUID; - uint64 uiKorfaxGUID; - uint64 uiMaxwellGUID; - uint64 uiEligorGUID; - uint64 uiRayneGUID; - uint64 uiDefenderGUID[ENCOUNTER_DEFENDER_NUMBER]; - uint64 uiEarthshatterGUID[ENCOUNTER_EARTHSHATTER_NUMBER]; - - // Death - uint64 uiKoltiraGUID; - uint64 uiOrbazGUID; - uint64 uiThassarianGUID; - uint64 uiLichKingGUID; - uint64 uiAbominationGUID[ENCOUNTER_ABOMINATION_NUMBER]; - uint64 uiBehemothGUID[ENCOUNTER_BEHEMOTH_NUMBER]; - uint64 uiGhoulGUID[ENCOUNTER_GHOUL_NUMBER]; - uint64 uiWarriorGUID[ENCOUNTER_WARRIOR_NUMBER]; - - void Reset() - { - if (!HasEscortState(STATE_ESCORT_ESCORTING)) - { - bIsBattle = false; - uiStep = 0; - uiPhase_timer = 3000; - uiFight_duration = 300000; // 5 minutes - uiTotal_dawn = ENCOUNTER_TOTAL_DAWN; - uiTotal_scourge = ENCOUNTER_TOTAL_SCOURGE; - uiSummon_counter = 0; - - uiAnti_magic_zone = urand(1000,6000); - uiDeath_strike = urand(5000,10000); - uiDeath_embrace = urand(5000,10000); - uiIcy_touch = urand(5000,10000); - uiUnholy_blight = urand(5000,10000); - - uiFight_speech = 15000; - uiSpawncheck = 1000; - uiTargetcheck = 10000; - - me->SetStandState(UNIT_STAND_STATE_STAND); - me->Mount(25279); - me->SetVisibility(VISIBILITY_ON); - - UpdateWorldState(me->GetMap(), WORLD_STATE_REMAINS, 0); - //UpdateWorldState(me->GetMap(), WORLD_STATE_COUNTDOWN, 0); - UpdateWorldState(me->GetMap(), WORLD_STATE_EVENT_BEGIN, 0); - - if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) - pTemp->setDeathState(JUST_DIED); - if (Creature* pTemp = Unit::GetCreature(*me, uiKorfaxGUID)) - pTemp->setDeathState(JUST_DIED); - if (Creature* pTemp = Unit::GetCreature(*me, uiMaxwellGUID)) - pTemp->setDeathState(JUST_DIED); - if (Creature* pTemp = Unit::GetCreature(*me, uiEligorGUID)) - pTemp->setDeathState(JUST_DIED); - if (Creature* pTemp = Unit::GetCreature(*me, uiRayneGUID)) - pTemp->setDeathState(JUST_DIED); - - uiTirionGUID = NULL; - uiKorfaxGUID = NULL; - uiMaxwellGUID = NULL; - uiEligorGUID = NULL; - uiRayneGUID = NULL; - - for (uint8 i = 0; i < ENCOUNTER_DEFENDER_NUMBER; ++i) - { - if (Creature* pTemp = Unit::GetCreature(*me, uiDefenderGUID[i])) - pTemp->setDeathState(JUST_DIED); - uiDefenderGUID[i] = 0; - } - for (uint8 i = 0; i < ENCOUNTER_EARTHSHATTER_NUMBER; ++i) - { - if (Creature* pTemp = Unit::GetCreature(*me, uiEarthshatterGUID[i])) - pTemp->setDeathState(JUST_DIED); - uiEarthshatterGUID[i] = 0; - } - - if (Creature* pTemp = Unit::GetCreature(*me, uiKoltiraGUID)) - pTemp->setDeathState(JUST_DIED); - if (Creature* pTemp = Unit::GetCreature(*me, uiOrbazGUID)) - pTemp->setDeathState(JUST_DIED); - if (Creature* pTemp = Unit::GetCreature(*me, uiThassarianGUID)) - pTemp->setDeathState(JUST_DIED); - if (Creature* pTemp = Unit::GetCreature(*me, uiLichKingGUID)) - pTemp->setDeathState(JUST_DIED); - - uiKoltiraGUID = NULL; - uiOrbazGUID = NULL; - uiThassarianGUID = NULL; - uiLichKingGUID = NULL; - for (uint8 i = 0; i < ENCOUNTER_ABOMINATION_NUMBER; ++i) - { - if (Creature* pTemp = Unit::GetCreature(*me, uiAbominationGUID[i])) - pTemp->setDeathState(JUST_DIED); - uiAbominationGUID[i] = 0; - } - for (uint8 i = 0; i < ENCOUNTER_BEHEMOTH_NUMBER; ++i) - { - if (Creature* pTemp = Unit::GetCreature(*me, uiBehemothGUID[i])) - pTemp->setDeathState(JUST_DIED); - uiBehemothGUID[i] = 0; - } - for (uint8 i = 0; i < ENCOUNTER_GHOUL_NUMBER; ++i) - { - if (Creature* pTemp = Unit::GetCreature(*me, uiGhoulGUID[i])) - pTemp->setDeathState(JUST_DIED); - uiGhoulGUID[i] = 0; - } - for (uint8 i = 0; i < ENCOUNTER_WARRIOR_NUMBER; ++i) - { - if (Creature* pTemp = Unit::GetCreature(*me, uiWarriorGUID[i])) - pTemp->setDeathState(JUST_DIED); - uiWarriorGUID[i] = 0; - } - } - } - - void AttackStart(Unit* who) - { - if (!who) - return; - - if (who == me) - return; - - if (me->Attack(who, true)) - { - me->AddThreat(who, 0.0f); - me->SetInCombatWith(who); - who->SetInCombatWith(me); - DoStartMovement(who); - } - } - - void MoveInLineOfSight(Unit* who) - { - if (!who) - return; - - if (who->isTargetableForAttack() && me->IsHostileTo(who)) - if (me->IsWithinDistInMap(who, 20) && me->IsWithinLOSInMap(who)) - AttackStart(who); - } - - void SetHoldState(bool bOnHold) - { - SetEscortPaused(bOnHold); - } - - void WaypointReached(uint32 i) - { - switch (i) - { - case 0: - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - SetHoldState(true); - break; - case 1: - SetHoldState(true); - - SpawnNPC(); - if (Creature* pTemp = Unit::GetCreature(*me, uiKorfaxGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN07, pTemp); - if (Creature* pTemp = Unit::GetCreature(*me, uiMaxwellGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN08, pTemp); - - for (uint8 i = 0; i < ENCOUNTER_GHOUL_NUMBER; ++i) - NPCChangeTarget(uiGhoulGUID[i]); - for (uint8 i = 0; i < ENCOUNTER_WARRIOR_NUMBER; ++i) - NPCChangeTarget(uiWarriorGUID[i]); - for (uint8 i = 0; i < ENCOUNTER_ABOMINATION_NUMBER; ++i) - NPCChangeTarget(uiAbominationGUID[i]); - for (uint8 i = 0; i < ENCOUNTER_BEHEMOTH_NUMBER; ++i) - NPCChangeTarget(uiBehemothGUID[i]); - NPCChangeTarget(uiKoltiraGUID); - NPCChangeTarget(uiOrbazGUID); - NPCChangeTarget(uiThassarianGUID); - - me->Unmount(); - me->CastSpell(me, SPELL_THE_MIGHT_OF_MOGRAINE, true); // need to fix, on player only - - if (Creature* pTemp = Unit::GetCreature(*me, uiKoltiraGUID)) - pTemp->Unmount(); - if (Creature* pTemp = Unit::GetCreature(*me, uiThassarianGUID)) - pTemp->Unmount(); - - bIsBattle = true; - break; - case 2: - me->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - DoCast(me, SPELL_THE_LIGHT_OF_DAWN); - break; - case 3: - { - //Unit* pTirion = Unit::GetCreature(*me, uiTirionGUID); - - DoScriptText(EMOTE_LIGHT_OF_DAWN05, me); - if (me->HasAura(SPELL_THE_LIGHT_OF_DAWN, 0)) - me->RemoveAurasDueToSpell(SPELL_THE_LIGHT_OF_DAWN); - if (Creature* pTemp = Unit::GetCreature(*me, uiKoltiraGUID)) - { - if (pTemp->HasAura(SPELL_THE_LIGHT_OF_DAWN, 0)) - pTemp->RemoveAurasDueToSpell(SPELL_THE_LIGHT_OF_DAWN); - pTemp->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[19].x, LightofDawnLoc[19].y, LightofDawnLoc[19].z); - } - if (Creature* pTemp = Unit::GetCreature(*me, uiThassarianGUID)) - { - if (pTemp->HasAura(SPELL_THE_LIGHT_OF_DAWN, 0)) - pTemp->RemoveAurasDueToSpell(SPELL_THE_LIGHT_OF_DAWN); - pTemp->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[21].x, LightofDawnLoc[21].y, LightofDawnLoc[21].z); - } - if (Creature* pTemp = Unit::GetCreature(*me, uiKorfaxGUID)) - { - pTemp->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - pTemp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY2H); - pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[10].x, LightofDawnLoc[10].y, LightofDawnLoc[10].z); - } - if (Creature* pTemp = Unit::GetCreature(*me, uiMaxwellGUID)) - { - pTemp->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[13].x, LightofDawnLoc[13].y, LightofDawnLoc[13].z); - } - if (Creature* pTemp = Unit::GetCreature(*me, uiEligorGUID)) - { - pTemp->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[16].x, LightofDawnLoc[16].y, LightofDawnLoc[16].z); - } - JumpToNextStep(10000); - } break; - case 4: - DoScriptText(SAY_LIGHT_OF_DAWN27, me); - me->SetStandState(UNIT_STAND_STATE_KNEEL); - - if (Creature* pTemp = Unit::GetCreature(*me, uiKoltiraGUID)) - pTemp->SetStandState(UNIT_STAND_STATE_KNEEL); - if (Creature* pTemp = Unit::GetCreature(*me, uiThassarianGUID)) - pTemp->SetStandState(UNIT_STAND_STATE_KNEEL); - SetHoldState(true); - break; - case 5: - DoScriptText(SAY_LIGHT_OF_DAWN33, me); - SetHoldState(true); - break; - case 6: - SetHoldState(true); - me->HandleEmoteCommand(EMOTE_ONESHOT_SPECIALATTACK1H); - JumpToNextStep(1000); - break; - case 7: - SetHoldState(true); - JumpToNextStep(2000); - break; - case 8: - me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(EQUIP_UNEQUIP)); - if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) - me->CastSpell(pTemp, SPELL_ASHBRINGER, true); - DoScriptText(EMOTE_LIGHT_OF_DAWN14, me); - SetHoldState(true); - break; - } - } - - void EnterEvadeMode() - { - if (!bIsBattle)//do not reset self if we are in battle - npc_escortAI::EnterEvadeMode(); - } - - void UpdateAI(const uint32 diff) - { - npc_escortAI::UpdateAI(diff); - - if (!bIsBattle) - { - if (uiPhase_timer <= diff) - { - // ******* Before battle ***************************************************************** - switch (uiStep) - { - case 0: // countdown - //UpdateWorldState(me->GetMap(), WORLD_STATE_COUNTDOWN, 1); - break; - - case 1: // just delay - //UpdateWorldState(me->GetMap(), WORLD_STATE_REMAINS, 1); - UpdateWorldState(me->GetMap(), WORLD_STATE_COUNTDOWN, 0); - UpdateWorldState(me->GetMap(), WORLD_STATE_EVENT_BEGIN, 1); - me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - JumpToNextStep(3000); - break; - - case 2: - DoScriptText(SAY_LIGHT_OF_DAWN04, me); - if (Creature* pKoltira = GetClosestCreatureWithEntry(me, NPC_KOLTIRA_DEATHWEAVER, 50.0f)) - uiKoltiraGUID = pKoltira->GetGUID(); - if (Creature* pOrbaz = GetClosestCreatureWithEntry(me, NPC_ORBAZ_BLOODBANE, 50.0f)) - uiOrbazGUID = pOrbaz->GetGUID(); - if (Creature* pThassarian = GetClosestCreatureWithEntry(me, NPC_THASSARIAN, 50.0f)) - uiThassarianGUID = pThassarian->GetGUID(); - JumpToNextStep(10000); - break; - - case 3: // rise - DoScriptText(SAY_LIGHT_OF_DAWN05, me); - JumpToNextStep(3000); - break; - - case 4: // summon ghoul - // Dunno whats the summon spell, so workaround - DoCast(me, 33271); // shack effect - uiPhase_timer = 500; - if (uiSummon_counter < ENCOUNTER_GHOUL_NUMBER) - { - Unit* pTemp = me->SummonCreature(NPC_ACHERUS_GHOUL, (me->GetPositionX()-20)+rand()%40, (me->GetPositionY()-20)+rand()%40, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); - pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - pTemp->setFaction(2084); - uiGhoulGUID[uiSummon_counter] = pTemp->GetGUID(); - ++uiSummon_counter; - } - else - { - uiSummon_counter = 0; - ++uiStep; - } - break; - - case 5: // summon abomination - DoCast(me, 33271); // shack effect - uiPhase_timer = 500; - if (uiSummon_counter < ENCOUNTER_ABOMINATION_NUMBER) - { - Unit* pTemp = me->SummonCreature(NPC_RAMPAGING_ABOMINATION, (me->GetPositionX()-20)+rand()%40, (me->GetPositionY()-20)+rand()%40, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); - pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - pTemp->setFaction(2084); - uiAbominationGUID[uiSummon_counter] = pTemp->GetGUID(); - ++uiSummon_counter; - } - else - { - uiSummon_counter = 0; - ++uiStep; - } - break; - - case 6: // summon warrior - DoCast(me, 33271); // shack effect - uiPhase_timer = 500; - if (uiSummon_counter < ENCOUNTER_WARRIOR_NUMBER) - { - Unit* pTemp = me->SummonCreature(NPC_WARRIOR_OF_THE_FROZEN_WASTES, (me->GetPositionX()-20)+rand()%40, (me->GetPositionY()-20)+rand()%40, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); - pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - pTemp->setFaction(2084); - uiWarriorGUID[uiSummon_counter] = pTemp->GetGUID(); - ++uiSummon_counter; - } - else - { - uiSummon_counter = 0; - ++uiStep; - } - break; - - case 7: // summon warrior - DoCast(me, 33271); // shack effect - uiPhase_timer = 500; - if (uiSummon_counter < ENCOUNTER_BEHEMOTH_NUMBER) - { - Unit* pTemp = me->SummonCreature(NPC_FLESH_BEHEMOTH, (me->GetPositionX()-20)+rand()%40, (me->GetPositionY()-20)+rand()%40, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); - pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - pTemp->setFaction(2084); - uiBehemothGUID[uiSummon_counter] = pTemp->GetGUID(); - ++uiSummon_counter; - } - else - { - uiSummon_counter = 0; - ++uiStep; - } - break; - - case 8: // summon announce - DoScriptText(SAY_LIGHT_OF_DAWN06, me); - JumpToNextStep(5000); - break; - - case 9: // charge begins - SetHoldState(false); - if (Creature* pTemp = Unit::GetCreature(*me, uiKoltiraGUID)) - { - pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z); - } - if (Creature* pTemp = Unit::GetCreature(*me, uiOrbazGUID)) - { - pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z); - } - if (Creature* pTemp = Unit::GetCreature(*me, uiThassarianGUID)) - { - pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z); - } - for (uint8 i = 0; i < ENCOUNTER_ABOMINATION_NUMBER; ++i) - if (Creature* pTemp = Unit::GetCreature(*me, uiAbominationGUID[i])) - pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z); - for (uint8 i = 0; i < ENCOUNTER_BEHEMOTH_NUMBER; ++i) - if (Creature* pTemp = Unit::GetCreature(*me, uiBehemothGUID[i])) - pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z); - for (uint8 i = 0; i < ENCOUNTER_GHOUL_NUMBER; ++i) - if (Creature* pTemp = Unit::GetCreature(*me, uiGhoulGUID[i])) - pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z); - for (uint8 i = 0; i < ENCOUNTER_WARRIOR_NUMBER; ++i) - if (Creature* pTemp = Unit::GetCreature(*me, uiWarriorGUID[i])) - pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z); - JumpToNextStep(5000); - break; - - // ******* After battle ***************************************************************** - case 11: // Tirion starts to speak - if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN28, pTemp); - JumpToNextStep(21000); - break; - - case 12: - if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN29, pTemp); - JumpToNextStep(13000); - break; - - case 13: - if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN30, pTemp); - JumpToNextStep(13000); - break; - - case 14: - me->SetStandState(UNIT_STAND_STATE_STAND); - DoScriptText(SAY_LIGHT_OF_DAWN31, me); - JumpToNextStep(7000); - break; - - case 15: // summon gate - if (Unit* pTemp = me->SummonCreature(NPC_HIGHLORD_ALEXANDROS_MOGRAINE, LightofDawnLoc[22].x, LightofDawnLoc[22].y, LightofDawnLoc[22].z, LightofDawnLoc[22].o, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000)) - { - pTemp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - pTemp->CastSpell(pTemp, SPELL_ALEXANDROS_MOGRAINE_SPAWN, true); - DoScriptText(EMOTE_LIGHT_OF_DAWN06, pTemp); - uiAlexandrosGUID = pTemp->GetGUID(); - } - JumpToNextStep(4000); - break; - - case 16: // Alexandros out - if (Creature* pTemp = Unit::GetCreature(*me, uiAlexandrosGUID)) - { - pTemp->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[23].x, LightofDawnLoc[23].y, LightofDawnLoc[23].z); - DoScriptText(SAY_LIGHT_OF_DAWN32, pTemp); - } - SetHoldState(false); // makes darion turns back - JumpToNextStep(5000); - break; - - case 17: - me->SetStandState(UNIT_STAND_STATE_KNEEL); - DoScriptText(SAY_LIGHT_OF_DAWN34, me); - JumpToNextStep(5000); - break; - - case 18: // Darion's spirit out - if (Unit* pTemp = me->SummonCreature(NPC_DARION_MOGRAINE, LightofDawnLoc[24].x, LightofDawnLoc[24].y, LightofDawnLoc[24].z, LightofDawnLoc[24].o, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000)) - { - DoScriptText(SAY_LIGHT_OF_DAWN35, pTemp); - pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - uiDarionGUID = pTemp->GetGUID(); - } - JumpToNextStep(4000); - break; - - case 19: // runs to father - if (Creature* pTemp = Unit::GetCreature(*me, uiDarionGUID)) - { - DoScriptText(EMOTE_LIGHT_OF_DAWN07, pTemp); - pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[25].x, LightofDawnLoc[25].y, LightofDawnLoc[25].z); - } - JumpToNextStep(4000); - break; - - case 20: - if (Creature* pTemp = Unit::GetCreature(*me, uiDarionGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN36, pTemp); - JumpToNextStep(4000); - break; - - case 21: - if (Creature* pTemp = Unit::GetCreature(*me, uiDarionGUID)) - DoScriptText(EMOTE_LIGHT_OF_DAWN08, pTemp); - JumpToNextStep(4000); - break; - - case 22: - if (Creature* pTemp = Unit::GetCreature(*me, uiAlexandrosGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN37, pTemp); - JumpToNextStep(8000); - break; - - case 23: - if (Creature* pTemp = Unit::GetCreature(*me, uiDarionGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN38, pTemp); - JumpToNextStep(8000); - break; - - case 24: - if (Creature* pTemp = Unit::GetCreature(*me, uiAlexandrosGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN39, pTemp); - - if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) // Tirion moves forward here - pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[1].x, LightofDawnLoc[1].y, LightofDawnLoc[1].z); - - JumpToNextStep(15000); - break; - - case 25: - if (Creature* pTemp = Unit::GetCreature(*me, uiDarionGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN40, pTemp); - JumpToNextStep(11000); - break; - - case 26: - if (Creature* pTemp = Unit::GetCreature(*me, uiAlexandrosGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN41, pTemp); - JumpToNextStep(5000); - break; - - case 27: - if (Creature* pTemp = Unit::GetCreature(*me, uiDarionGUID)) - pTemp->setDeathState(JUST_DIED); - JumpToNextStep(24000); - break; - - case 28: - if (Creature* pTemp = Unit::GetCreature(*me, uiAlexandrosGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN42, pTemp); - JumpToNextStep(6000); - break; - - case 29: // lich king spawns - if (Unit* pTemp = me->SummonCreature(NPC_THE_LICH_KING, LightofDawnLoc[26].x, LightofDawnLoc[26].y, LightofDawnLoc[26].z, LightofDawnLoc[26].o, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000)) - { - DoScriptText(SAY_LIGHT_OF_DAWN43, pTemp); - uiLichKingGUID = pTemp->GetGUID(); - if (Unit* pAlex = Unit::GetCreature(*me, uiAlexandrosGUID)) - pTemp->CastSpell(pAlex, SPELL_SOUL_FEAST_ALEX, false); - } - JumpToNextStep(2000); - break; - - case 30: - if (Creature* pTemp = Unit::GetCreature(*me, uiAlexandrosGUID)) // just hide him - { - DoScriptText(EMOTE_LIGHT_OF_DAWN09, pTemp); - pTemp->SetVisibility(VISIBILITY_OFF); - } - if (Creature* pTemp = Unit::GetCreature(*me, uiLichKingGUID)) - { - pTemp->InterruptNonMeleeSpells(false); - DoScriptText(SAY_LIGHT_OF_DAWN45, pTemp); - } - JumpToNextStep(3000); - break; - - case 31: - me->SetStandState(UNIT_STAND_STATE_STAND); - DoScriptText(EMOTE_LIGHT_OF_DAWN10, me); - DoScriptText(SAY_LIGHT_OF_DAWN44, me); - JumpToNextStep(3000); - break; - - case 32: - if (Creature* pTemp = Unit::GetCreature(*me, uiLichKingGUID)) - pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[27].x, LightofDawnLoc[27].y, LightofDawnLoc[27].z); - JumpToNextStep(6000); - break; - - case 33: // Darion supports to jump to lich king here - if (Creature* pTemp = Unit::GetCreature(*me, uiLichKingGUID)) - DoCast(me, SPELL_MOGRAINE_CHARGE); // jumping charge -// doesn't make it looks well, so workarounds, Darion charges, looks better - me->SetSpeed(MOVE_RUN, 3.0f); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - SetHoldState(false); - JumpToNextStep(0); - break; - - case 35: // Lich king counterattacks - if (Creature* pTemp = Unit::GetCreature(*me, uiLichKingGUID)) - { - pTemp->HandleEmoteCommand(EMOTE_ONESHOT_KICK); - DoScriptText(SAY_LIGHT_OF_DAWN46, pTemp); - } - me->SetSpeed(MOVE_RUN, 6.0f); - me->SetStandState(UNIT_STAND_STATE_DEAD); - SetHoldState(false); // Darion got kicked by lich king - JumpToNextStep(0); - break; - - case 37: // Lich king counterattacks - me->SetStandState(UNIT_STAND_STATE_KNEEL); - JumpToNextStep(3000); - break; - - case 38: - if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN47, pTemp); - JumpToNextStep(8000); - break; - - case 39: - if (Creature* pTemp = Unit::GetCreature(*me, uiLichKingGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN48, pTemp); - JumpToNextStep(15000); - break; - - case 40: - if (Creature* pTemp = Unit::GetCreature(*me, uiLichKingGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN49, pTemp); - JumpToNextStep(17000); - break; - - case 41: // Lich king - Apocalypse - if (Creature* pTemp = Unit::GetCreature(*me, uiLichKingGUID)) - { - DoScriptText(EMOTE_LIGHT_OF_DAWN11, pTemp); - DoScriptText(SAY_LIGHT_OF_DAWN51, pTemp); - if (Unit* pTirion = Unit::GetCreature(*me, uiTirionGUID)) - { - pTirion->SetStandState(UNIT_STAND_STATE_KNEEL); - //pTemp->CastSpell(pTirion, SPELL_APOCALYPSE, false); // not working - pTemp->CastSpell(pTirion, SPELL_SOUL_FEAST_TIRION, false); - DoScriptText(EMOTE_LIGHT_OF_DAWN12, pTirion); - } - } - JumpToNextStep(2000); - break; - - case 42: // Maxwell yells for attack - { - float fLichPositionX = 0, - fLichPositionY = 0, - fLichPositionZ = 0; - if (Creature* pTemp = Unit::GetCreature(*me, uiLichKingGUID)) - { - fLichPositionX = pTemp->GetPositionX(); - fLichPositionY = pTemp->GetPositionY(); - fLichPositionZ = pTemp->GetPositionZ(); - } - - if (fLichPositionX && fLichPositionY) - { - Unit* pTemp; - pTemp = me->SummonCreature(NPC_DEFENDER_OF_THE_LIGHT, LightofDawnLoc[0].x+rand()%10, LightofDawnLoc[0].y+rand()%10, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000); - pTemp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED); - pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - pTemp->SetSpeed(MOVE_RUN, 2.0f); - pTemp->setFaction(me->getFaction()); - pTemp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ); - uiDefenderGUID[0] = pTemp->GetGUID(); - - pTemp = me->SummonCreature(NPC_RIMBLAT_EARTHSHATTER, LightofDawnLoc[0].x+rand()%10, LightofDawnLoc[0].y+rand()%10, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000); - pTemp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED); - pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - pTemp->SetSpeed(MOVE_RUN, 2.0f); - pTemp->setFaction(me->getFaction()); - pTemp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ); - uiEarthshatterGUID[0] = pTemp->GetGUID(); - } - if (Creature* pTemp = Unit::GetCreature(*me, uiMaxwellGUID)) - { - pTemp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED); - pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - pTemp->SetSpeed(MOVE_RUN, 2.0f); - pTemp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ); - DoScriptText(SAY_LIGHT_OF_DAWN50, pTemp); - } - if (Creature* pTemp = Unit::GetCreature(*me, uiKorfaxGUID)) - { - pTemp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED); - pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - pTemp->SetSpeed(MOVE_RUN, 2.0f); - pTemp->HandleEmoteCommand(EMOTE_STATE_ATTACK_UNARMED); - pTemp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ); - } - if (Creature* pTemp = Unit::GetCreature(*me, uiEligorGUID)) - { - pTemp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED); - pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - pTemp->SetSpeed(MOVE_RUN, 2.0f); - pTemp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ); - } - } - JumpToNextStep(4500); - break; - - case 43: // They all got kicked - if (Creature* pTemp = Unit::GetCreature(*me, uiLichKingGUID)) - DoScriptText(EMOTE_LIGHT_OF_DAWN13, pTemp); - - if (Creature* pTemp = Unit::GetCreature(*me, uiMaxwellGUID)) - { - pTemp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE); - pTemp->SetSpeed(MOVE_RUN, 6.0f); - pTemp->SetStandState(UNIT_STAND_STATE_DEAD); - pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[14].x, LightofDawnLoc[14].y, LightofDawnLoc[14].z); - } - if (Creature* pTemp = Unit::GetCreature(*me, uiKorfaxGUID)) - { - pTemp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE); - pTemp->SetSpeed(MOVE_RUN, 6.0f); - pTemp->SetStandState(UNIT_STAND_STATE_DEAD); - pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[11].x, LightofDawnLoc[11].y, LightofDawnLoc[11].z); - } - if (Creature* pTemp = Unit::GetCreature(*me, uiEligorGUID)) - { - pTemp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE); - pTemp->SetSpeed(MOVE_RUN, 6.0f); - pTemp->SetStandState(UNIT_STAND_STATE_DEAD); - pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[17].x, LightofDawnLoc[17].y, LightofDawnLoc[17].z); - } - if (Creature* pTemp = Unit::GetCreature(*me, uiDefenderGUID[0])) - { - pTemp->SetSpeed(MOVE_RUN, 6.0f); - pTemp->SetStandState(UNIT_STAND_STATE_DEAD); - pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%10, LightofDawnLoc[0].y+rand()%10, LightofDawnLoc[0].z); - } - if (Creature* pTemp = Unit::GetCreature(*me, uiEarthshatterGUID[0])) - { - pTemp->SetSpeed(MOVE_RUN, 6.0f); - pTemp->SetStandState(UNIT_STAND_STATE_DEAD); - pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%10, LightofDawnLoc[0].y+rand()%10, LightofDawnLoc[0].z); - } - JumpToNextStep(3000); - break; - - case 44: // make them stand up - if (Creature* pTemp = Unit::GetCreature(*me, uiMaxwellGUID)) - pTemp->SetStandState(UNIT_STAND_STATE_STAND); - if (Creature* pTemp = Unit::GetCreature(*me, uiKorfaxGUID)) - pTemp->SetStandState(UNIT_STAND_STATE_STAND); - if (Creature* pTemp = Unit::GetCreature(*me, uiEligorGUID)) - pTemp->SetStandState(UNIT_STAND_STATE_STAND); - JumpToNextStep(1000); - break; - - case 45: - DoScriptText(SAY_LIGHT_OF_DAWN52, me); - JumpToNextStep(5000); - break; - - case 46: // Darion stand up, "not today" - me->SetSpeed(MOVE_RUN, 1.0f); - me->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - me->SetStandState(UNIT_STAND_STATE_STAND); - DoScriptText(SAY_LIGHT_OF_DAWN53, me); - SetHoldState(false); // Darion throws sword - JumpToNextStep(7000); - break; - - case 47: // Ashbringer rebirth - me->SetStandState(UNIT_STAND_STATE_KNEEL); - DoScriptText(EMOTE_LIGHT_OF_DAWN15, me); - if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) - { - pTemp->SetStandState(UNIT_STAND_STATE_STAND); - pTemp->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(EQUIP_HIGHLORD_TIRION_FORDRING)); - pTemp->CastSpell(pTemp, SPELL_REBIRTH_OF_THE_ASHBRINGER, false); - } - JumpToNextStep(1000); - break; - - case 48: // Show the cleansing effect (dawn of light) - //if (GameObject* pGo = me->GetMap()->GetGameObject(uiDawnofLightGUID)) - // pGo->SetPhaseMask(128, true); - me->SummonGameObject(GO_LIGHT_OF_DAWN, 2283.896, -5287.914, 83.066, 0, 0, 0, 0, 0, 30000); - if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) - { - if (pTemp->HasAura(SPELL_REBIRTH_OF_THE_ASHBRINGER, 0)) - pTemp->RemoveAurasDueToSpell(SPELL_REBIRTH_OF_THE_ASHBRINGER); - pTemp->CastSpell(pTemp, 41542, false); // workarounds, light expoded, makes it cool - pTemp->HandleEmoteCommand(EMOTE_ONESHOT_ROAR); - } - if (Creature* pTemp = Unit::GetCreature(*me, uiLichKingGUID)) - pTemp->InterruptNonMeleeSpells(false); - JumpToNextStep(2500); - break; - - case 49: - if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN54, pTemp); - JumpToNextStep(4000); - break; - - case 50: - if (Creature* pTemp = Unit::GetCreature(*me, uiLichKingGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN55, pTemp); - JumpToNextStep(5000); - break; - - case 51: - if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN56, pTemp); - JumpToNextStep(1000); - break; - - case 52: // Tiron charges - if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) - { - DoScriptText(EMOTE_LIGHT_OF_DAWN16, pTemp); - pTemp->CastSpell(pTemp, SPELL_TIRION_CHARGE, false); // jumping charge - pTemp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY2H); - pTemp->SetSpeed(MOVE_RUN, 3.0f); // workarounds, make Tirion still running - pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[2].x, LightofDawnLoc[2].y, LightofDawnLoc[2].z); - if (Creature* pTemp = Unit::GetCreature(*me, uiLichKingGUID)) - pTemp->Relocate(LightofDawnLoc[28].x, LightofDawnLoc[28].y, LightofDawnLoc[28].z); // workarounds, he should kick back by Tirion, but here we relocate him - } - JumpToNextStep(1500); - break; - - case 53: - if (Creature* pTemp = Unit::GetCreature(*me, uiLichKingGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN57, pTemp); - JumpToNextStep(1000); - break; - - case 54: - if (Creature* pTemp = Unit::GetCreature(*me, uiLichKingGUID)) - { - pTemp->SetSpeed(MOVE_RUN, 1.0f); - me->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[29].x, LightofDawnLoc[29].y, LightofDawnLoc[29].z); // 26 - } - JumpToNextStep(4000); - break; - - case 55: - if (Creature* pTemp = Unit::GetCreature(*me, uiLichKingGUID)) - pTemp->SetStandState(UNIT_STAND_STATE_KNEEL); - JumpToNextStep(2000); - break; - - case 56: - if (Creature* pTemp = Unit::GetCreature(*me, uiLichKingGUID)) - pTemp->SetStandState(UNIT_STAND_STATE_STAND); - JumpToNextStep(1500); - break; - - case 57: - if (Creature* pTemp = Unit::GetCreature(*me, uiLichKingGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN58, pTemp); - JumpToNextStep(10000); - break; - - case 58: - if (Creature* pTemp = Unit::GetCreature(*me, uiLichKingGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN59, pTemp); - JumpToNextStep(10000); - break; - - case 59: - if (Creature* pTemp = Unit::GetCreature(*me, uiLichKingGUID)) - pTemp->CastSpell(pTemp, SPELL_TELEPORT_VISUAL, false); - if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) // Tirion runs to Darion - { - pTemp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE); - pTemp->SetSpeed(MOVE_RUN, 1.0f); - pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[6].x, LightofDawnLoc[6].y, LightofDawnLoc[6].z); - } - JumpToNextStep(2500); - break; - - case 60: - if (Creature* pTemp = Unit::GetCreature(*me, uiLichKingGUID)) // Lich king disappears here - { - DoScriptText(EMOTE_LIGHT_OF_DAWN17, pTemp); - pTemp->Kill(pTemp); - } - JumpToNextStep(10000); - break; - - case 61: - if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN60, pTemp); - JumpToNextStep(3000); - break; - - case 62: - if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) - { - pTemp->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[7].x, LightofDawnLoc[7].y, LightofDawnLoc[7].z); - } - JumpToNextStep(5500); - break; - - case 63: - if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) - { - pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[8].x, LightofDawnLoc[8].y, LightofDawnLoc[8].z); - DoScriptText(SAY_LIGHT_OF_DAWN61, pTemp); - } - JumpToNextStep(15000); - break; - - case 64: - if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN62, pTemp); - JumpToNextStep(7000); - break; - - case 65: - if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN63, pTemp); - JumpToNextStep(10000); - break; - - case 66: - if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN64, pTemp); - JumpToNextStep(11000); - break; - - case 67: - if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN65, pTemp); - JumpToNextStep(10000); - break; - - case 68: - if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN66, pTemp); - JumpToNextStep(8000); - break; - - case 69: - if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN67, pTemp); - JumpToNextStep(10000); - break; - - case 70: - me->SetStandState(UNIT_STAND_STATE_STAND); - DoScriptText(SAY_LIGHT_OF_DAWN68, me); - JumpToNextStep(10000); - break; - - case 71: - //if (GameObject* pGo = me->GetMap()->GetGameObject(uiDawnofLightGUID)) // Turn off dawn of light - // pGo->SetPhaseMask(0, true); - - { - Map *map = me->GetMap(); // search players with in 50 yards for quest credit - Map::PlayerList const &PlayerList = map->GetPlayers(); - if (!PlayerList.isEmpty()) - { - for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) - if (i->getSource()->isAlive() && me->IsWithinDistInMap(i->getSource(), 50)) - i->getSource()->CastSpell(i->getSource(), SPELL_THE_LIGHT_OF_DAWN_Q, false); - } - } - me->SetVisibility(VISIBILITY_OFF); // respawns another Darion for quest turn in - me->SummonCreature(NPC_HIGHLORD_DARION_MOGRAINE, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 180000); - JumpToNextStep(1000); - break; - - case 72: - SetHoldState(false); // Escort ends - JumpToNextStep(25000); - break; - - case 73: - me->ForcedDespawn(); - break; - } - - } else uiPhase_timer -= diff; - } - - // ******* During battle ***************************************************************** - else - { - if (uiAnti_magic_zone <= diff) - { - DoCast(me, SPELL_ANTI_MAGIC_ZONE1); - uiAnti_magic_zone = 25000 + rand()%5000; - } else uiAnti_magic_zone -= diff; - - if (uiDeath_strike <= diff) - { - DoCast(me->getVictim(), SPELL_DEATH_STRIKE); - uiDeath_strike = 5000 + rand()%5000; - } else uiDeath_strike -= diff; - - if (uiDeath_embrace <= diff) - { - DoCast(me->getVictim(), SPELL_DEATH_EMBRACE); - uiDeath_embrace = 5000 + rand()%5000; - } else uiDeath_embrace -= diff; - - if (uiIcy_touch <= diff) - { - DoCast(me->getVictim(), SPELL_ICY_TOUCH1); - uiIcy_touch = 5000 + rand()%5000; - } else uiIcy_touch -= diff; - - if (uiUnholy_blight <= diff) - { - DoCast(me->getVictim(), SPELL_UNHOLY_BLIGHT); - uiUnholy_blight = 5000 + rand()%5000; - } else uiUnholy_blight -= diff; - - if (uiFight_speech <= diff) - { - DoScriptText(RAND(SAY_LIGHT_OF_DAWN09,SAY_LIGHT_OF_DAWN10,SAY_LIGHT_OF_DAWN11, - SAY_LIGHT_OF_DAWN12,SAY_LIGHT_OF_DAWN13,SAY_LIGHT_OF_DAWN14, - SAY_LIGHT_OF_DAWN15,SAY_LIGHT_OF_DAWN16,SAY_LIGHT_OF_DAWN17, - SAY_LIGHT_OF_DAWN18,SAY_LIGHT_OF_DAWN19,SAY_LIGHT_OF_DAWN20, - SAY_LIGHT_OF_DAWN21,SAY_LIGHT_OF_DAWN22,SAY_LIGHT_OF_DAWN23, - SAY_LIGHT_OF_DAWN24), me); - uiFight_speech = 15000 + rand()%5000; - } else uiFight_speech -= diff; - - // Check spawns - if (uiSpawncheck <= diff) - { - SpawnNPC(); - uiSpawncheck = 1000; - } else uiSpawncheck -= diff; - - // Check targets - if (uiTargetcheck <= diff) - { - for (uint8 i = 0; i < ENCOUNTER_GHOUL_NUMBER; ++i) - NPCChangeTarget(uiGhoulGUID[i]); - for (uint8 i = 0; i < ENCOUNTER_WARRIOR_NUMBER; ++i) - NPCChangeTarget(uiWarriorGUID[i]); - for (uint8 i = 0; i < ENCOUNTER_ABOMINATION_NUMBER; ++i) - NPCChangeTarget(uiAbominationGUID[i]); - for (uint8 i = 0; i < ENCOUNTER_BEHEMOTH_NUMBER; ++i) - NPCChangeTarget(uiBehemothGUID[i]); - NPCChangeTarget(uiKoltiraGUID); - NPCChangeTarget(uiOrbazGUID); - NPCChangeTarget(uiThassarianGUID); - - uiTargetcheck = 10000; - } else uiTargetcheck -= diff; - - // Battle end - if (uiFight_duration <= diff + 5000) - { - if (!uiTirionGUID) - if (Unit* pTemp = me->SummonCreature(NPC_HIGHLORD_TIRION_FORDRING, LightofDawnLoc[0].x, LightofDawnLoc[0].y, LightofDawnLoc[0].z, 1.528, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 600000)) - { - pTemp->setFaction(me->getFaction()); - pTemp->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(EQUIP_UNEQUIP)); - DoScriptText(SAY_LIGHT_OF_DAWN25, pTemp); - uiTirionGUID = pTemp->GetGUID(); - } - } - if (uiFight_duration <= diff) - { - bIsBattle = false; - uiFight_duration = 300000; - - if (me->HasAura(SPELL_THE_MIGHT_OF_MOGRAINE, 0)) - me->RemoveAurasDueToSpell(SPELL_THE_MIGHT_OF_MOGRAINE); - me->RemoveAllAuras(); - me->DeleteThreatList(); - me->CombatStop(true); - me->InterruptNonMeleeSpells(false); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - - for (uint8 i = 0; i < ENCOUNTER_DEFENDER_NUMBER; ++i) - DespawnNPC(uiDefenderGUID[i]); - for (uint8 i = 0; i < ENCOUNTER_EARTHSHATTER_NUMBER; ++i) - DespawnNPC(uiEarthshatterGUID[i]); - for (uint8 i = 0; i < ENCOUNTER_ABOMINATION_NUMBER; ++i) - DespawnNPC(uiAbominationGUID[i]); - for (uint8 i = 0; i < ENCOUNTER_BEHEMOTH_NUMBER; ++i) - DespawnNPC(uiBehemothGUID[i]); - for (uint8 i = 0; i < ENCOUNTER_GHOUL_NUMBER; ++i) - DespawnNPC(uiGhoulGUID[i]); - for (uint8 i = 0; i < ENCOUNTER_WARRIOR_NUMBER; ++i) - DespawnNPC(uiWarriorGUID[i]); - - if (Creature* pTemp = Unit::GetCreature(*me, uiKorfaxGUID)) - { - pTemp->RemoveAllAuras(); - pTemp->DeleteThreatList(); - pTemp->CombatStop(true); - pTemp->AttackStop(); - pTemp->setFaction(me->getFaction()); - pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[9].x, LightofDawnLoc[9].y, LightofDawnLoc[9].z); - } - - if (Creature* pTemp = Unit::GetCreature(*me, uiMaxwellGUID)) - { - pTemp->RemoveAllAuras(); - pTemp->DeleteThreatList(); - pTemp->CombatStop(true); - pTemp->AttackStop(); - pTemp->setFaction(me->getFaction()); - pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[12].x, LightofDawnLoc[12].y, LightofDawnLoc[12].z); - } - - if (Creature* pTemp = Unit::GetCreature(*me, uiEligorGUID)) - { - pTemp->RemoveAllAuras(); - pTemp->DeleteThreatList(); - pTemp->CombatStop(true); - pTemp->AttackStop(); - pTemp->setFaction(me->getFaction()); - pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[15].x, LightofDawnLoc[15].y, LightofDawnLoc[15].z); - } - DespawnNPC(uiRayneGUID); - - if (Creature* pTemp = Unit::GetCreature(*me, uiKoltiraGUID)) - { - pTemp->RemoveAllAuras(); - pTemp->DeleteThreatList(); - pTemp->CombatStop(true); - pTemp->AttackStop(); - pTemp->setFaction(me->getFaction()); - pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[18].x, LightofDawnLoc[18].y, LightofDawnLoc[18].z); - pTemp->CastSpell(pTemp, SPELL_THE_LIGHT_OF_DAWN, false); - } - - if (Creature* pTemp = Unit::GetCreature(*me, uiOrbazGUID)) - DoScriptText(EMOTE_LIGHT_OF_DAWN04, pTemp); - - if (Creature* pTemp = Unit::GetCreature(*me, uiThassarianGUID)) - { - pTemp->RemoveAllAuras(); - pTemp->DeleteThreatList(); - pTemp->CombatStop(true); - pTemp->AttackStop(); - pTemp->setFaction(me->getFaction()); - pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[20].x, LightofDawnLoc[20].y, LightofDawnLoc[20].z); - pTemp->CastSpell(pTemp, SPELL_THE_LIGHT_OF_DAWN, false); - } - - if (Creature* pTemp = Unit::GetCreature(*me, uiTirionGUID)) - DoScriptText(SAY_LIGHT_OF_DAWN26, pTemp); - - SetHoldState(false); - - } else uiFight_duration -= diff; - - DoMeleeAttackIfReady(); - } - } - - void JumpToNextStep(uint32 uiTimer) - { - uiPhase_timer = uiTimer; - ++uiStep; - } - - void NPCChangeTarget(uint64 ui_GUID) - { - if (Creature* pTemp = Unit::GetCreature(*me, ui_GUID)) - if (pTemp->isAlive()) - if (Unit* pTarger = SelectUnit(SELECT_TARGET_RANDOM,0)) - if (pTarger->isAlive()) - { - // pTemp->DeleteThreatList(); - pTemp->AddThreat(pTarger, 0.0f); - pTemp->AI()->AttackStart(pTarger); - pTemp->SetInCombatWith(pTarger); - pTarger->SetInCombatWith(pTemp); - // pTemp->GetMotionMaster()->MoveChase(pTarger, 20.0f); - } - } - - void SpawnNPC() - { - Unit* pTemp = NULL; - - // Death - for (uint8 i = 0; i < ENCOUNTER_GHOUL_NUMBER; ++i) - { - pTemp = Unit::GetCreature(*me, uiGhoulGUID[i]); - if (!pTemp) - { - pTemp = me->SummonCreature(NPC_ACHERUS_GHOUL, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); - pTemp->setFaction(2084); - uiGhoulGUID[i] = pTemp->GetGUID(); - } - } - for (uint8 i = 0; i < ENCOUNTER_ABOMINATION_NUMBER; ++i) - { - pTemp = Unit::GetCreature(*me, uiAbominationGUID[i]); - if (!pTemp) - { - pTemp = me->SummonCreature(NPC_WARRIOR_OF_THE_FROZEN_WASTES, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); - pTemp->setFaction(2084); - uiAbominationGUID[i] = pTemp->GetGUID(); - } - } - for (uint8 i = 0; i < ENCOUNTER_WARRIOR_NUMBER; ++i) - { - pTemp = Unit::GetCreature(*me, uiWarriorGUID[i]); - if (!pTemp) - { - pTemp = me->SummonCreature(NPC_RAMPAGING_ABOMINATION, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); - pTemp->setFaction(2084); - uiWarriorGUID[i] = pTemp->GetGUID(); - } - } - for (uint8 i = 0; i < ENCOUNTER_BEHEMOTH_NUMBER; ++i) - { - pTemp = Unit::GetCreature(*me, uiBehemothGUID[i]); - if (!pTemp) - { - pTemp = me->SummonCreature(NPC_FLESH_BEHEMOTH, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); - pTemp->setFaction(2084); - uiBehemothGUID[i] = pTemp->GetGUID(); - } - } - - // Dawn - for (uint8 i = 0; i < ENCOUNTER_DEFENDER_NUMBER; ++i) - { - pTemp = Unit::GetCreature(*me, uiDefenderGUID[i]); - if (!pTemp) - { - pTemp = me->SummonCreature(NPC_DEFENDER_OF_THE_LIGHT, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); - pTemp->setFaction(2089); - me->AddThreat(pTemp, 0.0f); - uiDefenderGUID[i] = pTemp->GetGUID(); - } - } - for (uint8 i = 0; i < ENCOUNTER_EARTHSHATTER_NUMBER; ++i) - { - pTemp = Unit::GetCreature(*me, uiEarthshatterGUID[i]); - if (!pTemp) - { - pTemp = me->SummonCreature(NPC_RIMBLAT_EARTHSHATTER, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); - pTemp->setFaction(2089); - me->AddThreat(pTemp, 0.0f); - uiEarthshatterGUID[i] = pTemp->GetGUID(); - } - } - pTemp = Unit::GetCreature(*me, uiKorfaxGUID); - if (!pTemp) - { - pTemp = me->SummonCreature(NPC_KORFAX_CHAMPION_OF_THE_LIGHT, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 600000); - pTemp->setFaction(2089); - me->AddThreat(pTemp, 0.0f); - uiKorfaxGUID = pTemp->GetGUID(); - } - pTemp = Unit::GetCreature(*me, uiMaxwellGUID); - if (!pTemp) - { - pTemp = me->SummonCreature(NPC_LORD_MAXWELL_TYROSUS, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 600000); - pTemp->setFaction(2089); - me->AddThreat(pTemp, 0.0f); - uiMaxwellGUID = pTemp->GetGUID(); - } - pTemp = Unit::GetCreature(*me, uiEligorGUID); - if (!pTemp) - { - pTemp = me->SummonCreature(NPC_COMMANDER_ELIGOR_DAWNBRINGER, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 600000); - pTemp->setFaction(2089); - me->AddThreat(pTemp, 0.0f); - uiEligorGUID = pTemp->GetGUID(); - } - pTemp = Unit::GetCreature(*me, uiRayneGUID); - if (!pTemp) - { - pTemp = me->SummonCreature(NPC_RAYNE, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); - pTemp->setFaction(2089); - me->AddThreat(pTemp, 0.0f); - uiRayneGUID = pTemp->GetGUID(); - } - } - - void DespawnNPC(uint64 pGUID) - { - if (Creature* pTemp = Unit::GetCreature(*me, pGUID)) - if (pTemp->isAlive()) - { - pTemp->SetVisibility(VISIBILITY_OFF); - pTemp->Kill(pTemp); - } - } -}; - -bool GossipHello_npc_highlord_darion_mograine(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - - if (pPlayer->GetQuestStatus(12801) == QUEST_STATUS_INCOMPLETE) - pPlayer->ADD_GOSSIP_ITEM(0, "I am ready.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); - - return true; -} - -bool GossipSelect_npc_highlord_darion_mograine(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction) -{ - switch (uiAction) - { - case GOSSIP_ACTION_INFO_DEF+1: - pPlayer->CLOSE_GOSSIP_MENU(); - CAST_AI(npc_highlord_darion_mograineAI, pCreature->AI())->uiStep = 1; - CAST_AI(npc_highlord_darion_mograineAI, pCreature->AI())->Start(true, false, pPlayer->GetGUID()); - break; - } - return true; -} - -/*###### -## npc the lich king in dawn of light -######*/ -struct npc_the_lich_king_tirion_dawnAI : public ScriptedAI -{ - npc_the_lich_king_tirion_dawnAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); } - void Reset() {} - void AttackStart(Unit * /*who*/) {} // very sample, just don't make them aggreesive - void UpdateAI(const uint32 /*diff*/) {} - void JustDied(Unit* /*killer*/) {} -}; - -CreatureAI* GetAI_npc_highlord_darion_mograine(Creature* pCreature) -{ - return new npc_highlord_darion_mograineAI(pCreature); -} - -CreatureAI* GetAI_npc_the_lich_king_tirion_dawn(Creature* pCreature) -{ - return new npc_the_lich_king_tirion_dawnAI (pCreature); -} - -void AddSC_the_scarlet_enclave_c5() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "npc_highlord_darion_mograine"; - newscript->GetAI = &GetAI_npc_highlord_darion_mograine; - newscript->pGossipHello = &GossipHello_npc_highlord_darion_mograine; - newscript->pGossipSelect = &GossipSelect_npc_highlord_darion_mograine; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_the_lich_king_tirion_dawn"; - newscript->GetAI = &GetAI_npc_the_lich_king_tirion_dawn; - newscript->RegisterSelf(); -} diff --git a/src/server/scripts/EasternKingdoms/scarlet_enclave/the_scarlet_enclave.cpp b/src/server/scripts/EasternKingdoms/scarlet_enclave/the_scarlet_enclave.cpp deleted file mode 100644 index cdfd69234fb..00000000000 --- a/src/server/scripts/EasternKingdoms/scarlet_enclave/the_scarlet_enclave.cpp +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright (C) 2009 Trinity - * - * 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 - */ - -#include "ScriptedPch.h" - -/*#### -## npc_valkyr_battle_maiden -####*/ -#define SPELL_REVIVE 51918 -#define VALK_WHISPER "It is not yet your time, champion. Rise! Rise and fight once more!" - -struct npc_valkyr_battle_maidenAI : public PassiveAI -{ - npc_valkyr_battle_maidenAI(Creature *c) : PassiveAI(c) {} - - uint32 FlyBackTimer; - float x, y, z; - uint32 phase; - - void Reset() - { - me->setActive(true); - me->SetVisibility(VISIBILITY_OFF); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->SetFlying(true); - FlyBackTimer = 500; - phase = 0; - - me->GetPosition(x, y, z); - z += 4; x -= 3.5; y -= 5; - me->GetMotionMaster()->Clear(false); - me->GetMap()->CreatureRelocation(me, x, y, z, 0.0f); - } - - void UpdateAI(const uint32 diff) - { - if (FlyBackTimer <= diff) - { - Player *plr = NULL; - if (me->isSummon()) - if (Unit *summoner = CAST_SUM(me)->GetSummoner()) - if (summoner->GetTypeId() == TYPEID_PLAYER) - plr = CAST_PLR(summoner); - - if (!plr) - phase = 3; - - switch(phase) - { - case 0: - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - me->HandleEmoteCommand(EMOTE_STATE_FLYGRABCLOSED); - FlyBackTimer = 500; - break; - case 1: - plr->GetClosePoint(x,y,z, me->GetObjectSize()); - z += 2.5; x -= 2; y -= 1.5; - me->GetMotionMaster()->MovePoint(0, x, y, z); - me->SetUInt64Value(UNIT_FIELD_TARGET, plr->GetGUID()); - me->SetVisibility(VISIBILITY_ON); - FlyBackTimer = 4500; - break; - case 2: - if (!plr->isRessurectRequested()) - { - me->HandleEmoteCommand(EMOTE_ONESHOT_CUSTOMSPELL01); - DoCast(plr, SPELL_REVIVE, true); - me->MonsterWhisper(VALK_WHISPER, plr->GetGUID()); - } - FlyBackTimer = 5000; - break; - case 3: - me->SetVisibility(VISIBILITY_OFF); - FlyBackTimer = 3000; - break; - case 4: - me->DisappearAndDie(); - break; - default: - //Nothing To DO - break; - } - ++phase; - } else FlyBackTimer-=diff; - } -}; - -CreatureAI* GetAI_npc_valkyr_battle_maiden(Creature* pCreature) -{ - return new npc_valkyr_battle_maidenAI (pCreature); -} - -void AddSC_the_scarlet_enclave() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "npc_valkyr_battle_maiden"; - newscript->GetAI = &GetAI_npc_valkyr_battle_maiden; - newscript->RegisterSelf(); - - // Chapter 3: Scarlet Armies Approach... - An End To All Things... - // Chapter 4: An End To All Things... - An End To All Things... -} diff --git a/src/server/scripts/EasternKingdoms/scarlet_monastery/boss_arcanist_doan.cpp b/src/server/scripts/EasternKingdoms/scarlet_monastery/boss_arcanist_doan.cpp deleted file mode 100644 index cb6ed1daf22..00000000000 --- a/src/server/scripts/EasternKingdoms/scarlet_monastery/boss_arcanist_doan.cpp +++ /dev/null @@ -1,128 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 .sourceforge.net/> - * 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_Arcanist_Doan -SD%Complete: 100 -SDComment: -SDCategory: Scarlet Monastery -EndScriptData */ - -#include "ScriptedPch.h" - -enum eEnums -{ - SAY_AGGRO = -1189019, - SAY_SPECIALAE = -1189020, - - SPELL_POLYMORPH = 13323, - SPELL_AOESILENCE = 8988, - SPELL_ARCANEEXPLOSION = 9433, - SPELL_FIREAOE = 9435, - SPELL_ARCANEBUBBLE = 9438, -}; - -struct boss_arcanist_doanAI : public ScriptedAI -{ - boss_arcanist_doanAI(Creature *c) : ScriptedAI(c) {} - - uint32 Polymorph_Timer; - uint32 AoESilence_Timer; - uint32 ArcaneExplosion_Timer; - bool bCanDetonate; - bool bShielded; - - void Reset() - { - Polymorph_Timer = 20000; - AoESilence_Timer = 15000; - ArcaneExplosion_Timer = 3000; - bCanDetonate = false; - bShielded = false; - } - - void EnterCombat(Unit * /*who*/) - { - DoScriptText(SAY_AGGRO, me); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (bShielded && bCanDetonate) - { - DoCast(me, SPELL_FIREAOE); - bCanDetonate = false; - } - - if (me->HasAura(SPELL_ARCANEBUBBLE)) - return; - - //If we are <50% hp cast Arcane Bubble - if (!bShielded && me->GetHealth()*100 / me->GetMaxHealth() <= 50) - { - //wait if we already casting - if (me->IsNonMeleeSpellCasted(false)) - return; - - DoScriptText(SAY_SPECIALAE, me); - DoCast(me, SPELL_ARCANEBUBBLE); - - bCanDetonate = true; - bShielded = true; - } - - if (Polymorph_Timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1)) - DoCast(pTarget, SPELL_POLYMORPH); - - Polymorph_Timer = 20000; - } else Polymorph_Timer -= diff; - - //AoESilence_Timer - if (AoESilence_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_AOESILENCE); - AoESilence_Timer = 15000 + rand()%5000; - } else AoESilence_Timer -= diff; - - //ArcaneExplosion_Timer - if (ArcaneExplosion_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_ARCANEEXPLOSION); - ArcaneExplosion_Timer = 8000; - } else ArcaneExplosion_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_arcanist_doan(Creature* pCreature) -{ - return new boss_arcanist_doanAI (pCreature); -} - -void AddSC_boss_arcanist_doan() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_arcanist_doan"; - newscript->GetAI = &GetAI_boss_arcanist_doan; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/scarlet_monastery/boss_azshir_the_sleepless.cpp b/src/server/scripts/EasternKingdoms/scarlet_monastery/boss_azshir_the_sleepless.cpp deleted file mode 100644 index 6b6efa0f934..00000000000 --- a/src/server/scripts/EasternKingdoms/scarlet_monastery/boss_azshir_the_sleepless.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: Boss_Azshir_the_Sleepless -SD%Complete: 80 -SDComment: -SDCategory: Scarlet Monastery -EndScriptData */ - -#include "ScriptedPch.h" - -#define SPELL_CALLOFTHEGRAVE 17831 -#define SPELL_TERRIFY 7399 -#define SPELL_SOULSIPHON 7290 - -struct boss_azshir_the_sleeplessAI : public ScriptedAI -{ - boss_azshir_the_sleeplessAI(Creature *c) : ScriptedAI(c) {} - - uint32 SoulSiphon_Timer; - uint32 CallOftheGrave_Timer; - uint32 Terrify_Timer; - - void Reset() - { - SoulSiphon_Timer = 1; - CallOftheGrave_Timer = 30000; - Terrify_Timer = 20000; - } - - void EnterCombat(Unit * /*who*/) - { - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //If we are <50% hp cast Soul Siphon rank 1 - if (me->GetHealth()*100 / me->GetMaxHealth() <= 50 && !me->IsNonMeleeSpellCasted(false)) - { - //SoulSiphon_Timer - if (SoulSiphon_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SOULSIPHON); - return; - - //SoulSiphon_Timer = 20000; - } else SoulSiphon_Timer -= diff; - } - - //CallOfTheGrave_Timer - if (CallOftheGrave_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_CALLOFTHEGRAVE); - CallOftheGrave_Timer = 30000; - } else CallOftheGrave_Timer -= diff; - - //Terrify_Timer - if (Terrify_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_TERRIFY); - Terrify_Timer = 20000; - } else Terrify_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_azshir_the_sleepless(Creature* pCreature) -{ - return new boss_azshir_the_sleeplessAI (pCreature); -} - -void AddSC_boss_azshir_the_sleepless() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_azshir_the_sleepless"; - newscript->GetAI = &GetAI_boss_azshir_the_sleepless; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/scarlet_monastery/boss_bloodmage_thalnos.cpp b/src/server/scripts/EasternKingdoms/scarlet_monastery/boss_bloodmage_thalnos.cpp deleted file mode 100644 index f7b6b7cce4b..00000000000 --- a/src/server/scripts/EasternKingdoms/scarlet_monastery/boss_bloodmage_thalnos.cpp +++ /dev/null @@ -1,124 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 .sourceforge.net/> - * 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_Bloodmage_Thalnos -SD%Complete: 100 -SDComment: -SDCategory: Scarlet Monastery -EndScriptData */ - -#include "ScriptedPch.h" - -enum eEnums -{ - SAY_AGGRO = -1189016, - SAY_HEALTH = -1189017, - SAY_KILL = -1189018, - - SPELL_FLAMESHOCK = 8053, - SPELL_SHADOWBOLT = 1106, - SPELL_FLAMESPIKE = 8814, - SPELL_FIRENOVA = 16079, -}; - -struct boss_bloodmage_thalnosAI : public ScriptedAI -{ - boss_bloodmage_thalnosAI(Creature *c) : ScriptedAI(c) {} - - bool HpYell; - uint32 FlameShock_Timer; - uint32 ShadowBolt_Timer; - uint32 FlameSpike_Timer; - uint32 FireNova_Timer; - - void Reset() - { - HpYell = false; - FlameShock_Timer = 10000; - ShadowBolt_Timer = 2000; - FlameSpike_Timer = 8000; - FireNova_Timer = 40000; - } - - void EnterCombat(Unit * /*who*/) - { - DoScriptText(SAY_AGGRO, me); - } - - void KilledUnit(Unit* /*Victim*/) - { - DoScriptText(SAY_KILL, me); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //If we are <35% hp - if (!HpYell && ((me->GetHealth()*100) / me->GetMaxHealth() <= 35)) - { - DoScriptText(SAY_HEALTH, me); - HpYell = true; - } - - //FlameShock_Timer - if (FlameShock_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_FLAMESHOCK); - FlameShock_Timer = 10000 + rand()%5000; - } else FlameShock_Timer -= diff; - - //FlameSpike_Timer - if (FlameSpike_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_FLAMESPIKE); - FlameSpike_Timer = 30000; - } else FlameSpike_Timer -= diff; - - //FireNova_Timer - if (FireNova_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_FIRENOVA); - FireNova_Timer = 40000; - } else FireNova_Timer -= diff; - - //ShadowBolt_Timer - if (ShadowBolt_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SHADOWBOLT); - ShadowBolt_Timer = 2000; - } else ShadowBolt_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_bloodmage_thalnos(Creature* pCreature) -{ - return new boss_bloodmage_thalnosAI (pCreature); -} - -void AddSC_boss_bloodmage_thalnos() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_bloodmage_thalnos"; - newscript->GetAI = &GetAI_boss_bloodmage_thalnos; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/scarlet_monastery/boss_headless_horseman.cpp b/src/server/scripts/EasternKingdoms/scarlet_monastery/boss_headless_horseman.cpp deleted file mode 100644 index 17bbf0c23c6..00000000000 --- a/src/server/scripts/EasternKingdoms/scarlet_monastery/boss_headless_horseman.cpp +++ /dev/null @@ -1,892 +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_Headless_Horseman -SD%Complete: -SDComment: -SDCategory: Scarlet Monastery -EndScriptData */ - -#include "ScriptedPch.h" -#include "SpellMgr.h" -#include "scarlet_monastery.h" - -//this texts are already used by 3975 and 3976 -#define SAY_ENTRANCE -1189001 -#define SAY_REJOINED -1189002 -#define SAY_LOST_HEAD -1189003 -#define SAY_CONFLAGRATION -1189004 -#define SAY_SPROUTING_PUMPKINS -1189005 -#define SAY_PLAYER_DEATH -1189006 -#define SAY_DEATH -1189007 - -uint32 RandomLaugh[] = {11965, 11975, 11976}; - - // Entryes -#define HH_MOUNTED 23682 -#define HH_UNHORSED 23800 -#define HEAD 23775 -#define PULSING_PUMPKIN 23694 -#define PUMPKIN_FIEND 23545 -#define HELPER 23686 -#define WISP_INVIS 24034 - - //Spells -#define SPELL_CLEAVE 42587 -#define SPELL_CONFLAGRATION 42380 //Phase 2, can't find real spell(Dim Fire?) -//#define SPELL_CONFL_SPEED 22587 //8% increase speed, value 22587 from SPELL_CONFLAGRATION mains that spell? -#define SPELL_SUMMON_PUMPKIN 42394 - -#define SPELL_WHIRLWIND 43116 -#define SPELL_IMMUNE 42556 -#define SPELL_BODY_REGEN 42403 -#define SPELL_CONFUSE 43105 - -#define SPELL_FLYING_HEAD 42399 //visual flying head -#define SPELL_HEAD 42413 //visual buff, "head" -#define SPELL_HEAD_IS_DEAD 42428 //at killing head, Phase 3 - -#define SPELL_PUMPKIN_AURA 42280 -#define SPELL_PUMPKIN_AURA_GREEN 42294 -#define SPELL_SQUASH_SOUL 42514 -#define SPELL_SPROUTING 42281 -#define SPELL_SPROUT_BODY 42285 - - //Effects -#define SPELL_RHYME_BIG 42909 -//#define SPELL_RHYME_SMALL 42910 -#define SPELL_HEAD_SPEAKS 43129 -#define SPELL_HEAD_LANDS 42400 -#define SPELL_BODY_FLAME 42074 -#define SPELL_HEAD_FLAME 42971 -//#define SPELL_ENRAGE_VISUAL 42438 // he uses this spell? -#define SPELL_WISP_BLUE 42821 -#define SPELL_WISP_FLIGHT_PORT 42818 -//#define SPELL_WISP_INVIS 42823 -#define SPELL_SMOKE 42355 -#define SPELL_DEATH 42566 //not correct spell - -struct Locations -{ - float x, y, z; -}; - -static Locations FlightPoint[]= -{ - {1754.00,1346.00,17.50}, - {1765.00,1347.00,19.00}, - {1784.00,1346.80,25.40}, - {1803.30,1347.60,33.00}, - {1824.00,1350.00,42.60}, - {1838.80,1353.20,49.80}, - {1852.00,1357.60,55.70}, - {1861.30,1364.00,59.40}, - {1866.30,1374.80,61.70}, - {1864.00,1387.30,63.20}, - {1854.80,1399.40,64.10}, - {1844.00,1406.90,64.10}, - {1824.30,1411.40,63.30}, - {1801.00,1412.30,60.40}, - {1782.00,1410.10,55.50}, - {1770.50,1405.20,50.30}, - {1765.20,1400.70,46.60}, - {1761.40,1393.40,41.70}, - {1759.10,1386.70,36.60}, - {1757.80,1378.20,29.00}, - {1758.00,1367.00,19.51} -}; - -static Locations Spawn[]= -{ - {1776.27,1348.74,19.20}, //spawn point for pumpkin shrine mob - {1765.28,1347.46,17.55} //spawn point for smoke -}; - -static const char* Text[]= -{ - "Horseman rise...", - "Your time is nigh...", - "You felt death once...", - "Now, know demise!" -}; - -#define EMOTE_LAUGHS "Headless Horseman laughs" - -struct mob_wisp_invisAI : public ScriptedAI -{ - mob_wisp_invisAI(Creature *c) : ScriptedAI(c) - { - Creaturetype = delay = spell = spell2 = 0; - //that's hack but there are no info about range of this spells in dbc - SpellEntry *wisp = GET_SPELL(SPELL_WISP_BLUE); - if (wisp) - wisp->rangeIndex = 6; //100 yards - SpellEntry *port = GET_SPELL(SPELL_WISP_FLIGHT_PORT); - if (port) - port->rangeIndex = 6; - } - - uint32 Creaturetype; - uint32 delay; - uint32 spell; - uint32 spell2; - void Reset(){} - void EnterCombat(Unit * /*who*/){} - void SetType(uint32 _type) - { - switch(Creaturetype = _type) - { - case 1: - spell = SPELL_PUMPKIN_AURA_GREEN; - break; - case 2: - delay = 15000; - spell = SPELL_BODY_FLAME; - spell2 = SPELL_DEATH; - break; - case 3: - delay = 15000; - spell = SPELL_SMOKE; - break; - case 4: - delay = 7000; - spell2 = SPELL_WISP_BLUE; - break; - } - if (spell) - DoCast(me, spell); - } - - void SpellHit(Unit* /*caster*/, const SpellEntry *spell) - { - if (spell->Id == SPELL_WISP_FLIGHT_PORT && Creaturetype == 4) - me->SetDisplayId(2027); - } - - void MoveInLineOfSight(Unit *who) - { - if (!who || Creaturetype != 1 || !who->isTargetableForAttack()) - return; - - if (me->IsWithinDist(who, 0.1, false) && !who->HasAura(SPELL_SQUASH_SOUL)) - DoCast(who, SPELL_SQUASH_SOUL); - } - - void UpdateAI(const uint32 diff) - { - if (delay) - { - if (delay <= diff) - { - me->RemoveAurasDueToSpell(SPELL_SMOKE); - if (spell2) - DoCast(me, spell2); - delay = 0; - } else delay -= diff; - } - } -}; - -struct mob_headAI : public ScriptedAI -{ - mob_headAI(Creature *c) : ScriptedAI(c) {} - - uint64 bodyGUID; - - uint32 Phase; - uint32 laugh; - uint32 wait; - - bool withbody; - bool die; - - void Reset() - { - Phase = 0; - bodyGUID = 0; - die = false; - withbody = true; - wait = 1000; - laugh = urand(15000,30000); - } - - void EnterCombat(Unit * /*who*/) {} - void SaySound(int32 textEntry, Unit *pTarget = 0) - { - DoScriptText(textEntry, me, pTarget); - //DoCast(me, SPELL_HEAD_SPEAKS, true); - Creature *speaker = DoSpawnCreature(HELPER,0,0,0,0,TEMPSUMMON_TIMED_DESPAWN,1000); - if (speaker) - speaker->CastSpell(speaker,SPELL_HEAD_SPEAKS,false); - laugh += 3000; - } - - void DamageTaken(Unit* /*done_by*/,uint32 &damage) - { - if (withbody) - return; - - switch(Phase) - { - case 1: - if (((me->GetHealth() - damage)*100)/me->GetMaxHealth() < 67) - Disappear(); - break; - case 2: - if (((me->GetHealth() - damage)*100)/me->GetMaxHealth() < 34) - Disappear(); - break; - case 3: - if (damage >= me->GetHealth()) - { - die = true; - withbody = true; - wait = 300; - damage = me->GetHealth() - me->GetMaxHealth()/100; - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->StopMoving(); - //me->GetMotionMaster()->MoveIdle(); - DoCast(me, SPELL_HEAD_IS_DEAD); - } - break; - } - } - - void SpellHit(Unit *caster, const SpellEntry* spell) - { - if (!withbody) - return; - - if (spell->Id == SPELL_FLYING_HEAD) - { - if (Phase < 3) ++Phase; - else Phase = 3; - withbody = false; - if (!bodyGUID) - bodyGUID = caster->GetGUID(); - me->RemoveAllAuras(); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - DoCast(me, SPELL_HEAD_LANDS, true); - DoCast(me, SPELL_HEAD, false); - SaySound(SAY_LOST_HEAD); - me->GetMotionMaster()->Clear(false); - me->GetMotionMaster()->MoveFleeing(caster->getVictim()); - } - } - void Disappear();//we must set returned=true(this will prevent from "body calls head" while head flying to body), see function below - void UpdateAI(const uint32 diff) - { - if (!withbody) - { - if (wait <= diff) - { - wait = 1000; - if (!me->getVictim()) return; - me->GetMotionMaster()->Clear(false); - me->GetMotionMaster()->MoveFleeing(me->getVictim()); - } else wait -= diff; - - if (laugh <= diff) - { - laugh = urand(15000,30000); - DoPlaySoundToSet(me, RandomLaugh[urand(0,2)]); - //DoCast(me, SPELL_HEAD_SPEAKS, true); //this spell remove buff "head" - Creature *speaker = DoSpawnCreature(HELPER,0,0,0,0,TEMPSUMMON_TIMED_DESPAWN,1000); - if (speaker) - speaker->CastSpell(speaker,SPELL_HEAD_SPEAKS,false); - me->MonsterTextEmote(EMOTE_LAUGHS,NULL); - } else laugh -= diff; - } - else - { - if (die) - { - if (wait <= diff) - { - die = false; - if (Unit *body = Unit::GetUnit((*me), bodyGUID)) - body->Kill(body); - me->Kill(me); - } else wait -= diff; - } - } - } -}; - -struct boss_headless_horsemanAI : public ScriptedAI -{ - boss_headless_horsemanAI(Creature *c) : ScriptedAI(c) - { - SpellEntry *confl = GET_SPELL(SPELL_CONFLAGRATION); - if (confl) - { - confl->EffectApplyAuraName[0] = SPELL_AURA_PERIODIC_DAMAGE_PERCENT; - confl->EffectBasePoints[0] = 10; - //confl->EffectBaseDice[0] = 10; - confl->DmgMultiplier[0] = 1; - } -/* - if (SpellEntry *confl = GET_SPELL(SPELL_CONFLAGRATION)) - confl->EffectTriggerSpell[1] = 22587; - - if (SpellEntry *speed = GET_SPELL(22587)) - { - speed->Effect[1] = SPELL_EFFECT_APPLY_AURA; - speed->EffectApplyAuraName[1] = SPELL_AURA_MOD_CONFUSE; - } -*/ - pInstance = c->GetInstanceData(); - } - - ScriptedInstance *pInstance; - - uint64 headGUID; - uint64 PlayerGUID; - - uint32 Phase; - uint32 id; - uint32 count; - uint32 say_timer; - - uint32 conflagrate; - uint32 summonadds; - uint32 cleave; - uint32 regen; - uint32 whirlwind; - uint32 laugh; - uint32 burn; - - bool withhead; - bool returned; - bool IsFlying; - bool wp_reached; - bool burned; - - void Reset() - { - Phase = 1; - conflagrate = 15000; - summonadds = 15000; - laugh = urand(16000,20000); - cleave = 2000; - regen = 1000; - burn = 6000; - count = 0; - say_timer = 3000; - - withhead = true; - returned = true; - burned = false; - IsFlying = false; - DoCast(me, SPELL_HEAD); - if (headGUID) - { - if (Creature* Head = Unit::GetCreature((*me), headGUID)) - Head->DisappearAndDie(); - - headGUID = 0; - } - - //if (pInstance) - // pInstance->SetData(DATA_HORSEMAN_EVENT, NOT_STARTED); - } - - void FlyMode() - { - me->SetVisibility(VISIBILITY_OFF); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_LEVITATING); - me->SetSpeed(MOVE_WALK,5.0f,true); - wp_reached = false; - count = 0; - say_timer = 3000; - id = 0; - Phase = 0; - } - - void MovementInform(uint32 type, uint32 i) - { - if (type != POINT_MOTION_TYPE || !IsFlying || i != id) - return; - - wp_reached = true; - - switch (id) - { - case 0: - me->SetVisibility(VISIBILITY_ON); - break; - case 1: - { - if (Creature *smoke = me->SummonCreature(HELPER,Spawn[1].x,Spawn[1].y,Spawn[1].z,0,TEMPSUMMON_TIMED_DESPAWN,20000)) - CAST_AI(mob_wisp_invisAI, smoke->AI())->SetType(3); - DoCast(me, SPELL_RHYME_BIG); - break; - } - case 6: - if (pInstance) - pInstance->SetData(GAMEOBJECT_PUMPKIN_SHRINE, 0); //hide gameobject - break; - case 19: - me->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_LEVITATING); - break; - case 20: - { - Phase = 1; - IsFlying = false; - wp_reached = false; - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - SaySound(SAY_ENTRANCE); - if (Unit *plr = Unit::GetUnit((*me),PlayerGUID)) - DoStartMovement(plr); - break; - } - } - ++id; - } - - void EnterCombat(Unit * /*who*/) - { - if (pInstance) - pInstance->SetData(DATA_HORSEMAN_EVENT, IN_PROGRESS); - DoZoneInCombat(); - } - void AttackStart(Unit* who) {ScriptedAI::AttackStart(who);} - void MoveInLineOfSight(Unit *who) - { - if (withhead && Phase != 0) - ScriptedAI::MoveInLineOfSight(who); - } - void KilledUnit(Unit *plr) - { - if (plr->GetTypeId() == TYPEID_PLAYER) - { - if (withhead) - SaySound(SAY_PLAYER_DEATH); - //maybe possible when player dies from conflagration - else if (Creature *Head = Unit::GetCreature((*me), headGUID)) - CAST_AI(mob_headAI, Head->AI())->SaySound(SAY_PLAYER_DEATH); - } - } - - void SaySound(int32 textEntry, Unit *pTarget = 0) - { - DoScriptText(textEntry, me, pTarget); - laugh += 4000; - } - - Player* SelectRandomPlayer(float range = 0.0f, bool checkLoS = true) - { - Map* pMap = me->GetMap(); - if (!pMap->IsDungeon()) return NULL; - - Map::PlayerList const &PlayerList = pMap->GetPlayers(); - Map::PlayerList::const_iterator i; - if (PlayerList.isEmpty()) return NULL; - - std::list temp; - std::list::const_iterator j; - - for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) - if ((me->IsWithinLOSInMap(i->getSource()) || !checkLoS) && me->getVictim() != i->getSource() && - me->IsWithinDistInMap(i->getSource(), range) && i->getSource()->isAlive()) - temp.push_back(i->getSource()); - - if (temp.size()) - { - j = temp.begin(); - advance(j, rand()%temp.size()); - return (*j); - } - return NULL; - } - - void SpellHitTarget(Unit* unit, const SpellEntry* spell) - { - if (spell->Id == SPELL_CONFLAGRATION && unit->HasAura(SPELL_CONFLAGRATION)) - SaySound(SAY_CONFLAGRATION,unit); - } - - void JustDied(Unit* /*killer*/) - { - me->StopMoving(); - //me->GetMotionMaster()->MoveIdle(); - SaySound(SAY_DEATH); - if (Creature *flame = DoSpawnCreature(HELPER,0,0,0,0,TEMPSUMMON_TIMED_DESPAWN,60000)) - flame->CastSpell(flame,SPELL_BODY_FLAME,false); - if (Creature *wisp = DoSpawnCreature(WISP_INVIS,0,0,0,0,TEMPSUMMON_TIMED_DESPAWN,60000)) - CAST_AI(mob_wisp_invisAI, wisp->AI())->SetType(4); - if (pInstance) - pInstance->SetData(DATA_HORSEMAN_EVENT, DONE); - } - - void SpellHit(Unit *caster, const SpellEntry* spell) - { - if (withhead) - return; - - if (spell->Id == SPELL_FLYING_HEAD) - { - if (Phase < 3) - ++Phase; - else - Phase = 3; - withhead = true; - me->RemoveAllAuras(); - me->SetName("Headless Horseman"); - me->SetHealth(me->GetMaxHealth()); - SaySound(SAY_REJOINED); - DoCast(me, SPELL_HEAD); - caster->GetMotionMaster()->Clear(false); - caster->GetMotionMaster()->MoveFollow(me,6,urand(0,5)); - //DoResetThreat();//not sure if need - std::list::const_iterator itr; - for (itr = caster->getThreatManager().getThreatList().begin(); itr != caster->getThreatManager().getThreatList().end(); ++itr) - { - Unit* pUnit = Unit::GetUnit((*me), (*itr)->getUnitGuid()); - if (pUnit && pUnit->isAlive() && pUnit != caster) - me->AddThreat(pUnit,caster->getThreatManager().getThreat(pUnit)); - } - } - } - - void DamageTaken(Unit *done_by, uint32 &damage) - { - if (damage >= me->GetHealth() && withhead) - { - withhead = false; - returned = false; - damage = me->GetHealth() - me->GetMaxHealth()/100; - me->RemoveAllAuras(); - me->SetName("Headless Horseman, Unhorsed"); - - if (!headGUID) - headGUID = DoSpawnCreature(HEAD,rand()%6,rand()%6,0,0,TEMPSUMMON_DEAD_DESPAWN,0)->GetGUID(); - Unit* Head = Unit::GetUnit((*me), headGUID); - if (Head && Head->isAlive()) - { - Head->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - //Head->CastSpell(Head,SPELL_HEAD_INVIS,false); - me->InterruptNonMeleeSpells(false); - DoCast(me, SPELL_IMMUNE, true); - DoCast(me, SPELL_BODY_REGEN, true); - DoCast(Head, SPELL_FLYING_HEAD, true); - DoCast(me, SPELL_CONFUSE, false); //test - done_by->ProcDamageAndSpell(me,PROC_FLAG_KILL,PROC_FLAG_KILLED,PROC_EX_NONE,0); - whirlwind = urand(4000,8000); - regen = 0; - } - } - } - - void UpdateAI(const uint32 diff) - { - if (withhead) - { - switch(Phase) - { - case 0: - { - if (!IsFlying) - { - if (say_timer <= diff) - { - say_timer = 3000; - Player *plr = SelectRandomPlayer(100.0f,false); - if (count < 3) - { - if (plr) - plr->Say(Text[count],0); - } - else - { - DoCast(me, SPELL_RHYME_BIG); - if (plr) - { - plr->Say(Text[count],0); - plr->HandleEmoteCommand(ANIM_EMOTE_SHOUT); - } - wp_reached = true; - IsFlying = true; - count = 0; - break; - } - ++count; - } else say_timer -= diff; - } - else - { - if (wp_reached) - { - wp_reached = false; - me->GetMotionMaster()->Clear(false); - me->GetMotionMaster()->MovePoint(id,FlightPoint[id].x,FlightPoint[id].y,FlightPoint[id].z); - } - } - } - break; - case 1: - if (burned) - break; - if (burn <= diff) - { - if (Creature *flame = me->SummonCreature(HELPER,Spawn[0].x,Spawn[0].y,Spawn[0].z,0,TEMPSUMMON_TIMED_DESPAWN,17000)) - CAST_AI(mob_wisp_invisAI, flame->AI())->SetType(2); - burned = true; - } else burn -= diff; - break; - case 2: - if (conflagrate <= diff) - { - if (Unit *plr = SelectRandomPlayer(30.0f)) - DoCast(plr, SPELL_CONFLAGRATION, false); - conflagrate = urand(10000,16000); - } else conflagrate -= diff; - break; - case 3: - if (summonadds <= diff) - { - me->InterruptNonMeleeSpells(false); - DoCast(me, SPELL_SUMMON_PUMPKIN); - SaySound(SAY_SPROUTING_PUMPKINS); - summonadds = urand(25000,35000); - } else summonadds -= diff; - break; - } - - if (laugh <= diff) - { - laugh = urand(11000,22000); - me->MonsterTextEmote(EMOTE_LAUGHS,NULL); - DoPlaySoundToSet(me, RandomLaugh[rand()%3]); - } else laugh -= diff; - - if (UpdateVictim()) - { - DoMeleeAttackIfReady(); - if (cleave <= diff) - { - DoCast(me->getVictim(), SPELL_CLEAVE); - cleave = urand(2000,6000); //1 cleave per 2.0-6.0sec - } else cleave -= diff; - } - } - else - { - if (regen <= diff) - { - regen = 1000; //"body calls head" - if (me->GetHealth()/me->GetMaxHealth() == 1 && !returned) - { - if (Phase > 1) - --Phase; - else - Phase = 1; - Creature* Head = Unit::GetCreature((*me), headGUID); - if (Head && Head->isAlive()) - { - CAST_AI(mob_headAI, Head->AI())->Phase = Phase; - CAST_AI(mob_headAI, Head->AI())->Disappear(); - } - return; - } - } - else regen -= diff; - - if (whirlwind <= diff) - { - whirlwind = urand(4000,8000); - if (urand(0,1)) - { - me->RemoveAurasDueToSpell(SPELL_CONFUSE); - DoCast(me, SPELL_WHIRLWIND, true); - DoCast(me, SPELL_CONFUSE); - } else - me->RemoveAurasDueToSpell(SPELL_WHIRLWIND); - } else whirlwind -= diff; - } - } -}; - -void mob_headAI::Disappear() -{ - if (withbody) - return; - if (bodyGUID) - { - Creature *body = Unit::GetCreature((*me), bodyGUID); - if (body && body->isAlive()) - { - withbody = true; - me->RemoveAllAuras(); - body->RemoveAurasDueToSpell(SPELL_IMMUNE);//hack, SpellHit doesn't calls if body has immune aura - DoCast(body, SPELL_FLYING_HEAD); - me->SetHealth(me->GetMaxHealth()); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->GetMotionMaster()->MoveIdle(); - CAST_AI(boss_headless_horsemanAI, body->AI())->returned = true; - } - } -} - -struct mob_pulsing_pumpkinAI : public ScriptedAI -{ - mob_pulsing_pumpkinAI(Creature *c) : ScriptedAI(c) {} - - bool sprouted; - uint64 debuffGUID; - - void Reset() - { - float x, y, z; - me->GetPosition(x, y, z); //this visual aura some under ground - me->GetMap()->CreatureRelocation(me, x,y,z + 0.35f, 0.0f); - Despawn(); - Creature *debuff = DoSpawnCreature(HELPER,0,0,0,0,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,14500); - if (debuff) - { - debuff->SetDisplayId(me->GetDisplayId()); - debuff->CastSpell(debuff,SPELL_PUMPKIN_AURA_GREEN,false); - CAST_AI(mob_wisp_invisAI, debuff->AI())->SetType(1); - debuffGUID = debuff->GetGUID(); - } - sprouted = false; - DoCast(me, SPELL_PUMPKIN_AURA, true); - DoCast(me, SPELL_SPROUTING); - me->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_STUNNED); - } - - void EnterCombat(Unit * /*who*/){} - - void SpellHit(Unit * /*caster*/, const SpellEntry *spell) - { - if (spell->Id == SPELL_SPROUTING) - { - sprouted = true; - me->RemoveAllAuras(); - me->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_STUNNED); - DoCast(me, SPELL_SPROUT_BODY, true); - me->UpdateEntry(PUMPKIN_FIEND); - DoStartMovement(me->getVictim()); - } - } - - void Despawn() - { - if (!debuffGUID) return; - Unit *debuff = Unit::GetUnit((*me),debuffGUID); - if (debuff) - debuff->SetVisibility(VISIBILITY_OFF); - debuffGUID = 0; - } - - void JustDied(Unit * /*killer*/) { if (!sprouted) Despawn(); } - - void MoveInLineOfSight(Unit *who) - { - if (!who || !who->isTargetableForAttack() || !me->IsHostileTo(who) || me->getVictim()) - return; - - me->AddThreat(who,0.0f); - if (sprouted) - DoStartMovement(who); - } - - void UpdateAI(const uint32 /*diff*/) - { - if (sprouted && UpdateVictim()) - DoMeleeAttackIfReady(); - } -}; - -bool GOHello_go_loosely_turned_soil(Player* pPlayer, GameObject* soil) -{ - ScriptedInstance* pInstance = pPlayer->GetInstanceData(); - if (pInstance) - { - if (pInstance->GetData(DATA_HORSEMAN_EVENT) != NOT_STARTED) - return true; - pInstance->SetData(DATA_HORSEMAN_EVENT, IN_PROGRESS); - } -/* if (soil->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER && plr->getLevel() > 64) - { - plr->PrepareQuestMenu(soil->GetGUID()); - plr->SendPreparedQuest(soil->GetGUID()); - } - if (plr->GetQuestStatus(11405) == QUEST_STATUS_INCOMPLETE && plr->getLevel() > 64) - { */ - pPlayer->AreaExploredOrEventHappens(11405); - if (Creature *horseman = soil->SummonCreature(HH_MOUNTED,FlightPoint[20].x,FlightPoint[20].y,FlightPoint[20].z,0,TEMPSUMMON_MANUAL_DESPAWN,0)) - { - CAST_AI(boss_headless_horsemanAI, horseman->AI())->PlayerGUID = pPlayer->GetGUID(); - CAST_AI(boss_headless_horsemanAI, horseman->AI())->FlyMode(); - } - //} - return true; -} - -CreatureAI* GetAI_mob_head(Creature* pCreature) -{ - return new mob_headAI (pCreature); -} - -CreatureAI* GetAI_boss_headless_horseman(Creature* pCreature) -{ - return new boss_headless_horsemanAI (pCreature); -} - -CreatureAI* GetAI_mob_pulsing_pumpkin(Creature* pCreature) -{ - return new mob_pulsing_pumpkinAI (pCreature); -} - -CreatureAI* GetAI_mob_wisp_invis(Creature* pCreature) -{ - return new mob_wisp_invisAI (pCreature); -} - -void AddSC_boss_headless_horseman() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "boss_headless_horseman"; - newscript->GetAI = &GetAI_boss_headless_horseman; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_head"; - newscript->GetAI = &GetAI_mob_head; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_pulsing_pumpkin"; - newscript->GetAI = &GetAI_mob_pulsing_pumpkin; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_wisp_invis"; - newscript->GetAI = &GetAI_mob_wisp_invis; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "go_loosely_turned_soil"; - newscript->pGOHello = &GOHello_go_loosely_turned_soil; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/scarlet_monastery/boss_herod.cpp b/src/server/scripts/EasternKingdoms/scarlet_monastery/boss_herod.cpp deleted file mode 100644 index e0db29aa240..00000000000 --- a/src/server/scripts/EasternKingdoms/scarlet_monastery/boss_herod.cpp +++ /dev/null @@ -1,158 +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_Herod -SD%Complete: 95 -SDComment: Should in addition spawn Myrmidons in the hallway outside -SDCategory: Scarlet Monastery -EndScriptData */ - -#include "ScriptedPch.h" -#include "ScriptedEscortAI.h" - -#define SAY_AGGRO -1189000 -#define SAY_WHIRLWIND -1189001 -#define SAY_ENRAGE -1189002 -#define SAY_KILL -1189003 -#define EMOTE_ENRAGE -1189004 - -#define SPELL_RUSHINGCHARGE 8260 -#define SPELL_CLEAVE 15496 -#define SPELL_WHIRLWIND 8989 -#define SPELL_FRENZY 8269 - -#define ENTRY_SCARLET_TRAINEE 6575 -#define ENTRY_SCARLET_MYRMIDON 4295 - -struct boss_herodAI : public ScriptedAI -{ - boss_herodAI(Creature *c) : ScriptedAI(c) {} - - bool Enrage; - - uint32 Cleave_Timer; - uint32 Whirlwind_Timer; - - void Reset() - { - Enrage = false; - Cleave_Timer = 12000; - Whirlwind_Timer = 60000; - } - - void EnterCombat(Unit * /*who*/) - { - DoScriptText(SAY_AGGRO, me); - DoCast(me, SPELL_RUSHINGCHARGE); - } - - void KilledUnit(Unit * /*victim*/) - { - DoScriptText(SAY_KILL, me); - } - - void JustDied(Unit* /*killer*/) - { - for (uint8 i = 0; i < 20; ++i) - me->SummonCreature(ENTRY_SCARLET_TRAINEE, 1939.18, -431.58, 17.09, 6.22, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //If we are <30% hp goes Enraged - if (!Enrage && me->GetHealth()*100 / me->GetMaxHealth() <= 30 && !me->IsNonMeleeSpellCasted(false)) - { - DoScriptText(EMOTE_ENRAGE, me); - DoScriptText(SAY_ENRAGE, me); - DoCast(me, SPELL_FRENZY); - Enrage = true; - } - - //Cleave_Timer - if (Cleave_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_CLEAVE); - Cleave_Timer = 12000; - } else Cleave_Timer -= diff; - - // Whirlwind_Timer - if (Whirlwind_Timer <= diff) - { - DoScriptText(SAY_WHIRLWIND, me); - DoCast(me->getVictim(), SPELL_WHIRLWIND); - Whirlwind_Timer = 30000; - } else Whirlwind_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_herod(Creature* pCreature) -{ - return new boss_herodAI(pCreature); -} - -struct mob_scarlet_traineeAI : public npc_escortAI -{ - mob_scarlet_traineeAI(Creature *c) : npc_escortAI(c) - { - Start_Timer = urand(1000,6000); - } - - uint32 Start_Timer; - - void Reset() {} - void WaypointReached(uint32 /*uiPoint*/) {} - void EnterCombat(Unit* /*who*/) {} - - void UpdateAI(const uint32 diff) - { - if (Start_Timer) - { - if (Start_Timer <= diff) - { - Start(true,true); - Start_Timer = 0; - } else Start_Timer -= diff; - } - - npc_escortAI::UpdateAI(diff); - } -}; - -CreatureAI* GetAI_mob_scarlet_trainee(Creature* pCreature) -{ - return new mob_scarlet_traineeAI(pCreature); -} - -void AddSC_boss_herod() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_herod"; - newscript->GetAI = &GetAI_boss_herod; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_scarlet_trainee"; - newscript->GetAI = &GetAI_mob_scarlet_trainee; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/scarlet_monastery/boss_high_inquisitor_fairbanks.cpp b/src/server/scripts/EasternKingdoms/scarlet_monastery/boss_high_inquisitor_fairbanks.cpp deleted file mode 100644 index b9b15f34508..00000000000 --- a/src/server/scripts/EasternKingdoms/scarlet_monastery/boss_high_inquisitor_fairbanks.cpp +++ /dev/null @@ -1,133 +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_Inquisitor_Fairbanks -SD%Complete: 100 -SDComment: TODO: if this guy not involved in some special event, remove (and let ACID script) -SDCategory: Scarlet Monastery -EndScriptData */ - -#include "ScriptedPch.h" - -enum eSpells -{ - SPELL_CURSEOFBLOOD = 8282, - SPELL_DISPELMAGIC = 15090, - SPELL_FEAR = 12096, - SPELL_HEAL = 12039, - SPELL_POWERWORDSHIELD = 11647, - SPELL_SLEEP = 8399 -}; - -struct boss_high_inquisitor_fairbanksAI : public ScriptedAI -{ - boss_high_inquisitor_fairbanksAI(Creature *c) : ScriptedAI(c) {} - - uint32 CurseOfBlood_Timer; - uint32 DispelMagic_Timer; - uint32 Fear_Timer; - uint32 Heal_Timer; - uint32 Sleep_Timer; - uint32 Dispel_Timer; - bool PowerWordShield; - - void Reset() - { - CurseOfBlood_Timer = 10000; - DispelMagic_Timer = 30000; - Fear_Timer = 40000; - Heal_Timer = 30000; - Sleep_Timer = 30000; - Dispel_Timer = 20000; - PowerWordShield = false; - } - - void EnterCombat(Unit * /*who*/) - { - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //If we are <25% hp cast Heal - if (me->GetHealth()*100 / me->GetMaxHealth() <= 25 && !me->IsNonMeleeSpellCasted(false) && Heal_Timer <= diff) - { - DoCast(me, SPELL_HEAL); - Heal_Timer = 30000; - } else Heal_Timer -= diff; - - //Fear_Timer - if (Fear_Timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1)) - DoCast(pTarget, SPELL_FEAR); - - Fear_Timer = 40000; - } else Fear_Timer -= diff; - - //Sleep_Timer - if (Sleep_Timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO,0)) - DoCast(pTarget, SPELL_SLEEP); - - Sleep_Timer = 30000; - } else Sleep_Timer -= diff; - - //PowerWordShield_Timer - if (!PowerWordShield && me->GetHealth()*100 / me->GetMaxHealth() <= 25) - { - DoCast(me, SPELL_POWERWORDSHIELD); - PowerWordShield = true; - } - - //Dispel_Timer - if (Dispel_Timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(pTarget, SPELL_DISPELMAGIC); - - DispelMagic_Timer = 30000; - } else DispelMagic_Timer -= diff; - - //CurseOfBlood_Timer - if (CurseOfBlood_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_CURSEOFBLOOD); - CurseOfBlood_Timer = 25000; - } else CurseOfBlood_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_high_inquisitor_fairbanks(Creature* pCreature) -{ - return new boss_high_inquisitor_fairbanksAI (pCreature); -} - -void AddSC_boss_high_inquisitor_fairbanks() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_high_inquisitor_fairbanks"; - newscript->GetAI = &GetAI_boss_high_inquisitor_fairbanks; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/scarlet_monastery/boss_houndmaster_loksey.cpp b/src/server/scripts/EasternKingdoms/scarlet_monastery/boss_houndmaster_loksey.cpp deleted file mode 100644 index 300e69611cd..00000000000 --- a/src/server/scripts/EasternKingdoms/scarlet_monastery/boss_houndmaster_loksey.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 .sourceforge.net/> - * 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_Houndmaster_Loksey -SD%Complete: 100 -SDComment: -SDCategory: Scarlet Monastery -EndScriptData */ - -#include "ScriptedPch.h" - -enum eEnums -{ - SAY_AGGRO = -1189021, - SPELL_SUMMONSCARLETHOUND = 17164, - SPELL_BLOODLUST = 6742 -}; - -struct boss_houndmaster_lokseyAI : public ScriptedAI -{ - boss_houndmaster_lokseyAI(Creature *c) : ScriptedAI(c) {} - - uint32 BloodLust_Timer; - - void Reset() - { - BloodLust_Timer = 20000; - } - - void EnterCombat(Unit * /*who*/) - { - DoScriptText(SAY_AGGRO, me); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (BloodLust_Timer <= diff) - { - DoCast(me, SPELL_BLOODLUST); - BloodLust_Timer = 20000; - } else BloodLust_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_houndmaster_loksey(Creature* pCreature) -{ - return new boss_houndmaster_lokseyAI (pCreature); -} - -void AddSC_boss_houndmaster_loksey() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_houndmaster_loksey"; - newscript->GetAI = &GetAI_boss_houndmaster_loksey; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/scarlet_monastery/boss_interrogator_vishas.cpp b/src/server/scripts/EasternKingdoms/scarlet_monastery/boss_interrogator_vishas.cpp deleted file mode 100644 index b4b84fc8059..00000000000 --- a/src/server/scripts/EasternKingdoms/scarlet_monastery/boss_interrogator_vishas.cpp +++ /dev/null @@ -1,118 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 .sourceforge.net/> - * 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_Interrogator_Vishas -SD%Complete: 100 -SDComment: -SDCategory: Scarlet Monastery -EndScriptData */ - -#include "ScriptedPch.h" -#include "scarlet_monastery.h" - -enum eEnums -{ - SAY_AGGRO = -1189011, - SAY_HEALTH1 = -1189012, - SAY_HEALTH2 = -1189013, - SAY_KILL = -1189014, - SAY_TRIGGER_VORREL = -1189015, - - SPELL_SHADOWWORDPAIN = 2767, -}; - -struct boss_interrogator_vishasAI : public ScriptedAI -{ - boss_interrogator_vishasAI(Creature *c) : ScriptedAI(c) - { - pInstance = me->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - bool Yell30; - bool Yell60; - uint32 ShadowWordPain_Timer; - - void Reset() - { - ShadowWordPain_Timer = 5000; - } - - void EnterCombat(Unit * /*who*/) - { - DoScriptText(SAY_AGGRO, me); - } - - void KilledUnit(Unit* /*Victim*/) - { - DoScriptText(SAY_KILL, me); - } - - void JustDied(Unit* /*Killer*/) - { - if (!pInstance) - return; - - //Any other actions to do with vorrel? setStandState? - if (Unit *vorrel = Unit::GetUnit(*me,pInstance->GetData64(DATA_VORREL))) - DoScriptText(SAY_TRIGGER_VORREL, vorrel); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //If we are low on hp Do sayings - if (!Yell60 && ((me->GetHealth()*100) / me->GetMaxHealth() <= 60)) - { - DoScriptText(SAY_HEALTH1, me); - Yell60 = true; - } - - if (!Yell30 && ((me->GetHealth()*100) / me->GetMaxHealth() <= 30)) - { - DoScriptText(SAY_HEALTH2, me); - Yell30 = true; - } - - //ShadowWordPain_Timer - if (ShadowWordPain_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SHADOWWORDPAIN); - ShadowWordPain_Timer = 5000 + rand()%10000; - } else ShadowWordPain_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_interrogator_vishas(Creature* pCreature) -{ - return new boss_interrogator_vishasAI (pCreature); -} - -void AddSC_boss_interrogator_vishas() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_interrogator_vishas"; - newscript->GetAI = &GetAI_boss_interrogator_vishas; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/scarlet_monastery/boss_mograine_and_whitemane.cpp b/src/server/scripts/EasternKingdoms/scarlet_monastery/boss_mograine_and_whitemane.cpp deleted file mode 100644 index 32b85e214a0..00000000000 --- a/src/server/scripts/EasternKingdoms/scarlet_monastery/boss_mograine_and_whitemane.cpp +++ /dev/null @@ -1,359 +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_Mograine_And_Whitemane -SD%Complete: 90 -SDComment: -SDCategory: Scarlet Monastery -EndScriptData */ - -#include "ScriptedPch.h" -#include "scarlet_monastery.h" - -enum eEnums -{ - //Mograine says - SAY_MO_AGGRO = -1189005, - SAY_MO_KILL = -1189006, - SAY_MO_RESSURECTED = -1189007, - - //Whitemane says - SAY_WH_INTRO = -1189008, - SAY_WH_KILL = -1189009, - SAY_WH_RESSURECT = -1189010, - - //Mograine Spells - SPELL_CRUSADERSTRIKE = 14518, - SPELL_HAMMEROFJUSTICE = 5589, - SPELL_LAYONHANDS = 9257, - SPELL_RETRIBUTIONAURA = 8990, - - //Whitemanes Spells - SPELL_DEEPSLEEP = 9256, - SPELL_SCARLETRESURRECTION = 9232, - SPELL_DOMINATEMIND = 14515, - SPELL_HOLYSMITE = 9481, - SPELL_HEAL = 12039, - SPELL_POWERWORDSHIELD = 22187 -}; - -struct boss_scarlet_commander_mograineAI : public ScriptedAI -{ - boss_scarlet_commander_mograineAI(Creature* pCreature) : ScriptedAI(pCreature) - { - m_pInstance = pCreature->GetInstanceData(); - } - - ScriptedInstance* m_pInstance; - - uint32 m_uiCrusaderStrike_Timer; - uint32 m_uiHammerOfJustice_Timer; - - bool m_bHasDied; - bool m_bHeal; - bool m_bFakeDeath; - - void Reset() - { - m_uiCrusaderStrike_Timer = 10000; - m_uiHammerOfJustice_Timer = 10000; - - //Incase wipe during phase that mograine fake death - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetStandState(UNIT_STAND_STATE_STAND); - - if (m_pInstance) - if (me->isAlive()) - m_pInstance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT,NOT_STARTED); - - m_bHasDied = false; - m_bHeal = false; - m_bFakeDeath = false; - } - - void JustReachedHome() - { - if (m_pInstance) - { - if (m_pInstance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT != NOT_STARTED)) - m_pInstance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, FAIL); - } - } - - void EnterCombat(Unit* /*pWho*/) - { - DoScriptText(SAY_MO_AGGRO, me); - DoCast(me, SPELL_RETRIBUTIONAURA); - - me->CallForHelp(VISIBLE_RANGE); - } - - void KilledUnit(Unit* /*pVictim*/) - { - DoScriptText(SAY_MO_KILL, me); - } - - void DamageTaken(Unit* /*pDoneBy*/, uint32 &uiDamage) - { - if (uiDamage < me->GetHealth() || m_bHasDied || m_bFakeDeath) - return; - - if (!m_pInstance) - return; - - //On first death, fake death and open door, as well as initiate whitemane if exist - if (Unit* Whitemane = Unit::GetUnit((*me), m_pInstance->GetData64(DATA_WHITEMANE))) - { - m_pInstance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, IN_PROGRESS); - - Whitemane->GetMotionMaster()->MovePoint(1,1163.113370,1398.856812,32.527786); - - me->GetMotionMaster()->MovementExpired(); - me->GetMotionMaster()->MoveIdle(); - - me->SetHealth(0); - - if (me->IsNonMeleeSpellCasted(false)) - me->InterruptNonMeleeSpells(false); - - me->ClearComboPointHolders(); - me->RemoveAllAuras(); - me->ClearAllReactives(); - - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetStandState(UNIT_STAND_STATE_DEAD); - - m_bHasDied = true; - m_bFakeDeath = true; - - uiDamage = 0; - } - } - - void SpellHit(Unit* /*pWho*/, const SpellEntry* pSpell) - { - //When hit with ressurection say text - if (pSpell->Id == SPELL_SCARLETRESURRECTION) - { - DoScriptText(SAY_MO_RESSURECTED, me); - m_bFakeDeath = false; - - if (m_pInstance) - m_pInstance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, SPECIAL); - } - } - - void UpdateAI(const uint32 uiDiff) - { - if (!UpdateVictim()) - return; - - if (m_bHasDied && !m_bHeal && m_pInstance && m_pInstance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) == SPECIAL) - { - //On ressurection, stop fake death and heal whitemane and resume fight - if (Unit* Whitemane = Unit::GetUnit((*me), m_pInstance->GetData64(DATA_WHITEMANE))) - { - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetStandState(UNIT_STAND_STATE_STAND); - DoCast(Whitemane, SPELL_LAYONHANDS); - - m_uiCrusaderStrike_Timer = 10000; - m_uiHammerOfJustice_Timer = 10000; - - if (me->getVictim()) - me->GetMotionMaster()->MoveChase(me->getVictim()); - - m_bHeal = true; - } - } - - //This if-check to make sure mograine does not attack while fake death - if (m_bFakeDeath) - return; - - //m_uiCrusaderStrike_Timer - if (m_uiCrusaderStrike_Timer <= uiDiff) - { - DoCast(me->getVictim(), SPELL_CRUSADERSTRIKE); - m_uiCrusaderStrike_Timer = 10000; - } else m_uiCrusaderStrike_Timer -= uiDiff; - - //m_uiHammerOfJustice_Timer - if (m_uiHammerOfJustice_Timer <= uiDiff) - { - DoCast(me->getVictim(), SPELL_HAMMEROFJUSTICE); - m_uiHammerOfJustice_Timer = 60000; - } else m_uiHammerOfJustice_Timer -= uiDiff; - - DoMeleeAttackIfReady(); - } -}; - -struct boss_high_inquisitor_whitemaneAI : public ScriptedAI -{ - boss_high_inquisitor_whitemaneAI(Creature* pCreature) : ScriptedAI(pCreature) - { - m_pInstance = pCreature->GetInstanceData(); - } - - ScriptedInstance* m_pInstance; - - uint32 m_uiHeal_Timer; - uint32 m_uiPowerWordShield_Timer; - uint32 m_uiHolySmite_Timer; - uint32 m_uiWait_Timer; - - bool m_bCanResurrectCheck; - bool m_bCanResurrect; - - void Reset() - { - m_uiWait_Timer = 7000; - m_uiHeal_Timer = 10000; - m_uiPowerWordShield_Timer = 15000; - m_uiHolySmite_Timer = 6000; - - m_bCanResurrectCheck = false; - m_bCanResurrect = false; - - if (m_pInstance) - if (me->isAlive()) - m_pInstance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, NOT_STARTED); - } - - void AttackStart(Unit* pWho) - { - if (m_pInstance && m_pInstance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) == NOT_STARTED) - return; - - ScriptedAI::AttackStart(pWho); - } - - void EnterCombat(Unit* /*pWho*/) - { - DoScriptText(SAY_WH_INTRO, me); - } - - void KilledUnit(Unit* /*pVictim*/) - { - DoScriptText(SAY_WH_KILL, me); - } - - void UpdateAI(const uint32 uiDiff) - { - if (!UpdateVictim()) - return; - - if (m_bCanResurrect) - { - //When casting resuruction make sure to delay so on rez when reinstate battle deepsleep runs out - if (m_pInstance && m_uiWait_Timer <= uiDiff) - { - if (Unit* Mograine = Unit::GetUnit((*me), m_pInstance->GetData64(DATA_MOGRAINE))) - { - DoCast(Mograine, SPELL_SCARLETRESURRECTION); - DoScriptText(SAY_WH_RESSURECT, me); - m_bCanResurrect = false; - } - } - else m_uiWait_Timer -= uiDiff; - } - - //Cast Deep sleep when health is less than 50% - if (!m_bCanResurrectCheck && me->GetHealth()*100 / me->GetMaxHealth() <= 50) - { - if (me->IsNonMeleeSpellCasted(false)) - me->InterruptNonMeleeSpells(false); - - DoCast(me->getVictim(), SPELL_DEEPSLEEP); - m_bCanResurrectCheck = true; - m_bCanResurrect = true; - return; - } - - //while in "resurrect-mode", don't do anything - if (m_bCanResurrect) - return; - - //If we are <75% hp cast healing spells at self or Mograine - if (m_uiHeal_Timer <= uiDiff) - { - Creature* pTarget = NULL; - - if (me->GetHealth() <= me->GetMaxHealth()*0.75f) - pTarget = me; - - if (m_pInstance) - { - if (Creature* pMograine = Unit::GetCreature((*me), m_pInstance->GetData64(DATA_MOGRAINE))) - { - // checking m_bCanResurrectCheck prevents her healing Mograine while he is "faking death" - if (m_bCanResurrectCheck && pMograine->isAlive() && pMograine->GetHealth() <= pMograine->GetMaxHealth()*0.75f) - pTarget = pMograine; - } - } - - if (pTarget) - DoCast(pTarget, SPELL_HEAL); - - m_uiHeal_Timer = 13000; - } else m_uiHeal_Timer -= uiDiff; - - //m_uiPowerWordShield_Timer - if (m_uiPowerWordShield_Timer <= uiDiff) - { - DoCast(me, SPELL_POWERWORDSHIELD); - m_uiPowerWordShield_Timer = 15000; - } else m_uiPowerWordShield_Timer -= uiDiff; - - //m_uiHolySmite_Timer - if (m_uiHolySmite_Timer <= uiDiff) - { - DoCast(me->getVictim(), SPELL_HOLYSMITE); - m_uiHolySmite_Timer = 6000; - } else m_uiHolySmite_Timer -= uiDiff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_scarlet_commander_mograine(Creature* pCreature) -{ - return new boss_scarlet_commander_mograineAI (pCreature); -} - -CreatureAI* GetAI_boss_high_inquisitor_whitemane(Creature* pCreature) -{ - return new boss_high_inquisitor_whitemaneAI (pCreature); -} - -void AddSC_boss_mograine_and_whitemane() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "boss_scarlet_commander_mograine"; - newscript->GetAI = &GetAI_boss_scarlet_commander_mograine; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_high_inquisitor_whitemane"; - newscript->GetAI = &GetAI_boss_high_inquisitor_whitemane; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/scarlet_monastery/boss_scorn.cpp b/src/server/scripts/EasternKingdoms/scarlet_monastery/boss_scorn.cpp deleted file mode 100644 index 5d0a3b3792f..00000000000 --- a/src/server/scripts/EasternKingdoms/scarlet_monastery/boss_scorn.cpp +++ /dev/null @@ -1,101 +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_Scorn -SD%Complete: 100 -SDComment: -SDCategory: Scarlet Monastery -EndScriptData */ - -#include "ScriptedPch.h" - -#define SPELL_LICHSLAP 28873 -#define SPELL_FROSTBOLTVOLLEY 8398 -#define SPELL_MINDFLAY 17313 -#define SPELL_FROSTNOVA 15531 - -struct boss_scornAI : public ScriptedAI -{ - boss_scornAI(Creature *c) : ScriptedAI(c) {} - - uint32 LichSlap_Timer; - uint32 FrostboltVolley_Timer; - uint32 MindFlay_Timer; - uint32 FrostNova_Timer; - - void Reset() - { - LichSlap_Timer = 45000; - FrostboltVolley_Timer = 30000; - MindFlay_Timer = 30000; - FrostNova_Timer = 30000; - } - - void EnterCombat(Unit * /*who*/) - { - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //LichSlap_Timer - if (LichSlap_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_LICHSLAP); - LichSlap_Timer = 45000; - } else LichSlap_Timer -= diff; - - //FrostboltVolley_Timer - if (FrostboltVolley_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_FROSTBOLTVOLLEY); - FrostboltVolley_Timer = 20000; - } else FrostboltVolley_Timer -= diff; - - //MindFlay_Timer - if (MindFlay_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_MINDFLAY); - MindFlay_Timer = 20000; - } else MindFlay_Timer -= diff; - - //FrostNova_Timer - if (FrostNova_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_FROSTNOVA); - FrostNova_Timer = 15000; - } else FrostNova_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_scorn(Creature* pCreature) -{ - return new boss_scornAI (pCreature); -} - -void AddSC_boss_scorn() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_scorn"; - newscript->GetAI = &GetAI_boss_scorn; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/scarlet_monastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/scarlet_monastery/instance_scarlet_monastery.cpp deleted file mode 100644 index 33642d4511c..00000000000 --- a/src/server/scripts/EasternKingdoms/scarlet_monastery/instance_scarlet_monastery.cpp +++ /dev/null @@ -1,157 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 .sourceforge.net/> -* 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_Scarlet_Monastery -SD%Complete: 50 -SDComment: -SDCategory: Scarlet Monastery -EndScriptData */ - -#include "ScriptedPch.h" -#include "scarlet_monastery.h" - -#define ENTRY_PUMPKIN_SHRINE 186267 -#define ENTRY_HORSEMAN 23682 -#define ENTRY_HEAD 23775 -#define ENTRY_PUMPKIN 23694 - -#define MAX_ENCOUNTER 2 - -struct instance_scarlet_monastery : public ScriptedInstance -{ - instance_scarlet_monastery(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint64 PumpkinShrineGUID; - uint64 HorsemanGUID; - uint64 HeadGUID; - std::set HorsemanAdds; - - uint64 MograineGUID; - uint64 WhitemaneGUID; - uint64 VorrelGUID; - uint64 DoorHighInquisitorGUID; - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - PumpkinShrineGUID = 0; - HorsemanGUID = 0; - HeadGUID = 0; - HorsemanAdds.clear(); - - MograineGUID = 0; - WhitemaneGUID = 0; - VorrelGUID = 0; - DoorHighInquisitorGUID = 0; - } - - void OnGameObjectCreate(GameObject* pGo, bool /*add*/) - { - switch(pGo->GetEntry()) - { - case ENTRY_PUMPKIN_SHRINE: PumpkinShrineGUID = pGo->GetGUID();break; - case 104600: DoorHighInquisitorGUID = pGo->GetGUID(); break; - } - } - - void OnCreatureCreate(Creature* pCreature, bool /*add*/) - { - switch(pCreature->GetEntry()) - { - case ENTRY_HORSEMAN: HorsemanGUID = pCreature->GetGUID(); break; - case ENTRY_HEAD: HeadGUID = pCreature->GetGUID(); break; - case ENTRY_PUMPKIN: HorsemanAdds.insert(pCreature->GetGUID());break; - case 3976: MograineGUID = pCreature->GetGUID(); break; - case 3977: WhitemaneGUID = pCreature->GetGUID(); break; - case 3981: VorrelGUID = pCreature->GetGUID(); break; - } - } - - void SetData(uint32 type, uint32 data) - { - switch(type) - { - case TYPE_MOGRAINE_AND_WHITE_EVENT: - if (data == IN_PROGRESS) - DoUseDoorOrButton(DoorHighInquisitorGUID); - if (data == FAIL) - DoUseDoorOrButton(DoorHighInquisitorGUID); - - m_auiEncounter[0] = data; - break; - case GAMEOBJECT_PUMPKIN_SHRINE: - HandleGameObject(PumpkinShrineGUID, false); - break; - case DATA_HORSEMAN_EVENT: - m_auiEncounter[1] = data; - if (data == DONE) - { - for (std::set::const_iterator itr = HorsemanAdds.begin(); itr != HorsemanAdds.end(); ++itr) - { - Creature* add = instance->GetCreature(*itr); - if (add && add->isAlive()) - add->Kill(add); - } - HorsemanAdds.clear(); - HandleGameObject(PumpkinShrineGUID, false); - } - break; - } - } - - uint64 GetData64(uint32 type) - { - switch(type) - { - //case GAMEOBJECT_PUMPKIN_SHRINE: return PumpkinShrineGUID; - //case DATA_HORSEMAN: return HorsemanGUID; - //case DATA_HEAD: return HeadGUID; - case DATA_MOGRAINE: return MograineGUID; - case DATA_WHITEMANE: return WhitemaneGUID; - case DATA_VORREL: return VorrelGUID; - case DATA_DOOR_WHITEMANE: return DoorHighInquisitorGUID; - } - return 0; - } - - uint32 GetData(uint32 type) - { - if (type == TYPE_MOGRAINE_AND_WHITE_EVENT) - return m_auiEncounter[0]; - if (type == DATA_HORSEMAN_EVENT) - return m_auiEncounter[1]; - return 0; - } -}; - -InstanceData* GetInstanceData_instance_scarlet_monastery(Map* pMap) -{ - return new instance_scarlet_monastery(pMap); -} - -void AddSC_instance_scarlet_monastery() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_scarlet_monastery"; - newscript->GetInstanceData = &GetInstanceData_instance_scarlet_monastery; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/scarlet_monastery/scarlet_monastery.h b/src/server/scripts/EasternKingdoms/scarlet_monastery/scarlet_monastery.h deleted file mode 100644 index 2b6399ae3e4..00000000000 --- a/src/server/scripts/EasternKingdoms/scarlet_monastery/scarlet_monastery.h +++ /dev/null @@ -1,18 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 .sourceforge.net/> - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ - -#ifndef DEF_SCARLET_M -#define DEF_SCARLET_M - -#define TYPE_MOGRAINE_AND_WHITE_EVENT 1 -#define DATA_MOGRAINE 2 -#define DATA_WHITEMANE 3 -#define DATA_DOOR_WHITEMANE 4 - -#define DATA_HORSEMAN_EVENT 5 -#define GAMEOBJECT_PUMPKIN_SHRINE 6 - -#define DATA_VORREL 7 -#endif - diff --git a/src/server/scripts/EasternKingdoms/scholomance/boss_darkmaster_gandling.cpp b/src/server/scripts/EasternKingdoms/scholomance/boss_darkmaster_gandling.cpp deleted file mode 100644 index 50a9e204566..00000000000 --- a/src/server/scripts/EasternKingdoms/scholomance/boss_darkmaster_gandling.cpp +++ /dev/null @@ -1,225 +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_Darkmaster_Gandling -SD%Complete: 75 -SDComment: Doors missing in instance script. -SDCategory: Scholomance -EndScriptData */ - -#include "ScriptedPch.h" -#include "scholomance.h" - -#define SPELL_ARCANEMISSILES 22272 -#define SPELL_SHADOWSHIELD 22417 //Not right ID. But 12040 is wrong either. -#define SPELL_CURSE 18702 - -#define ADD_1X 170.205 -#define ADD_1Y 99.413 -#define ADD_1Z 104.733 -#define ADD_1O 3.16 - -#define ADD_2X 170.813 -#define ADD_2Y 97.857 -#define ADD_2Z 104.713 -#define ADD_2O 3.16 - -#define ADD_3X 170.720 -#define ADD_3Y 100.900 -#define ADD_3Z 104.739 -#define ADD_3O 3.16 - -#define ADD_4X 171.866 -#define ADD_4Y 99.373 -#define ADD_4Z 104.732 -#define ADD_4O 3.16 - -struct boss_darkmaster_gandlingAI : public ScriptedAI -{ - boss_darkmaster_gandlingAI(Creature *c) : ScriptedAI(c) - { - pInstance = me->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint32 ArcaneMissiles_Timer; - uint32 ShadowShield_Timer; - uint32 Curse_Timer; - uint32 Teleport_Timer; - - void Reset() - { - ArcaneMissiles_Timer = 4500; - ShadowShield_Timer = 12000; - Curse_Timer = 2000; - Teleport_Timer = 16000; - } - - void EnterCombat(Unit * /*who*/) - { - } - - void JustDied(Unit * /*killer*/) - { - if (pInstance) - pInstance->SetData(TYPE_GANDLING, DONE); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //ArcaneMissiles_Timer - if (ArcaneMissiles_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_ARCANEMISSILES); - ArcaneMissiles_Timer = 8000; - } else ArcaneMissiles_Timer -= diff; - - //ShadowShield_Timer - if (ShadowShield_Timer <= diff) - { - DoCast(me, SPELL_SHADOWSHIELD); - ShadowShield_Timer = 14000 + rand()%14000; - } else ShadowShield_Timer -= diff; - - //Curse_Timer - if (Curse_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_CURSE); - Curse_Timer = 15000 + rand()%12000; - } else Curse_Timer -= diff; - - //Teleporting Random Target to one of the six pre boss rooms and spawn 3-4 skeletons near the gamer. - //We will only telport if gandling has more than 3% of hp so teleported gamers can always loot. - if (me->GetHealth()*100 / me->GetMaxHealth() > 3) - { - if (Teleport_Timer <= diff) - { - Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); - if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER) - { - if (DoGetThreat(pTarget)) - DoModifyThreatPercent(pTarget, -100); - - Creature *Summoned = NULL; - switch(rand()%6) - { - case 0: - DoTeleportPlayer(pTarget, 250.0696,0.3921,84.8408,3.149); - Summoned = me->SummonCreature(16119,254.2325,0.3417,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); - if (Summoned) - Summoned->AI()->AttackStart(pTarget); - Summoned = me->SummonCreature(16119,257.7133,4.0226,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); - if (Summoned) - Summoned->AI()->AttackStart(pTarget); - Summoned = me->SummonCreature(16119,258.6702,-2.60656,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); - if (Summoned) - Summoned->AI()->AttackStart(pTarget); - break; - case 1: - DoTeleportPlayer(pTarget, 181.4220,-91.9481,84.8410,1.608); - Summoned = me->SummonCreature(16119,184.0519,-73.5649,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); - if (Summoned) - Summoned->AI()->AttackStart(pTarget); - Summoned = me->SummonCreature(16119,179.5951,-73.7045,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); - if (Summoned) - Summoned->AI()->AttackStart(pTarget); - Summoned = me->SummonCreature(16119,180.6452,-78.2143,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); - if (Summoned) - Summoned->AI()->AttackStart(pTarget); - Summoned = me->SummonCreature(16119,283.2274,-78.1518,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); - if (Summoned) - Summoned->AI()->AttackStart(pTarget); - break; - case 2: - DoTeleportPlayer(pTarget, 95.1547,-1.8173,85.2289,0.043); - Summoned = me->SummonCreature(16119,100.9404,-1.8016,85.2289,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); - if (Summoned) - Summoned->AI()->AttackStart(pTarget); - Summoned = me->SummonCreature(16119,101.3729,0.4882,85.2289,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); - if (Summoned) - Summoned->AI()->AttackStart(pTarget); - Summoned = me->SummonCreature(16119,101.4596,-4.4740,85.2289,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); - if (Summoned) - Summoned->AI()->AttackStart(pTarget); - break; - case 3: - DoTeleportPlayer(pTarget, 250.0696,0.3921,72.6722,3.149); - Summoned = me->SummonCreature(16119,240.34481,0.7368,72.6722,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); - if (Summoned) - Summoned->AI()->AttackStart(pTarget); - Summoned = me->SummonCreature(16119,240.3633,-2.9520,72.6722,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); - if (Summoned) - Summoned->AI()->AttackStart(pTarget); - Summoned = me->SummonCreature(16119,240.6702,3.34949,72.6722,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); - if (Summoned) - Summoned->AI()->AttackStart(pTarget); - break; - case 4: - DoTeleportPlayer(pTarget, 181.4220,-91.9481,70.7734,1.608); - Summoned = me->SummonCreature(16119,184.0519,-73.5649,70.7734,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); - if (Summoned) - Summoned->AI()->AttackStart(pTarget); - Summoned = me->SummonCreature(16119,179.5951,-73.7045,70.7734,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); - if (Summoned) - Summoned->AI()->AttackStart(pTarget); - Summoned = me->SummonCreature(16119,180.6452,-78.2143,70.7734,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); - if (Summoned) - Summoned->AI()->AttackStart(pTarget); - Summoned = me->SummonCreature(16119,283.2274,-78.1518,70.7734,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); - if (Summoned) - Summoned->AI()->AttackStart(pTarget); - break; - case 5: - DoTeleportPlayer(pTarget, 106.1541,-1.8994,75.3663,0.043); - Summoned = me->SummonCreature(16119,115.3945,-1.5555,75.3663,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); - if (Summoned) - Summoned->AI()->AttackStart(pTarget); - Summoned = me->SummonCreature(16119,257.7133,1.8066,75.3663,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); - if (Summoned) - Summoned->AI()->AttackStart(pTarget); - Summoned = me->SummonCreature(16119,258.6702,-5.1001,75.3663,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); - if (Summoned) - Summoned->AI()->AttackStart(pTarget); - break; - } - } - Teleport_Timer = 20000 + rand()%15000; - } else Teleport_Timer -= diff; - } - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_darkmaster_gandling(Creature* pCreature) -{ - return new boss_darkmaster_gandlingAI (pCreature); -} - -void AddSC_boss_darkmaster_gandling() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_darkmaster_gandling"; - newscript->GetAI = &GetAI_boss_darkmaster_gandling; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/scholomance/boss_death_knight_darkreaver.cpp b/src/server/scripts/EasternKingdoms/scholomance/boss_death_knight_darkreaver.cpp deleted file mode 100644 index 8bb9ec68aca..00000000000 --- a/src/server/scripts/EasternKingdoms/scholomance/boss_death_knight_darkreaver.cpp +++ /dev/null @@ -1,58 +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_Death_knight_darkreaver -SD%Complete: 100 -SDComment: -SDCategory: Scholomance -EndScriptData */ - -#include "ScriptedPch.h" - -struct boss_death_knight_darkreaverAI : public ScriptedAI -{ - boss_death_knight_darkreaverAI(Creature *c) : ScriptedAI(c) {} - - void Reset() - { - } - - void DamageTaken(Unit * /*done_by*/, uint32 &damage) - { - if (me->GetHealth() <= damage) - DoCast(me, 23261, true); //Summon Darkreaver's Fallen Charger - } - - void EnterCombat(Unit * /*who*/) - { - } -}; -CreatureAI* GetAI_boss_death_knight_darkreaver(Creature* pCreature) -{ - return new boss_death_knight_darkreaverAI (pCreature); -} - -void AddSC_boss_death_knight_darkreaver() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "boss_death_knight_darkreaver"; - newscript->GetAI = &GetAI_boss_death_knight_darkreaver; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/scholomance/boss_doctor_theolen_krastinov.cpp b/src/server/scripts/EasternKingdoms/scholomance/boss_doctor_theolen_krastinov.cpp deleted file mode 100644 index 5ff01d48623..00000000000 --- a/src/server/scripts/EasternKingdoms/scholomance/boss_doctor_theolen_krastinov.cpp +++ /dev/null @@ -1,117 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 .sourceforge.net/> - * 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_Doctor_Theolen_Krastinov -SD%Complete: 100 -SDComment: -SDCategory: Scholomance -EndScriptData */ - -#include "ScriptedPch.h" -#include "scholomance.h" - -enum eEnums -{ - EMOTE_GENERIC_FRENZY_KILL = -1000001, - - SPELL_REND = 16509, - SPELL_BACKHAND = 18103, - SPELL_FRENZY = 8269 -}; - -struct boss_theolenkrastinovAI : public ScriptedAI -{ - boss_theolenkrastinovAI(Creature *c) : ScriptedAI(c) {} - - uint32 m_uiRend_Timer; - uint32 m_uiBackhand_Timer; - uint32 m_uiFrenzy_Timer; - - void Reset() - { - m_uiRend_Timer = 8000; - m_uiBackhand_Timer = 9000; - m_uiFrenzy_Timer = 1000; - } - - void JustDied(Unit* /*pKiller*/) - { - ScriptedInstance* pInstance = me->GetInstanceData(); - if (pInstance) - { - pInstance->SetData(DATA_DOCTORTHEOLENKRASTINOV_DEATH, 0); - - if (pInstance->GetData(TYPE_GANDLING) == IN_PROGRESS) - me->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0); - } - } - - void UpdateAI(const uint32 uiDiff) - { - if (!UpdateVictim()) - return; - - //Rend_Timer - if (m_uiRend_Timer <= uiDiff) - { - DoCast(me->getVictim(), SPELL_REND); - m_uiRend_Timer = 10000; - } - else - m_uiRend_Timer -= uiDiff; - - //Backhand_Timer - if (m_uiBackhand_Timer <= uiDiff) - { - DoCast(me->getVictim(), SPELL_BACKHAND); - m_uiBackhand_Timer = 10000; - } - else - m_uiBackhand_Timer -= uiDiff; - - //Frenzy_Timer - if (me->GetHealth()*100 / me->GetMaxHealth() < 26) - { - if (m_uiFrenzy_Timer <= uiDiff) - { - DoCast(me, SPELL_FRENZY); - DoScriptText(EMOTE_GENERIC_FRENZY_KILL, me); - - m_uiFrenzy_Timer = 120000; - } - else - m_uiFrenzy_Timer -= uiDiff; - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_theolenkrastinov(Creature* pCreature) -{ - return new boss_theolenkrastinovAI (pCreature); -} - -void AddSC_boss_theolenkrastinov() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_doctor_theolen_krastinov"; - newscript->GetAI = &GetAI_boss_theolenkrastinov; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/scholomance/boss_illucia_barov.cpp b/src/server/scripts/EasternKingdoms/scholomance/boss_illucia_barov.cpp deleted file mode 100644 index a038fc7a0b8..00000000000 --- a/src/server/scripts/EasternKingdoms/scholomance/boss_illucia_barov.cpp +++ /dev/null @@ -1,117 +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_Illucia_Barov -SD%Complete: 100 -SDComment: -SDCategory: Scholomance -EndScriptData */ - -#include "ScriptedPch.h" -#include "scholomance.h" - -#define SPELL_CURSEOFAGONY 18671 -#define SPELL_SHADOWSHOCK 20603 -#define SPELL_SILENCE 15487 -#define SPELL_FEAR 6215 - -struct boss_illuciabarovAI : public ScriptedAI -{ - boss_illuciabarovAI(Creature *c) : ScriptedAI(c) {} - - uint32 CurseOfAgony_Timer; - uint32 ShadowShock_Timer; - uint32 Silence_Timer; - uint32 Fear_Timer; - - void Reset() - { - CurseOfAgony_Timer = 18000; - ShadowShock_Timer = 9000; - Silence_Timer = 5000; - Fear_Timer = 30000; - } - - void JustDied(Unit * /*killer*/) - { - ScriptedInstance *pInstance = me->GetInstanceData(); - if (pInstance) - { - pInstance->SetData(DATA_LADYILLUCIABAROV_DEATH, 0); - - if (pInstance->GetData(TYPE_GANDLING) == IN_PROGRESS) - me->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0); - } - } - - void EnterCombat(Unit * /*who*/) - { - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //CurseOfAgony_Timer - if (CurseOfAgony_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_CURSEOFAGONY); - CurseOfAgony_Timer = 30000; - } else CurseOfAgony_Timer -= diff; - - //ShadowShock_Timer - if (ShadowShock_Timer <= diff) - { - Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); - if (pTarget) DoCast(pTarget, SPELL_SHADOWSHOCK); - - ShadowShock_Timer = 12000; - } else ShadowShock_Timer -= diff; - - //Silence_Timer - if (Silence_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SILENCE); - Silence_Timer = 14000; - } else Silence_Timer -= diff; - - //Fear_Timer - if (Fear_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_FEAR); - Fear_Timer = 30000; - } else Fear_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_illuciabarov(Creature* pCreature) -{ - return new boss_illuciabarovAI (pCreature); -} - -void AddSC_boss_illuciabarov() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_illucia_barov"; - newscript->GetAI = &GetAI_boss_illuciabarov; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/scholomance/boss_instructor_malicia.cpp b/src/server/scripts/EasternKingdoms/scholomance/boss_instructor_malicia.cpp deleted file mode 100644 index c4c0f95d8d1..00000000000 --- a/src/server/scripts/EasternKingdoms/scholomance/boss_instructor_malicia.cpp +++ /dev/null @@ -1,153 +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_instructormalicia -SD%Complete: 100 -SDComment: -SDCategory: Scholomance -EndScriptData */ - -#include "ScriptedPch.h" -#include "scholomance.h" - -#define SPELL_CALLOFGRAVES 17831 -#define SPELL_CORRUPTION 11672 -#define SPELL_FLASHHEAL 10917 -#define SPELL_RENEW 10929 -#define SPELL_HEALINGTOUCH 9889 - -struct boss_instructormaliciaAI : public ScriptedAI -{ - boss_instructormaliciaAI(Creature *c) : ScriptedAI(c) {} - - uint32 CallOfGraves_Timer; - uint32 Corruption_Timer; - uint32 FlashHeal_Timer; - uint32 Renew_Timer; - uint32 HealingTouch_Timer; - uint32 FlashCounter; - uint32 TouchCounter; - - void Reset() - { - CallOfGraves_Timer = 4000; - Corruption_Timer = 8000; - FlashHeal_Timer = 38000; - Renew_Timer = 32000; - HealingTouch_Timer = 45000; - FlashCounter = 0; - TouchCounter = 0; - } - - void JustDied(Unit * /*killer*/) - { - ScriptedInstance *pInstance = me->GetInstanceData(); - if (pInstance) - { - pInstance->SetData(DATA_INSTRUCTORMALICIA_DEATH, 0); - - if (pInstance->GetData(TYPE_GANDLING) == IN_PROGRESS) - me->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0); - } - } - - void EnterCombat(Unit * /*who*/) - { - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //CallOfGraves_Timer - if (CallOfGraves_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_CALLOFGRAVES); - CallOfGraves_Timer = 65000; - } else CallOfGraves_Timer -= diff; - - //Corruption_Timer - if (Corruption_Timer <= diff) - { - Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); - if (pTarget) DoCast(pTarget, SPELL_CORRUPTION); - - Corruption_Timer = 24000; - } else Corruption_Timer -= diff; - - //Renew_Timer - if (Renew_Timer <= diff) - { - DoCast(me, SPELL_RENEW); - Renew_Timer = 10000; - } else Renew_Timer -= diff; - - //FlashHeal_Timer - if (FlashHeal_Timer <= diff) - { - DoCast(me, SPELL_FLASHHEAL); - - //5 Flashheals will be casted - if (FlashCounter < 2) - { - FlashHeal_Timer = 5000; - ++FlashCounter; - } - else - { - FlashCounter=0; - FlashHeal_Timer = 30000; - } - } else FlashHeal_Timer -= diff; - - //HealingTouch_Timer - if (HealingTouch_Timer <= diff) - { - DoCast(me, SPELL_HEALINGTOUCH); - - //3 Healingtouchs will be casted - if (HealingTouch_Timer < 2) - { - HealingTouch_Timer = 5500; - ++TouchCounter; - } - else - { - TouchCounter=0; - HealingTouch_Timer = 30000; - } - } else HealingTouch_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_instructormalicia(Creature* pCreature) -{ - return new boss_instructormaliciaAI (pCreature); -} - -void AddSC_boss_instructormalicia() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_instructor_malicia"; - newscript->GetAI = &GetAI_boss_instructormalicia; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/scholomance/boss_jandice_barov.cpp b/src/server/scripts/EasternKingdoms/scholomance/boss_jandice_barov.cpp deleted file mode 100644 index f8d8520e394..00000000000 --- a/src/server/scripts/EasternKingdoms/scholomance/boss_jandice_barov.cpp +++ /dev/null @@ -1,201 +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_jandicebarov -SD%Complete: 100 -SDComment: -SDCategory: Scholomance -EndScriptData */ - -#include "ScriptedPch.h" - -#define SPELL_CURSEOFBLOOD 24673 -//#define SPELL_ILLUSION 17773 - -//Spells of Illusion of Jandice Barov -#define SPELL_CLEAVE 15584 - -struct boss_jandicebarovAI : public ScriptedAI -{ - boss_jandicebarovAI(Creature *c) : ScriptedAI(c) {} - - uint32 CurseOfBlood_Timer; - uint32 Illusion_Timer; - //uint32 Illusioncounter; - uint32 Invisible_Timer; - bool Invisible; - - void Reset() - { - CurseOfBlood_Timer = 15000; - Illusion_Timer = 30000; - Invisible_Timer = 3000; //Too much too low? - Invisible = false; - } - - void EnterCombat(Unit * /*who*/) - { - } - - void SummonIllusions(Unit* victim) - { - if (Creature *Illusion = DoSpawnCreature(11439, irand(-9,9), irand(-9,9), 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000)) - Illusion->AI()->AttackStart(victim); - } - - void UpdateAI(const uint32 diff) - { - if (Invisible && Invisible_Timer <= diff) - { - //Become visible again - me->setFaction(14); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetDisplayId(11073); //Jandice Model - Invisible = false; - } else if (Invisible) - { - Invisible_Timer -= diff; - //Do nothing while invisible - return; - } - - //Return since we have no target - if (!UpdateVictim()) - return; - - //CurseOfBlood_Timer - if (CurseOfBlood_Timer <= diff) - { - //Cast - DoCast(me->getVictim(), SPELL_CURSEOFBLOOD); - - //45 seconds - CurseOfBlood_Timer = 30000; - } else CurseOfBlood_Timer -= diff; - - //Illusion_Timer - if (!Invisible && Illusion_Timer <= diff) - { - - //Inturrupt any spell casting - me->InterruptNonMeleeSpells(false); - me->setFaction(35); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetDisplayId(11686); // Invisible Model - DoModifyThreatPercent(me->getVictim(),-99); - - //Summon 10 Illusions attacking random gamers - Unit *pTarget = NULL; - for (uint8 i = 0; i < 10; ++i) - { - pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); - if (pTarget) - SummonIllusions(pTarget); - } - Invisible = true; - Invisible_Timer = 3000; - - //25 seconds until we should cast this agian - Illusion_Timer = 25000; - } else Illusion_Timer -= diff; - - // //Illusion_Timer - // if (Illusion_Timer <= diff) - // { - // //Cast - // DoCast(me->getVictim(), SPELL_ILLUSION); - // - // //3 Illusion will be summoned - // if (Illusioncounter < 3) - // { - // Illusion_Timer = 500; - // ++Illusioncounter; - // } - // else { - // //15 seconds until we should cast this again - // Illusion_Timer = 15000; - // Illusioncounter = 0; - // } - // - // } else Illusion_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -// Illusion of Jandice Barov Script - -struct mob_illusionofjandicebarovAI : public ScriptedAI -{ - mob_illusionofjandicebarovAI(Creature *c) : ScriptedAI(c) {} - - uint32 Cleave_Timer; - - void Reset() - { - Cleave_Timer = 2000 + rand()%6000; - me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, true); - } - - void EnterCombat(Unit * /*who*/) - { - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //Cleave_Timer - if (Cleave_Timer <= diff) - { - //Cast - DoCast(me->getVictim(), SPELL_CLEAVE); - - //5-8 seconds - Cleave_Timer = 5000 + rand()%3000; - } else Cleave_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_jandicebarov(Creature* pCreature) -{ - return new boss_jandicebarovAI (pCreature); -} - -CreatureAI* GetAI_mob_illusionofjandicebarov(Creature* pCreature) -{ - return new mob_illusionofjandicebarovAI (pCreature); -} - -void AddSC_boss_jandicebarov() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_jandice_barov"; - newscript->GetAI = &GetAI_boss_jandicebarov; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_illusionofjandicebarov"; - newscript->GetAI = &GetAI_mob_illusionofjandicebarov; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/scholomance/boss_kormok.cpp b/src/server/scripts/EasternKingdoms/scholomance/boss_kormok.cpp deleted file mode 100644 index c4ae5cc490e..00000000000 --- a/src/server/scripts/EasternKingdoms/scholomance/boss_kormok.cpp +++ /dev/null @@ -1,120 +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_Kormok -SD%Complete: 100 -SDComment: -SDCategory: Scholomance -EndScriptData */ - -#include "ScriptedPch.h" - -#define SPELL_SHADOWBOLTVOLLEY 20741 -#define SPELL_BONESHIELD 27688 - -struct boss_kormokAI : public ScriptedAI -{ - boss_kormokAI(Creature *c) : ScriptedAI(c) {} - - uint32 ShadowVolley_Timer; - uint32 BoneShield_Timer; - uint32 Minion_Timer; - uint32 Mage_Timer; - bool Mages; - - void Reset() - { - ShadowVolley_Timer = 10000; - BoneShield_Timer = 2000; - Minion_Timer = 15000; - Mage_Timer = 0; - Mages = false; - } - - void EnterCombat(Unit * /*who*/) - { - } - - void SummonMinions(Unit* victim) - { - if (Creature *SummonedMinion = DoSpawnCreature(16119, irand(-7,7), irand(-7,7), 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 120000)) - SummonedMinion->AI()->AttackStart(victim); - } - - void SummonMages(Unit* victim) - { - if (Creature *SummonedMage = DoSpawnCreature(16120, irand(-9,9), irand(-9,9), 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 120000)) - SummonedMage->AI()->AttackStart(victim); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //ShadowVolley_Timer - if (ShadowVolley_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SHADOWBOLTVOLLEY); - ShadowVolley_Timer = 15000; - } else ShadowVolley_Timer -= diff; - - //BoneShield_Timer - if (BoneShield_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_BONESHIELD); - BoneShield_Timer = 45000; - } else BoneShield_Timer -= diff; - - //Minion_Timer - if (Minion_Timer <= diff) - { - //Cast - SummonMinions(me->getVictim()); - SummonMinions(me->getVictim()); - SummonMinions(me->getVictim()); - SummonMinions(me->getVictim()); - - Minion_Timer = 12000; - } else Minion_Timer -= diff; - - //Summon 2 Bone Mages - if (!Mages && me->GetHealth()*100 / me->GetMaxHealth() < 26) - { - //Cast - SummonMages(me->getVictim()); - SummonMages(me->getVictim()); - Mages = true; - } - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_kormok(Creature* pCreature) -{ - return new boss_kormokAI (pCreature); -} - -void AddSC_boss_kormok() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_kormok"; - newscript->GetAI = &GetAI_boss_kormok; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/scholomance/boss_lord_alexei_barov.cpp b/src/server/scripts/EasternKingdoms/scholomance/boss_lord_alexei_barov.cpp deleted file mode 100644 index 0956a04d824..00000000000 --- a/src/server/scripts/EasternKingdoms/scholomance/boss_lord_alexei_barov.cpp +++ /dev/null @@ -1,99 +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_Lord_Alexei_Barov -SD%Complete: 100 -SDComment: aura applied/defined in database -SDCategory: Scholomance -EndScriptData */ - -#include "ScriptedPch.h" -#include "scholomance.h" - -#define SPELL_IMMOLATE 20294 // Old ID was 15570 -#define SPELL_VEILOFSHADOW 17820 - -struct boss_lordalexeibarovAI : public ScriptedAI -{ - boss_lordalexeibarovAI(Creature *c) : ScriptedAI(c) {} - - uint32 Immolate_Timer; - uint32 VeilofShadow_Timer; - - void Reset() - { - Immolate_Timer = 7000; - VeilofShadow_Timer = 15000; - - me->LoadCreaturesAddon(); - } - - void JustDied(Unit * /*killer*/) - { - ScriptedInstance *pInstance = me->GetInstanceData(); - if (pInstance) - { - pInstance->SetData(DATA_LORDALEXEIBAROV_DEATH, 0); - - if (pInstance->GetData(TYPE_GANDLING) == IN_PROGRESS) - me->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0); - } - } - - void EnterCombat(Unit * /*who*/) - { - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //Immolate_Timer - if (Immolate_Timer <= diff) - { - Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); - if (pTarget) DoCast(pTarget, SPELL_IMMOLATE); - - Immolate_Timer = 12000; - } else Immolate_Timer -= diff; - - //VeilofShadow_Timer - if (VeilofShadow_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_VEILOFSHADOW); - VeilofShadow_Timer = 20000; - } else VeilofShadow_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_lordalexeibarov(Creature* pCreature) -{ - return new boss_lordalexeibarovAI (pCreature); -} - -void AddSC_boss_lordalexeibarov() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_lord_alexei_barov"; - newscript->GetAI = &GetAI_boss_lordalexeibarov; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/scholomance/boss_lorekeeper_polkelt.cpp b/src/server/scripts/EasternKingdoms/scholomance/boss_lorekeeper_polkelt.cpp deleted file mode 100644 index d3b75900202..00000000000 --- a/src/server/scripts/EasternKingdoms/scholomance/boss_lorekeeper_polkelt.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: Boss_Lorekeeper_Polkelt -SD%Complete: 100 -SDComment: -SDCategory: Scholomance -EndScriptData */ - -#include "ScriptedPch.h" -#include "scholomance.h" - -#define SPELL_VOLATILEINFECTION 24928 -#define SPELL_DARKPLAGUE 18270 -#define SPELL_CORROSIVEACID 23313 -#define SPELL_NOXIOUSCATALYST 18151 - -struct boss_lorekeeperpolkeltAI : public ScriptedAI -{ - boss_lorekeeperpolkeltAI(Creature *c) : ScriptedAI(c) {} - - uint32 VolatileInfection_Timer; - uint32 Darkplague_Timer; - uint32 CorrosiveAcid_Timer; - uint32 NoxiousCatalyst_Timer; - - void Reset() - { - VolatileInfection_Timer = 38000; - Darkplague_Timer = 8000; - CorrosiveAcid_Timer = 45000; - NoxiousCatalyst_Timer = 35000; - } - - void JustDied(Unit * /*killer*/) - { - ScriptedInstance *pInstance = me->GetInstanceData(); - if (pInstance) - { - pInstance->SetData(DATA_LOREKEEPERPOLKELT_DEATH, 0); - - if (pInstance->GetData(TYPE_GANDLING) == IN_PROGRESS) - me->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0); - } - } - - void EnterCombat(Unit * /*who*/) - { - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //VolatileInfection_Timer - if (VolatileInfection_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_VOLATILEINFECTION); - VolatileInfection_Timer = 32000; - } else VolatileInfection_Timer -= diff; - - //Darkplague_Timer - if (Darkplague_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_DARKPLAGUE); - Darkplague_Timer = 8000; - } else Darkplague_Timer -= diff; - - //CorrosiveAcid_Timer - if (CorrosiveAcid_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_CORROSIVEACID); - CorrosiveAcid_Timer = 25000; - } else CorrosiveAcid_Timer -= diff; - - //NoxiousCatalyst_Timer - if (NoxiousCatalyst_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_NOXIOUSCATALYST); - NoxiousCatalyst_Timer = 38000; - } else NoxiousCatalyst_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_lorekeeperpolkelt(Creature* pCreature) -{ - return new boss_lorekeeperpolkeltAI (pCreature); -} - -void AddSC_boss_lorekeeperpolkelt() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_lorekeeper_polkelt"; - newscript->GetAI = &GetAI_boss_lorekeeperpolkelt; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/scholomance/boss_ras_frostwhisper.cpp b/src/server/scripts/EasternKingdoms/scholomance/boss_ras_frostwhisper.cpp deleted file mode 100644 index 63837e04ad5..00000000000 --- a/src/server/scripts/EasternKingdoms/scholomance/boss_ras_frostwhisper.cpp +++ /dev/null @@ -1,123 +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_Ras_Frostwhisper -SD%Complete: 100 -SDComment: -SDCategory: Scholomance -EndScriptData */ - -#include "ScriptedPch.h" - -#define SPELL_FROSTBOLT 21369 -#define SPELL_ICEARMOR 18100 //This is actually a buff he gives himself -#define SPELL_FREEZE 18763 -#define SPELL_FEAR 26070 -#define SPELL_CHILLNOVA 18099 -#define SPELL_FROSTVOLLEY 8398 - -struct boss_rasfrostAI : public ScriptedAI -{ - boss_rasfrostAI(Creature *c) : ScriptedAI(c) {} - - uint32 IceArmor_Timer; - uint32 Frostbolt_Timer; - uint32 Freeze_Timer; - uint32 Fear_Timer; - uint32 ChillNova_Timer; - uint32 FrostVolley_Timer; - - void Reset() - { - IceArmor_Timer = 2000; - Frostbolt_Timer = 8000; - ChillNova_Timer = 12000; - Freeze_Timer = 18000; - FrostVolley_Timer = 24000; - Fear_Timer = 45000; - - DoCast(me, SPELL_ICEARMOR, true); - } - - void EnterCombat(Unit * /*who*/){} - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //IceArmor_Timer - if (IceArmor_Timer <= diff) - { - DoCast(me, SPELL_ICEARMOR); - IceArmor_Timer = 180000; - } else IceArmor_Timer -= diff; - - //Frostbolt_Timer - if (Frostbolt_Timer <= diff) - { - if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) - DoCast(pTarget, SPELL_FROSTBOLT); - - Frostbolt_Timer = 8000; - } else Frostbolt_Timer -= diff; - - //Freeze_Timer - if (Freeze_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_FREEZE); - Freeze_Timer = 24000; - } else Freeze_Timer -= diff; - - //Fear_Timer - if (Fear_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_FEAR); - Fear_Timer = 30000; - } else Fear_Timer -= diff; - - //ChillNova_Timer - if (ChillNova_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_CHILLNOVA); - ChillNova_Timer = 14000; - } else ChillNova_Timer -= diff; - - //FrostVolley_Timer - if (FrostVolley_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_FROSTVOLLEY); - FrostVolley_Timer = 15000; - } else FrostVolley_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_rasfrost(Creature* pCreature) -{ - return new boss_rasfrostAI (pCreature); -} - -void AddSC_boss_rasfrost() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_boss_ras_frostwhisper"; - newscript->GetAI = &GetAI_boss_rasfrost; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/scholomance/boss_the_ravenian.cpp b/src/server/scripts/EasternKingdoms/scholomance/boss_the_ravenian.cpp deleted file mode 100644 index 6340f2b0e2d..00000000000 --- a/src/server/scripts/EasternKingdoms/scholomance/boss_the_ravenian.cpp +++ /dev/null @@ -1,117 +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_ravenian -SD%Complete: 100 -SDComment: -SDCategory: Scholomance -EndScriptData */ - -#include "ScriptedPch.h" -#include "scholomance.h" - -#define SPELL_TRAMPLE 15550 -#define SPELL_CLEAVE 20691 -#define SPELL_SUNDERINCLEAVE 25174 -#define SPELL_KNOCKAWAY 10101 - -struct boss_theravenianAI : public ScriptedAI -{ - boss_theravenianAI(Creature *c) : ScriptedAI(c) {} - - uint32 Trample_Timer; - uint32 Cleave_Timer; - uint32 SunderingCleave_Timer; - uint32 KnockAway_Timer; - bool HasYelled; - - void Reset() - { - Trample_Timer = 24000; - Cleave_Timer = 15000; - SunderingCleave_Timer = 40000; - KnockAway_Timer = 32000; - HasYelled = false; - } - - void JustDied(Unit * /*killer*/) - { - ScriptedInstance *pInstance = me->GetInstanceData(); - if (pInstance) - { - pInstance->SetData(DATA_THERAVENIAN_DEATH, 0); - - if (pInstance->GetData(TYPE_GANDLING) == IN_PROGRESS) - me->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0); - } - } - - void EnterCombat(Unit * /*who*/) - { - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //Trample_Timer - if (Trample_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_TRAMPLE); - Trample_Timer = 10000; - } else Trample_Timer -= diff; - - //Cleave_Timer - if (Cleave_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_CLEAVE); - Cleave_Timer = 7000; - } else Cleave_Timer -= diff; - - //SunderingCleave_Timer - if (SunderingCleave_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SUNDERINCLEAVE); - SunderingCleave_Timer = 20000; - } else SunderingCleave_Timer -= diff; - - //KnockAway_Timer - if (KnockAway_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_KNOCKAWAY); - KnockAway_Timer = 12000; - } else KnockAway_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_theravenian(Creature* pCreature) -{ - return new boss_theravenianAI (pCreature); -} - -void AddSC_boss_theravenian() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_the_ravenian"; - newscript->GetAI = &GetAI_boss_theravenian; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/scholomance/boss_vectus.cpp b/src/server/scripts/EasternKingdoms/scholomance/boss_vectus.cpp deleted file mode 100644 index a38369faab0..00000000000 --- a/src/server/scripts/EasternKingdoms/scholomance/boss_vectus.cpp +++ /dev/null @@ -1,105 +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_Vectus -SD%Complete: 100 -SDComment: -SDCategory: Scholomance -EndScriptData */ - -#include "ScriptedPch.h" - -enum eEnums -{ - EMOTE_GENERIC_FRENZY_KILL = -1000001, - - SPELL_FLAMESTRIKE = 18399, - SPELL_BLAST_WAVE = 16046, - SPELL_FIRESHIELD = 19626, - SPELL_FRENZY = 8269 //28371, -}; - -struct boss_vectusAI : public ScriptedAI -{ - boss_vectusAI(Creature *c) : ScriptedAI(c) {} - - uint32 m_uiFireShield_Timer; - uint32 m_uiBlastWave_Timer; - uint32 m_uiFrenzy_Timer; - - void Reset() - { - m_uiFireShield_Timer = 2000; - m_uiBlastWave_Timer = 14000; - m_uiFrenzy_Timer = 0; - } - - void UpdateAI(const uint32 uiDiff) - { - if (!UpdateVictim()) - return; - - //FireShield_Timer - if (m_uiFireShield_Timer <= uiDiff) - { - DoCast(me, SPELL_FIRESHIELD); - m_uiFireShield_Timer = 90000; - } - else - m_uiFireShield_Timer -= uiDiff; - - //BlastWave_Timer - if (m_uiBlastWave_Timer <= uiDiff) - { - DoCast(me->getVictim(), SPELL_BLAST_WAVE); - m_uiBlastWave_Timer = 12000; - } - else - m_uiBlastWave_Timer -= uiDiff; - - //Frenzy_Timer - if (me->GetHealth()*100 / me->GetMaxHealth() < 25) - { - if (m_uiFrenzy_Timer <= uiDiff) - { - DoCast(me, SPELL_FRENZY); - DoScriptText(EMOTE_GENERIC_FRENZY_KILL, me); - - m_uiFrenzy_Timer = 24000; - } - else - m_uiFrenzy_Timer -= uiDiff; - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_vectus(Creature* pCreature) -{ - return new boss_vectusAI (pCreature); -} - -void AddSC_boss_vectus() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_vectus"; - newscript->GetAI = &GetAI_boss_vectus; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/scholomance/instance_scholomance.cpp b/src/server/scripts/EasternKingdoms/scholomance/instance_scholomance.cpp deleted file mode 100644 index 992849cff1b..00000000000 --- a/src/server/scripts/EasternKingdoms/scholomance/instance_scholomance.cpp +++ /dev/null @@ -1,146 +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_Scholomance -SD%Complete: 100 -SDComment: -SDCategory: Scholomance -EndScriptData */ - -#include "ScriptedPch.h" -#include "scholomance.h" - -#define GO_GATE_KIRTONOS 175570 -#define GO_GATE_GANDLING 177374 -#define GO_GATE_MALICIA 177375 -#define GO_GATE_THEOLEN 177377 -#define GO_GATE_POLKELT 177376 -#define GO_GATE_RAVENIAN 177372 -#define GO_GATE_BAROV 177373 -#define GO_GATE_ILLUCIA 177371 - -#define MAX_ENCOUNTER 2 - -struct instance_scholomance : public ScriptedInstance -{ - instance_scholomance(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - //Lord Alexei Barov, Doctor Theolen Krastinov, The Ravenian, Lorekeeper Polkelt, Instructor Malicia and the Lady Illucia Barov. - bool IsBossDied[6]; - uint32 m_auiEncounter[MAX_ENCOUNTER]; - - uint64 GateKirtonosGUID; - uint64 GateGandlingGUID; - uint64 GateMiliciaGUID; - uint64 GateTheolenGUID; - uint64 GatePolkeltGUID; - uint64 GateRavenianGUID; - uint64 GateBarovGUID; - uint64 GateIlluciaGUID; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - GateKirtonosGUID = 0; - GateGandlingGUID = 0; - GateMiliciaGUID = 0; - GateTheolenGUID = 0; - GatePolkeltGUID = 0; - GateRavenianGUID = 0; - GateBarovGUID = 0; - GateIlluciaGUID = 0; - - for (uint8 i = 0; i < 6; ++i) - IsBossDied[i] = false; - } - - void OnGameObjectCreate(GameObject* pGo, bool /*add*/) - { - switch(pGo->GetEntry()) - { - case GO_GATE_KIRTONOS: GateKirtonosGUID = pGo->GetGUID(); break; - case GO_GATE_GANDLING: GateGandlingGUID = pGo->GetGUID(); break; - case GO_GATE_MALICIA: GateMiliciaGUID = pGo->GetGUID(); break; - case GO_GATE_THEOLEN: GateTheolenGUID = pGo->GetGUID(); break; - case GO_GATE_POLKELT: GatePolkeltGUID = pGo->GetGUID(); break; - case GO_GATE_RAVENIAN: GateRavenianGUID = pGo->GetGUID(); break; - case GO_GATE_BAROV: GateBarovGUID = pGo->GetGUID(); break; - case GO_GATE_ILLUCIA: GateIlluciaGUID = pGo->GetGUID(); break; - } - } - - void SetData(uint32 type, uint32 data) - { - switch(type) - { - case DATA_LORDALEXEIBAROV_DEATH: - IsBossDied[0] = true; - break; - case DATA_DOCTORTHEOLENKRASTINOV_DEATH: - IsBossDied[1] = true; - break; - case DATA_THERAVENIAN_DEATH: - IsBossDied[2] = true; - break; - case DATA_LOREKEEPERPOLKELT_DEATH: - IsBossDied[3] = true; - break; - case DATA_INSTRUCTORMALICIA_DEATH: - IsBossDied[4] = true; - break; - case DATA_LADYILLUCIABAROV_DEATH: - IsBossDied[5] = true; - break; - case TYPE_GANDLING: - m_auiEncounter[0] = data; - break; - case TYPE_KIRTONOS: - m_auiEncounter[1] = data; - break; - } - } - - uint32 GetData(uint32 type) - { - if (type == TYPE_GANDLING) - { - if (IsBossDied[0] && IsBossDied[1] && IsBossDied[2] && IsBossDied[3] && IsBossDied[4] && IsBossDied[5]) - { - m_auiEncounter[0] = IN_PROGRESS; - return IN_PROGRESS; - } - } - - return 0; - } -}; - -InstanceData* GetInstanceData_instance_scholomance(Map* pMap) -{ - return new instance_scholomance(pMap); -} - -void AddSC_instance_scholomance() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_scholomance"; - newscript->GetInstanceData = &GetInstanceData_instance_scholomance; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/scholomance/scholomance.h b/src/server/scripts/EasternKingdoms/scholomance/scholomance.h deleted file mode 100644 index 83ce26c9687..00000000000 --- a/src/server/scripts/EasternKingdoms/scholomance/scholomance.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_SCHOLOMANCE_H -#define DEF_SCHOLOMANCE_H - -#define TYPE_GANDLING 1 -#define DATA_DOCTORTHEOLENKRASTINOV_DEATH 2 -#define DATA_INSTRUCTORMALICIA_DEATH 3 -#define DATA_LADYILLUCIABAROV_DEATH 4 -#define DATA_LORDALEXEIBAROV_DEATH 5 -#define DATA_LOREKEEPERPOLKELT_DEATH 6 -#define DATA_THERAVENIAN_DEATH 7 -#define TYPE_KIRTONOS 8 -#endif - diff --git a/src/server/scripts/EasternKingdoms/shadowfang_keep/instance_shadowfang_keep.cpp b/src/server/scripts/EasternKingdoms/shadowfang_keep/instance_shadowfang_keep.cpp deleted file mode 100644 index 20959641889..00000000000 --- a/src/server/scripts/EasternKingdoms/shadowfang_keep/instance_shadowfang_keep.cpp +++ /dev/null @@ -1,277 +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_Shadowfang_Keep -SD%Complete: 90 -SDComment: -SDCategory: Shadowfang Keep -EndScriptData */ - -#include "ScriptedPch.h" -#include "shadowfang_keep.h" - -#define MAX_ENCOUNTER 4 - -enum eEnums -{ - SAY_BOSS_DIE_AD = -1033007, - SAY_BOSS_DIE_AS = -1033008, - SAY_ARCHMAGE = -1033009, - - NPC_ASH = 3850, - NPC_ADA = 3849, - NPC_ARCHMAGE_ARUGAL = 4275, - NPC_ARUGAL_VOIDWALKER = 4627, - - GO_COURTYARD_DOOR = 18895, //door to open when talking to NPC's - GO_SORCERER_DOOR = 18972, //door to open when Fenrus the Devourer - GO_ARUGAL_DOOR = 18971, //door to open when Wolf Master Nandos - - SPELL_ASHCROMBE_TELEPORT = 15742 -}; - -const Position SpawnLocation[] = -{ - {-148.199,2165.647,128.448,1.026}, - {-153.110,2168.620,128.448,1.026}, - {-145.905,2180.520,128.448,4.183}, - {-140.794,2178.037,128.448,4.090}, - {-138.640,2170.159,136.577,2.737} -}; -struct instance_shadowfang_keep : public ScriptedInstance -{ - instance_shadowfang_keep(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - std::string str_data; - - uint64 uiAshGUID; - uint64 uiAdaGUID; - uint64 uiArchmageArugalGUID; - - uint64 DoorCourtyardGUID; - uint64 DoorSorcererGUID; - uint64 DoorArugalGUID; - - uint8 uiPhase; - uint16 uiTimer; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - uiAshGUID = 0; - uiAdaGUID = 0; - uiArchmageArugalGUID = 0; - - DoorCourtyardGUID = 0; - DoorSorcererGUID = 0; - DoorArugalGUID = 0; - - uiPhase = 0; - uiTimer = 0; - } - - void OnCreatureCreate(Creature* pCreature, bool /*add*/) - { - switch(pCreature->GetEntry()) - { - case NPC_ASH: uiAshGUID = pCreature->GetGUID(); break; - case NPC_ADA: uiAdaGUID = pCreature->GetGUID(); break; - case NPC_ARCHMAGE_ARUGAL: uiArchmageArugalGUID = pCreature->GetGUID(); break; - } - } - - void OnGameObjectCreate(GameObject* pGo, bool /*add*/) - { - switch(pGo->GetEntry()) - { - case GO_COURTYARD_DOOR: - DoorCourtyardGUID = pGo->GetGUID(); - if (m_auiEncounter[0] == DONE) - HandleGameObject(NULL, true, pGo); - break; - case GO_SORCERER_DOOR: - DoorSorcererGUID = pGo->GetGUID(); - if (m_auiEncounter[2] == DONE) - HandleGameObject(NULL, true, pGo); - break; - case GO_ARUGAL_DOOR: - DoorArugalGUID = pGo->GetGUID(); - if (m_auiEncounter[3] == DONE) - HandleGameObject(NULL, true, pGo); - break; - } - } - - void DoSpeech() - { - Creature* pAda = instance->GetCreature(uiAdaGUID); - Creature* pAsh = instance->GetCreature(uiAshGUID); - - if (pAda && pAda->isAlive() && pAsh && pAsh->isAlive()) - { - DoScriptText(SAY_BOSS_DIE_AD,pAda); - DoScriptText(SAY_BOSS_DIE_AS,pAsh); - } - } - - void SetData(uint32 type, uint32 data) - { - switch(type) - { - case TYPE_FREE_NPC: - if (data == DONE) - DoUseDoorOrButton(DoorCourtyardGUID); - m_auiEncounter[0] = data; - break; - case TYPE_RETHILGORE: - if (data == DONE) - DoSpeech(); - m_auiEncounter[1] = data; - break; - case TYPE_FENRUS: - switch(data) - { - case DONE: - uiTimer = 1000; - uiPhase = 1; - break; - case 7: - DoUseDoorOrButton(DoorSorcererGUID); - break; - } - m_auiEncounter[2] = data; - break; - case TYPE_NANDOS: - if (data == DONE) - DoUseDoorOrButton(DoorArugalGUID); - m_auiEncounter[3] = 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]; - - str_data = saveStream.str(); - - SaveToDB(); - OUT_SAVE_INST_DATA_COMPLETE; - } - } - - uint32 GetData(uint32 type) - { - switch(type) - { - case TYPE_FREE_NPC: - return m_auiEncounter[0]; - case TYPE_RETHILGORE: - return m_auiEncounter[1]; - case TYPE_FENRUS: - return m_auiEncounter[2]; - case TYPE_NANDOS: - return m_auiEncounter[3]; - } - 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]; - - for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) - { - if (m_auiEncounter[i] == IN_PROGRESS) - m_auiEncounter[i] = NOT_STARTED; - } - - OUT_LOAD_INST_DATA_COMPLETE; - } - - void Update(uint32 uiDiff) - { - if (GetData(TYPE_FENRUS) != DONE) - return; - - Creature* pArchmage = instance->GetCreature(uiArchmageArugalGUID); - Creature* pSummon = NULL; - - if (!pArchmage || !pArchmage->isAlive()) - return; - - if (uiPhase) - { - if (uiTimer <= uiDiff) - { - switch(uiPhase) - { - case 1: - pSummon = pArchmage->SummonCreature(pArchmage->GetEntry(),SpawnLocation[4],TEMPSUMMON_TIMED_DESPAWN,10000); - pSummon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); - pSummon->SetReactState(REACT_DEFENSIVE); - pSummon->CastSpell(pSummon,SPELL_ASHCROMBE_TELEPORT,true); - DoScriptText(SAY_ARCHMAGE,pSummon); - uiTimer = 2000; - uiPhase = 2; - break; - case 2: - pArchmage->SummonCreature(NPC_ARUGAL_VOIDWALKER,SpawnLocation[0],TEMPSUMMON_CORPSE_TIMED_DESPAWN,60000); - pArchmage->SummonCreature(NPC_ARUGAL_VOIDWALKER,SpawnLocation[1],TEMPSUMMON_CORPSE_TIMED_DESPAWN,60000); - pArchmage->SummonCreature(NPC_ARUGAL_VOIDWALKER,SpawnLocation[2],TEMPSUMMON_CORPSE_TIMED_DESPAWN,60000); - pArchmage->SummonCreature(NPC_ARUGAL_VOIDWALKER,SpawnLocation[3],TEMPSUMMON_CORPSE_TIMED_DESPAWN,60000); - uiPhase = 0; - break; - - } - } else uiTimer -= uiDiff; - } - } -}; - -InstanceData* GetInstanceData_instance_shadowfang_keep(Map* pMap) -{ - return new instance_shadowfang_keep(pMap); -} - -void AddSC_instance_shadowfang_keep() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_shadowfang_keep"; - newscript->GetInstanceData = &GetInstanceData_instance_shadowfang_keep; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/shadowfang_keep/shadowfang_keep.cpp b/src/server/scripts/EasternKingdoms/shadowfang_keep/shadowfang_keep.cpp deleted file mode 100644 index 23b8ad89160..00000000000 --- a/src/server/scripts/EasternKingdoms/shadowfang_keep/shadowfang_keep.cpp +++ /dev/null @@ -1,198 +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: Shadowfang_Keep -SD%Complete: 75 -SDComment: npc_shadowfang_prisoner using escortAI for movement to door. Might need additional code in case being attacked. Add proper texts/say(). -SDCategory: Shadowfang Keep -EndScriptData */ - -/* ContentData -npc_shadowfang_prisoner -EndContentData */ - -#include "ScriptedPch.h" -#include "ScriptedEscortAI.h" -#include "shadowfang_keep.h" - -/*###### -## npc_shadowfang_prisoner -######*/ - -enum eEnums -{ - SAY_FREE_AS = -1033000, - SAY_OPEN_DOOR_AS = -1033001, - SAY_POST_DOOR_AS = -1033002, - SAY_FREE_AD = -1033003, - SAY_OPEN_DOOR_AD = -1033004, - SAY_POST1_DOOR_AD = -1033005, - SAY_POST2_DOOR_AD = -1033006, - - SPELL_UNLOCK = 6421, - NPC_ASH = 3850, - - SPELL_DARK_OFFERING = 7154 -}; - -#define GOSSIP_ITEM_DOOR "Thanks, I'll follow you to the door." - -struct npc_shadowfang_prisonerAI : public npc_escortAI -{ - npc_shadowfang_prisonerAI(Creature *c) : npc_escortAI(c) - { - pInstance = c->GetInstanceData(); - uiNpcEntry = c->GetEntry(); - } - - ScriptedInstance *pInstance; - uint32 uiNpcEntry; - - void WaypointReached(uint32 uiPoint) - { - switch(uiPoint) - { - case 0: - if (uiNpcEntry == NPC_ASH) - DoScriptText(SAY_FREE_AS, me); - else - DoScriptText(SAY_FREE_AD, me); - break; - case 10: - if (uiNpcEntry == NPC_ASH) - DoScriptText(SAY_OPEN_DOOR_AS, me); - else - DoScriptText(SAY_OPEN_DOOR_AD, me); - break; - case 11: - if (uiNpcEntry == NPC_ASH) - DoCast(me, SPELL_UNLOCK); - break; - case 12: - if (uiNpcEntry == NPC_ASH) - DoScriptText(SAY_POST_DOOR_AS, me); - else - DoScriptText(SAY_POST1_DOOR_AD, me); - - if (pInstance) - pInstance->SetData(TYPE_FREE_NPC, DONE); - break; - case 13: - if (uiNpcEntry != NPC_ASH) - DoScriptText(SAY_POST2_DOOR_AD, me); - break; - } - } - - void Reset() {} - void EnterCombat(Unit* /*who*/) {} -}; - -CreatureAI* GetAI_npc_shadowfang_prisoner(Creature* pCreature) -{ - return new npc_shadowfang_prisonerAI(pCreature); -} - -bool GossipHello_npc_shadowfang_prisoner(Player* pPlayer, Creature* pCreature) -{ - ScriptedInstance* pInstance = pCreature->GetInstanceData(); - - if (pInstance && pInstance->GetData(TYPE_FREE_NPC) != DONE && pInstance->GetData(TYPE_RETHILGORE) == DONE) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_DOOR, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); - - return true; -} - -bool GossipSelect_npc_shadowfang_prisoner(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) - { - pPlayer->CLOSE_GOSSIP_MENU(); - - if (npc_escortAI* pEscortAI = CAST_AI(npc_shadowfang_prisonerAI, pCreature->AI())) - pEscortAI->Start(false, false); - } - return true; -} - -struct npc_arugal_voidwalkerAI : public ScriptedAI -{ - npc_arugal_voidwalkerAI(Creature* pCreature) : ScriptedAI(pCreature) - { - pInstance = pCreature->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint32 uiDarkOffering; - - void Reset() - { - uiDarkOffering = urand(290,10); - } - - void UpdateAI(uint32 const uiDiff) - { - if (!UpdateVictim()) - return; - - if (uiDarkOffering <= uiDiff) - { - if (Creature* pFriend = me->FindNearestCreature(me->GetEntry(),25.0f,true)) - { - if (pFriend) - DoCast(pFriend,SPELL_DARK_OFFERING); - } - else - DoCast(me,SPELL_DARK_OFFERING); - uiDarkOffering = urand(4400,12500); - } else uiDarkOffering -= uiDiff; - - DoMeleeAttackIfReady(); - } - - void JustDied(Unit* /*pKiller*/) - { - if (pInstance) - pInstance->SetData(TYPE_FENRUS, pInstance->GetData(TYPE_FENRUS) + 1); - } -}; - -CreatureAI* GetAI_npc_arugal_voidwalker(Creature* pCreature) -{ - return new npc_arugal_voidwalkerAI(pCreature); -} - -void AddSC_shadowfang_keep() -{ - Script* newscript; - - newscript = new Script; - newscript->Name = "npc_shadowfang_prisoner"; - newscript->pGossipHello = &GossipHello_npc_shadowfang_prisoner; - newscript->pGossipSelect = &GossipSelect_npc_shadowfang_prisoner; - newscript->GetAI = &GetAI_npc_shadowfang_prisoner; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_arugal_voidwalker"; - newscript->GetAI = &GetAI_npc_arugal_voidwalker; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/shadowfang_keep/shadowfang_keep.h b/src/server/scripts/EasternKingdoms/shadowfang_keep/shadowfang_keep.h deleted file mode 100644 index a1a59789632..00000000000 --- a/src/server/scripts/EasternKingdoms/shadowfang_keep/shadowfang_keep.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_SHADOWFANG_H -#define DEF_SHADOWFANG_H - -enum eData -{ - TYPE_FREE_NPC = 1, - TYPE_RETHILGORE = 2, - TYPE_FENRUS = 3, - TYPE_NANDOS = 4 -}; - -#endif - diff --git a/src/server/scripts/EasternKingdoms/stratholme/boss_baron_rivendare.cpp b/src/server/scripts/EasternKingdoms/stratholme/boss_baron_rivendare.cpp deleted file mode 100644 index de17717e289..00000000000 --- a/src/server/scripts/EasternKingdoms/stratholme/boss_baron_rivendare.cpp +++ /dev/null @@ -1,190 +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_Baron_Rivendare -SD%Complete: 70 -SDComment: aura applied/defined in database -SDCategory: Stratholme -EndScriptData */ - -#include "ScriptedPch.h" -#include "stratholme.h" - -#define SAY_0 "Intruders! More pawns of the Argent Dawn, no doubt. I already count one of their number among my prisoners. Withdraw from my domain before she is executed!" -#define SAY_1 "You're still here? Your foolishness is amusing! The Argent Dawn wench needn't suffer in vain. Leave at once and she shall be spared!" -#define SAY_2 "I shall take great pleasure in taking this poor wretch's life! It's not too late, she needn't suffer in vain. Turn back and her death shall be merciful!" -#define SAY_3 "May this prisoner's death serve as a warning. None shall defy the Scourge and live!" -#define SAY_4 "So you see fit to toy with the Lich King's creations? Ramstein, be sure to give the intruders a proper greeting." -#define SAY_5 "Time to take matters into my own hands. Come. Enter my domain and challenge the might of the Scourge!" - -#define ADD_1X 4017.403809 -#define ADD_1Y -3339.703369 -#define ADD_1Z 115.057655 -#define ADD_1O 5.487860 - -#define ADD_2X 4013.189209 -#define ADD_2Y -3351.808350 -#define ADD_2Z 115.052254 -#define ADD_2O 0.134280 - -#define ADD_3X 4017.738037 -#define ADD_3Y -3363.478016 -#define ADD_3Z 115.057274 -#define ADD_3O 0.723313 - -#define ADD_4X 4048.877197 -#define ADD_4Y -3363.223633 -#define ADD_4Z 115.054253 -#define ADD_4O 3.627735 - -#define ADD_5X 4051.777588 -#define ADD_5Y -3350.893311 -#define ADD_5Z 115.055351 -#define ADD_5O 3.066176 - -#define ADD_6X 4048.375977 -#define ADD_6Y -3339.966309 -#define ADD_6Z 115.055222 -#define ADD_6O 2.457497 - -#define SPELL_SHADOWBOLT 17393 -#define SPELL_CLEAVE 15284 -#define SPELL_MORTALSTRIKE 15708 - -#define SPELL_UNHOLY_AURA 17467 -#define SPELL_RAISEDEAD 17473 //triggers death pact (17471) - -#define SPELL_RAISE_DEAD1 17475 -#define SPELL_RAISE_DEAD2 17476 -#define SPELL_RAISE_DEAD3 17477 -#define SPELL_RAISE_DEAD4 17478 -#define SPELL_RAISE_DEAD5 17479 -#define SPELL_RAISE_DEAD6 17480 - -struct boss_baron_rivendareAI : public ScriptedAI -{ - boss_baron_rivendareAI(Creature *c) : ScriptedAI(c) - { - pInstance = me->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint32 ShadowBolt_Timer; - uint32 Cleave_Timer; - uint32 MortalStrike_Timer; - // uint32 RaiseDead_Timer; - uint32 SummonSkeletons_Timer; - - void Reset() - { - ShadowBolt_Timer = 5000; - Cleave_Timer = 8000; - MortalStrike_Timer = 12000; - // RaiseDead_Timer = 30000; - SummonSkeletons_Timer = 34000; - if (pInstance && pInstance->GetData(TYPE_RAMSTEIN) == DONE) - pInstance->SetData(TYPE_BARON,NOT_STARTED); - } - - void AttackStart(Unit* who) - { - if (pInstance)//can't use entercombat(), boss' dmg aura sets near players in combat, before entering the room's door - pInstance->SetData(TYPE_BARON,IN_PROGRESS); - ScriptedAI::AttackStart(who); - } - - void JustSummoned(Creature* summoned) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) - summoned->AI()->AttackStart(pTarget); - } - - void JustDied(Unit* /*Killer*/) - { - if (pInstance) - pInstance->SetData(TYPE_BARON,DONE); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //ShadowBolt - if (ShadowBolt_Timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(me->getVictim(), SPELL_SHADOWBOLT); - - ShadowBolt_Timer = 10000; - } else ShadowBolt_Timer -= diff; - - //Cleave - if (Cleave_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_CLEAVE); - //13 seconds until we should cast this again - Cleave_Timer = 7000 + (rand()%10000); - } else Cleave_Timer -= diff; - - //MortalStrike - if (MortalStrike_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_MORTALSTRIKE); - MortalStrike_Timer = 10000 + (rand()%15000); - } else MortalStrike_Timer -= diff; - - //RaiseDead - // if (RaiseDead_Timer <= diff) - // { - // DoCast(me, SPELL_RAISEDEAD); - // RaiseDead_Timer = 45000; - // } else RaiseDead_Timer -= diff; - - //SummonSkeletons - if (SummonSkeletons_Timer <= diff) - { - me->SummonCreature(11197,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,29000); - me->SummonCreature(11197,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,29000); - me->SummonCreature(11197,ADD_3X,ADD_3Y,ADD_3Z,ADD_3O,TEMPSUMMON_TIMED_DESPAWN,29000); - me->SummonCreature(11197,ADD_4X,ADD_4Y,ADD_4Z,ADD_4O,TEMPSUMMON_TIMED_DESPAWN,29000); - me->SummonCreature(11197,ADD_5X,ADD_5Y,ADD_5Z,ADD_5O,TEMPSUMMON_TIMED_DESPAWN,29000); - me->SummonCreature(11197,ADD_6X,ADD_6Y,ADD_6Z,ADD_6O,TEMPSUMMON_TIMED_DESPAWN,29000); - - //34 seconds until we should cast this again - SummonSkeletons_Timer = 40000; - } else SummonSkeletons_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_baron_rivendare(Creature* pCreature) -{ - return new boss_baron_rivendareAI (pCreature); -} - -void AddSC_boss_baron_rivendare() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_baron_rivendare"; - newscript->GetAI = &GetAI_boss_baron_rivendare; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/stratholme/boss_baroness_anastari.cpp b/src/server/scripts/EasternKingdoms/stratholme/boss_baroness_anastari.cpp deleted file mode 100644 index cff4fe3fbae..00000000000 --- a/src/server/scripts/EasternKingdoms/stratholme/boss_baroness_anastari.cpp +++ /dev/null @@ -1,127 +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_Baroness_Anastari -SD%Complete: 90 -SDComment: MC disabled -SDCategory: Stratholme -EndScriptData */ - -#include "ScriptedPch.h" -#include "stratholme.h" - -#define SPELL_BANSHEEWAIL 16565 -#define SPELL_BANSHEECURSE 16867 -#define SPELL_SILENCE 18327 -//#define SPELL_POSSESS 17244 - -struct boss_baroness_anastariAI : public ScriptedAI -{ - boss_baroness_anastariAI(Creature *c) : ScriptedAI(c) - { - pInstance = me->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint32 BansheeWail_Timer; - uint32 BansheeCurse_Timer; - uint32 Silence_Timer; - //uint32 Possess_Timer; - - void Reset() - { - BansheeWail_Timer = 1000; - BansheeCurse_Timer = 11000; - Silence_Timer = 13000; - //Possess_Timer = 35000; - } - - void EnterCombat(Unit * /*who*/) - { - } - - void JustDied(Unit* /*Killer*/) - { - if (pInstance) - pInstance->SetData(TYPE_BARONESS,IN_PROGRESS); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //BansheeWail - if (BansheeWail_Timer <= diff) - { - if (rand()%100 < 95) - DoCast(me->getVictim(), SPELL_BANSHEEWAIL); - //4 seconds until we should cast this again - BansheeWail_Timer = 4000; - } else BansheeWail_Timer -= diff; - - //BansheeCurse - if (BansheeCurse_Timer <= diff) - { - if (rand()%100 < 75) - DoCast(me->getVictim(), SPELL_BANSHEECURSE); - //18 seconds until we should cast this again - BansheeCurse_Timer = 18000; - } else BansheeCurse_Timer -= diff; - - //Silence - if (Silence_Timer <= diff) - { - if (rand()%100 < 80) - DoCast(me->getVictim(), SPELL_SILENCE); - //13 seconds until we should cast this again - Silence_Timer = 13000; - } else Silence_Timer -= diff; - - //Possess - /* if (Possess_Timer <= diff) - { - //Cast - if (rand()%100 < 65) - { - Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); - if (pTarget)DoCast(pTarget, SPELL_POSSESS); - } - //50 seconds until we should cast this again - Possess_Timer = 50000; - } else Possess_Timer -= diff; - */ - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_baroness_anastari(Creature* pCreature) -{ - return new boss_baroness_anastariAI (pCreature); -} - -void AddSC_boss_baroness_anastari() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_baroness_anastari"; - newscript->GetAI = &GetAI_boss_baroness_anastari; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/stratholme/boss_cannon_master_willey.cpp b/src/server/scripts/EasternKingdoms/stratholme/boss_cannon_master_willey.cpp deleted file mode 100644 index c12f7b9ad04..00000000000 --- a/src/server/scripts/EasternKingdoms/stratholme/boss_cannon_master_willey.cpp +++ /dev/null @@ -1,220 +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_cannon_master_willey -SD%Complete: 100 -SDComment: -SDCategory: Stratholme -EndScriptData */ - -#include "ScriptedPch.h" - -//front, left -#define ADD_1X 3553.851807 -#define ADD_1Y -2945.885986 -#define ADD_1Z 125.001015 -#define ADD_1O 0.592007 -//front, right -#define ADD_2X 3559.206299 -#define ADD_2Y -2952.929932 -#define ADD_2Z 125.001015 -#define ADD_2O 0.592007 -//mid, left -#define ADD_3X 3552.417480 -#define ADD_3Y -2948.667236 -#define ADD_3Z 125.001015 -#define ADD_3O 0.592007 -//mid, right -#define ADD_4X 3555.651855 -#define ADD_4Y -2953.519043 -#define ADD_4Z 125.001015 -#define ADD_4O 0.592007 -//back, left -#define ADD_5X 3547.927246 -#define ADD_5Y -2950.977295 -#define ADD_5Z 125.001015 -#define ADD_5O 0.592007 -//back, mid -#define ADD_6X 3553.094697 -#define ADD_6Y -2952.123291 -#define ADD_6Z 125.001015 -#define ADD_6O 0.592007 -//back, right -#define ADD_7X 3552.727539 -#define ADD_7Y -2957.776123 -#define ADD_7Z 125.001015 -#define ADD_7O 0.592007 -//behind, left -#define ADD_8X 3547.156250 -#define ADD_8Y -2953.162354 -#define ADD_8Z 125.001015 -#define ADD_8O 0.592007 -//behind, right -#define ADD_9X 3550.202148 -#define ADD_9Y -2957.437744 -#define ADD_9Z 125.001015 -#define ADD_9O 0.592007 - -#define SPELL_KNOCKAWAY 10101 -#define SPELL_PUMMEL 15615 -#define SPELL_SHOOT 16496 -//#define SPELL_SUMMONCRIMSONRIFLEMAN 17279 - -struct boss_cannon_master_willeyAI : public ScriptedAI -{ - boss_cannon_master_willeyAI(Creature *c) : ScriptedAI(c) {} - - uint32 KnockAway_Timer; - uint32 Pummel_Timer; - uint32 Shoot_Timer; - uint32 SummonRifleman_Timer; - - void Reset() - { - Shoot_Timer = 1000; - Pummel_Timer = 7000; - KnockAway_Timer = 11000; - SummonRifleman_Timer = 15000; - } - - void JustDied(Unit* /*Victim*/) - { - me->SummonCreature(11054,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,240000); - me->SummonCreature(11054,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,240000); - me->SummonCreature(11054,ADD_3X,ADD_3Y,ADD_3Z,ADD_3O,TEMPSUMMON_TIMED_DESPAWN,240000); - me->SummonCreature(11054,ADD_4X,ADD_4Y,ADD_4Z,ADD_4O,TEMPSUMMON_TIMED_DESPAWN,240000); - me->SummonCreature(11054,ADD_5X,ADD_5Y,ADD_5Z,ADD_5O,TEMPSUMMON_TIMED_DESPAWN,240000); - me->SummonCreature(11054,ADD_7X,ADD_7Y,ADD_7Z,ADD_7O,TEMPSUMMON_TIMED_DESPAWN,240000); - me->SummonCreature(11054,ADD_9X,ADD_9Y,ADD_9Z,ADD_9O,TEMPSUMMON_TIMED_DESPAWN,240000); - } - - void EnterCombat(Unit * /*who*/) - { - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //Pummel - if (Pummel_Timer <= diff) - { - //Cast - if (rand()%100 < 90) //90% chance to cast - { - DoCast(me->getVictim(), SPELL_PUMMEL); - } - //12 seconds until we should cast this again - Pummel_Timer = 12000; - } else Pummel_Timer -= diff; - - //KnockAway - if (KnockAway_Timer <= diff) - { - //Cast - if (rand()%100 < 80) //80% chance to cast - { - DoCast(me->getVictim(), SPELL_KNOCKAWAY); - } - //14 seconds until we should cast this again - KnockAway_Timer = 14000; - } else KnockAway_Timer -= diff; - - //Shoot - if (Shoot_Timer <= diff) - { - //Cast - DoCast(me->getVictim(), SPELL_SHOOT); - //1 seconds until we should cast this again - Shoot_Timer = 1000; - } else Shoot_Timer -= diff; - - //SummonRifleman - if (SummonRifleman_Timer <= diff) - { - //Cast - switch (rand()%9) - { - case 0: - me->SummonCreature(11054,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,240000); - me->SummonCreature(11054,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,240000); - me->SummonCreature(11054,ADD_4X,ADD_4Y,ADD_4Z,ADD_4O,TEMPSUMMON_TIMED_DESPAWN,240000); - break; - case 1: - me->SummonCreature(11054,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,240000); - me->SummonCreature(11054,ADD_3X,ADD_3Y,ADD_3Z,ADD_3O,TEMPSUMMON_TIMED_DESPAWN,240000); - me->SummonCreature(11054,ADD_5X,ADD_5Y,ADD_5Z,ADD_5O,TEMPSUMMON_TIMED_DESPAWN,240000); - break; - case 2: - me->SummonCreature(11054,ADD_3X,ADD_3Y,ADD_3Z,ADD_3O,TEMPSUMMON_TIMED_DESPAWN,240000); - me->SummonCreature(11054,ADD_4X,ADD_4Y,ADD_4Z,ADD_4O,TEMPSUMMON_TIMED_DESPAWN,240000); - me->SummonCreature(11054,ADD_6X,ADD_6Y,ADD_6Z,ADD_6O,TEMPSUMMON_TIMED_DESPAWN,240000); - break; - case 3: - me->SummonCreature(11054,ADD_4X,ADD_4Y,ADD_4Z,ADD_4O,TEMPSUMMON_TIMED_DESPAWN,240000); - me->SummonCreature(11054,ADD_5X,ADD_5Y,ADD_5Z,ADD_5O,TEMPSUMMON_TIMED_DESPAWN,240000); - me->SummonCreature(11054,ADD_7X,ADD_7Y,ADD_7Z,ADD_7O,TEMPSUMMON_TIMED_DESPAWN,240000); - break; - case 4: - me->SummonCreature(11054,ADD_5X,ADD_5Y,ADD_5Z,ADD_5O,TEMPSUMMON_TIMED_DESPAWN,240000); - me->SummonCreature(11054,ADD_6X,ADD_6Y,ADD_6Z,ADD_6O,TEMPSUMMON_TIMED_DESPAWN,240000); - me->SummonCreature(11054,ADD_8X,ADD_8Y,ADD_8Z,ADD_8O,TEMPSUMMON_TIMED_DESPAWN,240000); - break; - case 5: - me->SummonCreature(11054,ADD_6X,ADD_6Y,ADD_6Z,ADD_6O,TEMPSUMMON_TIMED_DESPAWN,240000); - me->SummonCreature(11054,ADD_7X,ADD_7Y,ADD_7Z,ADD_7O,TEMPSUMMON_TIMED_DESPAWN,240000); - me->SummonCreature(11054,ADD_9X,ADD_9Y,ADD_9Z,ADD_9O,TEMPSUMMON_TIMED_DESPAWN,240000); - break; - case 6: - me->SummonCreature(11054,ADD_7X,ADD_7Y,ADD_7Z,ADD_7O,TEMPSUMMON_TIMED_DESPAWN,240000); - me->SummonCreature(11054,ADD_8X,ADD_8Y,ADD_8Z,ADD_8O,TEMPSUMMON_TIMED_DESPAWN,240000); - me->SummonCreature(11054,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,240000); - break; - case 7: - me->SummonCreature(11054,ADD_8X,ADD_8Y,ADD_8Z,ADD_8O,TEMPSUMMON_TIMED_DESPAWN,240000); - me->SummonCreature(11054,ADD_9X,ADD_9Y,ADD_9Z,ADD_9O,TEMPSUMMON_TIMED_DESPAWN,240000); - me->SummonCreature(11054,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,240000); - break; - case 8: - me->SummonCreature(11054,ADD_9X,ADD_9Y,ADD_9Z,ADD_9O,TEMPSUMMON_TIMED_DESPAWN,240000); - me->SummonCreature(11054,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,240000); - me->SummonCreature(11054,ADD_3X,ADD_3Y,ADD_3Z,ADD_3O,TEMPSUMMON_TIMED_DESPAWN,240000); - break; - } - //30 seconds until we should cast this again - SummonRifleman_Timer = 30000; - } else SummonRifleman_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_cannon_master_willey(Creature* pCreature) -{ - return new boss_cannon_master_willeyAI (pCreature); -} - -void AddSC_boss_cannon_master_willey() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_cannon_master_willey"; - newscript->GetAI = &GetAI_boss_cannon_master_willey; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/stratholme/boss_dathrohan_balnazzar.cpp b/src/server/scripts/EasternKingdoms/stratholme/boss_dathrohan_balnazzar.cpp deleted file mode 100644 index a8489a7f549..00000000000 --- a/src/server/scripts/EasternKingdoms/stratholme/boss_dathrohan_balnazzar.cpp +++ /dev/null @@ -1,217 +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_Dathrohan_Balnazzar -SD%Complete: 95 -SDComment: Possibly need to fix/improve summons after death -SDCategory: Stratholme -EndScriptData */ - -#include "ScriptedPch.h" - -enum eEnums -{ - //Dathrohan spells - SPELL_CRUSADERSHAMMER = 17286, //AOE stun - SPELL_CRUSADERSTRIKE = 17281, - SPELL_HOLYSTRIKE = 17284, //weapon dmg +3 - - //Transform - SPELL_BALNAZZARTRANSFORM = 17288, //restore full HP/mana, trigger spell Balnazzar Transform Stun - - //Balnazzar spells - SPELL_SHADOWSHOCK = 17399, - SPELL_MINDBLAST = 17287, - SPELL_PSYCHICSCREAM = 13704, - SPELL_SLEEP = 12098, - SPELL_MINDCONTROL = 15690, - - NPC_DATHROHAN = 10812, - NPC_BALNAZZAR = 10813, - NPC_ZOMBIE = 10698 //probably incorrect -}; - -struct SummonDef -{ - float m_fX, m_fY, m_fZ, m_fOrient; -}; - -SummonDef m_aSummonPoint[]= -{ - {3444.156, -3090.626, 135.002, 2.240}, //G1 front, left - {3449.123, -3087.009, 135.002, 2.240}, //G1 front, right - {3446.246, -3093.466, 135.002, 2.240}, //G1 back left - {3451.160, -3089.904, 135.002, 2.240}, //G1 back, right - - {3457.995, -3080.916, 135.002, 3.784}, //G2 front, left - {3454.302, -3076.330, 135.002, 3.784}, //G2 front, right - {3460.975, -3078.901, 135.002, 3.784}, //G2 back left - {3457.338, -3073.979, 135.002, 3.784} //G2 back, right -}; - -struct boss_dathrohan_balnazzarAI : public ScriptedAI -{ - boss_dathrohan_balnazzarAI(Creature *c) : ScriptedAI(c) {} - - uint32 m_uiCrusadersHammer_Timer; - uint32 m_uiCrusaderStrike_Timer; - uint32 m_uiMindBlast_Timer; - uint32 m_uiHolyStrike_Timer; - uint32 m_uiShadowShock_Timer; - uint32 m_uiPsychicScream_Timer; - uint32 m_uiDeepSleep_Timer; - uint32 m_uiMindControl_Timer; - bool m_bTransformed; - - void Reset() - { - m_uiCrusadersHammer_Timer = 8000; - m_uiCrusaderStrike_Timer = 12000; - m_uiMindBlast_Timer = 6000; - m_uiHolyStrike_Timer = 18000; - m_uiShadowShock_Timer = 4000; - m_uiPsychicScream_Timer = 16000; - m_uiDeepSleep_Timer = 20000; - m_uiMindControl_Timer = 10000; - m_bTransformed = false; - - if (me->GetEntry() == NPC_BALNAZZAR) - me->UpdateEntry(NPC_DATHROHAN); - } - - void JustDied(Unit* /*Victim*/) - { - static uint32 uiCount = sizeof(m_aSummonPoint)/sizeof(SummonDef); - - for (uint8 i=0; iSummonCreature(NPC_ZOMBIE, - m_aSummonPoint[i].m_fX, m_aSummonPoint[i].m_fY, m_aSummonPoint[i].m_fZ, m_aSummonPoint[i].m_fOrient, - TEMPSUMMON_TIMED_DESPAWN, HOUR*IN_MILISECONDS); - } - - void EnterCombat(Unit * /*who*/) - { - } - - void UpdateAI(const uint32 uiDiff) - { - if (!UpdateVictim()) - return; - - //START NOT TRANSFORMED - if (!m_bTransformed) - { - //MindBlast - if (m_uiMindBlast_Timer <= uiDiff) - { - DoCast(me->getVictim(), SPELL_MINDBLAST); - m_uiMindBlast_Timer = 15000 + rand()%5000; - } else m_uiMindBlast_Timer -= uiDiff; - - //CrusadersHammer - if (m_uiCrusadersHammer_Timer <= uiDiff) - { - DoCast(me->getVictim(), SPELL_CRUSADERSHAMMER); - m_uiCrusadersHammer_Timer = 12000; - } else m_uiCrusadersHammer_Timer -= uiDiff; - - //CrusaderStrike - if (m_uiCrusaderStrike_Timer <= uiDiff) - { - DoCast(me->getVictim(), SPELL_CRUSADERSTRIKE); - m_uiCrusaderStrike_Timer = 15000; - } else m_uiCrusaderStrike_Timer -= uiDiff; - - //HolyStrike - if (m_uiHolyStrike_Timer <= uiDiff) - { - DoCast(me->getVictim(), SPELL_HOLYSTRIKE); - m_uiHolyStrike_Timer = 15000; - } else m_uiHolyStrike_Timer -= uiDiff; - - //BalnazzarTransform - if (me->GetHealth()*100 / me->GetMaxHealth() < 40) - { - if (me->IsNonMeleeSpellCasted(false)) - me->InterruptNonMeleeSpells(false); - - //restore hp, mana and stun - DoCast(me, SPELL_BALNAZZARTRANSFORM); - me->UpdateEntry(NPC_BALNAZZAR); - m_bTransformed = true; - } - } - else - { - //MindBlast - if (m_uiMindBlast_Timer <= uiDiff) - { - DoCast(me->getVictim(), SPELL_MINDBLAST); - m_uiMindBlast_Timer = 15000 + rand()%5000; - } else m_uiMindBlast_Timer -= uiDiff; - - //ShadowShock - if (m_uiShadowShock_Timer <= uiDiff) - { - DoCast(me->getVictim(), SPELL_SHADOWSHOCK); - m_uiShadowShock_Timer = 11000; - } else m_uiShadowShock_Timer -= uiDiff; - - //PsychicScream - if (m_uiPsychicScream_Timer <= uiDiff) - { - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(pTarget, SPELL_PSYCHICSCREAM); - - m_uiPsychicScream_Timer = 20000; - } else m_uiPsychicScream_Timer -= uiDiff; - - //DeepSleep - if (m_uiDeepSleep_Timer <= uiDiff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(pTarget, SPELL_SLEEP); - - m_uiDeepSleep_Timer = 15000; - } else m_uiDeepSleep_Timer -= uiDiff; - - //MindControl - if (m_uiMindControl_Timer <= uiDiff) - { - DoCast(me->getVictim(), SPELL_MINDCONTROL); - m_uiMindControl_Timer = 15000; - } else m_uiMindControl_Timer -= uiDiff; - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_dathrohan_balnazzar(Creature* pCreature) -{ - return new boss_dathrohan_balnazzarAI (pCreature); -} - -void AddSC_boss_dathrohan_balnazzar() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_dathrohan_balnazzar"; - newscript->GetAI = &GetAI_boss_dathrohan_balnazzar; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/stratholme/boss_magistrate_barthilas.cpp b/src/server/scripts/EasternKingdoms/stratholme/boss_magistrate_barthilas.cpp deleted file mode 100644 index 89de7dbc207..00000000000 --- a/src/server/scripts/EasternKingdoms/stratholme/boss_magistrate_barthilas.cpp +++ /dev/null @@ -1,128 +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_Magistrate_Barthilas -SD%Complete: 70 -SDComment: -SDCategory: Stratholme -EndScriptData */ - -#include "ScriptedPch.h" -#include "stratholme.h" - -#define SPELL_DRAININGBLOW 16793 -#define SPELL_CROWDPUMMEL 10887 -#define SPELL_MIGHTYBLOW 14099 -#define SPELL_FURIOUS_ANGER 16791 - -#define MODEL_NORMAL 10433 -#define MODEL_HUMAN 3637 - -struct boss_magistrate_barthilasAI : public ScriptedAI -{ - boss_magistrate_barthilasAI(Creature *c) : ScriptedAI(c) {} - - uint32 DrainingBlow_Timer; - uint32 CrowdPummel_Timer; - uint32 MightyBlow_Timer; - uint32 FuriousAnger_Timer; - uint32 AngerCount; - - void Reset() - { - DrainingBlow_Timer = 20000; - CrowdPummel_Timer = 15000; - MightyBlow_Timer = 10000; - FuriousAnger_Timer = 5000; - AngerCount = 0; - - if (me->isAlive()) - me->SetDisplayId(MODEL_NORMAL); - else - me->SetDisplayId(MODEL_HUMAN); - } - - void MoveInLineOfSight(Unit *who) - { - //nothing to see here yet - - ScriptedAI::MoveInLineOfSight(who); - } - - void JustDied(Unit* /*Killer*/) - { - me->SetDisplayId(MODEL_HUMAN); - } - - void EnterCombat(Unit * /*who*/) - { - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - if (FuriousAnger_Timer <= diff) - { - FuriousAnger_Timer = 4000; - if (AngerCount > 25) - return; - - ++AngerCount; - DoCast(me, SPELL_FURIOUS_ANGER, false); - } else FuriousAnger_Timer -= diff; - - //DrainingBlow - if (DrainingBlow_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_DRAININGBLOW); - DrainingBlow_Timer = 15000; - } else DrainingBlow_Timer -= diff; - - //CrowdPummel - if (CrowdPummel_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_CROWDPUMMEL); - CrowdPummel_Timer = 15000; - } else CrowdPummel_Timer -= diff; - - //MightyBlow - if (MightyBlow_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_MIGHTYBLOW); - MightyBlow_Timer = 20000; - } else MightyBlow_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_magistrate_barthilas(Creature* pCreature) -{ - return new boss_magistrate_barthilasAI (pCreature); -} - -void AddSC_boss_magistrate_barthilas() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_magistrate_barthilas"; - newscript->GetAI = &GetAI_boss_magistrate_barthilas; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/stratholme/boss_maleki_the_pallid.cpp b/src/server/scripts/EasternKingdoms/stratholme/boss_maleki_the_pallid.cpp deleted file mode 100644 index 0c1cf011d5e..00000000000 --- a/src/server/scripts/EasternKingdoms/stratholme/boss_maleki_the_pallid.cpp +++ /dev/null @@ -1,108 +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_maleki_the_pallid -SD%Complete: 100 -SDComment: -SDCategory: Stratholme -EndScriptData */ - -#include "ScriptedPch.h" -#include "stratholme.h" - -#define SPELL_FROSTBOLT 17503 -#define SPELL_DRAINLIFE 20743 -#define SPELL_DRAIN_MANA 17243 -#define SPELL_ICETOMB 16869 - -struct boss_maleki_the_pallidAI : public ScriptedAI -{ - boss_maleki_the_pallidAI(Creature *c) : ScriptedAI(c) - { - pInstance = me->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint32 Frostbolt_Timer; - uint32 IceTomb_Timer; - uint32 DrainLife_Timer; - - void Reset() - { - Frostbolt_Timer = 1000; - IceTomb_Timer = 16000; - DrainLife_Timer = 31000; - } - - void EnterCombat(Unit * /*who*/) - { - } - - void JustDied(Unit* /*Killer*/) - { - if (pInstance) - pInstance->SetData(TYPE_PALLID,IN_PROGRESS); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //Frostbolt - if (Frostbolt_Timer <= diff) - { - if (rand()%100 < 90) - DoCast(me->getVictim(), SPELL_FROSTBOLT); - Frostbolt_Timer = 3500; - } else Frostbolt_Timer -= diff; - - //IceTomb - if (IceTomb_Timer <= diff) - { - if (rand()%100 < 65) - DoCast(me->getVictim(), SPELL_ICETOMB); - IceTomb_Timer = 28000; - } else IceTomb_Timer -= diff; - - //DrainLife - if (DrainLife_Timer <= diff) - { - if (rand()%100 < 55) - DoCast(me->getVictim(), SPELL_DRAINLIFE); - DrainLife_Timer = 31000; - } else DrainLife_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_maleki_the_pallid(Creature* pCreature) -{ - return new boss_maleki_the_pallidAI (pCreature); -} - -void AddSC_boss_maleki_the_pallid() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_maleki_the_pallid"; - newscript->GetAI = &GetAI_boss_maleki_the_pallid; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/stratholme/boss_nerubenkan.cpp b/src/server/scripts/EasternKingdoms/stratholme/boss_nerubenkan.cpp deleted file mode 100644 index ae7299071f4..00000000000 --- a/src/server/scripts/EasternKingdoms/stratholme/boss_nerubenkan.cpp +++ /dev/null @@ -1,121 +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_Nerubenkan -SD%Complete: 70 -SDComment: -SDCategory: Stratholme -EndScriptData */ - -#include "ScriptedPch.h" -#include "stratholme.h" - -#define SPELL_ENCASINGWEBS 4962 -#define SPELL_PIERCEARMOR 6016 -#define SPELL_CRYPT_SCARABS 31602 -#define SPELL_RAISEUNDEADSCARAB 17235 - -struct boss_nerubenkanAI : public ScriptedAI -{ - boss_nerubenkanAI(Creature *c) : ScriptedAI(c) - { - pInstance = me->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint32 EncasingWebs_Timer; - uint32 PierceArmor_Timer; - uint32 CryptScarabs_Timer; - uint32 RaiseUndeadScarab_Timer; - - void Reset() - { - CryptScarabs_Timer = 3000; - EncasingWebs_Timer = 7000; - PierceArmor_Timer = 19000; - RaiseUndeadScarab_Timer = 3000; - } - - void EnterCombat(Unit * /*who*/) - { - } - - void JustDied(Unit* /*Killer*/) - { - if (pInstance) - pInstance->SetData(TYPE_NERUB,IN_PROGRESS); - } - - void RaiseUndeadScarab(Unit* pVictim) - { - if (Creature* pUndeadScarab = DoSpawnCreature(10876, irand(-9,9), irand(-9,9), 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 180000)) - if (pUndeadScarab->AI()) - pUndeadScarab->AI()->AttackStart(pVictim); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //EncasingWebs - if (EncasingWebs_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_ENCASINGWEBS); - EncasingWebs_Timer = 30000; - } else EncasingWebs_Timer -= diff; - - //PierceArmor - if (PierceArmor_Timer <= diff) - { - if (urand(0,3) < 2) - DoCast(me->getVictim(), SPELL_PIERCEARMOR); - PierceArmor_Timer = 35000; - } else PierceArmor_Timer -= diff; - - //CryptScarabs_Timer - if (CryptScarabs_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_CRYPT_SCARABS); - CryptScarabs_Timer = 20000; - } else CryptScarabs_Timer -= diff; - - //RaiseUndeadScarab - if (RaiseUndeadScarab_Timer <= diff) - { - RaiseUndeadScarab(me->getVictim()); - RaiseUndeadScarab_Timer = 16000; - } else RaiseUndeadScarab_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_nerubenkan(Creature* pCreature) -{ - return new boss_nerubenkanAI (pCreature); -} - -void AddSC_boss_nerubenkan() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_nerubenkan"; - newscript->GetAI = &GetAI_boss_nerubenkan; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/stratholme/boss_order_of_silver_hand.cpp b/src/server/scripts/EasternKingdoms/stratholme/boss_order_of_silver_hand.cpp deleted file mode 100644 index 905feb9fffc..00000000000 --- a/src/server/scripts/EasternKingdoms/stratholme/boss_order_of_silver_hand.cpp +++ /dev/null @@ -1,157 +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_Silver_Hand_Bosses -SD%Complete: 40 -SDComment: Basic script to have support for Horde paladin epic mount (quest 9737). All 5 members of Order of the Silver Hand running this script (least for now) -SDCategory: Stratholme -EndScriptData */ - -#include "ScriptedPch.h" -#include "stratholme.h" - -/*##### -# Additional: -# Although this is a working solution, the correct would be in addition to check if Aurius is dead. -# Once player extinguish the eternal flame (cast spell 31497->start event 11206) Aurius should become hostile. -# Once Aurius is defeated, he should be the one summoning the ghosts. -#####*/ - -#define SH_GREGOR 17910 -#define SH_CATHELA 17911 -#define SH_NEMAS 17912 -#define SH_AELMAR 17913 -#define SH_VICAR 17914 -#define SH_QUEST_CREDIT 17915 - -#define SPELL_HOLY_LIGHT 25263 -#define SPELL_DIVINE_SHIELD 13874 - -struct boss_silver_hand_bossesAI : public ScriptedAI -{ - boss_silver_hand_bossesAI(Creature* c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance *pInstance; - - uint32 HolyLight_Timer; - uint32 DivineShield_Timer; - - void Reset() - { - HolyLight_Timer = 20000; - DivineShield_Timer = 20000; - - if (pInstance) - { - switch(me->GetEntry()) - { - case SH_AELMAR: - pInstance->SetData(TYPE_SH_AELMAR, 0); - break; - case SH_CATHELA: - pInstance->SetData(TYPE_SH_CATHELA, 0); - break; - case SH_GREGOR: - pInstance->SetData(TYPE_SH_GREGOR, 0); - break; - case SH_NEMAS: - pInstance->SetData(TYPE_SH_NEMAS, 0); - break; - case SH_VICAR: - pInstance->SetData(TYPE_SH_VICAR, 0); - break; - } - } - } - - void EnterCombat(Unit* /*who*/) - { - } - - void JustDied(Unit* Killer) - { - if (pInstance) - { - switch(me->GetEntry()) - { - case SH_AELMAR: - pInstance->SetData(TYPE_SH_AELMAR, 2); - break; - case SH_CATHELA: - pInstance->SetData(TYPE_SH_CATHELA, 2); - break; - case SH_GREGOR: - pInstance->SetData(TYPE_SH_GREGOR, 2); - break; - case SH_NEMAS: - pInstance->SetData(TYPE_SH_NEMAS, 2); - break; - case SH_VICAR: - pInstance->SetData(TYPE_SH_VICAR, 2); - break; - } - if (pInstance->GetData(TYPE_SH_QUEST) && Killer->GetTypeId() == TYPEID_PLAYER) - CAST_PLR(Killer)->KilledMonsterCredit(SH_QUEST_CREDIT,me->GetGUID()); - } - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - if (HolyLight_Timer <= diff) - { - if (me->GetHealth()*5 < me->GetMaxHealth()) - { - DoCast(me, SPELL_HOLY_LIGHT); - HolyLight_Timer = 20000; - } - } else HolyLight_Timer -= diff; - - if (DivineShield_Timer <= diff) - { - if (me->GetHealth()*20 < me->GetMaxHealth()) - { - DoCast(me, SPELL_DIVINE_SHIELD); - DivineShield_Timer = 40000; - } - } else DivineShield_Timer -= diff; - - DoMeleeAttackIfReady(); - } - -}; -CreatureAI* GetAI_boss_silver_hand_bossesAI(Creature* pCreature) -{ - return new boss_silver_hand_bossesAI (pCreature); -} - -void AddSC_boss_order_of_silver_hand() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "boss_silver_hand_bosses"; - newscript->GetAI = &GetAI_boss_silver_hand_bossesAI; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/stratholme/boss_postmaster_malown.cpp b/src/server/scripts/EasternKingdoms/stratholme/boss_postmaster_malown.cpp deleted file mode 100644 index c04bae15468..00000000000 --- a/src/server/scripts/EasternKingdoms/stratholme/boss_postmaster_malown.cpp +++ /dev/null @@ -1,144 +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_postmaster_malown -SD%Complete: 50 -SDComment: -SDCategory: Stratholme -EndScriptData */ - -#include "ScriptedPch.h" - -//Spell ID to summon this guy is 24627 "Summon Postmaster Malown" -//He should be spawned along with three other elites once the third postbox has been opened - -#define SAY_MALOWNED "You just got MALOWNED!" - -#define SPELL_WAILINGDEAD 7713 -#define SPELL_BACKHAND 6253 -#define SPELL_CURSEOFWEAKNESS 8552 -#define SPELL_CURSEOFTONGUES 12889 -#define SPELL_CALLOFTHEGRAVE 17831 - -struct boss_postmaster_malownAI : public ScriptedAI -{ - boss_postmaster_malownAI(Creature *c) : ScriptedAI(c) {} - - uint32 WailingDead_Timer; - uint32 Backhand_Timer; - uint32 CurseOfWeakness_Timer; - uint32 CurseOfTongues_Timer; - uint32 CallOfTheGrave_Timer; - bool HasYelled; - - void Reset() - { - WailingDead_Timer = 19000; //lasts 6 sec - Backhand_Timer = 8000; //2 sec stun - CurseOfWeakness_Timer = 20000; //lasts 2 mins - CurseOfTongues_Timer = 22000; - CallOfTheGrave_Timer = 25000; - HasYelled = false; - } - - void EnterCombat(Unit * /*who*/) - { - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //WailingDead - if (WailingDead_Timer <= diff) - { - //Cast - if (rand()%100 < 65) //65% chance to cast - { - DoCast(me->getVictim(), SPELL_WAILINGDEAD); - } - //19 seconds until we should cast this again - WailingDead_Timer = 19000; - } else WailingDead_Timer -= diff; - - //Backhand - if (Backhand_Timer <= diff) - { - //Cast - if (rand()%100 < 45) //45% chance to cast - { - DoCast(me->getVictim(), SPELL_BACKHAND); - } - //8 seconds until we should cast this again - Backhand_Timer = 8000; - } else Backhand_Timer -= diff; - - //CurseOfWeakness - if (CurseOfWeakness_Timer <= diff) - { - //Cast - if (rand()%100 < 3) //3% chance to cast - { - DoCast(me->getVictim(), SPELL_CURSEOFWEAKNESS); - } - //20 seconds until we should cast this again - CurseOfWeakness_Timer = 20000; - } else CurseOfWeakness_Timer -= diff; - - //CurseOfTongues - if (CurseOfTongues_Timer <= diff) - { - //Cast - if (rand()%100 < 3) //3% chance to cast - { - DoCast(me->getVictim(), SPELL_CURSEOFTONGUES); - } - //22 seconds until we should cast this again - CurseOfTongues_Timer = 22000; - } else CurseOfTongues_Timer -= diff; - - //CallOfTheGrave - if (CallOfTheGrave_Timer <= diff) - { - //Cast - if (rand()%100 < 5) //5% chance to cast - { - DoCast(me->getVictim(), SPELL_CALLOFTHEGRAVE); - } - //25 seconds until we should cast this again - CallOfTheGrave_Timer = 25000; - } else CallOfTheGrave_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_postmaster_malown(Creature* pCreature) -{ - return new boss_postmaster_malownAI (pCreature); -} - -void AddSC_boss_postmaster_malown() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_postmaster_malown"; - newscript->GetAI = &GetAI_boss_postmaster_malown; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/stratholme/boss_ramstein_the_gorger.cpp b/src/server/scripts/EasternKingdoms/stratholme/boss_ramstein_the_gorger.cpp deleted file mode 100644 index 3a3ae60c9c9..00000000000 --- a/src/server/scripts/EasternKingdoms/stratholme/boss_ramstein_the_gorger.cpp +++ /dev/null @@ -1,102 +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_Ramstein_The_Gorger -SD%Complete: 70 -SDComment: -SDCategory: Stratholme -EndScriptData */ - -#include "ScriptedPch.h" -#include "stratholme.h" - -#define SPELL_TRAMPLE 5568 -#define SPELL_KNOCKOUT 17307 - - #define C_MINDLESS_UNDEAD 11030 - -struct boss_ramstein_the_gorgerAI : public ScriptedAI -{ - boss_ramstein_the_gorgerAI(Creature *c) : ScriptedAI(c) - { - pInstance = me->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint32 Trample_Timer; - uint32 Knockout_Timer; - - void Reset() - { - Trample_Timer = 3000; - Knockout_Timer = 12000; - } - - void EnterCombat(Unit * /*who*/) - { - } - - void JustDied(Unit* /*Killer*/) - { - for (uint8 i = 0; i < 30; ++i) - { - if (Creature* mob = me->SummonCreature(C_MINDLESS_UNDEAD,3969.35+irand(-10,10),-3391.87+irand(-10,10),119.11,5.91,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,1800000)) - mob->AI()->AttackStart(me->SelectNearestTarget(500)); - } - - if (pInstance) - pInstance->SetData(TYPE_RAMSTEIN,DONE); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //Trample - if (Trample_Timer <= diff) - { - DoCast(me, SPELL_TRAMPLE); - Trample_Timer = 7000; - } else Trample_Timer -= diff; - - //Knockout - if (Knockout_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_KNOCKOUT); - Knockout_Timer = 10000; - } else Knockout_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_ramstein_the_gorger(Creature* pCreature) -{ - return new boss_ramstein_the_gorgerAI (pCreature); -} - -void AddSC_boss_ramstein_the_gorger() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_ramstein_the_gorger"; - newscript->GetAI = &GetAI_boss_ramstein_the_gorger; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/stratholme/boss_timmy_the_cruel.cpp b/src/server/scripts/EasternKingdoms/stratholme/boss_timmy_the_cruel.cpp deleted file mode 100644 index f15eb59ba47..00000000000 --- a/src/server/scripts/EasternKingdoms/stratholme/boss_timmy_the_cruel.cpp +++ /dev/null @@ -1,83 +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_timmy_the_cruel -SD%Complete: 100 -SDComment: -SDCategory: Stratholme -EndScriptData */ - -#include "ScriptedPch.h" - -#define SAY_SPAWN "TIMMY!" - -#define SPELL_RAVENOUSCLAW 17470 - -struct boss_timmy_the_cruelAI : public ScriptedAI -{ - boss_timmy_the_cruelAI(Creature *c) : ScriptedAI(c) {} - - uint32 RavenousClaw_Timer; - bool HasYelled; - - void Reset() - { - RavenousClaw_Timer = 10000; - HasYelled = false; - } - - void EnterCombat(Unit * /*who*/) - { - if (!HasYelled) - { - me->MonsterYell(SAY_SPAWN,LANG_UNIVERSAL,NULL); - HasYelled = true; - } - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //RavenousClaw - if (RavenousClaw_Timer <= diff) - { - //Cast - DoCast(me->getVictim(), SPELL_RAVENOUSCLAW); - //15 seconds until we should cast this again - RavenousClaw_Timer = 15000; - } else RavenousClaw_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_timmy_the_cruel(Creature* pCreature) -{ - return new boss_timmy_the_cruelAI (pCreature); -} - -void AddSC_boss_timmy_the_cruel() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_timmy_the_cruel"; - newscript->GetAI = &GetAI_boss_timmy_the_cruel; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/stratholme/instance_stratholme.cpp b/src/server/scripts/EasternKingdoms/stratholme/instance_stratholme.cpp deleted file mode 100644 index ffeaa070a26..00000000000 --- a/src/server/scripts/EasternKingdoms/stratholme/instance_stratholme.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: instance_stratholme -SD%Complete: 50 -SDComment: In progress. Undead side 75% implemented. Save/load not implemented. -SDCategory: Stratholme -EndScriptData */ - -#include "ScriptedPch.h" -#include "stratholme.h" - -#define GO_SERVICE_ENTRANCE 175368 -#define GO_GAUNTLET_GATE1 175357 -#define GO_ZIGGURAT1 175380 //baroness -#define GO_ZIGGURAT2 175379 //nerub'enkan -#define GO_ZIGGURAT3 175381 //maleki -#define GO_ZIGGURAT4 175405 //rammstein -#define GO_ZIGGURAT5 175796 //baron -#define GO_PORT_GAUNTLET 175374 //port from gauntlet to slaugther -#define GO_PORT_SLAUGTHER 175373 //port at slaugther -#define GO_PORT_ELDERS 175377 //port at elders square - -#define C_CRYSTAL 10415 //three ziggurat crystals -#define C_BARON 10440 -#define C_YSIDA_TRIGGER 16100 - -#define C_RAMSTEIN 10439 -#define C_ABOM_BILE 10416 -#define C_ABOM_VENOM 10417 -#define C_BLACK_GUARD 10394 -#define C_YSIDA 16031 - -#define MAX_ENCOUNTER 6 - -struct instance_stratholme : public ScriptedInstance -{ - instance_stratholme(Map* pMap) : ScriptedInstance(pMap) {} - - uint32 Encounter[MAX_ENCOUNTER]; - - bool IsSilverHandDead[5]; - - uint32 BaronRun_Timer; - uint32 SlaugtherSquare_Timer; - - uint64 serviceEntranceGUID; - uint64 gauntletGate1GUID; - uint64 ziggurat1GUID; - uint64 ziggurat2GUID; - uint64 ziggurat3GUID; - uint64 ziggurat4GUID; - uint64 ziggurat5GUID; - uint64 portGauntletGUID; - uint64 portSlaugtherGUID; - uint64 portElderGUID; - - uint64 baronGUID; - uint64 ysidaTriggerGUID; - std::set crystalsGUID; - std::set abomnationGUID; - - void Initialize() - { - for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) - Encounter[i] = NOT_STARTED; - - for (uint8 i = 0; i < 5; ++i) - IsSilverHandDead[i] = false; - - BaronRun_Timer = 0; - SlaugtherSquare_Timer = 0; - - serviceEntranceGUID = 0; - gauntletGate1GUID = 0; - ziggurat1GUID = 0; - ziggurat2GUID = 0; - ziggurat3GUID = 0; - ziggurat4GUID = 0; - ziggurat5GUID = 0; - portGauntletGUID = 0; - portSlaugtherGUID = 0; - portElderGUID = 0; - - baronGUID = 0; - ysidaTriggerGUID = 0; - crystalsGUID.clear(); - abomnationGUID.clear(); - } - - bool StartSlaugtherSquare() - { - //change to DONE when crystals implemented - if (Encounter[1] == IN_PROGRESS && Encounter[2] == IN_PROGRESS && Encounter[3] == IN_PROGRESS) - { - HandleGameObject(portGauntletGUID, true); - HandleGameObject(portSlaugtherGUID, true); - return true; - } - - debug_log("TSCR: Instance Stratholme: Cannot open slaugther square yet."); - return false; - } - - //if withRestoreTime true, then newState will be ignored and GO should be restored to original state after 10 seconds - void UpdateGoState(uint64 goGuid, uint32 newState, bool withRestoreTime) - { - if (!goGuid) - return; - - if (GameObject* pGo = instance->GetGameObject(goGuid)) - { - if (withRestoreTime) - pGo->UseDoorOrButton(10); - else - pGo->SetGoState((GOState)newState); - } - } - - void OnCreatureCreate(Creature* pCreature, bool /*add*/) - { - switch(pCreature->GetEntry()) - { - case C_BARON: baronGUID = pCreature->GetGUID(); break; - case C_YSIDA_TRIGGER: ysidaTriggerGUID = pCreature->GetGUID(); break; - case C_CRYSTAL: crystalsGUID.insert(pCreature->GetGUID()); break; - case C_ABOM_BILE: - case C_ABOM_VENOM: abomnationGUID.insert(pCreature->GetGUID()); break; - } - } - - void OnGameObjectCreate(GameObject* pGo, bool /*add*/) - { - switch(pGo->GetEntry()) - { - case GO_SERVICE_ENTRANCE: - serviceEntranceGUID = pGo->GetGUID(); - break; - case GO_GAUNTLET_GATE1: - //weird, but unless flag is set, client will not respond as expected. DB bug? - pGo->SetFlag(GAMEOBJECT_FLAGS,GO_FLAG_LOCKED); - gauntletGate1GUID = pGo->GetGUID(); - break; - case GO_ZIGGURAT1: - ziggurat1GUID = pGo->GetGUID(); - if (GetData(TYPE_BARONESS) == IN_PROGRESS) - HandleGameObject(0, true, pGo); - break; - case GO_ZIGGURAT2: - ziggurat2GUID = pGo->GetGUID(); - if (GetData(TYPE_NERUB) == IN_PROGRESS) - HandleGameObject(0, true, pGo); - break; - case GO_ZIGGURAT3: - ziggurat3GUID = pGo->GetGUID(); - if (GetData(TYPE_PALLID) == IN_PROGRESS) - HandleGameObject(0, true, pGo); - break; - case GO_ZIGGURAT4: - ziggurat4GUID = pGo->GetGUID(); - if (GetData(TYPE_BARON) == DONE || GetData(TYPE_RAMSTEIN) == DONE) - HandleGameObject(0, true, pGo); - break; - case GO_ZIGGURAT5: - ziggurat5GUID = pGo->GetGUID(); - if (GetData(TYPE_BARON) == DONE || GetData(TYPE_RAMSTEIN) == DONE) - HandleGameObject(0, true, pGo); - break; - case GO_PORT_GAUNTLET: - portGauntletGUID = pGo->GetGUID(); - if (GetData(TYPE_BARONESS) == IN_PROGRESS && GetData(TYPE_NERUB) == IN_PROGRESS && GetData(TYPE_PALLID) == IN_PROGRESS) - HandleGameObject(0, true, pGo); - break; - case GO_PORT_SLAUGTHER: - portSlaugtherGUID = pGo->GetGUID(); - if (GetData(TYPE_BARONESS) == IN_PROGRESS && GetData(TYPE_NERUB) == IN_PROGRESS && GetData(TYPE_PALLID) == IN_PROGRESS) - HandleGameObject(0, true, pGo); - break; - case GO_PORT_ELDERS: - portElderGUID = pGo->GetGUID(); - break; - } - } - - void SetData(uint32 type, uint32 data) - { - switch(type) - { - case TYPE_BARON_RUN: - switch(data) - { - case IN_PROGRESS: - if (Encounter[0] == IN_PROGRESS || Encounter[0] == FAIL) - break; - Encounter[0] = data; - BaronRun_Timer = 2700000; - debug_log("TSCR: Instance Stratholme: Baron run in progress."); - break; - case FAIL: - //may add code to remove aura from players, but in theory the time should be up already and removed. - Encounter[0] = data; - break; - case DONE: - Encounter[0] = data; - if (Creature* pYsidaT = instance->GetCreature(ysidaTriggerGUID)) - pYsidaT->SummonCreature(C_YSIDA, - pYsidaT->GetPositionX(),pYsidaT->GetPositionY(),pYsidaT->GetPositionZ(),pYsidaT->GetOrientation(), - TEMPSUMMON_TIMED_DESPAWN,1800000); - BaronRun_Timer = 0; - break; - } - break; - case TYPE_BARONESS: - Encounter[1] = data; - if (data == IN_PROGRESS) - HandleGameObject(ziggurat1GUID, true); - if (data == IN_PROGRESS) //change to DONE when crystals implemented - StartSlaugtherSquare(); - break; - case TYPE_NERUB: - Encounter[2] = data; - if (data == IN_PROGRESS) - HandleGameObject(ziggurat2GUID, true); - if (data == IN_PROGRESS) //change to DONE when crystals implemented - StartSlaugtherSquare(); - break; - case TYPE_PALLID: - Encounter[3] = data; - if (data == IN_PROGRESS) - HandleGameObject(ziggurat3GUID, true); - if (data == IN_PROGRESS) //change to DONE when crystals implemented - StartSlaugtherSquare(); - break; - case TYPE_RAMSTEIN: - if (data == IN_PROGRESS) - { - HandleGameObject(portGauntletGUID, false); - - uint32 count = abomnationGUID.size(); - for (std::set::const_iterator i = abomnationGUID.begin(); i != abomnationGUID.end(); ++i) - { - if (Creature* pAbom = instance->GetCreature(*i)) - { - if (!pAbom->isAlive()) - --count; - } - } - - if (!count) - { - //a bit itchy, it should close the door after 10 secs, but it doesn't. skipping it for now. - //UpdateGoState(ziggurat4GUID,0,true); - if (Creature* pBaron = instance->GetCreature(baronGUID)) - pBaron->SummonCreature(C_RAMSTEIN,4032.84,-3390.24,119.73,4.71,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,1800000); - debug_log("TSCR: Instance Stratholme: Ramstein spawned."); - } - else - debug_log("TSCR: Instance Stratholme: %u Abomnation left to kill.",count); - } - - if (data == NOT_STARTED) - HandleGameObject(portGauntletGUID, true); - - if (data == DONE) - { - SlaugtherSquare_Timer = 300000; - debug_log("TSCR: Instance Stratholme: Slaugther event will continue in 5 minutes."); - } - Encounter[4] = data; - break; - case TYPE_BARON: - if (data == IN_PROGRESS) - { - HandleGameObject(ziggurat4GUID, false); - HandleGameObject(ziggurat5GUID, false); - if (GetData(TYPE_BARON_RUN) == IN_PROGRESS) - { - Map::PlayerList const& players = instance->GetPlayers(); - - if (!players.isEmpty()) - { - for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) - { - if (Player* pPlayer = itr->getSource()) - { - if (pPlayer->HasAura(SPELL_BARON_ULTIMATUM)) - pPlayer->RemoveAurasDueToSpell(SPELL_BARON_ULTIMATUM); - - if (pPlayer->GetQuestStatus(QUEST_DEAD_MAN_PLEA) == QUEST_STATUS_INCOMPLETE) - pPlayer->AreaExploredOrEventHappens(QUEST_DEAD_MAN_PLEA); - } - } - } - - SetData(TYPE_BARON_RUN,DONE); - } - } - if (data == DONE || data == NOT_STARTED) - { - HandleGameObject(ziggurat4GUID, true); - HandleGameObject(ziggurat5GUID, true); - } - if (data == DONE) - HandleGameObject(portGauntletGUID, true); - Encounter[5] = data; - break; - case TYPE_SH_AELMAR: - IsSilverHandDead[0] = (data) ? true : false; - break; - case TYPE_SH_CATHELA: - IsSilverHandDead[1] = (data) ? true : false; - break; - case TYPE_SH_GREGOR: - IsSilverHandDead[2] = (data) ? true : false; - break; - case TYPE_SH_NEMAS: - IsSilverHandDead[3] = (data) ? true : false; - break; - case TYPE_SH_VICAR: - IsSilverHandDead[4] = (data) ? true : false; - break; - } - if (data == DONE)SaveToDB(); - } - - std::string GetSaveData() - { - OUT_SAVE_INST_DATA; - - std::ostringstream saveStream; - saveStream << Encounter[0] << " " << Encounter[1] << " " << Encounter[2] << " " - << Encounter[3] << " " << Encounter[4] << " " << Encounter[5]; - - OUT_SAVE_INST_DATA_COMPLETE; - return saveStream.str(); - } - - void Load(const char* in) - { - if (!in) - { - OUT_LOAD_INST_DATA_FAIL; - return; - } - - OUT_LOAD_INST_DATA(in); - - std::istringstream loadStream(in); - loadStream >> Encounter[0] >> Encounter[1] >> Encounter[2] >> Encounter[3] - >> Encounter[4] >> Encounter[5]; - - // Do not reset 1, 2 and 3. they are not set to done, yet . - if (Encounter[0] == IN_PROGRESS) - Encounter[0] = NOT_STARTED; - if (Encounter[4] == IN_PROGRESS) - Encounter[4] = NOT_STARTED; - if (Encounter[5] == IN_PROGRESS) - Encounter[5] = NOT_STARTED; - - OUT_LOAD_INST_DATA_COMPLETE; - } - - uint32 GetData(uint32 type) - { - switch(type) - { - case TYPE_SH_QUEST: - if (IsSilverHandDead[0] && IsSilverHandDead[1] && IsSilverHandDead[2] && IsSilverHandDead[3] && IsSilverHandDead[4]) - return 1; - return 0; - case TYPE_BARON_RUN: - return Encounter[0]; - case TYPE_BARONESS: - return Encounter[1]; - case TYPE_NERUB: - return Encounter[2]; - case TYPE_PALLID: - return Encounter[3]; - case TYPE_RAMSTEIN: - return Encounter[4]; - case TYPE_BARON: - return Encounter[5]; - } - return 0; - } - - uint64 GetData64(uint32 data) - { - switch(data) - { - case DATA_BARON: - return baronGUID; - case DATA_YSIDA_TRIGGER: - return ysidaTriggerGUID; - } - return 0; - } - - void Update(uint32 diff) - { - if (BaronRun_Timer) - { - if (BaronRun_Timer <= diff) - { - if (GetData(TYPE_BARON_RUN) != DONE) - SetData(TYPE_BARON_RUN, FAIL); - BaronRun_Timer = 0; - debug_log("TSCR: Instance Stratholme: Baron run event reached end. Event has state %u.",GetData(TYPE_BARON_RUN)); - } else BaronRun_Timer -= diff; - } - - if (SlaugtherSquare_Timer) - { - if (SlaugtherSquare_Timer <= diff) - { - if (Creature* pBaron = instance->GetCreature(baronGUID)) - { - for (uint8 i = 0; i < 4; ++i) - pBaron->SummonCreature(C_BLACK_GUARD,4032.84,-3390.24,119.73,4.71,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,1800000); - - HandleGameObject(ziggurat4GUID, true); - HandleGameObject(ziggurat5GUID, true); - debug_log("TSCR: Instance Stratholme: Black guard sentries spawned. Opening gates to baron."); - } - SlaugtherSquare_Timer = 0; - } else SlaugtherSquare_Timer -= diff; - } - } -}; - -InstanceData* GetInstanceData_instance_stratholme(Map* pMap) -{ - return new instance_stratholme(pMap); -} - -void AddSC_instance_stratholme() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_stratholme"; - newscript->GetInstanceData = &GetInstanceData_instance_stratholme; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/stratholme/stratholme.cpp b/src/server/scripts/EasternKingdoms/stratholme/stratholme.cpp deleted file mode 100644 index 035fca68b95..00000000000 --- a/src/server/scripts/EasternKingdoms/stratholme/stratholme.cpp +++ /dev/null @@ -1,282 +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: Stratholme -SD%Complete: 100 -SDComment: Misc mobs for instance. pGo-script to apply aura and start event for quest 8945 -SDCategory: Stratholme -EndScriptData */ - -/* ContentData -go_gauntlet_gate -mob_freed_soul -mob_restless_soul -mobs_spectral_ghostly_citizen -EndContentData */ - -#include "ScriptedPch.h" -#include "stratholme.h" - -/*###### -## go_gauntlet_gate (this is the _first_ of the gauntlet gates, two exist) -######*/ - -bool GOHello_go_gauntlet_gate(Player* pPlayer, GameObject* pGo) -{ - ScriptedInstance* pInstance = pGo->GetInstanceData(); - - if (!pInstance) - return false; - - if (pInstance->GetData(TYPE_BARON_RUN) != NOT_STARTED) - return false; - - if (Group *pGroup = pPlayer->GetGroup()) - { - for (GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next()) - { - Player* pGroupie = itr->getSource(); - if (!pGroupie) - continue; - - if (pGroupie->GetQuestStatus(QUEST_DEAD_MAN_PLEA) == QUEST_STATUS_INCOMPLETE && - !pGroupie->HasAura(SPELL_BARON_ULTIMATUM) && - pGroupie->GetMap() == pGo->GetMap()) - pGroupie->CastSpell(pGroupie,SPELL_BARON_ULTIMATUM,true); - } - } else if (pPlayer->GetQuestStatus(QUEST_DEAD_MAN_PLEA) == QUEST_STATUS_INCOMPLETE && - !pPlayer->HasAura(SPELL_BARON_ULTIMATUM) && - pPlayer->GetMap() == pGo->GetMap()) - pPlayer->CastSpell(pPlayer,SPELL_BARON_ULTIMATUM,true); - - pInstance->SetData(TYPE_BARON_RUN,IN_PROGRESS); - return false; -} - -/*###### -## mob_freed_soul -######*/ - -//Possibly more of these quotes around. -#define SAY_ZAPPED0 -1329000 -#define SAY_ZAPPED1 -1329001 -#define SAY_ZAPPED2 -1329002 -#define SAY_ZAPPED3 -1329003 - -struct mob_freed_soulAI : public ScriptedAI -{ - mob_freed_soulAI(Creature *c) : ScriptedAI(c) {} - - void Reset() - { - DoScriptText(RAND(SAY_ZAPPED0,SAY_ZAPPED1,SAY_ZAPPED2,SAY_ZAPPED3), me); - } - - void EnterCombat(Unit* /*who*/) {} -}; - -CreatureAI* GetAI_mob_freed_soul(Creature* pCreature) -{ - return new mob_freed_soulAI (pCreature); -} - -/*###### -## mob_restless_soul -######*/ - -#define SPELL_EGAN_BLASTER 17368 -#define SPELL_SOUL_FREED 17370 -#define QUEST_RESTLESS_SOUL 5282 -#define ENTRY_RESTLESS 11122 -#define ENTRY_FREED 11136 - -struct mob_restless_soulAI : public ScriptedAI -{ - mob_restless_soulAI(Creature *c) : ScriptedAI(c) {} - - uint64 Tagger; - uint32 Die_Timer; - bool Tagged; - - void Reset() - { - Tagger = 0; - Die_Timer = 5000; - Tagged = false; - } - - void EnterCombat(Unit* /*who*/) {} - - void SpellHit(Unit *caster, const SpellEntry *spell) - { - if (caster->GetTypeId() == TYPEID_PLAYER) - { - if (!Tagged && spell->Id == SPELL_EGAN_BLASTER && CAST_PLR(caster)->GetQuestStatus(QUEST_RESTLESS_SOUL) == QUEST_STATUS_INCOMPLETE) - { - Tagged = true; - Tagger = caster->GetGUID(); - } - } - } - - void JustSummoned(Creature *summoned) - { - summoned->CastSpell(summoned,SPELL_SOUL_FREED,false); - } - - void JustDied(Unit* /*Killer*/) - { - if (Tagged) - me->SummonCreature(ENTRY_FREED, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN, 300000); - } - - void UpdateAI(const uint32 diff) - { - if (Tagged) - { - if (Die_Timer <= diff) - { - if (Unit* pTemp = Unit::GetUnit(*me,Tagger)) - { - CAST_PLR(pTemp)->KilledMonsterCredit(ENTRY_RESTLESS, me->GetGUID()); - me->Kill(me); - } - } else Die_Timer -= diff; - } - } -}; - -CreatureAI* GetAI_mob_restless_soul(Creature* pCreature) -{ - return new mob_restless_soulAI (pCreature); -} - -/*###### -## mobs_spectral_ghostly_citizen -######*/ - -enum eGhostlyCitizenSpells -{ - SPELL_HAUNTING_PHANTOM = 16336, - SPELL_SLAP = 6754 -}; - -struct mobs_spectral_ghostly_citizenAI : public ScriptedAI -{ - mobs_spectral_ghostly_citizenAI(Creature *c) : ScriptedAI(c) {} - - uint32 Die_Timer; - bool Tagged; - - void Reset() - { - Die_Timer = 5000; - Tagged = false; - } - - void EnterCombat(Unit* /*who*/) {} - - void SpellHit(Unit * /*caster*/, const SpellEntry *spell) - { - if (!Tagged && spell->Id == SPELL_EGAN_BLASTER) - Tagged = true; - } - - void JustDied(Unit* /*Killer*/) - { - if (Tagged) - { - for (uint32 i = 1; i <= 4; ++i) - { - //100%, 50%, 33%, 25% chance to spawn - if (urand(1,i) == 1) - DoSummon(ENTRY_RESTLESS, me, 20.0f, 600000); - } - } - } - - void UpdateAI(const uint32 diff) - { - if (Tagged) - { - if (Die_Timer <= diff) - me->Kill(me); - else Die_Timer -= diff; - } - - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - - void ReceiveEmote(Player* pPlayer, uint32 emote) - { - switch(emote) - { - case TEXTEMOTE_DANCE: - EnterEvadeMode(); - break; - case TEXTEMOTE_RUDE: - if (me->IsWithinDistInMap(pPlayer, 5)) - DoCast(pPlayer, SPELL_SLAP, false); - else - me->HandleEmoteCommand(EMOTE_ONESHOT_RUDE); - break; - case TEXTEMOTE_WAVE: - me->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); - break; - case TEXTEMOTE_BOW: - me->HandleEmoteCommand(EMOTE_ONESHOT_BOW); - break; - case TEXTEMOTE_KISS: - me->HandleEmoteCommand(EMOTE_ONESHOT_FLEX); - break; - } - } -}; - -CreatureAI* GetAI_mobs_spectral_ghostly_citizen(Creature* pCreature) -{ - return new mobs_spectral_ghostly_citizenAI (pCreature); -} - -void AddSC_stratholme() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "go_gauntlet_gate"; - newscript->pGOHello = &GOHello_go_gauntlet_gate; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_freed_soul"; - newscript->GetAI = &GetAI_mob_freed_soul; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_restless_soul"; - newscript->GetAI = &GetAI_mob_restless_soul; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mobs_spectral_ghostly_citizen"; - newscript->GetAI = &GetAI_mobs_spectral_ghostly_citizen; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/stratholme/stratholme.h b/src/server/scripts/EasternKingdoms/stratholme/stratholme.h deleted file mode 100644 index b9246091a7c..00000000000 --- a/src/server/scripts/EasternKingdoms/stratholme/stratholme.h +++ /dev/null @@ -1,28 +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_STRATHOLME_H -#define DEF_STRATHOLME_H - -#define TYPE_BARON_RUN 1 -#define TYPE_BARONESS 2 -#define TYPE_NERUB 3 -#define TYPE_PALLID 4 -#define TYPE_RAMSTEIN 5 -#define TYPE_BARON 6 - -#define DATA_BARON 10 -#define DATA_YSIDA_TRIGGER 11 - -#define TYPE_SH_QUEST 20 -#define TYPE_SH_CATHELA 21 -#define TYPE_SH_GREGOR 22 -#define TYPE_SH_NEMAS 23 -#define TYPE_SH_VICAR 24 -#define TYPE_SH_AELMAR 25 - -#define QUEST_DEAD_MAN_PLEA 8945 -#define SPELL_BARON_ULTIMATUM 27861 -#endif - diff --git a/src/server/scripts/EasternKingdoms/sunken_temple/instance_sunken_temple.cpp b/src/server/scripts/EasternKingdoms/sunken_temple/instance_sunken_temple.cpp deleted file mode 100644 index 6fe65cf963d..00000000000 --- a/src/server/scripts/EasternKingdoms/sunken_temple/instance_sunken_temple.cpp +++ /dev/null @@ -1,204 +0,0 @@ -/* Copyright (C) 2006 - 2009 kb_z - * 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_Sunken_Temple -SD%Complete: 100 -SDComment:Place Holder -SDCategory: Sunken Temple -EndScriptData */ - -#include "ScriptedPch.h" -#include "sunken_temple.h" - -#define GO_ATALAI_STATUE1 148830 -#define GO_ATALAI_STATUE2 148831 -#define GO_ATALAI_STATUE3 148832 -#define GO_ATALAI_STATUE4 148833 -#define GO_ATALAI_STATUE5 148834 -#define GO_ATALAI_STATUE6 148835 -#define GO_ATALAI_IDOL 148836 - -#define GO_ATALAI_LIGHT1 148883 -#define GO_ATALAI_LIGHT2 148937 - -#define NPC_MALFURION_STORMRAGE 15362 - -struct instance_sunken_temple : public ScriptedInstance -{ - instance_sunken_temple(Map* pMap) : ScriptedInstance(pMap) - { - Initialize(); - }; - - uint64 GOAtalaiStatue1; - uint64 GOAtalaiStatue2; - uint64 GOAtalaiStatue3; - uint64 GOAtalaiStatue4; - uint64 GOAtalaiStatue5; - uint64 GOAtalaiStatue6; - uint64 GOAtalaiIdol; - - uint32 State; - - bool s1; - bool s2; - bool s3; - bool s4; - bool s5; - bool s6; - - void Initialize() - { - GOAtalaiStatue1 = 0; - GOAtalaiStatue2 = 0; - GOAtalaiStatue3 = 0; - GOAtalaiStatue4 = 0; - GOAtalaiStatue5 = 0; - GOAtalaiStatue6 = 0; - GOAtalaiIdol = 0; - - State = 0; - - s1 = false; - s2 = false; - s3 = false; - s4 = false; - s5 = false; - s6 = false; - } - - void OnGameObjectCreate(GameObject* pGo, bool /*add*/) - { - switch(pGo->GetEntry()) - { - case GO_ATALAI_STATUE1: GOAtalaiStatue1 = pGo->GetGUID(); break; - case GO_ATALAI_STATUE2: GOAtalaiStatue2 = pGo->GetGUID(); break; - case GO_ATALAI_STATUE3: GOAtalaiStatue3 = pGo->GetGUID(); break; - case GO_ATALAI_STATUE4: GOAtalaiStatue4 = pGo->GetGUID(); break; - case GO_ATALAI_STATUE5: GOAtalaiStatue5 = pGo->GetGUID(); break; - case GO_ATALAI_STATUE6: GOAtalaiStatue6 = pGo->GetGUID(); break; - case GO_ATALAI_IDOL: GOAtalaiIdol = pGo->GetGUID(); break; - } - } - - virtual void Update(uint32 /*diff*/) // correct order goes form 1-6 - { - switch(State) - { - case GO_ATALAI_STATUE1: - if (!s1 && !s2 && !s3 && !s4 && !s5 && !s6) - { - if (GameObject *pAtalaiStatue1 = instance->GetGameObject(GOAtalaiStatue1)) - UseStatue(pAtalaiStatue1); - s1 = true; - State = 0; - }; - break; - case GO_ATALAI_STATUE2: - if (s1 && !s2 && !s3 && !s4 && !s5 && !s6) - { - if (GameObject *pAtalaiStatue2 = instance->GetGameObject(GOAtalaiStatue2)) - UseStatue(pAtalaiStatue2); - s2 = true; - State = 0; - }; - break; - case GO_ATALAI_STATUE3: - if (s1 && s2 && !s3 && !s4 && !s5 && !s6) - { - if (GameObject *pAtalaiStatue3 = instance->GetGameObject(GOAtalaiStatue3)) - UseStatue(pAtalaiStatue3); - s3 = true; - State = 0; - }; - break; - case GO_ATALAI_STATUE4: - if (s1 && s2 && s3 && !s4 && !s5 && !s6) - { - if (GameObject *pAtalaiStatue4 = instance->GetGameObject(GOAtalaiStatue4)) - UseStatue(pAtalaiStatue4); - s4 = true; - State = 0; - } - break; - case GO_ATALAI_STATUE5: - if (s1 && s2 && s3 && s4 && !s5 && !s6) - { - if (GameObject *pAtalaiStatue5 = instance->GetGameObject(GOAtalaiStatue5)) - UseStatue(pAtalaiStatue5); - s5 = true; - State = 0; - } - break; - case GO_ATALAI_STATUE6: - if (s1 && s2 && s3 && s4 && s5 && !s6) - { - if (GameObject *pAtalaiStatue6 = instance->GetGameObject(GOAtalaiStatue6)) - UseStatue(pAtalaiStatue6); - s6 = true; - State = 0; - } - break; - } - }; - - void UseStatue(GameObject* pGo) - { - pGo->SummonGameObject(GO_ATALAI_LIGHT1,pGo->GetPositionX(),pGo->GetPositionY(),pGo->GetPositionZ(),0,0,0,0,0,0); - pGo->SetUInt32Value(GAMEOBJECT_FLAGS, 4); - } - - /* - void UseLastStatue(GameObject* pGo) - { - AtalaiStatue1->SummonGameObject(GO_ATALAI_LIGHT2,AtalaiStatue1->GetPositionX(),AtalaiStatue1->GetPositionY(),AtalaiStatue1->GetPositionZ(),0,0,0,0,0,100000); - AtalaiStatue2->SummonGameObject(GO_ATALAI_LIGHT2,AtalaiStatue2->GetPositionX(),AtalaiStatue2->GetPositionY(),AtalaiStatue2->GetPositionZ(),0,0,0,0,0,100000); - AtalaiStatue3->SummonGameObject(GO_ATALAI_LIGHT2,AtalaiStatue3->GetPositionX(),AtalaiStatue3->GetPositionY(),AtalaiStatue3->GetPositionZ(),0,0,0,0,0,100000); - AtalaiStatue4->SummonGameObject(GO_ATALAI_LIGHT2,AtalaiStatue4->GetPositionX(),AtalaiStatue4->GetPositionY(),AtalaiStatue4->GetPositionZ(),0,0,0,0,0,100000); - AtalaiStatue5->SummonGameObject(GO_ATALAI_LIGHT2,AtalaiStatue5->GetPositionX(),AtalaiStatue5->GetPositionY(),AtalaiStatue5->GetPositionZ(),0,0,0,0,0,100000); - AtalaiStatue6->SummonGameObject(GO_ATALAI_LIGHT2,AtalaiStatue6->GetPositionX(),AtalaiStatue6->GetPositionY(),AtalaiStatue6->GetPositionZ(),0,0,0,0,0,100000); - pGo->SummonGameObject(148838,-488.997,96.61,-189.019,-1.52,0,0,0,0,100000); - } - */ - - void SetData(uint32 type, uint32 data) - { - if (type == EVENT_STATE) - State = data; - } - - uint32 GetData(uint32 type) - { - if (type == EVENT_STATE) - return State; - return 0; - } -}; - -InstanceData* GetInstanceData_instance_sunken_temple(Map* pMap) -{ - return new instance_sunken_temple(pMap); -} - -void AddSC_instance_sunken_temple() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_sunken_temple"; - newscript->GetInstanceData = &GetInstanceData_instance_sunken_temple; - newscript->RegisterSelf(); -} diff --git a/src/server/scripts/EasternKingdoms/sunken_temple/sunken_temple.cpp b/src/server/scripts/EasternKingdoms/sunken_temple/sunken_temple.cpp deleted file mode 100644 index 7f0ca126d78..00000000000 --- a/src/server/scripts/EasternKingdoms/sunken_temple/sunken_temple.cpp +++ /dev/null @@ -1,71 +0,0 @@ -/* Copyright (C) 2006 - 2009 kb_z - * 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: Sunken_Temple -SD%Complete: 100 -SDComment: Area Trigger + Puzzle event support -SDCategory: Sunken Temple -EndScriptData */ - -/* ContentData -at_malfurion_Stormrage_trigger -EndContentData */ - -#include "ScriptedPch.h" -#include "sunken_temple.h" - -/*##### -# at_malfurion_Stormrage_trigger -#####*/ - -bool AreaTrigger_at_malfurion_stormrage(Player* pPlayer, const AreaTriggerEntry * /*at*/) -{ - if (ScriptedInstance* pInstance = pPlayer->GetInstanceData()) - { - if (!pPlayer->FindNearestCreature(15362,15)) - pPlayer->SummonCreature(15362, pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), -1.52, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 100000); - return false; - } -return false; -} -/*##### -# go_atalai_statue -#####*/ - -bool GOHello_go_atalai_statue(Player* pPlayer, GameObject* pGo) -{ - ScriptedInstance* pInstance = pPlayer->GetInstanceData(); - if (!pInstance) - return false; - pInstance->SetData(EVENT_STATE,pGo->GetEntry()); - return false; -} - -void AddSC_sunken_temple() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "at_malfurion_stormrage"; - newscript->pAreaTrigger = &AreaTrigger_at_malfurion_stormrage; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "go_atalai_statue"; - newscript->pGOHello = &GOHello_go_atalai_statue; - newscript->RegisterSelf(); -} diff --git a/src/server/scripts/EasternKingdoms/sunken_temple/sunken_temple.h b/src/server/scripts/EasternKingdoms/sunken_temple/sunken_temple.h deleted file mode 100644 index 82245095c31..00000000000 --- a/src/server/scripts/EasternKingdoms/sunken_temple/sunken_temple.h +++ /dev/null @@ -1,22 +0,0 @@ -/* Copyright (C) 2006 - 2009 kb_z - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ - -#ifndef DEF_SUNKEN_TEMPLE_H -#define DEF_SUNKEN_TEMPLE_H - -#define TROLLBOSS1_DEATH 1 -#define TROLLBOSS2_DEATH 2 -#define TROLLBOSS3_DEATH 3 -#define TROLLBOSS4_DEATH 4 -#define TROLLBOSS5_DEATH 5 -#define TROLLBOSS6_DEATH 6 -#define JAMMALAN_DEATH 7 -#define MORPHAZ_DEATH 8 -#define HAZZAS_DEATH 9 -#define ERANIKUS_DEATH 10 -#define ATALALARION_DEATH 11 //optional - -#define EVENT_STATE 1 -#endif - diff --git a/src/server/scripts/EasternKingdoms/sunwell_plateau/boss_brutallus.cpp b/src/server/scripts/EasternKingdoms/sunwell_plateau/boss_brutallus.cpp deleted file mode 100644 index 59e58d6df1a..00000000000 --- a/src/server/scripts/EasternKingdoms/sunwell_plateau/boss_brutallus.cpp +++ /dev/null @@ -1,349 +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_Brutallus -SD%Complete: 80 -SDComment: Find a way to start the intro, best code for the intro -EndScriptData */ - -#include "ScriptedPch.h" -#include "sunwell_plateau.h" - -enum Quotes -{ - YELL_INTRO = -1580017, - YELL_INTRO_BREAK_ICE = -1580018, - YELL_INTRO_CHARGE = -1580019, - YELL_INTRO_KILL_MADRIGOSA = -1580020, - YELL_INTRO_TAUNT = -1580021, - - YELL_MADR_ICE_BARRIER = -1580031, - YELL_MADR_INTRO = -1580032, - YELL_MADR_ICE_BLOCK = -1580033, - YELL_MADR_TRAP = -1580034, - YELL_MADR_DEATH = -1580035, - - YELL_AGGRO = -1580022, - YELL_KILL1 = -1580023, - YELL_KILL2 = -1580024, - YELL_KILL3 = -1580025, - YELL_LOVE1 = -1580026, - YELL_LOVE2 = -1580027, - YELL_LOVE3 = -1580028, - YELL_BERSERK = -1580029, - YELL_DEATH = -1580030 -}; - -enum Spells -{ - SPELL_METEOR_SLASH = 45150, - SPELL_BURN = 46394, - SPELL_STOMP = 45185, - SPELL_BERSERK = 26662, - SPELL_DUAL_WIELD = 42459, - - SPELL_INTRO_FROST_BLAST = 45203, - SPELL_INTRO_FROSTBOLT = 44843, - SPELL_INTRO_ENCAPSULATE = 45665, - SPELL_INTRO_ENCAPSULATE_CHANELLING = 45661 -}; - -#define FELMYST 25038 - -struct boss_brutallusAI : public ScriptedAI -{ - boss_brutallusAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - Intro = true; - } - - ScriptedInstance* pInstance; - - uint32 SlashTimer; - uint32 BurnTimer; - uint32 StompTimer; - uint32 BerserkTimer; - - uint32 IntroPhase; - uint32 IntroPhaseTimer; - uint32 IntroFrostBoltTimer; - - bool Intro; - bool IsIntro; - bool Enraged; - - void Reset() - { - SlashTimer = 11000; - StompTimer = 30000; - BurnTimer = 60000; - BerserkTimer = 360000; - - IntroPhase = 0; - IntroPhaseTimer = 0; - IntroFrostBoltTimer = 0; - - IsIntro = false; - Enraged = false; - - DoCast(me, SPELL_DUAL_WIELD, true); - - if (pInstance) - pInstance->SetData(DATA_BRUTALLUS_EVENT, NOT_STARTED); - } - - void EnterCombat(Unit * /*who*/) - { - DoScriptText(YELL_AGGRO, me); - - if (pInstance) - pInstance->SetData(DATA_BRUTALLUS_EVENT, IN_PROGRESS); - } - - void KilledUnit(Unit* /*victim*/) - { - DoScriptText(RAND(YELL_KILL1,YELL_KILL2,YELL_KILL3), me); - } - - void JustDied(Unit* /*Killer*/) - { - DoScriptText(YELL_DEATH, me); - - if (pInstance) - { - pInstance->SetData(DATA_BRUTALLUS_EVENT, DONE); - float x,y,z; - me->GetPosition(x,y,z); - me->SummonCreature(FELMYST, x,y, z+30, me->GetOrientation(), TEMPSUMMON_MANUAL_DESPAWN, 0); - } - } - - void EnterEvadeMode() - { - if (!Intro) - ScriptedAI::EnterEvadeMode(); - } - - void StartIntro() - { - if (!Intro || IsIntro) - return; - error_log("Start Intro"); - Creature *Madrigosa = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_MADRIGOSA) : 0); - if (Madrigosa) - { - Madrigosa->Respawn(); - Madrigosa->setActive(true); - IsIntro = true; - Madrigosa->SetMaxHealth(me->GetMaxHealth()); - Madrigosa->SetHealth(me->GetMaxHealth()); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->Attack(Madrigosa, true); - Madrigosa->Attack(me, true); - }else - { - //Madrigosa not found, end intro - error_log("Madrigosa was not found"); - EndIntro(); - } - } - - void EndIntro() - { - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - Intro = false; - IsIntro = false; - error_log("End Intro"); - } - - void AttackStart(Unit* pWho) - { - if (!pWho || Intro || IsIntro) - return; - ScriptedAI::AttackStart(pWho); - } - - void DoIntro() - { - Creature *Madrigosa = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_MADRIGOSA) : 0); - if (!Madrigosa) - return; - - switch (IntroPhase) - { - case 0: - DoScriptText(YELL_MADR_ICE_BARRIER, Madrigosa); - IntroPhaseTimer = 7000; - ++IntroPhase; - break; - case 1: - me->SetInFront(Madrigosa); - Madrigosa->SetInFront(me); - DoScriptText(YELL_MADR_INTRO, Madrigosa, me); - IntroPhaseTimer = 9000; - ++IntroPhase; - break; - case 2: - DoScriptText(YELL_INTRO, me, Madrigosa); - IntroPhaseTimer = 13000; - ++IntroPhase; - break; - case 3: - DoCast(me, SPELL_INTRO_FROST_BLAST); - Madrigosa->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - me->AttackStop(); - Madrigosa->AttackStop(); - IntroFrostBoltTimer = 3000; - IntroPhaseTimer = 28000; - ++IntroPhase; - break; - case 4: - DoScriptText(YELL_INTRO_BREAK_ICE, me); - IntroPhaseTimer = 6000; - ++IntroPhase; - break; - case 5: - Madrigosa->CastSpell(me, SPELL_INTRO_ENCAPSULATE_CHANELLING, false); - DoScriptText(YELL_MADR_TRAP, Madrigosa); - DoCast(me, SPELL_INTRO_ENCAPSULATE); - IntroPhaseTimer = 11000; - ++IntroPhase; - break; - case 6: - DoScriptText(YELL_INTRO_CHARGE, me); - IntroPhaseTimer = 5000; - ++IntroPhase; - break; - case 7: - me->Kill(Madrigosa); - DoScriptText(YELL_MADR_DEATH, Madrigosa); - me->SetHealth(me->GetMaxHealth()); - me->AttackStop(); - IntroPhaseTimer = 4000; - ++IntroPhase; - break; - case 8: - DoScriptText(YELL_INTRO_KILL_MADRIGOSA, me); - me->SetOrientation(0.14f); - me->StopMoving(); - Madrigosa->setDeathState(CORPSE); - IntroPhaseTimer = 8000; - ++IntroPhase; - break; - case 9: - DoScriptText(YELL_INTRO_TAUNT, me); - IntroPhaseTimer = 5000; - ++IntroPhase; - break; - case 10: - EndIntro(); - break; - } - } - - void MoveInLineOfSight(Unit *who) - { - if (!who->isTargetableForAttack() || !me->IsHostileTo(who)) - return; - if (pInstance && Intro) - pInstance->SetData(DATA_BRUTALLUS_EVENT, SPECIAL); - - if (Intro && !IsIntro) - StartIntro(); - if (!Intro) - ScriptedAI::MoveInLineOfSight(who); - } - - void UpdateAI(const uint32 diff) - { - if (IsIntro) - { - if (IntroPhaseTimer <= diff) - DoIntro(); - else IntroPhaseTimer -= diff; - - if (IntroPhase == 3 + 1) - { - if (IntroFrostBoltTimer <= diff) - { - if (Creature *Madrigosa = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_MADRIGOSA) : 0)) - { - Madrigosa->CastSpell(me, SPELL_INTRO_FROSTBOLT, true); - IntroFrostBoltTimer = 2000; - } - } else IntroFrostBoltTimer -= diff; - } - if (!UpdateVictim()) - return; - DoMeleeAttackIfReady(); - } - - if (!UpdateVictim() || IsIntro) - return; - - if (SlashTimer <= diff) - { - DoCast(me->getVictim(), SPELL_METEOR_SLASH); - SlashTimer = 11000; - } else SlashTimer -= diff; - - if (StompTimer <= diff) - { - DoScriptText(RAND(YELL_LOVE1,YELL_LOVE2,YELL_LOVE3), me); - DoCast(me->getVictim(), SPELL_STOMP); - StompTimer = 30000; - } else StompTimer -= diff; - - if (BurnTimer <= diff) - { - std::list pTargets; - SelectTargetList(pTargets, 10, SELECT_TARGET_RANDOM, 100, true); - for (std::list::const_iterator i = pTargets.begin(); i != pTargets.end(); ++i) - if (!(*i)->HasAura(SPELL_BURN)) - { - (*i)->CastSpell((*i), SPELL_BURN, true); - break; - } - BurnTimer = urand(60000,180000); - } else BurnTimer -= diff; - - if (BerserkTimer < diff && !Enraged) - { - DoScriptText(YELL_BERSERK, me); - DoCast(me, SPELL_BERSERK); - Enraged = true; - } else BerserkTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_brutallus(Creature* pCreature) -{ - return new boss_brutallusAI (pCreature); -} - -void AddSC_boss_brutallus() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "boss_brutallus"; - newscript->GetAI = &GetAI_boss_brutallus; - newscript->RegisterSelf(); -} diff --git a/src/server/scripts/EasternKingdoms/sunwell_plateau/boss_eredar_twins.cpp b/src/server/scripts/EasternKingdoms/sunwell_plateau/boss_eredar_twins.cpp deleted file mode 100644 index 602f12065fa..00000000000 --- a/src/server/scripts/EasternKingdoms/sunwell_plateau/boss_eredar_twins.cpp +++ /dev/null @@ -1,762 +0,0 @@ -/* Copyright (C) 2009 Trinity -* 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_Eredar_Twins -SD%Complete: 100 -SDComment: -EndScriptData */ - -#include "ScriptedPch.h" -#include "sunwell_plateau.h" - -enum Quotes -{ - //Alytesh - YELL_CANFLAGRATION = -1580044, - YELL_SISTER_SACROLASH_DEAD = -1580045, - YELL_ALY_KILL_1 = -1580046, - YELL_ALY_KILL_2 = -1580047, - YELL_ALY_DEAD = -1580048, - YELL_BERSERK = -1580049, - - //Sacrolash - YELL_SHADOW_NOVA = -1580050, - YELL_SISTER_ALYTHESS_DEAD = -1580051, - YELL_SAC_KILL_1 = -1580052, - YELL_SAC_KILL_2 = -1580053, - SAY_SAC_DEAD = -1580054, - YELL_ENRAGE = -1580055, - - //Intro - YELL_INTRO_SAC_1 = -1580056, - YELL_INTRO_ALY_2 = -1580057, - YELL_INTRO_SAC_3 = -1580058, - YELL_INTRO_ALY_4 = -1580059, - YELL_INTRO_SAC_5 = -1580060, - YELL_INTRO_ALY_6 = -1580061, - YELL_INTRO_SAC_7 = -1580062, - YELL_INTRO_ALY_8 = -1580063, - - //Emote - EMOTE_SHADOW_NOVA = -1580064, - EMOTE_CONFLAGRATION = -1580065 -}; - -enum Spells -{ - //Lady Sacrolash spells - SPELL_DARK_TOUCHED = 45347, - SPELL_SHADOW_BLADES = 45248, //10 secs - SPELL_DARK_STRIKE = 45271, - SPELL_SHADOW_NOVA = 45329, //30-35 secs - SPELL_CONFOUNDING_BLOW = 45256, //25 secs - - //Shadow Image spells - SPELL_SHADOW_FURY = 45270, - SPELL_IMAGE_VISUAL = 45263, - - //Misc spells - SPELL_ENRAGE = 46587, - SPELL_EMPOWER = 45366, - SPELL_DARK_FLAME = 45345, - - //Grand Warlock Alythess spells - SPELL_PYROGENICS = 45230, //15secs - SPELL_FLAME_TOUCHED = 45348, - SPELL_CONFLAGRATION = 45342, //30-35 secs - SPELL_BLAZE = 45235, //on main target every 3 secs - SPELL_FLAME_SEAR = 46771, - SPELL_BLAZE_SUMMON = 45236, //187366 GO - SPELL_BLAZE_BURN = 45246 -}; - -struct boss_sacrolashAI : public ScriptedAI -{ - boss_sacrolashAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance *pInstance; - - bool SisterDeath; - bool Enraged; - - uint32 ShadowbladesTimer; - uint32 ShadownovaTimer; - uint32 ConfoundingblowTimer; - uint32 ShadowimageTimer; - uint32 ConflagrationTimer; - uint32 EnrageTimer; - - void Reset() - { - Enraged = false; - - if (pInstance) - { - Unit* Temp = Unit::GetUnit((*me),pInstance->GetData64(DATA_ALYTHESS)); - if (Temp) - if (Temp->isDead()) - { - CAST_CRE(Temp)->Respawn(); - }else - { - if (Temp->getVictim()) - { - me->getThreatManager().addThreat(Temp->getVictim(),0.0f); - } - } - } - - if (!me->isInCombat()) - { - ShadowbladesTimer = 10000; - ShadownovaTimer = 30000; - ConfoundingblowTimer = 25000; - ShadowimageTimer = 20000; - ConflagrationTimer = 30000; - EnrageTimer = 360000; - - SisterDeath = false; - } - - if (pInstance) - pInstance->SetData(DATA_EREDAR_TWINS_EVENT, NOT_STARTED); - } - - void EnterCombat(Unit * who) - { - DoZoneInCombat(); - - if (pInstance) - { - Unit* Temp = Unit::GetUnit((*me),pInstance->GetData64(DATA_ALYTHESS)); - if (Temp && Temp->isAlive() && !(Temp->getVictim())) - CAST_CRE(Temp)->AI()->AttackStart(who); - } - - if (pInstance) - pInstance->SetData(DATA_EREDAR_TWINS_EVENT, IN_PROGRESS); - } - - void KilledUnit(Unit * /*victim*/) - { - if (rand()%4 == 0) - DoScriptText(RAND(YELL_SAC_KILL_1,YELL_SAC_KILL_2), me); - } - - void JustDied(Unit* /*Killer*/) - { - // only if ALY death - if (SisterDeath) - { - DoScriptText(SAY_SAC_DEAD, me); - - if (pInstance) - pInstance->SetData(DATA_EREDAR_TWINS_EVENT, DONE); - } - else - me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); - } - - void SpellHitTarget(Unit *pTarget,const SpellEntry* spell) - { - switch(spell->Id) - { - case SPELL_SHADOW_BLADES: - case SPELL_SHADOW_NOVA: - case SPELL_CONFOUNDING_BLOW: - case SPELL_SHADOW_FURY: - HandleTouchedSpells(pTarget, SPELL_DARK_TOUCHED); - break; - case SPELL_CONFLAGRATION: - HandleTouchedSpells(pTarget, SPELL_FLAME_TOUCHED); - break; - } - } - - void HandleTouchedSpells(Unit *pTarget, uint32 TouchedType) - { - switch(TouchedType) - { - case SPELL_FLAME_TOUCHED: - if (!pTarget->HasAura(SPELL_DARK_FLAME)) - { - if (pTarget->HasAura(SPELL_DARK_TOUCHED)) - { - pTarget->RemoveAurasDueToSpell(SPELL_DARK_TOUCHED); - pTarget->CastSpell(pTarget, SPELL_DARK_FLAME, true); - } else pTarget->CastSpell(pTarget, SPELL_FLAME_TOUCHED, true); - } - break; - case SPELL_DARK_TOUCHED: - if (!pTarget->HasAura(SPELL_DARK_FLAME)) - { - if (pTarget->HasAura(SPELL_FLAME_TOUCHED)) - { - pTarget->RemoveAurasDueToSpell(SPELL_FLAME_TOUCHED); - pTarget->CastSpell(pTarget, SPELL_DARK_FLAME, true); - } else pTarget->CastSpell(pTarget, SPELL_DARK_TOUCHED, true); - } - break; - } - } - - void UpdateAI(const uint32 diff) - { - if (!SisterDeath) - { - if (pInstance) - { - Unit* Temp = NULL; - Temp = Unit::GetUnit((*me),pInstance->GetData64(DATA_ALYTHESS)); - if (Temp && Temp->isDead()) - { - DoScriptText(YELL_SISTER_ALYTHESS_DEAD, me); - DoCast(me, SPELL_EMPOWER); - me->InterruptSpell(CURRENT_GENERIC_SPELL); - SisterDeath = true; - } - } - } - - if (!UpdateVictim()) - return; - - if (SisterDeath) - { - if (ConflagrationTimer <= diff) - { - if (!me->IsNonMeleeSpellCasted(false)) - { - me->InterruptSpell(CURRENT_GENERIC_SPELL); - Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (pTarget) - DoCast(pTarget, SPELL_CONFLAGRATION); - ConflagrationTimer = 30000+(rand()%5000); - } - } else ConflagrationTimer -= diff; - } - else - { - if (ShadownovaTimer <= diff) - { - if (!me->IsNonMeleeSpellCasted(false)) - { - Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (pTarget) - DoCast(pTarget, SPELL_SHADOW_NOVA); - - if (!SisterDeath) - { - if (pTarget) - DoScriptText(EMOTE_SHADOW_NOVA, me, pTarget); - DoScriptText(YELL_SHADOW_NOVA, me); - } - ShadownovaTimer = 30000+(rand()%5000); - } - } else ShadownovaTimer -=diff; - } - - if (ConfoundingblowTimer <= diff) - { - if (!me->IsNonMeleeSpellCasted(false)) - { - Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (pTarget) - DoCast(pTarget, SPELL_CONFOUNDING_BLOW); - ConfoundingblowTimer = 20000 + (rand()%5000); - } - } else ConfoundingblowTimer -=diff; - - if (ShadowimageTimer <= diff) - { - Unit *pTarget = NULL; - Creature* temp = NULL; - for (uint8 i = 0; i<3; ++i) - { - pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); - temp = DoSpawnCreature(MOB_SHADOW_IMAGE,0,0,0,0,TEMPSUMMON_CORPSE_DESPAWN,10000); - if (temp && pTarget) - { - temp->AddThreat(pTarget,1000000);//don't change target(healers) - temp->AI()->AttackStart(pTarget); - } - } - ShadowimageTimer = 20000; - } else ShadowimageTimer -=diff; - - if (ShadowbladesTimer <= diff) - { - if (!me->IsNonMeleeSpellCasted(false)) - { - DoCast(me, SPELL_SHADOW_BLADES); - ShadowbladesTimer = 10000; - } - } else ShadowbladesTimer -=diff; - - if (EnrageTimer < diff && !Enraged) - { - me->InterruptSpell(CURRENT_GENERIC_SPELL); - DoScriptText(YELL_ENRAGE, me); - DoCast(me, SPELL_ENRAGE); - Enraged = true; - } else EnrageTimer -= diff; - - if (me->isAttackReady() && !me->IsNonMeleeSpellCasted(false)) - { - //If we are within range melee the target - if (me->IsWithinMeleeRange(me->getVictim())) - { - HandleTouchedSpells(me->getVictim(), SPELL_DARK_TOUCHED); - me->AttackerStateUpdate(me->getVictim()); - me->resetAttackTimer(); - } - } - } -}; - -CreatureAI* GetAI_boss_sacrolash(Creature* pCreature) -{ - return new boss_sacrolashAI (pCreature); -}; - -struct boss_alythessAI : public Scripted_NoMovementAI -{ - boss_alythessAI(Creature *c) : Scripted_NoMovementAI(c) - { - pInstance = c->GetInstanceData(); - IntroStepCounter = 10; - } - - ScriptedInstance *pInstance; - - bool SisterDeath; - bool Enraged; - - uint32 IntroStepCounter; - uint32 IntroYellTimer; - - uint32 ConflagrationTimer; - uint32 BlazeTimer; - uint32 PyrogenicsTimer; - uint32 ShadownovaTimer; - uint32 FlamesearTimer; - uint32 EnrageTimer; - - void Reset() - { - Enraged = false; - - if (pInstance) - { - Unit* Temp = Unit::GetUnit((*me),pInstance->GetData64(DATA_SACROLASH)); - if (Temp) - if (Temp->isDead()) - { - CAST_CRE(Temp)->Respawn(); - }else - { - if (Temp->getVictim()) - { - me->getThreatManager().addThreat(Temp->getVictim(),0.0f); - } - } - } - - if (!me->isInCombat()) - { - ConflagrationTimer = 45000; - BlazeTimer = 100; - PyrogenicsTimer = 15000; - ShadownovaTimer = 40000; - EnrageTimer = 360000; - FlamesearTimer = 15000; - IntroYellTimer = 10000; - - SisterDeath = false; - } - - if (pInstance) - pInstance->SetData(DATA_EREDAR_TWINS_EVENT, NOT_STARTED); - } - - void EnterCombat(Unit * who) - { - DoZoneInCombat(); - - if (pInstance) - { - Unit* Temp = Unit::GetUnit((*me),pInstance->GetData64(DATA_SACROLASH)); - if (Temp && Temp->isAlive() && !(Temp->getVictim())) - CAST_CRE(Temp)->AI()->AttackStart(who); - } - - if (pInstance) - pInstance->SetData(DATA_EREDAR_TWINS_EVENT, IN_PROGRESS); - } - - void AttackStart(Unit *who) - { - if (!me->isInCombat()) - { - Scripted_NoMovementAI::AttackStart(who); - } - } - - void MoveInLineOfSight(Unit *who) - { - 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 (!me->isInCombat()) - { - DoStartNoMovement(who); - } - } - } - else if (IntroStepCounter == 10 && me->IsWithinLOSInMap(who)&& me->IsWithinDistInMap(who, 30)) - { - IntroStepCounter = 0; - } - } - - void KilledUnit(Unit * /*victim*/) - { - if (rand()%4 == 0) - { - DoScriptText(RAND(YELL_ALY_KILL_1,YELL_ALY_KILL_2), me); - } - } - - void JustDied(Unit* /*Killer*/) - { - if (SisterDeath) - { - DoScriptText(YELL_ALY_DEAD, me); - - if (pInstance) - pInstance->SetData(DATA_EREDAR_TWINS_EVENT, DONE); - } - else - me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); - } - - void SpellHitTarget(Unit *pTarget,const SpellEntry* spell) - { - switch(spell->Id) - { - - case SPELL_BLAZE: - pTarget->CastSpell(pTarget, SPELL_BLAZE_SUMMON, true); - case SPELL_CONFLAGRATION: - case SPELL_FLAME_SEAR: - HandleTouchedSpells(pTarget, SPELL_FLAME_TOUCHED); - break; - case SPELL_SHADOW_NOVA: - HandleTouchedSpells(pTarget, SPELL_DARK_TOUCHED); - break; - } - } - - void HandleTouchedSpells(Unit *pTarget, uint32 TouchedType) - { - switch(TouchedType) - { - case SPELL_FLAME_TOUCHED: - if (!pTarget->HasAura(SPELL_DARK_FLAME)) - { - if (pTarget->HasAura(SPELL_DARK_TOUCHED)) - { - pTarget->RemoveAurasDueToSpell(SPELL_DARK_TOUCHED); - pTarget->CastSpell(pTarget, SPELL_DARK_FLAME, true); - }else - { - pTarget->CastSpell(pTarget, SPELL_FLAME_TOUCHED, true); - } - } - break; - case SPELL_DARK_TOUCHED: - if (!pTarget->HasAura(SPELL_DARK_FLAME)) - { - if (pTarget->HasAura(SPELL_FLAME_TOUCHED)) - { - pTarget->RemoveAurasDueToSpell(SPELL_FLAME_TOUCHED); - pTarget->CastSpell(pTarget, SPELL_DARK_FLAME, true); - } else pTarget->CastSpell(pTarget, SPELL_DARK_TOUCHED, true); - } - break; - } - } - - uint32 IntroStep(uint32 step) - { - Creature* Sacrolash = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_SACROLASH) : 0); - switch (step) - { - case 0: return 0; - case 1: - if (Sacrolash) - DoScriptText(YELL_INTRO_SAC_1, Sacrolash); - return 1000; - case 2: DoScriptText(YELL_INTRO_ALY_2, me); return 1000; - case 3: - if (Sacrolash) - DoScriptText(YELL_INTRO_SAC_3, Sacrolash); - return 2000; - case 4: DoScriptText(YELL_INTRO_ALY_4, me); return 1000; - case 5: - if (Sacrolash) - DoScriptText(YELL_INTRO_SAC_5, Sacrolash); - return 2000; - case 6: DoScriptText(YELL_INTRO_ALY_6, me); return 1000; - case 7: - if (Sacrolash) - DoScriptText(YELL_INTRO_SAC_7, Sacrolash); - return 3000; - case 8: DoScriptText(YELL_INTRO_ALY_8, me); return 900000; - } - return 10000; - } - - void UpdateAI(const uint32 diff) - { - if (IntroStepCounter < 9) - { - if (IntroYellTimer <= diff) - { - IntroYellTimer = IntroStep(++IntroStepCounter); - } else IntroYellTimer -= diff; - } - - if (!SisterDeath) - { - if (pInstance) - { - Unit* Temp = NULL; - Temp = Unit::GetUnit((*me),pInstance->GetData64(DATA_SACROLASH)); - if (Temp && Temp->isDead()) - { - DoScriptText(YELL_SISTER_SACROLASH_DEAD, me); - DoCast(me, SPELL_EMPOWER); - me->InterruptSpell(CURRENT_GENERIC_SPELL); - SisterDeath = true; - } - } - } - if (!me->getVictim()) - { - if (pInstance) - { - Creature* sisiter = Unit::GetCreature((*me),pInstance->GetData64(DATA_SACROLASH)); - if (sisiter && !sisiter->isDead() && sisiter->getVictim()) - { - me->AddThreat(sisiter->getVictim(),0.0f); - DoStartNoMovement(sisiter->getVictim()); - me->Attack(sisiter->getVictim(),false); - } - } - } - - if (!UpdateVictim()) - return; - - if (SisterDeath) - { - if (ShadownovaTimer <= diff) - { - if (!me->IsNonMeleeSpellCasted(false)) - { - Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (pTarget) - DoCast(pTarget, SPELL_SHADOW_NOVA); - ShadownovaTimer= 30000+(rand()%5000); - } - } else ShadownovaTimer -=diff; - } - else - { - if (ConflagrationTimer <= diff) - { - if (!me->IsNonMeleeSpellCasted(false)) - { - me->InterruptSpell(CURRENT_GENERIC_SPELL); - Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (pTarget) - DoCast(pTarget, SPELL_CONFLAGRATION); - ConflagrationTimer = 30000+(rand()%5000); - - if (!SisterDeath) - { - if (pTarget) - DoScriptText(EMOTE_CONFLAGRATION, me, pTarget); - DoScriptText(YELL_CANFLAGRATION, me); - } - - BlazeTimer = 4000; - } - } else ConflagrationTimer -= diff; - } - - if (FlamesearTimer <= diff) - { - if (!me->IsNonMeleeSpellCasted(false)) - { - DoCast(me, SPELL_FLAME_SEAR); - FlamesearTimer = 15000; - } - } else FlamesearTimer -=diff; - - if (PyrogenicsTimer <= diff) - { - if (!me->IsNonMeleeSpellCasted(false)) - { - DoCast(me, SPELL_PYROGENICS, true); - PyrogenicsTimer = 15000; - } - } else PyrogenicsTimer -= diff; - - if (BlazeTimer <= diff) - { - if (!me->IsNonMeleeSpellCasted(false)) - { - DoCast(me->getVictim(), SPELL_BLAZE); - BlazeTimer = 3800; - } - } else BlazeTimer -= diff; - - if (EnrageTimer < diff && !Enraged) - { - me->InterruptSpell(CURRENT_GENERIC_SPELL); - DoScriptText(YELL_BERSERK, me); - DoCast(me, SPELL_ENRAGE); - Enraged = true; - } else EnrageTimer -= diff; - } -}; - -CreatureAI* GetAI_boss_alythess(Creature* pCreature) -{ - return new boss_alythessAI (pCreature); -}; - -struct mob_shadow_imageAI : public ScriptedAI -{ - mob_shadow_imageAI(Creature *c) : ScriptedAI(c) {} - - uint32 ShadowfuryTimer; - uint32 KillTimer; - uint32 DarkstrikeTimer; - - void Reset() - { - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - ShadowfuryTimer = 5000 + (rand()%15000); - DarkstrikeTimer = 3000; - KillTimer = 15000; - } - - void EnterCombat(Unit * /*who*/){} - - void SpellHitTarget(Unit *pTarget,const SpellEntry* spell) - { - switch(spell->Id) - { - - case SPELL_SHADOW_FURY: - case SPELL_DARK_STRIKE: - if (!pTarget->HasAura(SPELL_DARK_FLAME)) - { - if (pTarget->HasAura(SPELL_FLAME_TOUCHED)) - { - pTarget->RemoveAurasDueToSpell(SPELL_FLAME_TOUCHED); - pTarget->CastSpell(pTarget, SPELL_DARK_FLAME, true); - } else pTarget->CastSpell(pTarget,SPELL_DARK_TOUCHED,true); - } - break; - } - } - - void UpdateAI(const uint32 diff) - { - if (!me->HasAura(SPELL_IMAGE_VISUAL)) - DoCast(me, SPELL_IMAGE_VISUAL); - - if (KillTimer <= diff) - { - me->Kill(me); - KillTimer = 9999999; - } else KillTimer -= diff; - - if (!UpdateVictim()) - return; - - if (ShadowfuryTimer <= diff) - { - DoCast(me, SPELL_SHADOW_FURY); - ShadowfuryTimer = 10000; - } else ShadowfuryTimer -=diff; - - if (DarkstrikeTimer <= diff) - { - if (!me->IsNonMeleeSpellCasted(false)) - { - //If we are within range melee the target - if (me->IsWithinMeleeRange(me->getVictim())) - DoCast(me->getVictim(), SPELL_DARK_STRIKE); - } - DarkstrikeTimer = 3000; - } else DarkstrikeTimer -= diff; - } -}; - -CreatureAI* GetAI_mob_shadow_image(Creature* pCreature) -{ - return new mob_shadow_imageAI (pCreature); -}; - -void AddSC_boss_eredar_twins() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "boss_sacrolash"; - newscript->GetAI = &GetAI_boss_sacrolash; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_alythess"; - newscript->GetAI = &GetAI_boss_alythess; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_shadow_image"; - newscript->GetAI = &GetAI_mob_shadow_image; - newscript->RegisterSelf(); -} diff --git a/src/server/scripts/EasternKingdoms/sunwell_plateau/boss_felmyst.cpp b/src/server/scripts/EasternKingdoms/sunwell_plateau/boss_felmyst.cpp deleted file mode 100644 index 88ad2dbab11..00000000000 --- a/src/server/scripts/EasternKingdoms/sunwell_plateau/boss_felmyst.cpp +++ /dev/null @@ -1,579 +0,0 @@ -/* Copyright (C) 2009 Trinity -* 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_Felmyst -SD%Complete: 0 -SDComment: -EndScriptData */ - -#include "ScriptedPch.h" -#include "sunwell_plateau.h" - -enum Yells -{ - YELL_BIRTH = -1580036, - YELL_KILL1 = -1580037, - YELL_KILL2 = -1580038, - YELL_BREATH = -1580039, - YELL_TAKEOFF = -1580040, - YELL_BERSERK = -1580041, - YELL_DEATH = -1580042, - YELL_KALECGOS = -1580043, // after felmyst's death spawned and say this -}; - -enum Spells -{ - //Aura - AURA_SUNWELL_RADIANCE = 45769, - AURA_NOXIOUS_FUMES = 47002, - - //Land phase - SPELL_CLEAVE = 19983, - SPELL_CORROSION = 45866, - SPELL_GAS_NOVA = 45855, - SPELL_ENCAPSULATE_CHANNEL = 45661, - // SPELL_ENCAPSULATE_EFFECT = 45665, - // SPELL_ENCAPSULATE_AOE = 45662, - - //Flight phase - SPELL_VAPOR_SELECT = 45391, // fel to player, force cast 45392, 50000y selete target - SPELL_VAPOR_SUMMON = 45392, // player summon vapor, radius around caster, 5y, - SPELL_VAPOR_FORCE = 45388, // vapor to fel, force cast 45389 - SPELL_VAPOR_CHANNEL = 45389, // fel to vapor, green beam channel - SPELL_VAPOR_TRIGGER = 45411, // linked to 45389, vapor to self, trigger 45410 and 46931 - SPELL_VAPOR_DAMAGE = 46931, // vapor damage, 4000 - SPELL_TRAIL_SUMMON = 45410, // vapor summon trail - SPELL_TRAIL_TRIGGER = 45399, // trail to self, trigger 45402 - SPELL_TRAIL_DAMAGE = 45402, // trail damage, 2000 + 2000 dot - SPELL_DEAD_SUMMON = 45400, // summon blazing dead, 5min - SPELL_DEAD_PASSIVE = 45415, - SPELL_FOG_BREATH = 45495, // fel to self, speed burst - SPELL_FOG_TRIGGER = 45582, // fog to self, trigger 45782 - SPELL_FOG_FORCE = 45782, // fog to player, force cast 45714 - SPELL_FOG_INFORM = 45714, // player let fel cast 45717, script effect - SPELL_FOG_CHARM = 45717, // fel to player - SPELL_FOG_CHARM2 = 45726, // link to 45717 - - SPELL_TRANSFORM_TRIGGER = 44885, // madrigosa to self, trigger 46350 - SPELL_TRANSFORM_VISUAL = 46350, // 46411stun? - SPELL_TRANSFORM_FELMYST = 45068, // become fel - SPELL_FELMYST_SUMMON = 45069, - - //Other - SPELL_BERSERK = 45078, - SPELL_CLOUD_VISUAL = 45212, - SPELL_CLOUD_SUMMON = 45884, -}; - -enum PhaseFelmyst -{ - PHASE_NONE, - PHASE_GROUND, - PHASE_FLIGHT, -}; - -enum EventFelmyst -{ - EVENT_NONE, - EVENT_BERSERK, - - EVENT_CLEAVE, - EVENT_CORROSION, - EVENT_GAS_NOVA, - EVENT_ENCAPSULATE, - EVENT_FLIGHT, - - EVENT_FLIGHT_SEQUENCE, - EVENT_SUMMON_DEAD, - EVENT_SUMMON_FOG, -}; - -struct boss_felmystAI : public ScriptedAI -{ - boss_felmystAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - - // wait for core patch be accepted - /*SpellEntry *TempSpell = GET_SPELL(SPELL_ENCAPSULATE_EFFECT); - if (TempSpell->SpellIconID == 2294) - TempSpell->SpellIconID = 2295; - TempSpell = GET_SPELL(SPELL_VAPOR_TRIGGER); - if ((TempSpell->Attributes & SPELL_ATTR_PASSIVE) == 0) - TempSpell->Attributes |= SPELL_ATTR_PASSIVE; - TempSpell = GET_SPELL(SPELL_FOG_CHARM2); - if ((TempSpell->Attributes & SPELL_ATTR_PASSIVE) == 0) - TempSpell->Attributes |= SPELL_ATTR_PASSIVE;*/ - } - - ScriptedInstance *pInstance; - PhaseFelmyst phase; - EventMap events; - - uint32 uiFlightCount; - uint32 uiBreathCount; - - float breathX, breathY; - - void Reset() - { - phase = PHASE_NONE; - - events.Reset(); - - uiFlightCount = 0; - - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - me->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 10); - me->SetFloatValue(UNIT_FIELD_COMBATREACH, 10); - - DespawnSummons(MOB_VAPOR_TRAIL); - me->setActive(false); - - if (pInstance) - pInstance->SetData(DATA_FELMYST_EVENT, NOT_STARTED); - } - - void EnterCombat(Unit * /*who*/) - { - events.ScheduleEvent(EVENT_BERSERK, 600000); - - me->setActive(true); - DoZoneInCombat(); - DoCast(me, AURA_SUNWELL_RADIANCE, true); - DoCast(me, AURA_NOXIOUS_FUMES, true); - EnterPhase(PHASE_GROUND); - - if (pInstance) - pInstance->SetData(DATA_FELMYST_EVENT, IN_PROGRESS); - } - - void AttackStart(Unit *who) - { - if (phase != PHASE_FLIGHT) - ScriptedAI::AttackStart(who); - } - - void MoveInLineOfSight(Unit *who) - { - if (phase != PHASE_FLIGHT) - ScriptedAI::MoveInLineOfSight(who); - } - - void KilledUnit(Unit* /*victim*/) - { - DoScriptText(RAND(YELL_KILL1,YELL_KILL2), me); - } - - void JustRespawned() - { - DoScriptText(YELL_BIRTH, me); - } - - void JustDied(Unit* /*Killer*/) - { - DoScriptText(YELL_DEATH, me); - - if (pInstance) - pInstance->SetData(DATA_FELMYST_EVENT, DONE); - } - - void SpellHit(Unit *caster, const SpellEntry *spell) - { - // workaround for linked aura - /*if (spell->Id == SPELL_VAPOR_FORCE) - { - caster->CastSpell(caster, SPELL_VAPOR_TRIGGER, true); - }*/ - // workaround for mind control - if (spell->Id == SPELL_FOG_INFORM) - { - float x, y, z; - caster->GetPosition(x, y, z); - if (Unit* summon = me->SummonCreature(MOB_DEAD, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000)) - { - summon->SetMaxHealth(caster->GetMaxHealth()); - summon->SetHealth(caster->GetMaxHealth()); - summon->CastSpell(summon, SPELL_FOG_CHARM, true); - summon->CastSpell(summon, SPELL_FOG_CHARM2, true); - } - me->DealDamage(caster, caster->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - } - } - - void JustSummoned(Creature *summon) - { - if (summon->GetEntry() == MOB_DEAD) - { - summon->AI()->AttackStart(SelectTarget(SELECT_TARGET_RANDOM)); - DoZoneInCombat(summon); - summon->CastSpell(summon, SPELL_DEAD_PASSIVE, true); - } - } - - void MovementInform(uint32, uint32) - { - if (phase == PHASE_FLIGHT) - events.ScheduleEvent(EVENT_FLIGHT_SEQUENCE, 1); - } - - void DamageTaken(Unit*, uint32 &damage) - { - if (phase != PHASE_GROUND && damage >= me->GetHealth()) - damage = 0; - } - - void EnterPhase(PhaseFelmyst NextPhase) - { - switch(NextPhase) - { - case PHASE_GROUND: - me->CastStop(SPELL_FOG_BREATH); - me->RemoveAurasDueToSpell(SPELL_FOG_BREATH); - me->SetUnitMovementFlags(MOVEMENTFLAG_NONE); - me->SetSpeed(MOVE_RUN, 2.0); - - events.ScheduleEvent(EVENT_CLEAVE, urand(5000, 10000)); - events.ScheduleEvent(EVENT_CORROSION, urand(10000, 20000)); - events.ScheduleEvent(EVENT_GAS_NOVA, urand(15000, 20000)); - events.ScheduleEvent(EVENT_ENCAPSULATE, urand(20000, 25000)); - events.ScheduleEvent(EVENT_FLIGHT, 60000); - break; - case PHASE_FLIGHT: - me->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); - events.ScheduleEvent(EVENT_FLIGHT_SEQUENCE, 1000); - uiFlightCount = 0; - uiBreathCount = 0; - break; - } - phase = NextPhase; - } - - void HandleFlightSequence() - { - switch(uiFlightCount) - { - case 0: - //me->AttackStop(); - me->GetMotionMaster()->Clear(false); - me->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); - me->StopMoving(); - DoScriptText(YELL_TAKEOFF, me); - events.ScheduleEvent(EVENT_FLIGHT_SEQUENCE, 2000); - break; - case 1: - me->GetMotionMaster()->MovePoint(0, me->GetPositionX()+1, me->GetPositionY(), me->GetPositionZ()+10); - break; - case 2: - { - Unit *pTarget = pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 150, true); - if (!pTarget) - pTarget = Unit::GetUnit(*me, pInstance ? pInstance->GetData64(DATA_PLAYER_GUID) : 0); - - if (!pTarget) - { - EnterEvadeMode(); - return; - } - - Creature* Vapor = me->SummonCreature(MOB_VAPOR, pTarget->GetPositionX()-5+rand()%10, pTarget->GetPositionY()-5+rand()%10, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 9000); - if (Vapor) - { - Vapor->AI()->AttackStart(pTarget); - me->InterruptNonMeleeSpells(false); - DoCast(Vapor, SPELL_VAPOR_CHANNEL, false); // core bug - Vapor->CastSpell(Vapor, SPELL_VAPOR_TRIGGER, true); - } - - events.ScheduleEvent(EVENT_FLIGHT_SEQUENCE, 10000); - break; - } - case 3: - { - DespawnSummons(MOB_VAPOR_TRAIL); - //DoCast(me, SPELL_VAPOR_SELECT); need core support - - Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 150, true); - if (!pTarget) - pTarget = Unit::GetUnit(*me, pInstance ? pInstance->GetData64(DATA_PLAYER_GUID) : 0); - - if (!pTarget) - { - EnterEvadeMode(); - return; - } - - //pTarget->CastSpell(pTarget, SPELL_VAPOR_SUMMON, true); need core support - Creature* pVapor = me->SummonCreature(MOB_VAPOR, pTarget->GetPositionX()-5+rand()%10, pTarget->GetPositionY()-5+rand()%10, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 9000); - if (pVapor) - { - if (pVapor->AI()) - pVapor->AI()->AttackStart(pTarget); - me->InterruptNonMeleeSpells(false); - DoCast(pVapor, SPELL_VAPOR_CHANNEL, false); // core bug - pVapor->CastSpell(pVapor, SPELL_VAPOR_TRIGGER, true); - } - - events.ScheduleEvent(EVENT_FLIGHT_SEQUENCE, 10000); - break; - } - case 4: - DespawnSummons(MOB_VAPOR_TRAIL); - events.ScheduleEvent(EVENT_FLIGHT_SEQUENCE, 1); - break; - case 5: - { - Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 150, true); - if (!pTarget) - pTarget = Unit::GetUnit(*me, pInstance ? pInstance->GetData64(DATA_PLAYER_GUID) : 0); - - if (!pTarget) - { - EnterEvadeMode(); - return; - } - - breathX = pTarget->GetPositionX(); - breathY = pTarget->GetPositionY(); - float x, y, z; - pTarget->GetContactPoint(me, x, y, z, 70); - me->GetMotionMaster()->MovePoint(0, x, y, z+10); - break; - } - case 6: - me->SetOrientation(me->GetAngle(breathX, breathY)); - me->StopMoving(); - //DoTextEmote("takes a deep breath.", NULL); - events.ScheduleEvent(EVENT_FLIGHT_SEQUENCE, 10000); - break; - case 7: - { - DoCast(me, SPELL_FOG_BREATH, true); - float x, y, z; - me->GetPosition(x, y, z); - x = 2 * breathX - x; - y = 2 * breathY - y; - me->GetMotionMaster()->MovePoint(0, x, y, z); - events.ScheduleEvent(EVENT_SUMMON_FOG, 1); - break; - } - case 8: - me->CastStop(SPELL_FOG_BREATH); - me->RemoveAurasDueToSpell(SPELL_FOG_BREATH); - ++uiBreathCount; - events.ScheduleEvent(EVENT_FLIGHT_SEQUENCE, 1); - if (uiBreathCount < 3) - uiFlightCount = 4; - break; - case 9: - if (Unit *pTarget = SelectTarget(SELECT_TARGET_TOPAGGRO)) - DoStartMovement(pTarget); - else - { - EnterEvadeMode(); - return; - } - break; - case 10: - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - me->HandleEmoteCommand(EMOTE_ONESHOT_LAND); - EnterPhase(PHASE_GROUND); - AttackStart(SelectTarget(SELECT_TARGET_TOPAGGRO)); - break; - } - ++uiFlightCount; - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - { - if (phase == PHASE_FLIGHT && !me->IsInEvadeMode()) - EnterEvadeMode(); - return; - } - - events.Update(diff); - - if (me->IsNonMeleeSpellCasted(false)) - return; - - if (phase == PHASE_GROUND) - { - switch(events.ExecuteEvent()) - { - case EVENT_BERSERK: - DoScriptText(YELL_BERSERK, me); - DoCast(me, SPELL_BERSERK, true); - events.ScheduleEvent(EVENT_BERSERK, 10000); - break; - case EVENT_CLEAVE: - DoCast(me->getVictim(), SPELL_CLEAVE, false); - events.ScheduleEvent(EVENT_CLEAVE, urand(5000,10000)); - break; - case EVENT_CORROSION: - DoCast(me->getVictim(), SPELL_CORROSION, false); - events.ScheduleEvent(EVENT_CORROSION, urand(20000,30000)); - break; - case EVENT_GAS_NOVA: - DoCast(me, SPELL_GAS_NOVA, false); - events.ScheduleEvent(EVENT_GAS_NOVA, urand(20000,25000)); - break; - case EVENT_ENCAPSULATE: - if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 150, true)) - DoCast(pTarget, SPELL_ENCAPSULATE_CHANNEL, false); - events.ScheduleEvent(EVENT_ENCAPSULATE, urand(25000,30000)); - break; - case EVENT_FLIGHT: - EnterPhase(PHASE_FLIGHT); - break; - default: - DoMeleeAttackIfReady(); - break; - } - } - - if (phase == PHASE_FLIGHT) - { - switch(events.ExecuteEvent()) - { - case EVENT_BERSERK: - DoScriptText(YELL_BERSERK, me); - DoCast(me, SPELL_BERSERK, true); - break; - case EVENT_FLIGHT_SEQUENCE: - HandleFlightSequence(); - break; - case EVENT_SUMMON_FOG: - { - float x, y, z; - me->GetPosition(x, y, z); - me->UpdateGroundPositionZ(x, y, z); - if (Creature *Fog = me->SummonCreature(MOB_VAPOR_TRAIL, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN, 10000)) - { - Fog->RemoveAurasDueToSpell(SPELL_TRAIL_TRIGGER); - Fog->CastSpell(Fog, SPELL_FOG_TRIGGER, true); - me->CastSpell(Fog, SPELL_FOG_FORCE, true); - } - } - events.ScheduleEvent(EVENT_SUMMON_FOG, 1000); - break; - } - } - } - - void DespawnSummons(uint32 entry) - { - std::list templist; - float x, y, z; - me->GetPosition(x, y, z); - - CellPair pair(Trinity::ComputeCellPair(x, y)); - Cell cell(pair); - cell.data.Part.reserved = ALL_DISTRICT; - cell.SetNoCreate(); - - Trinity::AllCreaturesOfEntryInRange check(me, entry, 100); - Trinity::CreatureListSearcher searcher(me, templist, check); - TypeContainerVisitor, GridTypeMapContainer> cSearcher(searcher); - cell.Visit(pair, cSearcher, *(me->GetMap())); - - for (std::list::const_iterator i = templist.begin(); i != templist.end(); ++i) - { - if (entry == MOB_VAPOR_TRAIL && phase == PHASE_FLIGHT) - { - (*i)->GetPosition(x, y, z); - me->SummonCreature(MOB_DEAD, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); - } - (*i)->SetVisibility(VISIBILITY_OFF); - (*i)->setDeathState(JUST_DIED); - if ((*i)->getDeathState() == CORPSE) - (*i)->RemoveCorpse(); - } - } -}; - -struct mob_felmyst_vaporAI : public ScriptedAI -{ - mob_felmyst_vaporAI(Creature *c) : ScriptedAI(c) - { - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetSpeed(MOVE_RUN, 0.8); - } - void Reset() {} - void EnterCombat(Unit* /*who*/) - { - DoZoneInCombat(); - //DoCast(me, SPELL_VAPOR_FORCE, true); core bug - } - void UpdateAI(const uint32 /*diff*/) - { - if (!me->getVictim()) - if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) - AttackStart(pTarget); - } -}; - -struct mob_felmyst_trailAI : public ScriptedAI -{ - mob_felmyst_trailAI(Creature *c) : ScriptedAI(c) - { - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - DoCast(me, SPELL_TRAIL_TRIGGER, true); - me->SetUInt64Value(UNIT_FIELD_TARGET, me->GetGUID()); - me->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 0.01); // core bug - } - void Reset() {} - void EnterCombat(Unit* /*who*/) {} - void AttackStart(Unit* /*who*/) {} - void MoveInLineOfSight(Unit* /*who*/) {} - void UpdateAI(const uint32 /*diff*/) {} -}; - -CreatureAI* GetAI_boss_felmyst(Creature* pCreature) -{ - return new boss_felmystAI(pCreature); -} - -CreatureAI* GetAI_mob_felmyst_vapor(Creature* pCreature) -{ - return new mob_felmyst_vaporAI(pCreature); -} - -CreatureAI* GetAI_mob_felmyst_trail(Creature* pCreature) -{ - return new mob_felmyst_trailAI(pCreature); -} - -void AddSC_boss_felmyst() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_felmyst"; - newscript->GetAI = &GetAI_boss_felmyst; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_felmyst_vapor"; - newscript->GetAI = &GetAI_mob_felmyst_vapor; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_felmyst_trail"; - newscript->GetAI = &GetAI_mob_felmyst_trail; - newscript->RegisterSelf(); -} diff --git a/src/server/scripts/EasternKingdoms/sunwell_plateau/boss_kalecgos.cpp b/src/server/scripts/EasternKingdoms/sunwell_plateau/boss_kalecgos.cpp deleted file mode 100644 index 146771325eb..00000000000 --- a/src/server/scripts/EasternKingdoms/sunwell_plateau/boss_kalecgos.cpp +++ /dev/null @@ -1,794 +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_Kalecgos -SD%Complete: 95 -SDComment: -SDCategory: Sunwell_Plateau -EndScriptData */ - -#include "ScriptedPch.h" -#include "sunwell_plateau.h" - -enum Yells -{ - //Kalecgos dragon form - SAY_EVIL_AGGRO = -1580000, - SAY_EVIL_SPELL1 = -1580001, - SAY_EVIL_SPELL2 = -1580002, - SAY_EVIL_SLAY1 = -1580003, - SAY_EVIL_SLAY2 = -1580004, - SAY_EVIL_ENRAGE = -1580005, - - //Kalecgos humanoid form - SAY_GOOD_AGGRO = -1580006, - SAY_GOOD_NEAR_DEATH = -1580007, - SAY_GOOD_NEAR_DEATH2 = -1580008, - SAY_GOOD_PLRWIN = -1580009, - - //Sathrovarr - SAY_SATH_AGGRO = -1580010, - SAY_SATH_DEATH = -1580011, - SAY_SATH_SPELL1 = -1580012, - SAY_SATH_SPELL2 = -1580013, - SAY_SATH_SLAY1 = -1580014, - SAY_SATH_SLAY2 = -1580015, - SAY_SATH_ENRAGE = -1580016, -}; - -enum Spells -{ - AURA_SUNWELL_RADIANCE = 45769, - AURA_SPECTRAL_EXHAUSTION = 44867, - AURA_SPECTRAL_REALM = 46021, - AURA_SPECTRAL_INVISIBILITY = 44801, - AURA_DEMONIC_VISUAL = 44800, - - SPELL_SPECTRAL_BLAST = 44869, - SPELL_TELEPORT_SPECTRAL = 46019, - SPELL_ARCANE_BUFFET = 45018, - SPELL_FROST_BREATH = 44799, - SPELL_TAIL_LASH = 45122, - - SPELL_BANISH = 44836, - SPELL_TRANSFORM_KALEC = 44670, - SPELL_ENRAGE = 44807, - - SPELL_CORRUPTION_STRIKE = 45029, - SPELL_AGONY_CURSE = 45032, - SPELL_SHADOW_BOLT = 45031, - - SPELL_HEROIC_STRIKE = 45026, - SPELL_REVITALIZE = 45027 -}; - -enum SWPActions -{ - DO_ENRAGE = 1, - DO_BANISH = 2, -}; - -#define GO_FAILED "You are unable to use this currently." - -#define EMOTE_UNABLE_TO_FIND "is unable to find Kalecgos" - -#define FLY_X 1679 -#define FLY_Y 900 -#define FLY_Z 82 - -#define CENTER_X 1705 -#define CENTER_Y 930 -#define RADIUS 30 - -#define DRAGON_REALM_Z 53.079 -#define DEMON_REALM_Z -74.558 - -#define MAX_PLAYERS_IN_SPECTRAL_REALM 0 //over this, teleport object won't work, 0 disables check - -uint32 WildMagic[] = { 44978, 45001, 45002, 45004, 45006, 45010 }; - -struct boss_kalecgosAI : public ScriptedAI -{ - boss_kalecgosAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - SathGUID = 0; - DoorGUID = 0; - bJustReset = false; - me->setActive(true); - SpellEntry *TempSpell = GET_SPELL(SPELL_SPECTRAL_BLAST); - if (TempSpell) - TempSpell->EffectImplicitTargetB[0] = TARGET_UNIT_TARGET_ENEMY; - } - - ScriptedInstance *pInstance; - - uint32 ArcaneBuffetTimer; - uint32 FrostBreathTimer; - uint32 WildMagicTimer; - uint32 SpectralBlastTimer; - uint32 TailLashTimer; - uint32 CheckTimer; - uint32 TalkTimer; - uint32 TalkSequence; - uint32 ResetTimer; - - bool isFriendly; - bool isEnraged; - bool isBanished; - bool bJustReset; - - uint64 SathGUID; - uint64 DoorGUID; - - void Reset() - { - if (pInstance) - { - SathGUID = pInstance->GetData64(DATA_SATHROVARR); - pInstance->SetData(DATA_KALECGOS_EVENT, NOT_STARTED); - } - - if (Creature *Sath = Unit::GetCreature(*me, SathGUID)) - Sath->AI()->EnterEvadeMode(); - - me->setFaction(14); - if (!bJustReset) //first reset at create - { - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - me->SetVisibility(VISIBILITY_ON); - me->SetStandState(UNIT_STAND_STATE_SLEEP); - } - me->SetHealth(me->GetMaxHealth());//dunno why it does not resets health at evade.. - ArcaneBuffetTimer = 8000; - FrostBreathTimer = 15000; - WildMagicTimer = 10000; - TailLashTimer = 25000; - SpectralBlastTimer = urand(20000,25000); - CheckTimer = 1000; - ResetTimer = 30000; - - TalkTimer = 0; - TalkSequence = 0; - isFriendly = false; - isEnraged = false; - isBanished = false; - } - - void EnterEvadeMode() - { - bJustReset = true; - me->SetVisibility(VISIBILITY_OFF); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE); - ScriptedAI::EnterEvadeMode(); - } - - void DoAction(const int32 param) - { - switch (param) - { - case DO_ENRAGE: - isEnraged = true; - me->CastSpell(me, SPELL_ENRAGE, true); - break; - case DO_BANISH: - isBanished = true; - me->CastSpell(me, SPELL_BANISH, true); - break; - } - } - - void UpdateAI(const uint32 diff) - { - if (TalkTimer) - { - if (!TalkSequence) - { - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE); - me->InterruptNonMeleeSpells(true); - me->RemoveAllAuras(); - me->DeleteThreatList(); - me->CombatStop(); - ++TalkSequence; - } - if (TalkTimer <= diff) - { - if (isFriendly) - GoodEnding(); - else - BadEnding(); - ++TalkSequence; - } else TalkTimer -= diff; - } - else - { - if (bJustReset) - { - if (ResetTimer <= diff) - { - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - me->SetVisibility(VISIBILITY_ON); - me->SetStandState(UNIT_STAND_STATE_SLEEP); - ResetTimer = 10000; - bJustReset = false; - } else ResetTimer -= diff; - return; - } - if (!UpdateVictim()) - return; - - if (CheckTimer <= diff) - { - if (me->GetDistance(CENTER_X, CENTER_Y, DRAGON_REALM_Z) >= 75) - { - me->AI()->EnterEvadeMode(); - return; - } - if (HealthBelowPct(10) && !isEnraged) - { - if (Creature* Sath = Unit::GetCreature(*me, SathGUID)) - Sath->AI()->DoAction(DO_ENRAGE); - DoAction(DO_ENRAGE); - } - if (!isBanished && HealthBelowPct(1)) - { - if (Creature* Sath = Unit::GetCreature(*me, SathGUID)) - { - if (Sath->HasAura(SPELL_BANISH)) - { - Sath->DealDamage(Sath, Sath->GetHealth()); - return; - } - else - DoAction(DO_BANISH); - } - else - { - error_log("TSCR: Didn't find Shathrowar. Kalecgos event reseted."); - EnterEvadeMode(); - return; - } - } - CheckTimer = 1000; - } else CheckTimer -= diff; - - if (ArcaneBuffetTimer <= diff) - { - DoCastAOE(SPELL_ARCANE_BUFFET); - ArcaneBuffetTimer = 8000; - } else ArcaneBuffetTimer -= diff; - - if (FrostBreathTimer <= diff) - { - DoCastAOE(SPELL_FROST_BREATH); - FrostBreathTimer = 15000; - } else FrostBreathTimer -= diff; - - if (TailLashTimer <= diff) - { - DoCastAOE(SPELL_TAIL_LASH); - TailLashTimer = 15000; - } else TailLashTimer -= diff; - - if (WildMagicTimer <= diff) - { - DoCastAOE(WildMagic[rand()%6]); - WildMagicTimer = 20000; - } else WildMagicTimer -= diff; - - if (SpectralBlastTimer <= diff) - { - std::list &m_threatlist = me->getThreatManager().getThreatList(); - std::list targetList; - for (std::list::const_iterator itr = m_threatlist.begin(); itr!= m_threatlist.end(); ++itr) - if ((*itr)->getTarget() && (*itr)->getTarget()->GetTypeId() == TYPEID_PLAYER && (*itr)->getTarget()->GetGUID() != me->getVictim()->GetGUID() && !(*itr)->getTarget()->HasAura(AURA_SPECTRAL_EXHAUSTION) && (*itr)->getTarget()->GetPositionZ() > me->GetPositionZ()-5) - targetList.push_back((*itr)->getTarget()); - if (targetList.empty()) - { - SpectralBlastTimer = 1000; - return; - } - std::list::const_iterator i = targetList.begin(); - advance(i, rand()%targetList.size()); - if ((*i)) - { - (*i)->CastSpell((*i), SPELL_SPECTRAL_BLAST,true); - SpectralBlastTimer = 20000+rand()%5000; - } else SpectralBlastTimer = 1000; - } else SpectralBlastTimer -= diff; - - DoMeleeAttackIfReady(); - } - } - - void MoveInLineOfSight(Unit *who) - { - if (bJustReset)//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 DamageTaken(Unit *done_by, uint32 &damage) - { - if (damage >= me->GetHealth() && done_by != me) - damage = 0; - } - - void EnterCombat(Unit* /*who*/) - { - me->SetStandState(UNIT_STAND_STATE_STAND); - DoScriptText(SAY_EVIL_AGGRO, me); - DoZoneInCombat(); - - if (pInstance) - pInstance->SetData(DATA_KALECGOS_EVENT, IN_PROGRESS); - } - - void KilledUnit(Unit * /*victim*/) - { - DoScriptText(RAND(SAY_EVIL_SLAY1,SAY_EVIL_SLAY2), me); - } - - void MovementInform(uint32 type,uint32 /*id*/) - { - if (type != POINT_MOTION_TYPE) - return; - me->SetVisibility(VISIBILITY_OFF); - if (isFriendly) - { - me->setDeathState(JUST_DIED); - - Map::PlayerList const& players = me->GetMap()->GetPlayers(); - if (!players.isEmpty()) - { - for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) - { - Player* pPlayer = itr->getSource(); - if (pPlayer) - ((InstanceMap*)me->GetMap())->PermBindAllPlayers(pPlayer); - } - } - } - else - { - me->GetMotionMaster()->MoveTargetedHome(); - TalkTimer = 1000; - } - } - - void GoodEnding() - { - switch(TalkSequence) - { - case 1: - me->setFaction(35); - TalkTimer = 1000; - break; - case 2: - DoScriptText(SAY_GOOD_PLRWIN, me); - TalkTimer = 10000; - break; - case 3: - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - me->GetMotionMaster()->MovePoint(0,FLY_X,FLY_Y,FLY_Z); - TalkTimer = 600000; - break; - default: - break; - } - } - - void BadEnding() - { - switch(TalkSequence) - { - case 1: - DoScriptText(SAY_EVIL_ENRAGE, me); - TalkTimer = 3000; - break; - case 2: - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - me->GetMotionMaster()->MovePoint(0,FLY_X,FLY_Y,FLY_Z); - TalkTimer = 15000; - break; - case 3: - EnterEvadeMode(); - break; - default: - break; - } - } -}; - -struct boss_sathrovarrAI : public ScriptedAI -{ - boss_sathrovarrAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - KalecGUID = 0; - KalecgosGUID = 0; - } - - ScriptedInstance *pInstance; - - uint32 CorruptionStrikeTimer; - uint32 AgonyCurseTimer; - uint32 ShadowBoltTimer; - uint32 CheckTimer; - uint32 ResetThreat; - - uint64 KalecGUID; - uint64 KalecgosGUID; - - bool isEnraged; - bool isBanished; - - void Reset() - { - me->SetHealth(me->GetMaxHealth());//dunno why it does not resets health at evade.. - me->setActive(true); - if (pInstance) - { - KalecgosGUID = pInstance->GetData64(DATA_KALECGOS_DRAGON); - pInstance->SetData(DATA_KALECGOS_EVENT, NOT_STARTED); - } - if (KalecGUID) - { - if (Creature* Kalec = Unit::GetCreature(*me, KalecGUID)) - Kalec->setDeathState(JUST_DIED); - KalecGUID = 0; - } - - ShadowBoltTimer = 7000 + rand()%3 * 1000; - AgonyCurseTimer = 20000; - CorruptionStrikeTimer = 13000; - CheckTimer = 1000; - ResetThreat = 1000; - isEnraged = false; - isBanished = false; - - me->CastSpell(me, AURA_DEMONIC_VISUAL, true); - TeleportAllPlayersBack(); - } - - void EnterCombat(Unit* /*who*/) - { - if (Creature *Kalec = me->SummonCreature(MOB_KALEC, me->GetPositionX() + 10, me->GetPositionY() + 5, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 0)) - { - KalecGUID = Kalec->GetGUID(); - me->CombatStart(Kalec); - me->AddThreat(Kalec, 100.0f); - Kalec->setActive(true); - } - DoScriptText(SAY_SATH_AGGRO, me); - } - - void DamageTaken(Unit *done_by, uint32 &damage) - { - if (damage >= me->GetHealth() && done_by != me) - damage = 0; - } - - void KilledUnit(Unit *pTarget) - { - if (pTarget->GetGUID() == KalecGUID) - { - TeleportAllPlayersBack(); - if (Creature *Kalecgos = Unit::GetCreature(*me, KalecgosGUID)) - { - CAST_AI(boss_kalecgosAI, Kalecgos->AI())->TalkTimer = 1; - CAST_AI(boss_kalecgosAI, Kalecgos->AI())->isFriendly = false; - } - EnterEvadeMode(); - return; - } - DoScriptText(RAND(SAY_SATH_SLAY1,SAY_SATH_SLAY2), me); - } - - void JustDied(Unit * /*killer*/) - { - DoScriptText(SAY_SATH_DEATH, me); - me->GetMap()->CreatureRelocation(me, me->GetPositionX(), me->GetPositionY(), DRAGON_REALM_Z, me->GetOrientation()); - TeleportAllPlayersBack(); - if (Creature *Kalecgos = Unit::GetCreature(*me, KalecgosGUID)) - { - CAST_AI(boss_kalecgosAI, Kalecgos->AI())->TalkTimer = 1; - CAST_AI(boss_kalecgosAI, Kalecgos->AI())->isFriendly = true; - } - - if (pInstance) - pInstance->SetData(DATA_KALECGOS_EVENT, DONE); - } - - void TeleportAllPlayersBack() - { - Map* pMap = me->GetMap(); - if (!pMap->IsDungeon()) return; - Map::PlayerList const &PlayerList = pMap->GetPlayers(); - for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) - { - if (i->getSource()->GetPositionZ() <= DRAGON_REALM_Z-5) - { - i->getSource()->RemoveAura(AURA_SPECTRAL_REALM); - i->getSource()->TeleportTo(me->GetMap()->GetId(),i->getSource()->GetPositionX(),i->getSource()->GetPositionY(),DRAGON_REALM_Z+5,i->getSource()->GetOrientation()); - } - } - } - - void DoAction(const int32 param) - { - switch (param) - { - case DO_ENRAGE: - isEnraged = true; - me->CastSpell(me, SPELL_ENRAGE, true); - break; - case DO_BANISH: - isBanished = true; - me->CastSpell(me, SPELL_BANISH, true); - break; - } - } - - void UpdateAI(const uint32 diff) - { - if (!me->HasAura(AURA_SPECTRAL_INVISIBILITY)) - me->CastSpell(me, AURA_SPECTRAL_INVISIBILITY, true); - if (!UpdateVictim()) - return; - - if (CheckTimer <= diff) - { - Creature *Kalec = Unit::GetCreature(*me, KalecGUID); - if (!Kalec || (Kalec && !Kalec->isAlive())) - { - if (Creature *Kalecgos = Unit::GetCreature(*me, KalecgosGUID)) - Kalecgos->AI()->EnterEvadeMode(); - return; - } - if (HealthBelowPct(10) && !isEnraged) - { - if (Creature* Kalecgos = Unit::GetCreature(*me, KalecgosGUID)) - Kalecgos->AI()->DoAction(DO_ENRAGE); - DoAction(DO_ENRAGE); - } - Creature *Kalecgos = Unit::GetCreature(*me, KalecgosGUID); - if (Kalecgos) - { - if (!Kalecgos->isInCombat()) - { - me->AI()->EnterEvadeMode(); - return; - } - } - if (!isBanished && HealthBelowPct(1)) - { - if (Kalecgos) - { - if (Kalecgos->HasAura(SPELL_BANISH)) - { - me->DealDamage(me, me->GetHealth()); - return; - } - else - DoAction(DO_BANISH); - } - else - { - me->MonsterTextEmote(EMOTE_UNABLE_TO_FIND, NULL); - EnterEvadeMode(); - return; - } - } - CheckTimer = 1000; - } else CheckTimer -= diff; - - if (ResetThreat <= diff) - { - for (std::list::const_iterator itr = me->getThreatManager().getThreatList().begin(); itr != me->getThreatManager().getThreatList().end(); ++itr) - { - if (Unit* pUnit = Unit::GetUnit(*me, (*itr)->getUnitGuid())) - { - if (pUnit->GetPositionZ() > me->GetPositionZ()+5) - { - me->getThreatManager().modifyThreatPercent(pUnit,-100); - } - } - } - ResetThreat = 1000; - } else ResetThreat -= diff; - - if (ShadowBoltTimer <= diff) - { - if (!(rand()%5))DoScriptText(SAY_SATH_SPELL1, me); - DoCast(me, SPELL_SHADOW_BOLT); - ShadowBoltTimer = 7000+(rand()%3000); - } else ShadowBoltTimer -= diff; - - if (AgonyCurseTimer <= diff) - { - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (!pTarget) pTarget = me->getVictim(); - DoCast(pTarget, SPELL_AGONY_CURSE); - AgonyCurseTimer = 20000; - } else AgonyCurseTimer -= diff; - - if (CorruptionStrikeTimer <= diff) - { - if (!(rand()%5))DoScriptText(SAY_SATH_SPELL2, me); - DoCast(me->getVictim(), SPELL_CORRUPTION_STRIKE); - CorruptionStrikeTimer = 13000; - } else CorruptionStrikeTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -struct boss_kalecAI : public ScriptedAI -{ - ScriptedInstance *pInstance; - - uint32 RevitalizeTimer; - uint32 HeroicStrikeTimer; - uint32 YellTimer; - uint32 YellSequence; - - uint64 SathGUID; - - bool isEnraged; // if demon is enraged - - boss_kalecAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - void Reset() - { - if (pInstance) - SathGUID = pInstance->GetData64(DATA_SATHROVARR); - - RevitalizeTimer = 5000; - HeroicStrikeTimer = 3000; - YellTimer = 5000; - YellSequence = 0; - - isEnraged = false; - } - - void DamageTaken(Unit *done_by, uint32 &damage) - { - if (done_by->GetGUID() != SathGUID) - damage = 0; - else if (isEnraged) - damage *= 3; - } - - void UpdateAI(const uint32 diff) - { - if (!me->HasAura(AURA_SPECTRAL_INVISIBILITY)) - me->CastSpell(me, AURA_SPECTRAL_INVISIBILITY, true); - if (!UpdateVictim()) - return; - - if (YellTimer <= diff) - { - switch(YellSequence) - { - case 0: - DoScriptText(SAY_GOOD_AGGRO, me); - ++YellSequence; - break; - case 1: - if (HealthBelowPct(50)) - { - DoScriptText(SAY_GOOD_NEAR_DEATH, me); - ++YellSequence; - } - break; - case 2: - if (HealthBelowPct(10)) - { - DoScriptText(SAY_GOOD_NEAR_DEATH2, me); - ++YellSequence; - } - break; - default: - break; - } - YellTimer = 5000; - } - - if (RevitalizeTimer <= diff) - { - DoCast(me, SPELL_REVITALIZE); - RevitalizeTimer = 5000; - } else RevitalizeTimer -= diff; - - if (HeroicStrikeTimer <= diff) - { - DoCast(me->getVictim(), SPELL_HEROIC_STRIKE); - HeroicStrikeTimer = 2000; - } else HeroicStrikeTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -bool GOkalecgos_teleporter(Player* pPlayer, GameObject* pGo) -{ - uint32 SpectralPlayers = 0; - Map* pMap = pGo->GetMap(); - if (!pMap->IsDungeon()) return true; - Map::PlayerList const &PlayerList = pMap->GetPlayers(); - for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) - { - if (i->getSource() && i->getSource()->GetPositionZ() < DEMON_REALM_Z + 5) - ++SpectralPlayers; - } - if (pPlayer->HasAura(AURA_SPECTRAL_EXHAUSTION) || (MAX_PLAYERS_IN_SPECTRAL_REALM && SpectralPlayers >= MAX_PLAYERS_IN_SPECTRAL_REALM)) - pPlayer->GetSession()->SendNotification(GO_FAILED); - else - pPlayer->CastSpell(pPlayer, SPELL_TELEPORT_SPECTRAL, true); - return true; -} - -CreatureAI* GetAI_boss_kalecgos(Creature* pCreature) -{ - return new boss_kalecgosAI (pCreature); -} - -CreatureAI* GetAI_boss_Sathrovarr(Creature* pCreature) -{ - return new boss_sathrovarrAI (pCreature); -} - -CreatureAI* GetAI_boss_kalec(Creature* pCreature) -{ - return new boss_kalecAI (pCreature); -} - -void AddSC_boss_kalecgos() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_kalecgos"; - newscript->GetAI = &GetAI_boss_kalecgos; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_sathrovarr"; - newscript->GetAI = &GetAI_boss_Sathrovarr; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_kalec"; - newscript->GetAI = &GetAI_boss_kalec; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "kalecgos_teleporter"; - newscript->pGOHello = &GOkalecgos_teleporter; - newscript->RegisterSelf(); -} diff --git a/src/server/scripts/EasternKingdoms/sunwell_plateau/boss_kiljaeden.cpp b/src/server/scripts/EasternKingdoms/sunwell_plateau/boss_kiljaeden.cpp deleted file mode 100644 index f1c3a769b28..00000000000 --- a/src/server/scripts/EasternKingdoms/sunwell_plateau/boss_kiljaeden.cpp +++ /dev/null @@ -1,1408 +0,0 @@ -/* Copyright (C) 2009 Trinity - * 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_Kiljaeden -SD%Complete: 80 -SDComment: Sinister Reflection Model, Armageddon Visual, SAY_KJ_SHADOWSPIKE3, Emote, End Sequence -SDCategory: Sunwell_Plateau -EndScriptData */ - -//TODO rewrite Armageddon - -#include "ScriptedPch.h" -#include "sunwell_plateau.h" -#include - -/*** Speech and sounds***/ -enum Yells -{ - // These are used throughout Sunwell and Magisters(?). Players can hear this while running through the instances. - SAY_KJ_OFFCOMBAT1 = -1580066, - SAY_KJ_OFFCOMBAT2 = -1580067, - SAY_KJ_OFFCOMBAT3 = -1580068, - SAY_KJ_OFFCOMBAT4 = -1580069, - SAY_KJ_OFFCOMBAT5 = -1580070, - - // Encounter speech and sounds - SAY_KJ_EMERGE = -1580071, - SAY_KJ_SLAY1 = -1580072, - SAY_KJ_SLAY2 = -1580073, - SAY_KJ_REFLECTION1 = -1580074, - SAY_KJ_REFLECTION2 = -1580075, - SAY_KJ_DARKNESS1 = -1580076, - SAY_KJ_DARKNESS2 = -1580077, - SAY_KJ_DARKNESS3 = -1580078, - SAY_KJ_PHASE3 = -1580079, - SAY_KJ_PHASE4 = -1580080, - SAY_KJ_PHASE5 = -1580081, - SAY_KJ_DEATH = -1580093, - EMOTE_KJ_DARKNESS = -1580094, - - /*** Kalecgos - Anveena speech at the beginning of Phase 5; Anveena's sacrifice ***/ - SAY_KALECGOS_AWAKEN = -1580082, - SAY_ANVEENA_IMPRISONED = -1580083, - SAY_KALECGOS_LETGO = -1580084, - SAY_ANVEENA_LOST = -1580085, - SAY_KALECGOS_FOCUS = -1580086, - SAY_ANVEENA_KALEC = -1580087, - SAY_KALECGOS_FATE = -1580088, - SAY_ANVEENA_GOODBYE = -1580089, - SAY_KALECGOS_GOODBYE = -1580090, - SAY_KALECGOS_ENCOURAGE = -1580091, - - /*** Kalecgos says throughout the fight ***/ - SAY_KALECGOS_JOIN = -1580092, - SAY_KALEC_ORB_READY1 = -1580095, - SAY_KALEC_ORB_READY2 = -1580096, - SAY_KALEC_ORB_READY3 = -1580097, - SAY_KALEC_ORB_READY4 = -1580098 -}; - -/*** Spells used during the encounter ***/ -enum Spells -{ - /* Hand of the Deceiver's spells and cosmetics */ - SPELL_SHADOW_BOLT_VOLLEY = 45770, // ~30 yard range Shadow Bolt Volley for ~2k(?) damage - SPELL_SHADOW_INFUSION = 45772, // They gain this at 20% - Immunity to Stun/Silence and makes them look angry! - SPELL_FELFIRE_PORTAL = 46875, // Creates a portal that spawns Felfire Fiends (LIVE FOR THE SWARM!1 FOR THE OVERMIND!) - SPELL_SHADOW_CHANNELING = 46757, // Channeling animation out of combat - - /* Volatile Felfire Fiend's spells */ - SPELL_FELFIRE_FISSION = 45779, // Felfire Fiends explode when they die or get close to target. - - /* Kil'Jaeden's spells and cosmetics */ - SPELL_TRANS = 23188, // Surprisingly, this seems to be the right spell.. (Where is it used?) - SPELL_REBIRTH = 44200, // Emerge from the Sunwell - SPELL_SOUL_FLAY = 45442, // 9k Shadow damage over 3 seconds. Spammed throughout all the fight. - SPELL_SOUL_FLAY_SLOW = 47106, - SPELL_LEGION_LIGHTNING = 45664, // Chain Lightning, 4 targets, ~3k Shadow damage, 1.5k mana burn - SPELL_FIRE_BLOOM = 45641, // Places a debuff on 5 raid members, which causes them to deal 2k Fire damage to nearby allies and selves. MIGHT NOT WORK - SPELL_DESTROY_ALL_DRAKES = 46707, // when he use it? - - SPELL_SINISTER_REFLECTION = 45785, // Summon shadow copies of 5 raid members that fight against KJ's enemies//dont work - // 45892 // right one for SPELL_SINISTER_REFLECTION but no EffectScriptEffect - SPELL_COPY_WEAPON = 41055, // } - SPELL_COPY_WEAPON2 = 41054, // } - SPELL_COPY_OFFHAND = 45206, // }- Spells used in Sinister Reflection creation - SPELL_COPY_OFFHAND_WEAPON = 45205, // } - - SPELL_SHADOW_SPIKE = 46680, // Bombard random raid members with Shadow Spikes (Very similar to Void Reaver orbs) - SPELL_FLAME_DART = 45737, // Bombards the raid with flames every 3(?) seconds - SPELL_DARKNESS_OF_A_THOUSAND_SOULS = 46605, // Begins a 8-second channeling, after which he will deal 50'000 damage to the raid - SPELL_DARKNESS_OF_A_THOUSAND_SOULS_DAMAGE = 45657, - - /* Armageddon spells wrong visual */ - SPELL_ARMAGEDDON_TRIGGER = 45909, // Meteor spell trigger missile should cast Creature on himself - SPELL_ARMAGEDDON_VISUAL = 45911, // Does the hellfire visual to indicate where the meteor missle lands - SPELL_ARMAGEDDON_VISUAL2 = 45914, // Does the light visual to indicate where the meteor missle lands - SPELL_ARMAGEDDON_VISUAL3 = 24207, // This shouldn't correct but same as seen on the movie - SPELL_ARMAGEDDON_SUMMON_TRIGGER = 45921, // Summons the triggers that cast the spells on himself need random target select - SPELL_ARMAGEDDON_DAMAGE = 45915, // This does the area damage - - /* Shield Orb Spells*/ - SPELL_SHADOW_BOLT = 45680, //45679 would be correct but triggers to often //TODO fix console error - - /* Anveena's spells and cosmetics (Or, generally, everything that has "Anveena" in name) */ - SPELL_ANVEENA_PRISON = 46367, // She hovers locked within a bubble - SPELL_ANVEENA_ENERGY_DRAIN = 46410, // Sunwell energy glow animation (Control mob uses this) - SPELL_SACRIFICE_OF_ANVEENA = 46474, // This is cast on Kil'Jaeden when Anveena sacrifices herself into the Sunwell - - /* Sinister Reflection Spells */ - SPELL_SR_CURSE_OF_AGONY = 46190, - SPELL_SR_SHADOW_BOLT = 47076, - - SPELL_SR_EARTH_SHOCK = 47071, - - SPELL_SR_FIREBALL = 47074, - - SPELL_SR_HEMORRHAGE = 45897, - - SPELL_SR_HOLY_SHOCK = 38921, - SPELL_SR_HAMMER_OF_JUSTICE = 37369, - - SPELL_SR_HOLY_SMITE = 47077, - SPELL_SR_RENEW = 47079, - - SPELL_SR_SHOOT = 16496, - SPELL_SR_MULTI_SHOT = 48098, - SPELL_SR_WING_CLIP = 40652, - - SPELL_SR_WHIRLWIND = 17207, - - SPELL_SR_MOONFIRE = 47072, - //SPELL_SR_PLAGU STRIKE = 58843, Dk Spell! - - /*** Other Spells (used by players, etc) ***/ - SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT = 45839, // Possess the blue dragon from the orb to help the raid. - SPELL_ENTROPIUS_BODY = 46819, // Visual for Entropius at the Epilogue - SPELL_RING_OF_BLUE_FLAMES = 45825 //Cast this spell when the go is activated -}; - -/*** Error messages ***/ -#define ERROR_KJ_NOT_SUMMONED "TSCR ERROR: Unable to summon Kil'Jaeden for some reason" - -/*** Others ***/ -#define FLOOR_Z 28.050388 -#define SHIELD_ORB_Z 45.000 - -enum Phase -{ - PHASE_DECEIVERS = 1, // Fight 3 adds - PHASE_NORMAL = 2, // Kil'Jaeden emerges from the sunwell - PHASE_DARKNESS = 3, // At 85%, he gains few abilities; Kalecgos joins the fight - PHASE_ARMAGEDDON = 4, // At 55%, he gains even more abilities - PHASE_SACRIFICE = 5, // At 25%, Anveena sacrifices herself into the Sunwell; at this point he becomes enraged and has *significally* shorter cooldowns. -}; - -//Timers -enum KilJaedenTimers -{ - TIMER_SPEECH = 0, - - //Phase 2 Timer - TIMER_SOUL_FLAY = 1, - TIMER_LEGION_LIGHTNING = 2, - TIMER_FIRE_BLOOM = 3, - TIMER_SUMMON_SHILEDORB = 4, - - //Phase 3 Timer - TIMER_SHADOW_SPIKE = 5, - TIMER_FLAME_DART = 6, - TIMER_DARKNESS = 7, - TIMER_ORBS_EMPOWER = 8, - - //Phase 4 Timer - TIMER_ARMAGEDDON = 9 -}; - -// Locations of the Hand of Deceiver adds -Position DeceiverLocations[3]= -{ - {1682.045, 631.299, 5.936}, - {1684.099, 618.848, 0.589}, - {1694.170, 612.272, 1.416}, -}; - -// Locations, where Shield Orbs will spawn -float ShieldOrbLocations[4][2]= -{ - {1698.900, 627.870}, // middle pont of Sunwell - {12, 3.14}, // First one spawns northeast of KJ - {12, 3.14/0.7}, // Second one spawns southeast - {12, 3.14*3.8} // Third one spawns (?) -}; - -struct Speech -{ - int32 textid; - uint32 pCreature, timer; -}; - -// Timers -static Speech Speeches[]= -{ - //Kil Phase 1 -> Phase 2 - {SAY_KJ_EMERGE, DATA_KILJAEDEN, 0}, - {SAY_KALECGOS_JOIN, DATA_KALECGOS_KJ, 26000}, - //Kil Phase 2 -> Phase 3 - {SAY_KALECGOS_AWAKEN, DATA_KALECGOS_KJ, 10000}, - {SAY_ANVEENA_IMPRISONED, DATA_ANVEENA, 5000}, - {SAY_KJ_PHASE3, DATA_KILJAEDEN, 5000}, - //Kil Phase 3 -> Phase 4 - {SAY_KALECGOS_LETGO, DATA_KALECGOS_KJ, 10000}, - {SAY_ANVEENA_LOST, DATA_ANVEENA, 8000}, - {SAY_KJ_PHASE4, DATA_KILJAEDEN, 7000}, - //Kil Phase 4 -> Phase 5 - {SAY_KALECGOS_FOCUS, DATA_KALECGOS_KJ, 4000}, - {SAY_ANVEENA_KALEC, DATA_ANVEENA, 11000}, - {SAY_KALECGOS_FATE, DATA_KALECGOS_KJ, 2000}, - {SAY_ANVEENA_GOODBYE, DATA_ANVEENA, 6000}, - {SAY_KJ_PHASE5, DATA_KILJAEDEN, 5500}, - - // use in End sequence? - {SAY_KALECGOS_GOODBYE, DATA_KALECGOS_KJ, 12000}, -}; - -//AI for Kalecgos -struct boss_kalecgos_kjAI : public ScriptedAI -{ - boss_kalecgos_kjAI(Creature* c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - uint8 OrbsEmpowered; - uint8 EmpowerCount; - - void Reset() - { - OrbsEmpowered = 0; - EmpowerCount = 0; - me->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_LEVITATING); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->setActive(true); - - for (uint8 i = 0; i < 4; ++i) - if (GameObject* pOrb = GetOrb(i)) - pOrb->SetGoType(GAMEOBJECT_TYPE_BUTTON); - } - - GameObject* GetOrb(int32 index) - { - if (!pInstance) - return NULL; - - switch(index) - { - case 0: - return pInstance->instance->GetGameObject(pInstance->GetData64(DATA_ORB_OF_THE_BLUE_DRAGONFLIGHT_1)); - case 1: - return pInstance->instance->GetGameObject(pInstance->GetData64(DATA_ORB_OF_THE_BLUE_DRAGONFLIGHT_2)); - case 2: - return pInstance->instance->GetGameObject(pInstance->GetData64(DATA_ORB_OF_THE_BLUE_DRAGONFLIGHT_3)); - case 3: - return pInstance->instance->GetGameObject(pInstance->GetData64(DATA_ORB_OF_THE_BLUE_DRAGONFLIGHT_4)); - } - - return NULL; - } - - void ResetOrbs() - { - me->RemoveDynObject(SPELL_RING_OF_BLUE_FLAMES); - for (uint8 i = 0; i < 4; ++i) - if (GameObject* pOrb = GetOrb(i)) - pOrb->SetUInt32Value(GAMEOBJECT_FACTION, 0); - } - - void EmpowerOrb(bool all) - { - GameObject* pOrbEmpowered = GetOrb(OrbsEmpowered); - if (!pOrbEmpowered) - return; - - if (all) - { - me->RemoveDynObject(SPELL_RING_OF_BLUE_FLAMES); - for (uint8 i = 0; i < 4; ++i) - { - if (GameObject* pOrb = GetOrb(i)) - { - pOrb->CastSpell(me, SPELL_RING_OF_BLUE_FLAMES); - pOrb->SetUInt32Value(GAMEOBJECT_FACTION, 35); - pOrb->setActive(true); - pOrb->Refresh(); - } - } - DoScriptText(SAY_KALECGOS_ENCOURAGE, me); - } - else - { - if (GameObject* pOrb = GetOrb(urand(0,3))) - { - pOrb->CastSpell(me, SPELL_RING_OF_BLUE_FLAMES); - pOrb->SetUInt32Value(GAMEOBJECT_FACTION, 35); - pOrb->setActive(true); - pOrb->Refresh(); - - OrbsEmpowered = (OrbsEmpowered+1)%4; - - ++EmpowerCount; - switch(EmpowerCount) - { - case 1: DoScriptText(SAY_KALEC_ORB_READY1, me); break; - case 2: DoScriptText(SAY_KALEC_ORB_READY2, me); break; - case 3: DoScriptText(SAY_KALEC_ORB_READY3, me); break; - case 4: DoScriptText(SAY_KALEC_ORB_READY4, me); break; - } - } - } - } - - void UpdateAI(const uint32 diff) - { - } - - void SetRingOfBlueFlames() - { - me->RemoveDynObject(SPELL_RING_OF_BLUE_FLAMES); - for (uint8 i = 0; i < 4; ++i) - { - if (GameObject* pOrb = GetOrb(i)) - { - if (pOrb->GetUInt32Value(GAMEOBJECT_FACTION) == 35) - { - pOrb->CastSpell(me, SPELL_RING_OF_BLUE_FLAMES); - pOrb->setActive(true); - pOrb->Refresh(); - } - } - } - } -}; - -CreatureAI* GetAI_boss_kalecgos_kj(Creature* pCreature) -{ - return new boss_kalecgos_kjAI (pCreature); -} - -bool GOHello_go_orb_of_the_blue_flight(Player* pPlayer, GameObject* pGo) -{ - if (pGo->GetUInt32Value(GAMEOBJECT_FACTION) == 35) - { - ScriptedInstance* pInstance = pGo->GetInstanceData(); - pPlayer->SummonCreature(CREATURE_POWER_OF_THE_BLUE_DRAGONFLIGHT, pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN, 121000); - pPlayer->CastSpell(pPlayer, SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT, false); - pGo->SetUInt32Value(GAMEOBJECT_FACTION, 0); - - if (Creature* pKalec = Unit::GetCreature(*pPlayer, pInstance->GetData64(DATA_KALECGOS_KJ))) - CAST_AI(boss_kalecgos_kjAI, pKalec->AI())->SetRingOfBlueFlames(); - - pGo->Refresh(); - } - return true; -} - -//AI for Kil'jaeden Event Controller -struct mob_kiljaeden_controllerAI : public Scripted_NoMovementAI -{ - mob_kiljaeden_controllerAI(Creature* c) : Scripted_NoMovementAI(c), summons(me) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - SummonList summons; - - bool bSummonedDeceivers; - bool bKiljaedenDeath; - - uint32 uiRandomSayTimer; - uint32 phase; - uint8 deceiverDeathCount; - - void InitializeAI() - { - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->addUnitState(UNIT_STAT_STUNNED); - - ScriptedAI::InitializeAI(); - } - - void Reset() - { - phase = PHASE_DECEIVERS; - - if (Creature* pKalecKJ = Unit::GetCreature((*me), pInstance->GetData64(DATA_KALECGOS_KJ))) - CAST_AI(boss_kalecgos_kjAI, pKalecKJ->AI())->ResetOrbs(); - deceiverDeathCount = 0; - bSummonedDeceivers = false; - bKiljaedenDeath = false; - uiRandomSayTimer = 30000; - summons.DespawnAll(); - } - - void JustSummoned(Creature* summoned) - { - switch(summoned->GetEntry()) - { - case CREATURE_HAND_OF_THE_DECEIVER: - summoned->CastSpell(summoned, SPELL_SHADOW_CHANNELING, false); - break; - case CREATURE_ANVEENA: - summoned->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_LEVITATING); - summoned->CastSpell(summoned, SPELL_ANVEENA_PRISON, true); - summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - break; - case CREATURE_KILJAEDEN: - summoned->CastSpell(summoned, SPELL_REBIRTH, false); - summoned->AddThreat(me->getVictim(), 1.0f); - break; - } - summons.Summon(summoned); - } - - void UpdateAI(const uint32 diff) - { - if (uiRandomSayTimer < diff) - { - if (pInstance && pInstance->GetData(DATA_MURU_EVENT) != DONE && pInstance->GetData(DATA_KILJAEDEN_EVENT) == NOT_STARTED) - DoScriptText(RAND(SAY_KJ_OFFCOMBAT1,SAY_KJ_OFFCOMBAT2,SAY_KJ_OFFCOMBAT3,SAY_KJ_OFFCOMBAT4,SAY_KJ_OFFCOMBAT5), me); - uiRandomSayTimer = 30000; - } else uiRandomSayTimer -= diff; - - if (!bSummonedDeceivers) - { - for (uint8 i = 0; i < 3; ++i) - me->SummonCreature(CREATURE_HAND_OF_THE_DECEIVER, DeceiverLocations[i], TEMPSUMMON_DEAD_DESPAWN, 0); - - DoSpawnCreature(CREATURE_ANVEENA, 0, 0, 40, 0, TEMPSUMMON_DEAD_DESPAWN, 0); - DoCast(me, SPELL_ANVEENA_ENERGY_DRAIN); - bSummonedDeceivers = true; - } - - if (deceiverDeathCount > 2 && phase == PHASE_DECEIVERS) - { - me->RemoveAurasDueToSpell(SPELL_ANVEENA_ENERGY_DRAIN); - phase = PHASE_NORMAL; - DoSpawnCreature(CREATURE_KILJAEDEN, 0, 0,0, 0, TEMPSUMMON_MANUAL_DESPAWN, 0); - } - } -}; - -CreatureAI* GetAI_mob_kiljaeden_controller(Creature* pCreature) -{ - return new mob_kiljaeden_controllerAI (pCreature); -} - -//AI for Kil'jaeden -struct boss_kiljaedenAI : public Scripted_NoMovementAI -{ - boss_kiljaedenAI(Creature* c) : Scripted_NoMovementAI(c), summons(me) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - SummonList summons; - - uint8 Phase; - uint8 ActiveTimers; - uint32 SpeechTimer; - - uint32 Timer[10]; - uint32 WaitTimer; - uint8 speechCount; - uint8 speechPhaseEnd; - - /* Boolean */ - bool IsInDarkness; - bool TimerIsDeactivated[10]; - bool IsWaiting; - bool OrbActivated; - bool SpeechBegins; - - void InitializeAI() - { - Scripted_NoMovementAI::InitializeAI(); - } - - void Reset() - { - TimerIsDeactivated[TIMER_SPEECH] = false; - Timer[TIMER_SPEECH] = 0; - - //Phase 2 Timer - Timer[TIMER_SOUL_FLAY] = 11000; - Timer[TIMER_LEGION_LIGHTNING] = 30000; - Timer[TIMER_FIRE_BLOOM] = 20000; - Timer[TIMER_SUMMON_SHILEDORB] = 35000; - - //Phase 3 Timer - Timer[TIMER_SHADOW_SPIKE] = 4000; - Timer[TIMER_FLAME_DART] = 3000; - Timer[TIMER_DARKNESS] = 45000; - Timer[TIMER_ORBS_EMPOWER] = 35000; - - //Phase 4 Timer - Timer[TIMER_ARMAGEDDON] = 2000; - - ActiveTimers = 5; - WaitTimer = 0; - speechCount = 0; - SpeechTimer = 0; - - Phase = PHASE_NORMAL; - - IsInDarkness = false; - IsWaiting = false; - OrbActivated = false; - SpeechBegins = true; - - if (pInstance) - { - if (Creature* pKalec = Unit::GetCreature(*me, pInstance->GetData64(DATA_KALECGOS_KJ))) - pKalec->RemoveDynObject(SPELL_RING_OF_BLUE_FLAMES); - } - me->SetFloatValue(UNIT_FIELD_COMBATREACH, 12); - ChangeTimers(false, 0); - summons.DespawnAll(); - } - - void ChangeTimers(bool status, uint32 WTimer) - { - for (uint8 i = 1; i < ActiveTimers; ++i) - TimerIsDeactivated[i] = status; - - if (WTimer > 0) - { - IsWaiting = true; - WaitTimer = WTimer; - } - - if (OrbActivated) - TimerIsDeactivated[TIMER_ORBS_EMPOWER] = true; - if (Timer[TIMER_SHADOW_SPIKE] == 0) - TimerIsDeactivated[TIMER_SHADOW_SPIKE] = true; - if (Phase == PHASE_SACRIFICE) - TimerIsDeactivated[TIMER_SUMMON_SHILEDORB] = true; - } - - void JustSummoned(Creature* summoned) - { - if (summoned->GetEntry() == CREATURE_ARMAGEDDON_TARGET) - { - summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - // summoned->SetVisibility(VISIBILITY_OFF); //with this we cant see the armageddon visuals - } - else - summoned->SetLevel(me->getLevel()); - - summoned->setFaction(me->getFaction()); - summons.Summon(summoned); - } - - void JustDied(Unit* killer) - { - DoScriptText(SAY_KJ_DEATH, me); - summons.DespawnAll(); - - if (pInstance) - pInstance->SetData(DATA_KILJAEDEN_EVENT, DONE); - } - - void KilledUnit(Unit* victim) - { - DoScriptText(RAND(SAY_KJ_SLAY1,SAY_KJ_SLAY2), me); - } - - void EnterEvadeMode() - { - Scripted_NoMovementAI::EnterEvadeMode(); - summons.DespawnAll(); - - // Reset the controller - if (pInstance) - { - if (Creature* pControl = Unit::GetCreature(*me, pInstance->GetData64(DATA_KILJAEDEN_CONTROLLER))) - CAST_AI(mob_kiljaeden_controllerAI, pControl->AI())->Reset(); - } - } - - void EnterCombat(Unit* who) - { - DoZoneInCombat(); - } - - void EnterNextPhase() - { - SpeechBegins = true; - OrbActivated = false; - ChangeTimers(true, 0);//stop every cast Shadow spike will reactivate em all - TimerIsDeactivated[TIMER_SHADOW_SPIKE] = false; - Timer[TIMER_SHADOW_SPIKE] = 100; - // empowered orbs before darkness - Timer[TIMER_DARKNESS] = (Phase == PHASE_SACRIFICE) ? 15000 : urand(10000,40000); - Timer[TIMER_ORBS_EMPOWER] = (Phase == PHASE_SACRIFICE) ? 10000 : 5000; - } - - void CastSinisterReflection() - { - DoScriptText(RAND(SAY_KJ_REFLECTION1,SAY_KJ_REFLECTION2), me); - for (uint8 i = 0; i < 4; ++i) - { - float x,y,z; - Unit *pTarget; - for (uint8 z = 0; z < 6; ++z) - { - pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); - if (!pTarget->HasAura(SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT,0))break; - } - if (pTarget) - { - pTarget->GetPosition(x,y,z); - if (Creature* pSinisterReflection = me->SummonCreature(CREATURE_SINISTER_REFLECTION, x,y,z,0, TEMPSUMMON_CORPSE_DESPAWN, 0)) - { - pSinisterReflection->SetDisplayId(pTarget->GetDisplayId()); - pSinisterReflection->AI()->AttackStart(pTarget); - } - } - } - } - - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim() || Phase < PHASE_NORMAL) - return; - - if (IsWaiting) - { - if (WaitTimer <= diff) - { - IsWaiting = false; - ChangeTimers(false, 0); - } else WaitTimer -= diff; - } - - for (uint8 t = 0; t < ActiveTimers; ++t) - { - if (Timer[t] < diff && !TimerIsDeactivated[t]) - { - switch(t) - { - case TIMER_SPEECH: - if (SpeechBegins) - { - SpeechBegins=false; - switch(Phase) - { - case PHASE_NORMAL: - speechPhaseEnd=1; - break; - case PHASE_DARKNESS: - speechPhaseEnd=4; - break; - case PHASE_ARMAGEDDON: - speechPhaseEnd=7; - break; - case PHASE_SACRIFICE: - speechPhaseEnd=12; - break; - } - } - if (Speeches[speechCount].timer < SpeechTimer) - { - SpeechTimer = 0; - if (Creature* pSpeechCreature = Unit::GetCreature(*me, pInstance->GetData64(Speeches[speechCount].pCreature))) - DoScriptText(Speeches[speechCount].textid, pSpeechCreature); - if (speechCount == 12) - if (Creature* pAnveena = Unit::GetCreature(*me, pInstance->GetData64(DATA_ANVEENA))) - pAnveena->CastSpell(me, SPELL_SACRIFICE_OF_ANVEENA, false); - // ChangeTimers(true, 10000); // Kil should do an emote while screaming without attacking for 10 seconds - if (speechCount == speechPhaseEnd) - TimerIsDeactivated[TIMER_SPEECH]=true; - speechCount++; - } - SpeechTimer += diff; - break; - case TIMER_SOUL_FLAY: - if (!me->IsNonMeleeSpellCasted(false)) - { - DoCast(me->getVictim(), SPELL_SOUL_FLAY_SLOW, false); - DoCast(me->getVictim(), SPELL_SOUL_FLAY, false); - Timer[TIMER_SOUL_FLAY] = 3500; - } - break; - case TIMER_LEGION_LIGHTNING: - if (!me->IsNonMeleeSpellCasted(false)) - { - Unit* pRandomPlayer; - - me->RemoveAurasDueToSpell(SPELL_SOUL_FLAY); - for (uint8 z = 0; z < 6; ++z) - { - pRandomPlayer = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); - if (!pRandomPlayer->HasAura(SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT,0)) - break; - } - - if (pRandomPlayer) - DoCast(pRandomPlayer, SPELL_LEGION_LIGHTNING, false); - else - error_log("try to cast SPELL_LEGION_LIGHTNING on invalid target"); - - Timer[TIMER_LEGION_LIGHTNING] = (Phase == PHASE_SACRIFICE) ? 18000 : 30000; // 18 seconds in PHASE_SACRIFICE - Timer[TIMER_SOUL_FLAY] = 2500; - } - break; - case TIMER_FIRE_BLOOM: - if (!me->IsNonMeleeSpellCasted(false)) - { - me->RemoveAurasDueToSpell(SPELL_SOUL_FLAY); - DoCastAOE(SPELL_FIRE_BLOOM, false); - Timer[TIMER_FIRE_BLOOM] = (Phase == PHASE_SACRIFICE) ? 25000 : 40000; // 25 seconds in PHASE_SACRIFICE - Timer[TIMER_SOUL_FLAY] = 1000; - } - break; - case TIMER_SUMMON_SHILEDORB: - for (uint8 i = 1; i < Phase; ++i) - { - float sx, sy; - sx = ShieldOrbLocations[0][0] + sin(ShieldOrbLocations[i][0]); - sy = ShieldOrbLocations[0][1] + sin(ShieldOrbLocations[i][1]); - me->SummonCreature(CREATURE_SHIELD_ORB, sx, sy, SHIELD_ORB_Z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000); - } - Timer[TIMER_SUMMON_SHILEDORB] = urand(30000,60000); // 30-60seconds cooldown - Timer[TIMER_SOUL_FLAY] = 2000; - break; - case TIMER_SHADOW_SPIKE: //Phase 3 - if (!me->IsNonMeleeSpellCasted(false)) - { - CastSinisterReflection(); - DoCastAOE(SPELL_SHADOW_SPIKE, false); - ChangeTimers(true, 30000); - Timer[TIMER_SHADOW_SPIKE] = 0; - TimerIsDeactivated[TIMER_SPEECH] = false; - } - break; - case TIMER_FLAME_DART: //Phase 3 - DoCastAOE(SPELL_FLAME_DART, false); - Timer[TIMER_FLAME_DART] = 3000; //TODO Timer - break; - case TIMER_DARKNESS: //Phase 3 - if (!me->IsNonMeleeSpellCasted(false)) - { - // Begins to channel for 8 seconds, then deals 50'000 damage to all raid members. - if (!IsInDarkness) - { - DoScriptText(EMOTE_KJ_DARKNESS, me); - DoCastAOE(SPELL_DARKNESS_OF_A_THOUSAND_SOULS, false); - ChangeTimers(true, 9000); - Timer[TIMER_DARKNESS] = 8750; - TimerIsDeactivated[TIMER_DARKNESS] = false; - if (Phase == PHASE_SACRIFICE) - TimerIsDeactivated[TIMER_ARMAGEDDON] = false; - IsInDarkness = true; - } - else - { - Timer[TIMER_DARKNESS] = (Phase == PHASE_SACRIFICE) ? 15000 : urand(40000,70000); - IsInDarkness = false; - DoCastAOE(SPELL_DARKNESS_OF_A_THOUSAND_SOULS_DAMAGE); - DoScriptText(RAND(SAY_KJ_DARKNESS1,SAY_KJ_DARKNESS2,SAY_KJ_DARKNESS3), me); - } - Timer[TIMER_SOUL_FLAY] = 9000; - } - break; - case TIMER_ORBS_EMPOWER: //Phase 3 - if (Creature* pKalec = Unit::GetCreature(*me, pInstance->GetData64(DATA_KALECGOS_KJ))) - { - switch (Phase) - { - case PHASE_SACRIFICE: - CAST_AI(boss_kalecgos_kjAI, pKalec->AI())->EmpowerOrb(true); - break; - default: - CAST_AI(boss_kalecgos_kjAI, pKalec->AI())->EmpowerOrb(false); - break; - } - } - OrbActivated = true; - TimerIsDeactivated[TIMER_ORBS_EMPOWER] = true; - break; - case TIMER_ARMAGEDDON: //Phase 4 - Unit *pTarget; - for (uint8 z = 0; z < 6; ++z) - { - pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); - if (!pTarget->HasAura(SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT,0)) break; - } - if (pTarget) - { - float x, y, z; - pTarget->GetPosition(x, y, z); - me->SummonCreature(CREATURE_ARMAGEDDON_TARGET, x,y,z,0, TEMPSUMMON_TIMED_DESPAWN,15000); - } - Timer[TIMER_ARMAGEDDON] = 2000; // No, I'm not kidding - break; - } - } - } - DoMeleeAttackIfReady(); - //Time runs over! - for (uint8 i = 0; i < ActiveTimers; ++i) - if (!TimerIsDeactivated[i]) - { - Timer[i] -= diff; - if (((int32)Timer[i]) < 0) Timer[i] = 0; - } - - //Phase 3 - if (Phase <= PHASE_NORMAL && !IsInDarkness) - { - if (Phase == PHASE_NORMAL && HealthBelowPct(85)) - { - Phase = PHASE_DARKNESS; - ActiveTimers = 9; - EnterNextPhase(); - } - else return; - } - - //Phase 4 - if (Phase <= PHASE_DARKNESS && !IsInDarkness) - { - if (Phase == PHASE_DARKNESS && HealthBelowPct(55)) - { - Phase = PHASE_ARMAGEDDON; - ActiveTimers = 10; - EnterNextPhase(); - } - else return; - } - - //Phase 5 specific spells all we can - if (Phase <= PHASE_ARMAGEDDON && !IsInDarkness) - { - if (Phase == PHASE_ARMAGEDDON && HealthBelowPct(25)) - { - Phase = PHASE_SACRIFICE; - EnterNextPhase(); - } - else return; - } - } -}; - -CreatureAI* GetAI_boss_kiljaeden(Creature* pCreature) -{ - return new boss_kiljaedenAI (pCreature); -} - -//AI for Hand of the Deceiver -struct mob_hand_of_the_deceiverAI : public ScriptedAI -{ - mob_hand_of_the_deceiverAI(Creature* c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint32 ShadowBoltVolleyTimer; - uint32 FelfirePortalTimer; - - void Reset() - { - // TODO: Timers! - ShadowBoltVolleyTimer = urand(8000,14000); // So they don't all cast it in the same moment. - FelfirePortalTimer = 20000; - if (pInstance) - pInstance->SetData(DATA_KILJAEDEN_EVENT, NOT_STARTED); - } - - void JustSummoned(Creature* summoned) - { - summoned->setFaction(me->getFaction()); - summoned->SetLevel(me->getLevel()); - } - - void EnterCombat(Unit* who) - { - if (pInstance) - { - pInstance->SetData(DATA_KILJAEDEN_EVENT, IN_PROGRESS); - if (Creature* pControl = Unit::GetCreature(*me, pInstance->GetData64(DATA_KILJAEDEN_CONTROLLER))) - pControl->AddThreat(who, 1.0f); - } - me->InterruptNonMeleeSpells(true); - } - - void JustDied(Unit* killer) - { - if (!pInstance) - return; - - if (Creature* pControl = Unit::GetCreature(*me, pInstance->GetData64(DATA_KILJAEDEN_CONTROLLER))) - ++(CAST_AI(mob_kiljaeden_controllerAI, pControl->AI())->deceiverDeathCount); - } - - void UpdateAI(const uint32 diff) - { - if (!me->isInCombat()) - DoCast(me, SPELL_SHADOW_CHANNELING); - - if (!UpdateVictim()) - return; - - // Gain Shadow Infusion at 20% health - if (HealthBelowPct(20) && !me->HasAura(SPELL_SHADOW_INFUSION, 0)) - DoCast(me, SPELL_SHADOW_INFUSION, true); - - // Shadow Bolt Volley - Shoots Shadow Bolts at all enemies within 30 yards, for ~2k Shadow damage. - if (ShadowBoltVolleyTimer <= diff) - { - DoCast(me->getVictim(), SPELL_SHADOW_BOLT_VOLLEY); - ShadowBoltVolleyTimer = 12000; - } - else - ShadowBoltVolleyTimer -= diff; - - // Felfire Portal - Creatres a portal, that spawns Volatile Felfire Fiends, which do suicide bombing. - if (FelfirePortalTimer <= diff) - { - if (Creature* pPortal = DoSpawnCreature(CREATURE_FELFIRE_PORTAL, 0, 0,0, 0, TEMPSUMMON_TIMED_DESPAWN, 20000)) - { - std::list::iterator itr; - for (itr = me->getThreatManager().getThreatList().begin(); itr != me->getThreatManager().getThreatList().end(); ++itr) - { - Unit* pUnit = Unit::GetUnit(*me, (*itr)->getUnitGuid()); - if (pUnit) - pPortal->AddThreat(pUnit, 1.0f); - } - } - FelfirePortalTimer = 20000; - } else FelfirePortalTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_hand_of_the_deceiver(Creature* pCreature) -{ - return new mob_hand_of_the_deceiverAI (pCreature); -} - -//AI for Felfire Portal -struct mob_felfire_portalAI : public Scripted_NoMovementAI -{ - mob_felfire_portalAI(Creature* c) : Scripted_NoMovementAI(c) {} - - uint32 uiSpawnFiendTimer; - - void Reset() - { - uiSpawnFiendTimer = 5000; - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_NON_ATTACKABLE); - } - - void JustSummoned(Creature* summoned) - { - summoned->setFaction(me->getFaction()); - summoned->SetLevel(me->getLevel()); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (uiSpawnFiendTimer <= diff) - { - if (Creature* pFiend = DoSpawnCreature(CREATURE_VOLATILE_FELFIRE_FIEND, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 20000)) - pFiend->AddThreat(SelectUnit(SELECT_TARGET_RANDOM,0), 100000.0f); - uiSpawnFiendTimer = urand(4000,8000); - } else uiSpawnFiendTimer -= diff; - } -}; - -CreatureAI* GetAI_mob_felfire_portal(Creature* pCreature) -{ - return new mob_felfire_portalAI (pCreature); -} - -//AI for Felfire Fiend -struct mob_volatile_felfire_fiendAI : public ScriptedAI -{ - mob_volatile_felfire_fiendAI(Creature* c) : ScriptedAI(c) {} - - uint32 uiExplodeTimer; - - bool bLockedTarget; - - void Reset() - { - uiExplodeTimer = 2000; - bLockedTarget = false; - } - - void DamageTaken(Unit *done_by, uint32 &damage) - { - if (damage > me->GetHealth()) - DoCast(me, SPELL_FELFIRE_FISSION, true); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (!bLockedTarget) - { - me->AddThreat(me->getVictim(), 10000000.0f); - bLockedTarget = true; - } - - if (uiExplodeTimer) - { - if (uiExplodeTimer <= diff) - uiExplodeTimer = 0; - else uiExplodeTimer -= diff; - } - else if (me->IsWithinDistInMap(me->getVictim(), 3)) // Explode if it's close enough to it's target - { - DoCast(me->getVictim(), SPELL_FELFIRE_FISSION); - me->Kill(me); - } - } -}; - -CreatureAI* GetAI_mob_volatile_felfire_fiend(Creature* pCreature) -{ - return new mob_volatile_felfire_fiendAI (pCreature); -} - -//AI for Armageddon target -struct mob_armageddonAI : public Scripted_NoMovementAI -{ - mob_armageddonAI(Creature* c) : Scripted_NoMovementAI(c) {} - - uint8 spell; - uint32 uiTimer; - - void Reset() - { - spell = 0; - uiTimer = 0; - } - - void UpdateAI(const uint32 diff) - { - if (uiTimer <= diff) - { - switch(spell) - { - case 0: - DoCast(me, SPELL_ARMAGEDDON_VISUAL, true); - ++spell; - break; - case 1: - DoCast(me, SPELL_ARMAGEDDON_VISUAL2, true); - uiTimer = 9000; - ++spell; - break; - case 2: - DoCast(me, SPELL_ARMAGEDDON_TRIGGER, true); - ++spell; - uiTimer = 5000; - break; - case 3: - me->Kill(me); - me->RemoveCorpse(); - break; - } - } else uiTimer -=diff; - } -}; - -CreatureAI* GetAI_mob_armageddon(Creature* pCreature) -{ - return new mob_armageddonAI (pCreature); -} - -//AI for Shield Orbs -struct mob_shield_orbAI : public ScriptedAI -{ - mob_shield_orbAI(Creature* c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - bool bPointReached; - bool bClockwise; - uint32 uiTimer; - uint32 uiCheckTimer; - float x, y, r, c, mx, my; - - void Reset() - { - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - bPointReached = true; - uiTimer = urand(500,1000); - uiCheckTimer = 1000; - r = 17; - c = 0; - mx = ShieldOrbLocations[0][0]; - my = ShieldOrbLocations[0][1]; - bClockwise = urand(0,1); - } - - void UpdateAI(const uint32 diff) - { - if (bPointReached) - { - if (bClockwise) - { - y = my - r * sin(c); - x = mx - r * cos(c); - } - else - { - y = my + r * sin(c); - x = mx + r * cos(c); - } - bPointReached = false; - uiCheckTimer = 1000; - me->GetMotionMaster()->MovePoint(1,x, y, SHIELD_ORB_Z); - c += M_PI/32; - if (c >= 2*M_PI) c = 0; - } - else - { - if (uiCheckTimer <= diff) - { - DoTeleportTo(x,y,SHIELD_ORB_Z); - bPointReached = true; - } - else uiCheckTimer -= diff; - } - - if (uiTimer <= diff) - { - if (Unit* random = Unit::GetUnit(*me, pInstance ? pInstance->GetData64(DATA_PLAYER_GUID) : 0)) - DoCast(random, SPELL_SHADOW_BOLT, false); - uiTimer = urand(500,1000); - } else uiTimer -= diff; - } - - void MovementInform(uint32 type, uint32 id) - { - if (type != POINT_MOTION_TYPE) - return; - - bPointReached = true; - } -}; - -CreatureAI* GetAI_mob_shield_orb(Creature* pCreature) -{ - return new mob_shield_orbAI (pCreature); -} - -//AI for Sinister Reflection -struct mob_sinster_reflectionAI : public ScriptedAI -{ - mob_sinster_reflectionAI(Creature* c) : ScriptedAI(c) {} - - uint8 victimClass; - uint32 uiTimer[3]; - - void Reset() - { - uiTimer[0] = 0; - uiTimer[1] = 0; - uiTimer[2] = 0; - victimClass = 0; - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if ((victimClass == 0) && me->getVictim()) - { - victimClass = me->getVictim()->getClass(); - switch (victimClass) - { - case CLASS_DRUID: - break; - case CLASS_HUNTER: - break; - case CLASS_MAGE: - break; - case CLASS_WARLOCK: - break; - case CLASS_WARRIOR: - me->SetCanDualWield(true); - break; - case CLASS_PALADIN: - break; - case CLASS_PRIEST: - break; - case CLASS_SHAMAN: - me->SetCanDualWield(true); - break; - case CLASS_ROGUE: - me->SetCanDualWield(true); - break; - } - } - - switch(victimClass) { - case CLASS_DRUID: - if (uiTimer[1] <= diff) - { - DoCast(me->getVictim(), SPELL_SR_MOONFIRE, false); - uiTimer[1] = urand(2000,4000); - } - DoMeleeAttackIfReady(); - break; - case CLASS_HUNTER: - if (uiTimer[1] <= diff) - { - DoCast(me->getVictim(), SPELL_SR_MULTI_SHOT, false); - uiTimer[1] = urand(8000,10000); - } - if (uiTimer[2] <= diff) - { - DoCast(me->getVictim(), SPELL_SR_SHOOT, false); - uiTimer[2] = urand(4000,6000); - } - if (me->IsWithinMeleeRange(me->getVictim(), 6)) - { - if (uiTimer[0] <= diff) - { - DoCast(me->getVictim(), SPELL_SR_MULTI_SHOT, false); - uiTimer[0] = urand(6000,8000); - } - DoMeleeAttackIfReady(); - } - break; - case CLASS_MAGE: - if (uiTimer[1] <= diff) - { - DoCast(me->getVictim(), SPELL_SR_FIREBALL, false); - uiTimer[1] = urand(2000,4000); - } - DoMeleeAttackIfReady(); - break; - case CLASS_WARLOCK: - if (uiTimer[1] <= diff) - { - DoCast(me->getVictim(), SPELL_SR_SHADOW_BOLT, false); - uiTimer[1] = urand(3000,5000); - } - if (uiTimer[2] <= diff) - { - DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true), SPELL_SR_CURSE_OF_AGONY, true); - uiTimer[2] = urand(2000,4000); - } - DoMeleeAttackIfReady(); - break; - case CLASS_WARRIOR: - if (uiTimer[1] <= diff) - { - DoCast(me->getVictim(), SPELL_SR_WHIRLWIND, false); - uiTimer[1] = urand(9000,11000); - } - DoMeleeAttackIfReady(); - break; - case CLASS_PALADIN: - if (uiTimer[1] <= diff) - { - DoCast(me->getVictim(), SPELL_SR_HAMMER_OF_JUSTICE, false); - uiTimer[1] = urand(6000,8000); - } - if (uiTimer[2] <= diff) - { - DoCast(me->getVictim(), SPELL_SR_HOLY_SHOCK, false); - uiTimer[2] = urand(2000,4000); - } - DoMeleeAttackIfReady(); - break; - case CLASS_PRIEST: - if (uiTimer[1] <= diff) - { - DoCast(me->getVictim(), SPELL_SR_HOLY_SMITE, false); - uiTimer[1] = urand(4000,6000); - } - if (uiTimer[2] <= diff) - { - DoCast(me, SPELL_SR_RENEW, false); - uiTimer[2] = urand(6000,8000); - } - DoMeleeAttackIfReady(); - break; - case CLASS_SHAMAN: - if (uiTimer[1] <= diff) - { - DoCast(me->getVictim(), SPELL_SR_EARTH_SHOCK, false); - uiTimer[1] = urand(4000,6000); - } - DoMeleeAttackIfReady(); - break; - case CLASS_ROGUE: - if (uiTimer[1] <= diff) - { - DoCast(me->getVictim(), SPELL_SR_HEMORRHAGE, true); - uiTimer[1] = urand(4000,6000); - } - DoMeleeAttackIfReady(); - break; - } - debug_log("Sinister-Timer"); - for (uint8 i = 0; i < 3; ++i) - uiTimer[i] -= diff; - } -}; - -CreatureAI* GetAI_mob_sinster_reflection(Creature* pCreature) -{ - return new mob_sinster_reflectionAI (pCreature); -} - -void AddSC_boss_kiljaeden() -{ - Script* newscript; - - newscript = new Script; - newscript->pGOHello = &GOHello_go_orb_of_the_blue_flight; - newscript->Name = "go_orb_of_the_blue_flight"; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->GetAI = &GetAI_boss_kalecgos_kj; - newscript->Name = "boss_kalecgos_kj"; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->GetAI = &GetAI_boss_kiljaeden; - newscript->Name = "boss_kiljaeden"; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->GetAI = &GetAI_mob_kiljaeden_controller; - newscript->Name = "mob_kiljaeden_controller"; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->GetAI = &GetAI_mob_hand_of_the_deceiver; - newscript->Name = "mob_hand_of_the_deceiver"; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->GetAI = &GetAI_mob_felfire_portal; - newscript->Name = "mob_felfire_portal"; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->GetAI = &GetAI_mob_volatile_felfire_fiend; - newscript->Name = "mob_volatile_felfire_fiend"; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->GetAI = &GetAI_mob_armageddon; - newscript->Name = "mob_armageddon"; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->GetAI = &GetAI_mob_shield_orb; - newscript->Name = "mob_shield_orb"; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->GetAI = &GetAI_mob_sinster_reflection; - newscript->Name = "mob_sinster_reflection"; - newscript->RegisterSelf(); -} diff --git a/src/server/scripts/EasternKingdoms/sunwell_plateau/boss_muru.cpp b/src/server/scripts/EasternKingdoms/sunwell_plateau/boss_muru.cpp deleted file mode 100644 index 9dca453ade6..00000000000 --- a/src/server/scripts/EasternKingdoms/sunwell_plateau/boss_muru.cpp +++ /dev/null @@ -1,640 +0,0 @@ -/* Copyright (C) 2009 Trinity -* 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_Muru -SD%Complete: 80 -SDComment: all sounds, black hole effect triggers to often (46228) -*/ - -#include "ScriptedPch.h" -#include "sunwell_plateau.h" - -// Muru & Entropius's spells -enum Spells -{ - SPELL_ENRAGE = 26662, - - // Muru's spells - SPELL_NEGATIVE_ENERGY = 46009, //(this trigger 46008) - SPELL_DARKNESS = 45999, - SPELL_OPEN_ALL_PORTALS = 46177, - SPELL_OPEN_PORTAL = 45977, - SPELL_OPEN_PORTAL_2 = 45976, - SPELL_SUMMON_BERSERKER = 46037, - SPELL_SUMNON_FURY_MAGE = 46038, - SPELL_SUMMON_VOID_SENTINEL = 45988, - SPELL_SUMMON_ENTROPIUS = 46217, - - // Entropius's spells - SPELL_DARKNESS_E = 46269, - SPELL_BLACKHOLE = 46282, - SPELL_NEGATIVE_ENERGY_E = 46284, - SPELL_ENTROPIUS_SPAWN = 46223, - - // Shadowsword Berserker's spells - SPELL_FLURRY = 46160, - SPELL_DUAL_WIELD = 29651, - - // Shadowsword Fury Mage's spells - SPELL_FEL_FIREBALL = 46101, - SPELL_SPELL_FURY = 46102, - - // Void Sentinel's spells - SPELL_SHADOW_PULSE = 46087, - SPELL_VOID_BLAST = 46161, - - // Void Spawn's spells - SPELL_SHADOW_BOLT_VOLLEY = 46082, - - //Dark Fiend Spells - SPELL_DARKFIEND_AOE = 45944, - SPELL_DARKFIEND_VISUAL = 45936, - SPELL_DARKFIEND_SKIN = 45934, - - //Black Hole Spells - SPELL_BLACKHOLE_SPAWN = 46242, - SPELL_BLACKHOLE_GROW = 46228 -}; - -enum BossTimers{ - TIMER_DARKNESS = 0, - TIMER_HUMANOIDES = 1, - TIMER_PHASE = 2, - TIMER_SENTINEL = 3 -}; - -float DarkFiends[8][4] = -{ - {1819.9, 609.80, 69.74, 1.94}, - {1829.39, 617.89, 69.73, 2.61}, - {1801.98, 633.62, 69.74, 5.71}, - {1830.88, 629.99, 69.73, 3.52}, - {1800.38, 621.41, 69.74, 0.22}, - {1808.3 , 612.45, 69.73, 1.02}, - {1823.9 , 639.69, 69.74, 4.12}, - {1811.85, 640.46, 69.73, 4.97} -}; - -float Humanoides[6][5] = -{ - {CREATURE_FURY_MAGE, 1780.16, 666.83, 71.19, 5.21}, - {CREATURE_FURY_MAGE, 1847.93, 600.30, 71.30, 2.57}, - {CREATURE_BERSERKER, 1779.97, 660.64, 71.19, 5.28}, - {CREATURE_BERSERKER, 1786.2 , 661.01, 71.19, 4.51}, - {CREATURE_BERSERKER, 1845.17, 602.63, 71.28, 2.43}, - {CREATURE_BERSERKER, 1842.91, 599.93, 71.23, 2.44} -}; - -uint32 EnrageTimer = 600000; -struct boss_entropiusAI : public ScriptedAI -{ - boss_entropiusAI(Creature *c) : ScriptedAI(c), Summons(me) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - SummonList Summons; - - uint32 BlackHoleSummonTimer; - - void Reset() - { - BlackHoleSummonTimer = 15000; - DoCastAOE(SPELL_NEGATIVE_ENERGY_E, false); - - Summons.DespawnAll(); - - if (pInstance) - pInstance->SetData(DATA_MURU_EVENT, NOT_STARTED); - } - - void EnterCombat(Unit * /*who*/) - { - DoCastAOE(SPELL_NEGATIVE_ENERGY_E, true); - DoCast(me, SPELL_ENTROPIUS_SPAWN, false); - - if (pInstance) - pInstance->SetData(DATA_MURU_EVENT, IN_PROGRESS); - } - - void JustSummoned(Creature* summoned) - { - switch(summoned->GetEntry()) - { - case CREATURE_DARK_FIENDS: - summoned->CastSpell(summoned,SPELL_DARKFIEND_VISUAL,false); - break; - case CREATURE_DARKNESS: - summoned->addUnitState(UNIT_STAT_STUNNED); - float x,y,z,o; - summoned->GetHomePosition(x,y,z,o); - me->SummonCreature(CREATURE_DARK_FIENDS, x,y,z,o, TEMPSUMMON_CORPSE_DESPAWN, 0); - break; - } - summoned->AI()->AttackStart(SelectTarget(SELECT_TARGET_RANDOM,0, 50, true)); - Summons.Summon(summoned); - } - - void JustDied(Unit* /*killer*/) - { - Summons.DespawnAll(); - - if (pInstance) - pInstance->SetData(DATA_MURU_EVENT, DONE); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (EnrageTimer < diff && !me->HasAura(SPELL_ENRAGE, 0)) - { - DoCast(me, SPELL_ENRAGE, false); - } else EnrageTimer -= diff; - - if (BlackHoleSummonTimer <= diff) - { - Unit* random = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); - if (!random) - return; - - DoCast(random, SPELL_DARKNESS_E, false); - - random = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); - if (!random) - return; - - random->CastSpell(random, SPELL_BLACKHOLE, false); - BlackHoleSummonTimer = 15000; - } else BlackHoleSummonTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_entropius(Creature* pCreature) -{ - return new boss_entropiusAI (pCreature); -} - -struct boss_muruAI : public Scripted_NoMovementAI -{ - boss_muruAI(Creature *c) : Scripted_NoMovementAI(c), Summons(me) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - SummonList Summons; - - uint8 Phase; - uint32 Timer[4]; - - bool DarkFiend; - - void Reset() - { - DarkFiend = false; - Phase = 1; - - EnrageTimer = 600000; - Timer[TIMER_DARKNESS] = 45000; - Timer[TIMER_HUMANOIDES] = 10000; - Timer[TIMER_PHASE] = 2000; - Timer[TIMER_SENTINEL] = 31500; - - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetVisibility(VISIBILITY_ON); - - Summons.DespawnAll(); - - if (pInstance) - pInstance->SetData(DATA_MURU_EVENT, NOT_STARTED); - } - - void EnterCombat(Unit * /*who*/) - { - DoCastAOE(SPELL_NEGATIVE_ENERGY,false); - - if (pInstance) - pInstance->SetData(DATA_MURU_EVENT, IN_PROGRESS); - } - - void DamageTaken(Unit * /*done_by*/, uint32 &damage) - { - if (damage > me->GetHealth() && Phase == 1) - { - damage = 0; - Phase = 2; - me->RemoveAllAuras(); - DoCast(me, SPELL_OPEN_ALL_PORTALS, false); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - } - if (Phase > 1 && Phase < 4) - damage = 0; - } - - void JustSummoned(Creature* summoned) - { - switch(summoned->GetEntry()) - { - case BOSS_ENTROPIUS: - me->SetVisibility(VISIBILITY_OFF); - break; - case CREATURE_DARK_FIENDS: - summoned->CastSpell(summoned,SPELL_DARKFIEND_VISUAL,false); - break; - } - summoned->AI()->AttackStart(SelectTarget(SELECT_TARGET_RANDOM,0, 50, true)); - Summons.Summon(summoned); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (Phase == 3) - { - if (Timer[TIMER_PHASE] <= diff) - { - if (!pInstance) - return; - switch(pInstance->GetData(DATA_MURU_EVENT)) - { - case NOT_STARTED: - Reset(); - break; - case DONE: - Phase = 4; - me->DisappearAndDie(); - break; - } - Timer[TIMER_PHASE] = 3000; - } else Timer[TIMER_PHASE] -= diff; - return; - } - - if (EnrageTimer < diff && !me->HasAura(SPELL_ENRAGE, 0)) - { - DoCast(me, SPELL_ENRAGE, false); - } else EnrageTimer -= diff; - - for (uint8 i = 0; i < 4; ++i) - { - if (Timer[i] <= diff) - { - switch(i) - { - case TIMER_DARKNESS: - if (!DarkFiend) - { - DoCastAOE(SPELL_DARKNESS, false); - Timer[TIMER_DARKNESS] = 3000; - DarkFiend = true; - } - else - { - DarkFiend = false; - for (uint8 i = 0; i < 8; ++i) - me->SummonCreature(CREATURE_DARK_FIENDS,DarkFiends[i][0],DarkFiends[i][1],DarkFiends[i][2], DarkFiends[i][3], TEMPSUMMON_CORPSE_DESPAWN, 0); - Timer[TIMER_DARKNESS] = 42000; - } - break; - case TIMER_HUMANOIDES: - for (uint8 i = 0; i < 6; ++i) - me->SummonCreature(Humanoides[i][0],Humanoides[i][1],Humanoides[i][2],Humanoides[i][3], Humanoides[i][4], TEMPSUMMON_CORPSE_DESPAWN, 0); - Timer[TIMER_HUMANOIDES] = 60000; - break; - case TIMER_PHASE: - me->RemoveAllAuras(); - DoCast(me, SPELL_SUMMON_ENTROPIUS, false); - Timer[TIMER_PHASE] = 3000; - Phase = 3; - return; - case TIMER_SENTINEL: - DoCastAOE(SPELL_OPEN_PORTAL_2, false); - Timer[TIMER_SENTINEL] = 30000; - break; - } - break; - } - } - - //Timer - for (uint8 i = 0; i < 4; ++i) - { - if (i != TIMER_PHASE)Timer[i] -= diff; - else if (Phase == 2) Timer[i] -= diff; - } - } -}; - -CreatureAI* GetAI_boss_muru(Creature* pCreature) -{ - return new boss_muruAI (pCreature); -} - -struct npc_muru_portalAI : public Scripted_NoMovementAI -{ - npc_muru_portalAI(Creature *c) : Scripted_NoMovementAI(c), Summons(me) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - SummonList Summons; - - bool SummonSentinel; - bool InAction; - - uint32 SummonTimer; - - void Reset() - { - SummonTimer = 5000; - - InAction = false; - SummonSentinel = false; - - me->addUnitState(UNIT_STAT_STUNNED); - - Summons.DespawnAll(); - } - - void JustSummoned(Creature* summoned) - { - if (pInstance) - if (Player* Target = Unit::GetPlayer(pInstance->GetData64(DATA_PLAYER_GUID))) - summoned->AI()->AttackStart(Target); - - Summons.Summon(summoned); - } - - void SpellHit(Unit* /*caster*/, const SpellEntry* Spell) - { - float x,y,z,o; - me->GetHomePosition(x,y,z,o); - DoTeleportTo(x,y,z); - InAction = true; - switch(Spell->Id) - { - case SPELL_OPEN_ALL_PORTALS: - DoCastAOE(SPELL_OPEN_PORTAL, false); - break; - case SPELL_OPEN_PORTAL_2: - DoCastAOE(SPELL_OPEN_PORTAL, false); - SummonSentinel = true; - break; - } - } - - void UpdateAI(const uint32 diff) - { - if (!SummonSentinel) - { - if (InAction && pInstance && pInstance->GetData(DATA_MURU_EVENT) == NOT_STARTED) - Reset(); - return; - } - if (SummonTimer <= diff) - { - DoCastAOE(SPELL_SUMMON_VOID_SENTINEL, false); - SummonTimer = 5000; - SummonSentinel = false; - } else SummonTimer -= diff; - } -}; - -CreatureAI* GetAI_npc_muru_portal(Creature* pCreature) -{ - return new npc_muru_portalAI (pCreature); -} - -struct npc_dark_fiendAI : public ScriptedAI -{ - npc_dark_fiendAI(Creature *c) : ScriptedAI(c) {} - - uint32 WaitTimer; - bool InAction; - - void Reset() - { - WaitTimer = 2000; - InAction = false; - - me->addUnitState(UNIT_STAT_STUNNED); - } - - void SpellHit(Unit* /*caster*/, const SpellEntry* Spell) - { - for (uint8 i = 0; i < 3; ++i) - if (Spell->Effect[i] == 38) - me->DisappearAndDie(); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (WaitTimer <= diff) - { - if (!InAction) - { - me->clearUnitState(UNIT_STAT_STUNNED); - DoCastAOE(SPELL_DARKFIEND_SKIN, false); - AttackStart(SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)); - InAction = true; - WaitTimer = 500; - } - else - { - - if (me->IsWithinDist(me->getVictim(), 5)) - { - DoCastAOE(SPELL_DARKFIEND_AOE, false); - me->DisappearAndDie(); - } - WaitTimer = 500; - } - } else WaitTimer -= diff; - } -}; - -CreatureAI* GetAI_npc_dark_fiend(Creature* pCreature) -{ - return new npc_dark_fiendAI (pCreature); -} - -struct npc_void_sentinelAI : public ScriptedAI -{ - npc_void_sentinelAI(Creature *c) : ScriptedAI(c){} - - uint32 PulseTimer; - uint32 VoidBlastTimer; - - void Reset() - { - PulseTimer = 3000; - VoidBlastTimer = 45000; //is this a correct timer? - - float x,y,z,o; - me->GetHomePosition(x,y,z,o); - DoTeleportTo(x,y,71); - } - - void JustDied(Unit* /*killer*/) - { - for (uint8 i = 0; i < 8; ++i) - me->SummonCreature(CREATURE_VOID_SPAWN, me->GetPositionX(),me->GetPositionY(),me->GetPositionZ(), rand()%6, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 180000); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (PulseTimer <= diff) - { - DoCastAOE(SPELL_SHADOW_PULSE, true); - PulseTimer = 3000; - } else PulseTimer -= diff; - - if (VoidBlastTimer <= diff) - { - DoCast(me->getVictim(), SPELL_VOID_BLAST, false); - VoidBlastTimer = 45000; - } else VoidBlastTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_npc_void_sentinel(Creature* pCreature) -{ - return new npc_void_sentinelAI (pCreature); -} - -struct npc_blackholeAI : public ScriptedAI -{ - npc_blackholeAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint32 DespawnTimer; - uint32 SpellTimer; - uint8 Phase; - uint8 NeedForAHack; - - void Reset() - { - DespawnTimer = 15000; - SpellTimer = 5000; - Phase = 0; - - me->addUnitState(UNIT_STAT_STUNNED); - DoCastAOE(SPELL_BLACKHOLE_SPAWN, true); - } - - void UpdateAI(const uint32 diff) - { - if (SpellTimer <= diff) - { - Unit* Victim = Unit::GetUnit(*me, pInstance ? pInstance->GetData64(DATA_PLAYER_GUID) : 0); - switch (NeedForAHack) - { - case 0: - me->clearUnitState(UNIT_STAT_STUNNED); - DoCastAOE(SPELL_BLACKHOLE_GROW, false); - if (Victim) - AttackStart(Victim); - SpellTimer = 700; - NeedForAHack = 2; - break; - case 1: - me->AddAura(SPELL_BLACKHOLE_GROW, me); - NeedForAHack = 2; - SpellTimer = 600; - break; - case 2: - SpellTimer = 400; - NeedForAHack = 3; - me->RemoveAura(SPELL_BLACKHOLE_GROW, 1); - break; - case 3: - SpellTimer = urand(400,900); - NeedForAHack = 1; - if (Unit* Temp = me->getVictim()) - { - if (Temp->GetPositionZ() > 73 && Victim) - AttackStart(Victim); - } else - return; - } - } else SpellTimer -= diff; - - if (DespawnTimer <= diff) - me->DisappearAndDie(); - else DespawnTimer -= diff; - } -}; - -CreatureAI* GetAI_npc_blackhole(Creature* pCreature) -{ - return new npc_blackholeAI (pCreature); -} - -void AddSC_boss_muru() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_muru"; - newscript->GetAI = &GetAI_boss_muru; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_entropius"; - newscript->GetAI = &GetAI_boss_entropius; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_muru_portal"; - newscript->GetAI = &GetAI_npc_muru_portal; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_dark_fiend"; - newscript->GetAI = &GetAI_npc_dark_fiend; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_void_sentinel"; - newscript->GetAI = &GetAI_npc_void_sentinel; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_blackhole"; - newscript->GetAI = &GetAI_npc_blackhole; - newscript->RegisterSelf(); -} diff --git a/src/server/scripts/EasternKingdoms/sunwell_plateau/instance_sunwell_plateau.cpp b/src/server/scripts/EasternKingdoms/sunwell_plateau/instance_sunwell_plateau.cpp deleted file mode 100644 index 94b7bf4b735..00000000000 --- a/src/server/scripts/EasternKingdoms/sunwell_plateau/instance_sunwell_plateau.cpp +++ /dev/null @@ -1,297 +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 */ - -/* ScriptData -SDName: Instance_Sunwell_Plateau -SD%Complete: 25 -SDComment: VERIFY SCRIPT -SDCategory: Sunwell_Plateau -EndScriptData */ - -#include "ScriptedPch.h" -#include "sunwell_plateau.h" - -#define MAX_ENCOUNTER 6 - -/* Sunwell Plateau: -0 - Kalecgos and Sathrovarr -1 - Brutallus -2 - Felmyst -3 - Eredar Twins (Alythess and Sacrolash) -4 - M'uru -5 - Kil'Jaeden -*/ - -struct instance_sunwell_plateau : public ScriptedInstance -{ - instance_sunwell_plateau(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - - /** Creatures **/ - uint64 Kalecgos_Dragon; - uint64 Kalecgos_Human; - uint64 Sathrovarr; - uint64 Brutallus; - uint64 Madrigosa; - uint64 Felmyst; - uint64 Alythess; - uint64 Sacrolash; - uint64 Muru; - uint64 KilJaeden; - uint64 KilJaedenController; - uint64 Anveena; - uint64 KalecgosKJ; - uint32 SpectralPlayers; - - /** GameObjects **/ - uint64 ForceField; // Kalecgos Encounter - uint64 KalecgosWall[2]; - uint64 FireBarrier; // Felmysts Encounter - uint64 MurusGate[2]; // Murus Encounter - - /*** Misc ***/ - uint32 SpectralRealmTimer; - std::vector SpectralRealmList; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - /*** Creatures ***/ - Kalecgos_Dragon = 0; - Kalecgos_Human = 0; - Sathrovarr = 0; - Brutallus = 0; - Madrigosa = 0; - Felmyst = 0; - Alythess = 0; - Sacrolash = 0; - Muru = 0; - KilJaeden = 0; - KilJaedenController = 0; - Anveena = 0; - KalecgosKJ = 0; - SpectralPlayers = 0; - - /*** GameObjects ***/ - ForceField = 0; - FireBarrier = 0; - MurusGate[0] = 0; - MurusGate[1] = 0; - KalecgosWall[0] = 0; - KalecgosWall[1] = 0; - - /*** Misc ***/ - SpectralRealmTimer = 5000; - } - - 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) - { - Player* plr = itr->getSource(); - if (plr && !plr->HasAura(45839,0)) - return plr; - } - } - - debug_log("TSCR: Instance Sunwell Plateau: GetPlayerInMap, but PlayerList is empty!"); - return NULL; - } - - void OnCreatureCreate(Creature* pCreature, bool /*add*/) - { - switch(pCreature->GetEntry()) - { - case 24850: Kalecgos_Dragon = pCreature->GetGUID(); break; - case 24891: Kalecgos_Human = pCreature->GetGUID(); break; - case 24892: Sathrovarr = pCreature->GetGUID(); break; - case 24882: Brutallus = pCreature->GetGUID(); break; - case 24895: Madrigosa = pCreature->GetGUID(); break; - case 25038: Felmyst = pCreature->GetGUID(); break; - case 25166: Alythess = pCreature->GetGUID(); break; - case 25165: Sacrolash = pCreature->GetGUID(); break; - case 25741: Muru = pCreature->GetGUID(); break; - case 25315: KilJaeden = pCreature->GetGUID(); break; - case 25608: KilJaedenController = pCreature->GetGUID(); break; - case 26046: Anveena = pCreature->GetGUID(); break; - case 25319: KalecgosKJ = pCreature->GetGUID(); break; - } - } - - void OnGameObjectCreate(GameObject* pGo, bool /*add*/) - { - switch(pGo->GetEntry()) - { - case 188421: ForceField = pGo->GetGUID(); break; - case 188523: KalecgosWall[0] = pGo->GetGUID(); break; - case 188524: KalecgosWall[0] = pGo->GetGUID(); break; - case 188075: - if (m_auiEncounter[2] == DONE) - HandleGameObject(NULL, true, pGo); - FireBarrier = pGo->GetGUID(); - break; - case 187990: MurusGate[0] = pGo->GetGUID(); break; - case 188118: - if (m_auiEncounter[4] == DONE) - HandleGameObject(NULL, true, pGo); - MurusGate[1]= pGo->GetGUID(); - break; - } - } - - uint32 GetData(uint32 id) - { - switch(id) - { - case DATA_KALECGOS_EVENT: return m_auiEncounter[0]; - case DATA_BRUTALLUS_EVENT: return m_auiEncounter[1]; - case DATA_FELMYST_EVENT: return m_auiEncounter[2]; - case DATA_EREDAR_TWINS_EVENT: return m_auiEncounter[3]; - case DATA_MURU_EVENT: return m_auiEncounter[4]; - case DATA_KILJAEDEN_EVENT: return m_auiEncounter[5]; - } - return 0; - } - - uint64 GetData64(uint32 id) - { - switch(id) - { - case DATA_KALECGOS_DRAGON: return Kalecgos_Dragon; - case DATA_KALECGOS_HUMAN: return Kalecgos_Human; - case DATA_SATHROVARR: return Sathrovarr; - case DATA_GO_FORCEFIELD: return ForceField; - case DATA_BRUTALLUS: return Brutallus; - case DATA_MADRIGOSA: return Madrigosa; - case DATA_FELMYST: return Felmyst; - case DATA_ALYTHESS: return Alythess; - case DATA_SACROLASH: return Sacrolash; - case DATA_MURU: return Muru; - case DATA_KILJAEDEN: return KilJaeden; - case DATA_KILJAEDEN_CONTROLLER: return KilJaedenController; - case DATA_ANVEENA: return Anveena; - case DATA_KALECGOS_KJ: return KalecgosKJ; - case DATA_PLAYER_GUID: - Player* Target = GetPlayerInMap(); - return Target->GetGUID(); - } - return 0; - } - - void SetData(uint32 id, uint32 data) - { - switch(id) - { - case DATA_KALECGOS_EVENT: - { - if (data == NOT_STARTED || data == DONE) - { - HandleGameObject(ForceField,true); - HandleGameObject(KalecgosWall[0],true); - HandleGameObject(KalecgosWall[1],true); - } - else if (data == IN_PROGRESS) - { - HandleGameObject(ForceField,false); - HandleGameObject(KalecgosWall[0],false); - HandleGameObject(KalecgosWall[1],false); - } - m_auiEncounter[0] = data; - } - break; - case DATA_BRUTALLUS_EVENT: m_auiEncounter[1] = data; break; - case DATA_FELMYST_EVENT: - if (data == DONE) - HandleGameObject(FireBarrier, true); - m_auiEncounter[2] = data; break; - case DATA_EREDAR_TWINS_EVENT: m_auiEncounter[3] = data; break; - case DATA_MURU_EVENT: - switch(data) - { - case DONE: - HandleGameObject(MurusGate[0], true); - HandleGameObject(MurusGate[1], true); - break; - case IN_PROGRESS: - HandleGameObject(MurusGate[0], false); - HandleGameObject(MurusGate[1], false); - break; - case NOT_STARTED: - HandleGameObject(MurusGate[0], true); - HandleGameObject(MurusGate[1], false); - break; - } - m_auiEncounter[4] = data; break; - case DATA_KILJAEDEN_EVENT: m_auiEncounter[5] = data; break; - } - - if (data == DONE) - SaveToDB(); - } - - 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]; - 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]; - 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_sunwell_plateau(Map* pMap) -{ - return new instance_sunwell_plateau(pMap); -} - -void AddSC_instance_sunwell_plateau() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "instance_sunwell_plateau"; - newscript->GetInstanceData = &GetInstanceData_instance_sunwell_plateau; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/sunwell_plateau/sunwell_plateau.cpp b/src/server/scripts/EasternKingdoms/sunwell_plateau/sunwell_plateau.cpp deleted file mode 100644 index dbf67d5f26e..00000000000 --- a/src/server/scripts/EasternKingdoms/sunwell_plateau/sunwell_plateau.cpp +++ /dev/null @@ -1,65 +0,0 @@ -/* Copyright (C) 2009 Trinity - * 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: Sunwell_Plateau -SD%Complete: 0 -SDComment: Placeholder, Epilogue after Kil'jaeden, Captain Selana Gossips -EndScriptData */ - -/* ContentData -npc_prophet_velen -npc_captain_selana -EndContentData */ - -#include "ScriptedPch.h" -#include "sunwell_plateau.h" - -/*###### -## npc_prophet_velen -######*/ - -enum ProphetSpeeches -{ - PROPHET_SAY1 = -1580099, - PROPHET_SAY2 = -1580100, - PROPHET_SAY3 = -1580101, - PROPHET_SAY4 = -1580102, - PROPHET_SAY5 = -1580103, - PROPHET_SAY6 = -1580104, - PROPHET_SAY7 = -1580105, - PROPHET_SAY8 = -1580106 -}; - -enum LiadrinnSpeeches -{ - LIADRIN_SAY1 = -1580107, - LIADRIN_SAY2 = -1580108, - LIADRIN_SAY3 = -1580109 -}; - -/*###### -## npc_captain_selana -######*/ - -#define CS_GOSSIP1 "Give me a situation report, Captain." -#define CS_GOSSIP2 "What went wrong?" -#define CS_GOSSIP3 "Why did they stop?" -#define CS_GOSSIP4 "Your insight is appreciated." - -void AddSC_sunwell_plateau() -{ -} diff --git a/src/server/scripts/EasternKingdoms/sunwell_plateau/sunwell_plateau.h b/src/server/scripts/EasternKingdoms/sunwell_plateau/sunwell_plateau.h deleted file mode 100644 index 9f1a2480c96..00000000000 --- a/src/server/scripts/EasternKingdoms/sunwell_plateau/sunwell_plateau.h +++ /dev/null @@ -1,95 +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_SUNWELLPLATEAU_H -#define DEF_SUNWELLPLATEAU_H - -/*** Encounters ***/ -enum Data -{ - DATA_KALECGOS_EVENT, - DATA_BRUTALLUS_EVENT, - DATA_FELMYST_EVENT, - DATA_EREDAR_TWINS_EVENT, - DATA_MURU_EVENT, - DATA_KILJAEDEN_EVENT, -}; - -enum Data64 -{ - /*** Creatures ***/ - DATA_KALECGOS_DRAGON, - DATA_KALECGOS_HUMAN, - DATA_SATHROVARR, - DATA_BRUTALLUS, - DATA_MADRIGOSA, - DATA_FELMYST, - DATA_ALYTHESS, - DATA_SACROLASH, - DATA_MURU, - DATA_KILJAEDEN, - DATA_KILJAEDEN_CONTROLLER, - DATA_ANVEENA, - DATA_KALECGOS_KJ, - - /*** GameObjects ***/ - DATA_GO_FORCEFIELD, - DATA_ORB_OF_THE_BLUE_DRAGONFLIGHT_1, - DATA_ORB_OF_THE_BLUE_DRAGONFLIGHT_2, - DATA_ORB_OF_THE_BLUE_DRAGONFLIGHT_3, - DATA_ORB_OF_THE_BLUE_DRAGONFLIGHT_4, - - /*** Misc ***/ - DATA_PLAYER_GUID, -}; - -enum Creatures -{ - BOSS_MURU = 25741, - BOSS_ENTROPIUS = 25840, - MOB_KALECGOS = 24850, - MOB_KALEC = 24891, - MOB_SATHROVARR = 24892, - - MOB_DEAD = 25268, - MOB_FLIGHT_LEFT = 25357, - MOB_FLIGHT_RIGHT = 25358, - MOB_DEATH_CLOUD = 25703, - MOB_VAPOR = 25265, - MOB_VAPOR_TRAIL = 25267, - - MOB_GRAND_WARLOCK_ALYTHESS = 25166, - MOB_SHADOW_IMAGE = 25214, - MOB_LADY_SACROLASH = 25165, - - CREATURE_ANVEENA = 26046, // Embodiment of the Sunwell - CREATURE_KALECGOS = 25319, // Helps the raid throughout the fight - CREATURE_PROPHET = 26246, // Outro - CREATURE_KILJAEDEN = 25315, // Give it to 'em KJ! - CREATURE_HAND_OF_THE_DECEIVER = 25588, // Adds found before KJ emerges - CREATURE_FELFIRE_PORTAL = 25603, // Portal spawned be Hand of the Deceivers - CREATURE_VOLATILE_FELFIRE_FIEND = 25598, // Fiends spawned by the above portal - CREATURE_ARMAGEDDON_TARGET = 25735, // This mob casts meteor on itself.. I think - CREATURE_SHIELD_ORB = 25502, // Shield orbs circle the room raining shadow bolts on raid - CREATURE_THE_CORE_OF_ENTROPIUS = 26262, // Used in the ending cinematic? - CREATURE_POWER_OF_THE_BLUE_DRAGONFLIGHT = 25653, // NPC that players possess when using the Orb of the Blue Dragonflight - CREATURE_SPIKE_TARGET1 = 30598, // Should summon these under Shadow Spike Channel on targets place - CREATURE_SPIKE_TARGET2 = 30614, - CREATURE_SINISTER_REFLECTION = 25708, // Sinister Relection spawnd on Phase swichtes - - CREATURE_DARKNESS = 25879, - CREATURE_DARK_FIENDS = 25744, - CREATURE_BERSERKER = 25798, - CREATURE_FURY_MAGE = 25799, - CREATURE_VOID_SENTINEL = 25772, - CREATURE_VOID_SPAWN = 25824, - CREATURE_BLACK_HOLE = 25855, -}; - -enum GameObjects -{ - GAMEOBJECT_ORB_OF_THE_BLUE_DRAGONFLIGHT = 188415, -}; - -#endif diff --git a/src/server/scripts/EasternKingdoms/uldaman/boss_archaedas.cpp b/src/server/scripts/EasternKingdoms/uldaman/boss_archaedas.cpp deleted file mode 100644 index cd3bc5fc219..00000000000 --- a/src/server/scripts/EasternKingdoms/uldaman/boss_archaedas.cpp +++ /dev/null @@ -1,497 +0,0 @@ -/* Copyright (C) 2006,2007 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_archaedas -SD%Complete: 100 -SDComment: Archaedas is activated when 1 person (was 3, changed in 3.0.8) clicks on his altar. -Every 10 seconds he will awaken one of his minions along the wall. -At 66%, he will awaken the 6 Guardians. -At 33%, he will awaken the Vault Walkers -On his death the vault door opens. -EndScriptData */ - -#include "ScriptedPch.h" - -#define SAY_AGGRO "Who dares awaken Archaedas? Who dares the wrath of the makers!" -#define SOUND_AGGRO 5855 - -#define SAY_SUMMON "Awake ye servants, defend the discs!" -#define SOUND_SUMMON 5856 - -#define SAY_SUMMON2 "To my side, brothers. For the makers!" -#define SOUND_SUMMON2 5857 - -#define SAY_KILL "Reckless mortal." -#define SOUND_KILL 5858 - -#define SPELL_GROUND_TREMOR 6524 -#define SPELL_ARCHAEDAS_AWAKEN 10347 -#define SPELL_BOSS_OBJECT_VISUAL 11206 -#define SPELL_BOSS_AGGRO 10340 -#define SPELL_SUB_BOSS_AGGRO 11568 -#define SPELL_AWAKEN_VAULT_WALKER 10258 -#define SPELL_AWAKEN_EARTHEN_GUARDIAN 10252 - -struct boss_archaedasAI : public ScriptedAI -{ - boss_archaedasAI(Creature *c) : ScriptedAI(c) - { - pInstance = me->GetInstanceData(); - } - - uint32 Tremor_Timer; - int32 Awaken_Timer; - uint32 WallMinionTimer; - bool wakingUp; - - bool guardiansAwake; - bool vaultWalkersAwake; - ScriptedInstance* pInstance; - - void Reset() - { - Tremor_Timer = 60000; - Awaken_Timer = 0; - WallMinionTimer = 10000; - - wakingUp = false; - guardiansAwake = false; - vaultWalkersAwake = false; - - if (pInstance) - pInstance->SetData (NULL, 5); // respawn any dead minions - me->setFaction(35); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE); - - } - - void ActivateMinion (uint64 guid, bool flag) - { - Unit *minion = Unit::GetUnit(*me, guid); - - if (minion && minion->isAlive()) - { - DoCast (minion, SPELL_AWAKEN_VAULT_WALKER, flag); - minion->CastSpell(minion, SPELL_ARCHAEDAS_AWAKEN,true); - } - } - - void EnterCombat(Unit * /*who*/) - { - me->setFaction (14); - me->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->RemoveFlag (UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE); - } - - void SpellHit (Unit* /*caster*/, const SpellEntry *spell) - { - // Being woken up from the altar, start the awaken sequence - if (spell == GetSpellStore()->LookupEntry(SPELL_ARCHAEDAS_AWAKEN)) { - me->MonsterYell(SAY_AGGRO,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(me,SOUND_AGGRO); - Awaken_Timer = 4000; - wakingUp = true; - } - } - - void KilledUnit(Unit * /*victim*/) - { - me->MonsterYell(SAY_KILL,LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(me, SOUND_KILL); - } - - void UpdateAI(const uint32 diff) - { - if (!pInstance) - return; - // we're still doing awaken animation - if (wakingUp && Awaken_Timer >= 0) { - Awaken_Timer -= diff; - return; // dont do anything until we are done - } else if (wakingUp && Awaken_Timer <= 0) { - wakingUp = false; - AttackStart(Unit::GetUnit(*me, pInstance->GetData64(0))); - return; // dont want to continue until we finish the AttackStart method - } - - //Return since we have no target - if (!UpdateVictim()) - return; - - // wake a wall minion - if (WallMinionTimer <= diff) { - pInstance->SetData (NULL, 2); - - WallMinionTimer = 10000; - } else WallMinionTimer -= diff; - - //If we are <66 summon the guardians - if (!guardiansAwake && me->GetHealth()*100 / me->GetMaxHealth() <= 66) { - ActivateMinion(pInstance->GetData64(5),true); // EarthenGuardian1 - ActivateMinion(pInstance->GetData64(6),true); // EarthenGuardian2 - ActivateMinion(pInstance->GetData64(7),true); // EarthenGuardian3 - ActivateMinion(pInstance->GetData64(8),true); // EarthenGuardian4 - ActivateMinion(pInstance->GetData64(9),true); // EarthenGuardian5 - ActivateMinion(pInstance->GetData64(10),false); // EarthenGuardian6 - me->MonsterYell(SAY_SUMMON,LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(me, SOUND_SUMMON); - guardiansAwake = true; - } - - //If we are <33 summon the vault walkers - if (!vaultWalkersAwake && me->GetHealth()*100 / me->GetMaxHealth() <= 33) { - ActivateMinion(pInstance->GetData64(1),true); // VaultWalker1 - ActivateMinion(pInstance->GetData64(2),true); // VaultWalker2 - ActivateMinion(pInstance->GetData64(3),true); // VaultWalker3 - ActivateMinion(pInstance->GetData64(4),false); // VaultWalker4 - me->MonsterYell(SAY_SUMMON2, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(me, SOUND_SUMMON2); - vaultWalkersAwake = true; - } - - if (Tremor_Timer <= diff) - { - //Cast - DoCast(me->getVictim(), SPELL_GROUND_TREMOR); - - //45 seconds until we should cast this agian - Tremor_Timer = 45000; - } else Tremor_Timer -= diff; - - DoMeleeAttackIfReady(); - } - - void JustDied (Unit * /*killer*/) { - if (pInstance) - { - pInstance->SetData(NULL,3); // open the vault door - pInstance->SetData(NULL,4); // deactivate his minions - } - } - -}; - -CreatureAI* GetAI_boss_archaedas(Creature* pCreature) -{ - return new boss_archaedasAI (pCreature); -} - -/* ScriptData -SDName: mob_archaedas_minions -SD%Complete: 100 -SDComment: These mobs are initially frozen until Archaedas awakens them -one at a time. -EndScriptData */ - -#define SPELL_ARCHAEDAS_AWAKEN 10347 - -struct mob_archaedas_minionsAI : public ScriptedAI -{ - mob_archaedas_minionsAI(Creature *c) : ScriptedAI(c) - { - pInstance = me->GetInstanceData(); - } - - uint32 Arcing_Timer; - int32 Awaken_Timer; - bool wakingUp; - - bool amIAwake; - ScriptedInstance* pInstance; - - void Reset() - { - Arcing_Timer = 3000; - Awaken_Timer = 0; - - wakingUp = false; - amIAwake = false; - - me->setFaction(35); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE); - me->RemoveAllAuras(); - } - - void EnterCombat(Unit * /*who*/) - { - me->setFaction (14); - me->RemoveAllAuras(); - me->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE); - amIAwake = true; - } - - void SpellHit (Unit* /*caster*/, const SpellEntry *spell) { - // time to wake up, start animation - if (spell == GetSpellStore()->LookupEntry(SPELL_ARCHAEDAS_AWAKEN)){ - Awaken_Timer = 5000; - wakingUp = true; - } - } - - void MoveInLineOfSight(Unit *who) - { - if (amIAwake) - ScriptedAI::MoveInLineOfSight(who); - } - - void UpdateAI(const uint32 diff) - { - // we're still in the awaken animation - if (wakingUp && Awaken_Timer >= 0) { - Awaken_Timer -= diff; - return; // dont do anything until we are done - } else if (wakingUp && Awaken_Timer <= 0) { - wakingUp = false; - amIAwake = true; - // AttackStart(Unit::GetUnit(*me, pInstance->GetData64(0))); // whoWokeArchaedasGUID - return; // dont want to continue until we finish the AttackStart method - } - - //Return since we have no target - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_archaedas_minions(Creature* pCreature) -{ - return new mob_archaedas_minionsAI (pCreature); -} - -/* ScriptData -SDName: go_altar_archaedas -SD%Complete: 100 -SDComment: Needs 1 person to activate the Archaedas script -SDCategory: Uldaman -EndScriptData */ - -#define OBJECT_ALTAR_OF_ARCHAEDAS 133234 - -#define NUMBER_NEEDED_TO_ACTIVATE 1 // as of patch 3.0.8 the altars can be opened by a single player (previously 3) - -#define SPELL_BOSS_OBJECT_VISUAL 11206 - -//uint64 altarOfArchaedasCount[5]; -//int32 altarOfArchaedasCounter=0; - -bool GOHello_go_altar_of_archaedas(Player* pPlayer, GameObject* /*pGo*/) -{ - //bool alreadyUsed; - //pGo->AddUse (); - - /* - alreadyUsed = false; - for (uint32 loop=0; loop<5; loop++) { - if (altarOfArchaedasCount[loop] == pPlayer->GetGUID()) alreadyUsed = true; - } - if (!alreadyUsed) - altarOfArchaedasCount[altarOfArchaedasCounter++] = pPlayer->GetGUID(); - */ - - pPlayer->CastSpell (pPlayer, SPELL_BOSS_OBJECT_VISUAL, false); - - /* - if (altarOfArchaedasCounter < NUMBER_NEEDED_TO_ACTIVATE) - return false; // not enough people yet - - // Check to make sure at least three people are still casting - uint8 count = 0; - Unit *pTarget; - for (uint8 x = 0; x <= 5; ++x) - { - pTarget = Unit::GetUnit(*pPlayer, altarOfArchaedasCount[x]); - if (!pTarget) - continue; - if (pTarget->IsNonMeleeSpellCasted(true)) - ++count; - if (count >= NUMBER_NEEDED_TO_ACTIVATE) - break; - } - - if (count < NUMBER_NEEDED_TO_ACTIVATE) - return false; // not enough people - */ - - ScriptedInstance* pInstance = pPlayer->GetInstanceData(); - if (!pInstance) - return false; - - pInstance->SetData(NULL,0); - pInstance->SetData64(0,pPlayer->GetGUID()); // activate archaedas - - return false; -} - -/* ScriptData -SDName: mob_stonekeepers -SD%Complete: 100 -SDComment: After activating the altar of the keepers, the stone keepers will -wake up one by one. -EndScriptData */ - -#include "ScriptedPch.h" - -#define SPELL_SELF_DESTRUCT 9874 - -struct mob_stonekeepersAI : public ScriptedAI -{ - mob_stonekeepersAI(Creature *c) : ScriptedAI(c) - { - pInstance = (me->GetInstanceData()); - } - - ScriptedInstance* pInstance; - - void Reset() - { - me->setFaction(35); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE); - me->RemoveAllAuras(); - } - - void EnterCombat(Unit * /*who*/) - { - me->setFaction (14); - me->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE); - } - - void UpdateAI(const uint32 /*diff*/) - { - - //Return since we have no target - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - - void JustDied(Unit * /*attacker*/) - { - DoCast (me, SPELL_SELF_DESTRUCT,true); - if (pInstance) - pInstance->SetData(NULL, 1); // activate next stonekeeper - } - -}; - -CreatureAI* GetAI_mob_stonekeepers(Creature* pCreature) -{ - return new mob_stonekeepersAI (pCreature); -} - -/* ScriptData -SDName: go_altar_of_the_keepers -SD%Complete: 100 -SDComment: Need 1 person to activate to open the altar. One by one the StoneKeepers will activate. After all four are dead than the door will open. -SDCategory: Uldaman -EndScriptData */ - -#define SPELL_BOSS_OBJECT_VISUAL 11206 - -#define NUMBER_NEEDED_TO_ACTIVATE 1 // as of patch 3.0.8 the altars can be opened by a single player (previously 3) - -//static uint64 altarOfTheKeeperCount[5]; -//static uint32 altarOfTheKeeperCounter=0; - -bool GOHello_go_altar_of_the_keepers(Player* pPlayer, GameObject* /*pGo*/) -{ - ScriptedInstance* pInstance = pPlayer->GetInstanceData(); - if (!pInstance) - return true; - - //bool alreadyUsed; - - //pGo->AddUse(); - - //alreadyUsed = false; - //for (uint32 loop=0; loop<5; ++loop) - //{ - // if (altarOfTheKeeperCount[loop] == pPlayer->GetGUID()) - //alreadyUsed = true; - //} - //if (!alreadyUsed && altarOfTheKeeperCounter < 5) - // altarOfTheKeeperCount[altarOfTheKeeperCounter++] = pPlayer->GetGUID(); - pPlayer->CastSpell (pPlayer, SPELL_BOSS_OBJECT_VISUAL, false); - - //if (altarOfTheKeeperCounter < NUMBER_NEEDED_TO_ACTIVATE) - //{ - //error_log("not enough people yet, altarOfTheKeeperCounter = %d", altarOfTheKeeperCounter); - // return false; // not enough people yet - //} -/* - // Check to make sure at least three people are still casting - uint8 count = 0; - Unit *pTarget; - for (uint8 x = 0; x < 5; ++x) - { - pTarget = Unit::GetUnit(*pPlayer, altarOfTheKeeperCount[x]); - //error_log("number of people currently activating it: %d", x+1); - if (!pTarget) - continue; - if (pTarget->IsNonMeleeSpellCasted(true)) - ++count; - if (count >= NUMBER_NEEDED_TO_ACTIVATE) - break; - } - - if (count < NUMBER_NEEDED_TO_ACTIVATE) - { - //error_log("still not enough people"); - return true; // not enough people - } -*/ - //error_log ("activating stone keepers"); - pInstance->SetData(NULL,1); // activate the Stone Keepers - return true; -} - -void AddSC_boss_archaedas() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_archaedas"; - newscript->GetAI = &GetAI_boss_archaedas; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "go_altar_of_archaedas"; - newscript->pGOHello = &GOHello_go_altar_of_archaedas; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_archaedas_minions"; - newscript->GetAI = &GetAI_mob_archaedas_minions; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "go_altar_of_the_keepers"; - newscript->pGOHello = &GOHello_go_altar_of_the_keepers; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_stonekeepers"; - newscript->GetAI = &GetAI_mob_stonekeepers; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/uldaman/boss_ironaya.cpp b/src/server/scripts/EasternKingdoms/uldaman/boss_ironaya.cpp deleted file mode 100644 index 9b6d5dba642..00000000000 --- a/src/server/scripts/EasternKingdoms/uldaman/boss_ironaya.cpp +++ /dev/null @@ -1,106 +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_Ironaya -SD%Complete: 100 -SDComment: -SDCategory: Uldaman -EndScriptData */ - -#include "ScriptedPch.h" - -#define SAY_AGGRO -1070000 - -#define SPELL_ARCINGSMASH 8374 -#define SPELL_KNOCKAWAY 10101 -#define SPELL_WSTOMP 11876 - -struct boss_ironayaAI : public ScriptedAI -{ - boss_ironayaAI(Creature *c) : ScriptedAI(c) {} - - uint32 Arcing_Timer; - bool hasCastedWstomp; - bool hasCastedKnockaway; - - void Reset() - { - Arcing_Timer = 3000; - hasCastedKnockaway = false; - hasCastedWstomp = false; - } - - void EnterCombat(Unit * /*who*/) - { - DoScriptText(SAY_AGGRO, me); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //If we are <50% hp do knockaway ONCE - if (!hasCastedKnockaway && me->GetHealth()*2 < me->GetMaxHealth()) - { - DoCast(me->getVictim(), SPELL_KNOCKAWAY, true); - - // current aggro target is knocked away pick new target - Unit* Target = SelectUnit(SELECT_TARGET_TOPAGGRO, 0); - - if (!Target || Target == me->getVictim()) - Target = SelectUnit(SELECT_TARGET_TOPAGGRO, 1); - - if (Target) - me->TauntApply(Target); - - //Shouldn't cast this agian - hasCastedKnockaway = true; - } - - //Arcing_Timer - if (Arcing_Timer <= diff) - { - DoCast(me, SPELL_ARCINGSMASH); - Arcing_Timer = 13000; - } else Arcing_Timer -= diff; - - if (!hasCastedWstomp && me->GetHealth()*4 < me->GetMaxHealth()) - { - DoCast(me, SPELL_WSTOMP); - hasCastedWstomp = true; - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_ironaya(Creature* pCreature) -{ - return new boss_ironayaAI (pCreature); -} - -void AddSC_boss_ironaya() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_ironaya"; - newscript->GetAI = &GetAI_boss_ironaya; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/uldaman/instance_uldaman.cpp b/src/server/scripts/EasternKingdoms/uldaman/instance_uldaman.cpp deleted file mode 100644 index a519ad678b7..00000000000 --- a/src/server/scripts/EasternKingdoms/uldaman/instance_uldaman.cpp +++ /dev/null @@ -1,300 +0,0 @@ -/* Copyright (C) 2006,2007 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 -*/ - -#include "ScriptedPch.h" - -#define SPELL_ARCHAEDAS_AWAKEN 10347 -#define SPELL_AWAKEN_VAULT_WALKER 10258 - -#define ARCHAEDAS_TEMPLE_DOOR 141869 -#define ALTAR_OF_ARCHAEDAS 133234 - -#define ALTAR_OF_THE_KEEPER_TEMPLE_DOOR 124367 -#define ALTAR_OF_THE_KEEPER_TEMPLE 130511 - -#define ANCIENT_VAULT_DOOR 124369 - -struct instance_uldaman : public ScriptedInstance -{ - instance_uldaman(Map* pMap) : ScriptedInstance(pMap) - { - Initialize(); - }; - - void Initialize() - { - archaedasGUID = 0; - altarOfTheKeeperTempleDoor = 0; - archaedasTempleDoor = 0; - ancientVaultDoor = 0; - whoWokeArchaedasGUID = 0; - } - - uint64 archaedasGUID; - uint64 altarOfTheKeeperTempleDoor; - uint64 archaedasTempleDoor; - uint64 ancientVaultDoor; - uint64 whoWokeArchaedasGUID; - - std::vector stoneKeeper; - std::vector altarOfTheKeeperCount; - std::vector vaultWalker; - std::vector earthenGuardian; - std::vector archaedasWallMinions; // minions lined up around the wall - - void OnGameObjectCreate(GameObject* pGo, bool /*add*/) - { - switch (pGo->GetEntry()) - { - case ALTAR_OF_THE_KEEPER_TEMPLE_DOOR: // lock the door - altarOfTheKeeperTempleDoor = pGo->GetGUID(); - break; - - case ARCHAEDAS_TEMPLE_DOOR: - archaedasTempleDoor = pGo->GetGUID(); - break; - - case ANCIENT_VAULT_DOOR: - pGo->SetGoState(GO_STATE_READY); - pGo->SetUInt32Value(GAMEOBJECT_FLAGS, 33); - ancientVaultDoor = pGo->GetGUID(); - break; - } - } - - void SetFrozenState(Creature* pCreature) - { - pCreature->setFaction(35); - pCreature->RemoveAllAuras(); - //creature->RemoveFlag (UNIT_FIELD_FLAGS,UNIT_FLAG_ANIMATION_FROZEN); - pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE); - } - - void OpenDoor(uint64 guid) - { - GameObject* pGo = instance->GetGameObject(guid); - if (!pGo) - return; - - pGo->SetUInt32Value(GAMEOBJECT_FLAGS, 33); - pGo->SetGoState(GO_STATE_ACTIVE); - } - - void ActivateStoneKeepers() - { - for (std::vector::const_iterator i = stoneKeeper.begin(); i != stoneKeeper.end(); ++i) - { - Creature *pTarget = instance->GetCreature(*i); - if (!pTarget || !pTarget->isAlive() || pTarget->getFaction() == 14) - continue; - pTarget->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE); - pTarget->setFaction(14); - pTarget->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - return; // only want the first one we find - } - // if we get this far than all four are dead so open the door - SetData (NULL, 0); - } - - void ActivateWallMinions() - { - Creature *archaedas = instance->GetCreature(archaedasGUID); - if (!archaedas) - return; - - for (std::vector::const_iterator i = archaedasWallMinions.begin(); i != archaedasWallMinions.end(); ++i) - { - Creature *pTarget = instance->GetCreature(*i); - if (!pTarget || !pTarget->isAlive() || pTarget->getFaction() == 14) - continue; - archaedas->CastSpell(pTarget, SPELL_AWAKEN_VAULT_WALKER, true); - pTarget->CastSpell(pTarget, SPELL_ARCHAEDAS_AWAKEN,true); - return; // only want the first one we find - } - } - - // used when Archaedas dies. All active minions must be despawned. - void DeActivateMinions() - { - // first despawn any aggroed wall minions - for (std::vector::const_iterator i = archaedasWallMinions.begin(); i != archaedasWallMinions.end(); ++i) - { - Creature *pTarget = instance->GetCreature(*i); - if (!pTarget || pTarget->isDead() || pTarget->getFaction() != 14) - continue; - pTarget->setDeathState(JUST_DIED); - pTarget->RemoveCorpse(); - } - - // Vault Walkers - for (std::vector::const_iterator i = vaultWalker.begin(); i != vaultWalker.end(); ++i) - { - Creature *pTarget = instance->GetCreature(*i); - if (!pTarget || pTarget->isDead() || pTarget->getFaction() != 14) - continue; - pTarget->setDeathState(JUST_DIED); - pTarget->RemoveCorpse(); - } - - // Earthen Guardians - for (std::vector::const_iterator i = earthenGuardian.begin(); i != earthenGuardian.end(); ++i) - { - Creature *pTarget = instance->GetCreature(*i); - if (!pTarget || pTarget->isDead() || pTarget->getFaction() != 14) - continue; - pTarget->setDeathState(JUST_DIED); - pTarget->RemoveCorpse(); - } - } - - void ActivateArchaedas(uint64 target) - { - Creature *archaedas = instance->GetCreature(archaedasGUID); - if (!archaedas) - return; - - if (Unit *victim = Unit::GetUnit(*archaedas, target)) - { - archaedas->CastSpell(archaedas, SPELL_ARCHAEDAS_AWAKEN,false); - whoWokeArchaedasGUID = target; - } - } - - void RespawnMinions() - { - // first respawn any aggroed wall minions - for (std::vector::const_iterator i = archaedasWallMinions.begin(); i != archaedasWallMinions.end(); ++i) - { - Creature *pTarget = instance->GetCreature(*i); - if (pTarget && pTarget->isDead()) - { - pTarget->Respawn(); - pTarget->GetMotionMaster()->MoveTargetedHome(); - SetFrozenState(pTarget); - } - } - - // Vault Walkers - for (std::vector::const_iterator i = vaultWalker.begin(); i != vaultWalker.end(); ++i) - { - Creature *pTarget = instance->GetCreature(*i); - if (pTarget && pTarget->isDead()) - { - pTarget->Respawn(); - pTarget->GetMotionMaster()->MoveTargetedHome(); - SetFrozenState(pTarget); - } - } - - // Earthen Guardians - for (std::vector::const_iterator i = earthenGuardian.begin(); i != earthenGuardian.end(); ++i) - { - Creature *pTarget = instance->GetCreature(*i); - if (pTarget && pTarget->isDead()) - { - pTarget->Respawn(); - pTarget->GetMotionMaster()->MoveTargetedHome(); - SetFrozenState(pTarget); - } - } - } - - void SetData (uint32 /*type*/, uint32 data) - { - //error_log ("SetData: data = %d", data); - if (data == 0) OpenDoor (altarOfTheKeeperTempleDoor); - if (data == 0) OpenDoor (archaedasTempleDoor); - if (data == 3) OpenDoor (ancientVaultDoor); - if (data == 1) ActivateStoneKeepers(); - if (data == 2) ActivateWallMinions(); - if (data == 4) DeActivateMinions(); - if (data == 5) RespawnMinions(); - } - - void SetData64 (uint32 type, uint64 data) - { - // Archaedas - if (type == 0) - { - ActivateArchaedas (data); - } - } - - void OnCreatureCreate(Creature* pCreature, bool /*add*/) - { - switch (pCreature->GetEntry()) { - case 4857: // Stone Keeper - SetFrozenState (pCreature); - stoneKeeper.push_back(pCreature->GetGUID()); - break; - - case 7309: // Earthen Custodian - archaedasWallMinions.push_back(pCreature->GetGUID()); - break; - - case 7077: // Earthen Hallshaper - archaedasWallMinions.push_back(pCreature->GetGUID()); - break; - - case 7076: // Earthen Guardian - earthenGuardian.push_back(pCreature->GetGUID()); - break; - - case 10120: // Vault Walker - vaultWalker.push_back(pCreature->GetGUID()); - break; - - case 2748: // Archaedas - archaedasGUID = pCreature->GetGUID(); - break; - - } // end switch - } // end OnCreatureCreate - - uint64 GetData64 (uint32 identifier) - { - if (identifier == 0) return whoWokeArchaedasGUID; - if (identifier == 1) return vaultWalker[0]; // VaultWalker1 - if (identifier == 2) return vaultWalker[1]; // VaultWalker2 - if (identifier == 3) return vaultWalker[2]; // VaultWalker3 - if (identifier == 4) return vaultWalker[3]; // VaultWalker4 - - if (identifier == 5) return earthenGuardian[0]; - if (identifier == 6) return earthenGuardian[1]; - if (identifier == 7) return earthenGuardian[2]; - if (identifier == 8) return earthenGuardian[3]; - if (identifier == 9) return earthenGuardian[4]; - if (identifier == 10) return earthenGuardian[5]; - - return 0; - } // end GetData64 -}; - -InstanceData* GetInstanceData_instance_uldaman(Map* pMap) -{ - return new instance_uldaman(pMap); -} - -void AddSC_instance_uldaman() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_uldaman"; - newscript->GetInstanceData = &GetInstanceData_instance_uldaman; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/uldaman/uldaman.cpp b/src/server/scripts/EasternKingdoms/uldaman/uldaman.cpp deleted file mode 100644 index 2bd8387efa5..00000000000 --- a/src/server/scripts/EasternKingdoms/uldaman/uldaman.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: Uldaman -SD%Complete: 100 -SDComment: Quest support: 2278 + 1 trash mob. -SDCategory: Uldaman -EndScriptData */ - -/* ContentData -mob_jadespine_basilisk -npc_lore_keeper_of_norgannon -EndContentData */ - -#include "ScriptedPch.h" - -/*###### -## mob_jadespine_basilisk -######*/ - -#define SPELL_CSLUMBER 3636 - -struct mob_jadespine_basiliskAI : public ScriptedAI -{ - mob_jadespine_basiliskAI(Creature *c) : ScriptedAI(c) {} - - uint32 Cslumber_Timer; - - void Reset() - { - Cslumber_Timer = 2000; - } - - void EnterCombat(Unit * /*who*/) - { - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //Cslumber_Timer - if (Cslumber_Timer <= diff) - { - //Cast - // DoCast(me->getVictim(), SPELL_CSLUMBER); - DoCast(me->getVictim(), SPELL_CSLUMBER, true); - - //Stop attacking target thast asleep and pick new target - Cslumber_Timer = 28000; - - Unit* Target = SelectUnit(SELECT_TARGET_TOPAGGRO, 0); - - if (!Target || Target == me->getVictim()) - Target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); - - if (Target) - me->TauntApply(Target); - - } else Cslumber_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_jadespine_basilisk(Creature* pCreature) -{ - return new mob_jadespine_basiliskAI (pCreature); -} - -/*###### -## npc_lore_keeper_of_norgannon -######*/ - -#define GOSSIP_HELLO_KEEPER "Who are the Earthen?" -#define GOSSIP_SELECT_KEEPER1 "What is a \"subterranean being matrix\"?" -#define GOSSIP_SELECT_KEEPER2 "What are the anomalies you speak of?" -#define GOSSIP_SELECT_KEEPER3 "What is a resilient foundation of construction?" -#define GOSSIP_SELECT_KEEPER4 "So... the Earthen were made out of stone?" -#define GOSSIP_SELECT_KEEPER5 "Anything else I should know about the Earthen?" -#define GOSSIP_SELECT_KEEPER6 "I think I understand the Creators' design intent for the Earthen now. What are the Earthen's anomalies that you spoke of earlier?" -#define GOSSIP_SELECT_KEEPER7 "What high-stress environments would cause the Earthen to destabilize?" -#define GOSSIP_SELECT_KEEPER8 "What happens when the Earthen destabilize?" -#define GOSSIP_SELECT_KEEPER9 "Troggs?! Are the troggs you mention the same as the ones in the world today?" -#define GOSSIP_SELECT_KEEPER10 "You mentioned two results when the Earthen destabilize. What is the second?" -#define GOSSIP_SELECT_KEEPER11 "Dwarves!!! Now you're telling me that dwarves originally came from the Earthen?!" -#define GOSSIP_SELECT_KEEPER12 "These dwarves are the same ones today, yes? Do the dwarves maintain any other links to the Earthen?" -#define GOSSIP_SELECT_KEEPER13 "Who are the Creators?" -#define GOSSIP_SELECT_KEEPER14 "This is a lot to think about." -#define GOSSIP_SELECT_KEEPER15 "I will access the discs now." - -bool GossipHello_npc_lore_keeper_of_norgannon(Player* pPlayer, Creature* pCreature) -{ - if (pPlayer->GetQuestStatus(2278) == QUEST_STATUS_INCOMPLETE) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO_KEEPER, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - pPlayer->SEND_GOSSIP_MENU(1079, pCreature->GetGUID()); - - return true; -} - -bool GossipSelect_npc_lore_keeper_of_norgannon(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction) -{ - switch (uiAction) - { - case GOSSIP_ACTION_INFO_DEF+1: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - pPlayer->SEND_GOSSIP_MENU(1080, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); - pPlayer->SEND_GOSSIP_MENU(1081, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+3: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); - pPlayer->SEND_GOSSIP_MENU(1082, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+4: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); - pPlayer->SEND_GOSSIP_MENU(1083, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+5: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6); - pPlayer->SEND_GOSSIP_MENU(1084, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+6: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+7); - pPlayer->SEND_GOSSIP_MENU(1085, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+7: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+8); - pPlayer->SEND_GOSSIP_MENU(1086, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+8: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER8, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+9); - pPlayer->SEND_GOSSIP_MENU(1087, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+9: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER9, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+10); - pPlayer->SEND_GOSSIP_MENU(1088, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+10: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER10, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+11); - pPlayer->SEND_GOSSIP_MENU(1089, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+11: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER11, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+12); - pPlayer->SEND_GOSSIP_MENU(1090, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+12: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER12, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+13); - pPlayer->SEND_GOSSIP_MENU(1091, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+13: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER13, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+14); - pPlayer->SEND_GOSSIP_MENU(1092, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+14: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER14, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+15); - pPlayer->SEND_GOSSIP_MENU(1093, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+15: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_KEEPER15, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+16); - pPlayer->SEND_GOSSIP_MENU(1094, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+16: - pPlayer->CLOSE_GOSSIP_MENU(); - pPlayer->AreaExploredOrEventHappens(2278); - break; - } - return true; -} - -void AddSC_uldaman() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "mob_jadespine_basilisk"; - newscript->GetAI = &GetAI_mob_jadespine_basilisk; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_lore_keeper_of_norgannon"; - newscript->pGossipHello = &GossipHello_npc_lore_keeper_of_norgannon; - newscript->pGossipSelect = &GossipSelect_npc_lore_keeper_of_norgannon; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/zulaman/boss_akilzon.cpp b/src/server/scripts/EasternKingdoms/zulaman/boss_akilzon.cpp deleted file mode 100644 index f516065cc03..00000000000 --- a/src/server/scripts/EasternKingdoms/zulaman/boss_akilzon.cpp +++ /dev/null @@ -1,467 +0,0 @@ -/* Copyright ?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_Akilzon -SD%Complete: 75% -SDComment: Missing timer for Call Lightning and Sound ID's -SQLUpdate: -#Temporary fix for Soaring Eagles - -EndScriptData */ - -#include "ScriptedPch.h" -#include "zulaman.h" -#include "Weather.h" - -#define SPELL_STATIC_DISRUPTION 43622 -#define SPELL_STATIC_VISUAL 45265 -#define SPELL_CALL_LIGHTNING 43661 //Missing timer -#define SPELL_GUST_OF_WIND 43621 -#define SPELL_ELECTRICAL_STORM 43648 -#define SPELL_BERSERK 45078 -#define SPELL_ELECTRICAL_DAMAGE 43657 -#define SPELL_ELECTRICAL_OVERLOAD 43658 -#define SPELL_EAGLE_SWOOP 44732 - -//"Your death gonna be quick, strangers. You shoulda never have come to this place..." -#define SAY_ONAGGRO "I be da predator! You da prey..." -#define SAY_ONDEATH "You can't... kill... me spirit!" -#define SAY_ONSLAY1 "Ya got nothin'!" -#define SAY_ONSLAY2 "Stop your cryin'!" -#define SAY_ONSUMMON "Feed, me bruddahs!" -#define SAY_ONENRAGE "All you be doing is wasting my time!" -#define SOUND_ONAGGRO 12013 -#define SOUND_ONDEATH 12019 -#define SOUND_ONSLAY1 12017 -#define SOUND_ONSLAY2 12018 -#define SOUND_ONSUMMON 12014 -#define SOUND_ONENRAGE 12016 - -#define MOB_SOARING_EAGLE 24858 -#define SE_LOC_X_MAX 400 -#define SE_LOC_X_MIN 335 -#define SE_LOC_Y_MAX 1435 -#define SE_LOC_Y_MIN 1370 - -struct boss_akilzonAI : public ScriptedAI -{ - boss_akilzonAI(Creature *c) : ScriptedAI(c) - { - SpellEntry *TempSpell = GET_SPELL(SPELL_ELECTRICAL_DAMAGE); - if (TempSpell) - TempSpell->EffectBasePoints[1] = 49;//disable bugged lightning until fixed in core - pInstance = c->GetInstanceData(); - } - ScriptedInstance *pInstance; - - uint64 BirdGUIDs[8]; - uint64 TargetGUID; - uint64 CycloneGUID; - uint64 CloudGUID; - - uint32 StaticDisruption_Timer; - uint32 GustOfWind_Timer; - uint32 CallLighting_Timer; - uint32 ElectricalStorm_Timer; - uint32 SummonEagles_Timer; - uint32 Enrage_Timer; - - uint32 StormCount; - uint32 StormSequenceTimer; - - bool isRaining; - - void Reset() - { - if (pInstance) - pInstance->SetData(DATA_AKILZONEVENT, NOT_STARTED); - - StaticDisruption_Timer = urand(10000,20000); //10 to 20 seconds (bosskillers) - GustOfWind_Timer = urand(20000,30000); //20 to 30 seconds(bosskillers) - CallLighting_Timer = urand(10000,20000); //totaly random timer. can't find any info on this - ElectricalStorm_Timer = 60000; //60 seconds(bosskillers) - Enrage_Timer = 10*MINUTE*IN_MILISECONDS; //10 minutes till enrage(bosskillers) - SummonEagles_Timer = 99999; - - TargetGUID = 0; - CloudGUID = 0; - CycloneGUID = 0; - DespawnSummons(); - for (uint8 i = 0; i < 8; ++i) - BirdGUIDs[i] = 0; - - StormCount = 0; - StormSequenceTimer = 0; - - isRaining = false; - - SetWeather(WEATHER_STATE_FINE, 0.0f); - } - - void EnterCombat(Unit * /*who*/) - { - me->MonsterYell(SAY_ONAGGRO, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(me, SOUND_ONAGGRO); - //DoZoneInCombat(); - if (pInstance) - pInstance->SetData(DATA_AKILZONEVENT, IN_PROGRESS); - } - - void JustDied(Unit* /*Killer*/) - { - me->MonsterYell(SAY_ONDEATH,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(me, SOUND_ONDEATH); - if (pInstance) - pInstance->SetData(DATA_AKILZONEVENT, DONE); - DespawnSummons(); - } - - void KilledUnit(Unit* /*victim*/) - { - switch (urand(0,1)) - { - case 0: - me->MonsterYell(SAY_ONSLAY1, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(me, SOUND_ONSLAY1); - break; - case 1: - me->MonsterYell(SAY_ONSLAY2, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(me, SOUND_ONSLAY2); - break; - } - } - - void DespawnSummons() - { - for (uint8 i = 0; i < 8; ++i) - { - Unit* bird = Unit::GetUnit(*me,BirdGUIDs[i]); - if (bird && bird->isAlive()) - { - bird->SetVisibility(VISIBILITY_OFF); - bird->setDeathState(JUST_DIED); - } - } - } - - void SetWeather(uint32 weather, float grade) - { - Map* pMap = me->GetMap(); - if (!pMap->IsDungeon()) - return; - - WorldPacket data(SMSG_WEATHER, (4+4+4)); - data << uint32(weather) << float(grade) << uint8(0); - - pMap->SendToPlayers(&data); - } - - void HandleStormSequence(Unit *Cloud) // 1: begin, 2-9: tick, 10: end - { - if (StormCount < 10 && StormCount > 1) - { - // deal damage - int32 bp0 = 800; - for (uint8 i = 2; i < StormCount; ++i) - bp0 *= 2; - - CellPair p(Trinity::ComputeCellPair(me->GetPositionX(), me->GetPositionY())); - Cell cell(p); - cell.data.Part.reserved = ALL_DISTRICT; - cell.SetNoCreate(); - - std::list tempUnitMap; - - { - Trinity::AnyAoETargetUnitInObjectRangeCheck u_check(me, me, 999); - Trinity::UnitListSearcher searcher(me, tempUnitMap, u_check); - - TypeContainerVisitor, WorldTypeMapContainer > world_unit_searcher(searcher); - TypeContainerVisitor, GridTypeMapContainer > grid_unit_searcher(searcher); - - cell.Visit(p, world_unit_searcher, *(me->GetMap())); - cell.Visit(p, grid_unit_searcher, *(me->GetMap())); - } - //dealdamege - for (std::list::const_iterator i = tempUnitMap.begin(); i != tempUnitMap.end(); ++i) - { - if (!Cloud->IsWithinDist(*i, 6, false)) - { - Cloud->CastCustomSpell(*i, 43137, &bp0, NULL, NULL, true, 0, 0, me->GetGUID()); - } - } - // visual - float x,y,z; - z = me->GetPositionZ(); - for (uint8 i = 0; i < 5+rand()%5; ++i) - { - x = 343+rand()%60; - y = 1380+rand()%60; - if (Unit *trigger = me->SummonTrigger(x, y, z, 0, 2000)) - { - trigger->setFaction(35); - trigger->SetMaxHealth(100000); - trigger->SetHealth(100000); - trigger->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - if (Cloud) - Cloud->CastCustomSpell(trigger, /*43661*/43137, &bp0, NULL, NULL,true, 0, 0, Cloud->GetGUID()); - } - } - } - ++StormCount; - if (StormCount > 10) - { - StormCount = 0; // finish - SummonEagles_Timer = 5000; - me->InterruptNonMeleeSpells(false); - CloudGUID = 0; - if (Cloud) - Cloud->DealDamage(Cloud, Cloud->GetHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - SetWeather(WEATHER_STATE_FINE, 0.0f); - isRaining = false; - } - StormSequenceTimer = 1000; - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (StormCount) - { - Unit *pTarget = Unit::GetUnit(*me, CloudGUID); - if (!pTarget || !pTarget->isAlive()) - { - EnterEvadeMode(); - return; - } - else if (Unit* Cyclone = Unit::GetUnit(*me, CycloneGUID)) - Cyclone->CastSpell(pTarget, 25160, true); // keep casting or... - - if (StormSequenceTimer <= diff) - HandleStormSequence(pTarget); - else - StormSequenceTimer -= diff; - - return; - } - - if (Enrage_Timer <= diff) - { - me->MonsterYell(SAY_ONENRAGE, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(me, SOUND_ONENRAGE); - DoCast(me, SPELL_BERSERK, true); - Enrage_Timer = 600000; - } else Enrage_Timer -= diff; - - if (StaticDisruption_Timer <= diff) - { - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1); - if (!pTarget) pTarget = me->getVictim(); - TargetGUID = pTarget->GetGUID(); - DoCast(pTarget, SPELL_STATIC_DISRUPTION, false); - me->SetInFront(me->getVictim()); - StaticDisruption_Timer = (10+rand()%8)*1000; // < 20s - - /*if (float dist = me->IsWithinDist3d(pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 5.0f) dist = 5.0f; - SDisruptAOEVisual_Timer = 1000 + floor(dist / 30 * 1000.0f);*/ - } else StaticDisruption_Timer -= diff; - - if (GustOfWind_Timer <= diff) - { - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1); - if (!pTarget) pTarget = me->getVictim(); - DoCast(pTarget, SPELL_GUST_OF_WIND); - GustOfWind_Timer = (20+rand()%10)*1000; //20 to 30 seconds(bosskillers) - } else GustOfWind_Timer -= diff; - - if (CallLighting_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_CALL_LIGHTNING); - CallLighting_Timer = (12 + rand()%5)*1000; //totaly random timer. can't find any info on this - } else CallLighting_Timer -= diff; - - if (!isRaining && ElectricalStorm_Timer < 8000 + rand()%5000) - { - SetWeather(WEATHER_STATE_HEAVY_RAIN, 0.9999f); - isRaining = true; - } - - if (ElectricalStorm_Timer <= diff) { - Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 50, true); - if (!pTarget) - { - EnterEvadeMode(); - return; - } - pTarget->CastSpell(pTarget, 44007, true);//cloud visual - DoCast(pTarget, SPELL_ELECTRICAL_STORM, false);//storm cyclon + visual - float x,y,z; - pTarget->GetPosition(x,y,z); - if (pTarget) - { - pTarget->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); - pTarget->SendMonsterMove(x,y,me->GetPositionZ()+15,0); - } - Unit *Cloud = me->SummonTrigger(x, y, me->GetPositionZ()+16, 0, 15000); - if (Cloud) - { - CloudGUID = Cloud->GetGUID(); - Cloud->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); - Cloud->StopMoving(); - Cloud->SetFloatValue(OBJECT_FIELD_SCALE_X, 1.0f); - Cloud->setFaction(35); - Cloud->SetMaxHealth(9999999); - Cloud->SetHealth(9999999); - Cloud->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - } - ElectricalStorm_Timer = 60000; //60 seconds(bosskillers) - StormCount = 1; - StormSequenceTimer = 0; - } else ElectricalStorm_Timer -= diff; - - if (SummonEagles_Timer <= diff) - { - me->MonsterYell(SAY_ONSUMMON, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(me, SOUND_ONSUMMON); - - float x, y, z; - me->GetPosition(x, y, z); - - for (uint8 i = 0; i < 8; ++i) - { - Unit* bird = Unit::GetUnit(*me,BirdGUIDs[i]); - if (!bird) //they despawned on die - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - x = pTarget->GetPositionX() + irand(-10,10); - y = pTarget->GetPositionY() + irand(-10,10); - z = pTarget->GetPositionZ() + urand(16,20); - if (z > 95) - z = 95 - urand(0,5); - } - Creature *pCreature = me->SummonCreature(MOB_SOARING_EAGLE, x, y, z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); - if (pCreature) - { - pCreature->AddThreat(me->getVictim(), 1.0f); - pCreature->AI()->AttackStart(me->getVictim()); - BirdGUIDs[i] = pCreature->GetGUID(); - } - } - } - SummonEagles_Timer = 999999; - } else SummonEagles_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -struct mob_soaring_eagleAI : public ScriptedAI -{ - mob_soaring_eagleAI(Creature *c) : ScriptedAI(c) {} - - uint32 EagleSwoop_Timer; - bool arrived; - uint32 TargetGUID; - - void Reset() - { - EagleSwoop_Timer = 5000 + rand()%5000; - arrived = true; - TargetGUID = 0; - me->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); - } - - void EnterCombat(Unit * /*who*/) {DoZoneInCombat();} - - void MoveInLineOfSight(Unit* /*who*/) {} - - void MovementInform(uint32, uint32) - { - arrived = true; - if (TargetGUID) - { - if (Unit *pTarget = Unit::GetUnit(*me, TargetGUID)) - DoCast(pTarget, SPELL_EAGLE_SWOOP, true); - TargetGUID = 0; - me->SetSpeed(MOVE_RUN, 1.2f); - EagleSwoop_Timer = 5000 + rand()%5000; - } - } - - void UpdateAI(const uint32 diff) - { - if (EagleSwoop_Timer <= diff) - EagleSwoop_Timer = 0; - else - EagleSwoop_Timer -= diff; - - if (arrived) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - float x, y, z; - if (EagleSwoop_Timer) - { - x = pTarget->GetPositionX() + irand(-10,10); - y = pTarget->GetPositionY() + irand(-10,10); - z = pTarget->GetPositionZ() + urand(10,15); - if (z > 95) - z = 95 - urand(0,5); - } - else - { - pTarget->GetContactPoint(me, x, y, z); - z += 2; - me->SetSpeed(MOVE_RUN, 5.0f); - TargetGUID = pTarget->GetGUID(); - } - me->GetMotionMaster()->MovePoint(0, x, y, z); - arrived = false; - } - } - } -}; - -//Soaring Eagle -CreatureAI* GetAI_mob_soaring_eagle(Creature* pCreature) -{ - return new mob_soaring_eagleAI(pCreature); -} - -CreatureAI* GetAI_boss_akilzon(Creature* pCreature) -{ - return new boss_akilzonAI(pCreature); -} - -void AddSC_boss_akilzon() -{ - Script *newscript = NULL; - - newscript = new Script; - newscript->Name = "boss_akilzon"; - newscript->GetAI = &GetAI_boss_akilzon; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_akilzon_eagle"; - newscript->GetAI = &GetAI_mob_soaring_eagle; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/zulaman/boss_halazzi.cpp b/src/server/scripts/EasternKingdoms/zulaman/boss_halazzi.cpp deleted file mode 100644 index aee0a8a59ea..00000000000 --- a/src/server/scripts/EasternKingdoms/zulaman/boss_halazzi.cpp +++ /dev/null @@ -1,401 +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_Halazzi -SD%Complete: 80 -SDComment: -SDCategory: Zul'Aman -EndScriptData */ - -#include "ScriptedPch.h" -#include "zulaman.h" -//#include "spell.h" - -#define YELL_AGGRO "Get on your knees and bow to da fang and claw!" -#define SOUND_AGGRO 12020 -#define YELL_SABER_ONE "You gonna leave in pieces!" -#define YELL_SABER_TWO "Me gonna carve ya now!" -#define YELL_SPLIT "Me gonna carve ya now!" -#define SOUND_SPLIT 12021 -#define YELL_MERGE "Spirit, come back to me!" -#define SOUND_MERGE 12022 -#define YELL_KILL_ONE "You cant fight the power!" -#define SOUND_KILL_ONE 12026 -#define YELL_KILL_TWO "You gonna fail!" -#define SOUND_KILL_TWO 12027 -#define YELL_DEATH "Chaga... choka'jinn." -#define SOUND_DEATH 12028 -#define YELL_BERSERK "Whatch you be doing? Pissin' yourselves..." -#define SOUND_BERSERK 12025 - -#define SPELL_DUAL_WIELD 29651 -#define SPELL_SABER_LASH 43267 -#define SPELL_FRENZY 43139 -#define SPELL_FLAMESHOCK 43303 -#define SPELL_EARTHSHOCK 43305 -#define SPELL_TRANSFORM_SPLIT 43142 -#define SPELL_TRANSFORM_SPLIT2 43573 -#define SPELL_TRANSFORM_MERGE 43271 -#define SPELL_SUMMON_LYNX 43143 -#define SPELL_SUMMON_TOTEM 43302 -#define SPELL_BERSERK 45078 - -#define MOB_SPIRIT_LYNX 24143 -#define SPELL_LYNX_FRENZY 43290 -#define SPELL_SHRED_ARMOR 43243 - -#define MOB_TOTEM 24224 -#define SPELL_LIGHTNING 43301 - -enum PhaseHalazzi -{ - PHASE_NONE = 0, - PHASE_LYNX = 1, - PHASE_SPLIT = 2, - PHASE_HUMAN = 3, - PHASE_MERGE = 4, - PHASE_ENRAGE = 5 -}; - -struct boss_halazziAI : public ScriptedAI -{ - boss_halazziAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - // need to find out what controls totem's spell cooldown - SpellEntry *TempSpell = GET_SPELL(SPELL_LIGHTNING); - if (TempSpell && TempSpell->CastingTimeIndex != 5) - TempSpell->CastingTimeIndex = 5; // 2000 ms casting time - } - - ScriptedInstance *pInstance; - - uint32 FrenzyTimer; - uint32 SaberlashTimer; - uint32 ShockTimer; - uint32 TotemTimer; - uint32 CheckTimer; - uint32 BerserkTimer; - - uint32 TransformCount; - - PhaseHalazzi Phase; - - uint64 LynxGUID; - - void Reset() - { - if (pInstance) - pInstance->SetData(DATA_HALAZZIEVENT, NOT_STARTED); - - TransformCount = 0; - BerserkTimer = 600000; - CheckTimer = 1000; - - DoCast(me, SPELL_DUAL_WIELD, true); - - Phase = PHASE_NONE; - EnterPhase(PHASE_LYNX); - } - - void EnterCombat(Unit * /*who*/) - { - if (pInstance) - pInstance->SetData(DATA_HALAZZIEVENT, IN_PROGRESS); - - me->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(me, SOUND_AGGRO); - - EnterPhase(PHASE_LYNX); - } - - void JustSummoned(Creature* summon) - { - summon->AI()->AttackStart(me->getVictim()); - if (summon->GetEntry() == MOB_SPIRIT_LYNX) - LynxGUID = summon->GetGUID(); - } - - void DamageTaken(Unit * /*done_by*/, uint32 &damage) - { - if (damage >= me->GetHealth() && Phase != PHASE_ENRAGE) - damage = 0; - } - - void SpellHit(Unit*, const SpellEntry *spell) - { - if (spell->Id == SPELL_TRANSFORM_SPLIT2) - EnterPhase(PHASE_HUMAN); - } - - void AttackStart(Unit *who) - { - if (Phase != PHASE_MERGE) ScriptedAI::AttackStart(who); - } - - void EnterPhase(PhaseHalazzi NextPhase) - { - switch(NextPhase) - { - case PHASE_LYNX: - case PHASE_ENRAGE: - if (Phase == PHASE_MERGE) - { - DoCast(me, SPELL_TRANSFORM_MERGE, true); - me->Attack(me->getVictim(), true); - me->GetMotionMaster()->MoveChase(me->getVictim()); - } - if (Creature *Lynx = Unit::GetCreature(*me, LynxGUID)) - Lynx->DisappearAndDie(); - me->SetMaxHealth(600000); - me->SetHealth(600000 - 150000 * TransformCount); - FrenzyTimer = 16000; - SaberlashTimer = 20000; - ShockTimer = 10000; - TotemTimer = 12000; - break; - case PHASE_SPLIT: - me->MonsterYell(YELL_SPLIT, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(me, SOUND_SPLIT); - DoCast(me, SPELL_TRANSFORM_SPLIT, true); - break; - case PHASE_HUMAN: - //DoCast(me, SPELL_SUMMON_LYNX, true); - DoSpawnCreature(MOB_SPIRIT_LYNX, 5,5,0,0, TEMPSUMMON_CORPSE_DESPAWN, 0); - me->SetMaxHealth(400000); - me->SetHealth(400000); - ShockTimer = 10000; - TotemTimer = 12000; - break; - case PHASE_MERGE: - if (Unit *pLynx = Unit::GetUnit(*me, LynxGUID)) - { - me->MonsterYell(YELL_MERGE, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(me, SOUND_MERGE); - pLynx->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - pLynx->GetMotionMaster()->Clear(); - pLynx->GetMotionMaster()->MoveFollow(me, 0, 0); - me->GetMotionMaster()->Clear(); - me->GetMotionMaster()->MoveFollow(pLynx, 0, 0); - ++TransformCount; - } - break; - default: - break; - } - Phase = NextPhase; - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (BerserkTimer <= diff) - { - me->MonsterYell(YELL_BERSERK, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(me, SOUND_BERSERK); - DoCast(me, SPELL_BERSERK, true); - BerserkTimer = 60000; - } else BerserkTimer -= diff; - - if (Phase == PHASE_LYNX || Phase == PHASE_ENRAGE) - { - if (SaberlashTimer <= diff) - { - // A tank with more than 490 defense skills should receive no critical hit - //DoCast(me, 41296, true); - DoCast(me->getVictim(), SPELL_SABER_LASH, true); - //me->RemoveAurasDueToSpell(41296); - SaberlashTimer = 30000; - } else SaberlashTimer -= diff; - - if (FrenzyTimer <= diff) - { - DoCast(me, SPELL_FRENZY); - FrenzyTimer = urand(10000,15000); - } else FrenzyTimer -= diff; - - if (Phase == PHASE_LYNX) - if (CheckTimer <= diff) - { - if (me->GetHealth() * 4 < me->GetMaxHealth() * (3 - TransformCount)) - EnterPhase(PHASE_SPLIT); - CheckTimer = 1000; - } else CheckTimer -= diff; - } - - if (Phase == PHASE_HUMAN || Phase == PHASE_ENRAGE) - { - if (TotemTimer <= diff) - { - DoCast(me, SPELL_SUMMON_TOTEM); - TotemTimer = 20000; - } else TotemTimer -= diff; - - if (ShockTimer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) - { - if (pTarget->IsNonMeleeSpellCasted(false)) - DoCast(pTarget, SPELL_EARTHSHOCK); - else - DoCast(pTarget, SPELL_FLAMESHOCK); - ShockTimer = 10000 + rand()%5000; - } - } else ShockTimer -= diff; - - if (Phase == PHASE_HUMAN) - if (CheckTimer <= diff) - { - if (((me->GetHealth()*100) / me->GetMaxHealth() <= 20)/*me->GetHealth() * 10 < me->GetMaxHealth()*/) - EnterPhase(PHASE_MERGE); - else - { - Unit *Lynx = Unit::GetUnit(*me, LynxGUID); - if (Lynx && ((Lynx->GetHealth()*100) / Lynx->GetMaxHealth() <= 20)/*Lynx->GetHealth() * 10 < Lynx->GetMaxHealth()*/) - EnterPhase(PHASE_MERGE); - } - CheckTimer = 1000; - } else CheckTimer -= diff; - } - - if (Phase == PHASE_MERGE) - { - if (CheckTimer <= diff) - { - Unit *Lynx = Unit::GetUnit(*me, LynxGUID); - if (Lynx) - { - Lynx->GetMotionMaster()->MoveFollow(me, 0, 0); - me->GetMotionMaster()->MoveFollow(Lynx, 0, 0); - if (me->IsWithinDistInMap(Lynx, 6.0f)) - { - if (TransformCount < 3) - EnterPhase(PHASE_LYNX); - else - EnterPhase(PHASE_ENRAGE); - } - } - CheckTimer = 1000; - } else CheckTimer -= diff; - } - - DoMeleeAttackIfReady(); - } - - void KilledUnit(Unit* /*victim*/) - { - switch (urand(0,1)) - { - case 0: - me->MonsterYell(YELL_KILL_ONE, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(me, SOUND_KILL_ONE); - break; - - case 1: - me->MonsterYell(YELL_KILL_TWO, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(me, SOUND_KILL_TWO); - break; - } - } - - void JustDied(Unit* /*Killer*/) - { - if (pInstance) - pInstance->SetData(DATA_HALAZZIEVENT, DONE); - - me->MonsterYell(YELL_DEATH, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(me, SOUND_DEATH); - } -}; - -// Spirits Lynx AI - -struct boss_spiritlynxAI : public ScriptedAI -{ - boss_spiritlynxAI(Creature *c) : ScriptedAI(c) {} - - uint32 FrenzyTimer; - uint32 shredder_timer; - - void Reset() - { - FrenzyTimer = urand(30000,50000); //frenzy every 30-50 seconds - shredder_timer = 4000; - } - - void DamageTaken(Unit * /*done_by*/, uint32 &damage) - { - if (damage >= me->GetHealth()) - damage = 0; - } - - void AttackStart(Unit *who) - { - if (!me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - ScriptedAI::AttackStart(who); - } - - void EnterCombat(Unit * /*who*/) {/*DoZoneInCombat();*/} - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (FrenzyTimer <= diff) - { - DoCast(me, SPELL_LYNX_FRENZY); - FrenzyTimer = urand(30000,50000); //frenzy every 30-50 seconds - } else FrenzyTimer -= diff; - - if (shredder_timer <= diff) - { - DoCast(me->getVictim(), SPELL_SHRED_ARMOR); - shredder_timer = 4000; - } else shredder_timer -= diff; - - DoMeleeAttackIfReady(); - } - -}; - -CreatureAI* GetAI_boss_halazziAI(Creature* pCreature) -{ - return new boss_halazziAI (pCreature); -} - -CreatureAI* GetAI_boss_spiritlynxAI(Creature* pCreature) -{ - return new boss_spiritlynxAI (pCreature); -} - -void AddSC_boss_halazzi() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_halazzi"; - newscript->GetAI = &GetAI_boss_halazziAI; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_halazzi_lynx"; - newscript->GetAI = &GetAI_boss_spiritlynxAI; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/zulaman/boss_hexlord.cpp b/src/server/scripts/EasternKingdoms/zulaman/boss_hexlord.cpp deleted file mode 100644 index 7baa9292142..00000000000 --- a/src/server/scripts/EasternKingdoms/zulaman/boss_hexlord.cpp +++ /dev/null @@ -1,907 +0,0 @@ -/* Copyright ?2006,2007 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_Hex_Lord_Malacrass -SD%Complete: -SDComment: -SDCategory: Zul'Aman -EndScriptData */ - -#include "ScriptedPch.h" -#include "zulaman.h" - -#define YELL_AGGRO "Da shadow gonna fall on you... " -#define SOUND_YELL_AGGRO 12041 -#define YELL_SPIRIT_BOLTS "Your soul gonna bleed!" -#define SOUND_YELL_SPIRIT_BOLTS 12047 -#define YELL_DRAIN_POWER "Darkness comin\' for you" -#define SOUND_YELL_DRAIN_POWER 12046 -#define YELL_KILL_ONE "Dis a nightmare ya don\' wake up from!" -#define SOUND_YELL_KILL_ONE 12043 -#define YELL_KILL_TWO "Azzaga choogo zinn!" -#define SOUND_YELL_KILL_TWO 12044 -#define YELL_DEATH "Dis not... da end of me..." -#define SOUND_YELL_DEATH 12051 - -#define SPELL_SPIRIT_BOLTS 43383 -#define SPELL_DRAIN_POWER 44131 -#define SPELL_SIPHON_SOUL 43501 - -#define MOB_TEMP_TRIGGER 23920 - -//Defines for various powers he uses after using soul drain - -//Druid -#define SPELL_DR_LIFEBLOOM 43421 -#define SPELL_DR_THORNS 43420 -#define SPELL_DR_MOONFIRE 43545 - -//Hunter -#define SPELL_HU_EXPLOSIVE_TRAP 43444 -#define SPELL_HU_FREEZING_TRAP 43447 -#define SPELL_HU_SNAKE_TRAP 43449 - -//Mage -#define SPELL_MG_FIREBALL 41383 -#define SPELL_MG_FROSTBOLT 43428 -#define SPELL_MG_FROST_NOVA 43426 -#define SPELL_MG_ICE_LANCE 43427 - -//Paladin -#define SPELL_PA_CONSECRATION 43429 -#define SPELL_PA_HOLY_LIGHT 43451 -#define SPELL_PA_AVENGING_WRATH 43430 - -//Priest -#define SPELL_PR_HEAL 41372 -#define SPELL_PR_MIND_CONTROL 43550 -#define SPELL_PR_MIND_BLAST 41374 -#define SPELL_PR_SW_DEATH 41375 -#define SPELL_PR_PSYCHIC_SCREAM 43432 -#define SPELL_PR_PAIN_SUPP 44416 - -//Rogue -#define SPELL_RO_BLIND 43433 -#define SPELL_RO_SLICE_DICE 43457 -#define SPELL_RO_WOUND_POISON 39665 - -//Shaman -#define SPELL_SH_FIRE_NOVA 43436 -#define SPELL_SH_HEALING_WAVE 43548 -#define SPELL_SH_CHAIN_LIGHT 43435 - -//Warlock -#define SPELL_WL_CURSE_OF_DOOM 43439 -#define SPELL_WL_RAIN_OF_FIRE 43440 -#define SPELL_WL_UNSTABLE_AFFL 35183 - -//Warrior -#define SPELL_WR_SPELL_REFLECT 43443 -#define SPELL_WR_WHIRLWIND 43442 -#define SPELL_WR_MORTAL_STRIKE 43441 - -#define ORIENT 1.5696 -#define POS_Y 921.2795 -#define POS_Z 33.8883 - -static float Pos_X[4] = {112.8827, 107.8827, 122.8827, 127.8827}; - -static uint32 AddEntryList[8]= -{ - 24240, //Alyson Antille - 24241, //Thurg - 24242, //Slither - 24243, //Lord Raadan - 24244, //Gazakroth - 24245, //Fenstalker - 24246, //Darkheart - 24247 //Koragg -}; - -enum AbilityTarget -{ - ABILITY_TARGET_SELF = 0, - ABILITY_TARGET_VICTIM = 1, - ABILITY_TARGET_ENEMY = 2, - ABILITY_TARGET_HEAL = 3, - ABILITY_TARGET_BUFF = 4, - ABILITY_TARGET_SPECIAL = 5 -}; - -struct PlayerAbilityStruct -{ - uint32 spell; - AbilityTarget target; - uint32 cooldown; -}; - -static PlayerAbilityStruct PlayerAbility[][3] = -{ - // 1 warrior - {{SPELL_WR_SPELL_REFLECT, ABILITY_TARGET_SELF, 10000}, - {SPELL_WR_WHIRLWIND, ABILITY_TARGET_SELF, 10000}, - {SPELL_WR_MORTAL_STRIKE, ABILITY_TARGET_VICTIM, 6000}}, - // 2 paladin - {{SPELL_PA_CONSECRATION, ABILITY_TARGET_SELF, 10000}, - {SPELL_PA_HOLY_LIGHT, ABILITY_TARGET_HEAL, 10000}, - {SPELL_PA_AVENGING_WRATH, ABILITY_TARGET_SELF, 10000}}, - // 3 hunter - {{SPELL_HU_EXPLOSIVE_TRAP, ABILITY_TARGET_SELF, 10000}, - {SPELL_HU_FREEZING_TRAP, ABILITY_TARGET_SELF, 10000}, - {SPELL_HU_SNAKE_TRAP, ABILITY_TARGET_SELF, 10000}}, - // 4 rogue - {{SPELL_RO_WOUND_POISON, ABILITY_TARGET_VICTIM, 3000}, - {SPELL_RO_SLICE_DICE, ABILITY_TARGET_SELF, 10000}, - {SPELL_RO_BLIND, ABILITY_TARGET_ENEMY, 10000}}, - // 5 priest - {{SPELL_PR_PAIN_SUPP, ABILITY_TARGET_HEAL, 10000}, - {SPELL_PR_HEAL, ABILITY_TARGET_HEAL, 10000}, - {SPELL_PR_PSYCHIC_SCREAM, ABILITY_TARGET_SELF, 10000}}, - // 5* shadow priest - {{SPELL_PR_MIND_CONTROL, ABILITY_TARGET_ENEMY, 15000}, - {SPELL_PR_MIND_BLAST, ABILITY_TARGET_ENEMY, 5000}, - {SPELL_PR_SW_DEATH, ABILITY_TARGET_ENEMY, 10000}}, - // 7 shaman - {{SPELL_SH_FIRE_NOVA, ABILITY_TARGET_SELF, 10000}, - {SPELL_SH_HEALING_WAVE, ABILITY_TARGET_HEAL, 10000}, - {SPELL_SH_CHAIN_LIGHT, ABILITY_TARGET_ENEMY, 8000}}, - // 8 mage - {{SPELL_MG_FIREBALL, ABILITY_TARGET_ENEMY, 5000}, - {SPELL_MG_FROSTBOLT, ABILITY_TARGET_ENEMY, 5000}, - {SPELL_MG_ICE_LANCE, ABILITY_TARGET_SPECIAL, 2000}}, - // 9 warlock - {{SPELL_WL_CURSE_OF_DOOM, ABILITY_TARGET_ENEMY, 10000}, - {SPELL_WL_RAIN_OF_FIRE, ABILITY_TARGET_ENEMY, 10000}, - {SPELL_WL_UNSTABLE_AFFL, ABILITY_TARGET_ENEMY, 10000}}, - // 11 druid - {{SPELL_DR_LIFEBLOOM, ABILITY_TARGET_HEAL, 10000}, - {SPELL_DR_THORNS, ABILITY_TARGET_SELF, 10000}, - {SPELL_DR_MOONFIRE, ABILITY_TARGET_ENEMY, 8000}} -}; - -struct boss_hexlord_addAI : public ScriptedAI -{ - ScriptedInstance* pInstance; - - boss_hexlord_addAI(Creature* c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - void Reset() {} - - void EnterCombat(Unit* /*who*/) {DoZoneInCombat();} - - void UpdateAI(const uint32 /*diff*/) - { - if (pInstance && pInstance->GetData(DATA_HEXLORDEVENT) != IN_PROGRESS) - { - EnterEvadeMode(); - return; - } - - DoMeleeAttackIfReady(); - } -}; - -struct boss_hex_lord_malacrassAI : public ScriptedAI -{ - boss_hex_lord_malacrassAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - SelectAddEntry(); - for (uint8 i = 0; i < 4; ++i) - AddGUID[i] = 0; - } - - ScriptedInstance *pInstance; - - uint64 AddGUID[4]; - uint32 AddEntry[4]; - - uint64 PlayerGUID; - - uint32 SpiritBolts_Timer; - uint32 DrainPower_Timer; - uint32 SiphonSoul_Timer; - uint32 PlayerAbility_Timer; - uint32 CheckAddState_Timer; - uint32 ResetTimer; - - uint32 PlayerClass; - - void Reset() - { - if (pInstance) - pInstance->SetData(DATA_HEXLORDEVENT, NOT_STARTED); - - SpiritBolts_Timer = 20000; - DrainPower_Timer = 60000; - SiphonSoul_Timer = 100000; - PlayerAbility_Timer = 99999; - CheckAddState_Timer = 5000; - ResetTimer = 5000; - - SpawnAdds(); - - me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 46916); - me->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE); - } - - void EnterCombat(Unit* /*who*/) - { - if (pInstance) - pInstance->SetData(DATA_HEXLORDEVENT, IN_PROGRESS); - - DoZoneInCombat(); - me->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(me, SOUND_YELL_AGGRO); - - for (uint8 i = 0; i < 4; ++i) - { - Unit* Temp = Unit::GetUnit((*me),AddGUID[i]); - if (Temp && Temp->isAlive()) - CAST_CRE(Temp)->AI()->AttackStart(me->getVictim()); - else - { - EnterEvadeMode(); - break; - } - } - } - - void KilledUnit(Unit* /*victim*/) - { - switch (urand(0,1)) - { - case 0: - me->MonsterYell(YELL_KILL_ONE, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(me, SOUND_YELL_KILL_ONE); - break; - case 1: - me->MonsterYell(YELL_KILL_TWO, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(me, SOUND_YELL_KILL_TWO); - break; - } - } - - void JustDied(Unit* /*victim*/) - { - if (pInstance) - pInstance->SetData(DATA_HEXLORDEVENT, DONE); - - me->MonsterYell(YELL_DEATH, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(me, SOUND_YELL_DEATH); - - for (uint8 i = 0; i < 4 ; ++i) - { - Unit* Temp = Unit::GetUnit((*me),AddGUID[i]); - if (Temp && Temp->isAlive()) - Temp->DealDamage(Temp, Temp->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - } - } - - void SelectAddEntry() - { - std::vector AddList; - - for (uint8 i = 0; i < 8; ++i) - AddList.push_back(AddEntryList[i]); - - while (AddList.size() > 4) - AddList.erase(AddList.begin()+rand()%AddList.size()); - - uint8 i = 0; - for (std::vector::const_iterator itr = AddList.begin(); itr != AddList.end(); ++itr, ++i) - AddEntry[i] = *itr; - } - - void SpawnAdds() - { - for (uint8 i = 0; i < 4; ++i) - { - Creature *pCreature = (Unit::GetCreature((*me), AddGUID[i])); - if (!pCreature || !pCreature->isAlive()) - { - if (pCreature) pCreature->setDeathState(DEAD); - pCreature = me->SummonCreature(AddEntry[i], Pos_X[i], POS_Y, POS_Z, ORIENT, TEMPSUMMON_DEAD_DESPAWN, 0); - if (pCreature) AddGUID[i] = pCreature->GetGUID(); - } - else - { - pCreature->AI()->EnterEvadeMode(); - pCreature->GetMap()->CreatureRelocation(me, Pos_X[i], POS_Y, POS_Z, ORIENT); - pCreature->StopMoving(); - } - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (ResetTimer <= diff) - { - if (me->IsWithinDist3d(119.223, 1035.45, 29.4481, 10)) - { - EnterEvadeMode(); - return; - } - ResetTimer = 5000; - } else ResetTimer -= diff; - - if (CheckAddState_Timer <= diff) - { - for (uint8 i = 0; i < 4; ++i) - if (Creature *pTemp = Unit::GetCreature(*me, AddGUID[i])) - if (pTemp->isAlive() && !pTemp->getVictim()) - pTemp->AI()->AttackStart(me->getVictim()); - - CheckAddState_Timer = 5000; - } else CheckAddState_Timer -= diff; - - if (DrainPower_Timer <= diff) - { - DoCast(me, SPELL_DRAIN_POWER, true); - me->MonsterYell(YELL_DRAIN_POWER, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(me, SOUND_YELL_DRAIN_POWER); - DrainPower_Timer = urand(40000,55000); // must cast in 60 sec, or buff/debuff will disappear - } else DrainPower_Timer -= diff; - - if (SpiritBolts_Timer <= diff) - { - if (DrainPower_Timer < 12000) // channel 10 sec - SpiritBolts_Timer = 13000; // cast drain power first - else - { - DoCast(me, SPELL_SPIRIT_BOLTS, false); - me->MonsterYell(YELL_SPIRIT_BOLTS, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(me, SOUND_YELL_SPIRIT_BOLTS); - SpiritBolts_Timer = 40000; - SiphonSoul_Timer = 10000; // ready to drain - PlayerAbility_Timer = 99999; - } - } else SpiritBolts_Timer -= diff; - - if (SiphonSoul_Timer <= diff) - { - Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 70, true); - Unit *trigger = DoSpawnCreature(MOB_TEMP_TRIGGER, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN, 30000); - if (!pTarget || !trigger) - { - EnterEvadeMode(); - return; - } - else - { - trigger->SetDisplayId(11686); - trigger->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - trigger->CastSpell(pTarget, SPELL_SIPHON_SOUL, true); - trigger->GetMotionMaster()->MoveChase(me); - - //DoCast(pTarget, SPELL_SIPHON_SOUL, true); - //me->SetUInt64Value(UNIT_FIELD_CHANNEL_OBJECT, pTarget->GetGUID()); - //me->SetUInt32Value(UNIT_CHANNEL_SPELL, SPELL_SIPHON_SOUL); - - PlayerGUID = pTarget->GetGUID(); - PlayerAbility_Timer = urand(8000,10000); - PlayerClass = pTarget->getClass() - 1; - - if (PlayerClass == CLASS_DRUID-1) - PlayerClass = CLASS_DRUID; - else if (PlayerClass == CLASS_PRIEST-1 && pTarget->HasSpell(15473)) - PlayerClass = CLASS_PRIEST; // shadow priest - - SiphonSoul_Timer = 99999; // buff lasts 30 sec - } - } else SiphonSoul_Timer -= diff; - - if (PlayerAbility_Timer <= diff) - { - //Unit *pTarget = Unit::GetUnit(*me, PlayerGUID); - //if (pTarget && pTarget->isAlive()) - //{ - UseAbility(); - PlayerAbility_Timer = urand(8000,10000); - //} - } else PlayerAbility_Timer -= diff; - - DoMeleeAttackIfReady(); - } - - void UseAbility() - { - uint8 random = urand(0,2); - Unit *pTarget = NULL; - switch(PlayerAbility[PlayerClass][random].target) - { - case ABILITY_TARGET_SELF: - pTarget = me; - break; - case ABILITY_TARGET_VICTIM: - pTarget = me->getVictim(); - break; - case ABILITY_TARGET_ENEMY: - default: - pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); - break; - case ABILITY_TARGET_HEAL: - pTarget = DoSelectLowestHpFriendly(50, 0); - break; - case ABILITY_TARGET_BUFF: - { - std::list templist = DoFindFriendlyMissingBuff(50, PlayerAbility[PlayerClass][random].spell); - if (!templist.empty()) - pTarget = *(templist.begin()); - } - break; - } - if (pTarget) - DoCast(pTarget, PlayerAbility[PlayerClass][random].spell, false); - } -}; - -#define SPELL_BLOODLUST 43578 -#define SPELL_CLEAVE 15496 - -struct boss_thurgAI : public boss_hexlord_addAI -{ - - boss_thurgAI(Creature *c) : boss_hexlord_addAI(c) {} - - uint32 bloodlust_timer; - uint32 cleave_timer; - - void Reset() - { - bloodlust_timer = 15000; - cleave_timer = 10000; - - boss_hexlord_addAI::Reset(); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (bloodlust_timer <= diff) - { - std::list templist = DoFindFriendlyMissingBuff(50, SPELL_BLOODLUST); - if (!templist.empty()) - { - if (Unit *pTarget = *(templist.begin())) - DoCast(pTarget, SPELL_BLOODLUST, false); - } - bloodlust_timer = 12000; - } else bloodlust_timer -= diff; - - if (cleave_timer <= diff) - { - DoCast(me->getVictim(), SPELL_CLEAVE, false); - cleave_timer = 12000; //3 sec cast - } else cleave_timer -= diff; - - boss_hexlord_addAI::UpdateAI(diff); - } -}; - -#define SPELL_FLASH_HEAL 43575 -#define SPELL_DISPEL_MAGIC 43577 - -struct boss_alyson_antilleAI : public boss_hexlord_addAI -{ - //Holy Priest - boss_alyson_antilleAI(Creature *c) : boss_hexlord_addAI(c) {} - - uint32 flashheal_timer; - uint32 dispelmagic_timer; - - void Reset() - { - flashheal_timer = 2500; - dispelmagic_timer = 10000; - - //AcquireGUID(); - - boss_hexlord_addAI::Reset(); - } - - void AttackStart(Unit* who) - { - if (!who) - return; - - if (who->isTargetableForAttack()) - { - if (me->Attack(who, false)) - { - me->GetMotionMaster()->MoveChase(who, 20); - me->AddThreat(who, 0.0f); - } - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (flashheal_timer <= diff) - { - Unit *pTarget = DoSelectLowestHpFriendly(99, 30000); - if (pTarget) - { - if (pTarget->IsWithinDistInMap(me, 50)) - DoCast(pTarget, SPELL_FLASH_HEAL, false); - else - { - // bugged - //me->GetMotionMaster()->Clear(); - //me->GetMotionMaster()->MoveChase(pTarget, 20); - } - } - else - { - if (urand(0,1)) - pTarget = DoSelectLowestHpFriendly(50, 0); - else - pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (pTarget) - DoCast(pTarget, SPELL_DISPEL_MAGIC, false); - } - flashheal_timer = 2500; - } else flashheal_timer -= diff; - - /*if (dispelmagic_timer <= diff) - { - if (urand(0,1)) - { - Unit *pTarget = SelectTarget(); - - DoCast(pTarget, SPELL_DISPEL_MAGIC, false); - } - else - me->CastSpell(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_DISPEL_MAGIC, false); - - dispelmagic_timer = 12000; - } else dispelmagic_timer -= diff;*/ - - boss_hexlord_addAI::UpdateAI(diff); - } -}; - -#define SPELL_FIREBOLT 43584 - -struct boss_gazakrothAI : public boss_hexlord_addAI -{ - boss_gazakrothAI(Creature *c) : boss_hexlord_addAI(c) {} - - uint32 firebolt_timer; - - void Reset() - { - firebolt_timer = 2000; - boss_hexlord_addAI::Reset(); - } - - void AttackStart(Unit* who) - { - if (!who) - return; - - if (who->isTargetableForAttack()) - { - if (me->Attack(who, false)) - { - me->GetMotionMaster()->MoveChase(who, 20); - me->AddThreat(who, 0.0f); - } - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (firebolt_timer <= diff) - { - DoCast(me->getVictim(), SPELL_FIREBOLT, false); - firebolt_timer = 700; - } else firebolt_timer -= diff; - - boss_hexlord_addAI::UpdateAI(diff); - } -}; - -#define SPELL_FLAME_BREATH 43582 -#define SPELL_THUNDERCLAP 43583 - -struct boss_lord_raadanAI : public boss_hexlord_addAI -{ - boss_lord_raadanAI(Creature *c) : boss_hexlord_addAI(c) {} - - uint32 flamebreath_timer; - uint32 thunderclap_timer; - - void Reset() - { - flamebreath_timer = 8000; - thunderclap_timer = 13000; - - boss_hexlord_addAI::Reset(); - - } - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (thunderclap_timer <= diff) - { - DoCast(me->getVictim(), SPELL_THUNDERCLAP, false); - thunderclap_timer = 12000; - } else thunderclap_timer -= diff; - - if (flamebreath_timer <= diff) - { - DoCast(me->getVictim(), SPELL_FLAME_BREATH, false); - flamebreath_timer = 12000; - } else flamebreath_timer -= diff; - - boss_hexlord_addAI::UpdateAI(diff); - } -}; - -#define SPELL_PSYCHIC_WAIL 43590 - -struct boss_darkheartAI : public boss_hexlord_addAI -{ - boss_darkheartAI(Creature *c) : boss_hexlord_addAI(c) {} - - uint32 psychicwail_timer; - - void Reset() - { - psychicwail_timer = 8000; - boss_hexlord_addAI::Reset(); - } - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (psychicwail_timer <= diff) - { - DoCast(me->getVictim(), SPELL_PSYCHIC_WAIL, false); - psychicwail_timer = 12000; - } else psychicwail_timer -= diff; - - boss_hexlord_addAI::UpdateAI(diff); - } -}; - -#define SPELL_VENOM_SPIT 43579 - -struct boss_slitherAI : public boss_hexlord_addAI -{ - boss_slitherAI(Creature *c) : boss_hexlord_addAI(c) {} - - uint32 venomspit_timer; - - void Reset() - { - venomspit_timer = 5000; - boss_hexlord_addAI::Reset(); - } - - void AttackStart(Unit* who) - { - if (!who) - return; - - if (who->isTargetableForAttack()) - { - if (me->Attack(who, false)) - { - me->GetMotionMaster()->MoveChase(who, 20); - me->AddThreat(who, 0.0f); - } - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (venomspit_timer <= diff) - { - if (Unit* victim = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) - DoCast(victim, SPELL_VENOM_SPIT, false); - venomspit_timer = 2500; - } else venomspit_timer -= diff; - - boss_hexlord_addAI::UpdateAI(diff); - } -}; - -//Fenstalker -#define SPELL_VOLATILE_INFECTION 43586 - -struct boss_fenstalkerAI : public boss_hexlord_addAI -{ - boss_fenstalkerAI(Creature *c) : boss_hexlord_addAI(c) {} - - uint32 volatileinf_timer; - - void Reset() - { - volatileinf_timer = 15000; - boss_hexlord_addAI::Reset(); - - } - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (volatileinf_timer <= diff) - { - // core bug - me->getVictim()->CastSpell(me->getVictim(),SPELL_VOLATILE_INFECTION, false); - volatileinf_timer = 12000; - } else volatileinf_timer -= diff; - - boss_hexlord_addAI::UpdateAI(diff); - } -}; - -//Koragg -#define SPELL_COLD_STARE 43593 -#define SPELL_MIGHTY_BLOW 43592 - -struct boss_koraggAI : public boss_hexlord_addAI -{ - boss_koraggAI(Creature *c) : boss_hexlord_addAI(c) {} - - uint32 coldstare_timer; - uint32 mightyblow_timer; - - void Reset() - { - coldstare_timer = 15000; - mightyblow_timer = 10000; - boss_hexlord_addAI::Reset(); - - } - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (mightyblow_timer <= diff) - { - DoCast(me->getVictim(), SPELL_MIGHTY_BLOW, false); - mightyblow_timer = 12000; - } - if (coldstare_timer <= diff) - { - if (Unit* victim = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) - DoCast(victim, SPELL_COLD_STARE, false); - coldstare_timer = 12000; - } - - boss_hexlord_addAI::UpdateAI(diff); - } -}; - -CreatureAI* GetAI_boss_hex_lord_malacrass(Creature* pCreature) -{ - return new boss_hex_lord_malacrassAI (pCreature); -} - -CreatureAI* GetAI_boss_thurg(Creature* pCreature) -{ - return new boss_thurgAI (pCreature); -} - -CreatureAI* GetAI_boss_alyson_antille(Creature* pCreature) -{ - return new boss_alyson_antilleAI (pCreature); -} - -CreatureAI* GetAI_boss_gazakroth(Creature* pCreature) -{ - return new boss_gazakrothAI (pCreature); -} - -CreatureAI* GetAI_boss_lord_raadan(Creature* pCreature) -{ - return new boss_lord_raadanAI (pCreature); -} - -CreatureAI* GetAI_boss_darkheart(Creature* pCreature) -{ - return new boss_darkheartAI (pCreature); -} - -CreatureAI* GetAI_boss_slither(Creature* pCreature) -{ - return new boss_slitherAI (pCreature); -} - -CreatureAI* GetAI_boss_fenstalker(Creature* pCreature) -{ - return new boss_fenstalkerAI (pCreature); -} - -CreatureAI* GetAI_boss_koragg(Creature* pCreature) -{ - return new boss_koraggAI (pCreature); -} -void AddSC_boss_hex_lord_malacrass() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_hexlord_malacrass"; - newscript->GetAI = &GetAI_boss_hex_lord_malacrass; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_thurg"; - newscript->GetAI = &GetAI_boss_thurg; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_gazakroth"; - newscript->GetAI = &GetAI_boss_gazakroth; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_lord_raadan"; - newscript->GetAI = &GetAI_boss_lord_raadan; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_darkheart"; - newscript->GetAI = &GetAI_boss_darkheart; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_slither"; - newscript->GetAI = &GetAI_boss_slither; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_fenstalker"; - newscript->GetAI = &GetAI_boss_fenstalker; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_koragg"; - newscript->GetAI = &GetAI_boss_koragg; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_alyson_antille"; - newscript->GetAI = &GetAI_boss_alyson_antille; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/zulaman/boss_janalai.cpp b/src/server/scripts/EasternKingdoms/zulaman/boss_janalai.cpp deleted file mode 100644 index 9ac54976241..00000000000 --- a/src/server/scripts/EasternKingdoms/zulaman/boss_janalai.cpp +++ /dev/null @@ -1,687 +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_Janalai -SD%Complete: 100 -SDComment: -SDCategory: Zul'Aman -EndScriptData */ - -#include "ScriptedPch.h" -#include "zulaman.h" -#include "GridNotifiers.h" - -enum eEnums -{ - SAY_AGGRO = -1568000, - SAY_FIRE_BOMBS = -1568001, - SAY_SUMMON_HATCHER = -1568002, - SAY_ALL_EGGS = -1568003, - SAY_BERSERK = -1568004, - SAY_SLAY_1 = -1568005, - SAY_SLAY_2 = -1568006, - SAY_DEATH = -1568007, - SAY_EVENT_STRANGERS = -1568008, - SAY_EVENT_FRIENDS = -1568009, - -// Jan'alai - SPELL_FLAME_BREATH = 43140, - SPELL_FIRE_WALL = 43113, - SPELL_ENRAGE = 44779, - SPELL_SUMMON_PLAYERS = 43097, - SPELL_TELE_TO_CENTER = 43098, // coord - SPELL_HATCH_ALL = 43144, - SPELL_BERSERK = 45078, - -// -- Fire Bob Spells - SPELL_FIRE_BOMB_CHANNEL = 42621, // last forever - SPELL_FIRE_BOMB_THROW = 42628, // throw visual - SPELL_FIRE_BOMB_DUMMY = 42629, // bomb visual - SPELL_FIRE_BOMB_DAMAGE = 42630, - -// --Summons - MOB_AMANI_HATCHER = 23818, - MOB_HATCHLING = 23598, // 42493 - MOB_EGG = 23817, - MOB_FIRE_BOMB = 23920, - -// -- Hatcher Spells - SPELL_HATCH_EGG = 43734, // 42471 - -// -- Hatchling Spells - SPELL_FLAMEBUFFET = 43299 -}; - -const int area_dx = 44; -const int area_dy = 51; - -float JanalainPos[1][3] = -{ - {-33.93, 1149.27, 19} -}; - -float FireWallCoords[4][4] = -{ - {-10.13, 1149.27, 19, 3.1415}, - {-33.93, 1123.90, 19, 0.5*3.1415}, - {-54.80, 1150.08, 19, 0}, - {-33.93, 1175.68, 19, 1.5*3.1415} -}; - -float hatcherway[2][5][3] = -{ - { - {-87.46,1170.09,6}, - {-74.41,1154.75,6}, - {-52.74,1153.32,19}, - {-33.37,1172.46,19}, - {-33.09,1203.87,19} - }, - { - {-86.57,1132.85,6}, - {-73.94,1146.00,6}, - {-52.29,1146.51,19}, - {-33.57,1125.72,19}, - {-34.29,1095.22,19} - } -}; - -struct boss_janalaiAI : public ScriptedAI -{ - boss_janalaiAI(Creature *c) : ScriptedAI(c) - { - pInstance =c->GetInstanceData(); - - SpellEntry *TempSpell = GET_SPELL(SPELL_HATCH_EGG); - if (TempSpell && TempSpell->EffectImplicitTargetA[0] != 1) - { - TempSpell->EffectImplicitTargetA[0] = 1; - TempSpell->EffectImplicitTargetB[0] = 0; - } - } - - ScriptedInstance *pInstance; - - uint32 FireBreathTimer; - uint32 BombTimer; - uint32 BombSequenceTimer; - uint32 BombCount; - uint32 HatcherTimer; - uint32 EnrageTimer; - - bool noeggs; - bool enraged; - bool isBombing; - - bool isFlameBreathing; - - uint64 FireBombGUIDs[40]; - - void Reset() - { - if (pInstance) - pInstance->SetData(DATA_JANALAIEVENT, NOT_STARTED); - - FireBreathTimer = 8000; - BombTimer = 30000; - BombSequenceTimer = 1000; - BombCount = 0; - HatcherTimer = 10000; - EnrageTimer = MINUTE*5*IN_MILISECONDS; - - noeggs = false; - isBombing =false; - enraged = false; - - isFlameBreathing = false; - - for (uint8 i = 0; i < 40; ++i) - FireBombGUIDs[i] = 0; - - HatchAllEggs(1); - } - - void JustDied(Unit* /*Killer*/) - { - DoScriptText(SAY_DEATH, me); - - if (pInstance) - pInstance->SetData(DATA_JANALAIEVENT, DONE); - } - - void KilledUnit(Unit* /*victim*/) - { - DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me); - } - - void EnterCombat(Unit * /*who*/) - { - if (pInstance) - pInstance->SetData(DATA_JANALAIEVENT, IN_PROGRESS); - - DoScriptText(SAY_AGGRO, me); -// DoZoneInCombat(); - } - - void DamageDeal(Unit *pTarget, uint32 &damage) - { - if (isFlameBreathing) - { - if (!me->HasInArc(M_PI/6, pTarget)) - damage = 0; - } - } - - void FireWall() - { - uint8 WallNum; - Creature* wall = NULL; - for (uint8 i = 0; i < 4; ++i) - { - if (i == 0 || i == 2) - WallNum = 3; - else - WallNum = 2; - - for (uint8 j = 0; j < WallNum; j++) - { - if (WallNum == 3) - wall = me->SummonCreature(MOB_FIRE_BOMB, FireWallCoords[i][0],FireWallCoords[i][1]+5*(j-1),FireWallCoords[i][2],FireWallCoords[i][3],TEMPSUMMON_TIMED_DESPAWN,15000); - else - wall = me->SummonCreature(MOB_FIRE_BOMB, FireWallCoords[i][0]-2+4*j,FireWallCoords[i][1],FireWallCoords[i][2],FireWallCoords[i][3],TEMPSUMMON_TIMED_DESPAWN,15000); - if (wall) wall->CastSpell(wall, SPELL_FIRE_WALL, true); - } - } - } - - void SpawnBombs() - { - float dx, dy; - for (int i(0); i < 40; ++i) - { - dx = irand(-area_dx/2, area_dx/2); - dy = irand(-area_dy/2, area_dy/2); - - Creature* bomb = DoSpawnCreature(MOB_FIRE_BOMB, dx, dy, 0, 0, TEMPSUMMON_TIMED_DESPAWN, 15000); - if (bomb) FireBombGUIDs[i] = bomb->GetGUID(); - } - BombCount = 0; - } - - bool HatchAllEggs(uint32 uiAction) //1: reset, 2: isHatching all - { - std::list templist; - float x, y, z; - me->GetPosition(x, y, z); - - { - CellPair pair(Trinity::ComputeCellPair(x, y)); - Cell cell(pair); - cell.data.Part.reserved = ALL_DISTRICT; - cell.SetNoCreate(); - - Trinity::AllCreaturesOfEntryInRange check(me, MOB_EGG, 100); - Trinity::CreatureListSearcher searcher(me, templist, check); - - TypeContainerVisitor, GridTypeMapContainer> cSearcher(searcher); - - cell.Visit(pair, cSearcher, *(me->GetMap())); - } - - //error_log("Eggs %d at middle", templist.size()); - if (!templist.size()) - return false; - - for (std::list::const_iterator i = templist.begin(); i != templist.end(); ++i) - { - if (uiAction == 1) - (*i)->SetDisplayId(10056); - else if (uiAction == 2 &&(*i)->GetDisplayId() != 11686) - (*i)->CastSpell(*i, SPELL_HATCH_EGG, false); - } - return true; - } - - void Boom() - { - std::list templist; - float x, y, z; - me->GetPosition(x, y, z); - - { - CellPair pair(Trinity::ComputeCellPair(x, y)); - Cell cell(pair); - cell.data.Part.reserved = ALL_DISTRICT; - cell.SetNoCreate(); - - Trinity::AllCreaturesOfEntryInRange check(me, MOB_FIRE_BOMB, 100); - Trinity::CreatureListSearcher searcher(me, templist, check); - - TypeContainerVisitor, GridTypeMapContainer> cSearcher(searcher); - - cell.Visit(pair, cSearcher, *(me->GetMap())); - } - for (std::list::const_iterator i = templist.begin(); i != templist.end(); ++i) - { - (*i)->CastSpell(*i, SPELL_FIRE_BOMB_DAMAGE, true); - (*i)->RemoveAllAuras(); - } - } - - void HandleBombSequence() - { - if (BombCount < 40) - { - if (Unit *FireBomb = Unit::GetUnit((*me), FireBombGUIDs[BombCount])) - { - FireBomb->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - DoCast(FireBomb, SPELL_FIRE_BOMB_THROW, true); - FireBomb->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - } - ++BombCount; - if (BombCount == 40) - { - BombSequenceTimer = 5000; - } else BombSequenceTimer = 100; - } - else - { - Boom(); - isBombing = false; - BombTimer = urand(20000,40000); - me->RemoveAurasDueToSpell(SPELL_FIRE_BOMB_CHANNEL); - if (EnrageTimer <= 10000) - EnrageTimer = 0; - else - EnrageTimer -= 10000; - } - } - - void UpdateAI(const uint32 diff) - { - if (isFlameBreathing) - { - if (!me->IsNonMeleeSpellCasted(false)) - isFlameBreathing = false; - else - return; - } - - if (isBombing) - { - if (BombSequenceTimer <= diff) - HandleBombSequence(); - else - BombSequenceTimer -= diff; - return; - } - - if (!UpdateVictim()) - return; - - //enrage if under 25% hp before 5 min. - if (!enraged && me->GetHealth() * 4 < me->GetMaxHealth()) - EnrageTimer = 0; - - if (EnrageTimer <= diff) - { - if (!enraged) - { - DoCast(me, SPELL_ENRAGE, true); - enraged = true; - EnrageTimer = 300000; - } - else - { - DoScriptText(SAY_BERSERK, me); - DoCast(me, SPELL_BERSERK, true); - EnrageTimer = 300000; - } - } else EnrageTimer -= diff; - - if (BombTimer <= diff) - { - DoScriptText(SAY_FIRE_BOMBS, me); - - me->AttackStop(); - me->GetMotionMaster()->Clear(); - DoTeleportTo(JanalainPos[0][0],JanalainPos[0][1],JanalainPos[0][2]); - me->StopMoving(); - DoCast(me, SPELL_FIRE_BOMB_CHANNEL, false); - //DoTeleportPlayer(me, JanalainPos[0][0], JanalainPos[0][1],JanalainPos[0][2], 0); - //DoCast(me, SPELL_TELE_TO_CENTER, true); - - FireWall(); - SpawnBombs(); - isBombing = true; - BombSequenceTimer = 100; - - //Teleport every Player into the middle - Map* pMap = me->GetMap(); - if (!pMap->IsDungeon()) return; - 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()) - DoTeleportPlayer(i_pl, JanalainPos[0][0]-5+rand()%10, JanalainPos[0][1]-5+rand()%10, JanalainPos[0][2], 0); - //DoCast(Temp, SPELL_SUMMON_PLAYERS, true) // core bug, spell does not work if too far - return; - } else BombTimer -= diff; - - if (!noeggs) - { - if (100 * me->GetHealth() < 35 * me->GetMaxHealth()) - { - DoScriptText(SAY_ALL_EGGS, me); - - me->AttackStop(); - me->GetMotionMaster()->Clear(); - DoTeleportTo(JanalainPos[0][0],JanalainPos[0][1],JanalainPos[0][2]); - me->StopMoving(); - DoCast(me, SPELL_HATCH_ALL, false); - HatchAllEggs(2); - noeggs = true; - } - else if (HatcherTimer <= diff) - { - if (HatchAllEggs(0)) - { - DoScriptText(SAY_SUMMON_HATCHER, me); - me->SummonCreature(MOB_AMANI_HATCHER,hatcherway[0][0][0],hatcherway[0][0][1],hatcherway[0][0][2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,10000); - me->SummonCreature(MOB_AMANI_HATCHER,hatcherway[1][0][0],hatcherway[1][0][1],hatcherway[1][0][2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,10000); - HatcherTimer = 90000; - } - else - noeggs = true; - } else HatcherTimer -= diff; - } - - EnterEvadeIfOutOfCombatArea(diff); - - DoMeleeAttackIfReady(); - - if (FireBreathTimer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) - { - me->AttackStop(); - me->GetMotionMaster()->Clear(); - DoCast(pTarget, SPELL_FLAME_BREATH, false); - me->StopMoving(); - isFlameBreathing = true; - } - FireBreathTimer = 8000; - } else FireBreathTimer -= diff; - } -}; - -CreatureAI* GetAI_boss_janalaiAI(Creature* pCreature) -{ - return new boss_janalaiAI(pCreature); -} - -struct mob_janalai_firebombAI : public ScriptedAI -{ - mob_janalai_firebombAI(Creature *c) : ScriptedAI(c){} - - void Reset() {} - - void SpellHit(Unit * /*caster*/, const SpellEntry *spell) - { - if (spell->Id == SPELL_FIRE_BOMB_THROW) - DoCast(me, SPELL_FIRE_BOMB_DUMMY, true); - } - - void EnterCombat(Unit* /*who*/) {} - - void AttackStart(Unit* /*who*/) {} - - void MoveInLineOfSight(Unit* /*who*/) {} - - void UpdateAI(const uint32 /*diff*/) {} -}; - -CreatureAI* GetAI_mob_janalai_firebombAI(Creature* pCreature) -{ - return new mob_janalai_firebombAI(pCreature); -} - -struct mob_amanishi_hatcherAI : public ScriptedAI -{ - mob_amanishi_hatcherAI(Creature *c) : ScriptedAI(c) - { - pInstance =c->GetInstanceData(); - } - - ScriptedInstance *pInstance; - - uint32 waypoint; - uint32 HatchNum; - uint32 WaitTimer; - - bool side; - bool hasChangedSide; - bool isHatching; - - void Reset() - { - me->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - side =(me->GetPositionY() < 1150); - waypoint = 0; - isHatching = false; - hasChangedSide = false; - WaitTimer = 1; - HatchNum = 0; - } - - bool HatchEggs(uint32 num) - { - std::list templist; - float x, y, z; - me->GetPosition(x, y, z); - - { - CellPair pair(Trinity::ComputeCellPair(x, y)); - Cell cell(pair); - cell.data.Part.reserved = ALL_DISTRICT; - cell.SetNoCreate(); - - Trinity::AllCreaturesOfEntryInRange check(me, 23817, 50); - Trinity::CreatureListSearcher searcher(me, templist, check); - - TypeContainerVisitor, GridTypeMapContainer> cSearcher(searcher); - - cell.Visit(pair, cSearcher, *(me->GetMap())); - } - - //error_log("Eggs %d at %d", templist.size(), side); - - for (std::list::const_iterator i = templist.begin(); i != templist.end() && num > 0; ++i) - if ((*i)->GetDisplayId() != 11686) - { - (*i)->CastSpell(*i, SPELL_HATCH_EGG, false); - num--; - } - - return num == 0; // if num == 0, no more templist - } - - void EnterCombat(Unit* /*who*/) {} - void AttackStart(Unit* /*who*/) {} - void MoveInLineOfSight(Unit* /*who*/) {} - void MovementInform(uint32, uint32) - { - if (waypoint == 5) - { - isHatching = true; - HatchNum = 1; - WaitTimer = 5000; - } - else - WaitTimer = 1; - } - - void UpdateAI(const uint32 diff) - { - if (!pInstance || !(pInstance->GetData(DATA_JANALAIEVENT) == IN_PROGRESS)) - { - me->DisappearAndDie(); - return; - } - - if (!isHatching) - { - if (WaitTimer) - { - me->GetMotionMaster()->Clear(); - me->GetMotionMaster()->MovePoint(0,hatcherway[side][waypoint][0],hatcherway[side][waypoint][1],hatcherway[side][waypoint][2]); - ++waypoint; - WaitTimer = 0; - } - } - else - { - if (WaitTimer <= diff) - { - if (HatchEggs(HatchNum)) - { - ++HatchNum; - WaitTimer = 10000; - } - else if (!hasChangedSide) - { - side = side ? 0 : 1; - isHatching = false; - waypoint = 3; - WaitTimer = 1; - hasChangedSide = true; - } - else - me->DisappearAndDie(); - - } else WaitTimer -= diff; - } - } -}; - -CreatureAI* GetAI_mob_amanishi_hatcherAI(Creature* pCreature) -{ - return new mob_amanishi_hatcherAI(pCreature); -} - -struct mob_hatchlingAI : public ScriptedAI -{ - mob_hatchlingAI(Creature *c) : ScriptedAI(c) - { - pInstance =c->GetInstanceData(); - } - - ScriptedInstance *pInstance; - uint32 BuffetTimer; - - void Reset() - { - BuffetTimer = 7000; - if (me->GetPositionY() > 1150) - me->GetMotionMaster()->MovePoint(0, hatcherway[0][3][0]+rand()%4-2,1150+rand()%4-2,hatcherway[0][3][2]); - else - me->GetMotionMaster()->MovePoint(0,hatcherway[1][3][0]+rand()%4-2,1150+rand()%4-2,hatcherway[1][3][2]); - - me->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); - } - - void EnterCombat(Unit * /*who*/) {/*DoZoneInCombat();*/} - - void UpdateAI(const uint32 diff) - { - if (!pInstance || !(pInstance->GetData(DATA_JANALAIEVENT) == IN_PROGRESS)) - { - me->DisappearAndDie(); - return; - } - - if (!UpdateVictim()) - return; - - if (BuffetTimer <= diff) - { - DoCast(me->getVictim(), SPELL_FLAMEBUFFET, false); - BuffetTimer = 10000; - } else BuffetTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_hatchlingAI(Creature* pCreature) -{ - return new mob_hatchlingAI(pCreature); -} - -struct mob_eggAI : public ScriptedAI -{ - mob_eggAI(Creature *c) : ScriptedAI(c){} - void Reset() {} - void EnterCombat(Unit* /*who*/) {} - void AttackStart(Unit* /*who*/) {} - void MoveInLineOfSight(Unit* /*who*/) {} - void UpdateAI(const uint32 /*diff*/) {} - - void SpellHit(Unit * /*caster*/, const SpellEntry *spell) - { - if (spell->Id == SPELL_HATCH_EGG) - { - DoSpawnCreature(MOB_HATCHLING, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000); - me->SetDisplayId(11686); - } - } -}; - -CreatureAI* GetAI_mob_eggAI(Creature* pCreature) -{ - return new mob_eggAI(pCreature); -} - -void AddSC_boss_janalai() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_janalai"; - newscript->GetAI = &GetAI_boss_janalaiAI; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_janalai_firebomb"; - newscript->GetAI = &GetAI_mob_janalai_firebombAI; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_janalai_hatcher"; - newscript->GetAI = &GetAI_mob_amanishi_hatcherAI; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_janalai_hatchling"; - newscript->GetAI = &GetAI_mob_hatchlingAI; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_janalai_egg"; - newscript->GetAI = &GetAI_mob_eggAI; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/zulaman/boss_nalorakk.cpp b/src/server/scripts/EasternKingdoms/zulaman/boss_nalorakk.cpp deleted file mode 100644 index ae5c6596d2d..00000000000 --- a/src/server/scripts/EasternKingdoms/zulaman/boss_nalorakk.cpp +++ /dev/null @@ -1,451 +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_Nalorakk -SD%Complete: 100 -SDComment: -SDCategory: Zul'Aman -EndScriptData */ - -#include "ScriptedPch.h" -#include "zulaman.h" -#include "GridNotifiers.h" - -//Trash Waves -float NalorakkWay[8][3] = -{ - { 18.569, 1414.512, 11.42},// waypoint 1 - {-17.264, 1419.551, 12.62}, - {-52.642, 1419.357, 27.31},// waypoint 2 - {-69.908, 1419.721, 27.31}, - {-79.929, 1395.958, 27.31}, - {-80.072, 1374.555, 40.87},// waypoint 3 - {-80.072, 1314.398, 40.87}, - {-80.072, 1295.775, 48.60} // waypoint 4 -}; - -#define YELL_NALORAKK_WAVE1 "Get da move on, guards! It be killin' time!" -#define SOUND_NALORAKK_WAVE1 12066 -#define YELL_NALORAKK_WAVE2 "Guards, go already! Who you more afraid of, dem... or me?" -#define SOUND_NALORAKK_WAVE2 12067 -#define YELL_NALORAKK_WAVE3 "Ride now! Ride out dere and bring me back some heads!" -#define SOUND_NALORAKK_WAVE3 12068 -#define YELL_NALORAKK_WAVE4 "I be losin' me patience! Go on: make dem wish dey was never born!" -#define SOUND_NALORAKK_WAVE4 12069 - -//Unimplemented SoundIDs -/* -#define SOUND_NALORAKK_EVENT1 12078 -#define SOUND_NALORAKK_EVENT2 12079 -*/ - -//General defines -#define YELL_AGGRO "You be dead soon enough!" -#define SOUND_YELL_AGGRO 12070 -#define YELL_KILL_ONE "Mua-ha-ha! Now whatchoo got to say?" -#define SOUND_YELL_KILL_ONE 12075 -#define YELL_KILL_TWO "Da Amani gonna rule again!" -#define SOUND_YELL_KILL_TWO 12076 -#define YELL_DEATH "I... be waitin' on da udda side...." -#define SOUND_YELL_DEATH 12077 -#define YELL_BERSERK "You had your chance, now it be too late!" //Never seen this being used, so just guessing from what I hear. -#define SOUND_YELL_BERSERK 12074 - -#define SPELL_BERSERK 45078 - -//Defines for Troll form -#define SPELL_BRUTALSWIPE 42384 -#define SPELL_MANGLE 42389 -#define SPELL_MANGLEEFFECT 44955 -#define SPELL_SURGE 42402 -#define SPELL_BEARFORM 42377 - -#define YELL_SURGE "I bring da pain!" -#define SOUND_YELL_SURGE 12071 - -#define YELL_SHIFTEDTOTROLL "Make way for Nalorakk!" -#define SOUND_YELL_TOTROLL 12073 - -//Defines for Bear form -#define SPELL_LACERATINGSLASH 42395 -#define SPELL_RENDFLESH 42397 -#define SPELL_DEAFENINGROAR 42398 - -#define YELL_SHIFTEDTOBEAR "You call on da beast, you gonna get more dan you bargain for!" -#define SOUND_YELL_TOBEAR 12072 - -struct boss_nalorakkAI : public ScriptedAI -{ - boss_nalorakkAI(Creature *c) : ScriptedAI(c) - { - MoveEvent = true; - MovePhase = 0; - pInstance = c->GetInstanceData(); - } - - ScriptedInstance *pInstance; - - uint32 BrutalSwipe_Timer; - uint32 Mangle_Timer; - uint32 Surge_Timer; - - uint32 LaceratingSlash_Timer; - uint32 RendFlesh_Timer; - uint32 DeafeningRoar_Timer; - - uint32 ShapeShift_Timer; - uint32 Berserk_Timer; - - bool inBearForm; - bool MoveEvent; - bool inMove; - uint32 MovePhase; - uint32 waitTimer; - - void Reset() - { - if (MoveEvent) - { - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - inMove = false; - waitTimer = 0; - me->SetSpeed(MOVE_RUN,2); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - }else - { - (*me).GetMotionMaster()->MovePoint(0,NalorakkWay[7][0],NalorakkWay[7][1],NalorakkWay[7][2]); - } - - if (pInstance) - pInstance->SetData(DATA_NALORAKKEVENT, NOT_STARTED); - - Surge_Timer = 15000 + rand()%5000; - BrutalSwipe_Timer = 7000 + rand()%5000; - Mangle_Timer = 10000 + rand()%5000; - ShapeShift_Timer = 45000 + rand()%5000; - Berserk_Timer = 600000; - - inBearForm = false; - // me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, 5122); // TODO: find the correct equipment id - } - - void SendAttacker(Unit *pTarget) - { - std::list templist; - float x, y, z; - me->GetPosition(x, y, z); - - { - CellPair pair(Trinity::ComputeCellPair(x, y)); - Cell cell(pair); - cell.data.Part.reserved = ALL_DISTRICT; - cell.SetNoCreate(); - - Trinity::AllFriendlyCreaturesInGrid check(me); - Trinity::CreatureListSearcher searcher(me, templist, check); - - TypeContainerVisitor, GridTypeMapContainer> cSearcher(searcher); - - cell.Visit(pair, cSearcher, *(me->GetMap())); - } - - if (!templist.size()) - return; - - for (std::list::const_iterator i = templist.begin(); i != templist.end(); ++i) - { - if ((*i) && me->IsWithinDistInMap((*i),25)) - { - (*i)->SetNoCallAssistance(true); - (*i)->AI()->AttackStart(pTarget); - } - } - } - - void AttackStart(Unit* who) - { - if (!MoveEvent) - ScriptedAI::AttackStart(who); - } - - void MoveInLineOfSight(Unit *who) - { - if (!MoveEvent) - { - ScriptedAI::MoveInLineOfSight(who); - } - else - { - if (me->IsHostileTo(who)) - { - if (!inMove) - { - switch(MovePhase) - { - case 0: - if (me->IsWithinDistInMap(who, 50)) - { - me->MonsterYell(YELL_NALORAKK_WAVE1, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(me, SOUND_NALORAKK_WAVE1); - - (*me).GetMotionMaster()->MovePoint(1,NalorakkWay[1][0],NalorakkWay[1][1],NalorakkWay[1][2]); - MovePhase ++; - inMove = true; - - SendAttacker(who); - } - break; - case 2: - if (me->IsWithinDistInMap(who, 40)) - { - me->MonsterYell(YELL_NALORAKK_WAVE2, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(me, SOUND_NALORAKK_WAVE2); - - (*me).GetMotionMaster()->MovePoint(3,NalorakkWay[3][0],NalorakkWay[3][1],NalorakkWay[3][2]); - MovePhase ++; - inMove = true; - - SendAttacker(who); - } - break; - case 5: - if (me->IsWithinDistInMap(who, 40)) - { - me->MonsterYell(YELL_NALORAKK_WAVE3, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(me, SOUND_NALORAKK_WAVE3); - - (*me).GetMotionMaster()->MovePoint(6,NalorakkWay[6][0],NalorakkWay[6][1],NalorakkWay[6][2]); - MovePhase ++; - inMove = true; - - SendAttacker(who); - } - break; - case 7: - if (me->IsWithinDistInMap(who, 50)) - { - SendAttacker(who); - - me->MonsterYell(YELL_NALORAKK_WAVE4, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(me, SOUND_NALORAKK_WAVE4); - - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - - MoveEvent = false; - } - break; - } - } - } - } - } - - void EnterCombat(Unit * /*who*/) - { - if (pInstance) - pInstance->SetData(DATA_NALORAKKEVENT, IN_PROGRESS); - - me->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(me, SOUND_YELL_AGGRO); - DoZoneInCombat(); - } - - void JustDied(Unit* /*Killer*/) - { - if (pInstance) - pInstance->SetData(DATA_NALORAKKEVENT, DONE); - - me->MonsterYell(YELL_DEATH,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(me, SOUND_YELL_DEATH); - } - - void KilledUnit(Unit* /*victim*/) - { - switch (urand(0,1)) - { - case 0: - me->MonsterYell(YELL_KILL_ONE, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(me, SOUND_YELL_KILL_ONE); - break; - case 1: - me->MonsterYell(YELL_KILL_TWO, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(me, SOUND_YELL_KILL_TWO); - break; - } - } - - void MovementInform(uint32 type, uint32 id) - { - if (MoveEvent) - { - if (type != POINT_MOTION_TYPE) - return; - - if (!inMove) - return; - - if (MovePhase != id) - return; - - switch(MovePhase) - { - case 2: - me->SetOrientation(3.1415*2); - inMove = false; - return; - case 1: - case 3: - case 4: - case 6: - MovePhase ++; - waitTimer = 1; - inMove = true; - return; - case 5: - me->SetOrientation(3.1415*0.5); - inMove = false; - return; - case 7: - me->SetOrientation(3.1415*0.5); - inMove = false; - return; - } - - } - } - - void UpdateAI(const uint32 diff) - { - if (waitTimer) - { - if (inMove) - if (waitTimer <= diff) - { - (*me).GetMotionMaster()->MovementExpired(); - (*me).GetMotionMaster()->MovePoint(MovePhase,NalorakkWay[MovePhase][0],NalorakkWay[MovePhase][1],NalorakkWay[MovePhase][2]); - waitTimer = 0; - } else waitTimer -= diff; - } - - if (!UpdateVictim()) - return; - - if (Berserk_Timer <= diff) - { - DoCast(me, SPELL_BERSERK, true); - me->MonsterYell(YELL_BERSERK, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(me, SOUND_YELL_BERSERK); - Berserk_Timer = 600000; - } else Berserk_Timer -= diff; - - if (ShapeShift_Timer <= diff) - { - if (inBearForm) - { - // me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, 5122); - me->MonsterYell(YELL_SHIFTEDTOTROLL, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(me, SOUND_YELL_TOTROLL); - me->RemoveAurasDueToSpell(SPELL_BEARFORM); - Surge_Timer = 15000 + rand()%5000; - BrutalSwipe_Timer = 7000 + rand()%5000; - Mangle_Timer = 10000 + rand()%5000; - ShapeShift_Timer = 45000 + rand()%5000; - inBearForm = false; - } - else - { - // me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, 0); - me->MonsterYell(YELL_SHIFTEDTOBEAR, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(me, SOUND_YELL_TOBEAR); - DoCast(me, SPELL_BEARFORM, true); - LaceratingSlash_Timer = 2000; // dur 18s - RendFlesh_Timer = 3000; // dur 5s - DeafeningRoar_Timer = 5000 + rand()%5000; // dur 2s - ShapeShift_Timer = 20000 + rand()%5000; // dur 30s - inBearForm = true; - } - } else ShapeShift_Timer -= diff; - - if (!inBearForm) - { - if (BrutalSwipe_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_BRUTALSWIPE); - BrutalSwipe_Timer = 7000 + rand()%5000; - } else BrutalSwipe_Timer -= diff; - - if (Mangle_Timer <= diff) - { - if (me->getVictim() && !me->getVictim()->HasAura(SPELL_MANGLEEFFECT)) - { - DoCast(me->getVictim(), SPELL_MANGLE); - Mangle_Timer = 1000; - } - else Mangle_Timer = 10000 + rand()%5000; - } else Mangle_Timer -= diff; - - if (Surge_Timer <= diff) - { - me->MonsterYell(YELL_SURGE, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(me, SOUND_YELL_SURGE); - Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 45, true); - if (pTarget) - DoCast(pTarget, SPELL_SURGE); - Surge_Timer = 15000 + rand()%5000; - } else Surge_Timer -= diff; - } - else - { - if (LaceratingSlash_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_LACERATINGSLASH); - LaceratingSlash_Timer = 18000 + rand()%5000; - } else LaceratingSlash_Timer -= diff; - - if (RendFlesh_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_RENDFLESH); - RendFlesh_Timer = 5000 + rand()%5000; - } else RendFlesh_Timer -= diff; - - if (DeafeningRoar_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_DEAFENINGROAR); - DeafeningRoar_Timer = 15000 + rand()%5000; - } else DeafeningRoar_Timer -= diff; - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_nalorakk(Creature* pCreature) -{ - return new boss_nalorakkAI (pCreature); -} - -void AddSC_boss_nalorakk() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_nalorakk"; - newscript->GetAI = &GetAI_boss_nalorakk; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/zulaman/boss_zuljin.cpp b/src/server/scripts/EasternKingdoms/zulaman/boss_zuljin.cpp deleted file mode 100644 index 91cfa728f89..00000000000 --- a/src/server/scripts/EasternKingdoms/zulaman/boss_zuljin.cpp +++ /dev/null @@ -1,623 +0,0 @@ -/* Copyright (C) 2006,2007,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_ZulJin -SD%Complete: 85% -SDComment: -EndScriptData */ - -#include "ScriptedPch.h" -#include "zulaman.h" - -//Speech -#define YELL_TRANSFORM_TO_LYNX "Let me introduce to you my new bruddahs: fang and claw!" -#define SOUND_TRANSFORM_TO_LYNX 12094 - -#define YELL_TRANSFORM_TO_BEAR "Got me some new tricks...like me bruddah bear!" -#define SOUND_TRANSFORM_TO_BEAR 12092 - -#define YELL_TRANSFORM_TO_DRAGONHAWK "Ya don' have to look to da sky to see da dragonhawk!" -#define SOUND_TRANSFORM_TO_DRAGONHAWK 12095 - -#define YELL_TRANSFORM_TO_EAGLE "Dere be no hidin' from da eagle!" -#define SOUND_TRANSFORM_TO_EAGLE 12093 - -#define YELL_KILL_ONE "Da Amani de chuka!" -#define SOUND_KILL_ONE 12098 - -#define YELL_KILL_TWO "Lot more gonna fall like you!" -#define SOUND_KILL_TWO 12099 - -#define YELL_FIRE_BREATH "Fire kill you just as quick!" -#define SOUND_FIRE_BRETH 12096 - -#define YELL_AGGRO "Nobody badduh dan me!" -#define SOUND_AGGRO 12091 - -#define YELL_BERSERK "You too slow! Me too strong!" -#define SOUND_BERSERK 12097 - -#define YELL_DEATH "Mebbe me fall...but da Amani empire...never gonna die..." -#define SOUND_DEATH 12100 - -//Still not used, need more info -#define YELL_INTRO "Everybody always wanna take from us. Now we gonna start takin' back. Anybody who get in our way...gonna drown in their own blood! De Amani empire be back now...seekin' vengeance. And we gonna start...with you!" -#define SOUND_INTRO 12090 - -//Spells: -//====== Troll Form -#define SPELL_WHIRLWIND 17207 -#define SPELL_GRIEVOUS_THROW 43093 // remove debuff after full healed -//====== Bear Form -#define SPELL_CREEPING_PARALYSIS 43095 // should cast on the whole raid -#define SPELL_OVERPOWER 43456 // use after melee attack dodged -//====== Eagle Form -#define SPELL_ENERGY_STORM 43983 // enemy area aura, trigger 42577 -#define SPELL_ZAP_INFORM 42577 -#define SPELL_ZAP_DAMAGE 43137 // 1250 damage -#define SPELL_SUMMON_CYCLONE 43112 // summon four feather vortex -#define CREATURE_FEATHER_VORTEX 24136 -#define SPELL_CYCLONE_VISUAL 43119 // trigger 43147 visual -#define SPELL_CYCLONE_PASSIVE 43120 // trigger 43121 (4y aoe) every second -//Lynx Form -#define SPELL_CLAW_RAGE_HASTE 42583 -#define SPELL_CLAW_RAGE_TRIGGER 43149 -#define SPELL_CLAW_RAGE_DAMAGE 43150 -#define SPELL_LYNX_RUSH_HASTE 43152 -#define SPELL_LYNX_RUSH_DAMAGE 43153 -//Dragonhawk Form -#define SPELL_FLAME_WHIRL 43213 // trigger two spells -#define SPELL_FLAME_BREATH 43215 -#define SPELL_SUMMON_PILLAR 43216 // summon 24187 -#define CREATURE_COLUMN_OF_FIRE 24187 -#define SPELL_PILLAR_TRIGGER 43218 // trigger 43217 - -//cosmetic -#define SPELL_SPIRIT_AURA 42466 -#define SPELL_SIPHON_SOUL 43501 - -//Transforms: -#define SPELL_SHAPE_OF_THE_BEAR 42594 // 15% dmg -#define SPELL_SHAPE_OF_THE_EAGLE 42606 -#define SPELL_SHAPE_OF_THE_LYNX 42607 // haste melee 30% -#define SPELL_SHAPE_OF_THE_DRAGONHAWK 42608 - -#define SPELL_BERSERK 45078 - -#define PHASE_BEAR 0 -#define PHASE_EAGLE 1 -#define PHASE_LYNX 2 -#define PHASE_DRAGONHAWK 3 -#define PHASE_TROLL 4 - -//coords for going for changing form -#define CENTER_X 120.148811 -#define CENTER_Y 703.713684 -#define CENTER_Z 45.111477 - -struct SpiritInfoStruct -{ - uint32 entry; - float x, y, z, orient; -}; - -static SpiritInfoStruct SpiritInfo[] = -{ - {23878, 147.87, 706.51, 45.11, 3.04}, - {23880, 88.95, 705.49, 45.11, 6.11}, - {23877, 137.23, 725.98, 45.11, 3.71}, - {23879, 104.29, 726.43, 45.11, 5.43} -}; - -struct TransformStruct -{ - uint32 sound; - char* text; - uint32 spell, unaura; -}; - -static TransformStruct Transform[] = -{ - {SOUND_TRANSFORM_TO_BEAR, YELL_TRANSFORM_TO_BEAR, SPELL_SHAPE_OF_THE_BEAR, SPELL_WHIRLWIND}, - {SOUND_TRANSFORM_TO_EAGLE, YELL_TRANSFORM_TO_EAGLE, SPELL_SHAPE_OF_THE_EAGLE, SPELL_SHAPE_OF_THE_BEAR}, - {SOUND_TRANSFORM_TO_LYNX, YELL_TRANSFORM_TO_LYNX, SPELL_SHAPE_OF_THE_LYNX, SPELL_SHAPE_OF_THE_EAGLE}, - {SOUND_TRANSFORM_TO_DRAGONHAWK, YELL_TRANSFORM_TO_DRAGONHAWK, SPELL_SHAPE_OF_THE_DRAGONHAWK, SPELL_SHAPE_OF_THE_LYNX} -}; - -struct boss_zuljinAI : public ScriptedAI -{ - boss_zuljinAI(Creature *c) : ScriptedAI(c), Summons(me) - { - pInstance = c->GetInstanceData(); - } - ScriptedInstance *pInstance; - - uint64 SpiritGUID[4]; - uint64 ClawTargetGUID; - uint64 TankGUID; - - uint32 Phase; - uint32 health_20; - - uint32 Intro_Timer; - uint32 Berserk_Timer; - - uint32 Whirlwind_Timer; - uint32 Grievous_Throw_Timer; - - uint32 Creeping_Paralysis_Timer; - uint32 Overpower_Timer; - - uint32 Claw_Rage_Timer; - uint32 Lynx_Rush_Timer; - uint32 Claw_Counter; - uint32 Claw_Loop_Timer; - - uint32 Flame_Whirl_Timer; - uint32 Flame_Breath_Timer; - uint32 Pillar_Of_Fire_Timer; - - SummonList Summons; - - void Reset() - { - if (pInstance) - pInstance->SetData(DATA_ZULJINEVENT, NOT_STARTED); - - Phase = 0; - - health_20 = me->GetMaxHealth()*0.2; - - Intro_Timer = 37000; - Berserk_Timer = 600000; - - Whirlwind_Timer = 7000; - Grievous_Throw_Timer = 8000; - - Creeping_Paralysis_Timer = 7000; - Overpower_Timer = 0; - - Claw_Rage_Timer = 5000; - Lynx_Rush_Timer = 14000; - Claw_Loop_Timer = 0; - Claw_Counter = 0; - - Flame_Whirl_Timer = 5000; - Flame_Breath_Timer = 6000; - Pillar_Of_Fire_Timer = 7000; - - ClawTargetGUID = 0; - TankGUID = 0; - - Summons.DespawnAll(); - - me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 47174); - //me->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, 218172674); - //me->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE); - } - - void EnterCombat(Unit * /*who*/) - { - if (pInstance) - pInstance->SetData(DATA_ZULJINEVENT, IN_PROGRESS); - - DoZoneInCombat(); - - me->MonsterYell(YELL_INTRO,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(me, SOUND_INTRO); - SpawnAdds(); - EnterPhase(0); - } - - void KilledUnit(Unit* /*victim*/) - { - if (Intro_Timer) - return; - - switch (urand(0,1)) - { - case 0: - me->MonsterYell(YELL_KILL_ONE, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(me, SOUND_KILL_ONE); - break; - case 1: - me->MonsterYell(YELL_KILL_TWO, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(me, SOUND_KILL_TWO); - break; - } - } - - void JustDied(Unit* /*Killer*/) - { - if (pInstance) - pInstance->SetData(DATA_ZULJINEVENT, DONE); - - me->MonsterYell(YELL_DEATH, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(me, SOUND_DEATH); - Summons.DespawnEntry(CREATURE_COLUMN_OF_FIRE); - - if (Unit *Temp = Unit::GetUnit(*me, SpiritGUID[3])) - Temp->SetUInt32Value(UNIT_FIELD_BYTES_1,UNIT_STAND_STATE_DEAD); - } - - void AttackStart(Unit *who) - { - if (Phase == 2) - AttackStartNoMove(who); - else - ScriptedAI::AttackStart(who); - } - - void DoMeleeAttackIfReady() - { - if (!me->IsNonMeleeSpellCasted(false)) - { - if (me->isAttackReady() && me->IsWithinMeleeRange(me->getVictim())) - { - if (Phase == 1 && !Overpower_Timer) - { - uint32 health = me->getVictim()->GetHealth(); - me->AttackerStateUpdate(me->getVictim()); - if (me->getVictim() && health == me->getVictim()->GetHealth()) - { - DoCast(me->getVictim(), SPELL_OVERPOWER, false); - Overpower_Timer = 5000; - } - } else me->AttackerStateUpdate(me->getVictim()); - me->resetAttackTimer(); - } - } - } - - void SpawnAdds() - { - Creature *pCreature = NULL; - for (uint8 i = 0; i < 4; ++i) - { - pCreature = me->SummonCreature(SpiritInfo[i].entry, SpiritInfo[i].x, SpiritInfo[i].y, SpiritInfo[i].z, SpiritInfo[i].orient, TEMPSUMMON_DEAD_DESPAWN, 0); - if (pCreature) - { - pCreature->CastSpell(pCreature, SPELL_SPIRIT_AURA, true); - pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - SpiritGUID[i] = pCreature->GetGUID(); - } - } - } - - void DespawnAdds() - { - for (uint8 i = 0; i < 4; ++i) - { - Unit* Temp = NULL; - if (SpiritGUID[i]) - { - if (Temp = Unit::GetUnit(*me, SpiritGUID[i])) - { - Temp->SetVisibility(VISIBILITY_OFF); - Temp->setDeathState(DEAD); - } - } - SpiritGUID[i] = 0; - } - } - - void JustSummoned(Creature *summon) - { - Summons.Summon(summon); - } - - void SummonedCreatureDespawn(Creature *summon) - { - Summons.Despawn(summon); - } - - void EnterPhase(uint32 NextPhase) - { - switch(NextPhase) - { - case 0: - break; - case 1: - case 2: - case 3: - case 4: - DoTeleportTo(CENTER_X, CENTER_Y, CENTER_Z, 100); - DoResetThreat(); - me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 0); - me->RemoveAurasDueToSpell(Transform[Phase].unaura); - DoCast(me, Transform[Phase].spell); - me->MonsterYell(Transform[Phase].text, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(me, Transform[Phase].sound); - if (Phase > 0) - { - if (Unit *Temp = Unit::GetUnit(*me, SpiritGUID[Phase - 1])) - Temp->SetUInt32Value(UNIT_FIELD_BYTES_1,UNIT_STAND_STATE_DEAD); - } - if (Unit *Temp = Unit::GetUnit(*me, SpiritGUID[NextPhase - 1])) - Temp->CastSpell(me, SPELL_SIPHON_SOUL, false); // should m cast on temp - if (NextPhase == 2) - { - me->GetMotionMaster()->Clear(); - DoCast(me, SPELL_ENERGY_STORM, true); // enemy aura - for (uint8 i = 0; i < 4; ++i) - { - Creature* Vortex = DoSpawnCreature(CREATURE_FEATHER_VORTEX, 0, 0, 0, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); - if (Vortex) - { - Vortex->CastSpell(Vortex, SPELL_CYCLONE_PASSIVE, true); - Vortex->CastSpell(Vortex, SPELL_CYCLONE_VISUAL, true); - Vortex->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - Vortex->SetSpeed(MOVE_RUN, 1.0f); - Vortex->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0)); - DoZoneInCombat(Vortex); - } - } - } - else - me->AI()->AttackStart(me->getVictim()); - if (NextPhase == 3) - { - me->RemoveAurasDueToSpell(SPELL_ENERGY_STORM); - Summons.DespawnEntry(CREATURE_FEATHER_VORTEX); - me->GetMotionMaster()->MoveChase(me->getVictim()); - } - break; - default: - break; - } - Phase = NextPhase; - } - - void UpdateAI(const uint32 diff) - { - if (!TankGUID) - { - if (!UpdateVictim()) - return; - - if (me->GetHealth() < health_20 * (4 - Phase)) - EnterPhase(Phase + 1); - } - - if (Berserk_Timer <= diff) - { - DoCast(me, SPELL_BERSERK, true); - me->MonsterYell(YELL_BERSERK, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(me, SOUND_BERSERK); - Berserk_Timer = 60000; - } else Berserk_Timer -= diff; - - switch (Phase) - { - case 0: - if (Intro_Timer) - { - if (Intro_Timer <= diff) - { - me->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(me, SOUND_AGGRO); - Intro_Timer = 0; - } else Intro_Timer -= diff; - } - - if (Whirlwind_Timer <= diff) - { - DoCast(me, SPELL_WHIRLWIND); - Whirlwind_Timer = 15000 + rand()%5000; - } else Whirlwind_Timer -= diff; - - if (Grievous_Throw_Timer <= diff) - { - if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) - DoCast(pTarget, SPELL_GRIEVOUS_THROW, false); - Grievous_Throw_Timer = 10000; - } else Grievous_Throw_Timer -= diff; - break; - - case 1: - if (Creeping_Paralysis_Timer <= diff) - { - DoCast(me, SPELL_CREEPING_PARALYSIS); - Creeping_Paralysis_Timer = 20000; - } else Creeping_Paralysis_Timer -= diff; - - if (Overpower_Timer <= diff) - { - // implemented in DoMeleeAttackIfReady() - Overpower_Timer = 0; - } else Overpower_Timer -= diff; - break; - - case 2: - return; - - case 3: - if (Claw_Rage_Timer <= diff) - { - if (!TankGUID) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - TankGUID = me->getVictim()->GetGUID(); - me->SetSpeed(MOVE_RUN, 5.0f); - AttackStart(pTarget); // change victim - Claw_Rage_Timer = 0; - Claw_Loop_Timer = 500; - Claw_Counter = 0; - } - } - else if (!Claw_Rage_Timer) // do not do this when Lynx_Rush - { - if (Claw_Loop_Timer <= diff) - { - Unit *pTarget = me->getVictim(); - if (!pTarget || !pTarget->isTargetableForAttack()) pTarget = Unit::GetUnit(*me, TankGUID); - if (!pTarget || !pTarget->isTargetableForAttack()) pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (pTarget) - { - AttackStart(pTarget); - if (me->IsWithinMeleeRange(pTarget)) - { - DoCast(pTarget, SPELL_CLAW_RAGE_DAMAGE, true); - ++Claw_Counter; - if (Claw_Counter == 12) - { - Claw_Rage_Timer = 15000 + rand()%5000; - me->SetSpeed(MOVE_RUN, 1.2f); - AttackStart(Unit::GetUnit(*me, TankGUID)); - TankGUID = 0; - return; - } - else - Claw_Loop_Timer = 500; - } - } - else - { - EnterEvadeMode(); // if (pTarget) - return; - } - } else Claw_Loop_Timer -= diff; - } //if (TankGUID) - } else Claw_Rage_Timer -= diff; - - if (Lynx_Rush_Timer <= diff) - { - if (!TankGUID) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - TankGUID = me->getVictim()->GetGUID(); - me->SetSpeed(MOVE_RUN, 5.0f); - AttackStart(pTarget); // change victim - Lynx_Rush_Timer = 0; - Claw_Counter = 0; - } - } - else if (!Lynx_Rush_Timer) - { - Unit *pTarget = me->getVictim(); - if (!pTarget || !pTarget->isTargetableForAttack()) - { - pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); - AttackStart(pTarget); - } - if (pTarget) - { - if (me->IsWithinMeleeRange(pTarget)) - { - DoCast(pTarget, SPELL_LYNX_RUSH_DAMAGE, true); - ++Claw_Counter; - if (Claw_Counter == 9) - { - Lynx_Rush_Timer = 15000 + rand()%5000; - me->SetSpeed(MOVE_RUN, 1.2f); - AttackStart(Unit::GetUnit(*me, TankGUID)); - TankGUID = 0; - } - else - AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0)); - } - } - else - { - EnterEvadeMode(); // if (pTarget) - return; - } - } //if (TankGUID) - } else Lynx_Rush_Timer -= diff; - - break; - case 4: - if (Flame_Whirl_Timer <= diff) - { - DoCast(me, SPELL_FLAME_WHIRL); - Flame_Whirl_Timer = 12000; - }Flame_Whirl_Timer -= diff; - - if (Pillar_Of_Fire_Timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(pTarget, SPELL_SUMMON_PILLAR); - Pillar_Of_Fire_Timer = 10000; - } else Pillar_Of_Fire_Timer -= diff; - - if (Flame_Breath_Timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) - me->SetInFront(pTarget); - DoCast(me, SPELL_FLAME_BREATH); - Flame_Breath_Timer = 10000; - } else Flame_Breath_Timer -= diff; - break; - - default: - break; - } - - if (!TankGUID) - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_zuljin(Creature* pCreature) -{ - return new boss_zuljinAI (pCreature); -} - -struct feather_vortexAI : public ScriptedAI -{ - feather_vortexAI(Creature *c) : ScriptedAI(c) {} - - void Reset() {} - - void EnterCombat(Unit * /*pTarget*/) {} - - void SpellHit(Unit *caster, const SpellEntry *spell) - { - if (spell->Id == SPELL_ZAP_INFORM) - DoCast(caster, SPELL_ZAP_DAMAGE, true); - } - - void UpdateAI(const uint32 /*diff*/) - { - //if the vortex reach the target, it change his target to another player - if (me->IsWithinMeleeRange(me->getVictim())) - AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0)); - } -}; - -CreatureAI* GetAI_feather_vortexAI(Creature* pCreature) -{ - return new feather_vortexAI (pCreature); -} - -void AddSC_boss_zuljin() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_zuljin"; - newscript->GetAI = &GetAI_boss_zuljin; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_zuljin_vortex"; - newscript->GetAI = &GetAI_feather_vortexAI; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/zulaman/instance_zulaman.cpp b/src/server/scripts/EasternKingdoms/zulaman/instance_zulaman.cpp deleted file mode 100644 index 897330691a6..00000000000 --- a/src/server/scripts/EasternKingdoms/zulaman/instance_zulaman.cpp +++ /dev/null @@ -1,320 +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_zulaman -SD%Complete: 80 -SDComment: -SDCategory: Zul'Aman -EndScriptData */ - -#include "ScriptedPch.h" -#include "zulaman.h" - -#define MAX_ENCOUNTER 6 -#define RAND_VENDOR 2 - -//187021 //Harkor's Satchel -//186648 //Tanzar's Trunk -//186672 //Ashli's Bag -//186667 //Kraz's Package -// Chests spawn at bear/eagle/dragonhawk/lynx bosses -// The loots depend on how many bosses have been killed, but not the entries of the chests -// But we cannot add loots to gameobject, so we have to use the fixed loot_template -struct SHostageInfo -{ - uint32 npc, pGo; - float x, y, z, o; -}; - -static SHostageInfo HostageInfo[] = -{ - {23790, 186648, -57, 1343, 40.77, 3.2}, // bear - {23999, 187021, 400, 1414, 74.36, 3.3}, // eagle - {24001, 186672, -35, 1134, 18.71, 1.9}, // dragonhawk - {24024, 186667, 413, 1117, 6.32, 3.1} // lynx - -}; - -struct instance_zulaman : public ScriptedInstance -{ - instance_zulaman(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint64 HarkorsSatchelGUID; - uint64 TanzarsTrunkGUID; - uint64 AshlisBagGUID; - uint64 KrazsPackageGUID; - - uint64 HexLordGateGUID; - uint64 ZulJinGateGUID; - uint64 AkilzonDoorGUID; - uint64 ZulJinDoorGUID; - uint64 HalazziDoorGUID; - - uint32 QuestTimer; - uint16 BossKilled; - uint16 QuestMinute; - uint16 ChestLooted; - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - uint32 RandVendor[RAND_VENDOR]; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - HarkorsSatchelGUID = 0; - TanzarsTrunkGUID = 0; - AshlisBagGUID = 0; - KrazsPackageGUID = 0; - - HexLordGateGUID = 0; - ZulJinGateGUID = 0; - AkilzonDoorGUID = 0; - HalazziDoorGUID = 0; - ZulJinDoorGUID = 0; - - QuestTimer = 0; - QuestMinute = 21; - BossKilled = 0; - ChestLooted = 0; - - for (uint8 i = 0; i < RAND_VENDOR; ++i) - RandVendor[i] = NOT_STARTED; - } - - 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 23578://janalai - case 23863://zuljin - case 24239://hexlord - case 23577://halazzi - case 23576://nalorakk - default: break; - } - } - - void OnGameObjectCreate(GameObject* pGo, bool /*add*/) - { - switch(pGo->GetEntry()) - { - case 186303: HalazziDoorGUID = pGo->GetGUID(); break; - case 186304: ZulJinGateGUID = pGo->GetGUID(); break; - case 186305: HexLordGateGUID = pGo->GetGUID(); break; - case 186858: AkilzonDoorGUID = pGo->GetGUID(); break; - case 186859: ZulJinDoorGUID = pGo->GetGUID(); break; - - case 187021: HarkorsSatchelGUID = pGo->GetGUID(); break; - case 186648: TanzarsTrunkGUID = pGo->GetGUID(); break; - case 186672: AshlisBagGUID = pGo->GetGUID(); break; - case 186667: KrazsPackageGUID = pGo->GetGUID(); break; - default: break; - - } - CheckInstanceStatus(); - } - - void SummonHostage(uint8 num) - { - if (!QuestMinute) - return; - - Map::PlayerList const &PlayerList = instance->GetPlayers(); - if (PlayerList.isEmpty()) - return; - - Map::PlayerList::const_iterator i = PlayerList.begin(); - if (Player* i_pl = i->getSource()) - { - if (Unit* Hostage = i_pl->SummonCreature(HostageInfo[num].npc, HostageInfo[num].x, HostageInfo[num].y, HostageInfo[num].z, HostageInfo[num].o, TEMPSUMMON_DEAD_DESPAWN, 0)) - { - Hostage->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - Hostage->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - } - } - } - - void CheckInstanceStatus() - { - if (BossKilled >= 4) - HandleGameObject(HexLordGateGUID, true); - - if (BossKilled >= 5) - HandleGameObject(ZulJinGateGUID, true); - } - - std::string GetSaveData() - { - std::ostringstream ss; - ss << "S " << BossKilled << " " << ChestLooted << " " << QuestMinute; - char* data = new char[ss.str().length()+1]; - strcpy(data, ss.str().c_str()); - //error_log("TSCR: Zul'aman saved, %s.", data); - return data; - } - - void Load(const char* load) - { - if (!load) return; - std::istringstream ss(load); - //error_log("TSCR: Zul'aman loaded, %s.", ss.str().c_str()); - char dataHead; // S - uint16 data1, data2, data3; - ss >> dataHead >> data1 >> data2 >> data3; - //error_log("TSCR: Zul'aman loaded, %d %d %d.", data1, data2, data3); - if (dataHead == 'S') - { - BossKilled = data1; - ChestLooted = data2; - QuestMinute = data3; - } else error_log("TSCR: Zul'aman: corrupted save data."); - } - - void SetData(uint32 type, uint32 data) - { - switch(type) - { - case DATA_NALORAKKEVENT: - m_auiEncounter[0] = data; - if (data == DONE) - { - if (QuestMinute) - { - QuestMinute += 15; - DoUpdateWorldState(3106, QuestMinute); - } - SummonHostage(0); - } - break; - case DATA_AKILZONEVENT: - m_auiEncounter[1] = data; - HandleGameObject(AkilzonDoorGUID, data != IN_PROGRESS); - if (data == DONE) - { - if (QuestMinute) - { - QuestMinute += 10; - DoUpdateWorldState(3106, QuestMinute); - } - SummonHostage(1); - } - break; - case DATA_JANALAIEVENT: - m_auiEncounter[2] = data; - if (data == DONE) SummonHostage(2); - break; - case DATA_HALAZZIEVENT: - m_auiEncounter[3] = data; - HandleGameObject(HalazziDoorGUID, data != IN_PROGRESS); - if (data == DONE) SummonHostage(3); - break; - case DATA_HEXLORDEVENT: - m_auiEncounter[4] = data; - if (data == IN_PROGRESS) - HandleGameObject(HexLordGateGUID, false); - else if (data == NOT_STARTED) - CheckInstanceStatus(); - break; - case DATA_ZULJINEVENT: - m_auiEncounter[5] = data; - HandleGameObject(ZulJinDoorGUID, data != IN_PROGRESS); - break; - case DATA_CHESTLOOTED: - ++ChestLooted; - SaveToDB(); - break; - case TYPE_RAND_VENDOR_1: - RandVendor[0] = data; - break; - case TYPE_RAND_VENDOR_2: - RandVendor[1] = data; - break; - } - - if (data == DONE) - { - ++BossKilled; - if (QuestMinute && BossKilled >= 4) - { - QuestMinute = 0; - DoUpdateWorldState(3104, 0); - } - CheckInstanceStatus(); - SaveToDB(); - } - } - - uint32 GetData(uint32 type) - { - switch(type) - { - case DATA_NALORAKKEVENT: return m_auiEncounter[0]; - case DATA_AKILZONEVENT: return m_auiEncounter[1]; - case DATA_JANALAIEVENT: return m_auiEncounter[2]; - case DATA_HALAZZIEVENT: return m_auiEncounter[3]; - case DATA_HEXLORDEVENT: return m_auiEncounter[4]; - case DATA_ZULJINEVENT: return m_auiEncounter[5]; - case DATA_CHESTLOOTED: return ChestLooted; - case TYPE_RAND_VENDOR_1: return RandVendor[0]; - case TYPE_RAND_VENDOR_2: return RandVendor[1]; - default: return 0; - } - } - - void Update(uint32 diff) - { - if (QuestMinute) - { - if (QuestTimer <= diff) - { - QuestMinute--; - SaveToDB(); - QuestTimer += 60000; - if (QuestMinute) - { - DoUpdateWorldState(3104, 1); - DoUpdateWorldState(3106, QuestMinute); - } else DoUpdateWorldState(3104, 0); - } - QuestTimer -= diff; - } - } -}; - -InstanceData* GetInstanceData_instance_zulaman(Map* pMap) -{ - return new instance_zulaman(pMap); -} - -void AddSC_instance_zulaman() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_zulaman"; - newscript->GetInstanceData = &GetInstanceData_instance_zulaman; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/zulaman/zulaman.cpp b/src/server/scripts/EasternKingdoms/zulaman/zulaman.cpp deleted file mode 100644 index 067ae687644..00000000000 --- a/src/server/scripts/EasternKingdoms/zulaman/zulaman.cpp +++ /dev/null @@ -1,192 +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: Zulaman -SD%Complete: 90 -SDComment: Forest Frog will turn into different NPC's. Workaround to prevent new entry from running this script -SDCategory: Zul'Aman -EndScriptData */ - -/* ContentData -npc_forest_frog -EndContentData */ - -#include "ScriptedPch.h" -#include "zulaman.h" - -/*###### -## npc_forest_frog -######*/ - -#define SPELL_REMOVE_AMANI_CURSE 43732 -#define SPELL_PUSH_MOJO 43923 -#define ENTRY_FOREST_FROG 24396 - -struct npc_forest_frogAI : public ScriptedAI -{ - npc_forest_frogAI(Creature* c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance *pInstance; - - void Reset() {} - - void EnterCombat(Unit * /*who*/) {} - - void DoSpawnRandom() - { - if (pInstance) - { - uint32 cEntry = 0; - switch(rand()%10) - { - case 0: cEntry = 24397; break; //Mannuth - case 1: cEntry = 24403; break; //Deez - case 2: cEntry = 24404; break; //Galathryn - case 3: cEntry = 24405; break; //Adarrah - case 4: cEntry = 24406; break; //Fudgerick - case 5: cEntry = 24407; break; //Darwen - case 6: cEntry = 24445; break; //Mitzi - case 7: cEntry = 24448; break; //Christian - case 8: cEntry = 24453; break; //Brennan - case 9: cEntry = 24455; break; //Hollee - } - - if (!pInstance->GetData(TYPE_RAND_VENDOR_1)) - if (rand()%10 == 1) cEntry = 24408; //Gunter - if (!pInstance->GetData(TYPE_RAND_VENDOR_2)) - if (rand()%10 == 1) cEntry = 24409; //Kyren - - if (cEntry) me->UpdateEntry(cEntry); - - if (cEntry == 24408) pInstance->SetData(TYPE_RAND_VENDOR_1,DONE); - if (cEntry == 24409) pInstance->SetData(TYPE_RAND_VENDOR_2,DONE); - } - } - - void SpellHit(Unit *caster, const SpellEntry *spell) - { - if (spell->Id == SPELL_REMOVE_AMANI_CURSE && caster->GetTypeId() == TYPEID_PLAYER && me->GetEntry() == ENTRY_FOREST_FROG) - { - //increase or decrease chance of mojo? - if (rand()%99 == 50) DoCast(caster, SPELL_PUSH_MOJO, true); - else DoSpawnRandom(); - } - } -}; -CreatureAI* GetAI_npc_forest_frog(Creature* pCreature) -{ - return new npc_forest_frogAI (pCreature); -} - -/*###### -## npc_zulaman_hostage -######*/ - -#define GOSSIP_HOSTAGE1 "I am glad to help you." - -static uint32 HostageEntry[] = {23790, 23999, 24024, 24001}; -static uint32 ChestEntry[] = {186648, 187021, 186672, 186667}; - -struct npc_zulaman_hostageAI : public ScriptedAI -{ - npc_zulaman_hostageAI(Creature *c) : ScriptedAI(c) {IsLoot = false;} - bool IsLoot; - uint64 PlayerGUID; - void Reset() {} - void EnterCombat(Unit * /*who*/) {} - void JustDied(Unit* /*who*/) - { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); - if (pPlayer) pPlayer->SendLoot(me->GetGUID(), LOOT_CORPSE); - } - void UpdateAI(const uint32 /*diff*/) - { - if (IsLoot) - DoCast(me, 7, false); - } -}; - -bool GossipHello_npc_zulaman_hostage(Player* pPlayer, Creature* pCreature) -{ - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HOSTAGE1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); - return true; -} - -bool GossipSelect_npc_zulaman_hostage(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) - pPlayer->CLOSE_GOSSIP_MENU(); - - if (!pCreature->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP)) - return true; - pCreature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - - ScriptedInstance* pInstance = pCreature->GetInstanceData(); - if (pInstance) - { - //uint8 progress = pInstance->GetData(DATA_CHESTLOOTED); - pInstance->SetData(DATA_CHESTLOOTED, 0); - float x, y, z; - pCreature->GetPosition(x, y, z); - uint32 entry = pCreature->GetEntry(); - for (uint8 i = 0; i < 4; ++i) - { - if (HostageEntry[i] == entry) - { - pCreature->SummonGameObject(ChestEntry[i], x-2, y, z, 0, 0, 0, 0, 0, 0); - break; - } - } - /*Creature* summon = pCreature->SummonCreature(HostageInfo[progress], x-2, y, z, 0, TEMPSUMMON_DEAD_DESPAWN, 0); - if (summon) - { - CAST_AI(npc_zulaman_hostageAI, summon->AI())->PlayerGUID = pPlayer->GetGUID(); - CAST_AI(npc_zulaman_hostageAI, summon->AI())->IsLoot = true; - summon->SetDisplayId(10056); - summon->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - summon->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - }*/ - } - return true; -} - -CreatureAI* GetAI_npc_zulaman_hostage(Creature* pCreature) -{ - return new npc_zulaman_hostageAI(pCreature); -} - -void AddSC_zulaman() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "npc_forest_frog"; - newscript->GetAI = &GetAI_npc_forest_frog; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_zulaman_hostage"; - newscript->GetAI = &GetAI_npc_zulaman_hostage; - newscript->pGossipHello = &GossipHello_npc_zulaman_hostage; - newscript->pGossipSelect = &GossipSelect_npc_zulaman_hostage; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/zulaman/zulaman.h b/src/server/scripts/EasternKingdoms/zulaman/zulaman.h deleted file mode 100644 index 6fb0ef173bd..00000000000 --- a/src/server/scripts/EasternKingdoms/zulaman/zulaman.h +++ /dev/null @@ -1,19 +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_ZULAMAN_H -#define DEF_ZULAMAN_H - -#define DATA_NALORAKKEVENT 1 -#define DATA_AKILZONEVENT 2 -#define DATA_JANALAIEVENT 3 -#define DATA_HALAZZIEVENT 4 -#define DATA_HEXLORDEVENT 5 -#define DATA_ZULJINEVENT 6 -#define DATA_CHESTLOOTED 7 -#define TYPE_RAND_VENDOR_1 8 -#define TYPE_RAND_VENDOR_2 9 - -#endif - diff --git a/src/server/scripts/EasternKingdoms/zulgurub/boss_arlokk.cpp b/src/server/scripts/EasternKingdoms/zulgurub/boss_arlokk.cpp deleted file mode 100644 index cbbe6c4dc4c..00000000000 --- a/src/server/scripts/EasternKingdoms/zulgurub/boss_arlokk.cpp +++ /dev/null @@ -1,278 +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_Arlokk -SD%Complete: 95 -SDComment: Wrong cleave and red aura is missing. -SDCategory: Zul'Gurub -EndScriptData */ - -#include "ScriptedPch.h" -#include "zulgurub.h" - -bool GOHello_go_gong_of_bethekk(Player* /*pPlayer*/, GameObject* pGo) -{ - if (ScriptedInstance* m_pInstance = pGo->GetInstanceData()) - { - if (m_pInstance->GetData(TYPE_ARLOKK) == DONE || m_pInstance->GetData(TYPE_ARLOKK) == IN_PROGRESS) - return true; - - m_pInstance->SetData(TYPE_ARLOKK, IN_PROGRESS); - return true; - } - - return true; -} - -enum eEnums -{ - SAY_AGGRO = -1309011, - SAY_FEAST_PANTHER = -1309012, - SAY_DEATH = -1309013, - - SPELL_SHADOWWORDPAIN = 23952, - SPELL_GOUGE = 24698, - SPELL_MARK = 24210, - SPELL_CLEAVE = 26350, //Perhaps not right. Not a red aura... - SPELL_PANTHER_TRANSFORM = 24190, - - MODEL_ID_NORMAL = 15218, - MODEL_ID_PANTHER = 15215, - MODEL_ID_BLANK = 11686, - - NPC_ZULIAN_PROWLER = 15101 -}; - -struct boss_arlokkAI : public ScriptedAI -{ - boss_arlokkAI(Creature* pCreature) : ScriptedAI(pCreature) - { - m_pInstance = pCreature->GetInstanceData(); - } - - ScriptedInstance* m_pInstance; - - uint32 m_uiShadowWordPain_Timer; - uint32 m_uiGouge_Timer; - uint32 m_uiMark_Timer; - uint32 m_uiCleave_Timer; - uint32 m_uiVanish_Timer; - uint32 m_uiVisible_Timer; - - uint32 m_uiSummon_Timer; - uint32 m_uiSummonCount; - - Unit* m_pMarkedTarget; - uint64 MarkedTargetGUID; - - bool m_bIsPhaseTwo; - bool m_bIsVanished; - - void Reset() - { - m_uiShadowWordPain_Timer = 8000; - m_uiGouge_Timer = 14000; - m_uiMark_Timer = 35000; - m_uiCleave_Timer = 4000; - m_uiVanish_Timer = 60000; - m_uiVisible_Timer = 6000; - - m_uiSummon_Timer = 5000; - m_uiSummonCount = 0; - - m_bIsPhaseTwo = false; - m_bIsVanished = false; - - MarkedTargetGUID = 0; - - me->SetDisplayId(MODEL_ID_NORMAL); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - } - - void EnterCombat(Unit* /*pWho*/) - { - DoScriptText(SAY_AGGRO, me); - } - - void JustReachedHome() - { - if (m_pInstance) - m_pInstance->SetData(TYPE_ARLOKK, NOT_STARTED); - - //we should be summoned, so despawn - me->ForcedDespawn(); - } - - void JustDied(Unit* /*pKiller*/) - { - DoScriptText(SAY_DEATH, me); - - me->SetDisplayId(MODEL_ID_NORMAL); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - - if (m_pInstance) - m_pInstance->SetData(TYPE_ARLOKK, DONE); - } - - void DoSummonPhanters() - { - if (Unit *pMarkedTarget = Unit::GetUnit(*me, MarkedTargetGUID)) - DoScriptText(SAY_FEAST_PANTHER, me, pMarkedTarget); - - me->SummonCreature(NPC_ZULIAN_PROWLER, -11532.7998, -1649.6734, 41.4800, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - me->SummonCreature(NPC_ZULIAN_PROWLER, -11532.9970, -1606.4840, 41.2979, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - } - - void JustSummoned(Creature* pSummoned) - { - if (Unit *pMarkedTarget = Unit::GetUnit(*me, MarkedTargetGUID)) - pSummoned->AI()->AttackStart(pMarkedTarget); - - ++m_uiSummonCount; - } - - void UpdateAI(const uint32 uiDiff) - { - if (!UpdateVictim()) - return; - - if (!m_bIsPhaseTwo) - { - if (m_uiShadowWordPain_Timer <= uiDiff) - { - DoCast(me->getVictim(), SPELL_SHADOWWORDPAIN); - m_uiShadowWordPain_Timer = 15000; - } - else - m_uiShadowWordPain_Timer -= uiDiff; - - if (m_uiMark_Timer <= uiDiff) - { - Unit *pMarkedTarget = SelectUnit(SELECT_TARGET_RANDOM,0); - - if (pMarkedTarget) - { - DoCast(pMarkedTarget, SPELL_MARK); - MarkedTargetGUID = pMarkedTarget->GetGUID(); - } - else - error_log("TSCR: boss_arlokk could not accuire pMarkedTarget."); - - m_uiMark_Timer = 15000; - } - else - m_uiMark_Timer -= uiDiff; - } - else - { - //Cleave_Timer - if (m_uiCleave_Timer <= uiDiff) - { - DoCast(me->getVictim(), SPELL_CLEAVE); - m_uiCleave_Timer = 16000; - } - else - m_uiCleave_Timer -= uiDiff; - - //Gouge_Timer - if (m_uiGouge_Timer <= uiDiff) - { - DoCast(me->getVictim(), SPELL_GOUGE); - - DoModifyThreatPercent(me->getVictim(),-80); - - m_uiGouge_Timer = 17000+rand()%10000; - } - else - m_uiGouge_Timer -= uiDiff; - } - - if (m_uiSummonCount <= 30) - { - if (m_uiSummon_Timer <= uiDiff) - { - DoSummonPhanters(); - m_uiSummon_Timer = 5000; - } - else - m_uiSummon_Timer -= uiDiff; - } - - if (m_uiVanish_Timer <= uiDiff) - { - //Invisble Model - me->SetDisplayId(MODEL_ID_BLANK); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - - me->AttackStop(); - DoResetThreat(); - - m_bIsVanished = true; - - m_uiVanish_Timer = 45000; - m_uiVisible_Timer = 6000; - } - else - m_uiVanish_Timer -= uiDiff; - - if (m_bIsVanished) - { - if (m_uiVisible_Timer <= uiDiff) - { - //The Panther Model - me->SetDisplayId(MODEL_ID_PANTHER); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - - const CreatureInfo *cinfo = me->GetCreatureInfo(); - me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 35))); - me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 35))); - me->UpdateDamagePhysical(BASE_ATTACK); - - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) - AttackStart(pTarget); - - m_bIsPhaseTwo = true; - m_bIsVanished = false; - } - else - m_uiVisible_Timer -= uiDiff; - } - else - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_arlokk(Creature* pCreature) -{ - return new boss_arlokkAI (pCreature); -} - -void AddSC_boss_arlokk() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "go_gong_of_bethekk"; - newscript->pGOHello = &GOHello_go_gong_of_bethekk; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_arlokk"; - newscript->GetAI = &GetAI_boss_arlokk; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/zulgurub/boss_gahzranka.cpp b/src/server/scripts/EasternKingdoms/zulgurub/boss_gahzranka.cpp deleted file mode 100644 index 0201235be70..00000000000 --- a/src/server/scripts/EasternKingdoms/zulgurub/boss_gahzranka.cpp +++ /dev/null @@ -1,93 +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_Gahz'ranka -SD%Complete: 85 -SDComment: Massive Geyser with knockback not working. Spell buggy. -SDCategory: Zul'Gurub -EndScriptData */ - -#include "ScriptedPch.h" - -#define SPELL_FROSTBREATH 16099 -#define SPELL_MASSIVEGEYSER 22421 //Not working. Cause its a summon... -#define SPELL_SLAM 24326 - -struct boss_gahzrankaAI : public ScriptedAI -{ - boss_gahzrankaAI(Creature *c) : ScriptedAI(c) {} - uint32 Frostbreath_Timer; - uint32 MassiveGeyser_Timer; - uint32 Slam_Timer; - - void Reset() - { - Frostbreath_Timer = 8000; - MassiveGeyser_Timer = 25000; - Slam_Timer = 17000; - } - - void EnterCombat(Unit * /*who*/) - { - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //Frostbreath_Timer - if (Frostbreath_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_FROSTBREATH); - Frostbreath_Timer = 7000 + rand()%4000; - } else Frostbreath_Timer -= diff; - - //MassiveGeyser_Timer - if (MassiveGeyser_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_MASSIVEGEYSER); - DoResetThreat(); - - MassiveGeyser_Timer = 22000 + rand()%10000; - } else MassiveGeyser_Timer -= diff; - - //Slam_Timer - if (Slam_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SLAM); - Slam_Timer = 12000 + rand()%8000; - } else Slam_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_gahzranka(Creature* pCreature) -{ - return new boss_gahzrankaAI (pCreature); -} - -void AddSC_boss_gahzranka() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_gahzranka"; - newscript->GetAI = &GetAI_boss_gahzranka; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/zulgurub/boss_grilek.cpp b/src/server/scripts/EasternKingdoms/zulgurub/boss_grilek.cpp deleted file mode 100644 index 67de135674a..00000000000 --- a/src/server/scripts/EasternKingdoms/zulgurub/boss_grilek.cpp +++ /dev/null @@ -1,93 +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_Grilek -SD%Complete: 100 -SDComment: -SDCategory: Zul'Gurub -EndScriptData */ - -#include "ScriptedPch.h" -#include "zulgurub.h" - -#define SPELL_AVARTAR 24646 //The Enrage Spell -#define SPELL_GROUNDTREMOR 6524 - -struct boss_grilekAI : public ScriptedAI -{ - boss_grilekAI(Creature *c) : ScriptedAI(c) {} - - uint32 Avartar_Timer; - uint32 GroundTremor_Timer; - - void Reset() - { - Avartar_Timer = 15000 + rand()%10000; - GroundTremor_Timer = 8000 + rand()%8000; - } - - void EnterCombat(Unit * /*who*/) - { - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //Avartar_Timer - if (Avartar_Timer <= diff) - { - - DoCast(me, SPELL_AVARTAR); - Unit *pTarget = NULL; - - pTarget = SelectUnit(SELECT_TARGET_RANDOM,1); - - if (DoGetThreat(me->getVictim())) - DoModifyThreatPercent(me->getVictim(),-50); - if (pTarget) - AttackStart(pTarget); - - Avartar_Timer = 25000 + rand()%10000; - } else Avartar_Timer -= diff; - - //GroundTremor_Timer - if (GroundTremor_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_GROUNDTREMOR); - GroundTremor_Timer = 12000 + rand()%4000; - } else GroundTremor_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_grilek(Creature* pCreature) -{ - return new boss_grilekAI (pCreature); -} - -void AddSC_boss_grilek() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_grilek"; - newscript->GetAI = &GetAI_boss_grilek; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/zulgurub/boss_hakkar.cpp b/src/server/scripts/EasternKingdoms/zulgurub/boss_hakkar.cpp deleted file mode 100644 index d7dd5020b74..00000000000 --- a/src/server/scripts/EasternKingdoms/zulgurub/boss_hakkar.cpp +++ /dev/null @@ -1,250 +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_Hakkar -SD%Complete: 95 -SDComment: Blood siphon spell buggy cause of Core Issue. -SDCategory: Zul'Gurub -EndScriptData */ - -#include "ScriptedPch.h" -#include "zulgurub.h" - -#define SAY_AGGRO -1309020 -#define SAY_FLEEING -1309021 -#define SAY_MINION_DESTROY -1309022 //where does it belong? -#define SAY_PROTECT_ALTAR -1309023 //where does it belong? - -#define SPELL_BLOODSIPHON 24322 -#define SPELL_CORRUPTEDBLOOD 24328 -#define SPELL_CAUSEINSANITY 24327 //Not working disabled. -#define SPELL_WILLOFHAKKAR 24178 -#define SPELL_ENRAGE 24318 - -// The Aspects of all High Priests -#define SPELL_ASPECT_OF_JEKLIK 24687 -#define SPELL_ASPECT_OF_VENOXIS 24688 -#define SPELL_ASPECT_OF_MARLI 24686 -#define SPELL_ASPECT_OF_THEKAL 24689 -#define SPELL_ASPECT_OF_ARLOKK 24690 - -struct boss_hakkarAI : public ScriptedAI -{ - boss_hakkarAI(Creature *c) : ScriptedAI(c) - { - m_pInstance = c->GetInstanceData(); - } - - ScriptedInstance *m_pInstance; - - uint32 BloodSiphon_Timer; - uint32 CorruptedBlood_Timer; - uint32 CauseInsanity_Timer; - uint32 WillOfHakkar_Timer; - uint32 Enrage_Timer; - - uint32 CheckJeklik_Timer; - uint32 CheckVenoxis_Timer; - uint32 CheckMarli_Timer; - uint32 CheckThekal_Timer; - uint32 CheckArlokk_Timer; - - uint32 AspectOfJeklik_Timer; - uint32 AspectOfVenoxis_Timer; - uint32 AspectOfMarli_Timer; - uint32 AspectOfThekal_Timer; - uint32 AspectOfArlokk_Timer; - - bool Enraged; - - void Reset() - { - BloodSiphon_Timer = 90000; - CorruptedBlood_Timer = 25000; - CauseInsanity_Timer = 17000; - WillOfHakkar_Timer = 17000; - Enrage_Timer = 600000; - - CheckJeklik_Timer = 1000; - CheckVenoxis_Timer = 2000; - CheckMarli_Timer = 3000; - CheckThekal_Timer = 4000; - CheckArlokk_Timer = 5000; - - AspectOfJeklik_Timer = 4000; - AspectOfVenoxis_Timer = 7000; - AspectOfMarli_Timer = 12000; - AspectOfThekal_Timer = 8000; - AspectOfArlokk_Timer = 18000; - - Enraged = false; - } - - void EnterCombat(Unit * /*who*/) - { - DoScriptText(SAY_AGGRO, me); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //BloodSiphon_Timer - if (BloodSiphon_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_BLOODSIPHON); - BloodSiphon_Timer = 90000; - } else BloodSiphon_Timer -= diff; - - //CorruptedBlood_Timer - if (CorruptedBlood_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_CORRUPTEDBLOOD); - CorruptedBlood_Timer = 30000 + rand()%15000; - } else CorruptedBlood_Timer -= diff; - - //CauseInsanity_Timer - /*if (CauseInsanity_Timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(pTarget, SPELL_CAUSEINSANITY); - - CauseInsanity_Timer = 35000 + rand()%8000; - } else CauseInsanity_Timer -= diff;*/ - - //WillOfHakkar_Timer - if (WillOfHakkar_Timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(pTarget, SPELL_WILLOFHAKKAR); - - WillOfHakkar_Timer = 25000 + rand()%10000; - } else WillOfHakkar_Timer -= diff; - - if (!Enraged && Enrage_Timer <= diff) - { - DoCast(me, SPELL_ENRAGE); - Enraged = true; - } else Enrage_Timer -= diff; - - //Checking if Jeklik is dead. If not we cast her Aspect - if (CheckJeklik_Timer <= diff) - { - if (m_pInstance) - { - if (m_pInstance->GetData(TYPE_JEKLIK) != DONE) - { - if (AspectOfJeklik_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_ASPECT_OF_JEKLIK); - AspectOfJeklik_Timer = 10000 + rand()%4000; - } else AspectOfJeklik_Timer -= diff; - } - } - CheckJeklik_Timer = 1000; - } else CheckJeklik_Timer -= diff; - - //Checking if Venoxis is dead. If not we cast his Aspect - if (CheckVenoxis_Timer <= diff) - { - if (m_pInstance) - { - if (m_pInstance->GetData(TYPE_VENOXIS) != DONE) - { - if (AspectOfVenoxis_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_ASPECT_OF_VENOXIS); - AspectOfVenoxis_Timer = 8000; - } else AspectOfVenoxis_Timer -= diff; - } - } - CheckVenoxis_Timer = 1000; - } else CheckVenoxis_Timer -= diff; - - //Checking if Marli is dead. If not we cast her Aspect - if (CheckMarli_Timer <= diff) - { - if (m_pInstance) - { - if (m_pInstance->GetData(TYPE_MARLI) != DONE) - { - if (AspectOfMarli_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_ASPECT_OF_MARLI); - AspectOfMarli_Timer = 10000; - } else AspectOfMarli_Timer -= diff; - - } - } - CheckMarli_Timer = 1000; - } else CheckMarli_Timer -= diff; - - //Checking if Thekal is dead. If not we cast his Aspect - if (CheckThekal_Timer <= diff) - { - if (m_pInstance) - { - if (m_pInstance->GetData(TYPE_THEKAL) != DONE) - { - if (AspectOfThekal_Timer <= diff) - { - DoCast(me, SPELL_ASPECT_OF_THEKAL); - AspectOfThekal_Timer = 15000; - } else AspectOfThekal_Timer -= diff; - } - } - CheckThekal_Timer = 1000; - } else CheckThekal_Timer -= diff; - - //Checking if Arlokk is dead. If yes we cast her Aspect - if (CheckArlokk_Timer <= diff) - { - if (m_pInstance) - { - if (m_pInstance->GetData(TYPE_ARLOKK) != DONE) - { - if (AspectOfArlokk_Timer <= diff) - { - DoCast(me, SPELL_ASPECT_OF_ARLOKK); - DoResetThreat(); - - AspectOfArlokk_Timer = 10000 + rand()%5000; - } else AspectOfArlokk_Timer -= diff; - } - } - CheckArlokk_Timer = 1000; - } else CheckArlokk_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_hakkar(Creature* pCreature) -{ - return new boss_hakkarAI (pCreature); -} - -void AddSC_boss_hakkar() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_hakkar"; - newscript->GetAI = &GetAI_boss_hakkar; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/zulgurub/boss_hazzarah.cpp b/src/server/scripts/EasternKingdoms/zulgurub/boss_hazzarah.cpp deleted file mode 100644 index ca67d0842c3..00000000000 --- a/src/server/scripts/EasternKingdoms/zulgurub/boss_hazzarah.cpp +++ /dev/null @@ -1,104 +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_Hazzarah -SD%Complete: 100 -SDComment: -SDCategory: Zul'Gurub -EndScriptData */ - -#include "ScriptedPch.h" -#include "zulgurub.h" - -#define SPELL_MANABURN 26046 -#define SPELL_SLEEP 24664 - -struct boss_hazzarahAI : public ScriptedAI -{ - boss_hazzarahAI(Creature *c) : ScriptedAI(c) {} - - uint32 ManaBurn_Timer; - uint32 Sleep_Timer; - uint32 Illusions_Timer; - - void Reset() - { - ManaBurn_Timer = 4000 + rand()%6000; - Sleep_Timer = 10000 + rand()%8000; - Illusions_Timer = 10000 + rand()%8000; - } - - void EnterCombat(Unit * /*who*/) - { - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //ManaBurn_Timer - if (ManaBurn_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_MANABURN); - ManaBurn_Timer = 8000 + rand()%8000; - } else ManaBurn_Timer -= diff; - - //Sleep_Timer - if (Sleep_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SLEEP); - Sleep_Timer = 12000 + rand()%8000; - } else Sleep_Timer -= diff; - - //Illusions_Timer - if (Illusions_Timer <= diff) - { - //We will summon 3 illusions that will spawn on a random gamer and attack this gamer - //We will just use one model for the beginning - Unit *pTarget = NULL; - for (uint8 i = 0; i < 3; ++i) - { - pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); - if (!pTarget) - return; - - Creature *Illusion = me->SummonCreature(15163,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,30000); - if (Illusion) - Illusion->AI()->AttackStart(pTarget); - } - - Illusions_Timer = 15000 + rand()%10000; - } else Illusions_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_hazzarah(Creature* pCreature) -{ - return new boss_hazzarahAI (pCreature); -} - -void AddSC_boss_hazzarah() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_hazzarah"; - newscript->GetAI = &GetAI_boss_hazzarah; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/zulgurub/boss_jeklik.cpp b/src/server/scripts/EasternKingdoms/zulgurub/boss_jeklik.cpp deleted file mode 100644 index fae05fcf384..00000000000 --- a/src/server/scripts/EasternKingdoms/zulgurub/boss_jeklik.cpp +++ /dev/null @@ -1,291 +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_Jeklik -SD%Complete: 85 -SDComment: Problem in finding the right flying batriders for spawning and making them fly. -SDCategory: Zul'Gurub -EndScriptData */ - -#include "ScriptedPch.h" -#include "zulgurub.h" - -#define SAY_AGGRO -1309002 -#define SAY_RAIN_FIRE -1309003 -#define SAY_DEATH -1309004 - -#define SPELL_CHARGE 22911 -#define SPELL_SONICBURST 23918 -#define SPELL_SCREECH 6605 -#define SPELL_SHADOW_WORD_PAIN 23952 -#define SPELL_MIND_FLAY 23953 -#define SPELL_CHAIN_MIND_FLAY 26044 //Right ID unknown. So disabled -#define SPELL_GREATERHEAL 23954 -#define SPELL_BAT_FORM 23966 - -// Batriders Spell - -#define SPELL_BOMB 40332 //Wrong ID but Magmadars bomb is not working... - -struct boss_jeklikAI : public ScriptedAI -{ - boss_jeklikAI(Creature *c) : ScriptedAI(c) - { - m_pInstance = c->GetInstanceData(); - } - - ScriptedInstance *m_pInstance; - - uint32 Charge_Timer; - uint32 SonicBurst_Timer; - uint32 Screech_Timer; - uint32 SpawnBats_Timer; - uint32 ShadowWordPain_Timer; - uint32 MindFlay_Timer; - uint32 ChainMindFlay_Timer; - uint32 GreaterHeal_Timer; - uint32 SpawnFlyingBats_Timer; - - bool PhaseTwo; - - void Reset() - { - Charge_Timer = 20000; - SonicBurst_Timer = 8000; - Screech_Timer = 13000; - SpawnBats_Timer = 60000; - ShadowWordPain_Timer = 6000; - MindFlay_Timer = 11000; - ChainMindFlay_Timer = 26000; - GreaterHeal_Timer = 50000; - SpawnFlyingBats_Timer = 10000; - - PhaseTwo = false; - } - - void EnterCombat(Unit * /*who*/) - { - DoScriptText(SAY_AGGRO, me); - DoCast(me, SPELL_BAT_FORM); - } - - void JustDied(Unit* /*Killer*/) - { - DoScriptText(SAY_DEATH, me); - - if (m_pInstance) - m_pInstance->SetData(TYPE_JEKLIK, DONE); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (me->getVictim() && me->isAlive()) - { - if ((me->GetHealth()*100 / me->GetMaxHealth() > 50)) - { - if (Charge_Timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) - { - DoCast(pTarget, SPELL_CHARGE); - AttackStart(pTarget); - } - - Charge_Timer = 15000 + rand()%15000; - } else Charge_Timer -= diff; - - if (SonicBurst_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SONICBURST); - SonicBurst_Timer = 8000 + rand()%5000; - } else SonicBurst_Timer -= diff; - - if (Screech_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SCREECH); - Screech_Timer = 18000 + rand()%8000; - } else Screech_Timer -= diff; - - if (SpawnBats_Timer <= diff) - { - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); - - Creature* Bat = NULL; - Bat = me->SummonCreature(11368,-12291.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (pTarget && Bat) Bat ->AI()->AttackStart(pTarget); - - Bat = me->SummonCreature(11368,-12289.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (pTarget && Bat) Bat ->AI()->AttackStart(pTarget); - - Bat = me->SummonCreature(11368,-12293.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (pTarget && Bat) Bat ->AI()->AttackStart(pTarget); - - Bat = me->SummonCreature(11368,-12291.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (pTarget && Bat) Bat ->AI()->AttackStart(pTarget); - - Bat = me->SummonCreature(11368,-12289.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (pTarget && Bat) Bat ->AI()->AttackStart(pTarget); - Bat = me->SummonCreature(11368,-12293.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (pTarget && Bat) Bat ->AI()->AttackStart(pTarget); - - SpawnBats_Timer = 60000; - } else SpawnBats_Timer -= diff; - } - else - { - if (PhaseTwo) - { - if (PhaseTwo && ShadowWordPain_Timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) - { - DoCast(pTarget, SPELL_SHADOW_WORD_PAIN); - ShadowWordPain_Timer = 12000 + rand()%6000; - } - }ShadowWordPain_Timer -=diff; - - if (MindFlay_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_MIND_FLAY); - MindFlay_Timer = 16000; - }MindFlay_Timer -=diff; - - if (ChainMindFlay_Timer <= diff) - { - me->InterruptNonMeleeSpells(false); - DoCast(me->getVictim(), SPELL_CHAIN_MIND_FLAY); - ChainMindFlay_Timer = 15000 + rand()%15000; - }ChainMindFlay_Timer -=diff; - - if (GreaterHeal_Timer <= diff) - { - me->InterruptNonMeleeSpells(false); - DoCast(me, SPELL_GREATERHEAL); - GreaterHeal_Timer = 25000 + rand()%10000; - }GreaterHeal_Timer -=diff; - - if (SpawnFlyingBats_Timer <= diff) - { - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (!pTarget) - return; - - Creature* FlyingBat = me->SummonCreature(14965, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ()+15, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (FlyingBat) - FlyingBat->AI()->AttackStart(pTarget); - - SpawnFlyingBats_Timer = 10000 + rand()%5000; - } else SpawnFlyingBats_Timer -=diff; - } - else - { - me->SetDisplayId(15219); - DoResetThreat(); - PhaseTwo = true; - } - } - - DoMeleeAttackIfReady(); - } - } -}; - -//Flying Bat -struct mob_batriderAI : public ScriptedAI -{ - mob_batriderAI(Creature *c) : ScriptedAI(c) - { - m_pInstance = c->GetInstanceData(); - } - - ScriptedInstance *m_pInstance; - - uint32 Bomb_Timer; - uint32 Check_Timer; - - void Reset() - { - Bomb_Timer = 2000; - Check_Timer = 1000; - - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - } - - void EnterCombat(Unit * /*who*/) {} - - void UpdateAI (const uint32 diff) - { - if (!UpdateVictim()) - return; - - //Bomb_Timer - if (Bomb_Timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - DoCast(pTarget, SPELL_BOMB); - Bomb_Timer = 5000; - } - } else Bomb_Timer -= diff; - - //Check_Timer - if (Check_Timer <= diff) - { - if (m_pInstance) - { - if (m_pInstance->GetData(TYPE_JEKLIK) == DONE) - { - me->setDeathState(JUST_DIED); - me->RemoveCorpse(); - return; - } - } - - Check_Timer = 1000; - } else Check_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_jeklik(Creature* pCreature) -{ - return new boss_jeklikAI (pCreature); -} - -CreatureAI* GetAI_mob_batrider(Creature* pCreature) -{ - return new mob_batriderAI (pCreature); -} - -void AddSC_boss_jeklik() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_jeklik"; - newscript->GetAI = &GetAI_boss_jeklik; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_batrider"; - newscript->GetAI = &GetAI_mob_batrider; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/zulgurub/boss_jindo.cpp b/src/server/scripts/EasternKingdoms/zulgurub/boss_jindo.cpp deleted file mode 100644 index 58f91f85a95..00000000000 --- a/src/server/scripts/EasternKingdoms/zulgurub/boss_jindo.cpp +++ /dev/null @@ -1,263 +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_Jin'do the Hexxer -SD%Complete: 85 -SDComment: Mind Control not working because of core bug. Shades visible for all. -SDCategory: Zul'Gurub -EndScriptData */ - -#include "ScriptedPch.h" -#include "zulgurub.h" - -#define SAY_AGGRO -1309014 - -#define SPELL_BRAINWASHTOTEM 24262 -#define SPELL_POWERFULLHEALINGWARD 24309 //We will not use this spell. We will summon a totem by script cause the spell totems will not cast. -#define SPELL_HEX 24053 -#define SPELL_DELUSIONSOFJINDO 24306 -#define SPELL_SHADEOFJINDO 24308 //We will not use this spell. We will summon a shade by script. - -//Healing Ward Spell -#define SPELL_HEAL 38588 //Totems are not working right. Right heal spell ID is 24311 but this spell is not casting... - -//Shade of Jindo Spell -#define SPELL_SHADOWSHOCK 19460 -#define SPELL_INVISIBLE 24699 - -struct boss_jindoAI : public ScriptedAI -{ - boss_jindoAI(Creature *c) : ScriptedAI(c) {} - - uint32 BrainWashTotem_Timer; - uint32 HealingWard_Timer; - uint32 Hex_Timer; - uint32 Delusions_Timer; - uint32 Teleport_Timer; - - void Reset() - { - BrainWashTotem_Timer = 20000; - HealingWard_Timer = 16000; - Hex_Timer = 8000; - Delusions_Timer = 10000; - Teleport_Timer = 5000; - } - - void EnterCombat(Unit * /*who*/) - { - DoScriptText(SAY_AGGRO, me); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //BrainWashTotem_Timer - if (BrainWashTotem_Timer <= diff) - { - DoCast(me, SPELL_BRAINWASHTOTEM); - BrainWashTotem_Timer = 18000 + rand()%8000; - } else BrainWashTotem_Timer -= diff; - - //HealingWard_Timer - if (HealingWard_Timer <= diff) - { - //DoCast(me, SPELL_POWERFULLHEALINGWARD); - me->SummonCreature(14987, me->GetPositionX()+3, me->GetPositionY()-2, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,30000); - HealingWard_Timer = 14000 + rand()%6000; - } else HealingWard_Timer -= diff; - - //Hex_Timer - if (Hex_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_HEX); - - if (DoGetThreat(me->getVictim())) - DoModifyThreatPercent(me->getVictim(),-80); - - Hex_Timer = 12000 + rand()%8000; - } else Hex_Timer -= diff; - - //Casting the delusion curse with a shade. So shade will attack the same target with the curse. - if (Delusions_Timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) - { - DoCast(pTarget, SPELL_DELUSIONSOFJINDO); - - Creature *Shade = me->SummonCreature(14986, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Shade) - Shade->AI()->AttackStart(pTarget); - } - - Delusions_Timer = 4000 + rand()%8000; - } else Delusions_Timer -= diff; - - //Teleporting a random gamer and spawning 9 skeletons that will attack this gamer - if (Teleport_Timer <= diff) - { - Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); - if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER) - { - DoTeleportPlayer(pTarget, -11583.7783,-1249.4278,77.5471,4.745); - - if (DoGetThreat(me->getVictim())) - DoModifyThreatPercent(pTarget,-100); - - Creature *Skeletons; - Skeletons = me->SummonCreature(14826, pTarget->GetPositionX()+2, pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Skeletons) - Skeletons->AI()->AttackStart(pTarget); - Skeletons = me->SummonCreature(14826, pTarget->GetPositionX()-2, pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Skeletons) - Skeletons->AI()->AttackStart(pTarget); - Skeletons = me->SummonCreature(14826, pTarget->GetPositionX()+4, pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Skeletons) - Skeletons->AI()->AttackStart(pTarget); - Skeletons = me->SummonCreature(14826, pTarget->GetPositionX()-4, pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Skeletons) - Skeletons->AI()->AttackStart(pTarget); - Skeletons = me->SummonCreature(14826, pTarget->GetPositionX(), pTarget->GetPositionY()+2, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Skeletons) - Skeletons->AI()->AttackStart(pTarget); - Skeletons = me->SummonCreature(14826, pTarget->GetPositionX(), pTarget->GetPositionY()-2, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Skeletons) - Skeletons->AI()->AttackStart(pTarget); - Skeletons = me->SummonCreature(14826, pTarget->GetPositionX(), pTarget->GetPositionY()+4, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Skeletons) - Skeletons->AI()->AttackStart(pTarget); - Skeletons = me->SummonCreature(14826, pTarget->GetPositionX(), pTarget->GetPositionY()-4, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Skeletons) - Skeletons->AI()->AttackStart(pTarget); - Skeletons = me->SummonCreature(14826, pTarget->GetPositionX()+3, pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Skeletons) - Skeletons->AI()->AttackStart(pTarget); - } - - Teleport_Timer = 15000 + rand()%8000; - } else Teleport_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -//Healing Ward -struct mob_healing_wardAI : public ScriptedAI -{ - mob_healing_wardAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - uint32 Heal_Timer; - - ScriptedInstance *pInstance; - - void Reset() - { - Heal_Timer = 2000; - } - - void EnterCombat(Unit * /*who*/) - { - } - - void UpdateAI (const uint32 diff) - { - //Heal_Timer - if (Heal_Timer <= diff) - { - if (pInstance) - { - Unit *pJindo = Unit::GetUnit((*me), pInstance->GetData64(DATA_JINDO)); - if (pJindo) - DoCast(pJindo, SPELL_HEAL); - } - Heal_Timer = 3000; - } else Heal_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -//Shade of Jindo -struct mob_shade_of_jindoAI : public ScriptedAI -{ - mob_shade_of_jindoAI(Creature *c) : ScriptedAI(c) {} - - uint32 ShadowShock_Timer; - - void Reset() - { - ShadowShock_Timer = 1000; - DoCast(me, SPELL_INVISIBLE, true); - } - - void EnterCombat(Unit * /*who*/){} - - void UpdateAI (const uint32 diff) - { - - //ShadowShock_Timer - if (ShadowShock_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SHADOWSHOCK); - ShadowShock_Timer = 2000; - } else ShadowShock_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_jindo(Creature* pCreature) -{ - return new boss_jindoAI (pCreature); -} - -CreatureAI* GetAI_mob_healing_ward(Creature* pCreature) -{ - return new mob_healing_wardAI (pCreature); -} - -CreatureAI* GetAI_mob_shade_of_jindo(Creature* pCreature) -{ - return new mob_shade_of_jindoAI (pCreature); -} - -void AddSC_boss_jindo() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "boss_jindo"; - newscript->GetAI = &GetAI_boss_jindo; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_healing_ward"; - newscript->GetAI = &GetAI_mob_healing_ward; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_shade_of_jindo"; - newscript->GetAI = &GetAI_mob_shade_of_jindo; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/zulgurub/boss_mandokir.cpp b/src/server/scripts/EasternKingdoms/zulgurub/boss_mandokir.cpp deleted file mode 100644 index 4609605f3c1..00000000000 --- a/src/server/scripts/EasternKingdoms/zulgurub/boss_mandokir.cpp +++ /dev/null @@ -1,333 +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_Mandokir -SD%Complete: 90 -SDComment: Ohgan function needs improvements. -SDCategory: Zul'Gurub -EndScriptData */ - -#include "ScriptedPch.h" -#include "zulgurub.h" - -#define SAY_AGGRO -1309015 -#define SAY_DING_KILL -1309016 -#define SAY_GRATS_JINDO -1309017 -#define SAY_WATCH -1309018 -#define SAY_WATCH_WHISPER -1309019 //is this text for real? easter egg? - -#define SPELL_CHARGE 24315 -#define SPELL_CLEAVE 20691 -#define SPELL_FEAR 29321 -#define SPELL_WHIRLWIND 24236 -#define SPELL_MORTAL_STRIKE 24573 -#define SPELL_ENRAGE 23537 -#define SPELL_WATCH 24314 -#define SPELL_LEVEL_UP 24312 - -//Ohgans Spells -#define SPELL_SUNDERARMOR 24317 - -struct boss_mandokirAI : public ScriptedAI -{ - boss_mandokirAI(Creature *c) : ScriptedAI(c) - { - m_pInstance = c->GetInstanceData(); - } - - uint32 KillCount; - uint32 Watch_Timer; - uint32 TargetInRange; - uint32 Cleave_Timer; - uint32 Whirlwind_Timer; - uint32 Fear_Timer; - uint32 MortalStrike_Timer; - uint32 Check_Timer; - float targetX; - float targetY; - float targetZ; - - ScriptedInstance *m_pInstance; - - bool endWatch; - bool someWatched; - bool RaptorDead; - bool CombatStart; - - uint64 WatchTarget; - - void Reset() - { - KillCount = 0; - Watch_Timer = 33000; - Cleave_Timer = 7000; - Whirlwind_Timer = 20000; - Fear_Timer = 1000; - MortalStrike_Timer = 1000; - Check_Timer = 1000; - - targetX = 0.0; - targetY = 0.0; - targetZ = 0.0; - TargetInRange = 0; - - WatchTarget = 0; - - someWatched = false; - endWatch = false; - RaptorDead = false; - CombatStart = false; - - DoCast(me, 23243); - } - - void KilledUnit(Unit* victim) - { - if (victim->GetTypeId() == TYPEID_PLAYER) - { - ++KillCount; - - if (KillCount == 3) - { - DoScriptText(SAY_DING_KILL, me); - - if (m_pInstance) - { - uint64 JindoGUID = m_pInstance->GetData64(DATA_JINDO); - if (JindoGUID) - { - if (Unit* jTemp = Unit::GetUnit(*me,JindoGUID)) - { - if (jTemp->isAlive()) - DoScriptText(SAY_GRATS_JINDO, jTemp); - } - } - } - DoCast(me, SPELL_LEVEL_UP, true); - KillCount = 0; - } - } - } - - void EnterCombat(Unit * /*who*/) - { - DoScriptText(SAY_AGGRO, me); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (me->getVictim() && me->isAlive()) - { - if (!CombatStart) - { - //At combat Start Mandokir is mounted so we must unmount it first - me->Unmount(); - - //And summon his raptor - me->SummonCreature(14988, me->getVictim()->GetPositionX(), me->getVictim()->GetPositionY(), me->getVictim()->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 35000); - CombatStart = true; - } - - if (Watch_Timer <= diff) //Every 20 Sec Mandokir will check this - { - if (WatchTarget) //If someone is watched and If the Position of the watched target is different from the one stored, or are attacking, mandokir will charge him - { - Unit* pUnit = Unit::GetUnit(*me, WatchTarget); - - if (pUnit && ( - targetX != pUnit->GetPositionX() || - targetY != pUnit->GetPositionY() || - targetZ != pUnit->GetPositionZ() || - pUnit->isInCombat())) - { - if (me->IsWithinMeleeRange(pUnit)) - { - DoCast(pUnit, 24316); - } - else - { - DoCast(pUnit, SPELL_CHARGE); - //me->SendMonsterMove(pUnit->GetPositionX(), pUnit->GetPositionY(), pUnit->GetPositionZ(), 0, true,1); - AttackStart(pUnit); - } - } - } - someWatched = false; - Watch_Timer = 20000; - } else Watch_Timer -= diff; - - if ((Watch_Timer < 8000) && !someWatched) //8 sec(cast time + expire time) before the check for the watch effect mandokir will cast watch debuff on a random target - { - if (Unit* p = SelectUnit(SELECT_TARGET_RANDOM,0)) - { - DoScriptText(SAY_WATCH, me, p); - DoCast(p, SPELL_WATCH); - WatchTarget = p->GetGUID(); - someWatched = true; - endWatch = true; - } - } - - if ((Watch_Timer < 1000) && endWatch) //1 sec before the debuf expire, store the target position - { - Unit* pUnit = Unit::GetUnit(*me, WatchTarget); - if (pUnit) - { - targetX = pUnit->GetPositionX(); - targetY = pUnit->GetPositionY(); - targetZ = pUnit->GetPositionZ(); - } - endWatch = false; - } - - if (!someWatched) - { - //Cleave - if (Cleave_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_CLEAVE); - Cleave_Timer = 7000; - } else Cleave_Timer -= diff; - - //Whirlwind - if (Whirlwind_Timer <= diff) - { - DoCast(me, SPELL_WHIRLWIND); - Whirlwind_Timer = 18000; - } else Whirlwind_Timer -= diff; - - //If more then 3 targets in melee range mandokir will cast fear - if (Fear_Timer <= diff) - { - TargetInRange = 0; - - std::list::const_iterator i = me->getThreatManager().getThreatList().begin(); - for (; i != me->getThreatManager().getThreatList().end(); ++i) - { - Unit* pUnit = Unit::GetUnit(*me, (*i)->getUnitGuid()); - if (pUnit && me->IsWithinMeleeRange(pUnit)) - ++TargetInRange; - } - - if (TargetInRange > 3) - DoCast(me->getVictim(), SPELL_FEAR); - - Fear_Timer = 4000; - } else Fear_Timer -=diff; - - //Mortal Strike if target below 50% hp - if (me->getVictim() && me->getVictim()->GetHealth() < me->getVictim()->GetMaxHealth()*0.5) - { - if (MortalStrike_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_MORTAL_STRIKE); - MortalStrike_Timer = 15000; - } else MortalStrike_Timer -= diff; - } - } - //Checking if Ohgan is dead. If yes Mandokir will enrage. - if (Check_Timer <= diff) - { - if (m_pInstance) - { - if (m_pInstance->GetData(TYPE_OHGAN) == DONE) - { - if (!RaptorDead) - { - DoCast(me, SPELL_ENRAGE); - RaptorDead = true; - } - } - } - - Check_Timer = 1000; - } else Check_Timer -= diff; - - DoMeleeAttackIfReady(); - } - } -}; - -//Ohgan -struct mob_ohganAI : public ScriptedAI -{ - mob_ohganAI(Creature *c) : ScriptedAI(c) - { - m_pInstance = c->GetInstanceData(); - } - - uint32 SunderArmor_Timer; - ScriptedInstance *m_pInstance; - - void Reset() - { - SunderArmor_Timer = 5000; - } - - void EnterCombat(Unit * /*who*/) {} - - void JustDied(Unit* /*Killer*/) - { - if (m_pInstance) - m_pInstance->SetData(TYPE_OHGAN, DONE); - } - - void UpdateAI (const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //SunderArmor_Timer - if (SunderArmor_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SUNDERARMOR); - SunderArmor_Timer = 10000 + rand()%5000; - } else SunderArmor_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_mandokir(Creature* pCreature) -{ - return new boss_mandokirAI (pCreature); -} - -CreatureAI* GetAI_mob_ohgan(Creature* pCreature) -{ - return new mob_ohganAI (pCreature); -} - -void AddSC_boss_mandokir() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "boss_mandokir"; - newscript->GetAI = &GetAI_boss_mandokir; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_ohgan"; - newscript->GetAI = &GetAI_mob_ohgan; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/zulgurub/boss_marli.cpp b/src/server/scripts/EasternKingdoms/zulgurub/boss_marli.cpp deleted file mode 100644 index 77e9f9b929f..00000000000 --- a/src/server/scripts/EasternKingdoms/zulgurub/boss_marli.cpp +++ /dev/null @@ -1,261 +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_Marli -SD%Complete: 80 -SDComment: Charging healers and casters not working. Perhaps wrong Spell Timers. -SDCategory: Zul'Gurub -EndScriptData */ - -#include "ScriptedPch.h" -#include "zulgurub.h" - -#define SAY_AGGRO -1309005 -#define SAY_TRANSFORM -1309006 -#define SAY_SPIDER_SPAWN -1309007 -#define SAY_DEATH -1309008 - -#define SPELL_CHARGE 22911 -#define SPELL_ASPECT_OF_MARLI 24686 // A stun spell -#define SPELL_ENVOLWINGWEB 24110 -#define SPELL_POISONVOLLEY 24099 -#define SPELL_SPIDER_FORM 24084 - -//The Spider Spells -#define SPELL_LEVELUP 24312 //Not right Spell. - -struct boss_marliAI : public ScriptedAI -{ - boss_marliAI(Creature *c) : ScriptedAI(c) - { - m_pInstance = c->GetInstanceData(); - } - - ScriptedInstance *m_pInstance; - - uint32 SpawnStartSpiders_Timer; - uint32 PoisonVolley_Timer; - uint32 SpawnSpider_Timer; - uint32 Charge_Timer; - uint32 Aspect_Timer; - uint32 Transform_Timer; - uint32 TransformBack_Timer; - - bool Spawned; - bool PhaseTwo; - - void Reset() - { - SpawnStartSpiders_Timer = 1000; - PoisonVolley_Timer = 15000; - SpawnSpider_Timer = 30000; - Charge_Timer = 1500; - Aspect_Timer = 12000; - Transform_Timer = 45000; - TransformBack_Timer = 25000; - - Spawned = false; - PhaseTwo = false; - } - - void EnterCombat(Unit * /*who*/) - { - DoScriptText(SAY_AGGRO, me); - } - - void JustDied(Unit* /*Killer*/) - { - DoScriptText(SAY_DEATH, me); - if (m_pInstance) - m_pInstance->SetData(TYPE_MARLI, DONE); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (me->getVictim() && me->isAlive()) - { - if (PoisonVolley_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_POISONVOLLEY); - PoisonVolley_Timer = 10000 + rand()%10000; - } else PoisonVolley_Timer -= diff; - - if (!PhaseTwo && Aspect_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_ASPECT_OF_MARLI); - Aspect_Timer = 13000 + rand()%5000; - } else Aspect_Timer -= diff; - - if (!Spawned && SpawnStartSpiders_Timer <= diff) - { - DoScriptText(SAY_SPIDER_SPAWN, me); - - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); - if (!pTarget) - return; - - Creature *Spider = NULL; - - Spider = me->SummonCreature(15041,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Spider) - Spider->AI()->AttackStart(pTarget); - Spider = me->SummonCreature(15041,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Spider) - Spider->AI()->AttackStart(pTarget); - Spider = me->SummonCreature(15041,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Spider) - Spider->AI()->AttackStart(pTarget); - Spider = me->SummonCreature(15041,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Spider) - Spider->AI()->AttackStart(pTarget); - - Spawned = true; - } else SpawnStartSpiders_Timer -= diff; - - if (SpawnSpider_Timer <= diff) - { - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); - if (!pTarget) - return; - - Creature *Spider = me->SummonCreature(15041,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Spider) - Spider->AI()->AttackStart(pTarget); - SpawnSpider_Timer = 12000 + rand()%5000; - } else SpawnSpider_Timer -= diff; - - if (!PhaseTwo && Transform_Timer <= diff) - { - DoScriptText(SAY_TRANSFORM, me); - DoCast(me, SPELL_SPIDER_FORM); - const CreatureInfo *cinfo = me->GetCreatureInfo(); - me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 35))); - me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 35))); - me->UpdateDamagePhysical(BASE_ATTACK); - DoCast(me->getVictim(), SPELL_ENVOLWINGWEB); - - if (DoGetThreat(me->getVictim())) - DoModifyThreatPercent(me->getVictim(),-100); - - PhaseTwo = true; - Transform_Timer = urand(35000,60000); - } else Transform_Timer -= diff; - - if (PhaseTwo) - { - if (Charge_Timer <= diff) - { - Unit *pTarget = NULL; - int i = 0; - while (i < 3) // max 3 tries to get a random target with power_mana - { - ++i; - pTarget = SelectTarget(SELECT_TARGET_RANDOM,1, 100, true); // not aggro leader - if (pTarget && pTarget->getPowerType() == POWER_MANA) - i = 3; - } - if (pTarget) - { - DoCast(pTarget, SPELL_CHARGE); - //me->GetMap()->CreatureRelocation(me, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0); - //me->SendMonsterMove(pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, true,1); - AttackStart(pTarget); - } - - Charge_Timer = 8000; - } else Charge_Timer -= diff; - - if (TransformBack_Timer <= diff) - { - me->SetDisplayId(15220); - const CreatureInfo *cinfo = me->GetCreatureInfo(); - me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 1))); - me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 1))); - me->UpdateDamagePhysical(BASE_ATTACK); - - PhaseTwo = false; - TransformBack_Timer = urand(25000,40000); - } else TransformBack_Timer -= diff; - - } - - DoMeleeAttackIfReady(); - } - } -}; - -//Spawn of Marli -struct mob_spawn_of_marliAI : public ScriptedAI -{ - mob_spawn_of_marliAI(Creature *c) : ScriptedAI(c) {} - - uint32 LevelUp_Timer; - - void Reset() - { - LevelUp_Timer = 3000; - } - - void EnterCombat(Unit * /*who*/) - { - } - - void UpdateAI (const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //LevelUp_Timer - if (LevelUp_Timer <= diff) - { - DoCast(me, SPELL_LEVELUP); - LevelUp_Timer = 3000; - } else LevelUp_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_marli(Creature* pCreature) -{ - return new boss_marliAI (pCreature); -} - -CreatureAI* GetAI_mob_spawn_of_marli(Creature* pCreature) -{ - return new mob_spawn_of_marliAI (pCreature); -} - -void AddSC_boss_marli() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "boss_marli"; - newscript->GetAI = &GetAI_boss_marli; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_spawn_of_marli"; - newscript->GetAI = &GetAI_mob_spawn_of_marli; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/zulgurub/boss_renataki.cpp b/src/server/scripts/EasternKingdoms/zulgurub/boss_renataki.cpp deleted file mode 100644 index f7b01b26e19..00000000000 --- a/src/server/scripts/EasternKingdoms/zulgurub/boss_renataki.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_Renataki -SD%Complete: 100 -SDComment: -SDCategory: Zul'Gurub -EndScriptData */ - -#include "ScriptedPch.h" -#include "zulgurub.h" - -#define SPELL_AMBUSH 24337 -#define SPELL_THOUSANDBLADES 24649 - -#define EQUIP_ID_MAIN_HAND 0 //was item display id 31818, but this id does not exist - -struct boss_renatakiAI : public ScriptedAI -{ - boss_renatakiAI(Creature *c) : ScriptedAI(c) {} - - uint32 Invisible_Timer; - uint32 Ambush_Timer; - uint32 Visible_Timer; - uint32 Aggro_Timer; - uint32 ThousandBlades_Timer; - - bool Invisible; - bool Ambushed; - - void Reset() - { - Invisible_Timer = 8000 + rand()%10000; - Ambush_Timer = 3000; - Visible_Timer = 4000; - Aggro_Timer = 15000 + rand()%10000; - ThousandBlades_Timer = 4000 + rand()%4000; - - Invisible = false; - Ambushed = false; - } - - void EnterCombat(Unit * /*who*/) - { - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //Invisible_Timer - if (Invisible_Timer <= diff) - { - me->InterruptSpell(CURRENT_GENERIC_SPELL); - - SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE); - me->SetDisplayId(11686); - - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - Invisible = true; - - Invisible_Timer = 15000 + rand()%15000; - } else Invisible_Timer -= diff; - - if (Invisible) - { - if (Ambush_Timer <= diff) - { - Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); - if (pTarget) - { - DoTeleportTo(pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ()); - DoCast(pTarget, SPELL_AMBUSH); - } - - Ambushed = true; - Ambush_Timer = 3000; - } else Ambush_Timer -= diff; - } - - if (Ambushed) - { - if (Visible_Timer <= diff) - { - me->InterruptSpell(CURRENT_GENERIC_SPELL); - - me->SetDisplayId(15268); - SetEquipmentSlots(false, EQUIP_ID_MAIN_HAND, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE); - - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - Invisible = false; - - Visible_Timer = 4000; - } else Visible_Timer -= diff; - } - - //Resetting some aggro so he attacks other gamers - if (!Invisible) - if (Aggro_Timer <= diff) - { - Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM,1); - - if (DoGetThreat(me->getVictim())) - DoModifyThreatPercent(me->getVictim(),-50); - - if (pTarget) - AttackStart(pTarget); - - Aggro_Timer = 7000 + rand()%13000; - } else Aggro_Timer -= diff; - - if (!Invisible) - if (ThousandBlades_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_THOUSANDBLADES); - ThousandBlades_Timer = 7000 + rand()%5000; - } else ThousandBlades_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_renataki(Creature* pCreature) -{ - return new boss_renatakiAI (pCreature); -} - -void AddSC_boss_renataki() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_renataki"; - newscript->GetAI = &GetAI_boss_renataki; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/zulgurub/boss_thekal.cpp b/src/server/scripts/EasternKingdoms/zulgurub/boss_thekal.cpp deleted file mode 100644 index 179700d36e7..00000000000 --- a/src/server/scripts/EasternKingdoms/zulgurub/boss_thekal.cpp +++ /dev/null @@ -1,556 +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_Thekal -SD%Complete: 95 -SDComment: Almost finished. -SDCategory: Zul'Gurub -EndScriptData */ - -#include "ScriptedPch.h" -#include "zulgurub.h" - -#define SAY_AGGRO -1309009 -#define SAY_DEATH -1309010 - -#define SPELL_MORTALCLEAVE 22859 -#define SPELL_SILENCE 23207 -#define SPELL_FRENZY 23342 -#define SPELL_FORCEPUNCH 24189 -#define SPELL_CHARGE 24408 -#define SPELL_ENRAGE 23537 -#define SPELL_SUMMONTIGERS 24183 -#define SPELL_TIGER_FORM 24169 -#define SPELL_RESURRECT 24173 //We will not use this spell. - -//Zealot Lor'Khan Spells -#define SPELL_SHIELD 25020 -#define SPELL_BLOODLUST 24185 -#define SPELL_GREATERHEAL 24208 -#define SPELL_DISARM 22691 - -//Zealot Lor'Khan Spells -#define SPELL_SWEEPINGSTRIKES 18765 -#define SPELL_SINISTERSTRIKE 15667 -#define SPELL_GOUGE 24698 -#define SPELL_KICK 15614 -#define SPELL_BLIND 21060 - -struct boss_thekalAI : public ScriptedAI -{ - boss_thekalAI(Creature *c) : ScriptedAI(c) - { - m_pInstance = c->GetInstanceData(); - } - - uint32 MortalCleave_Timer; - uint32 Silence_Timer; - uint32 Frenzy_Timer; - uint32 ForcePunch_Timer; - uint32 Charge_Timer; - uint32 Enrage_Timer; - uint32 SummonTigers_Timer; - uint32 Check_Timer; - uint32 Resurrect_Timer; - - ScriptedInstance *m_pInstance; - bool Enraged; - bool PhaseTwo; - bool WasDead; - - void Reset() - { - MortalCleave_Timer = 4000; - Silence_Timer = 9000; - Frenzy_Timer = 30000; - ForcePunch_Timer = 4000; - Charge_Timer = 12000; - Enrage_Timer = 32000; - SummonTigers_Timer = 25000; - Check_Timer = 10000; - Resurrect_Timer = 10000; - - Enraged = false; - PhaseTwo = false; - WasDead = false; - } - - void EnterCombat(Unit * /*who*/) - { - DoScriptText(SAY_AGGRO, me); - } - - void JustDied(Unit* /*Killer*/) - { - DoScriptText(SAY_DEATH, me); - if (m_pInstance) - m_pInstance->SetData(TYPE_THEKAL, DONE); - } - - void JustReachedHome() - { - if (m_pInstance) - m_pInstance->SetData(TYPE_THEKAL, NOT_STARTED); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //Check_Timer for the death of LorKhan and Zath. - if (!WasDead && Check_Timer <= diff) - { - if (m_pInstance) - { - if (m_pInstance->GetData(TYPE_LORKHAN) == SPECIAL) - { - //Resurrect LorKhan - if (Unit *pLorKhan = Unit::GetUnit((*me), m_pInstance->GetData64(DATA_LORKHAN))) - { - pLorKhan->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - pLorKhan->setFaction(14); - pLorKhan->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - pLorKhan->SetHealth(int(pLorKhan->GetMaxHealth()*1.0)); - - m_pInstance->SetData(TYPE_LORKHAN, DONE); - } - } - - if (m_pInstance->GetData(TYPE_ZATH) == SPECIAL) - { - //Resurrect Zath - Unit *pZath = Unit::GetUnit((*me), m_pInstance->GetData64(DATA_ZATH)); - if (pZath) - { - pZath->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - pZath->setFaction(14); - pZath->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - pZath->SetHealth(int(pZath->GetMaxHealth()*1.0)); - - m_pInstance->SetData(TYPE_ZATH, DONE); - } - } - } - - Check_Timer = 5000; - } else Check_Timer -= diff; - - if (!PhaseTwo && MortalCleave_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_MORTALCLEAVE); - MortalCleave_Timer = 15000 + rand()%5000; - } else MortalCleave_Timer -= diff; - - if (!PhaseTwo && Silence_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SILENCE); - Silence_Timer = 20000 + rand()%5000; - } else Silence_Timer -= diff; - - if (!PhaseTwo && !WasDead && me->GetHealth() <= me->GetMaxHealth() * 0.05) - { - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetStandState(UNIT_STAND_STATE_SLEEP); - me->AttackStop(); - - if (m_pInstance) - m_pInstance->SetData(TYPE_THEKAL, SPECIAL); - - WasDead=true; - } - - //Thekal will transform to Tiger if he died and was not resurrected after 10 seconds. - if (!PhaseTwo && WasDead) - { - if (Resurrect_Timer <= diff) - { - DoCast(me, SPELL_TIGER_FORM); - me->SetFloatValue(OBJECT_FIELD_SCALE_X, 2.00f); - me->SetStandState(UNIT_STAND_STATE_STAND); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetHealth(int(me->GetMaxHealth()*1.0)); - const CreatureInfo *cinfo = me->GetCreatureInfo(); - me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 40))); - me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 40))); - me->UpdateDamagePhysical(BASE_ATTACK); - DoResetThreat(); - PhaseTwo = true; - } else Resurrect_Timer -= diff; - } - - if ((me->GetHealth()*100 / me->GetMaxHealth() == 100) && WasDead) - { - WasDead = false; - } - - if (PhaseTwo) - { - if (Charge_Timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) - { - DoCast(pTarget, SPELL_CHARGE); - DoResetThreat(); - AttackStart(pTarget); - } - - Charge_Timer = 15000 + rand()%7000; - } else Charge_Timer -= diff; - - if (Frenzy_Timer <= diff) - { - DoCast(me, SPELL_FRENZY); - Frenzy_Timer = 30000; - } else Frenzy_Timer -= diff; - - if (ForcePunch_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SILENCE); - ForcePunch_Timer = 16000 + rand()%5000; - } else ForcePunch_Timer -= diff; - - if (SummonTigers_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SUMMONTIGERS); - SummonTigers_Timer = 10000 + rand()%4000; - } else SummonTigers_Timer -= diff; - - if ((me->GetHealth()*100 / me->GetMaxHealth() < 11) && !Enraged) - { - DoCast(me, SPELL_ENRAGE); - Enraged = true; - } - } - - DoMeleeAttackIfReady(); - - } -}; - -//Zealot Lor'Khan -struct mob_zealot_lorkhanAI : public ScriptedAI -{ - mob_zealot_lorkhanAI(Creature *c) : ScriptedAI(c) - { - m_pInstance = c->GetInstanceData(); - } - - uint32 Shield_Timer; - uint32 BloodLust_Timer; - uint32 GreaterHeal_Timer; - uint32 Disarm_Timer; - uint32 Check_Timer; - - bool FakeDeath; - - ScriptedInstance *m_pInstance; - - void Reset() - { - Shield_Timer = 1000; - BloodLust_Timer = 16000; - GreaterHeal_Timer = 32000; - Disarm_Timer = 6000; - Check_Timer = 10000; - - FakeDeath = false; - - if (m_pInstance) - m_pInstance->SetData(TYPE_LORKHAN, NOT_STARTED); - - me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - } - - void EnterCombat(Unit * /*who*/) - { - } - - void UpdateAI (const uint32 diff) - { - if (!UpdateVictim()) - return; - - //Shield_Timer - if (Shield_Timer <= diff) - { - DoCast(me, SPELL_SHIELD); - Shield_Timer = 61000; - } else Shield_Timer -= diff; - - //BloodLust_Timer - if (BloodLust_Timer <= diff) - { - DoCast(me, SPELL_BLOODLUST); - BloodLust_Timer = 20000+rand()%8000; - } else BloodLust_Timer -= diff; - - //Casting Greaterheal to Thekal or Zath if they are in meele range. - if (GreaterHeal_Timer <= diff) - { - if (m_pInstance) - { - Unit *pThekal = Unit::GetUnit((*me), m_pInstance->GetData64(DATA_THEKAL)); - Unit *pZath = Unit::GetUnit((*me), m_pInstance->GetData64(DATA_ZATH)); - - if (!pThekal || !pZath) - return; - - switch (urand(0,1)) - { - case 0: - if (me->IsWithinMeleeRange(pThekal)) - DoCast(pThekal, SPELL_GREATERHEAL); - break; - case 1: - if (me->IsWithinMeleeRange(pZath)) - DoCast(pZath, SPELL_GREATERHEAL); - break; - } - } - - GreaterHeal_Timer = 15000+rand()%5000; - } else GreaterHeal_Timer -= diff; - - //Disarm_Timer - if (Disarm_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_DISARM); - Disarm_Timer = 15000+rand()%10000; - } else Disarm_Timer -= diff; - - //Check_Timer for the death of LorKhan and Zath. - if (!FakeDeath && Check_Timer <= diff) - { - if (m_pInstance) - { - if (m_pInstance->GetData(TYPE_THEKAL) == SPECIAL) - { - //Resurrect Thekal - if (Unit *pThekal = Unit::GetUnit((*me), m_pInstance->GetData64(DATA_THEKAL))) - { - pThekal->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - pThekal->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - pThekal->setFaction(14); - pThekal->SetHealth(int(pThekal->GetMaxHealth()*1.0)); - } - } - - if (m_pInstance->GetData(TYPE_ZATH) == SPECIAL) - { - //Resurrect Zath - if (Unit *pZath = Unit::GetUnit((*me), m_pInstance->GetData64(DATA_ZATH))) - { - pZath->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - pZath->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - pZath->setFaction(14); - pZath->SetHealth(int(pZath->GetMaxHealth()*1.0)); - } - } - } - - Check_Timer = 5000; - } else Check_Timer -= diff; - - if (me->GetHealth() <= me->GetMaxHealth() * 0.05) - { - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetStandState(UNIT_STAND_STATE_SLEEP); - me->setFaction(35); - me->AttackStop(); - - if (m_pInstance) - m_pInstance->SetData(TYPE_LORKHAN, SPECIAL); - - FakeDeath = true; - } - - DoMeleeAttackIfReady(); - } -}; - -//Zealot Zath -struct mob_zealot_zathAI : public ScriptedAI -{ - mob_zealot_zathAI(Creature *c) : ScriptedAI(c) - { - m_pInstance = c->GetInstanceData(); - } - - uint32 SweepingStrikes_Timer; - uint32 SinisterStrike_Timer; - uint32 Gouge_Timer; - uint32 Kick_Timer; - uint32 Blind_Timer; - uint32 Check_Timer; - - bool FakeDeath; - - ScriptedInstance *m_pInstance; - - void Reset() - { - SweepingStrikes_Timer = 13000; - SinisterStrike_Timer = 8000; - Gouge_Timer = 25000; - Kick_Timer = 18000; - Blind_Timer = 5000; - Check_Timer = 10000; - - FakeDeath = false; - - if (m_pInstance) - m_pInstance->SetData(TYPE_ZATH, NOT_STARTED); - - me->SetStandState(UNIT_STAND_STATE_STAND); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - } - - void EnterCombat(Unit * /*who*/) - { - } - - void UpdateAI (const uint32 diff) - { - if (!UpdateVictim()) - return; - - //SweepingStrikes_Timer - if (SweepingStrikes_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SWEEPINGSTRIKES); - SweepingStrikes_Timer = 22000+rand()%4000; - } else SweepingStrikes_Timer -= diff; - - //SinisterStrike_Timer - if (SinisterStrike_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SINISTERSTRIKE); - SinisterStrike_Timer = 8000+rand()%8000; - } else SinisterStrike_Timer -= diff; - - //Gouge_Timer - if (Gouge_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_GOUGE); - - if (DoGetThreat(me->getVictim())) - DoModifyThreatPercent(me->getVictim(),-100); - - Gouge_Timer = 17000+rand()%10000; - } else Gouge_Timer -= diff; - - //Kick_Timer - if (Kick_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_KICK); - Kick_Timer = 15000+rand()%10000; - } else Kick_Timer -= diff; - - //Blind_Timer - if (Blind_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_BLIND); - Blind_Timer = 10000+rand()%10000; - } else Blind_Timer -= diff; - - //Check_Timer for the death of LorKhan and Zath. - if (!FakeDeath && Check_Timer <= diff) - { - if (m_pInstance) - { - if (m_pInstance->GetData(TYPE_LORKHAN) == SPECIAL) - { - //Resurrect LorKhan - if (Unit *pLorKhan = Unit::GetUnit((*me), m_pInstance->GetData64(DATA_LORKHAN))) - { - pLorKhan->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - pLorKhan->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - pLorKhan->setFaction(14); - pLorKhan->SetHealth(int(pLorKhan->GetMaxHealth()*1.0)); - } - } - - if (m_pInstance->GetData(TYPE_THEKAL) == SPECIAL) - { - //Resurrect Thekal - if (Unit *pThekal = Unit::GetUnit((*me), m_pInstance->GetData64(DATA_THEKAL))) - { - pThekal->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - pThekal->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - pThekal->setFaction(14); - pThekal->SetHealth(int(pThekal->GetMaxHealth()*1.0)); - } - } - } - - Check_Timer = 5000; - } else Check_Timer -= diff; - - if (me->GetHealth() <= me->GetMaxHealth() * 0.05) - { - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetStandState(UNIT_STAND_STATE_SLEEP); - me->setFaction(35); - me->AttackStop(); - - if (m_pInstance) - m_pInstance->SetData(TYPE_ZATH, SPECIAL); - - FakeDeath = true; - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_thekal(Creature* pCreature) -{ - return new boss_thekalAI (pCreature); -} - -CreatureAI* GetAI_mob_zealot_lorkhan(Creature* pCreature) -{ - return new mob_zealot_lorkhanAI (pCreature); -} - -CreatureAI* GetAI_mob_zealot_zath(Creature* pCreature) -{ - return new mob_zealot_zathAI (pCreature); -} - -void AddSC_boss_thekal() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "boss_thekal"; - newscript->GetAI = &GetAI_boss_thekal; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_zealot_lorkhan"; - newscript->GetAI = &GetAI_mob_zealot_lorkhan; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_zealot_zath"; - newscript->GetAI = &GetAI_mob_zealot_zath; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/zulgurub/boss_venoxis.cpp b/src/server/scripts/EasternKingdoms/zulgurub/boss_venoxis.cpp deleted file mode 100644 index ec1a7a142b5..00000000000 --- a/src/server/scripts/EasternKingdoms/zulgurub/boss_venoxis.cpp +++ /dev/null @@ -1,199 +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_Venoxis -SD%Complete: 100 -SDComment: -SDCategory: Zul'Gurub -EndScriptData */ - -#include "ScriptedPch.h" -#include "zulgurub.h" - -#define SAY_TRANSFORM -1309000 -#define SAY_DEATH -1309001 - -#define SPELL_HOLY_FIRE 23860 -#define SPELL_HOLY_WRATH 28883 //Not sure if this or 23979 -#define SPELL_VENOMSPIT 23862 -#define SPELL_HOLY_NOVA 23858 -#define SPELL_POISON_CLOUD 23861 -#define SPELL_SNAKE_FORM 23849 -#define SPELL_RENEW 23895 -#define SPELL_BERSERK 23537 -#define SPELL_DISPELL 23859 - -struct boss_venoxisAI : public ScriptedAI -{ - boss_venoxisAI(Creature *c) : ScriptedAI(c) - { - m_pInstance = c->GetInstanceData(); - } - - ScriptedInstance *m_pInstance; - - uint32 HolyFire_Timer; - uint32 HolyWrath_Timer; - uint32 VenomSpit_Timer; - uint32 Renew_Timer; - uint32 PoisonCloud_Timer; - uint32 HolyNova_Timer; - uint32 Dispell_Timer; - uint32 TargetInRange; - - bool PhaseTwo; - bool InBerserk; - - void Reset() - { - HolyFire_Timer = 10000; - HolyWrath_Timer = 60500; - VenomSpit_Timer = 5500; - Renew_Timer = 30500; - PoisonCloud_Timer = 2000; - HolyNova_Timer = 5000; - Dispell_Timer = 35000; - TargetInRange = 0; - - PhaseTwo = false; - InBerserk= false; - } - - void EnterCombat(Unit * /*who*/) - { - } - - void JustDied(Unit* /*Killer*/) - { - DoScriptText(SAY_DEATH, me); - if (m_pInstance) - m_pInstance->SetData(TYPE_VENOXIS, DONE); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if ((me->GetHealth()*100 / me->GetMaxHealth() > 50)) - { - if (Dispell_Timer <= diff) - { - DoCast(me, SPELL_DISPELL); - Dispell_Timer = 15000 + rand()%15000; - } else Dispell_Timer -= diff; - - if (Renew_Timer <= diff) - { - DoCast(me, SPELL_RENEW); - Renew_Timer = 20000 + rand()%10000; - } else Renew_Timer -= diff; - - if (HolyWrath_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_HOLY_WRATH); - HolyWrath_Timer = 15000 + rand()%10000; - } else HolyWrath_Timer -= diff; - - if (HolyNova_Timer <= diff) - { - TargetInRange = 0; - for (uint8 i = 0; i < 10; ++i) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO,i)) - if (me->IsWithinMeleeRange(pTarget)) - ++TargetInRange; - } - - if (TargetInRange > 1) - { - DoCast(me->getVictim(), SPELL_HOLY_NOVA); - HolyNova_Timer = 1000; - } - else - { - HolyNova_Timer = 2000; - } - - } else HolyNova_Timer -= diff; - - if (HolyFire_Timer < diff && TargetInRange < 3) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(pTarget, SPELL_HOLY_FIRE); - - HolyFire_Timer = 8000; - } else HolyFire_Timer -= diff; - } - else - { - if (!PhaseTwo) - { - DoScriptText(SAY_TRANSFORM, me); - me->InterruptNonMeleeSpells(false); - DoCast(me, SPELL_SNAKE_FORM); - me->SetFloatValue(OBJECT_FIELD_SCALE_X, 2.00f); - const CreatureInfo *cinfo = me->GetCreatureInfo(); - me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 25))); - me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 25))); - me->UpdateDamagePhysical(BASE_ATTACK); - DoResetThreat(); - PhaseTwo = true; - } - - if (PhaseTwo && PoisonCloud_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_POISON_CLOUD); - PoisonCloud_Timer = 15000; - }PoisonCloud_Timer -=diff; - - if (PhaseTwo && VenomSpit_Timer <= diff) - { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(pTarget, SPELL_VENOMSPIT); - - VenomSpit_Timer = 15000 + rand()%5000; - } else VenomSpit_Timer -= diff; - - if (PhaseTwo && (me->GetHealth()*100 / me->GetMaxHealth() < 11)) - { - if (!InBerserk) - { - me->InterruptNonMeleeSpells(false); - DoCast(me, SPELL_BERSERK); - InBerserk = true; - } - } - } - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_venoxis(Creature* pCreature) -{ - return new boss_venoxisAI (pCreature); -} - -void AddSC_boss_venoxis() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_venoxis"; - newscript->GetAI = &GetAI_boss_venoxis; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/zulgurub/boss_wushoolay.cpp b/src/server/scripts/EasternKingdoms/zulgurub/boss_wushoolay.cpp deleted file mode 100644 index a71d7e0504a..00000000000 --- a/src/server/scripts/EasternKingdoms/zulgurub/boss_wushoolay.cpp +++ /dev/null @@ -1,85 +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_Wushoolay -SD%Complete: 100 -SDComment: -SDCategory: Zul'Gurub -EndScriptData */ - -#include "ScriptedPch.h" -#include "zulgurub.h" - -#define SPELL_LIGHTNINGCLOUD 25033 -#define SPELL_LIGHTNINGWAVE 24819 - -struct boss_wushoolayAI : public ScriptedAI -{ - boss_wushoolayAI(Creature *c) : ScriptedAI(c) {} - - uint32 LightningCloud_Timer; - uint32 LightningWave_Timer; - - void Reset() - { - LightningCloud_Timer = 5000 + rand()%5000; - LightningWave_Timer = 8000 + rand()%8000; - } - - void EnterCombat(Unit * /*who*/) - { - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //LightningCloud_Timer - if (LightningCloud_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_LIGHTNINGCLOUD); - LightningCloud_Timer = 15000 + rand()%5000; - } else LightningCloud_Timer -= diff; - - //LightningWave_Timer - if (LightningWave_Timer <= diff) - { - Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); - if (pTarget) DoCast(pTarget, SPELL_LIGHTNINGWAVE); - - LightningWave_Timer = 12000 + rand()%4000; - } else LightningWave_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_wushoolay(Creature* pCreature) -{ - return new boss_wushoolayAI (pCreature); -} - -void AddSC_boss_wushoolay() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_wushoolay"; - newscript->GetAI = &GetAI_boss_wushoolay; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/zulgurub/instance_zulgurub.cpp b/src/server/scripts/EasternKingdoms/zulgurub/instance_zulgurub.cpp deleted file mode 100644 index aaed1c6df3a..00000000000 --- a/src/server/scripts/EasternKingdoms/zulgurub/instance_zulgurub.cpp +++ /dev/null @@ -1,159 +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_ZulGurub -SD%Complete: 80 -SDComment: Missing reset function after killing a boss for Ohgan, Thekal. -SDCategory: Zul'Gurub -EndScriptData */ - -#include "ScriptedPch.h" -#include "zulgurub.h" - -struct instance_zulgurub : public ScriptedInstance -{ - instance_zulgurub(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - //If all High Priest bosses were killed. Lorkhan, Zath and Ohgan are added too. - uint32 m_auiEncounter[MAX_ENCOUNTERS]; - - //Storing Lorkhan, Zath and Thekal because we need to cast on them later. Jindo is needed for healfunction too. - uint64 m_uiLorKhanGUID; - uint64 m_uiZathGUID; - uint64 m_uiThekalGUID; - uint64 m_uiJindoGUID; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - m_uiLorKhanGUID = 0; - m_uiZathGUID = 0; - m_uiThekalGUID = 0; - m_uiJindoGUID = 0; - } - - bool IsEncounterInProgress() const - { - //not active in Zul'Gurub - return false; - } - - void OnCreatureCreate(Creature* pCreature) - { - switch(pCreature->GetEntry()) - { - case 11347: m_uiLorKhanGUID = pCreature->GetGUID(); break; - case 11348: m_uiZathGUID = pCreature->GetGUID(); break; - case 14509: m_uiThekalGUID = pCreature->GetGUID(); break; - case 11380: m_uiJindoGUID = pCreature->GetGUID(); break; - } - } - - void SetData(uint32 uiType, uint32 uiData) - { - switch(uiType) - { - case TYPE_ARLOKK: - m_auiEncounter[0] = uiData; - break; - - case TYPE_JEKLIK: - m_auiEncounter[1] = uiData; - break; - - case TYPE_VENOXIS: - m_auiEncounter[2] = uiData; - break; - - case TYPE_MARLI: - m_auiEncounter[3] = uiData; - break; - - case TYPE_THEKAL: - m_auiEncounter[4] = uiData; - break; - - case TYPE_LORKHAN: - m_auiEncounter[5] = uiData; - break; - - case TYPE_ZATH: - m_auiEncounter[6] = uiData; - break; - - case TYPE_OHGAN: - m_auiEncounter[7] = uiData; - break; - } - } - - uint32 GetData(uint32 uiType) - { - switch(uiType) - { - case TYPE_ARLOKK: - return m_auiEncounter[0]; - case TYPE_JEKLIK: - return m_auiEncounter[1]; - case TYPE_VENOXIS: - return m_auiEncounter[2]; - case TYPE_MARLI: - return m_auiEncounter[3]; - case TYPE_THEKAL: - return m_auiEncounter[4]; - case TYPE_LORKHAN: - return m_auiEncounter[5]; - case TYPE_ZATH: - return m_auiEncounter[6]; - case TYPE_OHGAN: - return m_auiEncounter[7]; - } - return 0; - } - - uint64 GetData64(uint32 uiData) - { - switch(uiData) - { - case DATA_LORKHAN: - return m_uiLorKhanGUID; - case DATA_ZATH: - return m_uiZathGUID; - case DATA_THEKAL: - return m_uiThekalGUID; - case DATA_JINDO: - return m_uiJindoGUID; - } - return 0; - } -}; - -InstanceData* GetInstanceData_instance_zulgurub(Map* pMap) -{ - return new instance_zulgurub(pMap); -} - -void AddSC_instance_zulgurub() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_zulgurub"; - newscript->GetInstanceData = &GetInstanceData_instance_zulgurub; - newscript->RegisterSelf(); -} - diff --git a/src/server/scripts/EasternKingdoms/zulgurub/zulgurub.h b/src/server/scripts/EasternKingdoms/zulgurub/zulgurub.h deleted file mode 100644 index bf55a54c1d5..00000000000 --- a/src/server/scripts/EasternKingdoms/zulgurub/zulgurub.h +++ /dev/null @@ -1,28 +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_ZULGURUB_H -#define DEF_ZULGURUB_H - -enum eTypes -{ - MAX_ENCOUNTERS = 8, - - TYPE_ARLOKK = 1, - TYPE_JEKLIK = 2, - TYPE_VENOXIS = 3, - TYPE_MARLI = 4, - TYPE_OHGAN = 5, - TYPE_THEKAL = 6, - TYPE_ZATH = 7, - TYPE_LORKHAN = 8, - - DATA_JINDO = 10, - DATA_LORKHAN = 11, - DATA_THEKAL = 12, - DATA_ZATH = 13 -}; - -#endif - -- cgit v1.2.3